diff options
Diffstat (limited to 'system/upx/upx.SlackBuild')
-rw-r--r-- | system/upx/upx.SlackBuild | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/system/upx/upx.SlackBuild b/system/upx/upx.SlackBuild index 2f139e743f..8e3e17f3e0 100644 --- a/system/upx/upx.SlackBuild +++ b/system/upx/upx.SlackBuild @@ -2,6 +2,7 @@ # Slackware build script for upx +# Copyright 2018 KotCzarny <tjosko@yahoo.com> # Copyright 2010, 2012 Binh Nguyen <binhvng@gmail.com> # All rights reserved. # @@ -23,13 +24,13 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=upx -VERSION=${VERSION:-3.91} +VERSION=${VERSION:-3.94} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -40,36 +41,51 @@ 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 -eu rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION-src -tar xvf $CWD/$PRGNAM-$VERSION-src.tar.bz2 +tar xvf $CWD/$PRGNAM-$VERSION-src.tar.xz cd $PRGNAM-$VERSION-src 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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; + \( -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 {} \; -# Extract LZMA SDK to a proper place for use at build-time -mkdir -p $TMP/lzma465 -tar xvf $CWD/lzma465.tar.bz2 -C $TMP/lzma465 +patch -p1 < "$CWD/upx-0001-fix-check_whitespace.patch" -make UPX_LZMA_VERSION=0x465 UPX_LZMADIR=$TMP/lzma465 all +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +CXXFLAGS_WERROR="" \ +make all install -D src/upx.out $PKG/usr/bin/upx -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ +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 install -D -m 644 doc/upx.1 $PKG/usr/man/man1/upx.1 find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a BUGS COPYING LICENSE NEWS PROJECTS README* THANKS TODO \ +cp -a BUGS COPYING LICENSE NEWS PROJECTS README* THANKS \ doc/*.txt doc/upx.pod \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild |