Message ID | 20161107164415.GA8780@obsidianresearch.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Hi On 11/7/2016 18:44, Jason Gunthorpe wrote: > On Sun, Nov 06, 2016 at 02:01:20PM +0200, Alaa Hleihel wrote: >> Hi Jason, >> >> The example spec file is broken after commit ddd530be4622 ("Minor RPM spec file improvments"). >> >> rpmbuild fails with the following error: >> >> Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.7l0yoN >> + umask 022 >> + cd /tmp/xxx/BUILD >> + cd rdma-core-11 >> /var/tmp/rpm-tmp.7l0yoN: line 31: syntax error near unexpected token `post' >> error: Bad exit status from /var/tmp/rpm-tmp.7l0yoN (%build) >> >> The issue is that the new "Requires" macros were added after the %prep and %build sections.. > Ah, interesting, in my test scripts the common spec file is > superceeded by the version in redhat/ for systemd systems, which is > why I did not notice it. Yes, it happens with relatively new versions only.. > Jason > > From f2388d9d110ab43295d50d7345d5dda289a87a41 Mon Sep 17 00:00:00 2001 > From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> > Date: Mon, 7 Nov 2016 09:37:38 -0700 > Subject: [PATCH] Fix common rdma-core.spec for systemd systems > > RPM needs the Requires lines for systemd to be earlier. > > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> > --- > rdma-core.spec | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/rdma-core.spec b/rdma-core.spec > index 35186c3271b8..bea2a2267d1d 100644 > --- a/rdma-core.spec > +++ b/rdma-core.spec > @@ -46,6 +46,13 @@ BuildRequires: make > %endif > %endif > > +# Detect if systemd is supported on this system > +%if 0%{?_unitdir:1} > +Requires(post): systemd-units > +Requires(preun): systemd-units > +Requires(postun): systemd-units > +%endif > + > %description > Temporary packaging > > @@ -59,9 +66,6 @@ This is a simple example without the split sub packages to get things started. > # Detect if systemd is supported on this system > %if 0%{?_unitdir:1} > %define my_unitdir %{_unitdir} > -Requires(post): systemd-units > -Requires(preun): systemd-units > -Requires(postun): systemd-units > %else > %define my_unitdir /tmp/ > %endif I tested this patch. It resolves the issue. Thanks, Alaa -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Nov 08, 2016 at 04:47:21PM +0200, Alaa Hleihel wrote: > I tested this patch. > It resolves the issue. Thanks, applied. > > Thanks, > Alaa > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/rdma-core.spec b/rdma-core.spec index 35186c3271b8..bea2a2267d1d 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -46,6 +46,13 @@ BuildRequires: make %endif %endif +# Detect if systemd is supported on this system +%if 0%{?_unitdir:1} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%endif + %description Temporary packaging @@ -59,9 +66,6 @@ This is a simple example without the split sub packages to get things started. # Detect if systemd is supported on this system %if 0%{?_unitdir:1} %define my_unitdir %{_unitdir} -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units %else %define my_unitdir /tmp/ %endif