From 7ce665a7e62ae92355771302843747b71ec2649ee5b1ae68e7b402ce53928a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Fri, 5 Sep 2014 21:20:10 +0000 Subject: [PATCH] Accepting request 247706 from home:oertel:branches:hardware - add systemd support (bnc#865857) OBS-URL: https://build.opensuse.org/request/show/247706 OBS-URL: https://build.opensuse.org/package/show/hardware/sbl?expand=0&rev=20 --- brld.service | 10 ++++++++++ sbl.changes | 5 +++++ sbl.service | 10 ++++++++++ sbl.spec | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 brld.service create mode 100644 sbl.service diff --git a/brld.service b/brld.service new file mode 100644 index 0000000..5e5717a --- /dev/null +++ b/brld.service @@ -0,0 +1,10 @@ +[Unit] +Description=Braille Server +Wants=network.target +After=network.target + +[Service] +ExecStart=/usr/sbin/brld + +[Install] +WantedBy=multi-user.target diff --git a/sbl.changes b/sbl.changes index 454d9aa..81d84d7 100644 --- a/sbl.changes +++ b/sbl.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Sep 5 14:46:52 CEST 2014 - ro@suse.de + +- add systemd support (bnc#865857) + ------------------------------------------------------------------- Thu Aug 14 08:24:34 UTC 2014 - tyang@suse.com diff --git a/sbl.service b/sbl.service new file mode 100644 index 0000000..7ca31c2 --- /dev/null +++ b/sbl.service @@ -0,0 +1,10 @@ +[Unit] +Description=suse-blinux +Wants=network.target brld.service +After=network.target brld.service + +[Service] +ExecStart=/usr/sbin/sbl + +[Install] +WantedBy=multi-user.target diff --git a/sbl.spec b/sbl.spec index 1dbd7f4..8db6032 100644 --- a/sbl.spec +++ b/sbl.spec @@ -22,9 +22,15 @@ BuildRequires: gcc-c++ BuildRequires: libusb-devel BuildRequires: orca BuildRequires: speechd-devel +%if %{suse_version} > 1310 +BuildRequires: pkgconfig(libsystemd-daemon) +%{?systemd_requires} +%endif Version: 3.5.0 Release: 0 Source: sbl-3.5.0.tbz2 +Source1: sbl.service +Source2: brld.service Patch1: sbl-shared.patch Patch2: sbl-nostrip.patch Summary: SUSE blinux @@ -72,18 +78,48 @@ make CFLAGS="$RPM_OPT_FLAGS -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE" LIB_CFLAGS="$RPM_ %install make LIBINSTPATH=%{_libdir} DESTDIR=$RPM_BUILD_ROOT install +%if %{suse_version} > 1310 +rm -f $RPM_BUILD_ROOT/etc/init.d/sbl +rm -f $RPM_BUILD_ROOT/etc/init.d/brld +install -D -m 644 %SOURCE1 %{buildroot}%{_unitdir}/sbl.service +install -D -m 644 %SOURCE2 %{buildroot}%{_unitdir}/brld.service +rm -f $RPM_BUILD_ROOT/usr/sbin/rcsbl +rm -f $RPM_BUILD_ROOT/usr/sbin/rcbrld +ln -sf /sbin/service $RPM_BUILD_ROOT/usr/sbin/rcsbl +ln -sf /sbin/service $RPM_BUILD_ROOT/usr/sbin/rcbrld +%endif %clean rm -rf $RPM_BUILD_ROOT +%if %{suse_version} > 1310 +%pre +%service_add_pre sbl.service +%service_add_pre brld.service + +%preun +%service_del_preun brld.service +%service_del_preun sbl.service +%endif + %post /sbin/ldconfig +%if %{suse_version} > 1310 +%service_add_post sbl.service +%service_add_post brld.service +%else %{insserv_force_if_yast etc/init.d/sbl } %{insserv_force_if_yast etc/init.d/brld } +%endif %postun /sbin/ldconfig +%if %{suse_version} > 1310 +%service_del_postun brld.service +%service_del_postun sbl.service +%else %{insserv_cleanup} +%endif %files %defattr (-,root,root,755) @@ -102,8 +138,13 @@ rm -rf $RPM_BUILD_ROOT /usr/sbin/brld /usr/sbin/rcbrld %{_libdir}/libbrld.so.1 +%if %{suse_version} > 1310 +%{_unitdir}/sbl.service +%{_unitdir}/brld.service +%else /etc/init.d/sbl /etc/init.d/brld +%endif /usr/share/man/man8/brld.8.gz /usr/share/man/man8/sbl.8.gz