Pārlūkot izejas kodu

updated 2 packages

chrony-4.5-1

cronie-1.7.2-1
Tomohiro "Tomo-p" KATO 4 mēneši atpakaļ
vecāks
revīzija
03fefc1c23
2 mainītis faili ar 77 papildinājumiem un 59 dzēšanām
  1. 48 35
      c/chrony/chrony-vl.spec
  2. 29 24
      c/cronie/cronie-vl.spec

+ 48 - 35
c/chrony/chrony-vl.spec

@@ -1,7 +1,7 @@
 %bcond_with systemd
 
 Name:           chrony
-Version:        4.1
+Version:        4.5
 Release:        1%{?_dist_release}%{?with_systemd:.systemd}
 Summary:        An NTP client/server
 Group:          system
@@ -12,18 +12,13 @@ Packager:       tomop
 License:        GPLv2
 URL:            https://chrony.tuxfamily.org/
 Source0:        https://download.tuxfamily.org/chrony/chrony-%{version}%{?prerelease}.tar.gz
-Source1:        chrony.conf
 Source2:        chrony.dhclient
 Source3:        chronyd.sysconfig
 Source4:        chronyd.init
-Source5:        chrony.logrotate
+Source6:        chrony.sysusers
 
 # add distribution-specific bits to DHCP dispatcher
 Patch1:         chrony-nm-dispatcher-dhcp.patch
-# update seccomp filter for new glibc
-Patch2:         chrony-seccomp.patch
-# harden chronyd and chrony-wait services
-Patch3:         chrony-services.patch
 
 BuildRequires:  libcap-devel readline-devel ncurses-devel bison
 BuildRequires:  libseccomp-devel
@@ -58,87 +53,101 @@ clocks, system real-time clock or manual input as time references.
 %prep
 %setup -q -n %{name}-%{version}%{?prerelease}
 %patch1 -p1 -b .nm-dispatcher-dhcp
-%patch2 -p1 -b .seccomp
-%patch3 -p1 -b .services
 
 echo '# Keys used by chronyd for command and NTP authentication' > chrony.keys
 
+# use example chrony.conf as the default config with some modifications:
+# - use our vendor zone (2.*pool.ntp.org names include IPv6 addresses)
+# - enable leapsectz to get TAI-UTC offset and leap seconds from tzdata
+# - use NTP servers from DHCP
+sed -e 's|^\(pool \)\(pool.ntp.org\)|\1ntp.nict.jp|' \
+    -e 's|#\(leapsectz\)|\1|' \
+    -e 's|^pool.*pool.ntp.org.*|&\n\n# Use NTP servers from DHCP.\nsourcedir /run/chrony-dhcp|' \
+        < examples/chrony.conf.example2 > chrony.conf
+
+touch -r examples/chrony.conf.example2 chrony.conf
+
 # regenerate the file from getdate.y
 rm -f getdate.c
 
 
 %build
 %configure \
+	--chronyrundir=/run/chrony \
 	--docdir=%{_docdir} \
 	--enable-ntp-signd \
 	--enable-scfilter \
 	--disable-nts \
 	--with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
 	--with-user=chrony \
-	--with-sendmail=%{_sbindir}/sendmail \
-%if %{with systemd}
-	--chronyrundir=/run/chrony \
+	--with-hwclockfile=%{_sysconfdir}/adjtime \
 	--with-pidfile=/run/chrony/chronyd.pid \
-%endif
+	--with-sendmail=%{_sbindir}/sendmail \
 	%{mil}
 make %{?_smp_mflags}
 
 
 %install
-rm -rf %{buildroot}
 
 make install DESTDIR=%{buildroot}
 
 rm -rf %{buildroot}%{_docdir}
 
-mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d}
 mkdir -p %{buildroot}%{_initrddir}
+mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d}
 mkdir -p %{buildroot}%{_localstatedir}/{lib,log}/chrony
 mkdir -p %{buildroot}%{_sysconfdir}/dhcp/dhclient.d
+mkdir -p %{buildroot}%{_libexecdir}
 mkdir -p %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d
+%if %{with systemd}
+mkdir -p %{buildroot}%{_sysusersdir}
+mkdir -p %{buildroot}{%{_unitdir},%{_prefix}/lib/systemd/ntp-units.d}
+%endif
+
 
-install -m 644 -p %{SOURCE1} %{buildroot}%{_sysconfdir}/chrony.conf
-install -m 640 -p chrony.keys %{buildroot}%{_sysconfdir}/chrony.keys
+install -m 644 -p chrony.conf %{buildroot}%{_sysconfdir}/chrony.conf
 install -m 755 -p %{SOURCE2} \
 	%{buildroot}%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
