Accepting request 94398 from home:elvigia:branches:Base:System

- Use systemd macros in pre/post scripts

OBS-URL: https://build.opensuse.org/request/show/94398
OBS-URL: https://build.opensuse.org/package/show/Base:System/irqbalance?expand=0&rev=16
This commit is contained in:
Andreas Jaeger 2011-11-30 08:32:10 +00:00 committed by Git OBS Bridge
parent 382114686e
commit ad5e236160
2 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Nov 29 21:11:49 UTC 2011 - crrodriguez@opensuse.org
- Use systemd macros in pre/post scripts
-------------------------------------------------------------------
Mon Oct 17 13:59:37 UTC 2011 - trenn@suse.de

View File

@ -36,6 +36,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1130
BuildRequires: libcap-ng-devel
%endif
%if 0%{?suse_version} > 1140
BuildRequires: systemd
%{?systemd_requires}
%define has_systemd 1
%endif
%description
irqbalance dynamically switches the CPUs for IRQs to prevent cpu0 from
@ -61,24 +66,41 @@ mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 irqbalance.1.gz %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/
install -m 0644 sysconfig.irqbalance %{buildroot}%{_localstatedir}/adm/fillup-templates/
mkdir -p %{buildroot}/lib/systemd/system/
install -D -p -m 0644 misc/irqbalance.service %{buildroot}/lib/systemd/system/
%if 0%{?has_systemd}
install -D -m 0644 misc/irqbalance.service %{buildroot}%{_unitdir}/irqbalance.service
%endif
%pre
%if 0%{?has_systemd}
%service_add_pre irqbalance.service
%endif
%post
%fillup_only
%if 0%{?has_systemd}
%service_add_post irqbalance.service
%endif
%preun
%stop_on_removal irq_balancer
%if 0%{?has_systemd}
%service_del_preun irqbalance.service
%endif
%postun
%restart_on_update irq_balancer
%insserv_cleanup
%if 0%{?has_systemd}
%service_del_postun irqbalance.service
%endif
%files
%defattr(-,root,root,-)
%{_sbindir}/irqbalance
%{_sysconfdir}/init.d/irq_balancer
/lib/systemd/system/irqbalance.service
%if 0%{?has_systemd}
%{_unitdir}/irqbalance.service
%endif
%{_sbindir}/rcirq_balancer
%{_mandir}/man1/irqbalance.1.gz
%{_localstatedir}/adm/fillup-templates/sysconfig.irqbalance