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