diff options
author | Robby Workman <rw@rlworkman.net> | 2010-05-11 15:01:33 +0200 |
---|---|---|
committer | Piter PUNK <piterpk@slackbuilds.org> | 2010-05-11 15:01:33 +0200 |
commit | ff9b7ad258b1f6f0b13e8584ce1213f997e5253a (patch) | |
tree | 8289fa8c17a1f03a6a9b8772374edd2d87955924 | |
parent | 456d07a8a92408f81fba2603c976897cc62f8ba5 (diff) | |
download | slackbuilds-ff9b7ad258b1f6f0b13e8584ce1213f997e5253a.tar.gz |
network/openntpd: Initial import
-rw-r--r-- | network/openntpd/README | 17 | ||||
-rw-r--r-- | network/openntpd/doinst.sh | 23 | ||||
-rw-r--r-- | network/openntpd/openntpd.SlackBuild | 89 | ||||
-rw-r--r-- | network/openntpd/openntpd.info | 8 | ||||
-rw-r--r-- | network/openntpd/rc.ntpd | 39 | ||||
-rw-r--r-- | network/openntpd/slack-desc | 11 |
6 files changed, 187 insertions, 0 deletions
diff --git a/network/openntpd/README b/network/openntpd/README new file mode 100644 index 0000000000..218a49a43e --- /dev/null +++ b/network/openntpd/README @@ -0,0 +1,17 @@ +OpenNTPD is a FREE, easy to use implementation of the Network Time +Protocol. It provides the ability to sync the local clock to remote +NTP servers and can act as NTP server itself, redistributing the +local clock. OpenNTPD is primarily developed by Henning Brauer as +part of the OpenBSD Project. The portable version is made by Darren +Tucker. + +You will need to add the "_ntp" user and group to /etc/passwd and +/etc/group if it's not present on your system. Without these groups, +the package will not work. + +You will also need to call the /etc/rc.d/rc.ntpd script from one of +your startup scripts if you want OpenNTPD to start at boot; one way +is to add something like this to /etc/rc.d/rc.local: + if [ -x /etc/rc.d/rc.ntpd ]; then + /etc/rc.d/rc.ntpd start + fi diff --git a/network/openntpd/doinst.sh b/network/openntpd/doinst.sh new file mode 100644 index 0000000000..d1589f1e71 --- /dev/null +++ b/network/openntpd/doinst.sh @@ -0,0 +1,23 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.ntpd.new: +if [ -e etc/rc.d/rc.ntpd ]; then + cp -a etc/rc.d/rc.ntpd etc/rc.d/rc.ntpd.new.incoming + cat etc/rc.d/rc.ntpd.new > etc/rc.d/rc.ntpd.new.incoming + mv etc/rc.d/rc.ntpd.new.incoming etc/rc.d/rc.ntpd.new +fi + +config etc/rc.d/rc.ntpd.new +config etc/ntpd.conf.new + diff --git a/network/openntpd/openntpd.SlackBuild b/network/openntpd/openntpd.SlackBuild new file mode 100644 index 0000000000..b5903a26bd --- /dev/null +++ b/network/openntpd/openntpd.SlackBuild @@ -0,0 +1,89 @@ +#!/bin/sh + +# Slackware build script for openntpd + +# Copyright 2006-2007 Robby Workman (http://rlworkman.net) +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=openntpd +VERSION=3.9p1 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-2} +TAG=${TAG:-_SBo} +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG/usr $OUTPUT +cd $TMP || exit 1 +rm -rf $PRGNAM-$VERSION +tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1 +cd $PRGNAM-$VERSION || exit 1 +chown -R root:root . +chmod -R a-s,u+w,go+r-w . + +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + || exit 1 + +make || exit 1 +make install DESTDIR=$PKG || exit 1 + +( 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 +) + +if [ -d $PKG/usr/man ]; then +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +) +fi + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CREDITS ChangeLog INSTALL LICENCE README \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +# Add an init script that works with OpenNTPD (see the README) +mkdir -p $PKG/etc/rc.d +install -m 0755 $CWD/rc.ntpd $PKG/etc/rc.d/rc.ntpd.new + +# Don't clobber config file +mv $PKG/etc/ntpd.conf $PKG/etc/ntpd.conf.new + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/openntpd/openntpd.info b/network/openntpd/openntpd.info new file mode 100644 index 0000000000..454fb4adb2 --- /dev/null +++ b/network/openntpd/openntpd.info @@ -0,0 +1,8 @@ +PRGNAM="openntpd" +VERSION="3.9p1" +HOMEPAGE="http://www.openntpd.org" +DOWNLOAD="ftp://openbsd.mirrors.pair.com/OpenNTPD/openntpd-3.9p1.tar.gz" +MD5SUM="afc34175f38d08867c1403d9008600b3" +MAINTAINER="Robby Workman" +EMAIL="rw@rlworkman.net" +APPROVED="PiterPunk" diff --git a/network/openntpd/rc.ntpd b/network/openntpd/rc.ntpd new file mode 100644 index 0000000000..249df02de8 --- /dev/null +++ b/network/openntpd/rc.ntpd @@ -0,0 +1,39 @@ +#!/bin/sh +# Start/stop/restart the network time protocol daemon +# +# Written for Slackware Linux by Robby Workman <http://rlworkman.net> +# ## (by modifying one of Pat's scripts) +# Add -s to the command to set the time at startup + +ntpd_start() { + if [ -x /usr/sbin/ntpd ]; then + echo "Starting ntpd daemon: /usr/sbin/ntpd " + /usr/sbin/ntpd 2> /dev/null + sleep 1 + fi +} + +ntpd_stop() { + echo "Stopping ntpd daemon..." + killall ntpd 2> /dev/null +} + +ntpd_restart() { + ntpd_stop + sleep 1 + ntpd_start +} + +case "$1" in +'start') + ntpd_start + ;; +'stop') + ntpd_stop + ;; +'restart') + ntpd_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff --git a/network/openntpd/slack-desc b/network/openntpd/slack-desc new file mode 100644 index 0000000000..8b41acd72f --- /dev/null +++ b/network/openntpd/slack-desc @@ -0,0 +1,11 @@ +openntpd: OpenNTPD - Network Time Protocol client/server +openntpd: +openntpd: OpenNTPD is a FREE, easy to use implementation of the Network Time +openntpd: Protocol. It provides the ability to sync the local clock to remote +openntpd: NTP servers and can act as NTP server itself, redistributing the +openntpd: local clock. OpenNTPD is primarily developed by Henning Brauer as +openntpd: part of the OpenBSD Project. The portable version is made by Darren +openntpd: Tucker. +openntpd: +openntpd: Homepage: http://www.openntpd.org +openntpd: |