2 # - fix config having escaped html entities:
3 # # package A requires capability foo >= 1.0 while package B provides "foo"
6 %bcond_with static # don't use shared libraries
7 %bcond_without imode # don't build interactive mode
8 %bcond_without python # don't build python bindings
9 %bcond_with snap # install configs for official Th snapshot
10 %bcond_with db61 # DB 6.1 instead of 5.2
11 %bcond_with rpm4 # use rpm4/db4.7 instead of rpm5
13 # current snapshot name
16 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
17 # NOTE: poldek links with "system db" (-ldb) anyway if it exists
32 %define ver_rpm 4.5-49
34 %define ver_rpm 5.4.10
38 Summary: RPM packages management helper tool
39 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
40 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
43 Release: %{rel}%{?with_snap:.%{SNAP}}
45 Group: Applications/System
46 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
47 Source0: https://launchpad.net/poldek/0.32/%{version}/+download/%{name}-%{version}.tar.xz
48 # Source0-md5: 60b964723880569531f88f084cd3ae65
50 Source2: %{name}-multilib.conf
51 Source3: %{name}-config.sh
52 Source5: %{name}-aliases.conf
53 Source6: %{name}.desktop
55 # Source7-md5: ee487abede50874e9eceb6495d5ee150
56 Source8: %{name}-debuginfo.conf
57 Source9: %{name}-aidath.conf
58 Source10: %{name}-multilib-aidath.conf
59 Source11: %{name}-archive.conf
60 Source100: %{name}-snap.conf
61 Source101: %{name}-multilib-snap.conf
62 Source102: %{name}-debuginfo-snap.conf
63 Patch0: %{name}-size-type.patch
64 Patch1: %{name}-config.patch
65 Patch2: pm-hooks.patch
66 Patch3: WTERMSIG.patch
67 Patch4: %{name}-multiproto.patch
68 Patch5: python-fix.patch
69 Patch6: poldek-ext-down-enable.patch
70 URL: http://poldek.pld-linux.org/
71 BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
72 BuildRequires: autoconf
73 BuildRequires: automake >= 1:1.11
74 BuildRequires: bzip2-devel
75 BuildRequires: check-devel
76 BuildRequires: docbook-dtd412-xml
77 BuildRequires: gettext-tools
78 BuildRequires: libgomp-devel
79 BuildRequires: libtool
80 BuildRequires: libxml2-devel
81 BuildRequires: openssl-devel >= 0.9.7d
82 BuildRequires: pcre-devel
83 BuildRequires: pkgconfig
84 BuildRequires: popt-devel
85 %{?with_python:BuildRequires: python-devel}
86 BuildRequires: readline-devel >= 5.0
87 BuildRequires: rpm-devel >= %{ver_rpm}
88 %{?with_python:BuildRequires: rpm-pythonprov}
89 BuildRequires: tar >= 1:1.22
92 BuildRequires: zlib-devel
94 BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
95 BuildRequires: bzip2-static
96 BuildRequires: glibc-static
97 BuildRequires: libxml2-static
98 BuildRequires: ncurses-static
99 BuildRequires: openssl-static
100 BuildRequires: pcre-static
101 BuildRequires: popt-static
102 BuildRequires: readline-static
103 BuildRequires: rpm-static
104 BuildRequires: zlib-static
106 Requires(triggerpostun): awk
107 Requires(triggerpostun): sed >= 4.0
108 Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
109 Requires: %{name}-libs = %{version}-%{release}
110 Requires: /bin/run-parts
111 Requires: rpm >= %{ver_rpm}
112 Requires: rpm-db-ver = %{ver_db}
113 Requires: rpm-lib >= %{ver_rpm}
115 Conflicts: etckeeper < 1.18-2
116 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
118 %define _libexecdir %{_prefix}/lib/%{name}
121 poldek is an RPM package management tool which allows you to easily
122 perform package verification, installation (including system
123 installation from scratch), upgrading, and removal.
125 Program can be used in batch (like apt-get from Debian's APT) or
126 interactive mode. The interactive mode puts you into a readline
127 interface with command line autocompletion and history, similar to the
128 shell mode of Perl's CPAN.
130 %{?with_static:This version is statically linked.}
132 %{!?with_imode:This version hasn't got interactive mode.}
135 %description -l hu.UTF-8
136 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
137 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
138 nulláról), frissítést és eltávolítást.
140 A program használható parancssorból (mint a Debian apt-get programja)
141 vagy interaktív módban. Az interaktív mód egy readline környezetet
142 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
145 %{?with_static:Ez a verzió statikusan linkelt.}
147 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
149 %description -l pl.UTF-8
150 poldek jest narzędziem linii poleceń służącym do weryfikacji,
151 instalacji (włączając instalację systemu od zera), aktualizacji i
154 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
155 interaktywnym. Tryb interaktywny posiada interfejs readline z
156 dopełnianiem komend i historią, podobny do trybu shell perlowego
159 %{?with_static:Ta wersja jest konsolidowana statycznie.}
161 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
164 Summary: poldek libraries
165 Summary(hu.UTF-8): A poldek könyvtárai
166 Summary(pl.UTF-8): Biblioteki poldka
172 %description libs -l hu.UTF-8
175 %description libs -l pl.UTF-8
179 Summary: Header files for poldek libraries
180 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
181 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
182 Group: Development/Libraries
183 Requires: %{name}-libs = %{version}-%{release}
184 Requires: rpm-devel >= %{ver_rpm}
187 Header files for poldek libraries.
189 %description devel -l hu.UTF-8
190 A poldek könyvtár fejlesztői fájljai.
192 %description devel -l pl.UTF-8
193 Pliki nagłówkowe bibliotek poldka.
196 Summary: poldek static libraries
197 Summary(hu.UTF-8): poldek statikus könyvtárak
198 Summary(pl.UTF-8): Biblioteki statyczne poldka
199 Group: Development/Libraries
200 Requires: %{name}-devel = %{version}-%{release}
203 poldek static libraries.
205 %description static -l hu.UTF-8
206 poldek statikus könyvtárak.
208 %description static -l pl.UTF-8
209 Biblioteki statyczne poldka.
211 %package -n python-poldek
212 Summary: Python modules for poldek
213 Summary(hu.UTF-8): Python modulok poldek-hez
214 Summary(pl.UTF-8): Moduły języka Python dla poldka
215 Group: Libraries/Python
216 Requires: %{name}-libs = %{version}-%{release}
217 Requires: python-libs
219 %description -n python-poldek
220 Python modules for poldek.
222 %description -n python-poldek -l hu.UTF-8
223 Python modulok poldek-hez.
225 %description -n python-poldek -l pl.UTF-8
226 Moduły języka Python dla poldka.
238 %{__rm} m4/libtool.m4 m4/lt*.m4
240 # cleanup backups after patching
241 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
242 chmod u+x ./configure ./doc/conf-xml2.sh
265 CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
267 %{?with_static:--enable-static --disable-shared} \
268 %{!?with_imode:--disable-imode} \
269 --with-pkglibdir=%{_libexecdir} \
271 %{?with_python:--with-python}
280 rm -rf $RPM_BUILD_ROOT
281 install -d $RPM_BUILD_ROOT/var/cache/%{name}
283 %{__make} install -j1 \
284 DESTDIR=$RPM_BUILD_ROOT
286 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
289 %{__make} -C python -j1 install \
290 DESTDIR=$RPM_BUILD_ROOT \
291 py_sitedir=%{py_sitedir}
294 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
296 %ifarch i486 i686 ppc sparc alpha athlon
297 %define ftp_arch %{_target_cpu}
300 %define ftp_arch x86_64
301 %define ftp_alt_arch i686
302 %define ftp_alt2_arch x32
306 %define ftp_alt_arch x86_64
307 %define ftp_alt2_arch i686
310 %define ftp_arch i486
312 %ifarch pentium2 pentium3 pentium4
313 %define ftp_arch i686
315 %ifarch sparcv9 sparc64
316 %define ftp_arch sparc
317 %define ftp_arch %{_target_cpu}
319 %define ftp_alt_arch sparcv9
323 %define pld_conf %{SOURCE1}
324 %define pld_debuginfo_conf %{SOURCE8}
325 %define pld_archive_conf %{SOURCE11}
328 %define pld_multilib_conf %{SOURCE2}
329 %define pld_multilib2_conf %{SOURCE2}
333 %ifarch sparcv9 sparc64
334 %define pld_conf %{SOURCE9}
335 %undefine pld_archive_conf
338 %define pld_multilib_conf %{SOURCE10}
341 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
343 %if 0%{?pld_multilib_conf:1}
344 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf
347 %if 0%{?pld_multilib2_conf:1}
348 %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.conf
351 %if 0%{?pld_debuginfo_conf:1}
352 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
355 %if 0%{?pld_archive_conf:1}
356 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
359 # Always install snapshot configs
360 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \
361 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
362 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \
363 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
365 %{__sed} -e 's|%%ARCH%%|%{ftp_alt_arch}|g' \
366 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf
367 %{__sed} -e 's|%%ARCH%%|%{ftp_alt2_arch}|g' \
368 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt2_arch}.conf
372 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
373 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
375 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
376 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
379 # create "all" meta repo
380 %if 0%{?ftp_alt_arch:1}%{?ftp_alt2_arch:1}
381 cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-all.conf
382 # group source for referring th+th-multiarch sources together, i.e poldek -n th-all
386 sources = th %{?ftp_alt_arch:th-%{ftp_alt_arch}} %{?ftp_alt2_arch:th-%{ftp_alt2_arch}}
390 # th-2014 snap does not exist for x32 yet
391 %if "%{ftp_arch}" == "x32"
392 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
394 %if "%{ftp_alt2_arch}" == "x32"
395 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-x32.conf
398 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
401 # add desktop file and icon
402 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
403 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
404 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
407 # sources we don't package
408 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
409 # include them in %doc
412 %{__rm} -f configs/Makefile*
416 %{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so}
422 rm -rf $RPM_BUILD_ROOT
425 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
426 if [ "$1" = "1" ]; then
427 # remove ignore = vserver-packages inside vserver on first install
430 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
431 done </proc/self/status
433 if [ -z "$ctx" -o "$ctx" = "0" ]; then
438 if [ "$VSERVER" = "yes" ]; then
439 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
443 %postun -p /sbin/postshell
444 -/usr/sbin/fix-info-dir -c %{_infodir}
446 %post libs -p /sbin/ldconfig
447 %postun libs -p /sbin/ldconfig
449 %triggerpostun -- poldek < 0.30-0.20080225.00.1
450 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
451 %{__sed} -i -e '/^%%include source.conf/{
453 a# /etc/poldek/repos.d/*.conf
454 a%%includedir repos.d
455 }' %{_sysconfdir}/%{name}/poldek.conf
458 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
459 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
461 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
462 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
463 %{__mv} -v %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
467 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
468 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
469 %{__mv} -v %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
473 %triggerpostun -- poldek < 0.30.1-3
474 if [ -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave ]; then
475 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf{,.rpmnew}
476 %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf
478 if [ -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave ]; then
479 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf{,.rpmnew}
480 %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf
483 %triggerpostun -- %{name} < 0.30.1-8
484 if [ $1 -le 1 ]; then
485 # revert change on --downgrade
486 %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
489 %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
492 %files -f %{name}.lang
493 %defattr(644,root,root,755)
494 %doc ChangeLog README* NEWS TODO configs
495 %dir %{_sysconfdir}/%{name}
496 %dir %{_sysconfdir}/%{name}/pre-install.d
497 %{_sysconfdir}/%{name}/pre-install.d/README
498 %dir %{_sysconfdir}/%{name}/post-install.d
499 %{_sysconfdir}/%{name}/post-install.d/README
500 %dir %{_sysconfdir}/%{name}/repos.d
501 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
502 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
503 %attr(755,root,root) %{_bindir}/ipoldek
504 %attr(755,root,root) %{_bindir}/poldek
505 %attr(755,root,root) %{_bindir}/poldek-config
506 %attr(755,root,root) %{_bindir}/rpmvercmp
508 %attr(755,root,root) %{_libexecdir}/pm-command.sh
509 %attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh
510 %attr(755,root,root) %{_libexecdir}/vfcompr
511 %attr(755,root,root) %{_libexecdir}/vfjuggle
512 %attr(755,root,root) %{_libexecdir}/vfsmb
513 %attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh
514 %{_mandir}/man1/%{name}*.1*
515 %lang(pl) %{_mandir}/pl/man1/%{name}*
516 %{_infodir}/poldek.info*
518 %{_desktopdir}/%{name}.desktop
519 %{_pixmapsdir}/%{name}.png
521 %dir /var/cache/%{name}
523 %if %{without static}
525 %defattr(644,root,root,755)
526 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
527 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
528 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
529 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
530 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
531 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
532 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
533 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
534 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
535 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
539 %defattr(644,root,root,755)
540 %if %{without static}
541 %attr(755,root,root) %{_libdir}/libpoclidek.so
542 %attr(755,root,root) %{_libdir}/libpoldek.so
543 %attr(755,root,root) %{_libdir}/libtndb.so
544 %attr(755,root,root) %{_libdir}/libtrurl.so
545 %attr(755,root,root) %{_libdir}/libvfile.so
547 %{_libdir}/libpoclidek.la
548 %{_libdir}/libpoldek.la
549 %{_libdir}/libtndb.la
550 %{_libdir}/libtrurl.la
551 %{_libdir}/libvfile.la
552 %{_includedir}/poldek
556 %{_pkgconfigdir}/tndb.pc
557 %{_pkgconfigdir}/trurlib.pc
560 %defattr(644,root,root,755)
562 %{_libdir}/libtrurl.a
565 %files -n python-poldek
566 %defattr(644,root,root,755)
567 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
568 %{py_sitescriptdir}/poldek.py[co]
569 %{py_sitescriptdir}/poldekmod.py[co]