1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
7 version = %{ver_major}.8
11 groups = System/Daemons
12 url = http://www.ntp.org/
13 license = (MIT and BSD and BSD with advertising) and GPLv2
14 summary = The NTP daemon and utilities.
17 The Network Time Protocol (NTP) is used to synchronize a computer's
18 time with another reference time source. This package includes ntpd
19 (a daemon which continuously adjusts system time) and utilities used
20 to query and configure the ntpd daemon.
23 source_dl = http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-%{ver_major}/
25 # The vendor part in the NTP pool address.
26 VENDORZONE = %{DISTRO_SNAME}
38 # Create ntp user and group.
42 configure_options += \
43 --sysconfdir=%{sysconfdir}/ntp/crypto \
45 --enable-parse-clocks \
46 --enable-ntp-signd=%{localstatedir}/run/ntp_signd \
49 make_install_targets += bindir=%{sbindir}
52 mkdir -pv %{BUILDROOT}%{mandir}/man{5,8}
53 sed -i "s/sntp\.1/sntp\.8/" %{BUILDROOT}%{mandir}/man1/sntp.1
54 mv -v %{BUILDROOT}%{mandir}/man{1/sntp.1,8/sntp.8}
55 rm -rfv %{BUILDROOT}%{mandir}/man1
57 # Fix section numbers.
58 sed -i 's/\(\.TH[a-zA-Z ]*\)[1-9]\(.*\)/\18\2/' \
59 %{BUILDROOT}%{mandir}/man8/*.8
61 mkdir -pv %{BUILDROOT}/%{sysconfdir}/sysconfig
62 mkdir -pv %{BUILDROOT}/%{localstatedir}/{lib/ntp,log/ntpstats}
63 mkdir -pv %{BUILDROOT}%{prefix}/lib
64 touch %{BUILDROOT}/%{localstatedir}/lib/ntp/{drift,sntp-kod}
67 -e "s@VENDORZONE@%{VENDORZONE}@g" \
68 -e "s@ETCNTP@%{sysconfdir}/ntp@g" \
69 -e "s@VARNTP@%{localstatedir}/lib/ntp@g" \
70 < %{DIR_SOURCE}/ntp.conf > %{BUILDROOT}%{sysconfdir}/ntp.conf
72 mkdir -pv %{BUILDROOT}%{sysconfdir}/ntp
73 sed -e "s@VENDORZONE@%{VENDORZONE}@g" \
74 < %{DIR_SOURCE}/ntp.step-tickers > %{BUILDROOT}%{sysconfdir}/ntp/step-tickers
77 mkdir -pv %{BUILDROOT}%{sysconfdir}/ntp/crypto
78 install -p -m 600 %{DIR_SOURCE}/ntp.cryptopw \
79 %{BUILDROOT}%{sysconfdir}/ntp/crypto/pw
82 install -p -m 600 %{DIR_SOURCE}/ntp.keys \
83 %{BUILDROOT}%{sysconfdir}/ntp/keys
85 # Install ntpdate wrapper.
86 install -p -m 755 %{DIR_SOURCE}/ntpdate-wrapper\
87 %{BUILDROOT}%{prefix}/lib/ntpdate-wrapper
88 install -p -m 644 %{DIR_SOURCE}/ntpdate.sysconfig \
89 %{BUILDROOT}%{sysconfdir}/sysconfig/ntpdate
91 mkdir -pv %{unitdir}/ntp-units.d
92 echo "ntpd.service" > %{unitdir}/ntp-units.d/60-ntpd.list
95 chown -R ntp:ntp %{BUILDROOT}%{sharedstatedir}/ntp
100 getent group ntp >/dev/null || groupadd -g 38 ntp || :
101 getent passwd ntp >/dev/null || useradd -u 38 -g 38 -s /sbin/nologin \
102 -M -r -d %{sysconfdir}/ntp ntp || :
114 %{localstatedir}/lib/ntp/drift
118 systemctl daemon-reload >/dev/null 2>&1 || :
119 systemctl --no-reload enable ntpd.service >/dev/null 2>&1 || :
123 systemctl --no-reload disable ntpd.service >/dev/null 2>&1 || :
124 systemctl stop ntpd.service >/dev/null 2>&1 || :
128 systemctl daemon-reload >/dev/null 2>&1 || :
132 systemctl daemon-reload >/dev/null 2>&1 || :
133 systemctl try-restart ntpd.service >/dev/null 2>&1 || :
138 summary = Utility to set the date and time via NTP.
141 ntpdate is a program for retrieving the date and time
147 %{mandir}/man8/ntpdate.8*
155 systemctl daemon-reload >/dev/null 2>&1 || :
159 systemctl --no-reload disable ntpdate.service >/dev/null 2>&1 || :
160 systemctl stop ntpdate.service >/dev/null 2>&1 || :
164 systemctl daemon-reload >/dev/null 2>&1 || :
168 package %{name}-devel
172 package %{name}-debuginfo