PKGBUILDs/extra/ntp/PKGBUILD
2011-02-09 22:28:01 -06:00

86 lines
2.5 KiB
Bash

# $Id: PKGBUILD 95196 2010-10-17 01:43:50Z kevin $
# Maintainer: kevin <kevin@archlinux.org>
plugrel=1
# PlugApps changes: Added avahi to dependencies
pkgname=ntp
pkgver=4.2.6.p2
_realver=4.2.6p2
pkgrel=1
pkgdesc="NTP (Network Time Protocol) tries to keep servers in sync"
arch=(i686 x86_64)
license=('custom')
url="http://www.ntp.org/"
depends=('openssl' 'readline' 'libcap' 'avahi')
makedepends=('perl-html-parser')
backup=('etc/ntp.conf' 'etc/conf.d/ntp-client.conf')
options=('!emptydirs')
changelog=changelog
source=(http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${_realver}.tar.gz
ntp-4.2.4_p7-nano.patch
fix-ipv6.patch
ntp-4.2.4-html2man.patch
ntp.conf
ntp-client.conf
ntpd
ntpdate)
md5sums=('cf73cd85f248232c62f8029e6eb05938' '36c5711228cb0cf48966daa993e06f55'
'9dabdbc6b8cd020f2205515df7972c21' '1b04e888717bb31479a6087632981723'
'5bd3924f5720b97837969ec4ec4d5e09' 'c7f50632b69bd4f32cf052d0b1848463'
'46118a8ec2c4f5bbfafd730af21b7c03' '140855352baeb89da0c6c1c475c18b57')
build() {
cd "$srcdir/$pkgname-$_realver"
# fix glibc build issue
patch -Np1 -i ../ntp-4.2.4_p7-nano.patch
# fix ipv6 support
patch -Np1 -i ../fix-ipv6.patch
# fix man page generation
patch -Np1 -i ../ntp-4.2.4-html2man.patch
# configure
# 4.2.6p2 not finding rt lib: added LIS
export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
libtoolize --copy --force
ac_cv_header_dns_sd_h=0 ./configure LIBS=-lrt --prefix=/usr --mandir=/usr/share/man --enable-linux-caps
# build
make
}
package() {
cd "$srcdir/$pkgname-$_realver"
# install
make DESTDIR="$pkgdir" install
# install conf files
mkdir -p "$pkgdir/usr/share/ntp"
install -D -m644 conf/* "$pkgdir/usr/share/ntp/"
# install launch scripts
mkdir -p "$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"
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"
# create /var/lib/ntp
mkdir -p "$pkgdir/var/lib/ntp"
touch "$pkgdir/var/lib/ntp/.placeholder"
install -Dm644 "$srcdir/$pkgname-$_realver/COPYRIGHT" "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
}