]>
Commit | Line | Data |
---|---|---|
eb85e3be JB |
1 | # TODO: tests fail (rpm.org vs rpm5 compat problems?) |
2 | # | |
3 | # Conditional build: | |
807f0e8d | 4 | %bcond_without python3 # CPython 3.x module |
16c66ee9 | 5 | %bcond_with tests # make tests |
7ab42891 | 6 | |
eb85e3be JB |
7 | Summary: Creates a common metadata repository |
8 | Summary(pl.UTF-8): Tworzenie wspólnego repozytorium metadanych | |
9 | Name: createrepo_c | |
807f0e8d | 10 | Version: 0.10.0 |
7ab42891 | 11 | Release: 1 |
eb85e3be JB |
12 | License: GPL v2+ |
13 | Group: Applications/System | |
807f0e8d JB |
14 | #Source0Download: https://github.com/rpm-software-management/createrepo_c/releases |
15 | Source0: https://github.com/rpm-software-management/createrepo_c/archive/%{version}/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: 2e14b3e5d289875b894000ab1e54f1ec | |
eb85e3be | 17 | Patch0: %{name}-rpm5.patch |
16c66ee9 | 18 | Patch1: %{name}-python.patch |
807f0e8d JB |
19 | Patch2: %{name}-include.patch |
20 | URL: https://github.com/rpm-software-management/createrepo_c | |
eb85e3be JB |
21 | BuildRequires: bzip2-devel |
22 | BuildRequires: check-devel | |
23 | BuildRequires: cmake >= 2.6 | |
24 | BuildRequires: curl-devel | |
25 | BuildRequires: doxygen | |
26 | BuildRequires: expat-devel | |
27 | BuildRequires: glib2-devel >= 1:2.22.0 | |
28 | BuildRequires: libmagic-devel | |
29 | BuildRequires: libxml2-devel >= 2 | |
30 | BuildRequires: openssl-devel | |
31 | BuildRequires: python-devel >= 2 | |
32 | %{?with_tests:BuildRequires: python-nose} | |
807f0e8d JB |
33 | %if %{with python3} |
34 | BuildRequires: python3-devel >= 1:3.2 | |
35 | %{?with_tests:BuildRequires: python3-nose} | |
36 | %endif | |
eb85e3be JB |
37 | BuildRequires: rpm-devel >= 5 |
38 | BuildRequires: rpm-pythonprov | |
39 | BuildRequires: rpmbuild(macros) >= 1.219 | |
16c66ee9 | 40 | BuildRequires: sphinx-pdg-2 |
eb85e3be | 41 | BuildRequires: sqlite3-devel >= 3 |
eb85e3be JB |
42 | BuildRequires: xz-devel |
43 | BuildRequires: zlib-devel | |
44 | Requires: %{name}-libs = %{version}-%{release} | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | C implementation of Createrepo. This utility will generate a common | |
49 | metadata repository from a directory of RPM packages. | |
50 | ||
51 | %description -l pl.UTF-8 | |
52 | Implementacja w C programu Createrepo. To narzędzie generuje wspólne | |
53 | repozytorium metadanych z katalogu pakietów RPM. | |
54 | ||
55 | %package libs | |
56 | Summary: Library for repodata manipulation | |
57 | Summary(pl.UTF-8): Biblioteka do operacji na danych repozytorium | |
58 | Group: Libraries | |
59 | Requires: glib2 >= 1:2.22.0 | |
60 | ||
61 | %description libs | |
62 | This package contains the createrepo_c library for applications to | |
63 | easy manipulate with a repodata. | |
64 | ||
65 | %description libs -l pl.UTF-8 | |
66 | Ten pakiet zawiera bibliotekę createrepo_c, pozwalającą aplikacjom na | |
67 | łatwe operowanie na danych repozytorium (repodata). | |
68 | ||
69 | %package devel | |
70 | Summary: Header files for createrepo_c library | |
71 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki createrepo_c | |
72 | Group: Development/Libraries | |
73 | Requires: %{name}-libs = %{version}-%{release} | |
74 | Requires: bzip2-devel | |
75 | Requires: curl-devel | |
76 | Requires: expat-devel | |
77 | Requires: glib2-devel >= 1:2.22.0 | |
78 | Requires: libmagic-devel | |
79 | Requires: libxml2-devel >= 2 | |
80 | Requires: rpm-devel >= 5 | |
81 | Requires: sqlite3-devel >= 3 | |
82 | Requires: xz-devel | |
83 | Requires: zlib-devel | |
84 | ||
85 | %description devel | |
86 | This package contains the createrepo_c C header files. These | |
87 | development files are for easy manipulation with a repodata. | |
88 | ||
89 | %description devel -l pl.UTF-8 | |
7ab42891 ER |
90 | Ten pakiet zawiera pliki nagłówkowe C biblioteki createrepo_c. Mają na |
91 | celu łatwe operowanie na danych repozytorium (repodata). | |
eb85e3be JB |
92 | |
93 | %package apidocs | |
94 | Summary: API documentation for createrepo_c library | |
95 | Summary(pl.UTF-8): Dokumentacja API biblioteki createrepo_c | |
96 | Group: Documentation | |
97 | ||
98 | %description apidocs | |
99 | API documentation for createrepo_c library. | |
100 | ||
101 | %description apidocs -l pl.UTF-8 | |
102 | Dokumentacja API biblioteki createrepo_c. | |
103 | ||
104 | %package -n python-createrepo_c | |
807f0e8d JB |
105 | Summary: Python 2 bindings for the createrepo_c library |
106 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki createrepo_c | |
eb85e3be JB |
107 | Group: Development/Languages/Python |
108 | Requires: %{name}-libs = %{version}-%{release} | |
109 | ||
110 | %description -n python-createrepo_c | |
807f0e8d | 111 | Python 2 bindings for the createrepo_c library. |
eb85e3be JB |
112 | |
113 | %description -n python-createrepo_c -l pl.UTF-8 | |
807f0e8d JB |
114 | Wiązania Pythona 2 do biblioteki createrepo_c. |
115 | ||
116 | %package -n python3-createrepo_c | |
117 | Summary: Python 3 bindings for the createrepo_c library | |
118 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki createrepo_c | |
119 | Group: Development/Languages/Python | |
120 | Requires: %{name}-libs = %{version}-%{release} | |
121 | ||
122 | %description -n python3-createrepo_c | |
123 | Python 3 bindings for the createrepo_c library. | |
124 | ||
125 | %description -n python3-createrepo_c -l pl.UTF-8 | |
126 | Wiązania Pythona 3 do biblioteki createrepo_c. | |
eb85e3be JB |
127 | |
128 | %package -n bash-completion-createrepo_c | |
129 | Summary: Bash completion for createrepo_c commands | |
130 | Summary(pl.UTF-8): Bashowe uzupełnianie dla poleceń createrepo_c | |
131 | Group: Applications/Shells | |
132 | Requires: %{name} = %{version}-%{release} | |
133 | Requires: bash-completion | |
134 | ||
135 | %description -n bash-completion-createrepo_c | |
136 | Bash completion for createrepo_c commands (createrepo_c, mergerepo_c, | |
137 | modifyrepo_c). | |
138 | ||
139 | %description -n bash-completion-createrepo_c -l pl.UTF-8 | |
140 | Bashowe uzupełnianie dla poleceń createrepo_c (createrepo_c, | |
141 | mergerepo_c, modifyrepo_c). | |
142 | ||
143 | %prep | |
807f0e8d | 144 | %setup -q |
eb85e3be | 145 | %patch0 -p1 |
16c66ee9 | 146 | %patch1 -p1 |
807f0e8d | 147 | %patch2 -p1 |
eb85e3be JB |
148 | |
149 | %build | |
807f0e8d JB |
150 | install -d build %{?with_python3:build-py3} |
151 | ||
152 | cd build | |
153 | %cmake .. | |
16c66ee9 | 154 | |
eb85e3be JB |
155 | %{__make} |
156 | %{__make} doc | |
157 | ||
158 | %if %{with tests} | |
159 | %{__make} tests | |
160 | %{__make} test \ | |
161 | ARGS="-V" | |
162 | %endif | |
807f0e8d JB |
163 | cd .. |
164 | ||
165 | %if %{with python3} | |
166 | cd build-py3 | |
167 | %cmake .. \ | |
168 | -DPYTHON_DESIRED=3 | |
169 | ||
170 | %{__make} | |
171 | ||
172 | %if %{with tests} | |
173 | %{__make} tests | |
174 | %{__make} test \ | |
175 | ARGS="-V" | |
176 | %endif | |
177 | cd .. | |
178 | %endif | |
eb85e3be JB |
179 | |
180 | %install | |
181 | rm -rf $RPM_BUILD_ROOT | |
182 | ||
807f0e8d JB |
183 | %if %{with python3} |
184 | %{__make} -C build-py3 install \ | |
185 | DESTDIR=$RPM_BUILD_ROOT | |
186 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/createrepo_c | |
187 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/createrepo_c | |
188 | %endif | |
189 | ||
190 | %{__make} -C build install \ | |
eb85e3be JB |
191 | DESTDIR=$RPM_BUILD_ROOT |
192 | ||
193 | %py_comp $RPM_BUILD_ROOT%{py_sitedir}/createrepo_c | |
194 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/createrepo_c | |
195 | %py_postclean | |
196 | ||
197 | %clean | |
198 | rm -rf $RPM_BUILD_ROOT | |
199 | ||
200 | %post libs -p /sbin/ldconfig | |
201 | %postun libs -p /sbin/ldconfig | |
202 | ||
203 | %files | |
204 | %defattr(644,root,root,755) | |
205 | %attr(755,root,root) %{_bindir}/createrepo_c | |
206 | %attr(755,root,root) %{_bindir}/mergerepo_c | |
207 | %attr(755,root,root) %{_bindir}/modifyrepo_c | |
807f0e8d | 208 | %attr(755,root,root) %{_bindir}/sqliterepo_c |
eb85e3be JB |
209 | %{_mandir}/man8/createrepo_c.8* |
210 | %{_mandir}/man8/mergerepo_c.8* | |
7ab42891 | 211 | %{_mandir}/man8/modifyrepo_c.8* |
807f0e8d | 212 | %{_mandir}/man8/sqliterepo_c.8* |
eb85e3be JB |
213 | |
214 | %files libs | |
215 | %defattr(644,root,root,755) | |
216 | %doc AUTHORS README.md | |
217 | %attr(755,root,root) %{_libdir}/libcreaterepo_c.so.*.*.* | |
218 | %attr(755,root,root) %ghost %{_libdir}/libcreaterepo_c.so.0 | |
219 | ||
220 | %files devel | |
221 | %defattr(644,root,root,755) | |
222 | %attr(755,root,root) %{_libdir}/libcreaterepo_c.so | |
223 | %{_pkgconfigdir}/createrepo_c.pc | |
224 | %{_includedir}/createrepo_c | |
225 | ||
226 | %files apidocs | |
227 | %defattr(644,root,root,755) | |
807f0e8d | 228 | %doc build/doc/html |
eb85e3be JB |
229 | |
230 | %files -n python-createrepo_c | |
231 | %defattr(644,root,root,755) | |
232 | %dir %{py_sitedir}/createrepo_c | |
807f0e8d | 233 | %attr(755,root,root) %{py_sitedir}/createrepo_c/_createrepo_c.so |
eb85e3be JB |
234 | %{py_sitedir}/createrepo_c/__init__.py[co] |
235 | ||
807f0e8d JB |
236 | %if %{with python3} |
237 | %files -n python3-createrepo_c | |
238 | %defattr(644,root,root,755) | |
239 | %dir %{py3_sitedir}/createrepo_c | |
240 | %attr(755,root,root) %{py3_sitedir}/createrepo_c/_createrepo_c.so | |
241 | %{py3_sitedir}/createrepo_c/__init__.py | |
242 | %{py3_sitedir}/createrepo_c/__pycache__ | |
243 | %endif | |
244 | ||
eb85e3be JB |
245 | %files -n bash-completion-createrepo_c |
246 | %defattr(644,root,root,755) | |
247 | /etc/bash_completion.d/createrepo_c.bash |