]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with static # don't use shared libraries | |
4 | %bcond_without imode # don't build interactive mode | |
5 | %bcond_without python # don't build python bindings | |
6 | # | |
7 | # required versions (forced to avoid SEGV with mixed db used by rpm and poldek) | |
8 | %if "%{pld_release}" == "ti" | |
9 | %define ver_db 4.5.20 | |
10 | %define ver_db_rel 8 | |
11 | %else | |
12 | %define ver_db 4.7.25 | |
13 | %define ver_db_rel 1 | |
14 | %endif | |
15 | %define ver_rpm 4.5-5 | |
16 | # | |
17 | %define snap 20080820.23 | |
18 | %define rel 11 | |
19 | Summary: RPM packages management helper tool | |
20 | Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM | |
21 | Name: poldek | |
22 | Version: 0.30 | |
23 | Release: 0.%{snap}.%{rel} | |
24 | License: GPL v2 | |
25 | Group: Applications/System | |
26 | #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2 | |
27 | Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2 | |
28 | # Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414 | |
29 | Source1: %{name}.conf | |
30 | Source2: %{name}-multilib.conf | |
31 | Source3: %{name}-ti.conf | |
32 | Source4: %{name}-multilib-ti.conf | |
33 | Source5: %{name}-aliases.conf | |
34 | Source6: %{name}.desktop | |
35 | Source7: %{name}.png | |
36 | Patch0: %{name}-vserver-packages.patch | |
37 | Patch1: %{name}-config.patch | |
38 | Patch2: %{name}-abort-on-upgrade.patch | |
39 | Patch3: %{name}-inline.patch | |
40 | Patch4: %{name}-ls-llu.patch | |
41 | Patch5: %{name}-op-ldalldesc.patch | |
42 | Patch6: %{name}-nocolor-upgrade.patch | |
43 | Patch7: %{name}-upgrade-dist.patch | |
44 | Patch8: %{name}-keep-reinstalled-provides.patch | |
45 | Patch9: %{name}-dont-ask-for-suggests-on-errors.patch | |
46 | Patch10: %{name}-crash-on-invalid-locale.patch | |
47 | Patch11: %{name}-up_mini18n.patch | |
48 | Patch12: %{name}-dont-suggests-required-packages.patch | |
49 | Patch13: %{name}-tty-for-erasures.patch | |
50 | URL: http://poldek.pld-linux.org/ | |
51 | BuildRequires: autoconf | |
52 | BuildRequires: automake | |
53 | BuildRequires: bzip2-devel | |
54 | BuildRequires: check | |
55 | BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel} | |
56 | BuildRequires: gettext-autopoint | |
57 | BuildRequires: libtool | |
58 | BuildRequires: libxml2-devel | |
59 | BuildRequires: openssl-devel >= 0.9.7d | |
60 | BuildRequires: pcre-devel | |
61 | BuildRequires: perl-tools-pod | |
62 | BuildRequires: pkgconfig | |
63 | BuildRequires: popt-devel | |
64 | %{?with_python:BuildRequires: python-devel} | |
65 | BuildRequires: readline-devel >= 5.0 | |
66 | BuildRequires: rpm-devel >= %{ver_rpm} | |
67 | %{?with_python:BuildRequires: rpm-pythonprov} | |
68 | BuildRequires: xmlto | |
69 | BuildRequires: zlib-devel | |
70 | %if %{with static} | |
71 | BuildRequires: bzip2-static | |
72 | BuildRequires: db-static >= %{ver_db}-%{ver_db_rel} | |
73 | BuildRequires: glibc-static | |
74 | BuildRequires: libselinux-static | |
75 | BuildRequires: libxml2-static | |
76 | BuildRequires: ncurses-static | |
77 | BuildRequires: openssl-static | |
78 | BuildRequires: pcre-static | |
79 | BuildRequires: popt-static | |
80 | BuildRequires: readline-static | |
81 | BuildRequires: rpm-static | |
82 | BuildRequires: zlib-static | |
83 | %endif | |
84 | Requires(triggerpostun): awk | |
85 | Requires(triggerpostun): sed >= 4.0 | |
86 | Requires: %{name}-libs = %{version}-%{release} | |
87 | Requires: db >= %{ver_db}-%{ver_db_rel} | |
88 | Requires: rpm >= %{ver_rpm} | |
89 | Requires: rpm-db-ver = %{ver_db} | |
90 | Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib) | |
91 | # vf* scripts use sed | |
92 | Requires: sed | |
93 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
94 | ||
95 | %description | |
96 | poldek is an RPM package management tool which allows you to easily | |
97 | perform package verification, installation (including system | |
98 | installation from scratch), upgrading, and removal. | |
99 | ||
100 | Program can be used in batch (like apt-get from Debian's APT) or | |
101 | interactive mode. The interactive mode puts you into a readline | |
102 | interface with command line autocompletion and history, similar to the | |
103 | shell mode of Perl's CPAN. | |
104 | ||
105 | %{?with_static:This version is statically linked.} | |
106 | ||
107 | %{!?with_imode:This version hasn't got interactive mode.} | |
108 | #'vim | |
109 | ||
110 | %description -l pl.UTF-8 | |
111 | poldek jest narzędziem linii poleceń służącym do weryfikacji, | |
112 | instalacji (włączając instalację systemu od zera), aktualizacji i | |
113 | usuwania pakietów. | |
114 | ||
115 | Program może być używany w trybie wsadowym (jak debianowy apt-get) lub | |
116 | interaktywnym. Tryb interaktywny posiada interfejs readline z | |
117 | dopełnianiem komend i historią, podobny do trybu shell perlowego | |
118 | modułu CPAN. | |
119 | ||
120 | %{?with_static:Ta wersja jest konsolidowana statycznie.} | |
121 | ||
122 | %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.} | |
123 | ||
124 | %package libs | |
125 | Summary: poldek libraries | |
126 | Summary(pl.UTF-8): Biblioteki poldka | |
127 | Group: Libraries | |
128 | ||
129 | %description libs | |
130 | poldek libraries. | |
131 | ||
132 | %description libs -l pl.UTF-8 | |
133 | Biblioteki poldka. | |
134 | ||
135 | %package devel | |
136 | Summary: Header files for poldek libraries | |
137 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka | |
138 | Group: Development/Libraries | |
139 | Requires: %{name}-libs = %{version}-%{release} | |
140 | ||
141 | %description devel | |
142 | Header files for poldek libraries. | |
143 | ||
144 | %description devel -l pl.UTF-8 | |
145 | Pliki nagłówkowe bibliotek poldka. | |
146 | ||
147 | %package static | |
148 | Summary: poldek static libraries | |
149 | Summary(pl.UTF-8): Biblioteki statyczne poldka | |
150 | Group: Development/Libraries | |
151 | Requires: %{name}-devel = %{version}-%{release} | |
152 | ||
153 | %description static | |
154 | poldek static libraries. | |
155 | ||
156 | %description static -l pl.UTF-8 | |
157 | Biblioteki statyczne poldka. | |
158 | ||
159 | %package -n python-poldek | |
160 | Summary: Python modules for poldek | |
161 | Summary(pl.UTF-8): Moduły języka Python dla poldka | |
162 | Group: Libraries/Python | |
163 | Requires: %{name}-libs = %{version}-%{release} | |
164 | %pyrequires_eq python-libs | |
165 | ||
166 | %description -n python-poldek | |
167 | Python modules for poldek. | |
168 | ||
169 | %description -n python-poldek -l pl.UTF-8 | |
170 | Moduły języka Python dla poldka. | |
171 | ||
172 | %prep | |
173 | %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}} | |
174 | %patch0 -p1 | |
175 | %patch1 -p1 | |
176 | %patch2 -p1 | |
177 | %patch3 -p1 | |
178 | %patch4 -p1 | |
179 | %patch5 -p1 | |
180 | %patch6 -p0 | |
181 | %patch7 -p0 | |
182 | %patch8 -p0 | |
183 | %patch9 -p0 | |
184 | %patch10 -p1 | |
185 | #%patch11 -p1 | |
186 | %patch12 -p1 | |
187 | %patch13 -p1 | |
188 | ||
189 | # cleanup backups after patching | |
190 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
191 | ||
192 | %build | |
193 | %{__libtoolize} | |
194 | %{__aclocal} -I m4 | |
195 | %{__autoconf} | |
196 | %{__automake} | |
197 | cp -f config.sub trurlib | |
198 | ||
199 | CPPFLAGS="-std=gnu99" | |
200 | %configure \ | |
201 | %{?with_static:--enable-static --disable-shared} \ | |
202 | %{!?with_imode:--disable-imode} \ | |
203 | --enable-nls \ | |
204 | %{?with_python:--with-python} | |
205 | %{__make} | |
206 | ||
207 | %install | |
208 | rm -rf $RPM_BUILD_ROOT | |
209 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d | |
210 | ||
211 | %{__make} install \ | |
212 | DESTDIR=$RPM_BUILD_ROOT | |
213 | ||
214 | %if %{with python} | |
215 | %{__make} -C python install \ | |
216 | DESTDIR=$RPM_BUILD_ROOT \ | |
217 | libdir=%{py_sitedir} | |
218 | %endif | |
219 | ||
220 | %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp} | |
221 | ||
222 | %ifarch i486 i686 ppc sparc alpha athlon | |
223 | %define _ftp_arch %{_target_cpu} | |
224 | %endif | |
225 | %ifarch %{x8664} | |
226 | %define _ftp_arch x86_64 | |
227 | %define _ftp_alt_arch i686 | |
228 | %endif | |
229 | %ifarch i586 | |
230 | %if "%{pld_release}" == "ti" | |
231 | %define _ftp_arch i586 | |
232 | %else | |
233 | %define _ftp_arch i486 | |
234 | %endif | |
235 | %endif | |
236 | %ifarch pentium2 pentium3 pentium4 | |
237 | %define _ftp_arch i686 | |
238 | %endif | |
239 | %ifarch sparcv9 sparc64 | |
240 | %define _ftp_arch sparc | |
241 | %endif | |
242 | ||
243 | %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp} | |
244 | ||
245 | %if "%{pld_release}" == "ti" | |
246 | sed -e ' | |
247 | s|%%ARCH%%|%{_ftp_arch}|g | |
248 | ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf | |
249 | ||
250 | %ifarch %{x8664} | |
251 | sed ' | |
252 | s|%%ARCH%%|%{_ftp_alt_arch}|g | |
253 | ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf | |
254 | %endif | |
255 | %else | |
256 | sed -e ' | |
257 | s|%%ARCH%%|%{_ftp_arch}|g | |
258 | ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf | |
259 | ||
260 | %ifarch %{x8664} | |
261 | sed ' | |
262 | s|%%ARCH%%|%{_ftp_alt_arch}|g | |
263 | ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf | |
264 | %endif | |
265 | %endif | |
266 | ||
267 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf | |
268 | ||
269 | %if %{with imode} | |
270 | # add desktop file and icon | |
271 | install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}} | |
272 | install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop | |
273 | install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png | |
274 | %endif | |
275 | ||
276 | # sources we don't package | |
277 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf | |
278 | # include them in %doc | |
279 | rm -rf configs | |
280 | cp -a conf configs | |
281 | rm -f configs/Makefile* | |
282 | ||
283 | %if %{with python} | |
284 | %py_postclean | |
285 | rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la | |
286 | %endif | |
287 | ||
288 | %find_lang %{name} | |
289 | ||
290 | %clean | |
291 | rm -rf $RPM_BUILD_ROOT | |
292 | ||
293 | %post -p /sbin/postshell | |
294 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
295 | ||
296 | %postun -p /sbin/postshell | |
297 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
298 | ||
299 | %post libs -p /sbin/ldconfig | |
300 | %postun libs -p /sbin/ldconfig | |
301 | ||
302 | %triggerpostun -- poldek < 0.19.0-1.20050613.22.0 | |
303 | if [ -f /etc/poldek.conf.rpmsave ]; then | |
304 | awk '/^source/ { | |
305 | name = $3; | |
306 | path = $4; | |
307 | auto = "yes"; | |
308 | autoup = "yes"; | |
309 | type = "pdir"; | |
310 | pri = ""; | |
311 | ||
312 | if (sub(",noauto", "", name)) { | |
313 | auto = "no"; | |
314 | } | |
315 | ||
316 | # process pri=\d+ | |
317 | if (match(name, /,pri=[0-9]+/)) { | |
318 | pri = substr(name, RSTART + 5, RLENGTH - 5); | |
319 | name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH); | |
320 | } | |
321 | ||
322 | # skip ac sources. already in new config. | |
323 | if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) { | |
324 | print ""; | |
325 | print "[source]"; | |
326 | print "name = " name; | |
327 | print "type = " type; | |
328 | print "path = " path; | |
329 | print "auto = " auto; | |
330 | print "autoup = " autoup; | |
331 | if (pri) { | |
332 | print "pri = " pri; | |
333 | } | |
334 | } | |
335 | ||
336 | }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf | |
337 | echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf" | |
338 | ||
339 | # copy hold= | |
340 | hold=$(grep ^hold /etc/poldek.conf.rpmsave) | |
341 | if [ "$hold" ]; then | |
342 | sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf | |
343 | fi | |
344 | fi | |
345 | ||
346 | %triggerpostun -- poldek < 0.30-0.20080225.00.1 | |
347 | if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then | |
348 | %{__sed} -i -e '/^%%include source.conf/{ | |
349 | a | |
350 | a# /etc/poldek/repos.d/*.conf | |
351 | a%%includedir repos.d | |
352 | }' %{_sysconfdir}/%{name}/poldek.conf | |
353 | fi | |
354 | ||
355 | %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf | |
356 | %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf | |
357 | ||
358 | if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then | |
359 | cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew} | |
360 | cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf | |
361 | fi | |
362 | ||
363 | %ifarch %{x8664} | |
364 | if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then | |
365 | cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew} | |
366 | cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf | |
367 | fi | |
368 | %endif | |
369 | ||
370 | %files -f %{name}.lang | |
371 | %defattr(644,root,root,755) | |
372 | %doc README* NEWS TODO configs | |
373 | %dir %{_sysconfdir}/%{name} | |
374 | %dir %{_sysconfdir}/%{name}/repos.d | |
375 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf | |
376 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf | |
377 | %attr(755,root,root) %{_bindir}/* | |
378 | %dir %{_libdir}/%{name} | |
379 | %attr(755,root,root) %{_libdir}/%{name}/* | |
380 | %{_mandir}/man1/%{name}* | |
381 | %lang(pl) %{_mandir}/pl/man1/%{name}* | |
382 | %{_infodir}/poldek.info* | |
383 | %if %{with imode} | |
384 | %{_desktopdir}/%{name}.desktop | |
385 | %{_pixmapsdir}/%{name}.png | |
386 | %endif | |
387 | ||
388 | %if %{without static} | |
389 | %files libs | |
390 | %defattr(644,root,root,755) | |
391 | %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.* | |
392 | %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.* | |
393 | %attr(755,root,root) %{_libdir}/libtndb.so.*.*.* | |
394 | %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.* | |
395 | %attr(755,root,root) %{_libdir}/libvfile.so.*.*.* | |
396 | %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0 | |
397 | %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2 | |
398 | %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0 | |
399 | %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0 | |
400 | %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0 | |
401 | %endif | |
402 | ||
403 | %files devel | |
404 | %defattr(644,root,root,755) | |
405 | %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so} | |
406 | %{_libdir}/lib*.la | |
407 | %{_includedir}/* | |
408 | ||
409 | %files static | |
410 | %defattr(644,root,root,755) | |
411 | %{_libdir}/lib*.a | |
412 | ||
413 | %if %{with python} | |
414 | %files -n python-poldek | |
415 | %defattr(644,root,root,755) | |
416 | %attr(755,root,root) %{py_sitedir}/_poldekmod.so | |
417 | %{py_sitescriptdir}/poldek.py[co] | |
418 | %{py_sitescriptdir}/poldekmod.py[co] | |
419 | %endif |