Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > e325fe51bde71db0e850c60233686600 > files > 1

python-sip-4.16.9-1.mga5.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 11
%define _sip_api_minor 2
%define _sip_api       %{_sip_api_major}.%{_sip_api_minor}

Name: python-sip
Summary: Riverbanks's python sip
Version: 4.16.9
Release: %mkrel 1
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
Obsoletes: sip-macros < 4.15.4

%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
%apply_patches
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
* Thu Jan 14 2016 luigiwalser <luigiwalser> 1:4.16.9-1.mga5
+ Revision: 923074
- 4.16.9 (needed for python-qt5)

* Wed Dec 03 2014 lmenut <lmenut> 1:4.16.4-1.mga5
+ Revision: 800525
- Update to 4.16.4

* Wed Oct 15 2014 umeabot <umeabot> 1:4.16.3-2.mga5
+ Revision: 750595
- Second Mageia 5 Mass Rebuild

* Wed Oct 01 2014 lmenut <lmenut> 1:4.16.3-1.mga5
+ Revision: 734450
- update to 4.16.3

* Sat Sep 27 2014 tv <tv> 1:4.16.1-3.mga5
+ Revision: 729766
- rebuild for missing pythoneggs deps

* Tue Sep 16 2014 umeabot <umeabot> 1:4.16.1-2.mga5
+ Revision: 688335
- Mageia 5 Mass Rebuild

* Tue Jun 10 2014 fwang <fwang> 1:4.16.1-1.mga5
+ Revision: 635350
- 4.16.1

* Tue Jun 03 2014 lmenut <lmenut> 1:4.16-3.mga5
+ Revision: 630760
- add upstream patch to fix PyQt 4.11 build

* Sat May 31 2014 pterjan <pterjan> 1:4.16-2.mga5
+ Revision: 629014
- Rebuild for new Python

* Wed May 28 2014 fwang <fwang> 1:4.16-1.mga5
+ Revision: 627185
- 4.16

* Mon Mar 17 2014 fwang <fwang> 1:4.15.5-1.mga5
+ Revision: 604306
- 4.15.5

* Sun Mar 09 2014 wally <wally> 1:4.15.4-2.mga5
+ Revision: 601549
- obsolete sip-macros (leftover from wrongly imported sip pkg)

* Tue Feb 04 2014 fwang <fwang> 1:4.15.4-1.mga5
+ Revision: 581623
- new version 4.15.4

* Mon Oct 28 2013 philippem <philippem> 1:4.15.3-1.mga4
+ Revision: 547627
- Update to 4.15.3. This is a bug fix release for a regression that affects PyQtChart.

* Sat Oct 19 2013 umeabot <umeabot> 1:4.15.2-2.mga4
+ Revision: 534806
- Mageia 4 Mass Rebuild

* Sat Sep 14 2013 lmenut <lmenut> 1:4.15.2-1.mga4
+ Revision: 478912
- new version 4.15.2

* Thu Aug 29 2013 fwang <fwang> 1:4.15.1-1.mga4
+ Revision: 472845
- new version 4.15.1

* Thu Aug 29 2013 fwang <fwang> 1:4.15-1.mga4
+ Revision: 472815
- new version 4.15

* Tue Jun 18 2013 fwang <fwang> 1:4.14.7-1.mga4
+ Revision: 444289
- new version 4.14.7

* Sun Jun 09 2013 fwang <fwang> 1:4.14.6-1.mga4
+ Revision: 441306
- new version 4.14.6

* 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