]>
Commit | Line | Data |
---|---|---|
be5cfb8d WF |
1 | %bcond_without python2 # CPython 2.x module |
2 | %bcond_without python3 # CPython 3.x module | |
3 | ||
4 | %define module simplexml | |
5 | Summary: Simplexml in Python | |
6 | Summary(pl.UTF-8): simplexml w Pythonie | |
7 | Name: python-%{module} | |
0711a0f6 | 8 | Version: 0.6.5 |
828ffcba | 9 | Release: 6 |
be5cfb8d WF |
10 | License: GPL |
11 | Group: Libraries/Python | |
12 | Source0: http://www.fit.vutbr.cz/~smrcka/projects/simplexml/%{module}-%{version}.tar.gz | |
0711a0f6 | 13 | # Source0-md5: a150742499c483a38267a885dca4f245 |
be5cfb8d WF |
14 | URL: http://www.fit.vutbr.cz/~smrcka/projects/simplexml |
15 | BuildRequires: rpm-pythonprov | |
16 | BuildRequires: rpmbuild(macros) >= 1.219 | |
17 | %if %{with python2} | |
18 | Requires: python-modules | |
19 | %endif | |
20 | %if %{with python3} | |
21 | BuildRequires: python3-2to3 | |
22 | %endif | |
23 | BuildArch: noarch | |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
26 | %description | |
27 | SimpleXML is a commandline tool and library for very simply | |
28 | manipulating XML files. It lets you harvest data from XML files, | |
29 | change values of attributes, print or change data of elements, create | |
30 | new elements, etc. All you need is to know the path to element with | |
31 | definition of attributes and/or order of element. If you work with | |
32 | commandline tool, you must also know what do you want (change data, | |
33 | attributes, create new element, ...) In case you use the python | |
34 | module, you get an object with attributes like name, attr, value, data | |
35 | etc. | |
36 | ||
37 | For help with commandline tool, run it. It's really simple! ;-) For | |
38 | help with python module, import it and see __doc__ attributes ;-) | |
39 | ||
40 | Python 2.x version. | |
41 | ||
42 | %package -n python3-%{module} | |
43 | Summary: Simplexml in Python | |
44 | Summary(pl.UTF-8): Simplexml w Pythonie | |
45 | Group: Libraries/Python | |
46 | ||
47 | %description -n python3-%{module} | |
48 | SimpleXML is a commandline tool and library for very simply | |
49 | manipulating XML files. It lets you harvest data from XML files, | |
50 | change values of attributes, print or change data of elements, create | |
51 | new elements, etc. All you need is to know the path to element with | |
52 | definition of attributes and/or order of element. If you work with | |
53 | commandline tool, you must also know what do you want (change data, | |
54 | attributes, create new element, ...) In case you use the python | |
55 | module, you get an object with attributes like name, attr, value, data | |
56 | etc. | |
57 | ||
58 | For help with commandline tool, run it. It's really simple! ;-) For | |
59 | help with python module, import it and see __doc__ attributes ;-) | |
60 | ||
61 | Python 2.x version. | |
62 | ||
63 | %prep | |
64 | %setup -q -n %{module}-%{version} | |
65 | ||
0984783d JR |
66 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \ |
67 | simplexml | |
68 | ||
be5cfb8d WF |
69 | %build |
70 | ||
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | %if %{with python2} | |
c23e648b WF |
74 | install -d $RPM_BUILD_ROOT{%{py_sitescriptdir}/simplexml,%{_bindir}} |
75 | install *.py $RPM_BUILD_ROOT%{py_sitescriptdir}/simplexml/ | |
be5cfb8d WF |
76 | install simplexml $RPM_BUILD_ROOT%{_bindir} |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
c23e648b WF |
80 | install -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/simplexml |
81 | install *.py $RPM_BUILD_ROOT%{py3_sitescriptdir}/simplexml/ | |
be5cfb8d WF |
82 | %endif |
83 | ||
84 | %if %{with python2} | |
85 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
86 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
87 | %py_postclean | |
88 | %endif | |
89 | ||
90 | %if %{with python3} | |
0711a0f6 | 91 | 2to3 -w -n $RPM_BUILD_ROOT%{py3_sitescriptdir} |
dd8385e6 WF |
92 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir} |
93 | %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir} | |
be5cfb8d WF |
94 | %endif |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %if %{with python2} | |
100 | %files | |
101 | %defattr(644,root,root,755) | |
102 | %doc README | |
103 | %attr(755,root,root) %{_bindir}/simplexml | |
c23e648b WF |
104 | %dir %{py_sitescriptdir}/simplexml |
105 | %{py_sitescriptdir}/simplexml/* | |
be5cfb8d WF |
106 | %endif |
107 | ||
108 | %if %{with python3} | |
109 | %files -n python3-%{module} | |
110 | %defattr(644,root,root,755) | |
c23e648b WF |
111 | %dir %{py3_sitescriptdir}/simplexml |
112 | %{py3_sitescriptdir}/simplexml/* | |
be5cfb8d | 113 | %endif |