Commit f1892ddc authored by Daniele Cocca's avatar Daniele Cocca

Updating ntp (backporting the ntpd and ntpdate init scripts from Arch Linux).

parent 4d095bbb
......@@ -4,30 +4,30 @@
pkgname=ntp
pkgver=4.2.6.p3
_realver=4.2.6p3
pkgrel=3
pkgrel=4
pkgdesc="NTP (Network Time Protocol) tries to keep servers in sync"
arch=(i686 x86_64)
arch=('i686' 'x86_64')
license=('custom')
url="http://www.ntp.org/"
depends=('openssl' 'readline' 'libcap')
makedepends=('perl-html-parser')
backup=('etc/ntp.conf' 'etc/conf.d/ntp-client.conf')
options=('!emptydirs')
source=(http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${_realver}.tar.gz
ntp-4.2.4-html2man.patch
ntp.conf
ntp-client.conf
ntpd
ntpdate)
source=("http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${_realver}.tar.gz"
ntp-4.2.4-html2man.patch
ntp.conf
ntp-client.conf
ntpd
ntpdate)
md5sums=('59876a9009b098ff59767ee45a88ebd2'
'1b04e888717bb31479a6087632981723'
'6e3bac6153ab072d60d6f494093d2ded'
'58997d6cf4846d80e35a01b855376a33'
'bf20804e75656609e808ca21b53ea4aa'
'140855352baeb89da0c6c1c475c18b57')
'99b49d763e5866f4f81c48d922c80b93')
build() {
cd "$srcdir/$pkgname-$_realver"
cd "${srcdir}/${pkgname}-${_realver}"
# fix man page generation
patch -Np1 -i ../ntp-4.2.4-html2man.patch
# configure
......@@ -43,38 +43,40 @@ build() {
}
package() {
cd "$srcdir/$pkgname-$_realver"
cd "${srcdir}/${pkgname}-${_realver}"
# install
make DESTDIR="$pkgdir" install
make DESTDIR="${pkgdir}" install
# install conf files
install -d "$pkgdir/usr/share/ntp"
install -d "${pkgdir}/usr/share/ntp"
install -D -m644 conf/* "${pkgdir}/usr/share/ntp"
# install launch scripts
install -d "$pkgdir/etc/rc.d"
install -D -m755 ${srcdir}/{ntpd,ntpdate} "$pkgdir/etc/rc.d"
install -d "${pkgdir}/etc/rc.d"
install -D -m755 "${srcdir}"/{ntpd,ntpdate} "${pkgdir}/etc/rc.d"
# install man pages
cd html
../scripts/html2man
sed -i 's/^[\t\ ]*$//;/./,/^$/!d' man/man*/*.[58]
install -d "$pkgdir"/usr/share/man/man{5,8}
install -m644 man/man5/* "$pkgdir/usr/share/man/man5/"
install -m644 man/man8/* "$pkgdir/usr/share/man/man8/"
mv "$pkgdir/usr/share/man/man8/ntpd.8" "$pkgdir/usr/share/man/man8/ntp-ntpd.8"
install -d "${pkgdir}"/usr/share/man/man{5,8}
install -m644 man/man5/* "${pkgdir}/usr/share/man/man5"
install -m644 man/man8/* "${pkgdir}/usr/share/man/man8"
mv "${pkgdir}/usr/share/man/man8/ntpd.8" "${pkgdir}/usr/share/man/man8/ntp-ntpd.8"
cd ..
# install sample configs
install -D -m644 "$srcdir/ntp.conf" "$pkgdir/etc/ntp.conf"
install -D -m644 "$srcdir/ntp-client.conf" \
"$pkgdir/etc/conf.d/ntp-client.conf"
install -D -m644 "${srcdir}/ntp.conf" "${pkgdir}/etc/ntp.conf"
install -D -m644 "${srcdir}/ntp-client.conf" \
"${pkgdir}/etc/conf.d/ntp-client.conf"
# create /var/lib/ntp
install -d "$pkgdir/var/lib/ntp"
touch "$pkgdir/var/lib/ntp/.placeholder"
install -d "${pkgdir}/var/lib/ntp"
touch "${pkgdir}/var/lib/ntp/.placeholder"
install -Dm644 "$srcdir/$pkgname-$_realver/COPYRIGHT" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "${srcdir}/${pkgname}-${_realver}/COPYRIGHT" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
# vim:set ts=2 sw=2 et:
......@@ -7,9 +7,10 @@
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
/usr/bin/ntpd -q $NTP_CLIENT_OPTION &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
add_daemon ntpdate
stat_done
......@@ -22,9 +23,9 @@ case "$1" in
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment