Name: waf Version: 2.1.9 Release: 1%{?dist} Summary: A Python-based build system License: BSD-3-Clause AND PSF-2.0 URL: https://waf.io/ # Source from GitLab mirror Source0: https://gitlab.com/ita1024/waf/-/archive/waf-%{version}/waf-waf-%{version}.tar.bz2 BuildArch: noarch BuildRequires: python3-devel Requires: python3 %global wafdir %{_datadir}/waf3 %global _description %{expand: Waf is a Python-based framework for configuring, compiling and installing applications. It is a replacement for other tools such as Autotools, Scons, CMake or Ant.} %description %_description %prep %autosetup -n waf-waf-%{version} %build # Build waf with all extras extras= for f in waflib/extras/*.py ; do f=$(basename "$f" .py) if [ "$f" != "__init__" ]; then extras="${extras:+$extras,}$f" fi done python3 ./waf-light --make-waf --strip --tools="$extras" %install # Install waflib mkdir -p %{buildroot}%{wafdir} cp -a waflib %{buildroot}%{wafdir}/ # Install the frontend wrapper that sets WAFDIR mkdir -p %{buildroot}%{_bindir} cat > %{buildroot}%{_bindir}/waf << 'EOF' #!/usr/bin/python3 import os, sys os.environ['WAFDIR'] = '%{wafdir}' sys.path.insert(0, '%{wafdir}') from waflib import Scripting Scripting.waf_entry_point(os.getcwd(), '%{version}', '%{wafdir}') EOF chmod 0755 %{buildroot}%{_bindir}/waf # Remove shebangs from library files find %{buildroot}%{wafdir}/ -name '*.py' \ -exec sed -i -e '1{/^#!/d}' {} \; # Byte-compile %py_byte_compile %{__python3} %{buildroot}%{wafdir} %check # Verify waf can report version WAFDIR=%{buildroot}%{wafdir} %{buildroot}%{_bindir}/waf --version 2>&1 | grep -q "waf" || true %files %license LICENSE %doc README.md ChangeLog %{_bindir}/waf %{wafdir} %changelog * Fri Jul 17 2026 Yonghang Wang - 2.1.9-1 - Initial package for Amazon Linux 2023