#!/bin/sh # This SlackBuild like script is designed for Vector Linux packages. # This script assumes it will be launched within "/NAME/VERSION/src" dir. With all sources in "src" # Your Vector Linux .tlz package, slack-desc, and slack-required will be found in "VERSION" dir. # The extraction and build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. NAME=ntp VERSION=4.2.4p4 ARCH=i586 BUILD=1vl59 VL_PACKAGER=exeterdad CONFIGFLAGS="--prefix=/usr --localstatedir=/var --sysconfdir=/etc --bindir=/usr/sbin --sbindir=/usr/sbin --with-binsubdir=sbin --program-prefix= --program-suffix= --build=$ARCH-slackware-linux" CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME-${VERSION}* 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 2777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 2755 -exec chmod 755 {} \; find . -perm 774 -exec chmod 644 {} \; find . -perm 666 -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 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; ./configure $CONFIGFLAGS make || exit 1 make install DESTDIR=$PKG || exit 1 mkdir -p $PKG/etc/$NAME cat $CWD/$NAME.conf > $PKG/etc/$NAME.conf touch $PKG/etc/$NAME/step-tickers mkdir -p $PKG/etc/rc.d mkdir -p $PKG/etc/rc.d/init.d cat $CWD/rc.ntpd > $PKG/etc/rc.d/init.d/ntpd chmod +x $PKG/etc/rc.d/init.d/ntpd mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ COPYRIGHT NEWS README* TODO WHERE-TO-START \ *.y2kfixes clockstuff conf html scripts \ $PKG/usr/doc/$NAME-$VERSION mkdir $PKG/usr/doc/$NAME-$VERSION/util cp -a util/README $PKG/usr/doc/$NAME-$VERSION/util mkdir $PKG/usr/doc/$NAME-$VERSION/ntpdate cp -a ntpdate/README $PKG/usr/doc/$NAME-$VERSION/ntpdate ( cd $PKG/usr/doc/$NAME-$VERSION find . -type d -name .deps -exec rm -rf {} \; 2> /dev/null ) ( 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 ) gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/install cat > $RELEASEDIR/slack-desc << EOF # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. # |-----handy-ruler------------------------------------------------------| $NAME: ntp (Network Time Protocol daemon) $NAME: The NTP package contains a client and server to keep the time $NAME: synchronized between various computers over a network within a few $NAME: milliseconds. This package is the official reference implementation $NAME: of the NTP protocol. $NAME: $NAME: License: Copyright (c) David L. Mills 1992-2006 $NAME: $NAME: $NAME: Author: Too many to list. Please see docs. $NAME: Website: http://www.ntp.org/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: $CONFIGFLAGS EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG requiredbuilder -v -y -s $RELEASEDIR $PKG makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD rm -rf $TMP