#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-sparcutils 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 # Make the directory structure mkdir -p $PKG/usr/bin $PKG/usr/doc $PKG/usr/sbin mkdir -p $PKG/usr/man/man1 $PKG/usr/man/man8 # build elftoaout cd $TMP tar xvzf $CWD/elftoaout-2.3.tar.gz cd elftoaout-2.3 make cat elftoaout > $PKG/usr/bin/elftoaout # build piggyback/piggyback64 cd $TMP tar xvzf $CWD/piggyback.tar.gz cd piggyback zcat $CWD/piggyback.diff.gz | patch -p1 gcc -O2 -o piggyback piggyback.c gcc -O2 -o piggyback64 piggyback64.c cat piggyback > $PKG/usr/bin/piggyback cat piggyback64 > $PKG/usr/bin/piggyback64 cp $CWD/piggyback.1 $PKG/usr/man/man1/piggyback.1 echo ".so man1/piggyback.1" > $PKG/usr/man/man1/piggyback64.1 gzip -9 $PKG/usr/man/man1/piggyback*.1 # build ethtool cd $TMP tar xvzf $CWD/ethtool.tar.gz cd ethtool make cat ethtool > $PKG/usr/sbin/ethtool gzip -9c ethtool.8 > $PKG/usr/man/man8/ethtool.8.gz # build prtconf cd $TMP tar xvzf $CWD/prtconf.tar.gz cd prtconf make cat eeprom > $PKG/usr/sbin/eeprom cat prtconf > $PKG/usr/sbin/prtconf gzip -9c eeprom.8 > $PKG/usr/man/man8/eeprom.8.gz gzip -9c prtconf.8 > $PKG/usr/man/man8/prtconf.8.gz # build sparc32 cd $TMP tar xvzf $CWD/sparc32-1.1.tar.gz cd sparc32-1.1 zcat $CWD/sparc32-1.1.diff.gz | patch -p1 make cat sparc32 > $PKG/usr/bin/sparc32 ln -sf sparc32 $PKG/usr/bin/sparc64 gzip -9c sparc32.8 > $PKG/usr/man/man8/sparc32.8.gz gzip -9c sparc64.8 > $PKG/usr/man/man8/sparc64.8.gz # build audioctl cd $TMP tar xvzf $CWD/audioctl-1.3.tar.gz cd audioctl make cat audioctl > $PKG/usr/bin/audioctl gzip -9c audioctl.1 > $PKG/usr/man/man1/audioctl.1.gz # build openprom cd $TMP cc -O2 -o openprom $CWD/openprom.c cat openprom > $PKG/usr/bin/openprom # build uname-sunos cd $TMP cc -O2 -o uname-sunos $CWD/uname-sunos.c cat uname-sunos > $PKG/usr/bin/uname-sunos # Set all the permissions chown -R root.root $PKG chmod 755 $PKG/usr/bin/* $PKG/usr/sbin/* chmod 644 $PKG/usr/man/man*/*.gz # Build the package: cd $PKG tar czvf $TMP/sparcutils.tgz . # Warn of zero-length files: for file in `find . -type f -print` ; do if [ "`filesize $file`" = "0" ]; then echo "WARNING: zero length file $file" fi if [ "`filesize $file`" = "20" ]; then echo "WARNING: possible empty gzipped file $file" fi done