[packages/openntpd] - updated to 6.0p1 - removed TODO, there is no client here - added systemd service
baggins
baggins at pld-linux.org
Mon Apr 17 12:15:52 CEST 2017
commit ada768a4b61ee65beece4a0ca5ddb00848089720
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Apr 17 12:15:20 2017 +0200
- updated to 6.0p1
- removed TODO, there is no client here
- added systemd service
openntpd.init | 2 +-
openntpd.service | 12 ++++++++++++
openntpd.spec | 27 +++++++++++++++++++--------
openntpd.sysconfig | 2 ++
4 files changed, 34 insertions(+), 9 deletions(-)
---
diff --git a/openntpd.spec b/openntpd.spec
index c278fc2..877f187 100644
--- a/openntpd.spec
+++ b/openntpd.spec
@@ -1,25 +1,26 @@
-# TODO
-# - client/daemon package split like ntp.spec
Summary: FREE and easy to use implementation of the Network Time Protocol
Summary(pl.UTF-8): Wolnodostępna i łatwa w użyciu implementacja protokołu NTP
Name: openntpd
-Version: 5.7p4
-Release: 0.1
+Version: 6.0p1
+Release: 1
License: BSD
Group: Daemons
-Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/%{name}-%{version}.tar.gz
-# Source0-md5: 9d818a143fbc5d830203fa2f4b4c6a2a
+Source0: https://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/%{name}-%{version}.tar.gz
+# Source0-md5: 9388979cc2713551bfbdfb3864291abe
Source1: %{name}.init
Source2: %{name}.sysconfig
+Source3: %{name}.service
URL: http://www.openntpd.org/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-tools
BuildRequires: intltool
BuildRequires: openssl-devel
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpmbuild(macros) >= 1.647
Requires(post,preun): /sbin/chkconfig
+Requires(post,preun,postun): systemd-units >= 38
Requires: rc-scripts
+Requires: systemd-units >= 0.38
Provides: ntpclient
Provides: ntpdaemon
Obsoletes: ntpclient
@@ -55,22 +56,31 @@ zegar.
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
+install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} \
+ $RPM_BUILD_ROOT%{systemdunitdir}
+
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
+install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
+
%post
/sbin/chkconfig --add ntpd
%service ntpd restart "OpenNTP Daemon"
+%systemd_post ntpd.service
%preun
if [ "$1" = "0" ]; then
%service ntpd stop
/sbin/chkconfig --del ntpd
fi
+%systemd_preun ntpd.service
+
+%postun
+%systemd_reload
%clean
rm -rf $RPM_BUILD_ROOT
@@ -83,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(754,root,root) /etc/rc.d/init.d/ntpd
%attr(755,root,root) %{_sbindir}/ntpctl
%attr(755,root,root) %{_sbindir}/ntpd
+%{systemdunitdir}/ntpd.service
%{_mandir}/man5/ntpd.conf.5*
%{_mandir}/man8/ntpctl.8*
%{_mandir}/man8/ntpd.8*
diff --git a/openntpd.init b/openntpd.init
index 746c450..d7081a9 100755
--- a/openntpd.init
+++ b/openntpd.init
@@ -29,7 +29,7 @@ start() {
# Check if the service is already running?
if [ ! -f /var/lock/subsys/ntpd ]; then
msg_starting ntpd
- daemon ntpd -s
+ daemon ntpd $NTPD_OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd
else
diff --git a/openntpd.service b/openntpd.service
new file mode 100644
index 0000000..8181914
--- /dev/null
+++ b/openntpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Network Time Service
+After=syslog.target ntpdate.service
+Conflicts=systemd-timesyncd.service
+
+[Service]
+EnvironmentFile=/etc/sysconfig/ntpd
+ExecStart=/usr/sbin/ntpd -d $NTPD_OPTIONS
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openntpd.sysconfig b/openntpd.sysconfig
index 075c754..be93bc2 100644
--- a/openntpd.sysconfig
+++ b/openntpd.sysconfig
@@ -1,4 +1,6 @@
# Set nice level for openntpd
+NTPD_OPTIONS="-s"
+
# Define services nice level
SERVICE_RUN_NICE_LEVEL="+1"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/openntpd.git/commitdiff/ada768a4b61ee65beece4a0ca5ddb00848089720
More information about the pld-cvs-commit
mailing list