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
7 %bcond_with db60 # DB 6.0 instead of 5.2
9 # current snapshot name
12 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
13 # NOTE: poldek links with "system db" (-ldb) anyway if it exists
23 %define ver_rpm 5.4.10
26 Summary: RPM packages management helper tool
27 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
28 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
31 Release: %{rel}%{?with_snap:.%{SNAP}}
33 Group: Applications/System
34 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
35 Source0: http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz
36 # Source0-md5: 392cfa125912fbedb6cc6d54dfbb80e3
38 Source2: %{name}-multilib.conf
39 Source5: %{name}-aliases.conf
40 Source6: %{name}.desktop
42 Source8: %{name}-debuginfo.conf
43 Source9: %{name}-aidath.conf
44 Source10: %{name}-multilib-aidath.conf
45 Source11: %{name}-archive.conf
46 Source100: %{name}-snap.conf
47 Source101: %{name}-multilib-snap.conf
48 Source102: %{name}-debuginfo-snap.conf
49 Patch0: %{name}-size-type.patch
50 Patch1: %{name}-Os-fail-workaround.patch
51 Patch2: %{name}-config.patch
52 URL: http://poldek.pld-linux.org/
53 BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
54 BuildRequires: autoconf
55 BuildRequires: automake
56 BuildRequires: bzip2-devel
57 BuildRequires: check-devel
58 BuildRequires: docbook-dtd412-xml
59 BuildRequires: gettext-devel
60 BuildRequires: libtool
61 BuildRequires: libxml2-devel
62 BuildRequires: neon-devel
63 BuildRequires: openssl-devel >= 0.9.7d
64 BuildRequires: pcre-devel
65 BuildRequires: pkgconfig
66 BuildRequires: popt-devel
67 %{?with_python:BuildRequires: python-devel}
68 BuildRequires: readline-devel >= 5.0
69 BuildRequires: rpm-devel >= %{ver_rpm}
70 %{?with_python:BuildRequires: rpm-pythonprov}
71 BuildRequires: swig-python
72 BuildRequires: tar >= 1:1.22
75 BuildRequires: zlib-devel
77 BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
78 BuildRequires: bzip2-static
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: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
93 Requires: %{name}-libs = %{version}-%{release}
94 Requires: rpm >= %{ver_rpm}
95 Requires: rpm-db-ver = %{ver_db}
96 #Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
97 Requires: rpm-lib >= 5.4.10
100 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102 %define _libexecdir %{_prefix}/lib/%{name}
105 poldek is an RPM package management tool which allows you to easily
106 perform package verification, installation (including system
107 installation from scratch), upgrading, and removal.
109 Program can be used in batch (like apt-get from Debian's APT) or
110 interactive mode. The interactive mode puts you into a readline
111 interface with command line autocompletion and history, similar to the
112 shell mode of Perl's CPAN.
114 %{?with_static:This version is statically linked.}
116 %{!?with_imode:This version hasn't got interactive mode.}
119 %description -l hu.UTF-8
120 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
121 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
122 nulláról), frissítést és eltávolítást.
124 A program használható parancssorból (mint a Debian apt-get programja)
125 vagy interaktív módban. Az interaktív mód egy readline környezetet
126 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
129 %{?with_static:Ez a verzió statikusan linkelt.}
131 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
133 %description -l pl.UTF-8
134 poldek jest narzędziem linii poleceń służącym do weryfikacji,
135 instalacji (włączając instalację systemu od zera), aktualizacji i
138 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
139 interaktywnym. Tryb interaktywny posiada interfejs readline z
140 dopełnianiem komend i historią, podobny do trybu shell perlowego
143 %{?with_static:Ta wersja jest konsolidowana statycznie.}
145 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
148 Summary: poldek libraries
149 Summary(hu.UTF-8): A poldek könyvtárai
150 Summary(pl.UTF-8): Biblioteki poldka
156 %description libs -l hu.UTF-8
159 %description libs -l pl.UTF-8
163 Summary: Header files for poldek libraries
164 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
165 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
166 Group: Development/Libraries
167 Requires: %{name}-libs = %{version}-%{release}
168 Requires: rpm-devel >= %{ver_rpm}
171 Header files for poldek libraries.
173 %description devel -l hu.UTF-8
174 A poldek könyvtár fejlesztői fájljai.
176 %description devel -l pl.UTF-8
177 Pliki nagłówkowe bibliotek poldka.
180 Summary: poldek static libraries
181 Summary(hu.UTF-8): poldek statikus könyvtárak
182 Summary(pl.UTF-8): Biblioteki statyczne poldka
183 Group: Development/Libraries
184 Requires: %{name}-devel = %{version}-%{release}
187 poldek static libraries.
189 %description static -l hu.UTF-8
190 poldek statikus könyvtárak.
192 %description static -l pl.UTF-8
193 Biblioteki statyczne poldka.
195 %package -n python-poldek
196 Summary: Python modules for poldek
197 Summary(hu.UTF-8): Python modulok poldek-hez
198 Summary(pl.UTF-8): Moduły języka Python dla poldka
199 Group: Libraries/Python
200 Requires: %{name}-libs = %{version}-%{release}
201 Requires: python-libs
203 %description -n python-poldek
204 Python modules for poldek.
206 %description -n python-poldek -l hu.UTF-8
207 Python modulok poldek-hez.
209 %description -n python-poldek -l pl.UTF-8
210 Moduły języka Python dla poldka.
218 %{__rm} m4/libtool.m4 m4/lt*.m4
220 # cleanup backups after patching
221 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
222 chmod u+x ./configure ./doc/conf-xml2.sh
244 CPPFLAGS="%{rpmcppflags} -std=gnu99"
246 %{?with_static:--enable-static --disable-shared} \
247 %{!?with_imode:--disable-imode} \
248 --with-pkglibdir=%{_libexecdir} \
250 %{?with_python:--with-python}
255 rm -rf $RPM_BUILD_ROOT
256 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
258 %{__make} install -j1 \
259 DESTDIR=$RPM_BUILD_ROOT
262 %{__make} -C python -j1 install \
263 DESTDIR=$RPM_BUILD_ROOT \
267 %{?with_static:%{__rm} $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 %define _ftp_arch i486
279 %ifarch pentium2 pentium3 pentium4
280 %define _ftp_arch i686
282 %ifarch sparcv9 sparc64
283 %define _ftp_arch sparc
284 %define _ftp_arch %{_target_cpu}
286 %define _ftp_alt_arch sparcv9
290 %define pld_conf %{SOURCE1}
291 %define pld_debuginfo_conf %{SOURCE8}
292 %define pld_archive_conf %{SOURCE11}
295 %define pld_multilib_conf %{SOURCE2}
299 %ifarch sparcv9 sparc64
300 %define pld_conf %{SOURCE9}
301 %undefine pld_archive_conf
304 %define pld_multilib_conf %{SOURCE10}
307 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
309 %if 0%{?pld_multilib_conf:1}
310 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
313 %if 0%{?pld_debuginfo_conf:1}
314 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
317 %if 0%{?pld_archive_conf:1}
318 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
321 # Always install snapshot configs
322 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
323 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
324 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
325 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
327 %{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \
328 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf
332 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
333 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
335 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
336 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
339 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
342 # add desktop file and icon
343 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
344 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
345 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
348 # sources we don't package
349 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
350 # include them in %doc
353 %{__rm} -f configs/Makefile*
357 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
363 rm -rf $RPM_BUILD_ROOT
366 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
367 if [ "$1" = "1" ]; then
368 # remove ignore = vserver-packages inside vserver on first install
371 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
372 done </proc/self/status
374 if [ -z "$ctx" -o "$ctx" = "0" ]; then
379 if [ "$VSERVER" = "yes" ]; then
380 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
384 %postun -p /sbin/postshell
385 -/usr/sbin/fix-info-dir -c %{_infodir}
387 %post libs -p /sbin/ldconfig
388 %postun libs -p /sbin/ldconfig
390 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
391 if [ -f /etc/poldek.conf.rpmsave ]; then
400 if (sub(",noauto", "", name)) {
405 if (match(name, /,pri=[0-9]+/)) {
406 pri = substr(name, RSTART + 5, RLENGTH - 5);
407 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
410 # skip ac sources. already in new config.
411 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
414 print "name = " name;
415 print "type = " type;
416 print "path = " path;
417 print "auto = " auto;
418 print "autoup = " autoup;
424 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
425 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
428 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
430 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
434 %triggerpostun -- poldek < 0.30-0.20080225.00.1
435 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
436 %{__sed} -i -e '/^%%include source.conf/{
438 a# /etc/poldek/repos.d/*.conf
439 a%%includedir repos.d
440 }' %{_sysconfdir}/%{name}/poldek.conf
443 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
444 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
446 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
447 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
448 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
452 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
453 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
454 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
458 %files -f %{name}.lang
459 %defattr(644,root,root,755)
460 %doc ChangeLog README* NEWS TODO configs
461 %dir %{_sysconfdir}/%{name}
462 %dir %{_sysconfdir}/%{name}/repos.d
463 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
464 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
465 %attr(755,root,root) %{_bindir}/ipoldek
466 %attr(755,root,root) %{_bindir}/poldek
467 %attr(755,root,root) %{_bindir}/rpmvercmp
469 %attr(755,root,root) %{_libexecdir}/*
470 %{_mandir}/man1/%{name}*.1*
471 %lang(pl) %{_mandir}/pl/man1/%{name}*
472 %{_infodir}/poldek.info*
474 %{_desktopdir}/%{name}.desktop
475 %{_pixmapsdir}/%{name}.png
477 %dir /var/cache/%{name}
479 %if %{without static}
481 %defattr(644,root,root,755)
482 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
483 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
484 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
485 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
486 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
487 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
488 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
489 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
490 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
491 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
495 %defattr(644,root,root,755)
496 %if %{without static}
497 %attr(755,root,root) %{_libdir}/libpoclidek.so
498 %attr(755,root,root) %{_libdir}/libpoldek.so
499 %attr(755,root,root) %{_libdir}/libtndb.so
500 %attr(755,root,root) %{_libdir}/libtrurl.so
501 %attr(755,root,root) %{_libdir}/libvfile.so
503 %{_libdir}/libpoclidek.la
504 %{_libdir}/libpoldek.la
505 %{_libdir}/libtndb.la
506 %{_libdir}/libtrurl.la
507 %{_libdir}/libvfile.la
508 %{_includedir}/poldek
512 %{_pkgconfigdir}/tndb.pc
513 %{_pkgconfigdir}/trurlib.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]