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/*