]> git.pld-linux.org Git - packages/python-persistent.git/blob - python-persistent.spec
rebuild with tests and docs
[packages/python-persistent.git] / python-persistent.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  persistent
9 Summary:        Automatic persistence for Python objects
10 Summary(pl.UTF-8):      Automatyczne trwałe obiekty w Pythonie
11 Name:           python-%{module}
12 Version:        4.7.0
13 Release:        6
14 License:        ZPL v2.1
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/persistent/
17 Source0:        https://files.pythonhosted.org/packages/source/p/persistent/%{module}-%{version}.tar.gz
18 # Source0-md5:  dedb296b74082edf246fe48333065f46
19 Patch0:         missing-header.patch
20 URL:            https://www.zope.dev/
21 %if %{with python2}
22 BuildRequires:  python-cffi
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-manuel
27 BuildRequires:  python-zope.interface
28 BuildRequires:  python-zope.testrunner
29 %endif
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-cffi
33 BuildRequires:  python3-devel >= 1:3.5
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-manuel
37 BuildRequires:  python3-zope.interface
38 BuildRequires:  python3-zope.testrunner
39 %endif
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 %if %{with doc}
44 BuildRequires:  python3-repoze.sphinx.autointerface
45 BuildRequires:  sphinx-pdg-3
46 %endif
47 Requires:       python-modules >= 1:2.7
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
51 This package contains a generic persistence implementation for Python.
52 It forms the core protocol for making objects interact "transparently"
53 with a database such as the ZODB.
54
55 %description -l pl.UTF-8
56 Ten pakiet zawiera ogólną implementację trwałych danych dla Pythona.
57 Tworzy główny protokół, pozwalający obiektom w sposób przezroczysty
58 współpracować z bazą danych taką jak ZODB.
59
60 %package -n python3-%{module}
61 Summary:        Automatic persistence for Python objects
62 Summary(pl.UTF-8):      Automatyczne trwałe obiekty w Pythonie
63 Group:          Libraries/Python
64 Requires:       python3-modules >= 1:3.5
65
66 %description -n python3-%{module}
67 This package contains a generic persistence implementation for Python.
68 It forms the core protocol for making objects interact "transparently"
69 with a database such as the ZODB.
70
71 %description -n python3-%{module} -l pl.UTF-8
72 Ten pakiet zawiera ogólną implementację trwałych danych dla Pythona.
73 Tworzy główny protokół, pozwalający obiektom w sposób przezroczysty
74 współpracować z bazą danych taką jak ZODB.
75
76 %package apidocs
77 Summary:        API documentation for Python persistent module
78 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona persistent
79 Group:          Documentation
80
81 %description apidocs
82 API documentation for Python persistent module.
83
84 %description apidocs -l pl.UTF-8
85 Dokumentacja API modułu Pythona persistent.
86
87 %prep
88 %setup -q -n %{module}-%{version}
89 %patch0 -p1
90
91 %build
92 %if %{with python2}
93 %py_build %{?with_tests:test}
94 %endif
95
96 %if %{with python3}
97 %py3_build %{?with_tests:test}
98 %endif
99
100 %if %{with doc}
101 PYTHONPATH=$(pwd) \
102 %{__make} -C docs html \
103         SPHINXBUILD=sphinx-build-3
104 %endif
105
106 %install
107 rm -rf $RPM_BUILD_ROOT
108
109 %if %{with python2}
110 %py_install
111
112 %py_postclean
113 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/persistent/*.[ch]
114 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/persistent/tests
115 %endif
116
117 %if %{with python3}
118 %py3_install
119
120 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/persistent/*.[ch]
121 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/persistent/tests
122 %endif
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %if %{with python2}
128 %files
129 %defattr(644,root,root,755)
130 %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst
131 %dir %{py_sitedir}/persistent
132 %{py_sitedir}/persistent/*.py[co]
133 %attr(755,root,root) %{py_sitedir}/persistent/*.so
134 %{py_sitedir}/persistent-%{version}-py*.egg-info
135 %{py_incdir}/persistent
136 %endif
137
138 %if %{with python3}
139 %files -n python3-%{module}
140 %defattr(644,root,root,755)
141 %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst
142 %dir %{py3_sitedir}/persistent
143 %{py3_sitedir}/persistent/*.py
144 %attr(755,root,root) %{py3_sitedir}/persistent/*.so
145 %{py3_sitedir}/persistent/__pycache__
146 %{py3_sitedir}/persistent-%{version}-py*.egg-info
147 %{py3_incdir}/persistent
148 %endif
149
150 %if %{with doc}
151 %files apidocs
152 %defattr(644,root,root,755)
153 %doc docs/_build/html/{_static,api,*.html,*.js}
154 %endif
This page took 0.079718 seconds and 3 git commands to generate.