diff options
Diffstat (limited to 'source/d/make/make.SlackBuild')
-rwxr-xr-x | source/d/make/make.SlackBuild | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/source/d/make/make.SlackBuild b/source/d/make/make.SlackBuild index 2e70788d..66f60f0b 100755 --- a/source/d/make/make.SlackBuild +++ b/source/d/make/make.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2005-2016 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,27 +23,26 @@ PKGNAM=make VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-4} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) export ARCH=i486 ;; + i?86) export ARCH=i586 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; esac fi +NUMJOBS=${NUMJOBS:-" -j7 "} + CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-make -if [ "$ARCH" = "i386" ]; then - SLKCFLAGS="-O2 -march=i386 -mcpu=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" @@ -70,37 +69,67 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Fix a problem using make-3.82 to build Android: -zcat $CWD/make-3.82-android-build-fix.diff.gz | patch -p1 --verbose || exit 1 - -zcat $CWD/make-3.82-bugfixes.patch.gz | patch -p1 --verbose || exit 1 - +# Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --infodir=/usr/info \ - --build=$ARCH-slackware-linux + --build=$ARCH-slackware-linux || exit 1 -make -j6 || make || exit 1 +# Build and install: +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 ) -gzip -9 $PKG/usr/man/man1/* -rm $PKG/usr/info/dir -gzip -9 $PKG/usr/info/* + +# Compress and link manpages, if any: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1 | grep -v '\.gz$') ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.? + ) + done + ) +fi + +# Compress info files, if any: +if [ -d $PKG/usr/info ]; then + ( cd $PKG/usr/info + rm -f dir + gzip -9 * + ) +fi + # This has been here so long that it should probably stay. # Trying to get rid of ginstall didn't go well, so... :-) ( cd $PKG/usr/bin rm -f gmake ln -sf make gmake ) + mkdir -p $PKG/usr/doc/make-$VERSION cp -a \ - ABOUT-NLS AUTHORS COPYING* NEWS README* \ + AUTHORS COPYING* ChangeLog NEWS README* \ $PKG/usr/doc/make-$VERSION/ + +# If there's a ChangeLog, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r ChangeLog ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog + touch -r ChangeLog $DOCSDIR/ChangeLog +fi + mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc |