File runvdr-extreme-systemd.spec of Package runvdr-extreme-systemd

#
# spec file for package runvdr-extreme-systemd
#
# Copyright (C) 2012 Marcel Witte
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 B1 Systems GmbH, Vohburg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           runvdr-extreme-systemd
Version:        0.5.0
Release:        0
Summary:        Startscripts and systemd unit file for VDR
License:        GPL-2.0+
Group:          Hardware/TV
Url:            http://www.udo-richter.de/vdr/scripts.en.html#runvdr
Source0:        runvdr-extreme-%{version}.tar.xz
Source1:        vdr.service
Patch1:         runvdr.conf.suse.patch
# PATCH-FIX-OPENSUSE runvdr-extreme-exitcode.patch -- we need the correct exit code for systemd usage -- seife+obs@b1-systems.com
Patch2:         runvdr-extreme-exitcode.patch
# PATCH-FIX-OPENSUSE runvdr-extreme-systemlanguage.patch -- use /etc/sysconfig/language -- seife+obs@b1-systems.com
Patch3:         runvdr-extreme-systemlanguage.patch
BuildRequires:  systemd-rpm-macros
%{?systemd_requires}
# As vdr-runvdr won't be provided from 2.0.6, just provide the v+1 to obsolete it 
Provides:       vdr-runvdr = 2.0.7
Obsoletes:      vdr-runvdr < 2.0.7
BuildArch:      noarch

%description
This package contains runvdr.extreme as a startscript and a systemd unit file for VDR

%prep
%setup -q -n runvdr-extreme-%{version}
%patch1 -p 1
%patch2 -p 1
%patch3 -p 1

%build
pod2man -s 5 -c runvdr -r runvdr runvdr.conf.pod > runvdr.conf.5

%install
install -m 0755 -D runvdr %{buildroot}%{_bindir}/runvdr.extreme
install -m 0644 -D runvdr.conf.example %{buildroot}%{_sysconfdir}/runvdr.conf
install -m 0644 -D %{SOURCE1} %{buildroot}/%{_unitdir}/vdr.service
mkdir -p %{buildroot}%{_sbindir}
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcvdr
install -m 0644 -D runvdr.conf.5 %{buildroot}/%{_mandir}/man5/runvdr.5

%pre
%service_add_pre vdr.service

%post
%service_add_post vdr.service

%preun
%service_del_preun vdr.service

%postun
%service_del_postun vdr.service

%files
%defattr(-,root,root)
%{_bindir}/runvdr.extreme
%config(noreplace) %{_sysconfdir}/runvdr.conf
%{_sbindir}/rcvdr
%{_unitdir}/vdr.service
%doc COPYING HISTORY README README.de
%doc %{_mandir}/man5/runvdr.*

%changelog
openSUSE Build Service is sponsored by