python-sip/python3-sip.spec

107 lines
3.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python3-sip
#
# Copyright (c) 2011 SUSE LINUX Products 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 http://bugs.opensuse.org/
#
Name: python3-sip
Version: 4.13
Release: 2
License: GPL-2.0 or GPL-3.0 or SIP
Summary: SIP tool to use python sip bindings
%define rversion %{version}
Url: http://www.riverbankcomputing.com/software/sip/intro
Group: Development/Libraries/Python
Source0: sip-%{rversion}.tar.bz2
Patch0: disable-rpaths.diff
Patch1: build-compare.diff
BuildRequires: c++_compiler
BuildRequires: python3
BuildRequires: python3-devel
Requires(pre): python3
Requires: python3
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1140
Requires(pre): python3-base
Requires: python3-base
%endif
%global py3_incdir %(python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_inc(True))" 2>/dev/null || echo PYTHON-NOT-FOUND)
%global python3_sitearch %(python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True))" 2>/dev/null || echo PYTHON-NOT-FOUND)
%description
SIP is a tool that makes it very easy to create Python bindings for C
and C++ libraries. It was originally developed to create PyQt, the
Python bindings for the Qt toolkit, but can be used to create bindings
for any C or C++ library.
%package devel
License: GPL-2.0 or GPL-3.0 or SIP
Summary: SIP tool to create python bindings
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: c++_compiler
Requires: python-sip-bin
Requires: python3-devel
Provides: python3-sip:/usr/bin/sip
%description devel
SIP is a tool that makes it very easy to create Python bindings for C
and C++ libraries. It was originally developed to create PyQt, the
Python bindings for the Qt toolkit, but can be used to create bindings
for any C or C++ library.
This package contains all the developer tools you need to create your
own sip bindings.
%prep
%setup -q -n sip-%{rversion}
%patch0
%patch1
%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export SUSE_ASNEEDED=0
python3 configure.py --debug CFLAGS+="%{optflags}" CXXFLAGS+="%{optflags}"
make %{?_smp_mflags}
%install
%make_install
mkdir -p %{buildroot}%{_datadir}/sip
sed -i 's/"doc" directory/"doc" directory of package %{name}-devel/' README
# sip executable is provided by python-sip-bin to avoid conflicts
rm %{buildroot}%{_bindir}/sip
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc README
%{python3_sitearch}/sip.so
%files devel
%defattr(-,root,root)
%doc NEWS LICENSE doc
%{py3_incdir}/sip.h
%{python3_sitearch}/sipconfig.py
%{python3_sitearch}/sipdistutils.py
%{_datadir}/sip
%changelog