From e07edee0e0b83205da248bce9a5ab6eee433f413 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 15 Feb 2017 12:14:52 -0800 Subject: [PATCH] Re-add macro compat cruft for RHEL, comment upstream spec --- python-productmd.spec | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/python-productmd.spec b/python-productmd.spec index c3b08aa..949bf94 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -1,3 +1,10 @@ +# ** IMPORTANT NOTE ** +# This spec is also tracked in productmd upstream git: +# https://github.com/release-engineering/productmd +# Please synchronize changes to it with upstream, and be aware that +# the spec is used for builds on pure RHEL (i.e. without EPEL packages +# or macros). + # Enable Python 3 builds for Fedora + EPEL >5 # NOTE: do **NOT** change 'epel' to 'rhel' here, as this spec is also # used to do RHEL builds without EPEL @@ -9,6 +16,15 @@ %bcond_with python3 %endif +# Compatibility with RHEL. These macros have been added to EPEL but +# not yet to RHEL proper. +# https://bugzilla.redhat.com/show_bug.cgi?id=1307190 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}} +%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} + Name: python-productmd Version: 1.4 Release: 3%{?dist} @@ -76,6 +92,10 @@ and installation media. %{__python3} ./setup.py test %endif +# this must go after all 'License:' tags +# Implemented in EPEL, but not in RHEL +%{!?_licensedir:%global license %doc} + %files %license LICENSE %doc AUTHORS @@ -91,6 +111,9 @@ and installation media. %endif %changelog +* Wed Feb 15 2017 Adam Williamson +- Restore compatibility cruft for pure-RHEL builds + * Sat Feb 11 2017 Fedora Release Engineering - 1.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild