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.1%{?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 URL: http://poldek.pld-linux.org/
54 BuildRequires: autoconf
55 BuildRequires: automake
56 BuildRequires: bzip2-devel
57 BuildRequires: check-devel
58 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
59 BuildRequires: docbook-dtd412-xml
60 BuildRequires: gettext-devel
61 BuildRequires: libtool
62 BuildRequires: libxml2-devel
63 BuildRequires: neon-devel
64 BuildRequires: openssl-devel >= 0.9.7d
65 BuildRequires: pcre-devel
66 BuildRequires: pkgconfig
67 BuildRequires: popt-devel
68 %{?with_python:BuildRequires: python-devel}
69 BuildRequires: readline-devel >= 5.0
70 BuildRequires: rpm-devel >= %{ver_rpm}
71 %{?with_python:BuildRequires: rpm-pythonprov}
72 BuildRequires: swig-python
74 BuildRequires: zlib-devel
76 BuildRequires: bzip2-static
77 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
78 BuildRequires: glibc-static
79 BuildRequires: libselinux-static
80 BuildRequires: libxml2-static
81 BuildRequires: ncurses-static
82 BuildRequires: openssl-static
83 BuildRequires: pcre-static
84 BuildRequires: popt-static
85 BuildRequires: readline-static
86 BuildRequires: rpm-static
87 BuildRequires: zlib-static
89 Requires(triggerpostun): awk
90 Requires(triggerpostun): sed >= 4.0
91 Requires: %{name}-libs = %{version}-%{release}
92 Requires: db >= %{ver_db}-%{ver_db_rel}
93 Requires: rpm >= %{ver_rpm}
94 Requires: rpm-db-ver = %{ver_db}
95 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
98 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 poldek is an RPM package management tool which allows you to easily
102 perform package verification, installation (including system
103 installation from scratch), upgrading, and removal.
105 Program can be used in batch (like apt-get from Debian's APT) or
106 interactive mode. The interactive mode puts you into a readline
107 interface with command line autocompletion and history, similar to the
108 shell mode of Perl's CPAN.
110 %{?with_static:This version is statically linked.}
112 %{!?with_imode:This version hasn't got interactive mode.}
115 %description -l hu.UTF-8
116 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
117 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
118 nulláról), frissítést és eltávolítást.
120 A program használható parancssorból (mint a Debian apt-get programja)
121 vagy interaktív módban. Az interaktív mód egy readline környezetet
122 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
125 %{?with_static:Ez a verzió statikusan linkelt.}
127 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
129 %description -l pl.UTF-8
130 poldek jest narzędziem linii poleceń służącym do weryfikacji,
131 instalacji (włączając instalację systemu od zera), aktualizacji i
134 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
135 interaktywnym. Tryb interaktywny posiada interfejs readline z
136 dopełnianiem komend i historią, podobny do trybu shell perlowego
139 %{?with_static:Ta wersja jest konsolidowana statycznie.}
141 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
144 Summary: poldek libraries
145 Summary(hu.UTF-8): A poldek könyvtárai
146 Summary(pl.UTF-8): Biblioteki poldka
152 %description libs -l hu.UTF-8
155 %description libs -l pl.UTF-8
159 Summary: Header files for poldek libraries
160 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
161 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
162 Group: Development/Libraries
163 Requires: %{name}-libs = %{version}-%{release}
164 Requires: rpm-devel >= %{ver_rpm}
167 Header files for poldek libraries.
169 %description devel -l hu.UTF-8
170 A poldek könyvtár fejlesztői fájljai.
172 %description devel -l pl.UTF-8
173 Pliki nagłówkowe bibliotek poldka.
176 Summary: poldek static libraries
177 Summary(hu.UTF-8): poldek statikus könyvtárak
178 Summary(pl.UTF-8): Biblioteki statyczne poldka
179 Group: Development/Libraries
180 Requires: %{name}-devel = %{version}-%{release}
183 poldek static libraries.
185 %description static -l hu.UTF-8
186 poldek statikus könyvtárak.
188 %description static -l pl.UTF-8
189 Biblioteki statyczne poldka.
191 %package -n python-poldek
192 Summary: Python modules for poldek
193 Summary(hu.UTF-8): Python modulok poldek-hez
194 Summary(pl.UTF-8): Moduły języka Python dla poldka
195 Group: Libraries/Python
196 Requires: %{name}-libs = %{version}-%{release}
197 %pyrequires_eq python-libs
199 %description -n python-poldek
200 Python modules for poldek.
202 %description -n python-poldek -l hu.UTF-8
203 Python modulok poldek-hez.
205 %description -n python-poldek -l pl.UTF-8
206 Moduły języka Python dla poldka.
220 %{__rm} m4/libtool.m4 m4/lt*.m4
222 # cleanup backups after patching
223 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
224 chmod u+x ./configure ./doc/conf-xml2.sh
246 CPPFLAGS="%{rpmcppflags} -std=gnu99"
248 %{?with_static:--enable-static --disable-shared} \
249 %{!?with_imode:--disable-imode} \
251 %{?with_python:--with-python}
256 rm -rf $RPM_BUILD_ROOT
257 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
259 %{__make} install -j1 \
260 DESTDIR=$RPM_BUILD_ROOT
263 %{__make} -C python -j1 install \
264 DESTDIR=$RPM_BUILD_ROOT \
268 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
270 %ifarch i486 i686 ppc sparc alpha athlon
271 %define _ftp_arch %{_target_cpu}
274 %define _ftp_arch x86_64
275 %define _ftp_alt_arch i686
278 %define _ftp_arch i486
280 %ifarch pentium2 pentium3 pentium4
281 %define _ftp_arch i686
283 %ifarch sparcv9 sparc64
284 %define _ftp_arch sparc
285 %define _ftp_arch %{_target_cpu}
287 %define _ftp_alt_arch sparcv9
291 %define pld_conf %{SOURCE1}
292 %define pld_debuginfo_conf %{SOURCE8}
293 %define pld_archive_conf %{SOURCE11}
296 %define pld_multilib_conf %{SOURCE2}
300 %ifarch sparcv9 sparc64
301 %define pld_conf %{SOURCE9}
302 %undefine pld_archive_conf
305 %define pld_multilib_conf %{SOURCE10}
308 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
310 %if 0%{?pld_multilib_conf:1}
311 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
314 %if 0%{?pld_debuginfo_conf:1}
315 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
318 %if 0%{?pld_archive_conf:1}
319 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
322 # Always install snapshot configs
323 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
324 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
325 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
326 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
328 %{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \
329 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf
333 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
334 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
336 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
337 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
340 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
343 # add desktop file and icon
344 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
345 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
346 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
349 # sources we don't package
350 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
351 # include them in %doc
354 %{__rm} -f configs/Makefile*
358 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
364 rm -rf $RPM_BUILD_ROOT
367 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
368 if [ "$1" = "1" ]; then
369 # remove ignore = vserver-packages inside vserver on first install
372 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
373 done </proc/self/status
375 if [ -z "$ctx" -o "$ctx" = "0" ]; then
380 if [ "$VSERVER" = "yes" ]; then
381 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
385 %postun -p /sbin/postshell
386 -/usr/sbin/fix-info-dir -c %{_infodir}
388 %post libs -p /sbin/ldconfig
389 %postun libs -p /sbin/ldconfig
391 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
392 if [ -f /etc/poldek.conf.rpmsave ]; then
401 if (sub(",noauto", "", name)) {
406 if (match(name, /,pri=[0-9]+/)) {
407 pri = substr(name, RSTART + 5, RLENGTH - 5);
408 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
411 # skip ac sources. already in new config.
412 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
415 print "name = " name;
416 print "type = " type;
417 print "path = " path;
418 print "auto = " auto;
419 print "autoup = " autoup;
425 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
426 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
429 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
431 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
435 %triggerpostun -- poldek < 0.30-0.20080225.00.1
436 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
437 %{__sed} -i -e '/^%%include source.conf/{
439 a# /etc/poldek/repos.d/*.conf
440 a%%includedir repos.d
441 }' %{_sysconfdir}/%{name}/poldek.conf
444 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
445 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
447 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
448 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
449 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
453 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
454 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
455 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
459 %files -f %{name}.lang
460 %defattr(644,root,root,755)
461 %doc ChangeLog README* NEWS TODO configs
462 %dir %{_sysconfdir}/%{name}
463 %dir %{_sysconfdir}/%{name}/repos.d
464 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
465 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
466 %attr(755,root,root) %{_bindir}/ipoldek
467 %attr(755,root,root) %{_bindir}/poldek
468 %attr(755,root,root) %{_bindir}/rpmvercmp
469 %dir %{_libdir}/%{name}
470 %attr(755,root,root) %{_libdir}/%{name}/*
471 %{_mandir}/man1/%{name}*.1*
472 %lang(pl) %{_mandir}/pl/man1/%{name}*
473 %{_infodir}/poldek.info*
475 %{_desktopdir}/%{name}.desktop
476 %{_pixmapsdir}/%{name}.png
478 %dir /var/cache/%{name}
480 %if %{without static}
482 %defattr(644,root,root,755)
483 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
484 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
485 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
486 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
487 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
488 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
489 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
490 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
491 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
492 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
496 %defattr(644,root,root,755)
497 %if %{without static}
498 %attr(755,root,root) %{_libdir}/libpoclidek.so
499 %attr(755,root,root) %{_libdir}/libpoldek.so
500 %attr(755,root,root) %{_libdir}/libtndb.so
501 %attr(755,root,root) %{_libdir}/libtrurl.so
502 %attr(755,root,root) %{_libdir}/libvfile.so
504 %{_libdir}/libpoclidek.la
505 %{_libdir}/libpoldek.la
506 %{_libdir}/libtndb.la
507 %{_libdir}/libtrurl.la
508 %{_libdir}/libvfile.la
509 %{_includedir}/poldek
513 %{_pkgconfigdir}/tndb.pc
516 %defattr(644,root,root,755)
518 %{_libdir}/libtrurl.a
521 %files -n python-poldek
522 %defattr(644,root,root,755)
523 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
524 %{py_sitescriptdir}/poldek.py[co]
525 %{py_sitescriptdir}/poldekmod.py[co]