summaryrefslogtreecommitdiff
path: root/extra/ntp/PKGBUILD
blob: 69669c7218d2402652ab0910d6ede31a483be4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# $Id: PKGBUILD 117473 2011-04-03 17:50:26Z andrea $
# Maintainer: kevin <kevin@archlinux.org>

pkgname=ntp
pkgver=4.2.6.p3
_realver=4.2.6p3
pkgrel=3
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')
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-html2man.patch
	ntp.conf
	ntp-client.conf
	ntpd
	ntpdate)
md5sums=('59876a9009b098ff59767ee45a88ebd2' '1b04e888717bb31479a6087632981723'
         '398a7f270f6ae083f47f86eb8b557a75' '58997d6cf4846d80e35a01b855376a33'
         'bf20804e75656609e808ca21b53ea4aa' '99b49d763e5866f4f81c48d922c80b93')

build() {
  cd "$srcdir/$pkgname-$_realver"
  # fix man page generation
  patch -Np1 -i ../ntp-4.2.4-html2man.patch
  # configure
  export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
  # 4.2.6p3: aclocal too old, regenerate
  rm -f aclocal.m4
  libtoolize --copy --force
  ac_cv_header_dns_sd_h=0 ./configure --prefix=/usr \
    --mandir=/usr/share/man \
    --enable-linux-caps
  # build
  make
}

package() {
  cd "$srcdir/$pkgname-$_realver"

  # install
  make DESTDIR="$pkgdir" install

  # install conf files
  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 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
  install -d "$pkgdir/var/lib/ntp"
  touch "$pkgdir/var/lib/ntp/.placeholder"

  install -Dm644 "$srcdir/$pkgname-$_realver/COPYRIGHT" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}