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 Patch7: multiple-options.patch
72 URL: http://poldek.pld-linux.org/
73 BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
74 BuildRequires: autoconf
75 BuildRequires: automake >= 1:1.11
76 BuildRequires: bzip2-devel
77 BuildRequires: check-devel
78 BuildRequires: docbook-dtd412-xml
79 BuildRequires: gettext-tools
80 BuildRequires: libgomp-devel
81 BuildRequires: libtool
82 BuildRequires: libxml2-devel
83 BuildRequires: openssl-devel >= 0.9.7d
84 BuildRequires: pcre-devel
85 BuildRequires: pkgconfig
86 BuildRequires: popt-devel
87 %{?with_python:BuildRequires: python-devel}
88 BuildRequires: readline-devel >= 5.0
89 BuildRequires: rpm-devel >= %{ver_rpm}
90 %{?with_python:BuildRequires: rpm-pythonprov}
91 BuildRequires: tar >= 1:1.22
94 BuildRequires: zlib-devel
96 BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
97 BuildRequires: bzip2-static
98 BuildRequires: glibc-static
99 BuildRequires: libxml2-static
100 BuildRequires: ncurses-static
101 BuildRequires: openssl-static
102 BuildRequires: pcre-static
103 BuildRequires: popt-static
104 BuildRequires: readline-static
105 BuildRequires: rpm-static
106 BuildRequires: zlib-static
108 Requires(triggerpostun): awk
109 Requires(triggerpostun): sed >= 4.0
110 Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
111 Requires: %{name}-libs = %{version}-%{release}
112 Requires: /bin/run-parts
113 Requires: rpm >= %{ver_rpm}
114 Requires: rpm-db-ver = %{ver_db}
115 Requires: rpm-lib >= %{ver_rpm}
117 Conflicts: etckeeper < 1.18-2
118 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
120 %define _libexecdir %{_prefix}/lib/%{name}
123 poldek is an RPM package management tool which allows you to easily
124 perform package verification, installation (including system
125 installation from scratch), upgrading, and removal.
127 Program can be used in batch (like apt-get from Debian's APT) or
128 interactive mode. The interactive mode puts you into a readline
129 interface with command line autocompletion and history, similar to the
130 shell mode of Perl's CPAN.
132 %{?with_static:This version is statically linked.}
134 %{!?with_imode:This version hasn't got interactive mode.}
137 %description -l hu.UTF-8
138 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
139 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
140 nulláról), frissítést és eltávolítást.
142 A program használható parancssorból (mint a Debian apt-get programja)
143 vagy interaktív módban. Az interaktív mód egy readline környezetet
144 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
147 %{?with_static:Ez a verzió statikusan linkelt.}
149 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
151 %description -l pl.UTF-8
152 poldek jest narzędziem linii poleceń służącym do weryfikacji,
153 instalacji (włączając instalację systemu od zera), aktualizacji i
156 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
157 interaktywnym. Tryb interaktywny posiada interfejs readline z
158 dopełnianiem komend i historią, podobny do trybu shell perlowego
161 %{?with_static:Ta wersja jest konsolidowana statycznie.}
163 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
166 Summary: poldek libraries
167 Summary(hu.UTF-8): A poldek könyvtárai
168 Summary(pl.UTF-8): Biblioteki poldka
174 %description libs -l hu.UTF-8
177 %description libs -l pl.UTF-8
181 Summary: Header files for poldek libraries
182 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
183 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
184 Group: Development/Libraries
185 Requires: %{name}-libs = %{version}-%{release}
186 Requires: rpm-devel >= %{ver_rpm}
189 Header files for poldek libraries.
191 %description devel -l hu.UTF-8
192 A poldek könyvtár fejlesztői fájljai.
194 %description devel -l pl.UTF-8
195 Pliki nagłówkowe bibliotek poldka.
198 Summary: poldek static libraries
199 Summary(hu.UTF-8): poldek statikus könyvtárak
200 Summary(pl.UTF-8): Biblioteki statyczne poldka
201 Group: Development/Libraries
202 Requires: %{name}-devel = %{version}-%{release}
205 poldek static libraries.
207 %description static -l hu.UTF-8
208 poldek statikus könyvtárak.
210 %description static -l pl.UTF-8
211 Biblioteki statyczne poldka.
213 %package -n python-poldek
214 Summary: Python modules for poldek
215 Summary(hu.UTF-8): Python modulok poldek-hez
216 Summary(pl.UTF-8): Moduły języka Python dla poldka
217 Group: Libraries/Python
218 Requires: %{name}-libs = %{version}-%{release}
219 Requires: python-libs
221 %description -n python-poldek
222 Python modules for poldek.
224 %description -n python-poldek -l hu.UTF-8
225 Python modulok poldek-hez.
227 %description -n python-poldek -l pl.UTF-8
228 Moduły języka Python dla poldka.
242 %{__rm} m4/libtool.m4 m4/lt*.m4
244 # cleanup backups after patching
245 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
246 chmod u+x ./configure ./doc/conf-xml2.sh
269 CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline -D_GNU_SOURCE=1"
271 %{?with_static:--enable-static --disable-shared} \
272 %{!?with_imode:--disable-imode} \
273 --with-pkglibdir=%{_libexecdir} \
275 %{?with_python:--with-python}
284 rm -rf $RPM_BUILD_ROOT
285 install -d $RPM_BUILD_ROOT/var/cache/%{name}
287 %{__make} install -j1 \
288 DESTDIR=$RPM_BUILD_ROOT
290 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
293 %{__make} -C python -j1 install \
294 DESTDIR=$RPM_BUILD_ROOT \
295 py_sitedir=%{py_sitedir}
298 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
300 %ifarch i486 i686 ppc sparc alpha athlon
301 %define ftp_arch %{_target_cpu}
304 %define ftp_arch x86_64
305 %define ftp_alt_arch i686
306 %define ftp_alt2_arch x32
310 %define ftp_alt_arch x86_64
311 %define ftp_alt2_arch i686
314 %define ftp_arch i486
316 %ifarch pentium2 pentium3 pentium4
317 %define ftp_arch i686
319 %ifarch sparcv9 sparc64
320 %define ftp_arch sparc
321 %define ftp_arch %{_target_cpu}
323 %define ftp_alt_arch sparcv9
327 %define pld_conf %{SOURCE1}
328 %define pld_debuginfo_conf %{SOURCE8}
329 %define pld_archive_conf %{SOURCE11}
332 %define pld_multilib_conf %{SOURCE2}
333 %define pld_multilib2_conf %{SOURCE2}
337 %ifarch sparcv9 sparc64
338 %define pld_conf %{SOURCE9}
339 %undefine pld_archive_conf
342 %define pld_multilib_conf %{SOURCE10}
345 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
347 %if 0%{?pld_multilib_conf:1}
348 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf
351 %if 0%{?pld_multilib2_conf:1}
352 %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.conf
355 %if 0%{?pld_debuginfo_conf:1}
356 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
359 %if 0%{?pld_archive_conf:1}
360 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
363 # Always install snapshot configs
364 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \
365 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
366 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \
367 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
369 %{__sed} -e 's|%%ARCH%%|%{ftp_alt_arch}|g' \
370 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf
371 %{__sed} -e 's|%%ARCH%%|%{ftp_alt2_arch}|g' \
372 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt2_arch}.conf
376 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
377 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
379 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
380 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
383 # create "all" meta repo
384 %if 0%{?ftp_alt_arch:1}%{?ftp_alt2_arch:1}
385 cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-all.conf
386 # group source for referring th+th-multiarch sources together, i.e poldek -n th-all
390 sources = th %{?ftp_alt_arch:th-%{ftp_alt_arch}} %{?ftp_alt2_arch:th-%{ftp_alt2_arch}}
394 # th-2014 snap does not exist for x32 yet
395 %if "%{ftp_arch}" == "x32"
396 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
398 %if "%{ftp_alt2_arch}" == "x32"
399 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-x32.conf
402 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
405 # add desktop file and icon
406 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
407 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
408 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
411 # sources we don't package
412 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
413 # include them in %doc
416 %{__rm} -f configs/Makefile*
420 %{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so}
426 rm -rf $RPM_BUILD_ROOT
429 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
430 if [ "$1" = "1" ]; then
431 # remove ignore = vserver-packages inside vserver on first install
434 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
435 done </proc/self/status
437 if [ -z "$ctx" -o "$ctx" = "0" ]; then
442 if [ "$VSERVER" = "yes" ]; then
443 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
447 %postun -p /sbin/postshell
448 -/usr/sbin/fix-info-dir -c %{_infodir}
450 %post libs -p /sbin/ldconfig
451 %postun libs -p /sbin/ldconfig
453 %triggerpostun -- poldek < 0.30-0.20080225.00.1
454 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
455 %{__sed} -i -e '/^%%include source.conf/{
457 a# /etc/poldek/repos.d/*.conf
458 a%%includedir repos.d
459 }' %{_sysconfdir}/%{name}/poldek.conf
462 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
463 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
465 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
466 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
467 %{__mv} -v %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
471 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
472 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
473 %{__mv} -v %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
477 %triggerpostun -- poldek < 0.30.1-3
478 if [ -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave ]; then
479 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf{,.rpmnew}
480 %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf
482 if [ -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave ]; then
483 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf{,.rpmnew}
484 %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf
487 %triggerpostun -- %{name} < 0.30.1-8
488 if [ $1 -le 1 ]; then
489 # revert change on --downgrade
490 %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
493 %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
496 %files -f %{name}.lang
497 %defattr(644,root,root,755)
498 %doc ChangeLog README* NEWS TODO configs
499 %dir %{_sysconfdir}/%{name}
500 %dir %{_sysconfdir}/%{name}/pre-install.d
501 %{_sysconfdir}/%{name}/pre-install.d/README
502 %dir %{_sysconfdir}/%{name}/post-install.d
503 %{_sysconfdir}/%{name}/post-install.d/README
504 %dir %{_sysconfdir}/%{name}/repos.d
505 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
506 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
507 %attr(755,root,root) %{_bindir}/ipoldek
508 %attr(755,root,root) %{_bindir}/poldek
509 %attr(755,root,root) %{_bindir}/poldek-config
510 %attr(755,root,root) %{_bindir}/rpmvercmp
512 %attr(755,root,root) %{_libexecdir}/pm-command.sh
513 %attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh
514 %attr(755,root,root) %{_libexecdir}/vfcompr
515 %attr(755,root,root) %{_libexecdir}/vfjuggle
516 %attr(755,root,root) %{_libexecdir}/vfsmb
517 %attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh
518 %{_mandir}/man1/%{name}*.1*
519 %lang(pl) %{_mandir}/pl/man1/%{name}*
520 %{_infodir}/poldek.info*
522 %{_desktopdir}/%{name}.desktop
523 %{_pixmapsdir}/%{name}.png
525 %dir /var/cache/%{name}
527 %if %{without static}
529 %defattr(644,root,root,755)
530 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
531 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
532 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
533 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
534 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
535 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
536 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
537 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
538 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
539 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
543 %defattr(644,root,root,755)
544 %if %{without static}
545 %attr(755,root,root) %{_libdir}/libpoclidek.so
546 %attr(755,root,root) %{_libdir}/libpoldek.so
547 %attr(755,root,root) %{_libdir}/libtndb.so
548 %attr(755,root,root) %{_libdir}/libtrurl.so
549 %attr(755,root,root) %{_libdir}/libvfile.so
551 %{_libdir}/libpoclidek.la
552 %{_libdir}/libpoldek.la
553 %{_libdir}/libtndb.la
554 %{_libdir}/libtrurl.la
555 %{_libdir}/libvfile.la
556 %{_includedir}/poldek
560 %{_pkgconfigdir}/tndb.pc
561 %{_pkgconfigdir}/trurlib.pc
564 %defattr(644,root,root,755)
566 %{_libdir}/libtrurl.a
569 %files -n python-poldek
570 %defattr(644,root,root,755)
571 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
572 %{py_sitescriptdir}/poldek.py[co]
573 %{py_sitescriptdir}/poldekmod.py[co]