diff options
author | James Meyer <james.meyer@operamail.com> | 2008-11-08 17:08:28 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2008-11-08 17:08:28 (GMT) |
commit | c38715641e214272ad7dc6d495edd29940366e7f (patch) | |
tree | 9dcd507543e67458d98fa7462f62026041524047 /abs/core-testing/ntp | |
parent | 3d91b06198a56b6579cb0bd77de65f5908571b87 (diff) | |
download | linhes_pkgbuild-c38715641e214272ad7dc6d495edd29940366e7f.zip linhes_pkgbuild-c38715641e214272ad7dc6d495edd29940366e7f.tar.gz linhes_pkgbuild-c38715641e214272ad7dc6d495edd29940366e7f.tar.bz2 |
packages that will be needed in the future.
This is the initial merge of packages from MythVantage that are not MythVantage specific.
Diffstat (limited to 'abs/core-testing/ntp')
-rwxr-xr-x | abs/core-testing/ntp/PKGBUILD | 26 | ||||
-rwxr-xr-x | abs/core-testing/ntp/ntp-client.conf | 8 | ||||
-rwxr-xr-x | abs/core-testing/ntp/ntp.conf | 48 | ||||
-rwxr-xr-x | abs/core-testing/ntp/ntpd | 39 | ||||
-rwxr-xr-x | abs/core-testing/ntp/ntpdate | 30 |
5 files changed, 151 insertions, 0 deletions
diff --git a/abs/core-testing/ntp/PKGBUILD b/abs/core-testing/ntp/PKGBUILD new file mode 100755 index 0000000..3b60cdf --- /dev/null +++ b/abs/core-testing/ntp/PKGBUILD @@ -0,0 +1,26 @@ +pkgname=ntp +pkgver=4.2.4p5 +pkgrel=1 +pkgdesc="NTP (Network Time Protocol) tries to keep servers in sync" +arch=(i686 x86_64) +url="http://www.ntp.org/" +depends=('openssl' 'readline' ) +backup=('etc/ntp.conf' 'conf.d/ntp-client.conf') +source=(http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.4p5.tar.gz \ + ntp.conf ntp-client.conf ntpd ntpdate ) + + +build() { + cd $startdir/src/$pkgname-$pkgver + ./configure --prefix=/usr + make || return 1 + make prefix=$startdir/pkg/usr install + mkdir -p $startdir/pkg/usr/share/ntp/ $startdir/pkg/usr/man/man1/ + install -D -m644 conf/* $startdir/pkg/usr/share/ntp/ + install -D -m755 $startdir/ntpd $startdir/pkg/etc/rc.d/ntpd + install -D -m755 $startdir/ntpdate $startdir/pkg/etc/rc.d/ntpdate + install -D -m644 $startdir/src/man/* $startdir/pkg/usr/man/man1/ + install -D -m644 $startdir/ntp-client.conf $startdir/pkg/etc/conf.d/ntp-client.conf + install -D -m644 $startdir/ntp.conf $startdir/pkg/etc/ntp.conf +} + diff --git a/abs/core-testing/ntp/ntp-client.conf b/abs/core-testing/ntp/ntp-client.conf new file mode 100755 index 0000000..4acabee --- /dev/null +++ b/abs/core-testing/ntp/ntp-client.conf @@ -0,0 +1,8 @@ +# change this to a server closer to your location +#NTP_CLIENT_SERVER="pool.ntp.org" +NTP_CLIENT_SERVER="ntp1.cs.wisc.edu" +# client options +NTP_CLIENT_OPTION="-b -u" + +# timeout for the ntp-client +NTPCLIENT_TIMEOUT=10 diff --git a/abs/core-testing/ntp/ntp.conf b/abs/core-testing/ntp/ntp.conf new file mode 100755 index 0000000..e2c20e5 --- /dev/null +++ b/abs/core-testing/ntp/ntp.conf @@ -0,0 +1,48 @@ +# NOTES: +# - you should only have to update the server line below +# - if you start getting lines like 'restrict' and 'fudge' +# and you didnt add them, AND you run dhcpcd on your +# network interfaces, be sure to add '-Y -N' to the +# dhcpcd_ethX variables in /etc/conf.d/net + +# Name of the servers ntpd should sync with +# Please respect the access policy as stated by the responsible person. +#server ntp.example.tld iburst + +#server pool.ntp.org +server ntp1.cs.wisc.edu + +## +# A list of available servers can be found here: +# http://www.pool.ntp.org/ +# http://www.pool.ntp.org/#use +# A good way to get servers for your machine is: +# netselect -s 3 pool.ntp.org +## + +# you should not need to modify the following paths +driftfile /var/lib/ntp/ntp.drift + +#server ntplocal.example.com prefer +#server timeserver.example.org + +# Warning: Using default NTP settings will leave your NTP +# server accessible to all hosts on the Internet. + +# If you want to deny all machines (including your own) +# from accessing the NTP server, uncomment: +#restrict default ignore + + +# To deny other machines from changing the +# configuration but allow localhost: +restrict default nomodify nopeer +restrict 127.0.0.1 + + +# To allow machines within your network to synchronize +# their clocks with your server, but ensure they are +# not allowed to configure the server or used as peers +# to synchronize against, uncomment this line. +# +restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap diff --git a/abs/core-testing/ntp/ntpd b/abs/core-testing/ntp/ntpd new file mode 100755 index 0000000..bb39123 --- /dev/null +++ b/abs/core-testing/ntp/ntpd @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/bin/ntpd` +case "$1" in + start) + stat_busy "Starting NTP Daemon" + if [ -z "$PID" ]; then + /usr/bin/ntpd -g & + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + PID=`pidof -o %PPID /usr/bin/ntpd` + echo $PID > /var/run/ntpd.pid + add_daemon ntpd + stat_done + fi + ;; + stop) + stat_busy "Stopping NTP Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon ntpd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/abs/core-testing/ntp/ntpdate b/abs/core-testing/ntp/ntpdate new file mode 100755 index 0000000..643ae19 --- /dev/null +++ b/abs/core-testing/ntp/ntpdate @@ -0,0 +1,30 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/ntp-client.conf + +case "$1" in + start) + stat_busy "Starting NTP Client" + /usr/bin/ntpdate $NTP_CLIENT_OPTION -t $NTPCLIENT_TIMEOUT $NTP_CLIENT_SERVER > /dev/null 2>&1 + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon ntpdate + stat_done + fi + ;; + stop) + stat_busy "Stopping NTP Client" + rm_daemon ntpdate + stat_done + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac |