diff --git a/.gitignore b/.gitignore index cd322dd..3078e8a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ /scons-doc-4.5.1.tar.gz /scons-4.5.2.tar.gz /scons-doc-4.5.2.tar.gz +/SCons-4.6.0.tar.gz +/scons-doc-4.6.0.tar.gz diff --git a/scons.spec b/scons.spec index 31cdfcb..f35e933 100644 --- a/scons.spec +++ b/scons.spec @@ -1,32 +1,18 @@ -# 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 +%global pypi_name SCons # Package documentation files -%if 0%{?el7} || 0%{?el10} || 0%{?fedora} || 0%{?eln} %bcond_without doc -%else -%bcond_with doc -%endif - -%if 0%{?el8} -%global python3_sitelib %{_prefix}/lib/python3.9/site-packages -%endif # Install prebuilt documentation %bcond_without prebuilt_doc Name: scons -Version: 4.5.2 +Version: 4.6.0 Release: %autorelease 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 +Source0: %{pypi_source} Source1: https://scons.org/doc/production/scons-doc-%{version}.tar.gz BuildArch: noarch BuildRequires: make @@ -62,33 +48,14 @@ Scons documentation. %package -n python3-%{name} Summary: An Open Source software construction tool -%if 0%{?el7} || 0%{?el9} || 0%{?el10} || 0%{?fedora} || 0%{?eln} -BuildRequires: python3-devel -BuildRequires: python3-lxml -BuildRequires: python3-wheel -BuildRequires: python3-setuptools -BuildRequires: python3-psutil -BuildRequires: python3-psutil-tests -BuildRequires: lynx -%else -BuildRequires: python39-devel -BuildRequires: python39-lxml -BuildRequires: python39-wheel -BuildRequires: python39-setuptools -BuildRequires: python39-psutil -BuildRequires: lynx -Provides: scons-python39 = 0:%{version}-%{release} -Provides: python39-scons = 0:%{version}-%{release} -%endif -Provides: scons = 0:%{version}-%{release} -Provides: scons-python3 = 0:%{version}-%{release} -Provides: SCons = 0:%{version}-%{release} -%if 0%{?el7} -Obsoletes: python34-%{name} < 0:%{version}-%{release} -Obsoletes: python2-%{name} < 0:%{version}-%{release} -Obsoletes: python-%{name} < 0:%{version}-%{release} -%endif -%py_provides python3-%{name} + +BuildRequires: pyproject-rpm-macros +BuildRequires: python3-devel +BuildRequires: python3-build +%py_provides scons-python3 +%py_provides python3-%{name} +%py_provides SCons +%py_provides scons %description -n python3-%{name} SCons is an Open Source software construction tool--that is, a build @@ -107,103 +74,38 @@ defined Builder and/or Scanner objects. %prep %if 0%{with prebuilt_doc} -%autosetup -n %{name}-%{version} -N -%setup -n %{name}-%{version} -q -T -D -a 1 +%autosetup -n SCons-%{version} -N +%setup -n SCons-%{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 +%generate_buildrequires +%pyproject_buildrequires -x tests -%if 0%{?fedora} || 0%{?eln} || 0%{?el10} -%py3_shebang_fix %{name}-%{version}/scripts/scons.py -%else -pathfix%{python3_version}.py -i %{__python3} -pn %{name}-%{version}/scripts/scons.py -%endif -%if 0%{?el8} -pathfix3.9.py -i %{__python3} -pn %{name}-%{version}/scripts/scons.py -%endif - -# 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 %build -%if 0%{?el7} || 0%{?el9} || 0%{?el10} || 0%{?fedora} || 0%{?eln} -%{__python3} scripts/scons.py \ -%else -%{_bindir}/python3.9 scripts/scons.py \ -%endif -%if %{with debug} - --debug=explain \ -%endif -%if %{without doc} - SKIP_DOC=True -%endif +%pyproject_wheel + %install -export LDFLAGS="%{build_ldflags}" -export CFLAGS="%{build_cflags}" -%if 0%{?el7} || 0%{?el9} || 0%{?el10} || 0%{?fedora} || 0%{?eln} -%py3_install -- --install-scripts=%{_bindir} --install-data=%{_datadir} +%pyproject_install +%pyproject_save_files %{pypi_name} -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 - -%else - -%{_bindir}/python3.9 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.9 %{name}-3.9; do - ln -fs %{name} %{buildroot}%{_bindir}/$i -done -for i in %{name}ign-3 %{name}ign-v%{version}-3.9 %{name}ign-3.9; do - ln -fs %{name}ign %{buildroot}%{_bindir}/$i -done -for i in %{name}-configure-cache-3 %{name}-configure-cache-v%{version}-3.9 %{name}-configure-cache-3.9; do - ln -fs %{name}-configure-cache %{buildroot}%{_bindir}/$i -done -popd -%endif - rm -rfv %{buildroot}%{_bindir}/__pycache__ +rm -rfv %{buildroot}%{python3_sitelib}/SCons/Tool/docbook/__pycache__ # Install manpages mkdir -p %{buildroot}%{_mandir}/man1 -install -pm 644 build/doc/man/*.1 %{buildroot}%{_mandir}/man1/ -rm -f %{buildroot}%{_datadir}/*.1 +install -pm 644 *.1 %{buildroot}%{_mandir}/man1/ +rm -f %{buildroot}%{_prefix}/*.1 -%check -%{__python3} runtest.py -P %{__python3} --passed --quit-on-failure SCons/BuilderTests.py - -%files -n python3-%{name} -%doc CHANGES.txt RELEASE.* -%license LICENSE* +%files -n python3-%{name} -f %{pyproject_files} %{_bindir}/%{name} %{_bindir}/%{name}ign %{_bindir}/%{name}-configure-cache -%{_bindir}/%{name}*-3* -%{python3_sitelib}/SCons/ -%{python3_sitelib}/*.egg-info/ %{_mandir}/man1/* %if %{with doc} @@ -213,7 +115,7 @@ rm -f %{buildroot}%{_datadir}/*.1 %else %doc PDF HTML EPUB TEXT %endif -%license LICENSE* +%license LICENSE %endif %changelog diff --git a/sources b/sources index d95839e..94e85d4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (scons-4.5.2.tar.gz) = aa788d9365a8b5119fef404869562f61cb854be7ceadb5f5d47523e262c07f93ea7476166b577edec25339a64dc6a1f4a6f391fa5aeeab3f086a6659fc72e1ce -SHA512 (scons-doc-4.5.2.tar.gz) = 314caec92fbc1aec6913a4644482af280836ce3d6e21f1a08c29d44eea7811929c011c1c08c9a7c8dcde0d8c38aed1e42a45db75cc13a0df2311d14aed7497c6 +SHA512 (SCons-4.6.0.tar.gz) = c7dc952117c23ac30b8cf1f70ef0c4ad1c0a86c9865fd255fde1a29ea2fbf9e26573b73430f6adc8c545dab753077f380d29d77ac4eede7fce959c86576d2354 +SHA512 (scons-doc-4.6.0.tar.gz) = 07ce1fd6fa0f4482a9b8c4290db15686f071eb1a2fa2b87e72f441743e71604d9862fb5fbf79647ef4a1e53cde003d5b142763aa4fbc1a513d241d6e4062a384