chrony-vl.spec 10 KB

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