[PATCH rdma-core 16/19] build/azp: Add centos6 to the test distributions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

We keep having small defects related to these old glibc's, run a build
here too. The spec file is based on the old pre-packaging rdma-core spec
file.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 buildlib/azure-pipelines.yml |  11 +++-
 buildlib/cbuild              |  15 +++--
 buildlib/centos6.spec        | 109 +++++++++++++++++++++++++++++++++++
 3 files changed, 127 insertions(+), 8 deletions(-)
 create mode 100644 buildlib/centos6.spec

diff --git a/buildlib/azure-pipelines.yml b/buildlib/azure-pipelines.yml
index e062908e23756b..6a69e940a5b19e 100644
--- a/buildlib/azure-pipelines.yml
+++ b/buildlib/azure-pipelines.yml
@@ -10,6 +10,9 @@ resources:
     - container: azp
       image: ucfconsort.azurecr.io/rdma-core/azure_pipelines:25.0
       endpoint: ucfconsort_registry
+    - container: centos6
+      image: ucfconsort.azurecr.io/rdma-core/centos6:25.0
+      endpoint: ucfconsort_registry
     - container: centos7
       image: ucfconsort.azurecr.io/rdma-core/centos7:25.0
       endpoint: ucfconsort_registry
@@ -150,6 +153,10 @@ stages:
           vmImage: 'Ubuntu-16.04'
         strategy:
           matrix:
+            centos6:
+              CONTAINER: centos6
+              SPEC: buildlib/centos6.spec
+              RPMBUILD_OPTS:
             centos7:
               CONTAINER: centos7
               SPEC: redhat/rdma-core.spec
@@ -175,7 +182,7 @@ stages:
               set -e
               mkdir SOURCES tmp
               tar --wildcards -xzf rdma-core*.tar.gz  */$(SPEC) --strip-components=2
-              RPM_SRC=$(rpmspec -P rdma-core.spec | awk '/^Source:/{split($0,a,"[ \t]+");print(a[2])}')
+              RPM_SRC=$((rpmspec -P *.spec || grep ^Source: *.spec) | awk '/^Source:/{split($0,a,"[ \t]+");print(a[2])}')
               (cd SOURCES && ln -sf ../rdma-core*.tar.gz "$RPM_SRC")
-              rpmbuild --define '_tmppath '$(pwd)'/tmp' --define '_topdir '$(pwd) -bb rdma-core.spec $(RPMBUILD_OPTS)
+              rpmbuild --define '_tmppath '$(pwd)'/tmp' --define '_topdir '$(pwd) -bb *.spec $(RPMBUILD_OPTS)
             displayName: Perform Package Build
diff --git a/buildlib/cbuild b/buildlib/cbuild
index cc9c7e2999a9d2..e7065e3e7d8d2d 100755
--- a/buildlib/cbuild
+++ b/buildlib/cbuild
@@ -131,9 +131,10 @@ class centos6(YumEnvironment):
     name = "centos6";
     use_make = True;
     pandoc = False;
-    is_rpm = False;
     build_pyverbs = False;
+    specfile = "buildlib/centos6.spec";
     python_cmd = "python";
+    to_azp = True;
 
 class centos7(YumEnvironment):
     docker_parent = "centos:7";
@@ -713,11 +714,13 @@ with open("/etc/group","a") as F:
 os.setgid({gid:d});
 os.setuid({uid:d});
 
-# Get RPM to tell us the expected tar filename.
-for ln in subprocess.check_output(["rpmspec","-P",{tspec_file!r}]).splitlines():
-   if ln.startswith(b"Source:"):
-      tarfn = ln.strip().partition(b' ')[2].strip();
-os.symlink({tarfn!r},os.path.join(b"SOURCES",tarfn));
+# For Centos6
+if "check_output" in dir(subprocess):
+    # Get RPM to tell us the expected tar filename.
+    for ln in subprocess.check_output(["rpmspec","-P",{tspec_file!r}]).splitlines():
+       if ln.startswith(b"Source:"):
+          tarfn = ln.strip().partition(b' ')[2].strip();
+    os.symlink({tarfn!r},os.path.join(b"SOURCES",tarfn));
 """.format(passwd=":".join(str(I) for I in pwd.getpwuid(os.getuid())),
            group=":".join(str(I) for I in grp.getgrgid(os.getgid())),
            uid=os.getuid(),
diff --git a/buildlib/centos6.spec b/buildlib/centos6.spec
new file mode 100644
index 00000000000000..943b5e65c7e1e5
--- /dev/null
+++ b/buildlib/centos6.spec
@@ -0,0 +1,109 @@
+Name: rdma-core
+Version: 25.0
+Release: 1%{?dist}
+Summary: RDMA core userspace libraries and daemons
+
+# Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license
+#  providers/ipathverbs/ Dual licensed using a BSD license with an extra patent clause
+#  providers/rxe/ Incorporates code from ipathverbs and contains the patent clause
+#  providers/hfi1verbs Uses the 3 Clause BSD license
+License: (GPLv2 or BSD) and (GPLv2 or PathScale-BSD)
+Url: https://github.com/linux-rdma/rdma-core
+Source: rdma-core.tgz
+
+BuildRequires: binutils
+BuildRequires: cmake >= 2.8.11
+BuildRequires: gcc
+BuildRequires: libudev-devel
+BuildRequires: pkgconfig
+BuildRequires: pkgconfig(libnl-3.0)
+BuildRequires: pkgconfig(libnl-route-3.0)
+BuildRequires: valgrind-devel
+BuildRequires: python
+
+%define CMAKE_FLAGS %{nil}
+BuildRequires: make
+
+%description
+Temporary packaging
+
+This is a simple example without the split sub packages to get things started.
+
+%prep
+%setup
+
+%build
+
+%define my_unitdir /tmp/
+
+# New RPM defines _rundir, usually as /run
+%if 0%{?_rundir:1}
+%else
+%define _rundir /var/run
+%endif
+
+# New RPM defines _udevrulesdir, usually as /usr/lib/udev/rules.d
+%if 0%{?_udevrulesdir:1}
+%else
+# This is the old path (eg for C6)
+%define _udevrulesdir /lib/udev/rules.d
+%endif
+
+# Pass all of the rpm paths directly to GNUInstallDirs and our other defines.
+%cmake %{CMAKE_FLAGS} \
+         -DCMAKE_BUILD_TYPE=Release \
+         -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \
+         -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \
+         -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
+         -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \
+         -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \
+         -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=%{_sharedstatedir} \
+         -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir} \
+         -DCMAKE_INSTALL_INFODIR:PATH=%{_infodir} \
+         -DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} \
+         -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
+	 -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=%{my_unitdir} \
+	 -DCMAKE_INSTALL_INITDDIR:PATH=%{_initrddir} \
+	 -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \
+	 -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \
+	 -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \
+         -DCMAKE_INSTALL_PERLDIR:PATH=%{perl_vendorlib}
+make -s %{?_smp_mflags}
+
+%install
+DESTDIR=%{buildroot} make install
+
+%if 0%{?_unitdir:1}
+rm -rf %{buildroot}/%{_initrddir}/
+%else
+rm -rf %{buildroot}/%{my_unitdir}/
+%endif
+
+%files
+%doc %{_mandir}/man*/*
+%{_bindir}/*
+%{_includedir}/*
+%{_libdir}/lib*.so*
+%{_libdir}/libibverbs/*
+%{_libdir}/ibacm/*
+%{_libdir}/rsocket/*
+%{_libdir}/pkgconfig/*.pc
+%{_sbindir}/*
+%{_libexecdir}/*
+%{_udevrulesdir}/*
+%{_udevrulesdir}/../rdma_rename
+%doc %{_docdir}/%{name}-%{version}/*
+%if 0%{?_unitdir:1}
+%{_unitdir}/*
+%else
+%config %{_initrddir}/*
+%endif
+%config %{_sysconfdir}/iwpmd.conf
+%config %{_sysconfdir}/srp_daemon.conf
+%config %{_sysconfdir}/libibverbs.d/*
+%config %{_sysconfdir}/rdma/modules/*
+%{perl_vendorlib}/IBswcountlimits.pm
+%config(noreplace) %{_sysconfdir}/udev/rules.d/*
+%config(noreplace) %{_sysconfdir}/infiniband-diags/error_thresholds
+%config(noreplace) %{_sysconfdir}/infiniband-diags/ibdiag.conf
+%{_sysconfdir}/modprobe.d/*
-- 
2.22.0




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux