Migrate to systemd.

epel8
Jon Ciesla 13 years ago
parent 57b8e9b292
commit f7b41175b5

@ -0,0 +1,11 @@
[Unit]
Description=LIRC Infrared Signal Decoder
After=network.target
[Service]
Type=forking
PIDFile=/run/lirc/lircd.pid
ExecStart=/usr/sbin/lircd --driver=default --device=/dev/lirc0
[Install]
WantedBy=multi-user.target

@ -24,7 +24,7 @@
Name: lirc Name: lirc
Version: 0.9.0 Version: 0.9.0
%if 0%{?released} %if 0%{?released}
Release: 8%{?dist} Release: 9%{?dist}
%else %else
Release: 0.1.%{pre}%{?dist} Release: 0.1.%{pre}%{?dist}
%endif %endif
@ -38,8 +38,9 @@ Source0: http://downloads.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
%else %else
Source0: http://www.lirc.org/software/snapshots/%{name}-%{version}-%{pre}.tar.bz2 Source0: http://www.lirc.org/software/snapshots/%{name}-%{version}-%{pre}.tar.bz2
%endif %endif
Source1: %{name}.init Source1: %{name}.service
Source2: %{name}.sysconfig Source2: %{name}.sysconfig
Source3: %{name}md.service
Patch0: lirc-0.9.0-libusb-config-is-no-more.patch Patch0: lirc-0.9.0-libusb-config-is-no-more.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -68,10 +69,13 @@ BuildRequires: libXt-devel
BuildRequires: iguanaIR-devel BuildRequires: iguanaIR-devel
%endif %endif
Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release}
Requires(post): /sbin/chkconfig
Requires(post): /sbin/ldconfig Requires(post): /sbin/ldconfig
Requires(preun): /sbin/chkconfig
Requires(postun): /sbin/ldconfig Requires(postun): /sbin/ldconfig
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
#for triggerun
Requires(post): systemd-sysv
%description %description
LIRC is a package that allows you to decode and send infra-red and LIRC is a package that allows you to decode and send infra-red and
@ -208,12 +212,8 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/xmode2.1*
install -Dpm 644 doc/lirc.hwdb $RPM_BUILD_ROOT%{_datadir}/lirc/lirc.hwdb install -Dpm 644 doc/lirc.hwdb $RPM_BUILD_ROOT%{_datadir}/lirc/lirc.hwdb
install -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/lirc install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/lirc.service
%{__perl} -pi -e \ install -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/lircmd.service
's|/etc/|%{_sysconfdir}/|g ;
s|/var/|%{_localstatedir}/|g ;
s|/usr/sbin/|%{_sbindir}/|g' \
$RPM_BUILD_ROOT%{_initrddir}/lirc
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc
mkdir __docs mkdir __docs
@ -246,7 +246,10 @@ rm -rf $RPM_BUILD_ROOT
%post %post
/sbin/chkconfig --add lirc if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
# If we're upgrading, move config files into their new location, if need be # If we're upgrading, move config files into their new location, if need be
if [ $1 -ge 2 ] ; then if [ $1 -ge 2 ] ; then
if [ -e %{_sysconfdir}/lircd.conf -a ! -e %{_sysconfdir}/lirc/lircd.conf ]; then if [ -e %{_sysconfdir}/lircd.conf -a ! -e %{_sysconfdir}/lirc/lircd.conf ]; then
@ -261,20 +264,44 @@ fi
%preun %preun
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
%{_initrddir}/lirc stop >/dev/null || : # Package removal, not upgrade
/sbin/chkconfig --del lirc || : /bin/systemctl --no-reload disable lirc.service > /dev/null 2>&1 || :
/bin/systemctl stop lirc.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable lircmd.service > /dev/null 2>&1 || :
/bin/systemctl stop lircmd.service > /dev/null 2>&1 || :
fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart lirc.service >/dev/null 2>&1 || :
/bin/systemctl try-restart lircmd.service >/dev/null 2>&1 || :
fi fi
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%triggerun -- lirc < 0.9.0-9
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply lirc
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save lirc >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del lirc >/dev/null 2>&1 || :
/bin/systemctl try-restart lirc.service >/dev/null 2>&1 || :
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO %doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO
%config(noreplace) %{_sysconfdir}/lirc/lirc*d.conf %config(noreplace) %{_sysconfdir}/lirc/lirc*d.conf
%config(noreplace) %{_sysconfdir}/sysconfig/lirc %config(noreplace) %{_sysconfdir}/sysconfig/lirc
%config(noreplace) %{_sysconfdir}/tmpfiles.d/lirc.conf %config(noreplace) %{_sysconfdir}/tmpfiles.d/lirc.conf
%{_initrddir}/lirc %{_unitdir}/lirc*
%{_bindir}/*ir* %{_bindir}/*ir*
%{_bindir}/*mode2 %{_bindir}/*mode2
%{_sbindir}/lirc*d %{_sbindir}/lirc*d
@ -307,6 +334,9 @@ fi
%changelog %changelog
* Thu Apr 19 2012 Jon Ciesla <limburgher@gmail.com> - 0.9.0-9
- Migrate to systemd, BZ 789760.
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-8 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

@ -0,0 +1,11 @@
[Unit]
Description=LIRC Infrared Mouse Event Signal Decoder
Requires=lirc.service
After=network.target lirc.service
[Service]
Type=forking
ExecStart=/usr/sbin/lircmd
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save