Providing native systemd file for upcoming F14 Feature Systemd

Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
This commit is contained in:
Nikola Pajkovsky 2010-08-11 15:53:51 +02:00
parent 32a43902a0
commit d3732f1270
2 changed files with 32 additions and 10 deletions

14
gpm.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Console Mouse manager
After=syslog.target
# This could probably benefit from socket activation, but honestly I think it
# is time for gpm to go away, and hence I am not planning to spend the time
# to add socket activation here.
[Service]
ExecStart=/usr/sbin/gpm -m /dev/input/mice -t exps2 -D
StandardOutput=syslog
[Install]
WantedBy=multi-user.target

View File

@ -1,13 +1,14 @@
Summary: A mouse server for the Linux console Summary: A mouse server for the Linux console
Name: gpm Name: gpm
Version: 1.20.6 Version: 1.20.6
Release: 9%{?dist} Release: 10%{?dist}
License: GPLv2+ License: GPLv2+
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://unix.schottelius.org/gpm/ URL: http://unix.schottelius.org/gpm/
Source: http://unix.schottelius.org/gpm/archives/%{name}-%{version}.tar.lzma Source: http://unix.schottelius.org/gpm/archives/%{name}-%{version}.tar.lzma
Source1: gpm.init Source1: gpm.init
Source2: inputattach.c Source2: inputattach.c
Source3: gpm.service
Patch1: gpm-1.20.6-multilib.patch Patch1: gpm-1.20.6-multilib.patch
Patch2: gpm-1.20.1-lib-silent.patch Patch2: gpm-1.20.1-lib-silent.patch
Patch3: gpm-1.20.3-gcc4.3.patch Patch3: gpm-1.20.3-gcc4.3.patch
@ -18,6 +19,7 @@ Patch6: gpm-1.20.6-libtool.patch
Requires(post): /sbin/chkconfig /sbin/install-info /sbin/ldconfig Requires(post): /sbin/chkconfig /sbin/install-info /sbin/ldconfig
Requires(preun): /sbin/chkconfig /sbin/install-info Requires(preun): /sbin/chkconfig /sbin/install-info
Requires(postun): /sbin/ldconfig Requires(postun): /sbin/ldconfig
Requires: systemd-units
# this defines the library version that this package builds. # this defines the library version that this package builds.
%define LIBVER 2.1.0 %define LIBVER 2.1.0
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
@ -90,10 +92,11 @@ ln -sf libgpm.so.%{LIBVER} %{buildroot}/%{_libdir}/libgpm.so
%ifnarch s390 s390x %ifnarch s390 s390x
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
mkdir -p %{buildroot}/lib/systemd/system/
install -m 755 inputattach %{buildroot}%{_sbindir} install -m 755 inputattach %{buildroot}%{_sbindir}
install -m 644 conf/gpm-* %{buildroot}%{_sysconfdir} install -m 644 conf/gpm-* %{buildroot}%{_sysconfdir}
install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm install -m 644 %{SOURCE3} %{buildroot}/lib/systemd/system/
%else %else
# we're shipping only libraries in s390[x], so # we're shipping only libraries in s390[x], so
# remove stuff from the buildroot that we aren't shipping # remove stuff from the buildroot that we aren't shipping
@ -107,7 +110,7 @@ rm -rf %{buildroot}
%post %post
%ifnarch s390 s390x %ifnarch s390 s390x
/sbin/chkconfig --add gpm /bin/systemctl enable gpm.service >/dev/null 2>&1 || :
%endif %endif
if [ -e %{_infodir}/gpm.info.gz ]; then if [ -e %{_infodir}/gpm.info.gz ]; then
/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir || : /sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir || :
@ -117,18 +120,20 @@ fi
%preun %preun
%ifnarch s390 s390x %ifnarch s390 s390x
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
/sbin/service gpm stop >/dev/null 2>&1 /bin/systemctl disable gpm.service >/dev/null 2>&1 || :
/sbin/chkconfig --del gpm /bin/systemctl stop gpm.service >/dev/null 2>&1 || :
fi fi
%endif %endif
if [ $1 = 0 -a -e %{_infodir}/gpm.info.gz ]; then if [ $1 = 0 -a -e %{_infodir}/gpm.info.gz ]; then
/sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir || : /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir || :
fi f
%postun %postun
%ifnarch s390 s390x %ifnarch s390 s390x
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/sbin/service gpm condrestart >/dev/null 2>&1 # On upgrade, reload init system configuration if we changed unit files
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
# On upgrade, restart the daemon
/bin/systemctl try-restart gpm.service >/dev/null 2>&1 || :
fi fi
%endif %endif
/sbin/ldconfig /sbin/ldconfig
@ -140,7 +145,7 @@ fi
%{_infodir}/* %{_infodir}/*
%ifnarch s390 s390x %ifnarch s390 s390x
%config(noreplace) %{_sysconfdir}/gpm-* %config(noreplace) %{_sysconfdir}/gpm-*
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/gpm /lib/systemd/system/gpm.service
%{_sbindir}/* %{_sbindir}/*
%{_bindir}/* %{_bindir}/*
%{_mandir}/man?/* %{_mandir}/man?/*
@ -160,6 +165,9 @@ fi
%{_libdir}/libgpm.a %{_libdir}/libgpm.a
%changelog %changelog
* Wed Aug 11 2010 Nikola Pajkovsky <npajkovs@redhat.com> 1.20.6-10
- Providing native systemd file for upcoming F14 Feature Systemd
* Thu Dec 10 2009 Nikola Pajkovsky <npajkovs@redhat.com> 1.20.6-9 * Thu Dec 10 2009 Nikola Pajkovsky <npajkovs@redhat.com> 1.20.6-9
- add try-restart into gpm.init to be more LSB-compilant - add try-restart into gpm.init to be more LSB-compilant