Преглед изворни кода

[rpm] fixup corosync.spec.in to build on opensuse

- move dbus-devel and nss-devel BuildRequires to file based depedency.
  Those 2 BR have different names in OpenSUSE vs Fedora/RHEL/Centos.
  This is kind of controversial as most distribution prefers a package
  based build depedency, but the rpm version that supports
  BuildRequires: foo || bar
  is only available in rawhide and tumbleweed (aka no stable releases
  are shipping it yet).
  In order to build rpms in CI and have some level of flexibility
  with upstream spec file, we need to compromise a bit.

- add explicit --docdir
  OpenSUSE does not ship docs in the normal dir and their rpm macro
  does not appear to set it for us.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto пре 8 година
родитељ
комит
30c7f3319f
1 измењених фајлова са 14 додато и 3 уклоњено
  1. 14 3
      corosync.spec.in

+ 14 - 3
corosync.spec.in

@@ -32,9 +32,15 @@ Requires: corosynclib%{?_isa} = %{version}-%{release}
 
 
 # Build bits
 # Build bits
 
 
+# OpenSUSE needs groff-full to build html documentation,
+# but there is no clean way to express it here.
 BuildRequires: groff
 BuildRequires: groff
 BuildRequires: libqb-devel
 BuildRequires: libqb-devel
-BuildRequires: nss-devel
+# Use file based depedency to allow upstream spec file to
+# build on OpenSUSE since package name differs with Fedora/RHEL/Centos
+# and only recent versions of rpm supports BuildRequires: foo || bar
+# BuildRequires: nss-devel || mozilla-nss-devel
+BuildRequires: /usr/include/nss3/nss.h /usr/include/nspr4/nspr.h
 BuildRequires: libknet1-devel
 BuildRequires: libknet1-devel
 BuildRequires: zlib-devel
 BuildRequires: zlib-devel
 %if %{with runautogen}
 %if %{with runautogen}
@@ -47,7 +53,11 @@ BuildRequires: libstatgrab-devel
 BuildRequires: net-snmp-devel
 BuildRequires: net-snmp-devel
 %endif
 %endif
 %if %{with dbus}
 %if %{with dbus}
-BuildRequires: dbus-devel
+# Use file based depedency to allow upstream spec file to
+# build on OpenSUSE since package name differs with Fedora/RHEL/Centos
+# and only recent versions of rpm supports BuildRequires: foo || bar
+# BuildRequires: dbus-devel || dbus-1-devel
+BuildRequires: /usr/include/dbus-1.0/dbus/dbus.h
 %endif
 %endif
 %if %{with systemd}
 %if %{with systemd}
 %{?systemd_requires}
 %{?systemd_requires}
@@ -98,7 +108,8 @@ BuildRequires: libcgroup-devel
 	--enable-libcgroup \
 	--enable-libcgroup \
 %endif
 %endif
 	--with-initddir=%{_initrddir} \
 	--with-initddir=%{_initrddir} \
-	--with-systemddir=%{_unitdir}
+	--with-systemddir=%{_unitdir} \
+	--docdir=%{_docdir}
 
 
 make %{_smp_mflags}
 make %{_smp_mflags}