]>
Commit | Line | Data |
---|---|---|
771195b8 MK |
1 | # TODO: |
2 | # - fix tests | |
3 | ||
4 | # Conditional build: | |
5 | %bcond_with doc # don't build doc | |
6 | %bcond_with tests # do not perform "make test" | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | ||
10 | %define module pickleshare | |
11 | Summary: A small 'shelve' like datastore with concurrency support | |
12 | Summary(pl.UTF-8): Mały, podobny do 'shelve', zarządca danych z wsparciem dla konkurencyjności | |
13 | Name: python-%{module} | |
14 | Version: 0.7.4 | |
15 | Release: 1 | |
16 | License: MIT | |
17 | Group: Libraries/Python | |
18 | Source0: https://github.com/pickleshare/pickleshare/archive/%{version}.tar.gz | |
19 | # Source0-md5: edd1fc04bc12d9748c852218d2cb86fd | |
20 | URL: https://github.com/pickleshare/pickleshare | |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
24 | BuildRequires: python-modules | |
25 | BuildRequires: python-setuptools | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules | |
29 | BuildRequires: python3-setuptools | |
30 | %endif | |
31 | Requires: python-modules | |
32 | Requires: python-pathlib2 | |
33 | BuildArch: noarch | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | PickleShareDB object acts like a normal dictionary. Unlike shelve, | |
38 | many processes can access the database simultaneously. Changing a | |
39 | value in database is immediately visible to other processes accessing | |
40 | the same database. Concurrency is possible because the values are | |
41 | stored in separate files. Hence the "database" is a directory where | |
42 | all files are governed by PickleShare. | |
43 | ||
44 | # %%description -l pl.UTF-8 | |
45 | ||
46 | %package -n python3-%{module} | |
47 | Summary: - | |
48 | Summary(pl.UTF-8): - | |
49 | Group: Libraries/Python | |
50 | Requires: python3-modules | |
51 | Requires: python3-pathlib2 | |
52 | ||
53 | ||
54 | %description -n python3-%{module} | |
55 | PickleShareDB object acts like a normal dictionary. Unlike shelve, | |
56 | many processes can access the database simultaneously. Changing a | |
57 | value in database is immediately visible to other processes accessing | |
58 | the same database. Concurrency is possible because the values are | |
59 | stored in separate files. Hence the "database" is a directory where | |
60 | all files are governed by PickleShare. | |
61 | ||
62 | # %%description -n python3-%{module} -l pl.UTF-8 | |
63 | ||
64 | %package apidocs | |
65 | Summary: %{module} API documentation | |
66 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for %{module}. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API %{module}. | |
74 | ||
75 | %prep | |
76 | %setup -q -n %{module}-%{version} | |
77 | ||
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %py3_build %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with doc} | |
89 | cd docs | |
90 | %{__make} -j1 html | |
91 | rm -rf _build/html/_sources | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
100 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
101 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
102 | ||
103 | %py_postclean | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %py3_install | |
108 | %endif | |
109 | ||
110 | %clean | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
113 | %if %{with python2} | |
114 | %files | |
115 | %defattr(644,root,root,755) | |
116 | %doc README.md | |
117 | %{py_sitescriptdir}/%{module}.py* | |
118 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
119 | %endif | |
120 | ||
121 | %if %{with python3} | |
122 | %files -n python3-%{module} | |
123 | %defattr(644,root,root,755) | |
124 | %doc README.md | |
125 | %{py3_sitescriptdir}/%{module}.py | |
126 | %{py3_sitescriptdir}/__pycache__/%{module}.*.pyc | |
127 | ||
128 | ||
129 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
130 | %endif | |
131 | ||
132 | %if %{with doc} | |
133 | %files apidocs | |
134 | %defattr(644,root,root,755) | |
135 | %doc docs/_build/html/* | |
136 | %endif |