diff --git a/repack.sh b/repack.sh index 51589e0..7b7f6af 100755 --- a/repack.sh +++ b/repack.sh @@ -1,6 +1,6 @@ #! /bin/bash -version=1.9.7 +version=1.9.9 prerel= src=waf-${version}${prerel}.tar.bz2 diff --git a/sources b/sources index 3040dde..e64560c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (waf-1.9.7.stripped.tar.bz2) = b542f19a16825bfb8b09d92f79a557a4dd8a4d40fbd501eb74e46194949beb6184d3d368557cc491484770570a12d844dd49153620edd69e5fe5d0b30730ed59 +SHA512 (waf-1.9.9.stripped.tar.bz2) = 6a8fd102483a5253b30256f9544bf6d57488b7baacd2c6ab694c1c573a9e93e2c9e52f7dc094985e5b6fb97065a3cd3541e034030358e2ae1f99ecd7f38447b8 diff --git a/waf.spec b/waf.spec index d940578..32b4786 100644 --- a/waf.spec +++ b/waf.spec @@ -15,9 +15,19 @@ # For pre-releases %undefine prerel +# Priorities for the alternatives system +%if 0%{?fedora} > 25 +%global waf_py3_priority 30 +%global waf_py2_priority 20 +%else +# don't change standard binary for released Fedora versions +%global waf_py2_priority 20 +%global waf_py3_priority 10 +%endif + Name: waf -Version: 1.9.7 -Release: %{?prerel:0.}1%{?prerel:.%prerel}%{?dist}.2 +Version: 1.9.9 +Release: %{?prerel:0.}1%{?prerel:.%prerel}%{?dist} Summary: A Python-based build system Group: Development/Tools # The entire source code is BSD apart from pproc.py (taken from Python 2.5) @@ -55,6 +65,9 @@ BuildRequires: ImageMagick Requires: python(abi) = %{python2_version} %endif +# alternatives +Requires(posttrans): %{_sbindir}/alternatives +Requires(preun): %{_sbindir}/alternatives # the demo suite contains a perl module, which draws in unwanted # provides and requires @@ -124,7 +137,7 @@ for f in waflib/extras/*.py ; do extras="${extras:+$extras,}$f" ; fi done -./waf-light --make-waf --strip --tools="$extras" +%{__python2} ./waf-light --make-waf --strip --tools="$extras" %if 0%{?with_docs} # build html docs @@ -163,7 +176,9 @@ ln -s waf-%{python2_version} %{buildroot}%{_bindir}/waf-2 install -m 0755 -p -D waf-light %{buildroot}%{_bindir}/waf-%{python3_version} ln -s waf-%{python3_version} %{buildroot}%{_bindir}/waf-3 %endif # with_python3 -ln -s waf-%{python2_version} %{buildroot}%{_bindir}/waf + +# alternatives-controlled +touch %{buildroot}%{_bindir}/waf # remove shebangs from and fix EOL for all scripts in wafadmin find %{buildroot}%{_datadir}/ -name '*.py' \ @@ -198,17 +213,38 @@ rm -f docs/sphinx/build/html/.buildinfo %endif # with_python3 +%posttrans +%{_sbindir}/alternatives --install %{_bindir}/waf \ + waf %{_bindir}/waf-2 %{waf_py2_priority} || : + + +%preun +%{_sbindir}/alternatives --remove \ + waf %{_bindir}/waf-2 || : + + %files %doc README.md ChangeLog demos_py2/demos -%{_bindir}/waf +%ghost %{_bindir}/waf %{_bindir}/waf-%{python2_version} %{_bindir}/waf-2 %{_datadir}/waf %if 0%{?with_python3} +%posttrans -n %{name}-python3 +%{_sbindir}/alternatives --install %{_bindir}/waf \ + waf %{_bindir}/waf-3 %{waf_py3_priority} || : + + +%preun -n %{name}-python3 +%{_sbindir}/alternatives --remove \ + waf %{_bindir}/waf-3 || : + + %files -n %{name}-python3 %doc README.md ChangeLog demos_py3/demos +%ghost %{_bindir}/waf %{_bindir}/waf-%{python3_version} %{_bindir}/waf-3 %{_datadir}/waf3 @@ -222,6 +258,10 @@ rm -f docs/sphinx/build/html/.buildinfo %changelog +* Wed Apr 5 2017 Thomas Moschny - 1.9.9-1 +- Update to 1.9.9. +- Use alternatives to manage %%{_bindir}/waf (rhbz#1404699). + * Sat Feb 11 2017 Fedora Release Engineering - 1.9.7-1.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild