#!/bin/bash # Slackware build script for gnome-icon-theme # Originally written by Petar Petrov. # Modified and now maintained by B. Watson . # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20240821 bkw: BUILD=2 # - ARCH=noarch. # - extract tarballs to a top-level dir, for easier cleanup. # - factor repeated code into functions (makes the script shorter). # - --disable-nls, to avoid creating 103 empty LC_MESSAGES/ dirs # in /usr/share/locale. There's nothing to translate here. # Oddly, configure complains: # configure: WARNING: unrecognized options: --disable-nls # ...but it actually works anyway (no /usr/share/locale installed). # - funky doinst.sh creation and link removal. speed the build # up 2.26x (was 2m20s, now 1m2s, on my test box). # - add 'install_sh=/bin/install' to make command, which further # cuts the time from 1m2s to 33s (4.24x as fast as the original). # No idea why configure checks for the install command, then doesn't # use it instead of the shipped (and much slower) install-sh script. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=gnome-icon-theme VERSION=${VERSION:-3.12.0} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} ARCH=noarch EXTRAS=$PRGNAM-extras SYMBOL=$PRGNAM-symbolic if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP # 20240820 bkw: put everything in a top-level dir. rm -rf $PRGNAM-build mkdir -p $PRGNAM-build cd $PRGNAM-build TOPDIR=$( pwd ) # 20240821 bkw: --disable-dependency-tracking doesn't speed it up at all. build() { cd $TOPDIR tar xvf $CWD/$1-$VERSION.tar.xz cd $1-$VERSION chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ [ "$2" != "" ] && patch -p1 < $2 ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --enable-icon-mapping \ --disable-nls \ --localstatedir=/var/lib make all install DESTDIR=$PKG install_sh=/bin/install } build $PRGNAM build $EXTRAS build $SYMBOL $CWD/fix_gits_configure.patch # As in the original SlackBuild, we don't want icon caches: find $PKG/usr/share/icons -type f -name "icon-theme.cache" -exec rm -f {} \+ cd $TOPDIR PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION install_doc() { mkdir -p $PKGDOC/$2 cp -a $1-$VERSION/{AUTHORS,COPYING,NEWS,README} $PKGDOC/$2 } install_doc $PRGNAM install_doc $EXTRAS extras install_doc $SYMBOL symbolic cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG # makepkg's "find symlinks and create doinst.sh" phase is painfully slow, # especially when there are thousands of symlinks (this package has 3846 # of them). # This perl script does the same job, *many* times faster. Like, less # than 0.1 sec, compared to makepkg taking over a minute. perl $CWD/findsymlinks.pl >> $PKG/install/doinst.sh /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE