diff options
Diffstat (limited to 'doc/build-packages/slackware/cgit-ui.SlackBuild')
-rw-r--r-- | doc/build-packages/slackware/cgit-ui.SlackBuild | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/doc/build-packages/slackware/cgit-ui.SlackBuild b/doc/build-packages/slackware/cgit-ui.SlackBuild new file mode 100644 index 0000000..c356cae --- /dev/null +++ b/doc/build-packages/slackware/cgit-ui.SlackBuild @@ -0,0 +1,92 @@ +#!/bin/bash + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=cgit-ui +VERSION=${VERSION:-$(echo cgit-ui-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-2} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + 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 + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1 +cd $PKGNAM-$VERSION || exit 1 + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -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 {} \+ + +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --with-scriptdir=/srv/www/htdocs/cgit \ + --build=$ARCH-slackware-linux || exit 1 + + +make || exit 1 +make install DESTDIR=$PKG || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mv $PKG/usr/share/man $PKG/usr/ +gzip -9 $PKG/usr/man/man?/* +rmdir $PKG/usr/share/man + +find $PKG/usr/man -type f -exec gzip -9 {} \; + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + ChangeLog LICENSE README README.md doc \ + $PKG/usr/doc/$PKGNAM-$VERSION + +cp -a $CWD/$PKGNAM.info $PKG/usr/doc/$PKGNAM-$VERSION +cp -a $CWD/$PKGNAM.SlackBuild $PKG/usr/doc/$PKGNAM-$VERSION + +# If there's a ChangeLog file, 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/*-$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 + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz |