]> git.pld-linux.org Git - packages/python-lxml.git/blob - python-lxml.spec
- build python2 and python3 versions from one spec
[packages/python-lxml.git] / python-lxml.spec
1 #
2 %bcond_without  python3
3 %bcond_without  python2
4 %define         module  lxml
5 #
6 Summary:        A Pythonic binding for the libxml2 and libxslt libraries
7 Summary(pl.UTF-8):      Pythonowe wiązanie do bibliotek libxml2 i libxslt
8 Name:           python-%{module}
9 Version:        2.2.6
10 Release:        2
11 License:        BSD
12 Group:          Libraries/Python
13 Source0:        http://codespeak.net/lxml/%{module}-%{version}.tgz
14 # Source0-md5:  b1f700fb22d7ee9b977ee3eceb65b20c
15 Patch0:         python3.patch
16 URL:            http://codespeak.net/lxml/
17 BuildRequires:  libxml2-devel
18 BuildRequires:  libxslt-devel
19 %if %{with python2}
20 BuildRequires:  python-devel
21 BuildRequires:  python-modules
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-Cython
25 BuildRequires:  python3-devel
26 BuildRequires:  python3-modules
27 %endif
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.219
30 BuildRequires:  unzip
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 lxml is a Pythonic binding for the libxml2 and libxslt libraries.
35
36 %description -l pl.UTF-8
37 lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt.
38
39 %package -n     python3-%{module}
40 Summary:        A Pythonic binding for the libxml2 and libxslt libraries
41 Summary(pl.UTF-8):      Pythonowe wiązanie do bibliotek libxml2 i libxslt
42 Version:        %{version}
43 Release:        %{release}
44 Group:          Libraries/Python
45
46 %description -n python3-%{module}
47 lxml is a Pythonic binding for the libxml2 and libxslt libraries.
48
49 %description -n python3-%{module} -l pl.UTF-8
50 lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt.
51
52 %prep
53 %setup -q -n %{module}-%{version}
54 %patch0 -p1
55
56 %build
57 %if %{with python2}
58 %{__python} setup.py build
59 %endif
60 %if %{with python3}
61 %{__python3} setup.py build
62 %endif
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66
67 %if %{with python2}
68 %{__python} setup.py \
69         install \
70         --root=$RPM_BUILD_ROOT \
71         --optimize=2
72
73 %py_postclean
74 %endif
75
76 %if %{with python3}
77 %{__python3} setup.py \
78         install \
79         --root=$RPM_BUILD_ROOT \
80         --optimize=2
81
82 %py3_postclean
83 %endif
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %if %{with python2}
89 %files
90 %defattr(644,root,root,755)
91 %doc doc/* CHANGES.txt CREDITS.txt TODO.txt
92 %dir %{py_sitedir}/lxml
93 %{py_sitedir}/lxml/*.py[co]
94 %dir %{py_sitedir}/lxml/html
95 %{py_sitedir}/lxml/html/*.py[co]
96 %attr(755,root,root) %{py_sitedir}/lxml/etree.so
97 %attr(755,root,root) %{py_sitedir}/lxml/objectify.so
98 %{py_sitedir}/lxml-*.egg-info
99 %endif
100
101 %if %{with python3}
102 %files -n python3-%{module}
103 %defattr(644,root,root,755)
104 %doc doc/* CHANGES.txt CREDITS.txt TODO.txt
105 %dir %{py3_sitedir}/lxml
106 %{py3_sitedir}/lxml/*.py[co]
107 %dir %{py3_sitedir}/lxml/html
108 %{py3_sitedir}/lxml/html/*.py[co]
109 %attr(755,root,root) %{py3_sitedir}/lxml/etree.so
110 %attr(755,root,root) %{py3_sitedir}/lxml/objectify.so
111 %{py3_sitedir}/lxml-*.egg-info
112 %endif
This page took 0.044389 seconds and 4 git commands to generate.