summaryrefslogtreecommitdiffstats
path: root/core/openntpd/APKBUILD
blob: 4d13163d8499829109bbd1fb49dcb34f576da645 (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
pkgname=openntpd
pkgver=3.9_p1
_myver=3.9p1
pkgrel=2
pkgdesc="Lightweight NTP server ported from OpenBSD"
url=http://www.openntpd.org/
install=openntpd.install

subpackages="openntpd-doc"
depends="uclibc openssl"
makedepends="openssl-dev"
license=BSD
source="
	ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-$_myver.tar.gz
	openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff
	openntpd-3.9p1-ifaddr.patch
	openntpd.conf.d
	openntpd.rc
	openntpd.install
	"

_prepare() {
	cd "$srcdir/$pkgname-$_myver"
	patch -p1 < ../openntpd-3.9p1-ifaddr.patch
	patch -p1 < ../openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff
	sed -i '/NTPD_USER/s:_ntp:ntp:' ntpd.h || return 1
}

_compile() {
	cd "$srcdir/$pkgname-$_myver"
	./configure --prefix=/usr --mandir=/usr/share/man
	make || return 1
}

_install() {
	cd "$srcdir/$pkgname-$_myver"
	make install DESTDIR="$pkgdir"
	mkdir -p "$pkgdir/etc/init.d" "$pkgdir/etc/conf.d"
	cp ../openntpd.rc "$pkgdir/etc/init.d/ntpd"
	cp ../openntpd.conf.d "$pkgdir/etc/conf.d/ntpd"
}


build() {
	_prepare && _compile && _install
}
md5sums="afc34175f38d08867c1403d9008600b3  openntpd-3.9p1.tar.gz
ae2f708b860975b64126bb316aeb6641  openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff
a1640ec40ac228338e60bd4fda42f84d  openntpd-3.9p1-ifaddr.patch
e3eee9eb2ea092dfdf9d887cd6df5795  openntpd.conf.d
5000453927b7ae9943d51194c1042355  openntpd.rc
21032167a8524bc88565c83b328be44b  openntpd.install"