#!/bin/bash # procps.SlackBuild # by Stuart Winter for Slackware ARM # Heavily based on the original Slackware build script. # 03-Jun-2004 # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Sometimes this number lags behind: SOVER=3.2.7 PSMISCVER=22.3 # 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) SLKCFLAGS="-march=armv4t" ;; powerpc) SLKCFLAGS="" ;; sparc) SLKCFLAGS="" ;; *) SLKCFLAGS="" ;; esac # Create package framework: mkdir -p $PKG/{lib,bin,sbin,usr/bin,usr/man/man{1,5,8}} \ $PKG/usr/doc/{psmisc-$PSMISCVER,$PKGNAM-$VERSION,procinfo-18} ######## procps ################################################################# echo "Building procps" # Extract source: tar xvvf $CWD/procps-$VERSION.tar.gz cd procps-* || exit 1 slackhousekeeping # Apply patches: zcat $CWD/procps.w.showfrom.diff.gz | patch -p1 --verbose || failpatch # Apply Debian patch set, so we can apply a patch to fix "Unknown HZ value" # on ARM eabi: # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460331 zcat $PORTCWD/sources/*diff* | patch -p1 patch --verbose -p1 < debian/patches/30_sysinfo_7numbers.dpatch || exit 1 # Build: make $NUMJOBS OPT="-O2 $SLKCFLAGS" || failmake # Install binaries: install -m755 free ps/ps $PKG/bin install -m755 proc/libproc-${SOVER}.so $PKG/lib install -m755 tload top uptime vmstat w watch pmap slabtop pkill skill \ $PKG/usr/bin install -m755 sysctl $PKG/sbin # Create symlinks: ( cd $PKG/usr/bin ln -sf pkill pgrep ln -sf skill snice # Just in case ln -sf /bin/free . ln -sf /bin/ps . ) # Install man pages: install -m644 ps/ps.1 free.1 pgrep.1 pkill.1 slabtop.1 skill.1 snice.1 \ tload.1 top.1 uptime.1 w.1 watch.1 \ $PKG/usr/man/man1 install -m644 sysctl.conf.5 $PKG/usr/man/man5 install -m644 vmstat.8 sysctl.8 $PKG/usr/man/man8 # Install docs: cp -a BUGS COPYING COPYING.LIB NEWS TODO \ $PKG/usr/doc/$PKGNAM-$VERSION ########### psmisc ############################################################# echo "Building psmisc" cd $TMPBUILD tar xvvf $CWD/psmisc-$PSMISCVER.tar.gz cd psmisc-$PSMISCVER # Configure & make: CFLAGS="-O2 $SLKCFLAGS" \ ./configure \ --prefix=/usr \ --disable-nls || failconfig make $NUMJOBS || failmake # Install binaries: ( cd src install -m755 pstree fuser $PKG/usr/bin install -m755 killall $PKG/bin ) # Install man pages: ( cd doc install -m644 fuser.1 killall.1 pstree.1 $PKG/usr/man/man1 ) # Install docs: cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README \ $PKG/usr/doc/psmisc-$PSMISCVER ########### procinfo ############################################################# echo "Building procinfo" cd $TMPBUILD # Extract source: tar xvvf $CWD/procinfo-18.tar.gz cd procinfo-* # Apply patches: zcat $CWD/procinfo.gcc3.diff.gz | patch -p1 --backup --suffix=.orig --verbose || failpatch # Build: make $NUMJOBS CFLAGS="-O2 $SLKCFLAGS" || failmake # Install binaries: install -m755 procinfo $PKG/usr/bin install -m755 lsdev.pl $PKG/usr/bin/lsdev install -m755 socklist.pl $PKG/usr/bin/socklist # Install man pages: install -m644 procinfo.8 lsdev.8 socklist.8 $PKG/usr/man/man8 # Install docs: cp -a CHANGES README \ $PKG/usr/doc/procinfo-18 ################################################################### # 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