#!/bin/sh # Based on Patrick Volkerding's original ntp.build script. # Modified by George Georgakis 9/02/2003 ############################################################### CWD=`pwd` TMP=/tmp NAME=ntp VERSION=4.1.1a PKG=$TMP/package-$NAME # Create the package location, if it doesn't already exist [ ! -d $PKG ] && mkdir -p $PKG # Explode the controller tarball, if one exists ( cd $PKG [ -e $CWD/_$NAME.tar.gz ] && explodepkg $CWD/_$NAME.tar.gz # Start the on-screen information echo "+======+=====+" echo "| $NAME-$VERSION |" echo "+=======+====+" # Explode the source tarball cd $TMP tar xzvf $CWD/$NAME-$VERSION.tar.gz cd $NAME-$VERSION chown -R root.root . find . -perm 664 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; mkdir -p $PKG/usr/doc/ntp-$VERSION \ $PKG/usr/sbin \ $PKG/etc/ntp \ $PKG/usr/doc/ntp-$VERSION/util \ $PKG/install \ $PKG/usr/doc/ntp-$VERSION/ntpdate \ $PKG/usr/doc/ntp-$VERSION/ntptrace ./configure --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --bindir=/usr/sbin \ --program-prefix= \ --program-suffix= \ --build=i386-tripleg-linux-gnu make CFLAGS="-O2 -march=i386 -mcpu=i486" LDFLAGS=-s cp ./util/ntp-genkeys \ ./scripts/ntp-wait \ ./ntpd/ntpd \ ./ntpdate/ntpdate \ ./ntpdc/ntpdc \ ./ntpq/ntpq \ ./util/ntptime \ ./ntpdate/ntptimeset \ ./ntptrace/ntptrace \ ./util/tickadj $PKG/usr/sbin cat $CWD/ntp.conf > $PKG/etc/ntp.conf.new cat $CWD/ntp.keys > $PKG/etc/ntp/ntp.keys.new chmod 600 $PKG/etc/ntp/ntp.keys.new touch $PKG/etc/ntp/step-tickers cat $CWD/doinst.sh > $PKG/install/doinst.sh cp -a COPYRIGHT ChangeLog INSTALL NEWS README* TODO WHERE-TO-START \ *.y2kfixes clockstuff conf html scripts $PKG/usr/doc/ntp-$VERSION cp -a util/README $PKG/usr/doc/ntp-$VERSION/util cp -a ntpdate/README $PKG/usr/doc/ntp-$VERSION/ntpdate cp -a ntptrace/README $PKG/usr/doc/ntp-$VERSION/ntptrace chown -R root.root $PKG/usr/doc/ntp-$VERSION # Change "description" to "slack-desc" to conform with # standard Slackware practice. cat $CWD/slack-desc > $PKG/install/description # Delete empty non-linux stuff. rm -rf $PKG/usr/doc/ntp-4.1.1a/scripts/support/conf/ # Build the package cd $PKG tar czvf $TMP/$NAME-$VERSION.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 # Clean up the build directories if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$NAME-$VERSION rm -rf $PKG fi # Move the completed package into this directory if [ "$1" != "--nomove" -a "$2" != "--nomove" ]; then mkdir -p $CWD/package mv $TMP/$NAME-$VERSION.tgz $CWD/package/ echo echo "The finished $NAME-$VERSION is now in the package/ directory" echo echo fi # Fork screen output to a log ) 2>&1 | tee $CWD/$NAME.build.log