Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 6ea3229e1b2c0e236f34706f26fcb7bf > files > 1

python-sip-4.14.2-2.mga3.src.rpm

%global with_python3 1

%define py3dir ../python3

# extracted from sip.h, SIP_API_MAJOR_NR SIP_API_MINOR_NR defines
%define _sip_api_major 9
%define _sip_api_minor 1
%define _sip_api       %{_sip_api_major}.%{_sip_api_minor}

Name: python-sip
Summary: Riverbanks's python sip
Version: 4.14.2
Release: %mkrel 2
Epoch: 1
Group: Development/Python 
URL: http://www.riverbankcomputing.co.uk/software/sip/intro
Source0: http://downloads.sourceforge.net/pyqt/sip-%version.tar.gz
License: GPLv2+
BuildRequires: bzip2-devel
BuildRequires: python-devel
%if 0%{?with_python3}
BuildRequires:  python3-devel
%endif

Provides: sip-api(%{_sip_api_major}) = %{_sip_api}
%rename sip
%rename sip-devel

%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.

%if 0%{?with_python3}
%package -n python3-sip
Summary: SIP - Python 3/C++ Bindings Generator
Group: Development/Python
Provides: python3-sip-api(%{_sip_api_major}) = %{_sip_api}
Provides: python3-sip-api(%{_sip_api_major}) = %{_sip_api}

%description -n python3-sip
This is the Python 3 build of SIP.

SIP is a tool for generating bindings for C++ classes so that they can be
accessed as normal Python 3 classes. SIP takes many of its ideas from SWIG but,
because it is specifically designed for C++ and Python, is able to generate
tighter bindings. SIP is so called because it is a small SWIG.

SIP was originally designed to generate Python bindings for KDE and so has
explicit support for the signal slot mechanism used by the Qt/KDE class
libraries. However, SIP can be used to generate Python 3 bindings for any C++
class library.

%package -n python3-sip-devel
Summary: Files needed to generate Python 3 bindings for any C++ class library
Group: Development/Python
Requires: python3-sip = %{epoch}:%{version}
Requires: python3-devel

%description -n python3-sip-devel
This package contains files needed to generate Python 3 bindings for any C++
classes library.
%endif

%files 
%{_sysconfdir}/rpm/macros.d/sip.macros
%_bindir/sip
%py_platsitedir/s*
%py_incdir/sip.h

#------------------------------------------------------------

%prep
%setup -q -n sip-%version
export real_api_major=`grep SIP_API_MAJOR_NR siplib/sip.h.in|head -n1|awk -F' ' '{print $3}'`
export real_api_minor=`grep SIP_API_MINOR_NR siplib/sip.h.in|head -n1|awk -F' ' '{print $3}'`
if [ $real_api_major -ne %_sip_api_major ]; then
	echo 'Wrong spi major specified: Should be' $real_api_major ', but set' %_sip_api_major
	exit 1
fi
if [ $real_api_minor -ne %_sip_api_minor ]; then
	echo 'Wrong spi minor specified: Should be' $real_api_minor ', but set' %_sip_api_minor
	exit 1
fi

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

#  Don't use X11R6 prefix for includes neither libraries by default.
for file in specs/linux-*; do
    perl -p -i -e "s@/X11R6/@/@g" $file
done

%build
%define _disable_ld_no_undefined 1

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} configure.py -d %{python3_sitearch} CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" --sipdir=%{_datadir}/python3-sip LIBS="%{?ldflags} -lpython%{py3_ver}"

%make
popd
%endif

%{__python} configure.py
%{make} CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC" LIBS="%{?ldflags} -lpython%{py_ver}"

%install
# Perform the Python 3 installation first, to avoid stomping over the Python 2
# /usr/bin/sip:
%if 0%{?with_python3}
pushd %{py3dir}
%{makeinstall_std}
mkdir -p %{buildroot}%{_datadir}/python3-sip
mv %{buildroot}%{_bindir}/sip %{buildroot}%{_bindir}/python3-sip
popd
%endif

%{makeinstall_std}

mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d/
cat > %{buildroot}%{_sysconfdir}/rpm/macros.d/sip.macros << EOF
# extracted from sip.h, SIP_API_MAJOR_NR SIP_API_MINOR_NR defines
%%_sip_api_major %{_sip_api_major}
%%_sip_api_minor %{_sip_api_minor}
%%_sip_api       %{_sip_api_major}.%{_sip_api_minor}
EOF

%if 0%{?with_python3}
%files -n python3-sip
%{python3_sitearch}/*

%files -n python3-sip-devel
# Note that the "sip" binary is invoked by name in a few places higher up
# in the KDE-Python stack; these will need changing to "python3-sip":
%{_bindir}/python3-sip
%{_datadir}/python3-sip/
%{py3_incdir}/*
%endif


%changelog

* Sun Jan 13 2013 umeabot <umeabot> 1:4.14.2-2.mga3
+ Revision: 379522
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sun Dec 09 2012 fwang <fwang> 1:4.14.2-1.mga3
+ Revision: 329173
- new version 4.14.2

* Mon Oct 29 2012 fwang <fwang> 1:4.14.1-1.mga3
+ Revision: 311409
- bump sip minor
- new version 4.14.1

* Tue Oct 09 2012 fwang <fwang> 1:4.14-2.mga3
+ Revision: 303728
- link with libpython3

* Tue Oct 09 2012 fwang <fwang> 1:4.14-1.mga3
+ Revision: 303723
- new version 4.14
- new version 4.14

* Sat Sep 29 2012 fwang <fwang> 1:4.13.3-2.mga3
+ Revision: 300315
- rebuild for new python3.3
- fix libmajor extraction

* Mon Jun 25 2012 fwang <fwang> 1:4.13.3-1.mga3
+ Revision: 263394
- new version 4.13.3

* Wed Jun 13 2012 fwang <fwang> 1:4.13.2-3.mga3
+ Revision: 260327
- obsoletes wrongly imported sip package

* Wed Jun 13 2012 shlomif <shlomif> 1:4.13.2-2.mga3
+ Revision: 260323
- Now building a python3 package too (import changes from Fedora .spec)

* Tue Feb 21 2012 philippem <philippem> 1:4.13.2-1.mga2
+ Revision: 211544
- Update to 4.13.2.

* Mon Dec 26 2011 fwang <fwang> 1:4.13.1-1.mga2
+ Revision: 187679
- new version 4.13.1

* Mon Oct 31 2011 fwang <fwang> 1:4.13-1.mga2
+ Revision: 160338
- new version 4.13
- add api check in pre section
- new version 4.12.4

* Fri Jun 17 2011 fwang <fwang> 1:4.12.3-1.mga2
+ Revision: 108617
- new version 4.12.3

* Fri Mar 25 2011 ahmad <ahmad> 1:4.12.1-2.mga1
+ Revision: 77429
- add %%_sip_api and related macros to enforce requires on sip api (idea from Fedora)
- add %%{_sysconfdir}/rpm/macros.d/sip.macros with the above macros

* Fri Mar 25 2011 ahmad <ahmad> 1:4.12.1-1.mga1
+ Revision: 77222
- update to 4.12.1

* Sun Jan 16 2011 misc <misc> 1:4.12-2.mga1
+ Revision: 20547
- rebuild for new python 2.7

  + dmorgan <dmorgan>
    - imported package python-sip