#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-ps SRC=/devel/manpagesrc INFO=/devel/info-pages/usr/info TEX=/devel/texinfo-docs if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_ps.tar.gz # Function to handle manpage source: man2gz () { # $1 is source page name, $2 is target name for preformatted # output (full path && name) and $3 is the same, but for the # source. mkdir -p `dirname $2` groff -Tascii -mandoc $1 | gzip -9c > $2 if [ ! "$3" = "" ]; then mkdir -p `dirname $3` cat $1 > $3 fi } echo "+==============+" echo "| procps-0.99a |" echo "+==============+" cd $TMP tar xzvf $CWD/procps-0.99a.tar.gz cd procps-0.99a cat $CWD/procps-0.99a-new-kernels.diff | patch -p2 make cat free > $PKG/bin/free cat ps > $PKG/bin/ps cat psupdate > $PKG/sbin/psupdate cat tload > $PKG/usr/bin/tload cat top > $PKG/usr/bin/top cat uptime > $PKG/usr/bin/uptime cat vmstat > $PKG/usr/bin/vmstat cat sessreg > $PKG/usr/bin/sessreg cat w > $PKG/usr/bin/w for page in sessreg.1 free.1 ps.1 tload.1 top.1 uptime.1 w.1 ; do cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz done for page in vmstat.8 psupdate.8 ; do cat $page | gzip -9c > $PKG/usr/man/man8/$page.gz done cd skill cat skill > $PKG/usr/bin/skill cat skill.1 | gzip -9c > $PKG/usr/man/man1/skill.1.gz cd ../psmisc cat fuser > $PKG/usr/bin/fuser cat pstree > $PKG/usr/bin/pstree cat killall > $PKG/bin/killall for page in fuser.1 killall.1 pstree.1 ; do cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz done cd ../xproc cat XConsole > $PKG/usr/X11R6/bin/XConsole cat xload > $PKG/usr/X11R6/bin/xload cat XConsole.man | gzip -9c > /usr/X11R6/man/man1/XConsole.1.gz cat xload.man | gzip -9c > /usr/X11R6/man/man1/xload.1.gz cd ../xcpustate cat xcpustate > $PKG/usr/X11R6/bin/xcpustate cat xcpustate.man | gzip -9c > $PKG/usr/X11R6/man/man1/xcpustate.1.gz # Build the package: cd $PKG tar czvf $TMP/ps.tgz . # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/procps-0.99a rm -rf $PKG fi