Blame SPECS/rh-python38.spec

81856c
%global scl_name_prefix rh-
81856c
%global scl_name_base python
81856c
%global scl_name_version 38
81856c
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
81856c
81856c
## General notes about python38 SCL packaging
81856c
# - the names of packages are NOT prefixed with 'python3-' (e.g. are the same as in Fedora)
81856c
# - the names of binaries of Python 3 itself are both python{-debug,...} and python3{-debug,...}
81856c
#   so both are usable in shebangs, the non-versioned binaries are preferred.
81856c
# - the names of other binaries are NOT prefixed with 'python3-'.
81856c
81856c
# Bootstrap disables dependency on rh-python38-python-srpm-macros which aren't built yet
81856c
%bcond_with bootstrap
81856c
81856c
%global nfsmountable 1
81856c
81856c
%scl_package %scl
81856c
%global _turn_off_bytecompile 1
81856c
81856c
%global install_scl 1
81856c
81856c
# do not produce empty debuginfo package
81856c
%global debug_package %{nil}
81856c
81856c
Summary: Package that installs %scl
81856c
Name: %scl_name
81856c
Version: 2.0
81856c
Release: 4%{?dist}
81856c
License: GPLv2+
81856c
Source0: macros.additional.%{scl}
81856c
Source1: README
81856c
Source2: LICENSE
81856c
BuildRequires: help2man
81856c
# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=857354
81856c
BuildRequires: iso-codes
81856c
BuildRequires: scl-utils-build
81856c
%if 0%{?install_scl}
81856c
Requires: %{scl_prefix}python
81856c
Requires: %{scl_prefix}python-pip
81856c
Requires: %{scl_prefix}python-setuptools
81856c
%endif
81856c
81856c
%description
81856c
This is the main package for %scl Software Collection.
81856c
81856c
%package runtime
81856c
Summary: Package that handles %scl Software Collection.
81856c
Requires: scl-utils
81856c
81856c
%description runtime
81856c
Package shipping essential scripts to work with %scl Software Collection.
81856c
81856c
%package build
81856c
Summary: Package shipping basic build configuration
81856c
Requires: scl-utils-build
81856c
%if %{without bootstrap}
81856c
Requires: %{scl_prefix}python-srpm-macros
81856c
%endif
81856c
81856c
%description build
81856c
Package shipping essential configuration macros to build %scl Software Collection.
81856c
81856c
%package scldevel
81856c
Summary: Package shipping development files for %scl
81856c
81856c
%description scldevel
81856c
Package shipping development files, especially usefull for development of
81856c
packages depending on %scl Software Collection.
81856c
81856c
%prep
81856c
%setup -T -c
81856c
81856c
# This section generates README file from a template and creates man page
81856c
# from that file, expanding RPM macros in the template file.
81856c
cat >README <<'EOF'
81856c
%{expand:%(cat %{SOURCE1})}
81856c
EOF
81856c
81856c
# copy the license file so %%files section sees it
81856c
cp %{SOURCE2} .
81856c
81856c
%build
81856c
# generate a helper script that will be used by help2man
81856c
cat >h2m_helper <<'EOF'
81856c
#!/bin/bash
81856c
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
81856c
EOF
81856c
chmod a+x h2m_helper
81856c
81856c
# generate the man page
81856c
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
81856c
# Fix single quotes in man page. See RHBZ#1219531
81856c
#
81856c
# http://lists.gnu.org/archive/html/groff/2008-06/msg00001.html suggests that
81856c
# using "'" for quotes is correct, but the current implementation of man in 6
81856c
# mangles it when rendering.
81856c
sed -i "s/'/\\\\(aq/g" %{scl_name}.7
81856c
81856c
%install
81856c
%scl_install
81856c
81856c
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
81856c
export PATH=%{_exec_prefix}/local/bin:%{_bindir}\${PATH:+:\${PATH}}
81856c
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
81856c
export MANPATH=%{_mandir}:\$MANPATH
81856c
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
81856c
export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
81856c
EOF
81856c
81856c
# Add the aditional macros to macros.%%{scl}-config
81856c
cat %{SOURCE0} >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
81856c
# instead of replacing @scl@ with %%{scl} macro we replace it with scl_name_base and scl_name_version
81856c
# because scl macro contains vendor prefix rh- and this leads to wrong macro names
81856c
# (macro can't contain -) and erros like %rh has illegal name
81856c
sed -i 's|@scl@|%{scl_name_base}%{scl_name_version}|g' %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
81856c
81856c
# Create the scldevel subpackage macros
81856c
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
81856c
%%scl_%{scl_name_base} %{scl}
81856c
%%scl_prefix_%{scl_name_base} %{scl_prefix}
81856c
EOF
81856c
81856c
# install generated man page
81856c
mkdir -p %{buildroot}%{_mandir}/man7/
81856c
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
81856c
81856c
%files
81856c
81856c
%files runtime -f filelist
81856c
%doc README LICENSE
81856c
%scl_files
81856c
%{_mandir}/man7/%{scl_name}.*
81856c
81856c
%files build
81856c
%{_root_sysconfdir}/rpm/macros.%{scl}-config
81856c
81856c
%files scldevel
81856c
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
81856c
81856c
%changelog
81856c
* Thu Jan 30 2020 Tomas Orsava <torsava@redhat.com> - 2.0-4
81856c
- Modify PATH to also look into /usr/local/bin
81856c
- Resolves: rhbz#1671025
81856c
81856c
* Thu Jan 30 2020 Tomas Orsava <torsava@redhat.com> - 2.0-3
81856c
- Modify package set
81856c
- Resolves: rhbz#1671025
81856c
81856c
* Wed Jan 29 2020 Tomas Orsava <torsava@redhat.com> - 2.0-2
81856c
- Finished bootstrapping
81856c
- Resolves: rhbz#1671025
81856c
81856c
* Mon Jan 06 2020 Tomas Orsava <torsava@redhat.com> - 2.0-1
81856c
- Created the rh-python38 metapackage by importing and modifying rh-python36
81856c
- Resolves: rhbz#1671025