#!/bin/bash # apmd.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 20-Sep-2004 # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKCFLAGS="-O2 -march=armv4t" export LIBDIRSUFFIX="" ;; *) export SLKCFLAGS="-O2" ;; esac # Extract source: tar xvvf $CWD/$PKGNAM-$VERSION.tar.bz2 cd $PKGNAM* slackhousekeeping # Build: CFLAGS="$SLKCFLAGS" make $NUMJOBS || failmake # Install into package: CFLAGS="$SLKCFLAGS" make install DESTDIR=$PKG || failinstall ( cd xbattery cp ../.libs/libapm.a .. xmkmf make $NUMJOBS ) # Install binaries: mkdir -pm755 $PKG/usr/bin install -vpm755 xapm xbattery/xbattery $PKG/usr/bin/ # Man pages: mkdir -pm755 $PKG/usr/man/man{1,8} install -vpm644 xbattery/xbattery.man $PKG/usr/man/man1/xbattery.1 install -vpm644 apm.1 apmsleep.1 on_ac_power.1 xapm.1 $PKG/usr/man/man1/ install -vpm644 apmd.8 $PKG/usr/man/man8 mkdir -pm755 $PKG/usr/man/fr/man1 install -vpm644 apmsleep.fr.1 $PKG/usr/man/fr/man1/ # Copy docs: mkdir -pm755 $PKG/usr/doc/$PKGNAM-$VERSION cp -favv AUTHORS COPYING LSM README apmlib.COPYING apmsleep.README \ $PKG/usr/doc/$PKGNAM-$VERSION cp -a xbattery/README $PKG/usr/doc/$PKGNAM-$VERSION/README.xbattery # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links