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 %if "%{pld_release}" == "ti"
17 %define snap 20080820.23
19 Summary: RPM packages management helper tool
20 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
23 Release: 0.%{snap}.%{rel}
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
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
36 Source8: %{name}-debuginfo.conf
37 Source9: %{name}-aidath.conf
38 Source10: %{name}-multilib-aidath.conf
39 Patch0: %{name}-vserver-packages.patch
40 Patch1: %{name}-config.patch
41 Patch2: %{name}-abort-on-upgrade.patch
42 Patch3: %{name}-inline.patch
43 Patch4: %{name}-ls-llu.patch
44 Patch5: %{name}-op-ldalldesc.patch
45 Patch6: %{name}-nocolor-upgrade.patch
46 Patch7: %{name}-upgrade-dist.patch
47 Patch8: %{name}-keep-reinstalled-provides.patch
48 Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
49 Patch10: %{name}-crash-on-invalid-locale.patch
50 Patch11: %{name}-noutf8.patch
51 Patch12: %{name}-dont-suggests-required-packages.patch
52 Patch13: %{name}-tty-for-erasures.patch
53 Patch14: %{name}-both_langs.patch
54 Patch15: %{name}-317130.patch
55 Patch16: %{name}-321546.patch
56 Patch17: %{name}-size-type.patch
57 Patch18: %{name}-no-inlines.patch
58 Patch19: %{name}-export-missing-symbol.patch
59 Patch20: %{name}-skip-suggests-on-upgrade.patch
60 Patch21: %{name}-po.patch
61 Patch22: %{name}-refcnt.patch
62 Patch23: %{name}-assertion-failed.patch
63 Patch24: %{name}-unescape-urlencoded-strings.patch
64 Patch25: %{name}-ls-source-rpm.patch
65 Patch26: %{name}-add-arch-match.patch
66 Patch27: %{name}-multilib-upgrade.patch
67 Patch28: %{name}-score-reqs-marked-to-install.patch
68 Patch29: %{name}-dont-be-greedy.patch
69 Patch30: %{name}-dont-lose-deps.patch
70 Patch31: %{name}-ls-queryfmt.patch
71 URL: http://poldek.pld-linux.org/
72 BuildRequires: autoconf
73 BuildRequires: automake
74 BuildRequires: bzip2-devel
76 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
77 BuildRequires: gettext-autopoint
78 BuildRequires: libtool
79 BuildRequires: libxml2-devel
80 BuildRequires: openssl-devel >= 0.9.7d
81 BuildRequires: pcre-devel
82 BuildRequires: perl-tools-pod
83 BuildRequires: pkgconfig
84 BuildRequires: popt-devel
85 %{?with_python:BuildRequires: python-devel}
86 BuildRequires: readline-devel >= 5.0
87 BuildRequires: rpm-devel >= %{ver_rpm}
88 %{?with_python:BuildRequires: rpm-pythonprov}
90 BuildRequires: zlib-devel
92 BuildRequires: bzip2-static
93 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
94 BuildRequires: glibc-static
95 BuildRequires: libselinux-static
96 BuildRequires: libxml2-static
97 BuildRequires: ncurses-static
98 BuildRequires: openssl-static
99 BuildRequires: pcre-static
100 BuildRequires: popt-static
101 BuildRequires: readline-static
102 BuildRequires: rpm-static
103 BuildRequires: zlib-static
105 Requires(triggerpostun): awk
106 Requires(triggerpostun): sed >= 4.0
107 Requires: %{name}-libs = %{version}-%{release}
108 Requires: db >= %{ver_db}-%{ver_db_rel}
109 Requires: rpm >= %{ver_rpm}
110 Requires: rpm-db-ver = %{ver_db}
111 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
112 # vf* scripts use sed
114 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
117 poldek is an RPM package management tool which allows you to easily
118 perform package verification, installation (including system
119 installation from scratch), upgrading, and removal.
121 Program can be used in batch (like apt-get from Debian's APT) or
122 interactive mode. The interactive mode puts you into a readline
123 interface with command line autocompletion and history, similar to the
124 shell mode of Perl's CPAN.
126 %{?with_static:This version is statically linked.}
128 %{!?with_imode:This version hasn't got interactive mode.}
131 %description -l pl.UTF-8
132 poldek jest narzędziem linii poleceń służącym do weryfikacji,
133 instalacji (włączając instalację systemu od zera), aktualizacji i
136 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
137 interaktywnym. Tryb interaktywny posiada interfejs readline z
138 dopełnianiem komend i historią, podobny do trybu shell perlowego
141 %{?with_static:Ta wersja jest konsolidowana statycznie.}
143 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
146 Summary: poldek libraries
147 Summary(pl.UTF-8): Biblioteki poldka
153 %description libs -l pl.UTF-8
157 Summary: Header files for poldek libraries
158 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
159 Group: Development/Libraries
160 Requires: %{name}-libs = %{version}-%{release}
161 Requires: rpm-devel >= %{ver_rpm}
164 Header files for poldek libraries.
166 %description devel -l pl.UTF-8
167 Pliki nagłówkowe bibliotek poldka.
170 Summary: poldek static libraries
171 Summary(pl.UTF-8): Biblioteki statyczne poldka
172 Group: Development/Libraries
173 Requires: %{name}-devel = %{version}-%{release}
176 poldek static libraries.
178 %description static -l pl.UTF-8
179 Biblioteki statyczne poldka.
181 %package -n python-poldek
182 Summary: Python modules for poldek
183 Summary(pl.UTF-8): Moduły języka Python dla poldka
184 Group: Libraries/Python
185 Requires: %{name}-libs = %{version}-%{release}
186 %pyrequires_eq python-libs
188 %description -n python-poldek
189 Python modules for poldek.
191 %description -n python-poldek -l pl.UTF-8
192 Moduły języka Python dla poldka.
195 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
227 # score reqs already marked to install
229 # dont be greedy if upgraded pkg has needed capabilities
231 # http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2009-November/150519.html
235 # cleanup backups after patching
236 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
243 cp -f config.sub trurlib
245 CPPFLAGS="-std=gnu99"
247 %{?with_static:--enable-static --disable-shared} \
248 %{!?with_imode:--disable-imode} \
250 %{?with_python:--with-python}
255 rm -rf $RPM_BUILD_ROOT
256 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
259 DESTDIR=$RPM_BUILD_ROOT
262 %{__make} -C python install \
263 DESTDIR=$RPM_BUILD_ROOT \
267 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
269 %ifarch i486 i686 ppc sparc alpha athlon
270 %define _ftp_arch %{_target_cpu}
273 %define _ftp_arch x86_64
274 %define _ftp_alt_arch i686
277 %if "%{pld_release}" == "ti"
278 %define _ftp_arch i586
280 %define _ftp_arch i486
283 %ifarch pentium2 pentium3 pentium4
284 %define _ftp_arch i686
286 %ifarch sparcv9 sparc64
287 %define _ftp_arch sparc
288 %if "%{pld_release}" == "th"
289 %define _ftp_arch %{_target_cpu}
291 %define _ftp_alt_arch sparcv9
296 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
298 %if "%{pld_release}" == "ti"
300 s|%%ARCH%%|%{_ftp_arch}|g
301 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
305 s|%%ARCH%%|%{_ftp_alt_arch}|g
306 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
310 %ifarch sparcv9 sparc64
312 s|%%ARCH%%|%{_ftp_arch}|g
313 ' < %{SOURCE9} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
317 s|%%ARCH%%|%{_ftp_alt_arch}|g
318 ' < %{SOURCE10} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
323 s|%%ARCH%%|%{_ftp_arch}|g
324 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
326 s|%%ARCH%%|%{_ftp_arch}|g
327 ' < %{SOURCE8} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
331 s|%%ARCH%%|%{_ftp_alt_arch}|g
332 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
337 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
340 # add desktop file and icon
341 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
342 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
343 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
346 # sources we don't package
347 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
348 # include them in %doc
351 rm -f configs/Makefile*
355 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
361 rm -rf $RPM_BUILD_ROOT
364 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
365 if [ "$1" = "1" ]; then
366 # remove ignore = vserver-packages inside vserver on first install
369 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
370 done </proc/self/status
372 if [ -z "$ctx" -o "$ctx" = "0" ]; then
377 if [ "$VSERVER" = "yes" ]; then
378 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
382 %postun -p /sbin/postshell
383 -/usr/sbin/fix-info-dir -c %{_infodir}
385 %post libs -p /sbin/ldconfig
386 %postun libs -p /sbin/ldconfig
388 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
389 if [ -f /etc/poldek.conf.rpmsave ]; then
398 if (sub(",noauto", "", name)) {
403 if (match(name, /,pri=[0-9]+/)) {
404 pri = substr(name, RSTART + 5, RLENGTH - 5);
405 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
408 # skip ac sources. already in new config.
409 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
412 print "name = " name;
413 print "type = " type;
414 print "path = " path;
415 print "auto = " auto;
416 print "autoup = " autoup;
422 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
423 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
426 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
428 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
432 %triggerpostun -- poldek < 0.30-0.20080225.00.1
433 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
434 %{__sed} -i -e '/^%%include source.conf/{
436 a# /etc/poldek/repos.d/*.conf
437 a%%includedir repos.d
438 }' %{_sysconfdir}/%{name}/poldek.conf
441 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
442 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
444 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
445 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
446 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
450 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
451 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
452 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
456 %files -f %{name}.lang
457 %defattr(644,root,root,755)
458 %doc README* NEWS TODO configs
459 %dir %{_sysconfdir}/%{name}
460 %dir %{_sysconfdir}/%{name}/repos.d
461 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
462 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
463 %attr(755,root,root) %{_bindir}/*
464 %dir %{_libdir}/%{name}
465 %attr(755,root,root) %{_libdir}/%{name}/*
466 %{_mandir}/man1/%{name}*
467 %lang(pl) %{_mandir}/pl/man1/%{name}*
468 %{_infodir}/poldek.info*
470 %{_desktopdir}/%{name}.desktop
471 %{_pixmapsdir}/%{name}.png
474 %if %{without static}
476 %defattr(644,root,root,755)
477 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
478 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
479 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
480 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
481 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
482 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
483 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
484 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
485 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
486 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
490 %defattr(644,root,root,755)
491 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
496 %defattr(644,root,root,755)
500 %files -n python-poldek
501 %defattr(644,root,root,755)
502 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
503 %{py_sitescriptdir}/poldek.py[co]
504 %{py_sitescriptdir}/poldekmod.py[co]