| 1 | #define svn_url     e:/trees/sip/trunk | 
|---|
| 2 | %define svn_url     http://svn.netlabs.org/repos/ports/sip/trunk | 
|---|
| 3 | %define svn_rev     1601 | 
|---|
| 4 |  | 
|---|
| 5 | # switch this on when we have python3 | 
|---|
| 6 | #global with_python3 1 | 
|---|
| 7 |  | 
|---|
| 8 | %if 0%{?with_python3} | 
|---|
| 9 | %{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")} | 
|---|
| 10 | %endif | 
|---|
| 11 | %{!?__python2:%global __python2 /@unixroot/usr/bin/python2} | 
|---|
| 12 | %{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} | 
|---|
| 13 | %{!?python2_inc:%global python2_inc %(%{__python2} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(1)")} | 
|---|
| 14 |  | 
|---|
| 15 | Summary: SIP - Python/C++ Bindings Generator | 
|---|
| 16 | Name: sip | 
|---|
| 17 | Version: 4.18 | 
|---|
| 18 | Release: 5%{?dist} | 
|---|
| 19 |  | 
|---|
| 20 | # sipgen/parser.{c.h} is GPLv3+ with exceptions (bison) | 
|---|
| 21 | License: GPLv2 or GPLv3 and (GPLv3+ with exceptions) | 
|---|
| 22 | Url: http://www.riverbankcomputing.com/software/sip/intro | 
|---|
| 23 | Vendor: bww bitwise works GmbH | 
|---|
| 24 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip | 
|---|
| 25 |  | 
|---|
| 26 | # extracted from sip.h, SIP_API_MAJOR_NR SIP_API_MINOR_NR defines | 
|---|
| 27 | %global _sip_api_major 11 | 
|---|
| 28 | %global _sip_api_minor 3 | 
|---|
| 29 | %global _sip_api %{_sip_api_major}.%{_sip_api_minor} | 
|---|
| 30 |  | 
|---|
| 31 | Provides: sip-api(%{_sip_api_major}) = %{_sip_api} | 
|---|
| 32 |  | 
|---|
| 33 | BuildRequires: python2-devel | 
|---|
| 34 | BuildRequires: sed | 
|---|
| 35 |  | 
|---|
| 36 | %if 0%{?with_python3} | 
|---|
| 37 | BuildRequires:  python3-devel | 
|---|
| 38 | %endif | 
|---|
| 39 |  | 
|---|
| 40 | %description | 
|---|
| 41 | SIP is a tool for generating bindings for C++ classes so that they can be | 
|---|
| 42 | accessed as normal Python classes. SIP takes many of its ideas from SWIG but, | 
|---|
| 43 | because it is specifically designed for C++ and Python, is able to generate | 
|---|
| 44 | tighter bindings. SIP is so called because it is a small SWIG. | 
|---|
| 45 |  | 
|---|
| 46 | SIP was originally designed to generate Python bindings for KDE and so has | 
|---|
| 47 | explicit support for the signal slot mechanism used by the Qt/KDE class | 
|---|
| 48 | libraries. However, SIP can be used to generate Python bindings for any C++ | 
|---|
| 49 | class library. | 
|---|
| 50 |  | 
|---|
| 51 | %package devel | 
|---|
| 52 | Summary: Files needed to generate Python bindings for any C++ class library | 
|---|
| 53 | Requires: %{name} = %{version}-%{release} | 
|---|
| 54 | Requires: %{name}-macros = %{version}-%{release} | 
|---|
| 55 | Requires: python2-devel | 
|---|
| 56 | %description devel | 
|---|
| 57 | This package contains files needed to generate Python bindings for any C++ | 
|---|
| 58 | classes library. | 
|---|
| 59 |  | 
|---|
| 60 | %package macros | 
|---|
| 61 | Summary: RPM macros for use when working with SIP | 
|---|
| 62 | Requires: rpm | 
|---|
| 63 | # when arch->noarch happened | 
|---|
| 64 | Obsoletes: sip-macros < 4.15.5 | 
|---|
| 65 | BuildArch: noarch | 
|---|
| 66 | %description macros | 
|---|
| 67 | This package contains RPM macros for use when working with SIP. | 
|---|
| 68 | %if 0%{?with_python3} | 
|---|
| 69 | It is used by both the sip-devel (python 2) and python3-sip-devel subpackages. | 
|---|
| 70 | %endif | 
|---|
| 71 |  | 
|---|
| 72 | %if 0%{?with_python3} | 
|---|
| 73 | %package -n python3-sip | 
|---|
| 74 | Summary: SIP - Python 3/C++ Bindings Generator | 
|---|
| 75 | Provides: python3-sip-api(%{_sip_api_major}) = %{_sip_api} | 
|---|
| 76 | %description -n python3-sip | 
|---|
| 77 | This is the Python 3 build of SIP. | 
|---|
| 78 |  | 
|---|
| 79 | SIP is a tool for generating bindings for C++ classes so that they can be | 
|---|
| 80 | accessed as normal Python 3 classes. SIP takes many of its ideas from SWIG but, | 
|---|
| 81 | because it is specifically designed for C++ and Python, is able to generate | 
|---|
| 82 | tighter bindings. SIP is so called because it is a small SWIG. | 
|---|
| 83 |  | 
|---|
| 84 | SIP was originally designed to generate Python bindings for KDE and so has | 
|---|
| 85 | explicit support for the signal slot mechanism used by the Qt/KDE class | 
|---|
| 86 | libraries. However, SIP can be used to generate Python 3 bindings for any C++ | 
|---|
| 87 | class library. | 
|---|
| 88 |  | 
|---|
| 89 | %package -n python3-sip-devel | 
|---|
| 90 | Summary: Files needed to generate Python 3 bindings for any C++ class library | 
|---|
| 91 | Requires: %{name}-macros = %{version}-%{release} | 
|---|
| 92 | Requires: python3-sip = %{version}-%{release} | 
|---|
| 93 | Requires: python3-devel | 
|---|
| 94 | %description -n python3-sip-devel | 
|---|
| 95 | This package contains files needed to generate Python 3 bindings for any C++ | 
|---|
| 96 | classes library. | 
|---|
| 97 | %endif | 
|---|
| 98 |  | 
|---|
| 99 | %debug_package | 
|---|
| 100 |  | 
|---|
| 101 |  | 
|---|
| 102 | %prep | 
|---|
| 103 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0} | 
|---|
| 104 | %setup -q | 
|---|
| 105 | %else | 
|---|
| 106 | %setup -n "%{name}-%{version}" -Tc | 
|---|
| 107 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force | 
|---|
| 108 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" | 
|---|
| 109 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}") | 
|---|
| 110 | %endif | 
|---|
| 111 |  | 
|---|
| 112 | %if 0%{?with_python3} | 
|---|
| 113 | rm -rf %{py3dir} | 
|---|
| 114 | cp -a . %{py3dir} | 
|---|
| 115 | %endif | 
|---|
| 116 |  | 
|---|
| 117 |  | 
|---|
| 118 | %build | 
|---|
| 119 | LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp" | 
|---|
| 120 |  | 
|---|
| 121 | %if 0%{?with_python3} | 
|---|
| 122 | pushd %{py3dir} | 
|---|
| 123 | %{__python3} configure.py \ | 
|---|
| 124 | -d %{python3_sitearch} \ | 
|---|
| 125 | --sipdir=%{_datadir}/python3-sip \ | 
|---|
| 126 | CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="$LDFLAGS" | 
|---|
| 127 |  | 
|---|
| 128 | make %{?_smp_mflags} | 
|---|
| 129 | popd | 
|---|
| 130 | %endif | 
|---|
| 131 |  | 
|---|
| 132 | %{__python2} configure.py \ | 
|---|
| 133 | -d %{python2_sitearch} \ | 
|---|
| 134 | CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="$LDFLAGS" | 
|---|
| 135 |  | 
|---|
| 136 | make %{?_smp_mflags} | 
|---|
| 137 |  | 
|---|
| 138 |  | 
|---|
| 139 | %install | 
|---|
| 140 | # Perform the Python 3 installation first, to avoid stomping over the Python 2 | 
|---|
| 141 | # /usr/bin/sip: | 
|---|
| 142 | %if 0%{?with_python3} | 
|---|
| 143 | pushd %{py3dir} | 
|---|
| 144 | make install DESTDIR=%{buildroot} | 
|---|
| 145 | mkdir -p %{buildroot}%{_datadir}/python3-sip | 
|---|
| 146 | mv %{buildroot}%{_bindir}/sip %{buildroot}%{_bindir}/python3-sip | 
|---|
| 147 | popd | 
|---|
| 148 |  | 
|---|
| 149 | ## toplevel __pycache__ creation is ... inconsistent | 
|---|
| 150 | ## rawhide makes one, f23 local builds do not, so let's *make* it consistent | 
|---|
| 151 | mkdir -p %{buildroot}%{python3_sitearch}/__pycache__/exclude_rpm_hack | 
|---|
| 152 | %endif | 
|---|
| 153 |  | 
|---|
| 154 | # Python 2 installation: | 
|---|
| 155 | make install DESTDIR=%{buildroot} | 
|---|
| 156 | mkdir -p %{buildroot}%{_datadir}/sip | 
|---|
| 157 |  | 
|---|
| 158 | # Macros used by -devel subpackages: | 
|---|
| 159 | mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d | 
|---|
| 160 | install -m 0644 %{_builddir}/%{buildsubdir}/macros.sip %{buildroot}%{_rpmconfigdir}/macros.d | 
|---|
| 161 |  | 
|---|
| 162 |  | 
|---|
| 163 | %files | 
|---|
| 164 | %doc NEWS README | 
|---|
| 165 | %license LICENSE LICENSE-GPL2 LICENSE-GPL3 | 
|---|
| 166 | %{python2_sitearch}/sip*.py* | 
|---|
| 167 |  | 
|---|
| 168 | %files devel | 
|---|
| 169 | %{_bindir}/sip.exe | 
|---|
| 170 | %{_datadir}/sip/ | 
|---|
| 171 | %{python2_inc}/* | 
|---|
| 172 |  | 
|---|
| 173 | %files macros | 
|---|
| 174 | %{_rpmconfigdir}/macros.d/macros.sip | 
|---|
| 175 |  | 
|---|
| 176 | %if 0%{?with_python3} | 
|---|
| 177 | %files -n python3-sip | 
|---|
| 178 | %doc NEWS README | 
|---|
| 179 | %license LICENSE LICENSE-GPL2 LICENSE-GPL3 | 
|---|
| 180 | %{python3_sitearch}/sip.so | 
|---|
| 181 | %{python3_sitearch}/sip*.py* | 
|---|
| 182 | %{python3_sitearch}/__pycache__/* | 
|---|
| 183 | %exclude %{python3_sitearch}/__pycache__/exclude_rpm_hack | 
|---|
| 184 |  | 
|---|
| 185 | %files -n python3-sip-devel | 
|---|
| 186 | # Note that the "sip" binary is invoked by name in a few places higher up | 
|---|
| 187 | # in the KDE-Python stack; these will need changing to "python3-sip": | 
|---|
| 188 | %{_bindir}/python3-sip.exe | 
|---|
| 189 | %{_datadir}/python3-sip/ | 
|---|
| 190 | %{python3_inc}/* | 
|---|
| 191 | %endif | 
|---|
| 192 |  | 
|---|
| 193 |  | 
|---|
| 194 | %changelog | 
|---|
| 195 | * Wed Jun 14 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.18.3-5 | 
|---|
| 196 | - fix signature handling | 
|---|
| 197 |  | 
|---|
| 198 | * Tue Jun 14 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.18.3-4 | 
|---|
| 199 | - rebuilt because of python ucs2/ucs4 change | 
|---|
| 200 |  | 
|---|
| 201 | * Fri Jun 3 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.18-3 | 
|---|
| 202 | - truncate pyd files to max 8 char, if longer | 
|---|
| 203 | - create a symlink, if the original pyd file is larger than 8 char | 
|---|
| 204 | - add the possibility to have a nameshort tag in the %Module() section | 
|---|
| 205 | - add a def file for pyd (header only) | 
|---|
| 206 |  | 
|---|
| 207 | * Fri May 20 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.18-2 | 
|---|
| 208 | - fix the Qt lib names (append the right version) | 
|---|
| 209 | - enable GNUMAKE as make generator | 
|---|
| 210 |  | 
|---|
| 211 | * Thu May 19 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.18-1 | 
|---|
| 212 | - initial version | 
|---|