]> git.pld-linux.org Git - packages/python-polib.git/blob - python-polib.spec
f3244b975c7bd5a259e25378be80ce1763be109a
[packages/python-polib.git] / python-polib.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module          polib
8 %define         egg_name        polib
9 %define         pypi_name       polib
10 Summary:        A library to parse and manage gettext catalogs
11 Name:           python-%{pypi_name}
12 Version:        1.0.7
13 Release:        5
14 License:        MIT
15 Source0:        http://bitbucket.org/izi/polib/get/%{version}.tar.gz
16 # Source0-md5:  270110a7010425738e9a08832c5cba4f
17 Group:          Libraries/Python
18 URL:            http://bitbucket.org/izi/polib/
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-modules
23 BuildRequires:  python-setuptools
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-modules
27 BuildRequires:  python3-setuptools
28 %endif
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 polib allows you to manipulate, create, modify gettext files (pot, po
34 and mo files). You can load existing files, iterate through it's
35 entries, add, modify entries, comments or metadata, etc... or create
36 new po files from scratch.
37
38 polib provides a simple and pythonic API, exporting only three
39 convenience functions 'pofile', 'mofile' and 'detect_encoding', and
40 the 4 core classes: POFile, MOFile, POEntry and MOEntry for creating
41 new files/entries.
42
43 %package -n python3-%{pypi_name}
44 Summary:        A library to parse and manage gettext catalogs
45 Group:          Libraries/Python
46
47 %description -n python3-%{pypi_name}
48 polib allows you to manipulate, create, modify gettext files (pot, po
49 and mo files). You can load existing files, iterate through it's
50 entries, add, modify entries, comments or metadata, etc... or create
51 new po files from scratch.
52
53 polib provides a simple and pythonic API, exporting only three
54 convenience functions 'pofile', 'mofile' and 'detect_encoding', and
55 the 4 core classes: POFile, MOFile, POEntry and MOEntry for creating
56 new files/entries.
57
58 %prep
59 %setup -qc
60 mv izi-polib-d75ce6dbbc2a/* .
61
62 %build
63 %if %{with python2}
64 %py_build %{?with_tests:test}
65 %endif
66
67 %if %{with python3}
68 %py3_build %{?with_tests:test}
69 %endif
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73 %if %{with python2}
74 %py_install
75 %py_postclean
76 %endif
77
78 %if %{with python3}
79 %py3_install
80 %endif
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %if %{with python2}
86 %files
87 %defattr(644,root,root,755)
88 %doc README.rst LICENSE
89 %{py_sitescriptdir}/%{module}.py[co]
90 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
91 %endif
92
93 %if %{with python3}
94 %files -n python3-%{pypi_name}
95 %defattr(644,root,root,755)
96 %doc README.rst LICENSE
97 %{py3_sitescriptdir}/%{module}.py
98 %{py3_sitescriptdir}/__pycache__/%{module}.cpython-*.pyc
99 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
100 %endif
This page took 0.083175 seconds and 2 git commands to generate.