#!/bin/bash # Slackware build script for xatmas2 # Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # Self-hosted source includes the contents of the xatmas2 and # atmas2-manual git repos, see git2tarxz.sh. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=xatmas2 VERSION=${VERSION:-2.7+20240613_b06cec3} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi 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} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" else SLKCFLAGS="-O2" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.xz cd $PRGNAM-$VERSION chown -R root:root . find . ! -type l -a \ \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \ \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION PKGBIN=$PKG/usr/bin PKGMAN1=$PKG/usr/man/man1 mkdir -p $PKGDOC/examples $PKGBIN $PKGMAN1 sed -i "s,-O3,$SLKCFLAGS," Makefile make DEBUG=" " [ "${TEST:-no}" = "yes" ] && make test 2>&1 | tee > $PKGDOC/maketest.out install -s -m0755 $PRGNAM $PKGBIN cp -a LICENSE README.md atmas2-manual/*.pdf $PKGDOC cp -a tst/*.SRC $PKGDOC/examples cp -a atmas2-manual/README.md $PKGDOC/README-manual.md cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild # man page written by the SlackBuild author gzip -9c < $CWD/$PRGNAM.1 > $PKGMAN1/$PRGNAM.1.gz mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE