diff --git a/scons-4.3.0.tar.gz b/scons-4.3.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..86cf469392088345b289ba8158138284c89bb187 Binary files /dev/null and b/scons-4.3.0.tar.gz differ diff --git a/scons-doc-4.3.0.tar.gz b/scons-doc-4.3.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b827362a02060cb402a6bb203ebdb07902f4cabc Binary files /dev/null and b/scons-doc-4.3.0.tar.gz differ diff --git a/scons.spec b/scons.spec new file mode 100644 index 0000000000000000000000000000000000000000..2be5ae874a09494d8d36be2c57ca4f06e2e96a73 --- /dev/null +++ b/scons.spec @@ -0,0 +1,260 @@ +%define anolis_release 1 +# SCons 4.* works with Python3 >= (3,5,0) +# 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 +%bcond_without doc + +# Install prebuilt documentation +%bcond_without prebuilt_doc + +# Additional EPEL builds +%bcond_with python3_other + +Name: scons +Version: 4.3.0 +Release: %{anolis_release}%{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 +Source1: https://scons.org/doc/production/scons-doc-%{version}.tar.gz +BuildArch: noarch +BuildRequires: make + +%description +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 +Carpentry build tool design competition in August 2000. + +SCons "configuration files" are Python scripts, eliminating the need +to learn a new build tool syntax. SCons maintains a global view of +all dependencies in a tree, and can scan source (or other) files for +implicit dependencies, such as files specified on #include lines. SCons +uses MD5 signatures to rebuild only when the contents of a file have +really changed, not just when the timestamp has been touched. SCons +supports side-by-side variant builds, and is easily extended with user- +defined Builder and/or Scanner objects. + +%if %{with doc} +%package doc +Summary: An Open Source software construction tool +BuildArch: noarch +%if 0%{without prebuilt_doc} +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme +BuildRequires: rst2pdf, fop, ghostscript +BuildRequires: python3dist(readme-renderer) +%endif +%description doc +Scons documentation. +%endif + +%package -n python3-%{name} +Summary: An Open Source software construction tool +BuildRequires: python3-devel +BuildRequires: python3-lxml +BuildRequires: python3-wheel +BuildRequires: python3-setuptools +BuildRequires: lynx +Provides: scons = 0:%{version}-%{release} +Provides: scons-python3 = 0:%{version}-%{release} +Provides: SCons = 0:%{version}-%{release} +%{?python_provide:%python_provide python3-%{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 +Carpentry build tool design competition in August 2000. + +SCons "configuration files" are Python scripts, eliminating the need +to learn a new build tool syntax. SCons maintains a global view of +all dependencies in a tree, and can scan source (or other) files for +implicit dependencies, such as files specified on #include lines. SCons +uses MD5 signatures to rebuild only when the contents of a file have +really changed, not just when the timestamp has been touched. SCons +supports side-by-side variant builds, and is easily extended with user- +defined Builder and/or Scanner objects. + +%if %{with python3_other} +%package -n python%{python3_other_pkgversion}-%{name} +Summary: An Open Source software construction tool + +BuildRequires: python%{python3_other_pkgversion}-devel +BuildRequires: python%{python3_other_pkgversion}-lxml +BuildRequires: python%{python3_other_pkgversion}-setuptools +Provides: scons-%{__python3_other} = %{version}-%{release} +%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{name}} + +%description -n python%{python3_other_pkgversion}-%{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 +Carpentry build tool design competition in August 2000. + +SCons "configuration files" are Python scripts, eliminating the need +to learn a new build tool syntax. SCons maintains a global view of +all dependencies in a tree, and can scan source (or other) files for +implicit dependencies, such as files specified on #include lines. SCons +uses MD5 signatures to rebuild only when the contents of a file have +really changed, not just when the timestamp has been touched. SCons +supports side-by-side variant builds, and is easily extended with user- +defined Builder and/or Scanner objects. +%endif + +%prep +%if 0%{with prebuilt_doc} +%autosetup -n %{name}-%{version} -N +%setup -n %{name}-%{version} -q -T -D -a 1 +cd .. +%else +%autosetup -N -T -b 0 +cd .. +%endif + +# Convert to UTF-8 +for file in %{name}-%{version}/src/*.txt; do + iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \ + touch -r $file $file.new && \ + mv $file.new $file +done + +pathfix.py -i %{__python3} -pn %{name}-%{version}/scripts/scons.py + +# PREVENT MANPAGES REMOVING +# See https://github.com/SCons/scons/issues/3989#issuecomment-890582380 +sed -i -e 's!env.AddPostAction(tgz_file, Delete(man_pages))! !g' %{name}-%{version}/SConstruct + +%if %{with python3_other} +cp -a %{name}-%{version} %{name}-%{version}-py%{python3_other_pkgversion} +pathfix.py -i %{__python3_other} -pn %{name}-%{version}-py%{python3_other_pkgversion}/scripts/scons.py +%endif + +%build + +%{__python3} scripts/scons.py \ +%if %{with debug} + --debug=explain \ +%endif +%if %{without doc} + SKIP_DOC=True +%endif + +%if %{with python3_other} +pushd %{name}-%{version}-py%{python3_other_pkgversion} +%{__python3_other} scripts/scons.py \ +%if %{with debug} + --debug=explain \ +%endif +%if %{without doc} + SKIP_DOC=True +%endif + +popd +%endif + +%install +export LDFLAGS="%{build_ldflags}" +export CFLAGS="%{build_cflags}" +%py3_install -- --install-scripts=%{_bindir} --install-data=%{_datadir} + +pushd %{buildroot}%{_bindir} +for i in %{name}-3 %{name}-v%{version}-%{python3_version} %{name}-%{python3_version}; do + ln -fs %{name} %{buildroot}%{_bindir}/$i +done +for i in %{name}ign-3 %{name}ign-v%{version}-%{python3_version} %{name}ign-%{python3_version}; do + ln -fs %{name}ign %{buildroot}%{_bindir}/$i +done +for i in %{name}-configure-cache-3 %{name}-configure-cache-v%{version}-%{python3_version} %{name}-configure-cache-%{python3_version}; do + ln -fs %{name}-configure-cache %{buildroot}%{_bindir}/$i +done +popd + +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 +%py3_other_install \ + --install-scripts=%{_bindir} \ + --install-data=%{_datadir} + +# Install manpages +mkdir -p %{buildroot}%{_mandir}/man1 +install -pm 644 ../build/doc/man/*.1 %{buildroot}%{_mandir}/man1/ +popd + +pushd %{buildroot}%{_bindir} +for i in %{name}-v%{version}-%{__python3_other} %{name}-%{__python3_other}; do + ln -fs %{name}-%{__python3_other} %{buildroot}%{_bindir}/$i +done +for i in %{name}ign-v%{version}-%{__python3_other} %{name}ign-%{__python3_other}; do + ln -fs %{name}ign-%{__python3_other} %{buildroot}%{_bindir}/$i +done +for i in %{name}-configure-cache-v%{version}-%{__python3_other} %{name}-configure-cache-%{__python3_other}; do + ln -fs %{name}-configure-cache-%{__python3_other} %{buildroot}%{_bindir}/$i +done +popd +%endif +%generate_compatibility_deps + +%check +%{__python3} runtest.py -P %{__python3} --passed --quit-on-failure SCons/BuilderTests.py + +%if %{with python3_other} +pushd %{name}-%{version}-py%{python3_other_pkgversion} +%{__python3_other} runtest.py -P %{__python3_other} --passed --quit-on-failure SCons/BuilderTests.py +popd +%endif + + + +%files -n python3-%{name} +%doc CHANGES.txt RELEASE.* +%license LICENSE* +%{_bindir}/%{name} +%{_bindir}/%{name}ign +%{_bindir}/%{name}-configure-cache +%{_bindir}/%{name}*-3* +%{python3_sitelib}/SCons/ +%{python3_sitelib}/*.egg-info/ +%{_mandir}/man1/* + +%if %{with python3_other} +%files -n python%{python3_other_pkgversion}-%{name} +%doc CHANGES.txt RELEASE.* +%license LICENSE* +%{_bindir}/%{name} +%{_bindir}/%{name}ign +%{_bindir}/%{name}-configure-cache +%{_bindir}/%{name}*-%{__python3_other} +%{_bindir}/%{name}*-%{python3_other_pkgversion} +%{python3_other_sitelib}/SCons/ +%{python3_other_sitelib}/scons-%{version}*.egg-info/ +%{_mandir}/man1/* +%endif + +%if %{with doc} +%files 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 +* Tue Mar 28 2023 Zhongling He - TODO:VERSION +- Init package from upstream