SHA256
1
0
forked from pool/sbl

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
This commit is contained in:
Cristian Rodríguez 2014-09-05 21:20:10 +00:00 committed by Git OBS Bridge
parent 4e48ac7029
commit 7ce665a7e6
4 changed files with 66 additions and 0 deletions

10
brld.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Braille Server
Wants=network.target
After=network.target
[Service]
ExecStart=/usr/sbin/brld
[Install]
WantedBy=multi-user.target

View File

@ -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

10
sbl.service Normal file
View File

@ -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

View File

@ -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