Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Tom "spot" Callaway
8827523200 convert to systemd 2011-09-15 14:56:35 -04:00
2 changed files with 47 additions and 19 deletions

13
shmpps.service Normal file
View file

@ -0,0 +1,13 @@
[Unit]
Description=PPS Shared Memory Driver For NTP
After=syslog.target
Before=ntpd.service
[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/shmpps
ExecStart=/usr/sbin/shm_splc2 $OPTIONS
[Install]
WantedBy=multi-user.target

View file

@ -1,20 +1,21 @@
Name: shmpps
Version: 1.03
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Shared Memory driver for PPS time signals
Group: System Environment/Daemons
License: Public Domain and MIT
URL: http://time.qnan.org/
Source0: http://time.qnan.org/%{name}.tar
Source1: shmpps.init
Source1: shmpps.service
Source2: shmpps.sysconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ntp
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig /sbin/service
Requires(postun): /sbin/service
BuildRequires: systemd-units
Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%description
Shared memory (SHM) driver to allow high-resolution pulse-per-second
@ -34,35 +35,49 @@ sed -i \
make CFLAGS="%{optflags}" LDFLAGS=""
%install
rm -rf %{buildroot}
install -p -m755 -D shm_splc2 %{buildroot}%{_sbindir}/shm_splc2
install -p -m755 -D %{SOURCE1} %{buildroot}%{_initrddir}/shmpps
install -p -m644 -D %{SOURCE1} %{buildroot}%{_unitdir}/shmpps.service
install -p -m644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/shmpps
%clean
rm -rf %{buildroot}
%post
/sbin/chkconfig --add shmpps
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ "$1" -eq 0 ]; then
/sbin/service shmpps stop > /dev/null 2>&1
/sbin/chkconfig --del shmpps
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable shmpps.service > /dev/null 2>&1 || :
/bin/systemctl stop shmpps.service > /dev/null 2>&1 || :
fi
%postun
if [ "$1" -ge 1 ]; then
/sbin/service shmpps condrestart > /dev/null 2>&1
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart shmpps.service >/dev/null 2>&1 || :
fi
%triggerun -- shmpps < 1.03-3
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply shmpps
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save shmpps >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del shmpps >/dev/null 2>&1 || :
/bin/systemctl try-restart shmpps.service >/dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%{_sbindir}/shm_splc2
%{_initrddir}/shmpps
%{_unitdir}/shmpps.service
%config(noreplace) %{_sysconfdir}/sysconfig/shmpps
%changelog
* Thu Sep 15 2011 Tom Callaway <spot@fedoraproject.org> - 1.03-3
- convert to systemd
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.03-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild