- ver. 3.0.1
[packages/python-lxml.git] / python-lxml.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs         # do not build and package API docs
4 %bcond_without  python3         # Python 3 package
5 %bcond_without  python2         # Python 2 package
6
7 %define         module  lxml
8 Summary:        A Pythonic binding for the libxml2 and libxslt libraries
9 Summary(pl.UTF-8):      Pythonowe wiązanie do bibliotek libxml2 i libxslt
10 Name:           python-%{module}
11 Version:        3.0.1
12 Release:        1
13 License:        BSD
14 Group:          Libraries/Python
15 Source0:        http://lxml.de/files/%{module}-%{version}.tgz
16 # Source0-md5:  0f2b1a063ab3b6b0944cbc4a9a85dcfa
17 URL:            http://lxml.de/
18 BuildRequires:  libxml2-devel
19 BuildRequires:  libxslt-devel
20 %if %{with python2}
21 BuildRequires:  python-devel
22 BuildRequires:  python-modules
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-Cython > 0.17
26 BuildRequires:  python3-devel
27 BuildRequires:  python3-modules
28 %endif
29 BuildRequires:  rpm-pythonprov
30 BuildRequires:  rpmbuild(macros) >= 1.219
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 %package apidocs
53 Summary:        lxml API documentation
54 Summary(pl.UTF-8):      Dokumentacja API biblioteki lxml
55 Group:          Documentation
56
57 %description apidocs
58 API and internal documentation for lxml library.
59
60 %prep
61 %setup -q -n %{module}-%{version}
62
63 %build
64 %if %{with python2}
65 %{__python} setup.py build
66 %endif
67 %if %{with python3}
68 %{__python3} setup.py build
69 %endif
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73
74 %if %{with python2}
75 %{__python} setup.py \
76         install \
77         --root=$RPM_BUILD_ROOT \
78         --optimize=2
79
80 %py_postclean
81 %endif
82
83 %if %{with python3}
84 %{__python3} setup.py \
85         install \
86         --root=$RPM_BUILD_ROOT \
87         --optimize=2
88 %endif
89
90 # cleanup for packaging
91 rm -rf docs
92 cp -a doc docs
93 # apidocs packaged separately
94 rm -rf docs/html
95 # build docs not useful at runtime
96 rm docs/build.txt
97 # common licenses
98 rm docs/licenses/{BSD,GPL}.txt
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %if %{with python2}
104 %files
105 %defattr(644,root,root,755)
106 %doc docs/* CHANGES.txt CREDITS.txt TODO.txt
107 %dir %{py_sitedir}/lxml
108 %{py_sitedir}/lxml/*.py[co]
109 %{py_sitedir}/lxml/isoschematron
110 %dir %{py_sitedir}/lxml/html
111 %{py_sitedir}/lxml/html/*.py[co]
112 %attr(755,root,root) %{py_sitedir}/lxml/etree.so
113 %attr(755,root,root) %{py_sitedir}/lxml/objectify.so
114 %{py_sitedir}/lxml-*.egg-info
115 %endif
116
117 %if %{with python3}
118 %files -n python3-%{module}
119 %defattr(644,root,root,755)
120 %doc docs/* CHANGES.txt CREDITS.txt TODO.txt
121 %dir %{py3_sitedir}/lxml
122 %attr(755,root,root) %{py3_sitedir}/lxml/*.so
123 %{py3_sitedir}/lxml/*.py
124 %{py3_sitedir}/lxml/__pycache__
125 %{py3_sitedir}/lxml/isoschematron
126 %{py3_sitedir}/lxml/html
127 %{py3_sitedir}/lxml-*.egg-info
128 %endif
129
130 %if %{with apidocs}
131 %files apidocs
132 %defattr(644,root,root,755)
133 %doc doc/html/*
134 %endif
This page took 0.044039 seconds and 3 git commands to generate.