chrony-vl.spec 10.0 KB

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