Blame SPECS/rh-python35.spec

e46afb
%global scl_name_prefix rh-
e46afb
%global scl_name_base python
e46afb
%global scl_name_version 35
e46afb
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
e46afb
e46afb
## General notes about python33 SCL packaging
e46afb
# - the names of packages are NOT prefixed with 'python3-' (e.g. are the same as in Fedora)
e46afb
# - the names of binaries of Python 3 itself are both python{-debug,...} and python3{-debug,...}
e46afb
#   so both are usable in shebangs, the non-versioned binaries are preferred.
e46afb
# - the names of other binaries are NOT prefixed with 'python3-'.
e46afb
# - there are both macros in '3' variant and non-versioned variant, e.g. both %%{__python}
e46afb
#   and %%{__python3} are available
e46afb
e46afb
%global nfsmountable 1
e46afb
e46afb
%scl_package %scl
e46afb
%global _turn_off_bytecompile 1
e46afb
e46afb
%global install_scl 1
e46afb
e46afb
# do not produce empty debuginfo package
e46afb
%global debug_package %{nil}
e46afb
e46afb
Summary: Package that installs %scl
e46afb
Name: %scl_name
e46afb
Version: 2.0
e46afb
Release: 2%{?dist}
e46afb
License: GPLv2+
e46afb
Source0: macros.additional.%{scl}
e46afb
Source1: README
e46afb
Source2: LICENSE
e46afb
Source3: pythondeps-scl-35.sh
e46afb
BuildRequires: help2man
e46afb
# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=857354
e46afb
BuildRequires: iso-codes
e46afb
BuildRequires: scl-utils-build
e46afb
%if 0%{?install_scl}
e46afb
Requires: %{scl_prefix}python
e46afb
Requires: %{scl_prefix}python-pip
e46afb
Requires: %{scl_prefix}python-setuptools
e46afb
Requires: %{scl_prefix}python-virtualenv
e46afb
%endif
e46afb
e46afb
%description
e46afb
This is the main package for %scl Software Collection.
e46afb
e46afb
%package runtime
e46afb
Summary: Package that handles %scl Software Collection.
e46afb
Requires: scl-utils
e46afb
e46afb
%description runtime
e46afb
Package shipping essential scripts to work with %scl Software Collection.
e46afb
e46afb
%package build
e46afb
Summary: Package shipping basic build configuration
e46afb
Requires: scl-utils-build
e46afb
e46afb
%description build
e46afb
Package shipping essential configuration macros to build %scl Software Collection.
e46afb
e46afb
%package scldevel
e46afb
Summary: Package shipping development files for %scl
e46afb
e46afb
%description scldevel
e46afb
Package shipping development files, especially usefull for development of
e46afb
packages depending on %scl Software Collection.
e46afb
e46afb
%prep
e46afb
%setup -T -c
e46afb
e46afb
# This section generates README file from a template and creates man page
e46afb
# from that file, expanding RPM macros in the template file.
e46afb
cat >README <<'EOF'
e46afb
%{expand:%(cat %{SOURCE1})}
e46afb
EOF
e46afb
e46afb
# copy the license file so %%files section sees it
e46afb
cp %{SOURCE2} .
e46afb
e46afb
%build
e46afb
# generate a helper script that will be used by help2man
e46afb
cat >h2m_helper <<'EOF'
e46afb
#!/bin/bash
e46afb
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
e46afb
EOF
e46afb
chmod a+x h2m_helper
e46afb
e46afb
# generate the man page
e46afb
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
e46afb
# Fix single quotes in man page. See RHBZ#1219531
e46afb
#
e46afb
# http://lists.gnu.org/archive/html/groff/2008-06/msg00001.html suggests that
e46afb
# using "'" for quotes is correct, but the current implementation of man in 6
e46afb
# mangles it when rendering.
e46afb
sed -i "s/'/\\\\(aq/g" %{scl_name}.7
e46afb
e46afb
%install
e46afb
%scl_install
e46afb
e46afb
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
e46afb
export PATH=%{_bindir}\${PATH:+:\${PATH}}
e46afb
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
e46afb
export MANPATH=%{_mandir}:\$MANPATH
e46afb
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
e46afb
export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
e46afb
EOF
e46afb
e46afb
# Add the aditional macros to macros.%%{scl}-config
e46afb
cat %{SOURCE0} >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
e46afb
# instead of replacing @scl@ with %{scl} macro we replace it with scl_name_base and scl_name_version
e46afb
# because scl macro contains vendor prefix rh- and this leads to wrong macro names 
e46afb
# (macro can't contain -) and erros like %rh has illegal name
e46afb
sed -i 's|@scl@|%{scl_name_base}%{scl_name_version}|g' %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
e46afb
sed -i 's|@vendorscl@|%{scl}|g' %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
e46afb
e46afb
# Create the scldevel subpackage macros
e46afb
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
e46afb
%%scl_%{scl_name_base} %{scl}
e46afb
%%scl_prefix_%{scl_name_base} %{scl_prefix}
e46afb
EOF
e46afb
e46afb
mkdir -p %{buildroot}%{_root_prefix}/lib/rpm
e46afb
cp -a %{SOURCE3} %{buildroot}%{_root_prefix}/lib/rpm
e46afb
e46afb
# install generated man page
e46afb
mkdir -p %{buildroot}%{_mandir}/man7/
e46afb
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
e46afb
e46afb
%files
e46afb
e46afb
%files runtime -f filelist
e46afb
%doc README LICENSE
e46afb
%scl_files
e46afb
%{_mandir}/man7/%{scl_name}.*
e46afb
e46afb
%files build
e46afb
%{_root_sysconfdir}/rpm/macros.%{scl}-config
e46afb
%{_root_prefix}/lib/rpm/pythondeps-scl-35.sh
e46afb
e46afb
%files scldevel
e46afb
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
e46afb
e46afb
%changelog
e46afb
* Tue Feb 16 2016 Robert Kuska <rkuska@redhat.com> - 2.0-2
e46afb
- Properly define XDG_DATA_DIRS variable to avoid breaking applications (rhbz#1266529)
e46afb
- Change packages installed by default with collection (rhbz#1229582)
e46afb
- Escape apostrophs in metapackage manual page (rbhz#1219528)
e46afb
e46afb
* Tue Nov 24 2015 Robert Kuska <rkuska@redhat.com> - 2.0-1
e46afb
- Create python35 metapackage