]>
Commit | Line | Data |
---|---|---|
f7c36091 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_with python3 # CPython 3.x module (built from liblouis.spec) | |
5 | ||
6 | Summary: Python 2 ctypes binding for liblouis | |
7 | Summary(pl.UTF-8): Wiązania Pythona 2 oparte na ctypes do biblioteki liblouis | |
8 | Name: python-louis | |
9 | # keep 3.15.x for python2 support | |
10 | Version: 3.15.0 | |
38423f7d | 11 | Release: 3 |
f7c36091 JB |
12 | License: LGPL v2.1+ |
13 | Group: Libraries/Python | |
14 | #Source0Download: http://liblouis.org/downloads/ | |
15 | Source0: https://github.com/liblouis/liblouis/releases/download/v%{version}/liblouis-%{version}.tar.gz | |
16 | # Source0-md5: ea605d9b55d5fc142a0678eb88bbf9d8 | |
17 | URL: http://liblouis.org/ | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.6 | |
20 | BuildRequires: python-setuptools | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules >= 1:3.2 | |
24 | BuildRequires: python3-setuptools | |
25 | %endif | |
26 | BuildRequires: rpm-pythonprov | |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | Requires: liblouis >= 3.15.0 | |
29 | Requires: python-modules >= 1:2.6 | |
30 | BuildArch: noarch | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | Python 2 ctypes binding for liblouis. | |
35 | ||
36 | %description -l pl.UTF-8 | |
37 | Wiązania Pythona 2 oparte na ctypes do biblioteki liblouis. | |
38 | ||
39 | %package -n python3-%{module} | |
40 | Summary: Python 3 ctypes binding for liblouis | |
41 | Summary(pl.UTF-8): Wiązania Pythona 3 oparte na ctypes do biblioteki liblouis | |
42 | Group: Libraries/Python | |
43 | Requires: liblouis >= 3.15.0 | |
44 | Requires: python3-modules >= 1:3.2 | |
45 | ||
46 | %description -n python3-%{module} | |
47 | Python 3 ctypes binding for liblouis. | |
48 | ||
49 | %description -n python3-%{module} -l pl.UTF-8 | |
50 | Wiązania Pythona 3 oparte na ctypes do biblioteki liblouis. | |
51 | ||
52 | %prep | |
53 | %setup -q -n liblouis-%{version} | |
54 | ||
55 | %{__sed} -e 's/###LIBLOUIS_SONAME###/liblouis.so.20/' python/louis/__init__.py.in >python/louis/__init__.py | |
56 | ||
57 | %build | |
58 | cd python | |
59 | ||
60 | %if %{with python2} | |
61 | %py_build | |
62 | %endif | |
63 | ||
64 | %if %{with python3} | |
65 | %py3_build | |
66 | %endif | |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | cd python | |
72 | ||
73 | %if %{with python2} | |
74 | %py_install | |
75 | ||
76 | %py_postclean | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | %py3_install | |
81 | %endif | |
82 | ||
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %if %{with python2} | |
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %doc python/README | |
90 | %{py_sitescriptdir}/louis | |
91 | %{py_sitescriptdir}/louis-%{version}-py*.egg-info | |
92 | %endif | |
93 | ||
94 | %if %{with python3} | |
95 | %files -n python3-louis | |
96 | %defattr(644,root,root,755) | |
97 | %doc python/README | |
98 | %{py3_sitescriptdir}/louis | |
99 | %{py3_sitescriptdir}/louis-%{version}-py*.egg-info | |
100 | %endif |