File scons.spec of Package scons
#
# spec file for package scons
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%bcond_without test
Name: scons
Version: 4.3.0
Release: 0
Summary: A software construction tool
License: MIT
Group: Development/Tools/Building
URL: https://www.scons.org/
Source0: https://github.com/SCons/scons/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://www.scons.org/doc/%{version}/HTML/scons-user.html
Source2: skip-test-list.txt
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-base >= 3.6
BuildRequires: python3-setuptools
BuildRequires: python3-wheel
Requires: python3-base >= 3.6
BuildArch: noarch
%if %{with test}
BuildRequires: bison
BuildRequires: clang
BuildRequires: docbook-xsl-stylesheets
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: libxslt-devel
BuildRequires: libxslt-tools
BuildRequires: m4
BuildRequires: ninja
BuildRequires: python3-dbm
BuildRequires: python3-devel
BuildRequires: python3-lxml
BuildRequires: swig
# disable doc test for now, missing sphinx dependencies in openSUSE
# BuildRequires: python3-Sphinx
# BuildRequires: xmlgraphics-fop
BuildRequires: zip
%endif
%description
SCons is an Open Source software construction tool. Think of SCons as
an improved, cross-platform substitute for the classic Make utility
with integrated functionality similar to autoconf/automake and compiler
caches such as ccache. In short, SCons is an easier, more reliable and
faster way to build software.
%prep
%setup -q
sed -i 's|%{_bindir}/env python|%{_bindir}/python3|' scripts/*
sed -i 's|%{_bindir}/env python|%{_bindir}/python3|' bin/*
chmod -x CHANGES.txt README.rst RELEASE.txt
%build
python3 scripts/scons.py
%install
%python3_install
%fdupes %{buildroot}%{python3_sitelib}/
install -D -m 0755 bin/scons-time.py %{buildroot}/%{_bindir}/scons-time
install -D -m 0644 %{SOURCE1} %{buildroot}/%{_docdir}/%{name}/scons-user.html
# remove dummy man-pages
rm %{buildroot}%{_prefix}/scons-time.1 %{buildroot}%{_prefix}/scons.1 %{buildroot}%{_prefix}/sconsign.1
%check
%if %{with test}
python3 runtest.py -a --exclude-list %{SOURCE2}
%endif
%files
%license LICENSE
%doc CHANGES.txt README.rst RELEASE.txt
%doc scons-user.html
%{_bindir}/scons
%{_bindir}/scons-configure-cache
%{_bindir}/scons-time
%{_bindir}/sconsign
%{python3_sitelib}/SCons-*-py*.*-info
%changelog