]> git.ipfire.org Git - ipfire-3.x.git/blob - chrony/chrony.nm
pcengines-apu-firmware: New package
[ipfire-3.x.git] / chrony / chrony.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = chrony
7 version = 3.4
8 release = 1
9
10 groups = System/Daemons
11 url = https://chrony.tuxfamily.org
12 license = GPLv2
13 summary = An NTP client/server.
14
15 description
16 A client/server for the Network Time Protocol, this program keeps your
17 computer's clock accurate. It was specially designed to support
18 systems with intermittent internet connections, but it also works well
19 in permanently connected environments. It can use also hardware reference
20 clocks, system real-time clock or manual input as time references.
21 end
22
23 source_dl = https://download.tuxfamily.org/chrony/
24
25 build
26 requires
27 bison
28 libcap-devel
29 libedit-devel
30 nettle-devel
31 readline-devel
32 shadow-utils
33 texinfo
34 end
35
36 configure_options = \
37 --prefix=/usr \
38 --with-sendmail=/usr/sbin/sendmail
39
40 prepare_cmds
41 %{create_user}
42 end
43
44 build_targets += getdate all docs
45 install_targets += install-docs
46
47 install_cmds
48 mkdir -pv %{BUILDROOT}/var/{lib,log}/chrony
49 touch %{BUILDROOT}/var/lib/chrony/{drift,rtc}
50
51 mkdir -pv %{BUILDROOT}/etc
52 install -m 644 -p %{DIR_SOURCE}/chrony.conf %{BUILDROOT}/etc/chrony.conf
53 install -m 640 -p %{DIR_SOURCE}/chrony.keys %{BUILDROOT}/etc/chrony.keys
54 chown -v root.chrony %{BUILDROOT}/etc/chrony.keys
55
56 mkdir -pv %{BUILDROOT}/etc/logrotate.d
57 install -m 644 -p %{DIR_SOURCE}/chrony.logrotate \
58 %{BUILDROOT}/etc/logrotate.d/chrony
59
60 chown -Rv chrony.chrony %{BUILDROOT}/var/{lib,log}/chrony
61 end
62 end
63
64 create_user
65 getent group chrony >/dev/null || /usr/sbin/groupadd -r chrony
66 getent passwd chrony >/dev/null || /usr/sbin/useradd -r -g chrony \
67 -d /var/lib/chrony -s /sbin/nologin chrony
68 end
69
70 packages
71 package %{name}
72 groups += Base
73
74 configfiles
75 /etc/chrony.conf
76 /etc/chrony.keys
77 end
78
79 prerequires
80 shadow-utils
81 systemd-units
82 end
83
84 script prein
85 %{create_user}
86 end
87
88 script postin
89 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
90 /bin/systemctl --no-reload enable \
91 chrony-wait.service chronyd.service >/dev/null 2>&1 || :
92 end
93
94 script preun
95 /bin/systemctl --no-reload disable \
96 chrony-wait.service chronyd.service >/dev/null 2>&1 || :
97 /bin/systemctl stop chrony-wait.service chronyd.service >/dev/null 2>&1 || :
98 end
99
100 script postup
101 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
102 /bin/systemctl try-restart chronyd.service >/dev/null 2>&1 || :
103 end
104 end
105
106 package %{name}-debuginfo
107 template DEBUGINFO
108 end
109 end