#!/bin/sh # Set initial variables: CWD=`pwd` VERSION=2.12a ARCH=${ARCH:-i486} BUILD=2 TMP=/tmp/util-linux-$VERSION if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi PKG=/tmp/package-util-linux rm -r $PKG mkdir -p $PKG # Explode the package framework: cd $PKG explodepkg $CWD/_util-linux.tar.gz echo "+================+" echo "| net-tools-1.60 |" echo "+================+" cd $TMP rm -rf net-tools-1.60 tar xjvf $CWD/net-tools-1.60.tar.bz2 cd net-tools-1.60 zcat $CWD/net-tools.diff.gz | patch -p1 make strip hostname cat hostname > $PKG/bin/hostname cd man/en_US for page in hostname.1 dnsdomainname.1 nisdomainname.1 ypdomainname.1 \ domainname.1 ; do cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz done echo "+================+" echo "| setserial-2.17 |" echo "+================+" cd $TMP rm -rf setserial-2.17 tar xzvf $CWD/setserial-2.17.tar.gz cd setserial-2.17 zcat $CWD/setserial-rc.serial.diff.gz | patch -E -p1 --verbose ./configure --prefix=/usr make strip setserial cat setserial > $PKG/sbin/setserial cat rc.serial > $PKG/etc/rc.d/rc.serial cat serial.conf > $PKG/etc/serial.conf cat setserial.8 | gzip -9c > $PKG/usr/man/man8/setserial.8.gz echo "+============+" echo "| bsdstrings |" echo "+============+" cd $TMP rm -rf bsdstrings tar xzvf $CWD/bsdstrings.tar.gz cd bsdstrings make strip strings cat strings > $PKG/usr/bin/strings cat strings.1 | gzip -9c > $PKG/usr/man/man1/strings.1.gz echo "+==========+" echo "| adjtimex |" echo "+==========+" cd $TMP rm -rf adjtimex-1.13 tar xzvf $CWD/adjtimex-1.13.tar.gz cd adjtimex-1.13 zcat $CWD/adjtimex.diff.gz | patch -p1 chown -R root.root . CFLAGS=-O2 ./configure --prefix=/usr make strip adjtimex cat adjtimex > $PKG/sbin/adjtimex chmod 755 $PKG/sbin/adjtimex chown root.bin $PKG/sbin/adjtimex cat adjtimex.8 | gzip -9c > $PKG/usr/man/man8/adjtimex.8.gz mkdir -p $PKG/usr/doc/adjtimex-1.13 cp -a \ COPYING COPYRIGHT ChangeLog README README.ru adjtimex.lsm \ $PKG/usr/doc/adjtimex-1.13 echo "+==================+" echo "| util-linux-$VERSION |" echo "+==================+" cd $TMP rm -rf util-linux-$VERSION tar xjvf $CWD/util-linux-$VERSION.tar.bz2 cd util-linux-$VERSION chown -R root.root . zcat $CWD/util-linux.MCONFIG.diff.gz | patch -E --backup -p1 --suffix=.orig # We're finally going to cave to this one and make the setup tools grok # "Linux" as the partition type instead of "Linux native". #zcat $CWD/util-linux.fdisk.diff.gz | patch -E --backup -p0 --suffix=.orig # Fix a security hole with umount where using '-r' results in flags like nosuid # being dropped if the umount fails: zcat $CWD/umount.remount.diff.gz | patch -E --backup -p1 --suffix=.orig || exit ./configure make cat sys-utils/arch > $PKG/bin/arch cat sys-utils/dmesg > $PKG/bin/dmesg cat getopt/getopt > $PKG/bin/getopt cat misc-utils/mcookie > $PKG/usr/bin/mcookie cat misc-utils/rename > $PKG/usr/bin/rename #cat misc-utils/hostname > $PKG/bin/hostname cat misc-utils/kill > $PKG/bin/kill #cat login-utils/login > $PKG/bin/login cat text-utils/more > $PKG/bin/more cat text-utils/line > $PKG/usr/bin/line cat text-utils/pg > $PKG/usr/bin/pg cat mount/mount > $PKG/bin/mount cat mount/umount > $PKG/bin/umount cat mount/losetup > $PKG/sbin/losetup cat mount/pivot_root > $PKG/sbin/pivot_root #cat sys-utils/setserial > $PKG/bin/setserial cat misc-utils/setterm > $PKG/bin/setterm cat sys-utils/sln > $PKG/bin/sln #cat sys-utils/sync > $PKG/bin/sync cat login-utils/agetty > $PKG/sbin/agetty #cat login-utils/chfn > $PKG/usr/bin/chfn #cat bdflush > $PKG/sbin/bdflush #cat sys-utils/clock > $PKG/sbin/clock cat hwclock/hwclock > $PKG/sbin/hwclock cat fdisk/fdisk > $PKG/sbin/fdisk cat fdisk/sfdisk > $PKG/usr/sbin/sfdisk #cat fsck > $PKG/sbin/fsck cat disk-utils/fsck.minix > $PKG/sbin/fsck.minix cat disk-utils/fsck.cramfs > $PKG/sbin/fsck.cramfs cat disk-utils/raw > $PKG/usr/bin/raw cat sys-utils/readprofile > $PKG/usr/bin/readprofile cat disk-utils/blockdev > $PKG/sbin/blockdev cat disk-utils/elvtune > $PKG/sbin/elvtune cat disk-utils/mkfs.bfs > $PKG/sbin/mkfs.bfs cat disk-utils/mkfs.cramfs > $PKG/sbin/mkfs.cramfs cat disk-utils/mkfs.minix > $PKG/sbin/mkfs.minix cat disk-utils/mkfs > $PKG/sbin/mkfs cat disk-utils/mkswap > $PKG/sbin/mkswap cat sys-utils/rdev > $PKG/sbin/rdev cat mount/swapon > $PKG/sbin/swapon cat misc-utils/cal > $PKG/usr/bin/cal #cat login-utils/chsh > $PKG/usr/bin/chsh #cat clear > $PKG/usr/bin/clear cat text-utils/col > $PKG/usr/bin/col cat text-utils/colcrt > $PKG/usr/bin/colcrt cat text-utils/colrm > $PKG/usr/bin/colrm cat text-utils/column > $PKG/usr/bin/column cat misc-utils/ddate > $PKG/usr/bin/ddate cat disk-utils/fdformat > $PKG/usr/bin/fdformat cat text-utils/hexdump > $PKG/usr/bin/hexdump #cat misc-utils/hostid > $PKG/usr/bin/hostid cat sys-utils/ipcrm > $PKG/usr/bin/ipcrm cat disk-utils/isosize > $PKG/usr/bin/isosize cat sys-utils/cytune > $PKG/usr/bin/cytune cat sys-utils/ipcs > $PKG/usr/bin/ipcs #cat login-utils/last > $PKG/usr/bin/last cat misc-utils/logger > $PKG/usr/bin/logger cat misc-utils/look > $PKG/usr/bin/look cat login-utils/mesg > $PKG/usr/bin/mesg cat misc-utils/namei > $PKG/usr/bin/namei #cat login-utils/newgrp > $PKG/usr/bin/newgrp #cat login-utils/passwd > $PKG/usr/bin/passwd #cat login-utils/vipw > $PKG/usr/sbin/vipw cat sys-utils/renice > $PKG/usr/bin/renice cat misc-utils/reset.sh > $PKG/usr/bin/reset cat text-utils/rev > $PKG/usr/bin/rev cat misc-utils/script > $PKG/usr/bin/script cat disk-utils/setfdprm > $PKG/usr/bin/setfdprm cat sys-utils/setsid > $PKG/usr/bin/setsid #cat text-utils/strings > $PKG/usr/bin/strings #cat misc-utils/tsort > $PKG/usr/bin/tsort cat sys-utils/tunelp > $PKG/usr/bin/tunelp cat text-utils/ul > $PKG/usr/bin/ul cat login-utils/wall > $PKG/usr/bin/wall cat misc-utils/whereis > $PKG/usr/bin/whereis cat misc-utils/write > $PKG/usr/bin/write cat misc-utils/chkdupexe > $PKG/usr/bin/chkdupexe cat fdisk/cfdisk > $PKG/usr/sbin/cfdisk #cat sys-utils/chroot > $PKG/usr/sbin/chroot cat sys-utils/ctrlaltdel > $PKG/usr/sbin/ctrlaltdel mkdir -p $PKG/usr/info cat sys-utils/ipc.info | gzip -9c > $PKG/usr/info/ipc.info.gz mkdir -p $PKG/usr/share/misc/getopt ( cd getopt cat getopt-parse.bash > $PKG/usr/share/misc/getopt/getopt-parse.bash cat getopt-parse.tcsh > $PKG/usr/share/misc/getopt/getopt-parse.tcsh cat getopt-test.bash > $PKG/usr/share/misc/getopt/getopt-test.bash cat getopt-test.tcsh > $PKG/usr/share/misc/getopt/getopt-test.tcsh ) ( cd po for message in *.gmo ; do mkdir -p $PKG/usr/share/locale/`basename $message .gmo`/LC_MESSAGES cat $message > $PKG/usr/share/locale/`basename $message .gmo`/LC_MESSAGES/util-linux.mo done ) gzip -9c getopt/getopt.1 > $PKG/usr/man/man1/getopt.1.gz for file in sys-utils/arch.1 \ text-utils/more.1 text-utils/line.1 text-utils/pg.1 misc-utils/setterm.1 \ text-utils/col.1 text-utils/colcrt.1 \ text-utils/colrm.1 text-utils/column.1 text-utils/hexdump.1 \ misc-utils/kill.1 misc-utils/logger.1 misc-utils/look.1 \ login-utils/mesg.1 \ misc-utils/rename.1 \ misc-utils/reset.1 text-utils/rev.1 misc-utils/script.1 \ text-utils/ul.1 login-utils/wall.1 misc-utils/whereis.1 \ misc-utils/write.1 misc-utils/namei.1 misc-utils/ddate.1 \ misc-utils/chkdupexe.1 sys-utils/readprofile.1 \ misc-utils/mcookie.1 misc-utils/cal.1 ; do gzip -9c $file > $PKG/usr/man/man1/`basename $file`.gz done #gzip -9c mount/pivot_root.2 > $PKG/usr/man/man2/pivot_root.2.gz gzip -9c mount/fstab.5 > $PKG/usr/man/man5/fstab.5.gz gzip -9c mount/nfs.5 > $PKG/usr/man/man5/nfs.5.gz gzip -9c mount/pivot_root.8 > $PKG/usr/man/man8/pivot_root.8.gz for file in sys-utils/dmesg.8 mount/mount.8 \ mount/losetup.8 mount/umount.8 login-utils/agetty.8 \ hwclock/hwclock.8 sys-utils/rdev.8 \ sys-utils/cytune.8 sys-utils/sln.8 fdisk/fdisk.8 disk-utils/fsck.minix.8 \ disk-utils/blockdev.8 disk-utils/elvtune.8 disk-utils/mkfs.bfs.8 \ disk-utils/isosize.8 disk-utils/raw.8 \ disk-utils/mkfs.minix.8 disk-utils/mkswap.8 \ mount/swapon.8 disk-utils/mkfs.8 disk-utils/fdformat.8 \ sys-utils/ipcrm.8 sys-utils/ipcs.8 sys-utils/renice.8 disk-utils/setfdprm.8 \ sys-utils/setsid.8 sys-utils/tunelp.8 \ sys-utils/ctrlaltdel.8 fdisk/cfdisk.8 fdisk/sfdisk.8 \ sys-utils/ramsize.8 mount/swapoff.8 sys-utils/vidmode.8 \ sys-utils/rootflags.8 ; do gzip -9c $file > $PKG/usr/man/man8/`basename $file`.gz done mkdir -p $PKG/usr/doc/util-linux-$VERSION cp -a \ HISTORY INSTALL hwclock/README* disk-utils/README* fdisk/README* login-utils/README* misc-utils/README* mount/README* text-utils/README* text-utils/LICENSE* \ $PKG/usr/doc/util-linux-$VERSION cp -a getopt/README $PKG/usr/doc/util-linux-$VERSION/README.getopt-1.1.3 chmod 644 $PKG/usr/doc/util-linux-$VERSION/* echo "+==============+" echo "| updated-2.11 |" echo "+==============+" cd $TMP rm -rf updated-2.11 tar xzvf $CWD/updated-2.11.tar.gz cd updated-2.11 mkdir -p $PKG/usr/doc/updated-2.11 cp -a update.lsm $PKG/usr/doc/updated-2.11 chmod 644 $PKG/usr/doc/updated-2.11/update.lsm chown root.root $PKG/usr/doc/updated-2.11/update.lsm make strip update cat update > $PKG/sbin/update cat update.8 | gzip -9c > $PKG/usr/man/man8/update.8.gz echo "+=============+" echo "| ziptool-1.3 |" echo "+=============+" cd $TMP rm -rf ziptool-1.3 tar xzvf $CWD/ziptool-1.3.tar.gz cd ziptool-1.3 make strip ziptool cat ziptool > $PKG/sbin/ziptool mkdir -p $PKG/usr/doc/ziptool-1.3 cp -a README $PKG/usr/doc/ziptool-1.3 chown root.root $PKG/usr/doc/ziptool-1.3/* chmod 644 $PKG/usr/doc/ziptool-1.3/* cat ziptool.1.gz > $PKG/usr/man/man1/ziptool.1.gz # Grab 'tput' from the running system. Hopefully it's new enough, # and we already have source for it in d/ncurses/. This is needed # by the /usr/bin/clear we include. cp -a /usr/bin/tput $PKG/usr/bin/tput ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG makepkg -l y -c n /tmp/util-linux-$VERSION-$ARCH-$BUILD.tgz # a warning for me, because I forget these things cat << EOF ...you might want to check that we grabbed the correct version of /usr/bin/tput, and not some old obsolete thing, ok? :) EOF # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/adjtimex-1.13 rm -rf $TMP/bsdstrings rm -rf $TMP/util-linux-$VERSION rm -rf $TMP/net-tools-1.60 rm -rf $TMP/update-1.2 rm -rf $TMP/setserial-2.17 rm -rf $TMP/ziptool-1.3 rm -rf $PKG fi