#!/bin/sh # Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi VERSION=2.12r ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} BUILDDIR=$TMP/util-linux-$VERSION rm -rf $BUILDDIR mkdir -p $BUILDDIR 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 $BUILDDIR 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 || exit zcat $CWD/net-tools_1.60-17.diff.gz | patch -p1 || exit make make hostname 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 # This is supposedly due to be merged into util-linux upstream... echo "+==================+" echo "| schedutils-1.5.0 |" echo "+==================+" cd $BUILDDIR rm -rf schedutils-1.5.0 tar xzvf $CWD/schedutils-1.5.0.tar.gz cd schedutils-1.5.0 make || exit mkdir -p $PKG/usr/bin cp chrt ionice taskset $PKG/usr/bin chmod 755 $PKG/usr/bin/{chrt,ionice,taskset} mkdir -p $PKG/usr/man/man1 ( cd man for file in *.1 ; do cat $file | gzip -9c > $PKG/usr/man/man1/${file}.gz done ) mkdir -p $PKG/usr/doc/schedutils-1.5.0 cp -a \ AUTHORS COPYING ChangeLog INSTALL README \ $PKG/usr/doc/schedutils-1.5.0 echo "+================+" echo "| setserial-2.17 |" echo "+================+" cd $BUILDDIR 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 || exit ./configure --prefix=/usr make strip setserial cat setserial > $PKG/sbin/setserial cat rc.serial > $PKG/etc/rc.d/rc.serial.new cat serial.conf > $PKG/etc/serial.conf.new cat setserial.8 | gzip -9c > $PKG/usr/man/man8/setserial.8.gz echo "+============+" echo "| bsdstrings |" echo "+============+" cd $BUILDDIR 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 $BUILDDIR rm -rf adjtimex-1.20 tar xzvf $CWD/adjtimex-1.20.tar.gz cd adjtimex-1.20 CFLAGS=-O2 ./configure --prefix=/usr make strip adjtimex cat adjtimex > $PKG/sbin/adjtimex chmod 755 $PKG/sbin/adjtimex cat adjtimex.8 | gzip -9c > $PKG/usr/man/man8/adjtimex.8.gz mkdir -p $PKG/usr/doc/adjtimex-1.20 cp -a \ COPYING COPYRIGHT README README.ru adjtimex.lsm \ $PKG/usr/doc/adjtimex-1.20 echo "+==================+" echo "| util-linux-$VERSION |" echo "+==================+" cd $BUILDDIR rm -rf util-linux-$VERSION tar xjvf $CWD/util-linux-$VERSION.tar.bz2 cd util-linux-$VERSION zcat $CWD/util-linux.MCONFIG.diff.gz | patch -E --backup -p1 --suffix=.orig || exit #zcat $CWD/util-linux.x86_64.diff.gz | patch -E --backup -p1 --suffix=.orig || exit # Breaks gcc41 patch to fix cramfs, dropped zcat $CWD/util-linux.x86_64.rdev.diff.gz | patch -E --backup -p0 --suffix=.orig || exit # Fix missing rdev on AMD64 # Patch from uClibc to fix fsck.cramfs on AMD64 (also fixes GCC 3.4) zcat $CWD/util-linux.gcc41.diff.gz | patch -E --backup -p1 --suffix=.orig || exit # They've added changed the description of partition type 82 from # "Linux swap" to "Linux swap / Solaris". Nothing against Sun, but Solaris # has shared this partition type with Linux swap since at least 1994, and # it has never been a support issue. However, I think it's possible that # listing swap partitions as "Solaris" at installation time will confuse # some people, so I'm patching it back to "Linux swap" like it has always # been. If this is a problem for anyone, please email and I'll listen. zcat $CWD/util-linux.fdisk-no-solaris.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 sys-utils/flock > $PKG/usr/bin/flock 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/flock.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 rmdir $PKG/usr/man/man{2,6} mkdir -p $PKG/usr/doc/util-linux-$VERSION cp -a \ HISTORY INSTALL hwclock/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 "| ziptool-1.4.0 |" echo "+===============+" cd $BUILDDIR rm -rf ziptool-1.4.0 tar xjvf $CWD/ziptool-1.4.0.tar.bz2 cd ziptool-1.4.0 make strip ziptool cat ziptool > $PKG/sbin/ziptool mkdir -p $PKG/usr/doc/ziptool-1.4.0 cp -a README $PKG/usr/doc/ziptool-1.4.0 chmod 644 $PKG/usr/doc/ziptool-1.4.0/* 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 chown root:root $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 ) ( cd $PKG/usr/doc chown -R root:root . find . -perm 666 -exec chmod 644 {} \; find . -perm 640 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; ) 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