]> git.pld-linux.org Git - packages/shiboken.git/blob - shiboken.spec
Release 5 (by relup.sh)
[packages/shiboken.git] / shiboken.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # CPython 2.x support
4 %bcond_without  python3         # CPython 3.x support
5 %bcond_with     python3_default # default to python3
6 #
7 Summary:        CPython bindings generator for C++ libraries
8 Summary(pl.UTF-8):      Generator wiązań CPythona dla bibliotek C++
9 Name:           shiboken
10 Version:        1.2.4
11 Release:        5
12 License:        LGPL v2.1+ (libraries), GPL v2 (tools)
13 Group:          Development/Tools
14 #Source0Download: https://github.com/pyside/Shiboken/releases
15 Source0:        https://github.com/pyside/Shiboken/archive/%{version}/%{name}-%{version}.tar.gz
16 # Source0-md5:  c284197d06ad25d78009ff55f18dd512
17 Patch0:         %{name}-python.patch
18 Patch1:         build.patch
19 Patch2:         python3.patch
20 URL:            https://github.com/pyside/Shiboken
21 BuildRequires:  QtCore-devel >= 4.5.0
22 BuildRequires:  QtXml-devel >= 4.5.0
23 BuildRequires:  QtXmlPatterns-devel >= 4.5.0
24 BuildRequires:  cmake >= 2.6
25 BuildRequires:  libstdc++-devel
26 BuildRequires:  libxml2-devel >= 1:2.6.32
27 BuildRequires:  libxslt-devel >= 1.1.19
28 %{?with_python2:BuildRequires:  python-devel >= 1:2.6}
29 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
30 BuildRequires:  sphinx-pdg
31 Requires:       QtCore >= 4.5.0
32 Requires:       QtXml >= 4.5.0
33 Requires:       QtXmlPatterns >= 4.5.0
34 Requires:       libxml2 >= 1:2.6.32
35 Requires:       libxslt >= 1.1.19
36 Requires:       python >= 1:2.6
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         py3_soabi       %(%{__python3} -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"));')
40
41 %description
42 shiboken is a CPython bindings generator for C++ libraries.
43
44 %description -l pl.UTF-8
45 shiboken to generator wiązań CPythona dla bibliotek C++.
46
47 %package python2
48 Summary:        Shiboken Python 2.x support files
49 Summary(pl.UTF-8):      Shiboken - pliki do obsługi Pythona 2.x
50 Group:          Development/Libraries
51 Requires:       %{name} = %{version}-%{release}
52 Requires:       python-devel >= 1:%{py_ver}
53 Requires:       python-shiboken = %{version}-%{release}
54
55 %description python2
56 Shiboken Python 2.x support files.
57
58 %description python2 -l pl.UTF-8
59 Shiboken - pliki do obsługi Pythona 2.x.
60
61 %package -n python-shiboken
62 Summary:        Shiboken runtime library for Python 2.x
63 Summary(pl.UTF-8):      Biblioteka uruchomieniowa shiboken dla Pythona 2.x
64 Group:          Libraries/Python
65 Requires:       python-libs >= 1:2.6
66 Obsoletes:      shiboken-libs < 1.2.2
67
68 %description -n python-shiboken
69 Shiboken runtime library for Python 2.x.
70
71 %description -n python-shiboken -l pl.UTF-8
72 Biblioteka uruchomieniowa shiboken dla Pythona 2.x.
73
74 %package python3
75 Summary:        Shiboken Python 3.x support files
76 Summary(pl.UTF-8):      Shiboken - pliki do obsługi Pythona 3.x
77 Group:          Development/Libraries
78 Requires:       %{name} = %{version}-%{release}
79 Requires:       python3-devel >= 1:%{py_ver}
80 Requires:       python3-shiboken = %{version}-%{release}
81
82 %description python3
83 Shiboken Python 3.x support files.
84
85 %description python3 -l pl.UTF-8
86 Shiboken - pliki do obsługi Pythona 3.x.
87
88 %package -n python3-shiboken
89 Summary:        Shiboken runtime library for Python 3.x
90 Summary(pl.UTF-8):      Biblioteka uruchomieniowa shiboken dla Pythona 3.x
91 Group:          Libraries/Python
92 Requires:       python3-libs >= 1:3.2
93 Obsoletes:      shiboken-libs < 1.2.2
94
95 %description -n python3-shiboken
96 Shiboken runtime library for Python 3.x.
97
98 %description -n python3-shiboken -l pl.UTF-8
99 Biblioteka uruchomieniowa shiboken dla Pythona 3.x.
100
101 %prep
102 %setup -q -n Shiboken-%{version}
103 %patch0 -p1
104 %patch1 -p1
105 %patch2 -p1
106
107 %build
108 %if %{with python2}
109 install -d build-py2
110 cd build-py2
111 %cmake ..
112 %{__make}
113 cd ..
114 %endif
115
116 %if %{with python3}
117 install -d build-py3
118 cd build-py3
119 %cmake .. \
120         -DUSE_PYTHON3=TRUE
121 %{__make}
122 cd ..
123 %endif
124
125 %install
126 rm -rf $RPM_BUILD_ROOT
127
128 # version installed as last will be default (it covers default PYTHON_SUFFIX in cmake files and .pc symlink)
129 for pyver in %{?with_python3_default:%{?with_python2:py2}} %{?with_python3:py3} %{!?with_python3_default:%{?with_python2:py2}} ; do
130
131 %{__make} -C build-${pyver} install \
132         DESTDIR=$RPM_BUILD_ROOT
133
134 %{__mv} $RPM_BUILD_ROOT%{_pkgconfigdir}/shiboken.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/shiboken-${pyver}.pc
135 ln -sf shiboken-${pyver}.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/shiboken.pc
136
137 done
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %post   -n python-shiboken -p /sbin/ldconfig
143 %postun -n python-shiboken -p /sbin/ldconfig
144
145 %post   -n python3-shiboken -p /sbin/ldconfig
146 %postun -n python3-shiboken -p /sbin/ldconfig
147
148 %files
149 %defattr(644,root,root,755)
150 %doc AUTHORS
151 %attr(755,root,root) %{_bindir}/shiboken
152 %{_includedir}/shiboken
153 %dir %{_libdir}/cmake/Shiboken-%{version}
154 %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfig.cmake
155 %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfigVersion.cmake
156 %{_mandir}/man1/shiboken.1*
157
158 %if %{with python2}
159 %files python2
160 %defattr(644,root,root,755)
161 %attr(755,root,root) %{_libdir}/libshiboken-python%{py_ver}.so
162 %{_pkgconfigdir}/shiboken-py2.pc
163 %{!?with_python3_default:%{_pkgconfigdir}/shiboken.pc}
164 %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfig-python%{py_ver}.cmake
165
166 %files -n python-shiboken
167 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_libdir}/libshiboken-python%{py_ver}.so.*.*.*
169 %attr(755,root,root) %ghost %{_libdir}/libshiboken-python%{py_ver}.so.1.2
170 %attr(755,root,root) %{py_sitedir}/shiboken.so
171 %endif
172
173 %if %{with python3}
174 %files python3
175 %defattr(644,root,root,755)
176 %attr(755,root,root) %{_libdir}/libshiboken.%{py3_soabi}.so
177 %{_pkgconfigdir}/shiboken-py3.pc
178 %{?with_python3_default:%{_pkgconfigdir}/shiboken.pc}
179 %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfig.%{py3_soabi}.cmake
180
181 %files -n python3-shiboken
182 %defattr(644,root,root,755)
183 %attr(755,root,root) %{_libdir}/libshiboken.%{py3_soabi}.so.*.*.*
184 %attr(755,root,root) %ghost %{_libdir}/libshiboken.%{py3_soabi}.so.1.2
185 %attr(755,root,root) %{py3_sitedir}/shiboken.so
186 %endif
This page took 0.116263 seconds and 4 git commands to generate.