diff options
Diffstat (limited to 'source/l/popt/popt.SlackBuild')
-rwxr-xr-x | source/l/popt/popt.SlackBuild | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/source/l/popt/popt.SlackBuild b/source/l/popt/popt.SlackBuild index 4e01dd52..b495de5c 100755 --- a/source/l/popt/popt.SlackBuild +++ b/source/l/popt/popt.SlackBuild @@ -23,15 +23,22 @@ PKGNAM=popt VERSION=${VERSION:-1.7} -ARCH=${ARCH:-x86_64} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} +NUMJOBS=${NUMJOBS:-" -j7 "} + +# Automatically determine architecture for build & packaging: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-${PKGNAM} -rm -rf $PKG -mkdir -p $TMP $PKG if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" @@ -42,8 +49,13 @@ elif [ "$ARCH" = "s390" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi +rm -rf $PKG +mkdir -p $TMP $PKG cd $TMP rm -rf ${PKGNAM}-${VERSION} tar xjvf $CWD/${PKGNAM}-$VERSION.tar.bz2 || exit 1 @@ -69,15 +81,23 @@ CFLAGS="$SLKCFLAGS" \ --build=$ARCH-slackware-linux # Build and install: -make -j4 || exit 1 +make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 -# Strip binaries: -( cd $PKG - find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null - find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +# Move the binary and shared library to /sbin and /lib(64) +mkdir -p $PKG/lib${LIBDIRSUFFIX} +( cd $PKG/usr/lib${LIBDIRSUFFIX} + for file in lib*.so.?.* ; do + mv $file ../../lib${LIBDIRSUFFIX} + ln -sf ../../lib${LIBDIRSUFFIX}/$file . + done + cp -a lib*.so.? ../../lib${LIBDIRSUFFIX} ) +# Strip binaries: +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + # Compress and link manpages, if any: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man |