Prepare this package for epel8 + python38

This commit is contained in:
Antonio Trande 2021-04-16 17:31:54 +02:00
parent 4c20c41d21
commit b2b0369ad6
3 changed files with 78 additions and 25 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@
/scons-4.0.1.tar.gz
/scons-doc-4.0.1.tar.gz
/scons-4.1.0.tar.gz
/scons-doc-4.1.0.tar.gz

View File

@ -1,27 +1,33 @@
# SCons 4.* works with Python3 >= (3,5,0)
# Python2 is deprecated.
# Python2 is deprecated.
# SCons 4 is not in EPEL8 because already provided by Centos8-stream,
# however building this package in epel8 outside official repositories is possible with Python38.
# See https://bugzilla.redhat.com/show_bug.cgi?id=1823510
%bcond_with debug
# Package documentation files
%if 0%{?el7} || 0%{?fedora}
%bcond_without doc
%else
%bcond_with doc
%global python3_sitelib %{_prefix}/lib/python3.8/site-packages
%endif
# Install prebuilt documentation
%bcond_with prebuilt_doc
# Additional EPEL7 builds
# Additional EPEL builds
%bcond_with python3_other
Name: scons
Version: 4.1.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: An Open Source software construction tool
License: MIT
URL: http://www.scons.org
Source0: https://github.com/SCons/scons/archive/%{version}/scons-%{version}.tar.gz
%if %{with prebuilt_doc}
Source1: https://scons.org/doc/production/scons-doc-%%{version}.tar.gz
%endif
Source1: https://scons.org/doc/production/scons-doc-%{version}.tar.gz
BuildArch: noarch
BuildRequires: make
@ -44,9 +50,9 @@ defined Builder and/or Scanner objects.
%package doc
Summary: An Open Source software construction tool
BuildArch: noarch
%if %{without prebuilt_doc}
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme
%if 0%{without prebuilt_doc}
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: rst2pdf, fop
BuildRequires: python3dist(readme-renderer)
%endif
@ -54,13 +60,23 @@ BuildRequires: python3dist(readme-renderer)
Scons documentation.
%endif
%package -n python%{python3_pkgversion}-%{name}
%package -n python3-%{name}
Summary: An Open Source software construction tool
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-lxml
BuildRequires: python%{python3_pkgversion}-wheel
BuildRequires: python%{python3_pkgversion}-setuptools
%if 0%{?el7} || 0%{?fedora}
BuildRequires: python3-devel
BuildRequires: python3-lxml
BuildRequires: python3-wheel
BuildRequires: python3-setuptools
BuildRequires: lynx
%else
BuildRequires: python38-devel
BuildRequires: python38-lxml
BuildRequires: python38-wheel
BuildRequires: python38-setuptools
BuildRequires: lynx
Provides: scons-python38 = 0:%{version}-%{release}
Provides: python38-scons = 0:%{version}-%{release}
%endif
Provides: scons = 0:%{version}-%{release}
Provides: scons-python3 = 0:%{version}-%{release}
Provides: SCons = 0:%{version}-%{release}
@ -69,9 +85,9 @@ Obsoletes: python34-%{name} < 0:%{version}-%{release}
Obsoletes: python2-%{name} < 0:%{version}-%{release}
Obsoletes: python-%{name} < 0:%{version}-%{release}
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
%{?python_provide:%python_provide python3-%{name}}
%description -n python%{python3_pkgversion}-%{name}
%description -n python3-%{name}
SCons is an Open Source software construction tool--that is, a build
tool; an improved substitute for the classic Make utility; a better way
to build software. SCons is based on the design which won the Software
@ -113,7 +129,7 @@ defined Builder and/or Scanner objects.
%endif
%prep
%if %{with prebuilt_doc}
%if 0%{with prebuilt_doc}
%autosetup -n %{name}-%{version} -N
%setup -n %{name}-%{version} -q -T -D -a 1
cd ..
@ -129,7 +145,11 @@ for file in %{name}-%{version}/src/*.txt; do
mv $file.new $file
done
%if 0%{?el7} || 0%{?fedora}
pathfix.py -i %{__python3} -pn %{name}-%{version}/scripts/scons.py
%else
pathfix3.8.py -i %{__python3} -pn %{name}-%{version}/scripts/scons.py
%endif
%if %{with python3_other}
cp -a %{name}-%{version} %{name}-%{version}-py%{python3_other_pkgversion}
@ -137,7 +157,11 @@ pathfix.py -i %{__python3_other} -pn %{name}-%{version}-py%{python3_other_pkgver
%endif
%build
%if 0%{?el7} || 0%{?fedora}
%{__python3} scripts/scons.py --include-dir= -j1 \
%else
%{_bindir}/python3.8 scripts/scons.py --include-dir= -j1 \
%endif
%if %{with debug}
--debug=explain
%endif
@ -155,15 +179,10 @@ popd
%install
export LDFLAGS="%{build_ldflags}"
export CFLAGS="%{build_cflags}"
%if 0%{?el7} || 0%{?fedora}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot} \
--install-scripts=%{_bindir} \
--install-data=%{_datadir}
rm -rfv %{buildroot}%{_bindir}/__pycache__
# Install manpages
mkdir -p %{buildroot}%{_mandir}/man1
install -pm 644 build/doc/man/*.1 %{buildroot}%{_mandir}/man1/
rm -f %{buildroot}%{_datadir}/*.1
pushd %{buildroot}%{_bindir}
for i in %{name}-3 %{name}-v%{version}-%{python3_version} %{name}-%{python3_version}; do
@ -177,6 +196,32 @@ for i in %{name}-configure-cache-3 %{name}-configure-cache-v%{version}-%{python3
done
popd
%else
%{_bindir}/python3.8 setup.py install -O1 --skip-build --root %{buildroot} \
--install-scripts=%{_bindir} \
--install-data=%{_datadir}
pushd %{buildroot}%{_bindir}
for i in %{name}-3 %{name}-v%{version}-3.8 %{name}-3.8; do
ln -fs %{name} %{buildroot}%{_bindir}/$i
done
for i in %{name}ign-3 %{name}ign-v%{version}-3.8 %{name}ign-3.8; do
ln -fs %{name}ign %{buildroot}%{_bindir}/$i
done
for i in %{name}-configure-cache-3 %{name}-configure-cache-v%{version}-3.8 %{name}-configure-cache-3.8; do
ln -fs %{name}-configure-cache %{buildroot}%{_bindir}/$i
done
popd
%endif
rm -rfv %{buildroot}%{_bindir}/__pycache__
# Install manpages
mkdir -p %{buildroot}%{_mandir}/man1
install -pm 644 build/doc/man/*.1 %{buildroot}%{_mandir}/man1/
rm -f %{buildroot}%{_datadir}/*.1
%if %{with python3_other}
pushd %{name}-%{version}-py%{python3_other_pkgversion}/build/scons
@ -211,7 +256,7 @@ pushd %{name}-%{version}-py%{python3_other_pkgversion}
popd
%endif
%files -n python%{python3_pkgversion}-%{name}
%files -n python3-%{name}
%doc CHANGES.txt RELEASE.*
%license LICENSE*
%{_bindir}/%{name}
@ -236,15 +281,21 @@ popd
%{_mandir}/man1/*
%endif
%if %{with doc}
%files doc
%if %{without prebuilt_doc}
%if 0%{without prebuilt_doc}
%doc build/doc/PDF build/doc/HTML build/doc/TEXT
%else
%doc PDF HTML EPUB TEXT
%endif
%license LICENSE*
%endif
%changelog
* Fri Apr 16 2021 Antonio Trande <sagitter@fedoraproject.org> - 4.1.0-2
- Exclude documentation build in epel8
- Prepare this package for epel8 + python38
* Thu Jan 28 2021 Antonio Trande <sagitter@fedoraproject.org> - 4.1.0-1
- Release 4.1.0

View File

@ -1 +1,2 @@
SHA512 (scons-4.1.0.tar.gz) = f79b86bb09783767b3872cfb8efb665372714a604af2aaf3adc66eee63d3afe27bc6b2aab83813743c83f71c81c800d42842e916501787ba402ce2726dda9b44
SHA512 (scons-doc-4.1.0.tar.gz) = 17fb391e7ac003869b17ee4307fa0633efc736825f162acdac0d9c272a7ef8dcbc70b064b29baf9cbb6afc7e8d96b3e4fffa909ec3c2fb65252d43d2b6136248