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
7 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
8 %define ver_db 4.3.27-1
9 %define ver_rpm 4.4.9-1
11 %define snap 20080820.23
13 Summary: RPM packages management helper tool
14 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
17 Release: 0.%{snap}.%{rel}
19 Group: Applications/System
20 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
21 Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
22 # Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
24 Source2: %{name}-multilib.conf
25 Source5: %{name}-aliases.conf
26 Source6: %{name}.desktop
28 Patch100: %{name}-dirdeps.patch
29 Patch0: %{name}-vserver-packages.patch
30 Patch1: %{name}-config.patch
31 Patch2: %{name}-abort-on-upgrade.patch
32 Patch3: %{name}-inline.patch
33 Patch4: %{name}-ls-llu.patch
34 Patch5: %{name}-op-ldalldesc.patch
35 Patch6: %{name}-nocolor-upgrade.patch
36 Patch7: %{name}-upgrade-dist.patch
37 Patch8: %{name}-keep-reinstalled-provides.patch
38 Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
39 Patch10: %{name}-crash-on-invalid-locale.patch
40 Patch11: %{name}-noutf8.patch
41 Patch12: %{name}-dont-suggests-required-packages.patch
42 Patch13: %{name}-tty-for-erasures.patch
43 Patch14: %{name}-both_langs.patch
44 Patch15: %{name}-317130.patch
45 Patch16: %{name}-321546.patch
46 Patch17: %{name}-size-type.patch
47 Patch18: %{name}-no-inlines.patch
48 Patch19: %{name}-export-missing-symbol.patch
49 Patch20: %{name}-skip-suggests-on-upgrade.patch
50 Patch21: %{name}-po.patch
51 Patch22: %{name}-refcnt.patch
52 Patch23: %{name}-assertion-failed.patch
53 Patch24: %{name}-unescape-urlencoded-strings.patch
54 Patch25: %{name}-ls-source-rpm.patch
55 Patch26: %{name}-add-arch-match.patch
56 Patch27: %{name}-multilib-upgrade.patch
57 Patch28: %{name}-score-reqs-marked-to-install.patch
58 Patch29: %{name}-dont-be-greedy.patch
59 Patch30: %{name}-dont-lose-deps.patch
60 Patch31: %{name}-ls-queryfmt.patch
61 Patch32: %{name}-prepare_url_fix.patch
62 Patch33: %{name}-noloop_on_terminal_loos.patch
63 Patch34: %{name}-show_only_relative_used_space.patch
64 Patch35: %{name}-zlib.patch
65 URL: http://poldek.pld-linux.org/
66 BuildRequires: autoconf
67 BuildRequires: automake
68 BuildRequires: bzip2-devel
69 BuildRequires: db-devel >= %{ver_db}
70 BuildRequires: gettext-autopoint
71 BuildRequires: gettext-devel
72 BuildRequires: libtool
73 BuildRequires: libxml2-devel
74 BuildRequires: openssl-devel >= 0.9.7d
75 BuildRequires: pcre-devel
76 BuildRequires: pkgconfig
77 BuildRequires: popt-devel
78 %{?with_python:BuildRequires: python-devel}
79 BuildRequires: readline-devel >= 5.0
80 BuildRequires: rpm-devel >= %{ver_rpm}
81 %{?with_python:BuildRequires: rpm-pythonprov}
82 BuildRequires: sed >= 4.0
83 BuildRequires: zlib-devel
85 BuildRequires: bzip2-static
86 BuildRequires: db-static >= %{ver_db}
87 BuildRequires: glibc-static
88 BuildRequires: libselinux-static
89 BuildRequires: libxml2-static
90 BuildRequires: ncurses-static
91 BuildRequires: openssl-static
92 BuildRequires: pcre-static
93 BuildRequires: popt-static
94 BuildRequires: readline-static
95 BuildRequires: rpm-static
96 BuildRequires: zlib-static
98 Requires(triggerpostun): awk
99 Requires(triggerpostun): sed >= 4.0
100 Requires: %{name}-libs = %{version}-%{release}
101 Requires: db >= %{ver_db}
102 Requires: openssl >= 0.9.7d
103 Requires: rpm >= %{ver_rpm}
104 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
105 # vf* scripts use sed
107 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
110 poldek is an RPM package management tool which allows you to easily
111 perform package verification, installation (including system
112 installation from scratch), upgrading, and removal.
114 Program can be used in batch (like apt-get from Debian's APT) or
115 interactive mode. The interactive mode puts you into a readline
116 interface with command line autocompletion and history, similar to the
117 shell mode of Perl's CPAN.
119 %{?with_static:This version is statically linked.}
121 %{!?with_imode:This version hasn't got interactive mode.}
124 %description -l pl.UTF-8
125 poldek jest narzędziem linii poleceń służącym do weryfikacji,
126 instalacji (włączając instalację systemu od zera), aktualizacji i
129 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
130 interaktywnym. Tryb interaktywny posiada interfejs readline z
131 dopełnianiem komend i historią, podobny do trybu shell perlowego
134 %{?with_static:Ta wersja jest konsolidowana statycznie.}
136 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
139 Summary: poldek libraries
140 Summary(pl.UTF-8): Biblioteki poldka
146 %description libs -l pl.UTF-8
150 Summary: Header files for poldek libraries
151 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
152 Group: Development/Libraries
153 Requires: %{name}-libs = %{version}-%{release}
154 Requires: rpm-devel >= %{ver_rpm}
157 Header files for poldek libraries.
159 %description devel -l pl.UTF-8
160 Pliki nagłówkowe bibliotek poldka.
163 Summary: poldek static libraries
164 Summary(pl.UTF-8): Biblioteki statyczne poldka
165 Group: Development/Libraries
166 Requires: %{name}-devel = %{version}-%{release}
169 poldek static libraries.
171 %description static -l pl.UTF-8
172 Biblioteki statyczne poldka.
174 %package -n python-poldek
175 Summary: Python modules for poldek
176 Summary(pl.UTF-8): Moduły języka Python dla poldka
177 Group: Libraries/Python
178 Requires: %{name}-libs = %{version}-%{release}
179 %pyrequires_eq python-libs
181 %description -n python-poldek
182 Python modules for poldek.
184 %description -n python-poldek -l pl.UTF-8
185 Moduły języka Python dla poldka.
188 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
215 # LP#392984: add source rpm to ls
221 # score reqs already marked to install
223 # dont be greedy if upgraded pkg has needed capabilities
225 # http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2009-November/150519.html
227 # LP#392984: add query format to ls
233 # do not info. about amount of transaction space req. but relative to already installed
235 # fixes failures with zlib >= 1.2.3.7
238 # cleanup backups after patching
239 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
246 cp -f config.sub trurlib
248 CPPFLAGS="-std=gnu99"
250 %{?with_static:--enable-static --disable-shared} \
251 %{!?with_imode:--disable-imode} \
253 %{?with_python:--with-python}
258 rm -rf $RPM_BUILD_ROOT
259 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
262 DESTDIR=$RPM_BUILD_ROOT
265 %{__make} -C python install \
266 DESTDIR=$RPM_BUILD_ROOT \
270 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
272 %ifarch i386 i586 i686 ppc sparc alpha athlon
273 %define _ftp_arch %{_target_cpu}
276 %define _ftp_arch amd64
277 %define _ftp_alt_arch i686
280 %define _ftp_arch i386
282 %ifarch pentium2 pentium3 pentium4
283 %define _ftp_arch i686
285 %ifarch sparcv9 sparc64
286 %define _ftp_arch sparc
289 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
292 s|%%ARCH%%|%{_ftp_arch}|g
293 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
297 s|%%ARCH%%|%{_ftp_alt_arch}|g
298 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
301 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
304 # add desktop file and icon
305 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
306 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
307 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
310 # sources we don't package
311 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
312 # include them in %doc
315 rm -f configs/Makefile*
319 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
325 rm -rf $RPM_BUILD_ROOT
328 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
329 if [ "$1" = "1" ]; then
330 # remove ignore = vserver-packages inside vserver on first install
333 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
334 done </proc/self/status
336 if [ -z "$ctx" -o "$ctx" = "0" ]; then
341 if [ "$VSERVER" = "yes" ]; then
342 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
346 %postun -p /sbin/postshell
347 -/usr/sbin/fix-info-dir -c %{_infodir}
349 %post libs -p /sbin/ldconfig
350 %postun libs -p /sbin/ldconfig
352 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
353 if [ -f /etc/poldek.conf.rpmsave ]; then
362 if (sub(",noauto", "", name)) {
367 if (match(name, /,pri=[0-9]+/)) {
368 pri = substr(name, RSTART + 5, RLENGTH - 5);
369 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
372 # skip ac sources. already in new config.
373 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
376 print "name = " name;
377 print "type = " type;
378 print "path = " path;
379 print "auto = " auto;
380 print "autoup = " autoup;
386 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
387 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
390 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
392 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
396 %triggerpostun -- poldek < 0.30-0.20080225.00.1
397 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
398 %{__sed} -i -e '/^%%include source.conf/{
400 a# /etc/poldek/repos.d/*.conf
401 a%%includedir repos.d
402 }' %{_sysconfdir}/%{name}/poldek.conf
405 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
406 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
408 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
409 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
410 mv -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
411 %{__sed} -i -e 's,_pld_arch,_arch,g;s,_ac_idxtype,_type,g;s,_pld_prefix,_prefix,g' \
412 %{_sysconfdir}/%{name}/repos.d/pld.conf
416 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
417 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
418 mv -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
419 %{__sed} -i -e 's,_pld_arch,_arch,g;s,_ac_idxtype,_type,g;s,_pld_prefix,_prefix,g' \
420 %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
424 %files -f %{name}.lang
425 %defattr(644,root,root,755)
426 %doc README* NEWS TODO configs
427 %dir %{_sysconfdir}/%{name}
428 %dir %{_sysconfdir}/%{name}/repos.d
429 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
430 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
431 %attr(755,root,root) %{_bindir}/*
432 %dir %{_libdir}/%{name}
433 %attr(755,root,root) %{_libdir}/%{name}/*
434 %{_mandir}/man1/%{name}*
435 %lang(pl) %{_mandir}/pl/man1/%{name}*
436 %{_infodir}/poldek.info*
438 %{_desktopdir}/%{name}.desktop
439 %{_pixmapsdir}/%{name}.png
442 %if %{without static}
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
446 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
447 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
448 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
449 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
450 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
451 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
452 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
453 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
454 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
458 %defattr(644,root,root,755)
459 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
464 %defattr(644,root,root,755)
468 %files -n python-poldek
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
471 %{py_sitescriptdir}/poldek.py[co]
472 %{py_sitescriptdir}/poldekmod.py[co]