]>
Commit | Line | Data |
---|---|---|
164c0d73 | 1 | ############################################################################### |
802ea3af MT |
2 | # IPFire.org - An Open Source Firewall Solution # |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
164c0d73 MT |
4 | ############################################################################### |
5 | ||
802ea3af MT |
6 | name = chrony |
7 | version = 1.26 | |
f43608d2 | 8 | release = 8 |
164c0d73 | 9 | |
f43608d2 | 10 | groups = System/Daemons |
802ea3af MT |
11 | url = http://chrony.tuxfamily.org |
12 | license = GPLv2 | |
13 | summary = An NTP client/server. | |
164c0d73 | 14 | |
802ea3af | 15 | description |
164c0d73 MT |
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. | |
802ea3af MT |
21 | end |
22 | ||
23 | build | |
24 | requires | |
25 | bison | |
26 | libcap-devel | |
27 | libedit-devel | |
28 | readline-devel | |
29 | shadow-utils | |
30 | texinfo | |
31 | end | |
32 | ||
33 | configure_options = \ | |
34 | --prefix=/usr \ | |
35 | --with-sendmail=/usr/sbin/sendmail | |
36 | ||
37 | prepare_cmds | |
38 | %{create_user} | |
39 | end | |
40 | ||
41 | build_targets += getdate all docs | |
42 | install_targets += install-docs | |
164c0d73 | 43 | |
802ea3af MT |
44 | install_cmds |
45 | mkdir -pv %{BUILDROOT}/var/{lib,log}/chrony | |
46 | touch %{BUILDROOT}/var/lib/chrony/{drift,rtc} | |
164c0d73 | 47 | |
802ea3af MT |
48 | mkdir -pv %{BUILDROOT}/etc |
49 | install -m 644 -p %{DIR_SOURCE}/chrony.conf %{BUILDROOT}/etc/chrony.conf | |
50 | install -m 640 -p %{DIR_SOURCE}/chrony.keys %{BUILDROOT}/etc/chrony.keys | |
51 | chown -v root.chrony %{BUILDROOT}/etc/chrony.keys | |
164c0d73 | 52 | |
802ea3af MT |
53 | mkdir -pv %{BUILDROOT}/etc/dhcp/dhclient.d |
54 | install -m 755 -p %{DIR_SOURCE}/chrony.dhclient \ | |
55 | %{BUILDROOT}/etc/dhcp/dhclient.d/chrony.sh | |
164c0d73 | 56 | |
802ea3af MT |
57 | mkdir -pv %{BUILDROOT}/etc/logrotate.d |
58 | install -m 644 -p %{DIR_SOURCE}/chrony.logrotate \ | |
59 | %{BUILDROOT}/etc/logrotate.d/chrony | |
164c0d73 | 60 | |
802ea3af MT |
61 | mkdir -pv %{BUILDROOT}/usr/lib/chrony |
62 | install -m 755 -p %{DIR_SOURCE}/chrony-helper %{BUILDROOT}/usr/lib/chrony-helper | |
164c0d73 | 63 | |
802ea3af MT |
64 | chown -Rv chrony.chrony %{BUILDROOT}/var/{lib,log}/chrony |
65 | end | |
66 | end | |
164c0d73 | 67 | |
802ea3af MT |
68 | create_user |
69 | getent group chrony >/dev/null || /usr/sbin/groupadd -r chrony | |
70 | getent passwd chrony >/dev/null || /usr/sbin/useradd -r -g chrony \ | |
71 | -d /var/lib/chrony -s /sbin/nologin chrony | |
72 | end | |
164c0d73 | 73 | |
802ea3af MT |
74 | packages |
75 | package %{name} | |
f43608d2 MT |
76 | groups += Base |
77 | ||
802ea3af MT |
78 | configfiles |
79 | /etc/chrony.conf | |
80 | /etc/chrony.keys | |
81 | end | |
82 | ||
eef76e84 MT |
83 | prerequires = shadow-utils systemd-units |
84 | ||
802ea3af MT |
85 | script prein |
86 | %{create_user} | |
87 | end | |
88 | ||
89 | script postin | |
eef76e84 MT |
90 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : |
91 | /bin/systemctl --no-reload enable \ | |
92 | chrony-wait.service chronyd.service >/dev/null 2>&1 || : | |
802ea3af MT |
93 | end |
94 | ||
95 | script preun | |
96 | /bin/systemctl --no-reload disable \ | |
eef76e84 MT |
97 | chrony-wait.service chronyd.service >/dev/null 2>&1 || : |
98 | /bin/systemctl stop chrony-wait.service chronyd.service >/dev/null 2>&1 || : | |
802ea3af MT |
99 | end |
100 | ||
101 | script postup | |
eef76e84 MT |
102 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : |
103 | /bin/systemctl try-restart chronyd.service >/dev/null 2>&1 || : | |
802ea3af MT |
104 | end |
105 | end | |
106 | end |