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 # don't build python bindings
8 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
11 %define ver_rpm 4.5-49
15 Summary: RPM packages management helper tool
16 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
17 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
20 Release: 1.%{snap}.%{rel}
22 Group: Applications/System
23 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
24 Source0: http://carme.pld-linux.org/~cactus/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
25 # Source0-md5: ab89926c28cfb6b7d72497fc37c16ac4
27 Source2: %{name}-multilib.conf
28 Source5: %{name}-aliases.conf
29 Source6: %{name}.desktop
31 Source8: %{name}-debuginfo.conf
32 Source9: %{name}-aidath.conf
33 Source10: %{name}-multilib-aidath.conf
34 Source11: %{name}-archive.conf
35 Patch0: %{name}-vserver-packages.patch
36 Patch1: %{name}-config.patch
37 Patch2: %{name}-size-type.patch
38 Patch3: %{name}-Os-fail-workaround.patch
39 Patch4: %{name}-git.patch
40 Patch5: %{name}-am.patch
41 URL: http://poldek.pld-linux.org/
42 BuildRequires: autoconf
43 BuildRequires: automake
44 BuildRequires: bzip2-devel
45 BuildRequires: check-devel
46 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
47 BuildRequires: docbook-dtd412-xml
48 BuildRequires: gettext-devel
49 BuildRequires: libtool
50 BuildRequires: libxml2-devel
51 BuildRequires: neon-devel
52 BuildRequires: openssl-devel >= 0.9.7d
53 BuildRequires: pcre-devel
54 BuildRequires: pkgconfig
55 BuildRequires: popt-devel
56 %{?with_python:BuildRequires: python-devel}
57 BuildRequires: readline-devel >= 5.0
58 BuildRequires: rpm-devel >= %{ver_rpm}
59 %{?with_python:BuildRequires: rpm-pythonprov}
60 BuildRequires: swig-python
62 BuildRequires: zlib-devel
64 BuildRequires: bzip2-static
65 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
66 BuildRequires: glibc-static
67 BuildRequires: libselinux-static
68 BuildRequires: libxml2-static
69 BuildRequires: ncurses-static
70 BuildRequires: openssl-static
71 BuildRequires: pcre-static
72 BuildRequires: popt-static
73 BuildRequires: readline-static
74 BuildRequires: rpm-static
75 BuildRequires: zlib-static
77 Requires(triggerpostun): awk
78 Requires(triggerpostun): sed >= 4.0
79 Requires: %{name}-libs = %{version}-%{release}
80 Requires: db >= %{ver_db}-%{ver_db_rel}
81 Requires: rpm >= %{ver_rpm}
82 Requires: rpm-db-ver = %{ver_db}
83 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
86 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
89 poldek is an RPM package management tool which allows you to easily
90 perform package verification, installation (including system
91 installation from scratch), upgrading, and removal.
93 Program can be used in batch (like apt-get from Debian's APT) or
94 interactive mode. The interactive mode puts you into a readline
95 interface with command line autocompletion and history, similar to the
96 shell mode of Perl's CPAN.
98 %{?with_static:This version is statically linked.}
100 %{!?with_imode:This version hasn't got interactive mode.}
103 %description -l hu.UTF-8
104 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
105 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
106 nulláról), frissítést és eltávolítást.
108 A program használható parancssorból (mint a Debian apt-get programja)
109 vagy interaktív módban. Az interaktív mód egy readline környezetet
110 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
113 %{?with_static:Ez a verzió statikusan linkelt.}
115 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
117 %description -l pl.UTF-8
118 poldek jest narzędziem linii poleceń służącym do weryfikacji,
119 instalacji (włączając instalację systemu od zera), aktualizacji i
122 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
123 interaktywnym. Tryb interaktywny posiada interfejs readline z
124 dopełnianiem komend i historią, podobny do trybu shell perlowego
127 %{?with_static:Ta wersja jest konsolidowana statycznie.}
129 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
132 Summary: poldek libraries
133 Summary(hu.UTF-8): A poldek könyvtárai
134 Summary(pl.UTF-8): Biblioteki poldka
140 %description libs -l hu.UTF-8
143 %description libs -l pl.UTF-8
147 Summary: Header files for poldek libraries
148 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
149 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
150 Group: Development/Libraries
151 Requires: %{name}-libs = %{version}-%{release}
152 Requires: rpm-devel >= %{ver_rpm}
155 Header files for poldek libraries.
157 %description devel -l hu.UTF-8
158 A poldek könyvtár fejlesztői fájljai.
160 %description devel -l pl.UTF-8
161 Pliki nagłówkowe bibliotek poldka.
164 Summary: poldek static libraries
165 Summary(hu.UTF-8): poldek statikus könyvtárak
166 Summary(pl.UTF-8): Biblioteki statyczne poldka
167 Group: Development/Libraries
168 Requires: %{name}-devel = %{version}-%{release}
171 poldek static libraries.
173 %description static -l hu.UTF-8
174 poldek statikus könyvtárak.
176 %description static -l pl.UTF-8
177 Biblioteki statyczne poldka.
179 %package -n python-poldek
180 Summary: Python modules for poldek
181 Summary(hu.UTF-8): Python modulok poldek-hez
182 Summary(pl.UTF-8): Moduły języka Python dla poldka
183 Group: Libraries/Python
184 Requires: %{name}-libs = %{version}-%{release}
185 %pyrequires_eq python-libs
187 %description -n python-poldek
188 Python modules for poldek.
190 %description -n python-poldek -l hu.UTF-8
191 Python modulok poldek-hez.
193 %description -n python-poldek -l pl.UTF-8
194 Moduły języka Python dla poldka.
205 %{__rm} m4/libtool.m4 m4/lt*.m4
207 # cleanup backups after patching
208 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
209 chmod u+x ./configure ./doc/conf-xml2.sh
231 CPPFLAGS="%{rpmcppflags} -std=gnu99"
233 %{?with_static:--enable-static --disable-shared} \
234 %{!?with_imode:--disable-imode} \
236 %{?with_python:--with-python}
241 rm -rf $RPM_BUILD_ROOT
242 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
244 %{__make} install -j1 \
245 DESTDIR=$RPM_BUILD_ROOT
248 %{__make} -C python -j1 install \
249 DESTDIR=$RPM_BUILD_ROOT \
253 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
255 %ifarch i486 i686 ppc sparc alpha athlon
256 %define _ftp_arch %{_target_cpu}
259 %define _ftp_arch x86_64
260 %define _ftp_alt_arch i686
263 %define _ftp_arch i486
265 %ifarch pentium2 pentium3 pentium4
266 %define _ftp_arch i686
268 %ifarch sparcv9 sparc64
269 %define _ftp_arch sparc
270 %define _ftp_arch %{_target_cpu}
272 %define _ftp_alt_arch sparcv9
276 %define pld_conf %{SOURCE1}
277 %define pld_debuginfo_conf %{SOURCE8}
278 %define pld_archive_conf %{SOURCE11}
281 %define pld_multilib_conf %{SOURCE2}
285 %ifarch sparcv9 sparc64
286 %define pld_conf %{SOURCE9}
287 %undefine pld_archive_conf
290 %define pld_multilib_conf %{SOURCE10}
293 sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
295 %if 0%{?pld_multilib_conf:1}
296 sed 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
299 %if 0%{?pld_debuginfo_conf:1}
300 sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
303 %if 0%{?pld_archive_conf:1}
304 sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
307 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
310 # add desktop file and icon
311 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
312 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
313 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
316 # sources we don't package
317 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
318 # include them in %doc
321 rm -f configs/Makefile*
325 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
331 rm -rf $RPM_BUILD_ROOT
334 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
335 if [ "$1" = "1" ]; then
336 # remove ignore = vserver-packages inside vserver on first install
339 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
340 done </proc/self/status
342 if [ -z "$ctx" -o "$ctx" = "0" ]; then
347 if [ "$VSERVER" = "yes" ]; then
348 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
352 %postun -p /sbin/postshell
353 -/usr/sbin/fix-info-dir -c %{_infodir}
355 %post libs -p /sbin/ldconfig
356 %postun libs -p /sbin/ldconfig
358 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
359 if [ -f /etc/poldek.conf.rpmsave ]; then
368 if (sub(",noauto", "", name)) {
373 if (match(name, /,pri=[0-9]+/)) {
374 pri = substr(name, RSTART + 5, RLENGTH - 5);
375 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
378 # skip ac sources. already in new config.
379 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
382 print "name = " name;
383 print "type = " type;
384 print "path = " path;
385 print "auto = " auto;
386 print "autoup = " autoup;
392 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
393 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
396 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
398 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
402 %triggerpostun -- poldek < 0.30-0.20080225.00.1
403 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
404 %{__sed} -i -e '/^%%include source.conf/{
406 a# /etc/poldek/repos.d/*.conf
407 a%%includedir repos.d
408 }' %{_sysconfdir}/%{name}/poldek.conf
411 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
412 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
414 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
415 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
416 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
420 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
421 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
422 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
426 %files -f %{name}.lang
427 %defattr(644,root,root,755)
428 %doc ChangeLog README* NEWS TODO configs
429 %dir %{_sysconfdir}/%{name}
430 %dir %{_sysconfdir}/%{name}/repos.d
431 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
432 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
433 %attr(755,root,root) %{_bindir}/ipoldek
434 %attr(755,root,root) %{_bindir}/poldek
435 %attr(755,root,root) %{_bindir}/rpmvercmp
436 %dir %{_libdir}/%{name}
437 %attr(755,root,root) %{_libdir}/%{name}/*
438 %{_mandir}/man1/%{name}*.1*
439 %lang(pl) %{_mandir}/pl/man1/%{name}*
440 %{_infodir}/poldek.info*
442 %{_desktopdir}/%{name}.desktop
443 %{_pixmapsdir}/%{name}.png
445 %dir /var/cache/%{name}
447 %if %{without static}
449 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
451 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
452 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
453 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
454 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
455 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
456 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
457 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
458 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
459 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
463 %defattr(644,root,root,755)
464 %if %{without static}
465 %attr(755,root,root) %{_libdir}/libpoclidek.so
466 %attr(755,root,root) %{_libdir}/libpoldek.so
467 %attr(755,root,root) %{_libdir}/libtndb.so
468 %attr(755,root,root) %{_libdir}/libtrurl.so
469 %attr(755,root,root) %{_libdir}/libvfile.so
471 %{_libdir}/libpoclidek.la
472 %{_libdir}/libpoldek.la
473 %{_libdir}/libtndb.la
474 %{_libdir}/libtrurl.la
475 %{_libdir}/libvfile.la
476 %{_includedir}/poldek
480 %{_pkgconfigdir}/tndb.pc
483 %defattr(644,root,root,755)
485 %{_libdir}/libtrurl.a
488 %files -n python-poldek
489 %defattr(644,root,root,755)
490 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
491 %{py_sitescriptdir}/poldek.py[co]
492 %{py_sitescriptdir}/poldekmod.py[co]