scons/scons.spec
Tomáš Chvátal 7d5d49b536 Accepting request 640640 from home:mcepl:work
- Make package not to be noarch (bsc#1109755)
- Make package multibuild for separate testing
- Block failing tests (and block %check section completely on
  non-Intel archs, as the tests are apparently not designed for
  that).
- Fix patches from the upstream to improve compatbiilty:
    fix-jN-for-python-37.patch
    fix-rpm-tests-for-newer-rpmbuild.patch
    no_deprecated_asserts.patch
    no_time-clock.patch
    removed_splitunc.patch
    replace_TestSuite_main.patch
    stop_custom_OrderedDict.patch
- Remove replace-imp-with-importlib.patch for now (to stabilize
  the package first)

OBS-URL: https://build.opensuse.org/request/show/640640
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=64
2018-10-08 19:36:14 +00:00

139 lines
3.9 KiB
RPMSpec

#
# spec file for package scons
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
%define modname scons
%global flavor @BUILD_FLAVOR@%{nil}
%bcond_with test
# Tests on non-Intel archs have too many failing tests
# https://pairlist4.pair.net/pipermail/scons-users/2018-October/007311.html
%ifnarch aarch64 armv7l ppc64 ppc64le s390x
%if "%{flavor}" == "test"
%bcond_without test
%endif
%endif
%if %{with test}
Name: %{modname}-%{flavor}
%else
Name: %{modname}
%endif
Version: 3.0.1
Release: 0
Summary: Replacement for Make
License: MIT
Group: Development/Tools/Building
URL: http://www.scons.org/
Source0: https://github.com/SCons/%{modname}/archive/%{version}.tar.gz
#http://www.scons.org/doc/%%{version}/HTML/scons-user.html
Source1: scons-user.html-%{version}.tar.bz2
# Adjust to exclude all failing tests
Source2: grep-filter-list.txt
# Upstream compatibilitt patches
Patch0: no_deprecated_asserts.patch
Patch1: removed_splitunc.patch
Patch2: fix-jN-for-python-37.patch
Patch3: replace_TestSuite_main.patch
Patch4: stop_custom_OrderedDict.patch
Patch5: no_time-clock.patch
# Specific fixes
Patch6: fix-rpm-tests-for-newer-rpmbuild.patch
# Patch7: replace-imp-with-importlib.patch
# Local modification
Patch8: scons-3.0.0-fix-install.patch
BuildRequires: grep
BuildRequires: python3-base >= 3.5
BuildRequires: python3-lxml
Requires: python3-base >= 3.5
%if %{with test}
# For tests
BuildRequires: clang
BuildRequires: docbook-xsl-pdf2index
BuildRequires: docbook5-xsl-stylesheets
BuildRequires: gcc-c++
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: libxslt-tools
BuildRequires: xmlgraphics-fop
# texlive texlive-latex3 biber texmaker ghostscript
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: git
BuildRequires: libtool
BuildRequires: pcre-devel
BuildRequires: subversion
BuildRequires: swig
%endif
%description
SCons is a make replacement that provides a range of enhanced features,
such as automated dependency generation and built-in compilation cache
support. SCons rule sets are Python scripts, which means that SCons
provides itself as well as the features. SCons allows you to use the
full power of Python to control compilation.
%prep
%setup -q -n %{modname}-%{version}
%autopatch -p1
sed -i -e '/QT_LIBPATH = os.path.join.*QTDIR/s/lib/%{_lib}/' \
src/engine/SCons/Tool/qt.py
sed -i 's|%{_bindir}/env python|%{_bindir}/python3|' src/script/*
cp %{SOURCE2} grep-filter-list.txt
%build
python3 bootstrap.py build/scons
cd build/scons
%py3_build
%install
%if !%{with test}
cd build/scons
ls -lh build/lib
%py3_install \
--standard-lib \
--no-install-bat \
--no-version-script \
--install-scripts=%{_bindir} \
--record installed_files.txt
%endif
%check
%if %{with test}
TEMP_FILE=$(mktemp --tmpdir %{modname}-test.XXXXXX)
trap 'rm -f -- "$TEMP_FILE"' INT TERM HUP EXIT
find src/ test/ -name \*.py \
| grep -F -v -f grep-filter-list.txt >$TEMP_FILE
python3 runtest.py -f $TEMP_FILE
%endif
%files
%license LICENSE
%doc src/CHANGES.txt README.rst src/RELEASE.txt
%if !%{with test}
%{_bindir}/*
%{python3_sitelib}/SCons
%{python3_sitelib}/%{modname}*.egg-info
%{_mandir}/man1/*%{ext_man}
%endif
%changelog