[iwhd] maint: add comment: %{_unitdir} BuildReqires: systemd-units

Pete Zaitcev zaitcev at redhat.com
Wed Nov 30 15:44:09 UTC 2011


On Wed, 30 Nov 2011 14:39:10 +0000 (UTC)
Jim Meyering <meyering at fedoraproject.org> wrote:

> +++ b/iwhd.spec.in
> @@ -71,7 +71,7 @@ rm -rf %{buildroot}
>  %{_localstatedir}/lib/iwhd
>  
> -# Use _unitdir on F16+
> +# Use _unitdir on F16+, and add this: BuildRequires: systemd-units
>  #{_unitdir}/iwhd.service
>  /lib/systemd/system/iwhd.service

How about this instead:

diff --git a/iwhd.spec.in b/iwhd.spec.in
index bbd70a5..4983c7c 100644
--- a/iwhd.spec.in
+++ b/iwhd.spec.in
@@ -31,6 +31,11 @@ BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: help2man
 
+# this defines %{_unitdir}
+%if 0%{?fedora} >= 17
+BuildRequires: systemd-units
+%endif
+
 # mongodb-server is required at build time so make check succeeds
 BuildRequires: mongodb-server
 
@@ -71,9 +76,11 @@ rm -rf %{buildroot}
 %config(noreplace)	%{_sysconfdir}/sysconfig/iwhd
 %{_localstatedir}/lib/iwhd
 
-# Use _unitdir on F16+, and add this: BuildRequires: systemd-units
-#{_unitdir}/iwhd.service
+%if 0%{?fedora} >= 17
+%{_unitdir}/iwhd.service
+%else
 /lib/systemd/system/iwhd.service
+%endif
 
 %changelog
 * Wed Oct  7 2010 Jim Meyering <meyering at redhat.com> - 0.90-1

An %if is not something welcome in distro specs, but perhaps ok
for our in-tree spec. As long as an unifdef-ing it produces the
spec that we actually use in Koji, I think it should be fine.

-- Pete


More information about the iwhd-devel mailing list