From 78dd721af17dde1ec8d6dca8ba789adb8163fa28d67fff974054be43d835fe13 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Fri, 17 Feb 2017 10:46:09 +0000 Subject: [PATCH] Accepting request 457512 from home:eeich:branches:network:cluster - Cleaned up spec file: add generic defines to the top. OBS-URL: https://build.opensuse.org/request/show/457512 OBS-URL: https://build.opensuse.org/package/show/network:cluster/conman?expand=0&rev=3 --- conman.changes | 5 +++++ conman.spec | 28 +++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/conman.changes b/conman.changes index f12d367..c1733c8 100644 --- a/conman.changes +++ b/conman.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 15 17:48:57 UTC 2017 - eich@suse.com + +- Cleaned up spec file: add generic defines to the top. + ------------------------------------------------------------------- Tue Jan 17 13:53:52 UTC 2017 - eich@suse.com diff --git a/conman.spec b/conman.spec index 674b8e6..6824859 100644 --- a/conman.spec +++ b/conman.spec @@ -14,6 +14,12 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +%if 0%{?suse_version} > 1140 +%define have_systemd 1 + %ifarch x86_64 + %define have_freeipmi 1 + %endif +%endif Name: conman Version: 0.2.7 @@ -28,13 +34,11 @@ Requires: expect Requires: logrotate BuildRequires: tcpd-devel -%if 0%{?suse_version} > 1140 -%ifarch x86_64 +%if 0%{?have_freeipmi} BuildRequires: freeipmi-devel %endif -%endif Source0: https://github.com/dun/conman/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2 -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} Source1: %{name}.service %endif @@ -63,18 +67,16 @@ Its features include: %build %configure --with-tcp-wrappers \ -%if 0%{?suse_version} > 1140 -%ifarch x86_64 +%if 0%{?have_freeipmi} --with-freeipmi \ %endif -%endif make %{?_smp_mflags} %install %make_install -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service rm -rf %{buildroot}%{_sysconfdir}/init.d %{__ln_s} %{_sbindir}/service %{buildroot}%{_sbindir}/rcconman @@ -115,12 +117,12 @@ EOF fi %pre -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} %service_add_pre conman.service %endif %preun -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} %service_del_preun conman.service %else %{stop_on_removal conman} @@ -128,12 +130,12 @@ fi %post %fillup_only conman -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} %service_add_post conman.service %endif %postun -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} %service_del_postun conman.service %else %{restart_on_update conman} @@ -155,7 +157,7 @@ fi %{_bindir}/* %{_sbindir}/* %{_prefix}/lib/conman -%if 0%{?suse_version} > 1140 +%if 0%{?have_systemd} %{_prefix}/lib/systemd/* %else %{_sysconfdir}/init.d/*