chrony-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. %bcond_with systemd
  2. Name: chrony
  3. Version: 4.1
  4. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  5. Summary: An NTP client/server
  6. Group: system
  7. Vendor: Project Vine
  8. Distribution: Vine Linux
  9. Packager: tomop
  10. License: GPLv2
  11. URL: https://chrony.tuxfamily.org/
  12. Source0: https://download.tuxfamily.org/chrony/chrony-%{version}%{?prerelease}.tar.gz
  13. Source1: chrony.conf
  14. Source2: chrony.dhclient
  15. Source3: chronyd.sysconfig
  16. Source4: chronyd.init
  17. Source5: chrony.logrotate
  18. # add distribution-specific bits to DHCP dispatcher
  19. Patch1: chrony-nm-dispatcher-dhcp.patch
  20. # update seccomp filter for new glibc
  21. Patch2: chrony-seccomp.patch
  22. # harden chronyd and chrony-wait services
  23. Patch3: chrony-services.patch
  24. BuildRequires: libcap-devel readline-devel ncurses-devel bison
  25. BuildRequires: libseccomp-devel
  26. BuildRequires: gcc gcc-c++ bison gnupg2 net-tools
  27. BuildRequires: gnutls-devel gnutls-utils
  28. Requires(pre): shadow-utils
  29. %if %{with systemd}
  30. BuildRequires: systemd
  31. %{?systemd_requires}
  32. %else
  33. Requires(post): chkconfig
  34. Requires(preun): chkconfig initscripts
  35. Requires(postun): initscripts
  36. %endif
  37. %if "%{?_dist_release}" == "vl7"
  38. Obsoletes: ntp < 4.2.6p5
  39. %endif
  40. %description
  41. A client/server for the Network Time Protocol, this program keeps your
  42. computer's clock accurate. It was specially designed to support
  43. systems with intermittent internet connections, but it also works well
  44. in permanently connected environments. It can use also hardware reference
  45. clocks, system real-time clock or manual input as time references.
  46. %debug_package
  47. %prep
  48. %setup -q -n %{name}-%{version}%{?prerelease}
  49. %patch1 -p1 -b .nm-dispatcher-dhcp
  50. %patch2 -p1 -b .seccomp
  51. %patch3 -p1 -b .services
  52. echo '# Keys used by chronyd for command and NTP authentication' > chrony.keys
  53. # regenerate the file from getdate.y
  54. rm -f getdate.c
  55. %build
  56. %configure \
  57. --docdir=%{_docdir} \
  58. --enable-ntp-signd \
  59. --enable-scfilter \
  60. --disable-nts \
  61. --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
  62. --with-user=chrony \
  63. --with-sendmail=%{_sbindir}/sendmail \
  64. %if %{with systemd}
  65. --chronyrundir=/run/chrony \
  66. --with-pidfile=/run/chrony/chronyd.pid \
  67. %endif
  68. %{mil}
  69. make %{?_smp_mflags}
  70. %install
  71. rm -rf %{buildroot}
  72. make install DESTDIR=%{buildroot}
  73. rm -rf %{buildroot}%{_docdir}
  74. mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d}
  75. mkdir -p %{buildroot}%{_initrddir}
  76. mkdir -p %{buildroot}%{_localstatedir}/{lib,log}/chrony
  77. mkdir -p %{buildroot}%{_sysconfdir}/dhcp/dhclient.d
  78. mkdir -p %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d
  79. install -m 644 -p %{SOURCE1} %{buildroot}%{_sysconfdir}/chrony.conf
  80. install -m 640 -p chrony.keys %{buildroot}%{_sysconfdir}/chrony.keys
  81. install -m 755 -p %{SOURCE2} \
  82. %{buildroot}%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
  83. install -m 644 -p %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/chrony
  84. install -m 755 -p examples/chrony.nm-dispatcher.onoffline \
  85. %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony-onoffline
  86. install -m 755 -p examples/chrony.nm-dispatcher.dhcp \
  87. %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony-dhcp
  88. install -m 644 -p %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/chronyd
  89. %if %{with systemd}
  90. mkdir -p %{buildroot}{%{_unitdir},/lib/systemd/ntp-units.d}
  91. install -m 644 -p examples/chronyd.service \
  92. %{buildroot}%{_unitdir}/chronyd.service
  93. install -m 644 -p examples/chrony-wait.service \
  94. %{buildroot}%{_unitdir}/chrony-wait.service
  95. mkdir -p %{buildroot}%{_libexecdir}
  96. echo 'chronyd.service' > \
  97. %{buildroot}/lib/systemd/ntp-units.d/50-chronyd.list
  98. %else
  99. install -m 755 -p %{SOURCE4} %{buildroot}%{_initrddir}/chronyd
  100. %endif
  101. touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
  102. %clean
  103. rm -rf %{buildroot}
  104. %pre
  105. getent group chrony > /dev/null || /usr/sbin/groupadd -r chrony
  106. getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \
  107. -d %{_localstatedir}/lib/chrony -s /sbin/nologin chrony
  108. :
  109. %post
  110. %if %{with systemd}
  111. # workaround for late reload of unit file (#1614751)
  112. %{_bindir}/systemctl daemon-reload
  113. # migrate from chrony-helper to sourcedir directive
  114. if test -a %{_libexecdir}/chrony-helper; then
  115. grep -qi 'sourcedir /run/chrony-dhcp$' %{_sysconfdir}/chrony.conf 2> /dev/null || \
  116. echo -e '\n# Use NTP servers from DHCP.\nsourcedir /run/chrony-dhcp' >> \
  117. %{_sysconfdir}/chrony.conf
  118. mkdir -p /run/chrony-dhcp
  119. for f in %{_localstatedir}/lib/dhclient/chrony.servers.*; do
  120. sed 's|.*|server &|' < $f > /run/chrony-dhcp/"${f##*servers.}.sources"
  121. done 2> /dev/null
  122. fi
  123. %systemd_post chronyd.service chrony-wait.service
  124. %else
  125. /sbin/chkconfig --add chronyd
  126. :
  127. %endif
  128. %preun
  129. %if %{with systemd}
  130. %systemd_preun chronyd.service chrony-wait.service
  131. %else
  132. if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
  133. /sbin/service chronyd stop &> /dev/null
  134. /sbin/chkconfig --del chronyd
  135. fi
  136. :
  137. %endif
  138. %postun
  139. %if %{with systemd}
  140. %systemd_postun_with_restart chronyd.service
  141. %else
  142. if [ "$1" -ge 1 ]; then
  143. /sbin/service chronyd condrestart &> /dev/null
  144. fi
  145. :
  146. %endif
  147. %files
  148. %defattr(-,root,root,-)
  149. %license COPYING
  150. %doc FAQ NEWS README examples/*
  151. %config(noreplace) %{_sysconfdir}/chrony.conf
  152. %config(noreplace) %verify(not md5 size mtime) %attr(640,root,chrony) %{_sysconfdir}/chrony.keys
  153. %config(noreplace) %{_sysconfdir}/sysconfig/chronyd
  154. %config(noreplace) %{_sysconfdir}/logrotate.d/chrony
  155. %if %{with systemd}
  156. /lib/systemd/ntp-units.d/*.list
  157. %{_unitdir}/chrony*.service
  158. %else
  159. %{_initrddir}/chronyd
  160. %endif
  161. %dir %{_prefix}/lib/NetworkManager
  162. %dir %{_prefix}/lib/NetworkManager/dispatcher.d
  163. %{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony*
  164. %dir %{_sysconfdir}/dhcp
  165. %dir %{_sysconfdir}/dhcp/dhclient.d
  166. %{_sysconfdir}/dhcp/dhclient.d/chrony.sh
  167. %{_bindir}/chronyc
  168. %{_sbindir}/chronyd
  169. %{_mandir}/man[158]/%{name}*.[158]*
  170. %dir %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony
  171. %ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/drift
  172. %ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/rtc
  173. %dir %attr(-,chrony,chrony) %{_localstatedir}/log/chrony
  174. %changelog
  175. * Wed Nov 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.1-1
  176. - new upstream release.
  177. * Tue Sep 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.1-2
  178. - rebuilt with nettle-3.6.
  179. * Thu Aug 27 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.1-1
  180. - new upstream release.
  181. * Mon Apr 06 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5-2
  182. - added systemd stuff (disabled as default).
  183. - updated Source2.
  184. * Wed Mar 25 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5-1
  185. - new upstream release.
  186. - dropped Patch102: fixed in upstream.
  187. * Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> 3.2-2
  188. - rebuild with readline-8.0 and ncurses-6.1
  189. * Sat Jun 9 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 3.2-1
  190. - update to 3.2
  191. - drop Patch101; upstream merged
  192. - add Fedora's patch (Patch102)
  193. * Tue Dec 05 2017 Miroslav Lichvar <mlichvar@redhat.com> 3.2-2
  194. - fix chronyc getting stuck in infinite loop after clock step (#1520884)
  195. - restrict obsoleting 'ntp' package to VineSeed; for Vine Linux 6
  196. * Thu May 18 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 3.0-1
  197. - update to 3.0
  198. - add patch to fix time smoothing in interleaved mode (Patch101); from Debian 3.0-4
  199. - drop chrony.txt in %%doc; upstream dropped
  200. - drop info file; upstream dropped
  201. - drop R: info
  202. - drop BR: texinfo
  203. - drop scripts for info
  204. * Mon Jul 11 2016 IWAI, Masaharu <iwaim.sub@gmail.com> 2.2.1-2
  205. - Obsoletes: networkmanager-dispatcher-chrony
  206. * Wed Mar 23 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.1-1
  207. - new upstream release.
  208. * Fri Oct 23 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2-1
  209. - new upstream release.
  210. * Sat Jul 25 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.1.1-1
  211. - new upstream release.
  212. * Tue Dec 23 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.31-1
  213. - new upstream release.
  214. * Sat Jun 7 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.29.1-1
  215. - new upstream release.
  216. - initial build for Vine Linux.
  217. * Fri Aug 09 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.25-3
  218. - fix buffer overflow when processing crafted command packets (CVE-2012-4502)
  219. - don't send uninitialized data in command replies (CVE-2012-4503)
  220. * Thu May 19 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-2
  221. - remove timepps.h, NM and dhclient scripts
  222. - build with readline
  223. * Thu May 05 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-1
  224. - update to 1.25
  225. - link with -Wl,-z,relro,-z,now options
  226. - use iburst, four pool servers, rtcsync, stratumweight in default config
  227. - suppress install-info errors
  228. * Thu Apr 29 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-4.20100428git73d775
  229. - update to 20100428git73d775
  230. - replace initstepslew directive with makestep in default config
  231. - add NetworkManager dispatcher script
  232. - add dhclient script
  233. - retry server/peer name resolution at least once to workaround
  234. NetworkManager race condition on boot
  235. - don't verify chrony.keys
  236. * Fri Mar 12 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-3.20100302git5fb555
  237. - update to snapshot 20100302git5fb555
  238. - compile with PPS API support
  239. * Thu Feb 04 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-1
  240. - update to 1.24 (#555367, CVE-2010-0292 CVE-2010-0293 CVE-2010-0294)
  241. - modify default config
  242. - step clock on start if it is off by more than 100 seconds
  243. - disable client log
  244. - build with -fPIE on sparc
  245. * Tue Dec 15 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.24-0.1.pre1
  246. - update to 1.24-pre1
  247. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-7.20081106gitbe42b4
  248. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  249. * Fri Jul 17 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.23-6.20081106gitbe42b4
  250. - switch to editline
  251. - support arbitrary chronyc commands in init script
  252. * Mon Jun 08 2009 Dan Horak <dan[at]danny.cz> 1.23-5.20081106gitbe42b4
  253. - add patch with support for s390/s390x
  254. * Mon Mar 09 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.23-4.20081106gitbe42b4
  255. - fix building with broken libcap header (#483548)
  256. * Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-3.20081106gitbe42b4
  257. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  258. * Wed Nov 19 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.23-2.20081106gitbe42b4
  259. - fix info uninstall
  260. - generate random command key in init script
  261. - support cyclelogs, online, offline commands in init script
  262. - add logrotate script
  263. * Tue Nov 11 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.23-1.20081106gitbe42b4
  264. - initial release