#!/bin/sh TMP=/tmp PKG=$TMP/package-xscreensaver CWD=`pwd` VERSION=5.02 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} DISTRO=${DISTRO:-slamd64} if [ $DISTRO = slackware ]; then PKGARCH=$ARCH else PKGARCH=${ARCH}_${DISTRO} fi if [ $DISTRO = slamd64 ]; then LIBSUFFIX=64 else LIBSUFFIX= fi if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi rm -rf $PKG cd $TMP rm -rf xscreensaver-$VERSION tar xjvf $CWD/xscreensaver-$VERSION.tar.bz2 cd xscreensaver-$VERSION # Allow xscreensaver to work setgid shadow. I'd rather avoid requiring # setuid root on this if at all possible... zcat $CWD/xscreensaver.setuid.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 chown -R root:root . xml_config=/usr/bin/xml-config xml2_config=/usr/bin/xml2-config \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBSUFFIX \ --mandir=/usr/man \ --with-x-app-defaults=/etc/X11/app-defaults \ --with-shadow \ --with-jpeg \ --with-gl \ --build=$ARCH-$DISTRO-linux # We use '-i' because xscreensaver's NLS support has always been horribly broken make -i -j 12 make -i install_prefix=$PKG install-strip gzip -9 $PKG/usr/man/man?/* chown root:shadow $PKG/usr/bin/xscreensaver chmod 2751 $PKG/usr/bin/xscreensaver # This is needed for the menus: mkdir -p $PKG/usr/share/pixmaps mkdir -p $PKG/etc mkdir -p $PKG/usr/doc/xscreensaver-$VERSION cp -a \ README* \ $PKG/usr/doc/xscreensaver-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/xscreensaver-$VERSION-$PKGARCH-$BUILD.tgz