-install -m 644 -p %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/chrony
+install -m 644 -p examples/chrony.logrotate \
+	%{buildroot}%{_sysconfdir}/logrotate.d/chrony
 install -m 755 -p examples/chrony.nm-dispatcher.onoffline \
 	%{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony-onoffline
 install -m 755 -p examples/chrony.nm-dispatcher.dhcp \
 	%{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony-dhcp
 
-install -m 644 -p %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/chronyd
-
 %if %{with systemd}
-mkdir -p %{buildroot}{%{_unitdir},/lib/systemd/ntp-units.d}
 install -m 644 -p examples/chronyd.service \
 	%{buildroot}%{_unitdir}/chronyd.service
+install -m 644 -p examples/chronyd-restricted.service \
+	%{buildroot}%{_unitdir}/chronyd-restricted.service
 install -m 644 -p examples/chrony-wait.service \
 	%{buildroot}%{_unitdir}/chrony-wait.service
-mkdir -p %{buildroot}%{_libexecdir}
+install -m 644 -p %{SOURCE6} \
+	%{buildroot}%{_sysusersdir}/chrony.conf
 echo 'chronyd.service' > \
-        %{buildroot}/lib/systemd/ntp-units.d/50-chronyd.list
+	%{buildroot}/usr/lib/systemd/ntp-units.d/50-chronyd.list
 %else
 install -m 755 -p %{SOURCE4} %{buildroot}%{_initrddir}/chronyd
 %endif
 
-touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
-
+install -m 644 -p %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/chronyd
 
-%clean
-rm -rf %{buildroot}
+touch %{buildroot}%{_sysconfdir}/chrony.keys
+touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
 
 
 %pre
+%if %{with systemd}
+%sysusers_create_compat %{SOURCE6}
+%else
 getent group chrony > /dev/null || /usr/sbin/groupadd -r chrony
 getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \
        -d %{_localstatedir}/lib/chrony -s /sbin/nologin chrony
-:
+exit 0
+%endif
 
 %post
 %if %{with systemd}
-# workaround for late reload of unit file (#1614751)
-%{_bindir}/systemctl daemon-reload
 # migrate from chrony-helper to sourcedir directive
 if test -a %{_libexecdir}/chrony-helper; then
         grep -qi 'sourcedir /run/chrony-dhcp$' %{_sysconfdir}/chrony.conf 2> /dev/null || \
@@ -149,7 +158,7 @@ if test -a %{_libexecdir}/chrony-helper; then
                 sed 's|.*|server &|' < $f > /run/chrony-dhcp/"${f##*servers.}.sources"
         done 2> /dev/null
 fi
-%systemd_post chronyd.service chrony-wait.service
+%systemd_post chronyd.service chronyd-restricted.service chrony-wait.service
 %else
 /sbin/chkconfig --add chronyd
 :
@@ -157,7 +166,7 @@ fi
 
 %preun
 %if %{with systemd}
-%systemd_preun chronyd.service chrony-wait.service
+%systemd_preun chronyd.service chronyd-restricted.service chrony-wait.service
 %else
 if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
         /sbin/service chronyd stop &> /dev/null
@@ -168,7 +177,7 @@ fi
 
 %postun
 %if %{with systemd}
-%systemd_postun_with_restart chronyd.service
+%systemd_postun_with_restart chronyd.service chronyd-restricted.service
 %else
 if [ "$1" -ge 1 ]; then
         /sbin/service chronyd condrestart &> /dev/null
@@ -182,12 +191,13 @@ fi
 %license COPYING
 %doc FAQ NEWS README examples/*
 %config(noreplace) %{_sysconfdir}/chrony.conf
-%config(noreplace) %verify(not md5 size mtime) %attr(640,root,chrony) %{_sysconfdir}/chrony.keys
+%config(noreplace) %attr(640,root,chrony) %{_sysconfdir}/chrony.keys
 %config(noreplace) %{_sysconfdir}/sysconfig/chronyd
 %config(noreplace) %{_sysconfdir}/logrotate.d/chrony
 %if %{with systemd}
-/lib/systemd/ntp-units.d/*.list
+/usr/lib/systemd/ntp-units.d/*.list
 %{_unitdir}/chrony*.service
+%{_sysusersdir}/chrony.conf
 %else
 %{_initrddir}/chronyd
 %endif
@@ -207,6 +217,9 @@ fi
 
 
 %changelog
+* Fri Jul 12 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.5-1
+- new upstream release.
+
 * Wed Nov 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.1-1
 - new upstream release.
 

+ 29 - 24
c/cronie/cronie-vl.spec

@@ -6,7 +6,7 @@
 
 Summary:        Cron daemon for executing programs at set times
 Name:           cronie
-Version:        1.5.7
+Version:        1.7.2
 Release:        1%{?_dist_release}%{?with_systemd:.systemd}
 Group:          system
 Vendor:         Project Vine
@@ -18,7 +18,7 @@ URL:            https://github.com/cronie-crond/cronie
 Source0:        https://github.com/cronie-crond/cronie/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
 # from cronie 1.4.8 tarball
 Source1:        cronie.init
-Patch0:         0001-Address-issues-found-by-coverity-scan.patch
+Patch0:         0001-do-no-leak-file-descriptors.patch
 
 Requires:       dailyjobs
 Conflicts:      vixie-cron
@@ -112,40 +112,40 @@ extra features.
 --enable-pie \
 --enable-relro
 
-make %{?_smp_mflags}
+%make_build V=2
 
 
 %install
-make install DESTDIR=$RPM_BUILD_ROOT DESTMAN=$RPM_BUILD_ROOT%{_mandir}
-mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/cron
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
-mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
+%make_install DESTMAN=%{buildroot}%{_mandir}
+mkdir -pm700 %{buildroot}%{_localstatedir}/spool/cron
+mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/
+mkdir -pm755 %{buildroot}%{_sysconfdir}/cron.d/
 %if ! %{with pam}
-    rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/crond
+    rm -f %{buildroot}%{_sysconfdir}/pam.d/crond
 %endif
-install -m 600 crond.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/crond
-touch $RPM_BUILD_ROOT%{_sysconfdir}/cron.deny
-install -m 600 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
-install -c -m755 contrib/0hourly $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/0hourly
-mkdir -pm 700 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly
-install -c -m755 contrib/0anacron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/0anacron
-mkdir -p $RPM_BUILD_ROOT/var/spool/anacron
-touch $RPM_BUILD_ROOT/var/spool/anacron/cron.daily
-touch $RPM_BUILD_ROOT/var/spool/anacron/cron.weekly
-touch $RPM_BUILD_ROOT/var/spool/anacron/cron.monthly
+install -m 600 crond.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/crond
+touch %{buildroot}%{_sysconfdir}/cron.deny
+install -m 600 contrib/anacrontab %{buildroot}%{_sysconfdir}/anacrontab
+install -c -m755 contrib/0hourly %{buildroot}%{_sysconfdir}/cron.d/0hourly
+mkdir -pm 700 %{buildroot}%{_sysconfdir}/cron.hourly
+install -c -m755 contrib/0anacron %{buildroot}%{_sysconfdir}/cron.hourly/0anacron
+mkdir -p %{buildroot}/var/spool/anacron
+touch %{buildroot}/var/spool/anacron/cron.daily
+touch %{buildroot}/var/spool/anacron/cron.weekly
+touch %{buildroot}/var/spool/anacron/cron.monthly
 
 # noanacron package
-install -m 644 contrib/dailyjobs $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/dailyjobs
+install -m 644 contrib/dailyjobs %{buildroot}%{_sysconfdir}/cron.d/dailyjobs
 
 
 %if %{with systemd}
 # install systemd initscript
-mkdir -p $RPM_BUILD_ROOT%{_unitdir}
-install -m 644 contrib/cronie.systemd $RPM_BUILD_ROOT%{_unitdir}/crond.service
+mkdir -p %{buildroot}%{_unitdir}
+install -m 644 contrib/cronie.systemd %{buildroot}%{_unitdir}/crond.service
 %else
 # install initscript
-mkdir -p $RPM_BUILD_ROOT%{_initddir}
-install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/crond
+mkdir -p %{buildroot}%{_initddir}
+install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/crond
 %endif
 
 
@@ -167,7 +167,7 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/crond
 %if %{with systemd}
 %systemd_preun crond.service
 %else
-if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
+if [ "$1" -eq 0 -o -x /usr/bin/systemctl ]; then
         /sbin/service crond stop >/dev/null 2>&1
         /sbin/chkconfig --del crond
 fi
@@ -232,6 +232,11 @@ fi
 
 
 %changelog
+* Fri Jul 12 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.7.2-1
+- new upstream release.
+- dropped Patch0.
+- imported Patch0 from rawhide.
+
 * Wed Nov 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.7-1
 - new upstream release.
 - imported Patch0 from rawhide.