aboutsummaryrefslogtreecommitdiffstats
path: root/main/chrony/APKBUILD
blob: 977e5af043f4302dd22c3629523e7051d1822d47 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Contributor: Łukasz Jendrysik
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=chrony
pkgver=3.1
pkgrel=1
_ver=${pkgver/_/-}
pkgdesc="NTP client and server programs"
url="https://chrony.tuxfamily.org/"
pkgusers="$pkgname"
pkggroups="$pkgname"
arch="all"
license="GPL2"
install="$pkgname.pre-install $pkgname.pre-upgrade"
depends=""
makedepends="libcap-dev texinfo asciidoctor"
subpackages="$pkgname-doc"
source="https://download.tuxfamily.org/$pkgname/$pkgname-$_ver.tar.gz
	max_resolve_interval.patch
	chronyd.confd
	chronyd.initd
	chrony.logrotate
	chrony.conf
	timepps.h
	"

builddir="$srcdir"/$pkgname-$_ver
prepare() {
	cd "$builddir"
	# We copy timepps.h to the local build directory instead of
	# creating a pps-tools-dev package for ppstime.h
	# (See https://github.com/ago/pps-tools)
	mkdir -p pps-tools/sys
	cp "$srcdir"/timepps.h "$builddir"/pps-tools/sys/

	# apply patches (if any)
	default_prepare || return 1
}

build() {
	cd "$builddir"
	CPPFLAGS="$CPPFLAGS -I./pps-tools/" ./configure \
		--prefix=/usr \
		--infodir=/usr/share/info \
		--mandir=/usr/share/man \
		--sysconfdir=/etc/$pkgname \
		--disable-readline \
		--with-user=$pkgname \
		--with-sendmail=/usr/sbin/sendmail \
		|| return 1
	make all docs || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/etc/logrotate.d
	install -Dm644 "$srcdir"/chrony.logrotate "$pkgdir"/etc/logrotate.d/chrony || return 1

	mkdir -p "$pkgdir"/usr/share/doc/chrony
	install -m644 examples/*.example "$pkgdir"/usr/share/doc/chrony/
	install -Dm755 "$srcdir"/chronyd.initd "$pkgdir"/etc/init.d/chronyd
	install -Dm644 "$srcdir"/chronyd.confd "$pkgdir"/etc/conf.d/chronyd

	install -dm2750 -g wheel "$pkgdir"/var/log/chrony

	mkdir -p "$pkgdir"/var/lib/chrony \
		"$pkgdir"/etc/chrony

	# chrony.drift must be writable by chrony user
	chown $pkgusers:$pkggroups "$pkgdir"/etc/chrony
	install -m644 "$srcdir"/chrony.conf "$pkgdir"/etc/chrony/chrony.conf
	chown root:root "$pkgdir"/etc/chrony/*

	chown $pkgusers:$pkggroups "$pkgdir"/var/lib/chrony
	touch "$pkgdir"/var/lib/chrony/chrony.drift
}

md5sums="f8d2ee78c55548bfbe95582c6a855cee  chrony-3.1.tar.gz
a756428186bb27884d157a9f2c9732c6  max_resolve_interval.patch
d62521b4c8837e15262c47ac88359307  chronyd.confd
93642fa5d3eed62c15a183f72023ec6f  chronyd.initd
455da71ae961667dc7823300f3cf8ab4  chrony.logrotate
15fd3724c7e171c3e75a29d217e707b2  chrony.conf
28f6835098a216f4a620f9218d15b5b8  timepps.h"
sha256sums="9d9107dcdb7768a03dc129d33b2a7a25f1eea2f5620bc85eb00cfea07c1b6075  chrony-3.1.tar.gz
61528337a48ac82f0c393547b78a972c57fb3727ff75407c4335c9b014eb8db5  max_resolve_interval.patch
29040502f86c419dbfbc7e2627cc658a8df82b37da21b3d1fce2eed9136d8f99  chronyd.confd
a621ef2c5694c635e982de525357dff518562a3400378948e216a43dcf00ace6  chronyd.initd
4c4f95b03f7e2e240ad26943da44591b300862e328c97ef5690f5a9a66c97650  chrony.logrotate
d50a474d654ff4a1b742e712bbfc2d9e6c75e04b28ec9b86ee2054bdaf830fc0  chrony.conf
ab4f459ee9d1037d7fa962a66ea652b08935539a4f443dc216e82b5717d8bb22  timepps.h"
sha512sums="4ba3a75c3634050bb63ba9ee80d9be7a295f44ce4d195a050e4be4738bd7dd807fe37f2289d7ead4a75272bd5ebadbd03c233c67f859e9b68871fca5a6671427  chrony-3.1.tar.gz
19faf017e4502947a9b549b8165bf31bf11b814f2bf7b013a1ac11460afa654287d58de341cfa1f10b6a34334ed7d1d34e58b350c3c68bf6336530712d4db13c  max_resolve_interval.patch
6919c7bddce2a8f81c0f2759c7c58506e97f89102bfeb7b5c19c6da5ed4cbd9070faddd4f3fb411bb4c653fffbdcc93a7f7dc810f38b199f038b1d4072f57640  chronyd.confd
9a18c9744d7b78d9b9be3f0ae0b43cb988b294c342764802e0d5df835d450e748584c0b345f7161f14d84e15c8bbd491514ee9dc45e4a65f1276c52124d2e312  chronyd.initd
ab38f06bf45888846778ad935e24abb30d13b6805e9a750bc694ff953695fa8c5b33aac560f5f7f96dc46031c1a38660e5c418b6fce6fb34a87908a9a3c99357  chrony.logrotate
2719b71251a110d3a9f697fad17f74a898bb0cf33cfbf60f4ec3e598ad8f09cadc6afbb069be06aff8da8f58e00ba622f4384b9dd88f25b279e6f3b6cb43ad3c  chrony.conf
eb11fc19243d1789016d88eb7645bfe67c46304547781489bf36eb1dd4c252d523681ff835a6488fa0ef62b6b9e2f781c672279f4439f5d5640a3f214a113048  timepps.h"