diff --git a/brltty.spec b/brltty.spec index 49945df..f11f44d 100644 --- a/brltty.spec +++ b/brltty.spec @@ -1,8 +1,8 @@ %define pkg_version 4.5 %define api_version 0.6.0 -%{!?tcl_version: %define tcl_version %(echo 'puts $tcl_version' | tclsh)} -%{!?tcl_sitearch: %define tcl_sitearch %{_prefix}/%{_lib}/tcl%{tcl_version}} +%{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)} +%{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}} # with speech dispatcher iff on Fedora: %define with_speech_dispatcher 0%{?fedora} @@ -13,16 +13,21 @@ Name: brltty Version: %{pkg_version} -Release: 3%{?dist} +Release: 5%{?dist} License: GPLv2+ Group: System Environment/Daemons URL: http://mielke.cc/brltty/ -Source: http://mielke.cc/brltty/releases/%{name}-%{version}.tar.gz +Source0: http://mielke.cc/brltty/releases/%{name}-%{version}.tar.gz +Source1: brltty.service Patch4: brltty-loadLibrary.patch Summary: Braille display driver for Linux/Unix BuildRequires: byacc glibc-kernheaders bluez-libs-devel +BuildRequires: systemd # work around a bug in the install process: Requires(post): coreutils +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description BRLTTY is a background process (daemon) which provides @@ -232,6 +237,8 @@ install -d -m 755 "${RPM_BUILD_ROOT}%{_sysconfdir}" "$RPM_BUILD_ROOT%{_mandir}/m install -m 644 Documents/brltty.conf "${RPM_BUILD_ROOT}%{_sysconfdir}" echo ".so man1/brltty.1" > $RPM_BUILD_ROOT%{_mandir}/man5/brltty.conf.5 +install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/brltty.service + # clean up the manuals: rm Documents/Manual-*/*/{*.mk,*.made,Makefile*} mv Documents/BrlAPIref/{html,BrlAPIref} @@ -240,6 +247,7 @@ mv Documents/BrlAPIref/{html,BrlAPIref} rm -rf $RPM_BUILD_ROOT/%{_libdir}/libbrlapi.a %post +%systemd_post brltty.service devices="/dev/vcsa /dev/vcsa0 /dev/vcc/a" install=true for device in ${devices} @@ -260,12 +268,20 @@ then fi exit 0 + +%preun +%systemd_preun brltty.service + +%postun +%systemd_postun_with_restart brltty.service + %post -n brlapi -p /sbin/ldconfig %postun -n brlapi -p /sbin/ldconfig %files %config(noreplace) %{_sysconfdir}/brltty.conf %{_sysconfdir}/brltty/ +%{_unitdir}/brltty.service %{_bindir}/brltty %{_bindir}/brltty-* %{_libdir}/brltty/ @@ -334,6 +350,9 @@ exit 0 %endif %changelog +* Tue Apr 30 2013 Jon Ciesla - 4.5-5 +- Add systemd unit file, BZ 916628. + * Tue Apr 30 2013 Jon Ciesla - 4.5-3 - Add bluetooth support, BZ 916628.