From c7f8a5282a1e972d91b61a9074d729d7d4c8982b Mon Sep 17 00:00:00 2001 From: Dmitry Butskoy Date: Wed, 17 Aug 2011 17:33:38 +0400 Subject: [PATCH] Migration to Systemd --- zvbi.spec | 56 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/zvbi.spec b/zvbi.spec index d1bb69d..7f76a27 100644 --- a/zvbi.spec +++ b/zvbi.spec @@ -3,7 +3,7 @@ Name: zvbi Version: 0.2.33 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Raw VBI, Teletext and Closed Caption decoding library Group: System Environment/Libraries # See NEWS for a full breakdown of licensing. @@ -20,10 +20,12 @@ BuildRequires: gettext >= 0.16.1 BuildRequires: libpng-devel BuildRequires: libICE-devel BuildRequires: xorg-x11-font-utils -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(postun): /sbin/service +BuildRequires: systemd-units + +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units + %description ZVBI provides functions to capture and decode VBI data. The vertical blanking @@ -74,6 +76,21 @@ Fonts from zvbi converted for use with X11 #Fix character encodings iconv -f iso8859-1 README -t utf8 > README.conv && /bin/mv -f README.conv README +# systemd service file +cat >zvbid.service </dev/null 2>&1 || : +fi %postun /sbin/ldconfig -if [ "$1" -ge "1" ]; then - /sbin/service zvbid condrestart >/dev/null 2>&1 || : + +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 != 0 ]; then + /bin/systemctl try-restart zvbid.service >/dev/null 2>&1 || : fi %preun + if [ $1 = 0 ]; then - /sbin/service zvbid stop >/dev/null 2>&1 || : - /sbin/chkconfig --del zvbid + /bin/systemctl --no-reload disable zvbid.service >/dev/null 2>&1 || : + /bin/systemctl stop zvbid.service >/dev/null 2>&1 || : fi @@ -164,7 +190,8 @@ fi %defattr(-,root,root,-) %{_bindir}/%{name}* %{_sbindir}/zvbid -%{_sysconfdir}/rc.d/init.d/zvbid +#%{_initrddir}/zvbid +%{_unitdir}/zvbid.service %{_libdir}/*.so.* %{_mandir}/man1/* %exclude %{_libdir}/*.a @@ -190,6 +217,9 @@ fi %changelog +* Wed Aug 17 2011 Dmitry Butskoy - 0.2.33-7 +- Migration from SysV to Systemd init system (#730154) + * Tue Feb 08 2011 Fedora Release Engineering - 0.2.33-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild