From 37e0659e34c2d94d1a7b0b67326430dfacc449c5 Mon Sep 17 00:00:00 2001 From: William Brown Date: Tue, 20 Dec 2016 16:27:57 +1000 Subject: [PATCH 2/2] Ticket 48835 - package tests into python site packages - fix rpm Bug Description: While building this, I only tested on fedora. Due to changes in python packaging, on RHEL this failed to build the rpms. Fix Description: fix the python build macros to work on RHEL7 (without epel) and fix the makefile to correctly create the dist file. https://fedorahosted.org/389/ticket/48835 Author: wibrown Review by: ??? --- Makefile.am | 2 ++ rpm/389-ds-base.spec.in | 25 +++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1fa117c..7d49e88 100644 --- a/Makefile.am +++ b/Makefile.am @@ -405,6 +405,7 @@ dist_noinst_HEADERS = \ ldap/servers/slapd/protect_db.h \ ldap/servers/slapd/proto-slap.h \ ldap/servers/slapd/pw.h \ + ldap/servers/slapd/pw_verify.h \ ldap/servers/slapd/secerrstrs.h \ ldap/servers/slapd/slap.h \ ldap/servers/slapd/slapi-plugin-compat4.h \ @@ -494,6 +495,7 @@ dist_noinst_DATA = \ $(srcdir)/LICENSE \ $(srcdir)/LICENSE.* \ $(srcdir)/VERSION.sh \ + $(srcdir)/setup.py.in \ $(srcdir)/wrappers/*.in \ $(srcdir)/wrappers/systemd.template.sysconfig \ $(srcdir)/dirsrvtests \ diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index 2445767..77c77fb 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -233,13 +233,18 @@ Obsoletes: %{name} <= 1.3.5.4 %description snmp SNMP Agent for the 389 Directory Server base package. - - %package -n python2-%{srcname}-tests Summary: The lib389 Continuous Integration Tests Group: Development/Libraries -Requires: python2-lib389 BuildArch: noarch +Requires: python2-lib389 +%if 0%{?rhel} +BuildRequires: python-devel +BuildRequires: python-setuptools +%else +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%endif %description -n python2-%{srcname}-tests The lib389 CI tests that can be run against the Directory Server. @@ -250,8 +255,10 @@ The lib389 CI tests that can be run against the Directory Server. %package -n python%{python3_pkgversion}-%{srcname}-tests Summary: The lib389 Continuous Integration Tests Group: Development/Libraries -Requires: python%{python3_pkgversion}-lib389 BuildArch: noarch +Requires: python%{python3_pkgversion}-lib389 +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools %description -n python%{python3_pkgversion}-%{srcname}-tests The lib389 CI tests that can be run against the Directory Server. @@ -318,9 +325,11 @@ make %{?_smp_mflags} make setup.py -%py2_build %if 0%{?rhel} >= 8 || 0%{?fedora} +%py2_build %py3_build +%else +%py_build %endif %install @@ -335,9 +344,11 @@ popd make DESTDIR="$RPM_BUILD_ROOT" install -%py2_install %if 0%{?rhel} >= 8 || 0%{?fedora} +%py2_install %py3_install +%else +%py_install %endif mkdir -p $RPM_BUILD_ROOT/var/log/%{pkgname} @@ -535,10 +546,12 @@ fi %doc LICENSE LICENSE.GPLv3+ %{python2_sitelib}/* +%if 0%{?rhel} >= 8 || 0%{?fedora} %files -n python%{python3_pkgversion}-%{srcname}-tests %defattr(-,root,root,-) %doc LICENSE LICENSE.GPLv3+ %{python3_sitelib}/* +%endif %changelog * Mon Dec 21 2015 Mark Reynolds - 1.3.4.1-3 -- 1.8.3.1