Hi folks,
Not being a programmer in any way, shape or form and even unable to write a bash script of any kind, I *have* been able over the years to open a SlackBuild file and change things here and there once in a great while to make it work on/better for my system, simply through a lot of guessing and saves and re-saves over and over in my editor.
I'd really like to have this program of 'ConvertAll' be in the SlackBuilds repository as I honestly believe it's a very helpful program.
Here's my problem though - it's written in python and I'm having a hell of a time getting my SlackBuild to work. At the present point, the build keeps stopping with...
Code:
cp: missing destination file operand after '/tmp/SBo/package-convertall/usr/doc/ConvertAll'
I'm at a loss as to how to fix this, as I've looked at other SlackBuild files in other programs for comparison and I can't find any problem(s).
Here is my SlackBuild for this program below. I've added 'PRGNAM2' because the uncompressed tarball directory isn't the same as the 'PRGNAM' in the tarball name itself (in other words, the tarball is 'convertall-version', but the uncompressed directory name is 'ConvertAll').
If anyone has a moment to look it over and offer a/some suggestions, I'd really be appreciative. As I said, I honestly believe this program could be useful to many people and I simply wanted to try and be able to offer it up in the SlackBuilds repository...I just suck at getting it working is all.
Also, for this project I used the 'python-template.SlackBuild' template, believing this would be best for a 'python' program.
I also commented out line 53 because then it always ended with this...
Code:
Usage:
python install.py [-h] [-p dir] [-d dir] [-t dir] [-i dir] [-b dir] [-x]
where:
-h display this help message
-p dir install prefix [default: /usr/local]
-d dir documentaion dir [default: <prefix>/share/doc/convertall]
-i dir icon dir [default: <prefix>/share/icons/convertall]
-b dir temporary build root for packagers [default: /]
-x skip all dependency checks (risky)
...which confused me even more even though I *did* try some of the different commands such as the 'p' and 'd' which didn't help any.
Anyway, here's my build file...
Code:
PRGNAM=convertall
PRGNAM2=ConvertAll
VERSION=${VERSION:-0.5.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
DOCS=$PRGNAM2/doc "INSTALL LICENSE README.html"
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM2
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
#python install.py --root=$PKG
# Strip binaries and libraries.
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM2
cp -a $DOCS $PKG/usr/doc/$PRGNAM2
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}