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 URL: http://poldek.pld-linux.org/
55 BuildRequires: autoconf
56 BuildRequires: automake
57 BuildRequires: bzip2-devel
58 BuildRequires: check-devel
59 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
60 BuildRequires: docbook-dtd412-xml
61 BuildRequires: gettext-devel
62 BuildRequires: libtool
63 BuildRequires: libxml2-devel
64 BuildRequires: neon-devel
65 BuildRequires: openssl-devel >= 0.9.7d
66 BuildRequires: pcre-devel
67 BuildRequires: pkgconfig
68 BuildRequires: popt-devel
69 %{?with_python:BuildRequires: python-devel}
70 BuildRequires: readline-devel >= 5.0
71 BuildRequires: rpm-devel >= %{ver_rpm}
72 %{?with_python:BuildRequires: rpm-pythonprov}
73 BuildRequires: swig-python
75 BuildRequires: zlib-devel
77 BuildRequires: bzip2-static
78 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
79 BuildRequires: glibc-static
80 BuildRequires: libselinux-static
81 BuildRequires: libxml2-static
82 BuildRequires: ncurses-static
83 BuildRequires: openssl-static
84 BuildRequires: pcre-static
85 BuildRequires: popt-static
86 BuildRequires: readline-static
87 BuildRequires: rpm-static
88 BuildRequires: zlib-static
90 Requires(triggerpostun): awk
91 Requires(triggerpostun): sed >= 4.0
92 Requires: %{name}-libs = %{version}-%{release}
93 Requires: db >= %{ver_db}-%{ver_db_rel}
94 Requires: rpm >= %{ver_rpm}
95 Requires: rpm-db-ver = %{ver_db}
96 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102 poldek is an RPM package management tool which allows you to easily
103 perform package verification, installation (including system
104 installation from scratch), upgrading, and removal.
106 Program can be used in batch (like apt-get from Debian's APT) or
107 interactive mode. The interactive mode puts you into a readline
108 interface with command line autocompletion and history, similar to the
109 shell mode of Perl's CPAN.
111 %{?with_static:This version is statically linked.}
113 %{!?with_imode:This version hasn't got interactive mode.}
116 %description -l hu.UTF-8
117 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
118 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
119 nulláról), frissítést és eltávolítást.
121 A program használható parancssorból (mint a Debian apt-get programja)
122 vagy interaktív módban. Az interaktív mód egy readline környezetet
123 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
126 %{?with_static:Ez a verzió statikusan linkelt.}
128 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
130 %description -l pl.UTF-8
131 poldek jest narzędziem linii poleceń służącym do weryfikacji,
132 instalacji (włączając instalację systemu od zera), aktualizacji i
135 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
136 interaktywnym. Tryb interaktywny posiada interfejs readline z
137 dopełnianiem komend i historią, podobny do trybu shell perlowego
140 %{?with_static:Ta wersja jest konsolidowana statycznie.}
142 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
145 Summary: poldek libraries
146 Summary(hu.UTF-8): A poldek könyvtárai
147 Summary(pl.UTF-8): Biblioteki poldka
153 %description libs -l hu.UTF-8
156 %description libs -l pl.UTF-8
160 Summary: Header files for poldek libraries
161 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
162 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
163 Group: Development/Libraries
164 Requires: %{name}-libs = %{version}-%{release}
165 Requires: rpm-devel >= %{ver_rpm}
168 Header files for poldek libraries.
170 %description devel -l hu.UTF-8
171 A poldek könyvtár fejlesztői fájljai.
173 %description devel -l pl.UTF-8
174 Pliki nagłówkowe bibliotek poldka.
177 Summary: poldek static libraries
178 Summary(hu.UTF-8): poldek statikus könyvtárak
179 Summary(pl.UTF-8): Biblioteki statyczne poldka
180 Group: Development/Libraries
181 Requires: %{name}-devel = %{version}-%{release}
184 poldek static libraries.
186 %description static -l hu.UTF-8
187 poldek statikus könyvtárak.
189 %description static -l pl.UTF-8
190 Biblioteki statyczne poldka.
192 %package -n python-poldek
193 Summary: Python modules for poldek
194 Summary(hu.UTF-8): Python modulok poldek-hez
195 Summary(pl.UTF-8): Moduły języka Python dla poldka
196 Group: Libraries/Python
197 Requires: %{name}-libs = %{version}-%{release}
198 %pyrequires_eq python-libs
200 %description -n python-poldek
201 Python modules for poldek.
203 %description -n python-poldek -l hu.UTF-8
204 Python modulok poldek-hez.
206 %description -n python-poldek -l pl.UTF-8
207 Moduły języka Python dla poldka.
222 %{__rm} m4/libtool.m4 m4/lt*.m4
224 # cleanup backups after patching
225 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
226 chmod u+x ./configure ./doc/conf-xml2.sh
248 CPPFLAGS="%{rpmcppflags} -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,/var/cache/%{name}}
261 %{__make} install -j1 \
262 DESTDIR=$RPM_BUILD_ROOT
265 %{__make} -C python -j1 install \
266 DESTDIR=$RPM_BUILD_ROOT \
270 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
272 %ifarch i486 i686 ppc sparc alpha athlon
273 %define _ftp_arch %{_target_cpu}
276 %define _ftp_arch x86_64
277 %define _ftp_alt_arch i686
280 %define _ftp_arch i486
282 %ifarch pentium2 pentium3 pentium4
283 %define _ftp_arch i686
285 %ifarch sparcv9 sparc64
286 %define _ftp_arch sparc
287 %define _ftp_arch %{_target_cpu}
289 %define _ftp_alt_arch sparcv9
293 %define pld_conf %{SOURCE1}
294 %define pld_debuginfo_conf %{SOURCE8}
295 %define pld_archive_conf %{SOURCE11}
298 %define pld_multilib_conf %{SOURCE2}
302 %ifarch sparcv9 sparc64
303 %define pld_conf %{SOURCE9}
304 %undefine pld_archive_conf
307 %define pld_multilib_conf %{SOURCE10}
310 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
312 %if 0%{?pld_multilib_conf:1}
313 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
316 %if 0%{?pld_debuginfo_conf:1}
317 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
320 %if 0%{?pld_archive_conf:1}
321 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
324 # Always install snapshot configs
325 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
326 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
327 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
328 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
330 %{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \
331 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf
335 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
336 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
338 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
339 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
342 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
345 # add desktop file and icon
346 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
347 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
348 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
351 # sources we don't package
352 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
353 # include them in %doc
356 %{__rm} -f configs/Makefile*
360 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
366 rm -rf $RPM_BUILD_ROOT
369 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
370 if [ "$1" = "1" ]; then
371 # remove ignore = vserver-packages inside vserver on first install
374 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
375 done </proc/self/status
377 if [ -z "$ctx" -o "$ctx" = "0" ]; then
382 if [ "$VSERVER" = "yes" ]; then
383 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
387 %postun -p /sbin/postshell
388 -/usr/sbin/fix-info-dir -c %{_infodir}
390 %post libs -p /sbin/ldconfig
391 %postun libs -p /sbin/ldconfig
393 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
394 if [ -f /etc/poldek.conf.rpmsave ]; then
403 if (sub(",noauto", "", name)) {
408 if (match(name, /,pri=[0-9]+/)) {
409 pri = substr(name, RSTART + 5, RLENGTH - 5);
410 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
413 # skip ac sources. already in new config.
414 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
417 print "name = " name;
418 print "type = " type;
419 print "path = " path;
420 print "auto = " auto;
421 print "autoup = " autoup;
427 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
428 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
431 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
433 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
437 %triggerpostun -- poldek < 0.30-0.20080225.00.1
438 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
439 %{__sed} -i -e '/^%%include source.conf/{
441 a# /etc/poldek/repos.d/*.conf
442 a%%includedir repos.d
443 }' %{_sysconfdir}/%{name}/poldek.conf
446 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
447 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
449 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
450 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
451 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
455 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
456 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
457 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
461 %files -f %{name}.lang
462 %defattr(644,root,root,755)
463 %doc ChangeLog README* NEWS TODO configs
464 %dir %{_sysconfdir}/%{name}
465 %dir %{_sysconfdir}/%{name}/repos.d
466 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
467 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
468 %attr(755,root,root) %{_bindir}/ipoldek
469 %attr(755,root,root) %{_bindir}/poldek
470 %attr(755,root,root) %{_bindir}/rpmvercmp
471 %dir %{_libdir}/%{name}
472 %attr(755,root,root) %{_libdir}/%{name}/*
473 %{_mandir}/man1/%{name}*.1*
474 %lang(pl) %{_mandir}/pl/man1/%{name}*
475 %{_infodir}/poldek.info*
477 %{_desktopdir}/%{name}.desktop
478 %{_pixmapsdir}/%{name}.png
480 %dir /var/cache/%{name}
482 %if %{without static}
484 %defattr(644,root,root,755)
485 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
486 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
487 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
488 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
489 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
490 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
491 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
492 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
493 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
494 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
498 %defattr(644,root,root,755)
499 %if %{without static}
500 %attr(755,root,root) %{_libdir}/libpoclidek.so
501 %attr(755,root,root) %{_libdir}/libpoldek.so
502 %attr(755,root,root) %{_libdir}/libtndb.so
503 %attr(755,root,root) %{_libdir}/libtrurl.so
504 %attr(755,root,root) %{_libdir}/libvfile.so
506 %{_libdir}/libpoclidek.la
507 %{_libdir}/libpoldek.la
508 %{_libdir}/libtndb.la
509 %{_libdir}/libtrurl.la
510 %{_libdir}/libvfile.la
511 %{_includedir}/poldek
515 %{_pkgconfigdir}/tndb.pc
518 %defattr(644,root,root,755)
520 %{_libdir}/libtrurl.a
523 %files -n python-poldek
524 %defattr(644,root,root,755)
525 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
526 %{py_sitescriptdir}/poldek.py[co]
527 %{py_sitescriptdir}/poldekmod.py[co]