source: spec/trunk/SPECS/sip.spec@ 1010

Last change on this file since 1010 was 803, checked in by Silvan Scherrer, 9 years ago

spec: sip fix signature handling

File size: 6.7 KB
Line 
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
15Summary: SIP - Python/C++ Bindings Generator
16Name: sip
17Version: 4.18
18Release: 5%{?dist}
19
20# sipgen/parser.{c.h} is GPLv3+ with exceptions (bison)
21License: GPLv2 or GPLv3 and (GPLv3+ with exceptions)
22Url: http://www.riverbankcomputing.com/software/sip/intro
23Vendor: bww bitwise works GmbH
24Source: %{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
31Provides: sip-api(%{_sip_api_major}) = %{_sip_api}
32
33BuildRequires: python2-devel
34BuildRequires: sed
35
36%if 0%{?with_python3}
37BuildRequires: python3-devel
38%endif
39
40%description
41SIP is a tool for generating bindings for C++ classes so that they can be
42accessed as normal Python classes. SIP takes many of its ideas from SWIG but,
43because it is specifically designed for C++ and Python, is able to generate
44tighter bindings. SIP is so called because it is a small SWIG.
45
46SIP was originally designed to generate Python bindings for KDE and so has
47explicit support for the signal slot mechanism used by the Qt/KDE class
48libraries. However, SIP can be used to generate Python bindings for any C++
49class library.
50
51%package devel
52Summary: Files needed to generate Python bindings for any C++ class library
53Requires: %{name} = %{version}-%{release}
54Requires: %{name}-macros = %{version}-%{release}
55Requires: python2-devel
56%description devel
57This package contains files needed to generate Python bindings for any C++
58classes library.
59
60%package macros
61Summary: RPM macros for use when working with SIP
62Requires: rpm
63# when arch->noarch happened
64Obsoletes: sip-macros < 4.15.5
65BuildArch: noarch
66%description macros
67This package contains RPM macros for use when working with SIP.
68%if 0%{?with_python3}
69It 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
74Summary: SIP - Python 3/C++ Bindings Generator
75Provides: python3-sip-api(%{_sip_api_major}) = %{_sip_api}
76%description -n python3-sip
77This is the Python 3 build of SIP.
78
79SIP is a tool for generating bindings for C++ classes so that they can be
80accessed as normal Python 3 classes. SIP takes many of its ideas from SWIG but,
81because it is specifically designed for C++ and Python, is able to generate
82tighter bindings. SIP is so called because it is a small SWIG.
83
84SIP was originally designed to generate Python bindings for KDE and so has
85explicit support for the signal slot mechanism used by the Qt/KDE class
86libraries. However, SIP can be used to generate Python 3 bindings for any C++
87class library.
88
89%package -n python3-sip-devel
90Summary: Files needed to generate Python 3 bindings for any C++ class library
91Requires: %{name}-macros = %{version}-%{release}
92Requires: python3-sip = %{version}-%{release}
93Requires: python3-devel
94%description -n python3-sip-devel
95This package contains files needed to generate Python 3 bindings for any C++
96classes 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
107svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
108rm -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}
113rm -rf %{py3dir}
114cp -a . %{py3dir}
115%endif
116
117
118%build
119LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
120
121%if 0%{?with_python3}
122pushd %{py3dir}
123%{__python3} configure.py \
124 -d %{python3_sitearch} \
125 --sipdir=%{_datadir}/python3-sip \
126 CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="$LDFLAGS"
127
128make %{?_smp_mflags}
129popd
130%endif
131
132%{__python2} configure.py \
133 -d %{python2_sitearch} \
134 CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="$LDFLAGS"
135
136make %{?_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}
143pushd %{py3dir}
144make install DESTDIR=%{buildroot}
145mkdir -p %{buildroot}%{_datadir}/python3-sip
146mv %{buildroot}%{_bindir}/sip %{buildroot}%{_bindir}/python3-sip
147popd
148
149## toplevel __pycache__ creation is ... inconsistent
150## rawhide makes one, f23 local builds do not, so let's *make* it consistent
151mkdir -p %{buildroot}%{python3_sitearch}/__pycache__/exclude_rpm_hack
152%endif
153
154# Python 2 installation:
155make install DESTDIR=%{buildroot}
156mkdir -p %{buildroot}%{_datadir}/sip
157
158# Macros used by -devel subpackages:
159mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d
160install -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
Note: See TracBrowser for help on using the repository browser.