Accepting request 561433 from openSUSE:Factory:Staging:O

- Reduce some conditionals for old distros lets consider sle11/rhel6
  as minimal supported configuration
- Make sure we can be built and distributed with python3 only
  present in the system

OBS-URL: https://build.opensuse.org/request/show/561433
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=106
This commit is contained in:
Klaus Kämpf 2018-01-04 08:41:17 +00:00 committed by Git OBS Bridge
parent 2f1df77534
commit fc54490665
2 changed files with 33 additions and 48 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Jan 3 14:30:52 UTC 2018 - tchvatal@suse.com
- Reduce some conditionals for old distros lets consider sle11/rhel6
as minimal supported configuration
- Make sure we can be built and distributed with python3 only
present in the system
-------------------------------------------------------------------
Tue Nov 7 20:07:12 UTC 2017 - mpluskal@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package swig
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@ -17,12 +17,24 @@
%bcond_with swig_ocaml
%if 0%{?fedora} + 0%{?rhel_version} + 0%{?centos_version} > 0
%define docpath %{_docdir}/%{name}-%{version}
BuildRequires: perl-Test-Simple
BuildRequires: perl-devel
BuildRequires: pkgconfig
BuildRequires: ruby
%endif
%if 0%{?suse_version} > 0
%define docpath %{_docdir}/%{name}
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: ruby-devel
%endif
Name: swig
Version: 3.0.12
Release: 0
Summary: Simplified Wrapper and Interface Generator
License: GPL-3.0+ and BSD-3-Clause
License: GPL-3.0+ AND BSD-3-Clause
Group: Development/Languages/C and C++
Url: http://www.swig.org/
Source: http://sourceforge.net/projects/swig/files/swig/%{name}-%{version}/%{name}-%{version}.tar.gz
@ -32,56 +44,24 @@ Patch3: swig-ocaml-int64.patch
Patch4: swig-perl526.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pcre-devel
BuildRequires: perl
%if 0%{?suse_version} > 1325
BuildRequires: libboost_headers-devel
BuildRequires: python2-devel
BuildRequires: python3-devel
BuildRequires: python3-tools
%else
BuildRequires: boost-devel
BuildRequires: python-devel
%endif
BuildRequires: gcc-c++
BuildRequires: libtool
%if %{with swig_ocaml}
BuildRequires: ncurses-devel
BuildRequires: ocaml
BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-findlib
%endif
BuildRequires: pcre-devel
BuildRequires: perl
%if 0%{?rhel_version} > 0
BuildRequires: -vim
%endif
%if 0%{?fedora} + 0%{?rhel_version} + 0%{?centos_version} > 0
%define docpath %{_docdir}/%{name}-%{version}
BuildRequires: pkgconfig
BuildRequires: ruby
%if 0%{?rhel_version} < 600 && 0%{?centos_version} < 600
# not available on RHEL-6
BuildRequires: ruby-devel
%endif
%if 0%{?fedora} > 0 || 0%{?rhel_version} >= 600 ||0%{?centos_version} >= 600
BuildRequires: perl-Test-Simple
BuildRequires: perl-devel
%endif
%endif
%if 0%{?suse_version} > 0
%define docpath %{_docdir}/%{name}
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
# SLE9
%if 0%{?suse_version} < 920
BuildRequires: pkgconfig
BuildRequires: ruby
%else
BuildRequires: pkg-config
# SLE10 and up
BuildRequires: ruby-devel
%endif
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
SWIG is a compiler that attempts to make it easy to integrate C, C++,
@ -98,9 +78,7 @@ Summary: SWIG Manual
License: BSD-3-Clause
Group: Documentation/Man
Requires: swig
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description doc
SWIG is a compiler that attempts to make it easy to integrate C, C++,
@ -152,10 +130,13 @@ export CCSHARED="-fPIC"
make %{?_smp_mflags}
%check
make check
%if 0%{?suse_version} > 1325
export PY3=true
%endif
make %{?_smp_mflags} check
%install
make install DESTDIR=%{buildroot}
%make_install
install -d %{buildroot}%{docpath}
cp -a TODO ANNOUNCE CHANGES* LICENSE README Doc/{Devel,Manual} \
@ -175,9 +156,7 @@ find %{buildroot}%{_libdir}/swig -name '*.h' -perm /111 | \
xargs --no-run-if-empty chmod -x
ln -s %{_libdir}/swig/examples %{buildroot}%{docpath}/Examples
%if 0%{?suse_version} > 1010
%fdupes %{buildroot}
%endif
%files
%defattr(644,root,root,755)
@ -187,12 +166,10 @@ ln -s %{_libdir}/swig/examples %{buildroot}%{docpath}/Examples
%attr(755,root,root) %{_bindir}/swig
%files doc
%defattr(-,root,root)
%{docpath}/Devel
%{docpath}/Manual
%files examples
%defattr(-,root,root)
%{docpath}/Examples
%{_libdir}/swig