From e3e5b53f2b90bf9b03f890c7886235868b2a1c25 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 31 2016 08:13:33 +0000 Subject: import python27-1.1-25.el7 --- diff --git a/SOURCES/macros.additional.python27 b/SOURCES/macros.additional.python27 index 60753a6..4fcaa6e 100644 --- a/SOURCES/macros.additional.python27 +++ b/SOURCES/macros.additional.python27 @@ -1,6 +1,9 @@ # override __os_install_post for this collection # the python27_os_install_post macro is defined in macros.python2.python27 in python27-python-devel # the name is intentionally hardcoded to always provide the same name +%@scl@_python_provides /usr/lib/rpm/pythondeps-scl-27.sh --provides %{?scl:@vendorscl@-} +%@scl@_python_requires /usr/lib/rpm/pythondeps-scl-27.sh --requires %{?scl:@vendorscl@-} + %scl_package_override() %{expand:%{?@scl@_os_install_post:%global __os_install_post %@scl@_os_install_post} %global __python_requires %@scl@_python_requires %global __python_provides %@scl@_python_provides @@ -13,4 +16,5 @@ %global python_sitearch %@scl@python2_sitearch %global python2_version %@scl@python2_version %global python_version %@scl@python2_version +%global scl_no_vendor @scl@ } diff --git a/SOURCES/pythondeps-scl-27.sh b/SOURCES/pythondeps-scl-27.sh new file mode 100755 index 0000000..7edaa68 --- /dev/null +++ b/SOURCES/pythondeps-scl-27.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Altered from pythondeps.sh +# The second parameter is %{scl_prefix}, which is used to prefix python(abi). + +[ $# -ge 1 ] || { + cat > /dev/null + exit 0 +} + +case $1 in +-P|--provides) + shift + # Match buildroot/payload paths of the form + # /PATH/OF/BUILDROOT/%{_scl_root}/usr/bin/pythonMAJOR.MINOR + # generating a line of the form + # %{scl_prefix}python(abi) = MAJOR.MINOR + # (Don't match against -config tools e.g. /usr/bin/python2.6-config) + if [ "x$1" = "x" ]; then + grep "/usr/bin/python.\..$" \ + | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|" + else + grep "/opt/.*/usr/bin/python.\..$" \ + | sed -e "s|.*/usr/bin/python\(.\..\)|$1python(abi) = \1|" + fi + ;; +-R|--requires) + shift + # Match buildroot paths of the form + # /PATH/OF/BUILDROOT/%{scl_root}/usr/lib/pythonMAJOR.MINOR/ and + # /PATH/OF/BUILDROOT/%{scl_root}/usr/lib64/pythonMAJOR.MINOR/ + # generating (uniqely) lines of the form: + # %{scl_prefix}python(abi) = MAJOR.MINOR + if [ "x$1" = "x" ]; then + grep "/usr/lib[^/]*/python.\../.*" \ + | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \ + | sort | uniq + else + grep "/opt/.*/usr/lib[^/]*/python.\../.*" \ + | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|$1python(abi) = \1|g" \ + | sort | uniq + fi + ;; +esac + +exit 0 diff --git a/SPECS/python27.spec b/SPECS/python27.spec index 026f7c5..a789903 100644 --- a/SPECS/python27.spec +++ b/SPECS/python27.spec @@ -13,11 +13,12 @@ Summary: Package that installs %scl Name: %scl_name Version: 1.1 -Release: 20%{?dist} +Release: 25%{?dist} License: GPLv2+ Source0: macros.additional.%{scl} Source1: README Source2: LICENSE +Source3: pythondeps-scl-27.sh BuildRequires: help2man # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=857354 BuildRequires: iso-codes @@ -82,6 +83,12 @@ chmod a+x h2m_helper # generate the man page help2man -N --section 7 ./h2m_helper -o %{scl_name}.7 +# Fix single quotes in man page. See RHBZ#1219527 +# +# http://lists.gnu.org/archive/html/groff/2008-06/msg00001.html suggests that +# using "'" for quotes is correct, but the current implementation of man in 6 +# mangles it when rendering. +sed -i "s/'/\\\\(aq/g" %{scl_name}.7 %install rm -rf %{buildroot} @@ -92,7 +99,7 @@ export PATH=%{_bindir}\${PATH:+:\${PATH}} export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}} export MANPATH=%{_mandir}:\${MANPATH} # For systemtap -export XDG_DATA_DIRS=%{_datadir}\${XDG_DATA_DIRS:+:\${XDG_DATA_DIRS}} +export XDG_DATA_DIRS=%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share} # For pkg-config export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}} EOF @@ -101,6 +108,7 @@ EOF # Add the aditional macros to macros.%%{scl}-config cat %{SOURCE0} >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config sed -i 's|@scl@|%{scl}|g' %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config +sed -i 's|@vendorscl@|%{scl}|g' %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config # Create the scldevel subpackage macros cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF @@ -108,6 +116,9 @@ cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << E %%scl_prefix_%{scl_name_base} %{scl_prefix} EOF +mkdir -p %{buildroot}%{_root_prefix}/lib/rpm +cp -a %{SOURCE3} %{buildroot}%{_root_prefix}/lib/rpm + # install generated man page mkdir -p %{buildroot}%{_mandir}/man7/ install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7 @@ -121,11 +132,28 @@ install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7 %files build %{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_prefix}/lib/rpm/pythondeps-scl-27.sh %files scldevel %{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel %changelog +* Wed Apr 20 2016 Charalampos Stratakis - 1.1-25 +- Properly seperate paths for XDG_DATA_DIRS variable (rhbz#1266529) + +* Fri Apr 15 2016 Charalampos Stratakis - 1.1-24 +- Fix SPEC file syntax error for XDG_DATA_DIRS variable definition (rhbz#1266529) + +* Wed Feb 17 2016 Robert Kuska - 1.1-23 +- Insert proper value into requires/provides macros + +* Wed Feb 17 2016 Michal Cyprian - 1.1-22 +- Add script pythondeps-scl-27.sh to manage provides and requires + +* Tue Feb 16 2016 Charalampos Stratakis - 1.1-21 +- Properly define XDG_DATA_DIRS variable to avoid breaking applications (rhbz#1266529) +- Escape apostrophs in metapackage manual page(rhbz#1219527) + * Tue Jan 20 2015 Slavek Kabrda - 1.1-20 - Require python-pip and python-wheel (note: in rh-python34 this is not necessary, because "python" depends on these).