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 %bcond_with snap # install configs for official Th snapshot
8 # current snapshot name
11 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
14 %define ver_rpm 5.4.10
17 %define rel 14.2%{?with_snap:.%{SNAP}}
18 Summary: RPM packages management helper tool
19 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
20 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
23 Release: 1.%{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/~cactus/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
28 # Source0-md5: ab89926c28cfb6b7d72497fc37c16ac4
30 Source2: %{name}-multilib.conf
31 Source5: %{name}-aliases.conf
32 Source6: %{name}.desktop
34 Source8: %{name}-debuginfo.conf
35 Source9: %{name}-aidath.conf
36 Source10: %{name}-multilib-aidath.conf
37 Source11: %{name}-archive.conf
38 Source100: %{name}-snap.conf
39 Source101: %{name}-multilib-snap.conf
40 Source102: %{name}-debuginfo-snap.conf
41 Patch0: %{name}-vserver-packages.patch
42 Patch1: %{name}-config.patch
43 Patch2: %{name}-size-type.patch
44 Patch3: %{name}-Os-fail-workaround.patch
45 Patch4: %{name}-git.patch
46 Patch5: %{name}-am.patch
47 Patch6: https://bugs.launchpad.net/poldek/+bug/1031767/+attachment/3252805/+files/%{name}-ls-space-lp1031767.patch
48 # Patch6-md5: 9ba0f7abdb2ba1051e1a396f9daec606
49 Patch7: https://bugs.launchpad.net/pld-linux/+bug/1042200/+attachment/3285885/+files/poldek-rpm54.patch
50 # Patch7-md5: 128afb37934a3f12077fff12fddaa3ec
51 Patch8: https://bugs.launchpad.net/pld-linux/+bug/1042200/+attachment/3298948/+files/poldek-pkg-recno-type.patch
52 # Patch8-md5: bdc855d84167592a1adef576eba75de6
53 Patch9: %{name}-Werror-format-security.patch
54 Patch10: https://bugs.launchpad.net/pld-linux/+bug/1042200/+attachment/3307962/+files/poldek-leaking-locks.patch
55 # Patch10-md5: 1fe6857ef429c4b35b94679489850ddd
56 URL: http://poldek.pld-linux.org/
57 BuildRequires: autoconf
58 BuildRequires: automake
59 BuildRequires: bzip2-devel
60 BuildRequires: check-devel
61 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
62 BuildRequires: docbook-dtd412-xml
63 BuildRequires: gettext-devel
64 BuildRequires: libtool
65 BuildRequires: libxml2-devel
66 BuildRequires: neon-devel
67 BuildRequires: openssl-devel >= 0.9.7d
68 BuildRequires: pcre-devel
69 BuildRequires: pkgconfig
70 BuildRequires: popt-devel
71 %{?with_python:BuildRequires: python-devel}
72 BuildRequires: readline-devel >= 5.0
73 BuildRequires: rpm-devel >= %{ver_rpm}
74 %{?with_python:BuildRequires: rpm-pythonprov}
75 BuildRequires: swig-python
77 BuildRequires: zlib-devel
79 BuildRequires: bzip2-static
80 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
81 BuildRequires: glibc-static
82 BuildRequires: libselinux-static
83 BuildRequires: libxml2-static
84 BuildRequires: ncurses-static
85 BuildRequires: openssl-static
86 BuildRequires: pcre-static
87 BuildRequires: popt-static
88 BuildRequires: readline-static
89 BuildRequires: rpm-static
90 BuildRequires: zlib-static
92 Requires(triggerpostun): awk
93 Requires(triggerpostun): sed >= 4.0
94 Requires: %{name}-libs = %{version}-%{release}
95 Requires: db >= %{ver_db}-%{ver_db_rel}
96 Requires: rpm >= %{ver_rpm}
97 Requires: rpm-db-ver = %{ver_db}
98 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
101 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104 poldek is an RPM package management tool which allows you to easily
105 perform package verification, installation (including system
106 installation from scratch), upgrading, and removal.
108 Program can be used in batch (like apt-get from Debian's APT) or
109 interactive mode. The interactive mode puts you into a readline
110 interface with command line autocompletion and history, similar to the
111 shell mode of Perl's CPAN.
113 %{?with_static:This version is statically linked.}
115 %{!?with_imode:This version hasn't got interactive mode.}
118 %description -l hu.UTF-8
119 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
120 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
121 nulláról), frissítést és eltávolítást.
123 A program használható parancssorból (mint a Debian apt-get programja)
124 vagy interaktív módban. Az interaktív mód egy readline környezetet
125 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
128 %{?with_static:Ez a verzió statikusan linkelt.}
130 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
132 %description -l pl.UTF-8
133 poldek jest narzędziem linii poleceń służącym do weryfikacji,
134 instalacji (włączając instalację systemu od zera), aktualizacji i
137 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
138 interaktywnym. Tryb interaktywny posiada interfejs readline z
139 dopełnianiem komend i historią, podobny do trybu shell perlowego
142 %{?with_static:Ta wersja jest konsolidowana statycznie.}
144 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
147 Summary: poldek libraries
148 Summary(hu.UTF-8): A poldek könyvtárai
149 Summary(pl.UTF-8): Biblioteki poldka
155 %description libs -l hu.UTF-8
158 %description libs -l pl.UTF-8
162 Summary: Header files for poldek libraries
163 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
164 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
165 Group: Development/Libraries
166 Requires: %{name}-libs = %{version}-%{release}
167 Requires: rpm-devel >= %{ver_rpm}
170 Header files for poldek libraries.
172 %description devel -l hu.UTF-8
173 A poldek könyvtár fejlesztői fájljai.
175 %description devel -l pl.UTF-8
176 Pliki nagłówkowe bibliotek poldka.
179 Summary: poldek static libraries
180 Summary(hu.UTF-8): poldek statikus könyvtárak
181 Summary(pl.UTF-8): Biblioteki statyczne poldka
182 Group: Development/Libraries
183 Requires: %{name}-devel = %{version}-%{release}
186 poldek static libraries.
188 %description static -l hu.UTF-8
189 poldek statikus könyvtárak.
191 %description static -l pl.UTF-8
192 Biblioteki statyczne poldka.
194 %package -n python-poldek
195 Summary: Python modules for poldek
196 Summary(hu.UTF-8): Python modulok poldek-hez
197 Summary(pl.UTF-8): Moduły języka Python dla poldka
198 Group: Libraries/Python
199 Requires: %{name}-libs = %{version}-%{release}
200 %pyrequires_eq python-libs
202 %description -n python-poldek
203 Python modules for poldek.
205 %description -n python-poldek -l hu.UTF-8
206 Python modulok poldek-hez.
208 %description -n python-poldek -l pl.UTF-8
209 Moduły języka Python dla poldka.
225 %{__rm} m4/libtool.m4 m4/lt*.m4
227 # cleanup backups after patching
228 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
229 chmod u+x ./configure ./doc/conf-xml2.sh
251 CPPFLAGS="%{rpmcppflags} -std=gnu99"
253 %{?with_static:--enable-static --disable-shared} \
254 %{!?with_imode:--disable-imode} \
256 %{?with_python:--with-python}
261 rm -rf $RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
264 %{__make} install -j1 \
265 DESTDIR=$RPM_BUILD_ROOT
268 %{__make} -C python -j1 install \
269 DESTDIR=$RPM_BUILD_ROOT \
273 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
275 %ifarch i486 i686 ppc sparc alpha athlon
276 %define _ftp_arch %{_target_cpu}
279 %define _ftp_arch x86_64
280 %define _ftp_alt_arch i686
283 %define _ftp_arch i486
285 %ifarch pentium2 pentium3 pentium4
286 %define _ftp_arch i686
288 %ifarch sparcv9 sparc64
289 %define _ftp_arch sparc
290 %define _ftp_arch %{_target_cpu}
292 %define _ftp_alt_arch sparcv9
296 %define pld_conf %{SOURCE1}
297 %define pld_debuginfo_conf %{SOURCE8}
298 %define pld_archive_conf %{SOURCE11}
301 %define pld_multilib_conf %{SOURCE2}
305 %ifarch sparcv9 sparc64
306 %define pld_conf %{SOURCE9}
307 %undefine pld_archive_conf
310 %define pld_multilib_conf %{SOURCE10}
313 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
315 %if 0%{?pld_multilib_conf:1}
316 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
319 %if 0%{?pld_debuginfo_conf:1}
320 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
323 %if 0%{?pld_archive_conf:1}
324 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
327 # Always install snapshot configs
328 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
329 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
330 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
331 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
333 %{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \
334 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf
338 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
339 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
341 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
342 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
345 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
348 # add desktop file and icon
349 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
350 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
351 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
354 # sources we don't package
355 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
356 # include them in %doc
359 %{__rm} -f configs/Makefile*
363 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
369 rm -rf $RPM_BUILD_ROOT
372 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
373 if [ "$1" = "1" ]; then
374 # remove ignore = vserver-packages inside vserver on first install
377 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
378 done </proc/self/status
380 if [ -z "$ctx" -o "$ctx" = "0" ]; then
385 if [ "$VSERVER" = "yes" ]; then
386 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
390 %postun -p /sbin/postshell
391 -/usr/sbin/fix-info-dir -c %{_infodir}
393 %post libs -p /sbin/ldconfig
394 %postun libs -p /sbin/ldconfig
396 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
397 if [ -f /etc/poldek.conf.rpmsave ]; then
406 if (sub(",noauto", "", name)) {
411 if (match(name, /,pri=[0-9]+/)) {
412 pri = substr(name, RSTART + 5, RLENGTH - 5);
413 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
416 # skip ac sources. already in new config.
417 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
420 print "name = " name;
421 print "type = " type;
422 print "path = " path;
423 print "auto = " auto;
424 print "autoup = " autoup;
430 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
431 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
434 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
436 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
440 %triggerpostun -- poldek < 0.30-0.20080225.00.1
441 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
442 %{__sed} -i -e '/^%%include source.conf/{
444 a# /etc/poldek/repos.d/*.conf
445 a%%includedir repos.d
446 }' %{_sysconfdir}/%{name}/poldek.conf
449 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
450 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
452 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
453 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
454 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
458 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
459 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
460 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
464 %files -f %{name}.lang
465 %defattr(644,root,root,755)
466 %doc ChangeLog README* NEWS TODO configs
467 %dir %{_sysconfdir}/%{name}
468 %dir %{_sysconfdir}/%{name}/repos.d
469 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
470 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
471 %attr(755,root,root) %{_bindir}/ipoldek
472 %attr(755,root,root) %{_bindir}/poldek
473 %attr(755,root,root) %{_bindir}/rpmvercmp
474 %dir %{_libdir}/%{name}
475 %attr(755,root,root) %{_libdir}/%{name}/*
476 %{_mandir}/man1/%{name}*.1*
477 %lang(pl) %{_mandir}/pl/man1/%{name}*
478 %{_infodir}/poldek.info*
480 %{_desktopdir}/%{name}.desktop
481 %{_pixmapsdir}/%{name}.png
483 %dir /var/cache/%{name}
485 %if %{without static}
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
489 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
490 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
491 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
492 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
493 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
494 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
495 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
496 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
497 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
501 %defattr(644,root,root,755)
502 %if %{without static}
503 %attr(755,root,root) %{_libdir}/libpoclidek.so
504 %attr(755,root,root) %{_libdir}/libpoldek.so
505 %attr(755,root,root) %{_libdir}/libtndb.so
506 %attr(755,root,root) %{_libdir}/libtrurl.so
507 %attr(755,root,root) %{_libdir}/libvfile.so
509 %{_libdir}/libpoclidek.la
510 %{_libdir}/libpoldek.la
511 %{_libdir}/libtndb.la
512 %{_libdir}/libtrurl.la
513 %{_libdir}/libvfile.la
514 %{_includedir}/poldek
518 %{_pkgconfigdir}/tndb.pc
521 %defattr(644,root,root,755)
523 %{_libdir}/libtrurl.a
526 %files -n python-poldek
527 %defattr(644,root,root,755)
528 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
529 %{py_sitescriptdir}/poldek.py[co]
530 %{py_sitescriptdir}/poldekmod.py[co]