chrony-vl.spec 9.7 KB

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