diff mbox

[ovs-dev] rpms: %exclude has side-effects, remove the files from buildroot instead

Message ID 162344ada1e22d053343fea37d7a25c01576a4bf.1448460281.git.pmatilai@redhat.com
State Accepted
Headers show

Commit Message

Panu Matilainen Nov. 25, 2015, 2:04 p.m. UTC
Due to the way debuginfo package creation is done in existing rpm
versions, its better to physically remove any non-packaged files
from the buildroot, using %exclude for the purposes causes artifacts
like broken symlinks  in the -debuginfo packages.

Bug-report: https://bugzilla.redhat.com/show_bug.cgi?id=1281913
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 25 ++++++++++++-------------
 rhel/openvswitch.spec.in        | 12 +++++-------
 2 files changed, 17 insertions(+), 20 deletions(-)

Comments

Flavio Leitner Nov. 25, 2015, 4:54 p.m. UTC | #1
On Wed, Nov 25, 2015 at 04:04:41PM +0200, Panu Matilainen wrote:
> Due to the way debuginfo package creation is done in existing rpm
> versions, its better to physically remove any non-packaged files
> from the buildroot, using %exclude for the purposes causes artifacts
> like broken symlinks  in the -debuginfo packages.
> 
> Bug-report: https://bugzilla.redhat.com/show_bug.cgi?id=1281913
> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> ---

Acked-by: Flavio Leitner <fbl@sysclose.org>
Ben Pfaff Nov. 26, 2015, 5:53 a.m. UTC | #2
On Wed, Nov 25, 2015 at 02:54:11PM -0200, Flavio Leitner wrote:
> On Wed, Nov 25, 2015 at 04:04:41PM +0200, Panu Matilainen wrote:
> > Due to the way debuginfo package creation is done in existing rpm
> > versions, its better to physically remove any non-packaged files
> > from the buildroot, using %exclude for the purposes causes artifacts
> > like broken symlinks  in the -debuginfo packages.
> > 
> > Bug-report: https://bugzilla.redhat.com/show_bug.cgi?id=1281913
> > Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> > ---
> 
> Acked-by: Flavio Leitner <fbl@sysclose.org>

Applied to master, thanks!
diff mbox

Patch

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index cb76500..15f5c60 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -162,6 +162,18 @@  install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
 
+# remove unpackaged files
+rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-benchmark \
+        $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \
+        $RPM_BUILD_ROOT%{_bindir}/ovs-pcap \
+        $RPM_BUILD_ROOT%{_bindir}/ovs-tcpundump \
+        $RPM_BUILD_ROOT%{_sbindir}/ovs-vlan-bug-workaround \
+        $RPM_BUILD_ROOT%{_mandir}/man1/ovs-benchmark.1 \
+        $RPM_BUILD_ROOT%{_mandir}/man1/ovs-pcap.1 \
+        $RPM_BUILD_ROOT%{_mandir}/man1/ovs-tcpundump.1 \
+        $RPM_BUILD_ROOT%{_mandir}/man8/ovs-vlan-bug-workaround.8 \
+        $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-save
+
 %check
 %if %{with check}
     if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
@@ -307,9 +319,6 @@  rm -rf $RPM_BUILD_ROOT
 %{_sbindir}/ovs-bugtool
 %{_sbindir}/ovs-vswitchd
 %{_sbindir}/ovsdb-server
-%{_mandir}/man1/ovs-benchmark.1*
-%{_mandir}/man1/ovs-pcap.1*
-%{_mandir}/man1/ovs-tcpundump.1*
 %{_mandir}/man1/ovsdb-client.1*
 %{_mandir}/man1/ovsdb-server.1*
 %{_mandir}/man1/ovsdb-tool.1*
@@ -332,16 +341,6 @@  rm -rf $RPM_BUILD_ROOT
 /var/lib/openvswitch
 /var/log/openvswitch
 %ghost %attr(755,root,root) %{_rundir}/openvswitch
-%exclude %{_bindir}/ovs-benchmark
-%exclude %{_bindir}/ovs-parse-backtrace
-%exclude %{_bindir}/ovs-pcap
-%exclude %{_bindir}/ovs-tcpundump
-%exclude %{_sbindir}/ovs-vlan-bug-workaround
-%exclude %{_mandir}/man1/ovs-benchmark.1.gz
-%exclude %{_mandir}/man1/ovs-pcap.1.gz
-%exclude %{_mandir}/man1/ovs-tcpundump.1.gz
-%exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
-%exclude %{_datadir}/openvswitch/scripts/ovs-save
 
 %files ovn
 %{_bindir}/ovn-controller
diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index 4a2076c..fdb1879 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -64,7 +64,11 @@  rm \
     $RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8 \
     $RPM_BUILD_ROOT/usr/share/man/man8/ovs-l3ping.8 \
     $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \
-    $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8
+    $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8 \
+    $RPM_BUILD_ROOT/usr/bin/ovn-* \
+    $RPM_BUILD_ROOT/usr/share/man/man?/ovn-* \
+    $RPM_BUILD_ROOT/usr/share/openvswitch/ovn-* \
+    $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovn-*
 (cd "$RPM_BUILD_ROOT" && rm -rf usr/lib)
 (cd "$RPM_BUILD_ROOT" && rm -rf usr/include)
 
@@ -180,9 +184,3 @@  exit 0
 %doc INSTALL.DPDK.md rhel/README.RHEL README-native-tunneling.md
 /var/lib/openvswitch
 /var/log/openvswitch
-%exclude /usr/bin/ovn-*
-%exclude /usr/share/man/man5/ovn-*
-%exclude /usr/share/man/man7/ovn-*
-%exclude /usr/share/man/man8/ovn-*
-%exclude /usr/share/openvswitch/ovn-*
-%exclude /usr/share/openvswitch/scripts/ovn-*