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 URL: http://poldek.pld-linux.org/
70 BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
71 BuildRequires: autoconf
72 BuildRequires: automake >= 1:1.11
73 BuildRequires: bzip2-devel
74 BuildRequires: check-devel
75 BuildRequires: docbook-dtd412-xml
76 BuildRequires: gettext-tools
77 BuildRequires: libgomp-devel
78 BuildRequires: libtool
79 BuildRequires: libxml2-devel
80 BuildRequires: openssl-devel >= 0.9.7d
81 BuildRequires: pcre-devel
82 BuildRequires: pkgconfig
83 BuildRequires: popt-devel
84 %{?with_python:BuildRequires: python-devel}
85 BuildRequires: readline-devel >= 5.0
86 BuildRequires: rpm-devel >= %{ver_rpm}
87 %{?with_python:BuildRequires: rpm-pythonprov}
88 BuildRequires: tar >= 1:1.22
91 BuildRequires: zlib-devel
93 BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
94 BuildRequires: bzip2-static
95 BuildRequires: glibc-static
96 BuildRequires: libxml2-static
97 BuildRequires: ncurses-static
98 BuildRequires: openssl-static
99 BuildRequires: pcre-static
100 BuildRequires: popt-static
101 BuildRequires: readline-static
102 BuildRequires: rpm-static
103 BuildRequires: zlib-static
105 Requires(triggerpostun): awk
106 Requires(triggerpostun): sed >= 4.0
107 Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
108 Requires: %{name}-libs = %{version}-%{release}
109 Requires: /bin/run-parts
110 Requires: rpm >= %{ver_rpm}
111 Requires: rpm-db-ver = %{ver_db}
112 Requires: rpm-lib >= %{ver_rpm}
114 Conflicts: etckeeper < 1.18-2
115 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
117 %define _libexecdir %{_prefix}/lib/%{name}
120 poldek is an RPM package management tool which allows you to easily
121 perform package verification, installation (including system
122 installation from scratch), upgrading, and removal.
124 Program can be used in batch (like apt-get from Debian's APT) or
125 interactive mode. The interactive mode puts you into a readline
126 interface with command line autocompletion and history, similar to the
127 shell mode of Perl's CPAN.
129 %{?with_static:This version is statically linked.}
131 %{!?with_imode:This version hasn't got interactive mode.}
134 %description -l hu.UTF-8
135 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
136 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
137 nulláról), frissítést és eltávolítást.
139 A program használható parancssorból (mint a Debian apt-get programja)
140 vagy interaktív módban. Az interaktív mód egy readline környezetet
141 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
144 %{?with_static:Ez a verzió statikusan linkelt.}
146 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
148 %description -l pl.UTF-8
149 poldek jest narzędziem linii poleceń służącym do weryfikacji,
150 instalacji (włączając instalację systemu od zera), aktualizacji i
153 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
154 interaktywnym. Tryb interaktywny posiada interfejs readline z
155 dopełnianiem komend i historią, podobny do trybu shell perlowego
158 %{?with_static:Ta wersja jest konsolidowana statycznie.}
160 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
163 Summary: poldek libraries
164 Summary(hu.UTF-8): A poldek könyvtárai
165 Summary(pl.UTF-8): Biblioteki poldka
171 %description libs -l hu.UTF-8
174 %description libs -l pl.UTF-8
178 Summary: Header files for poldek libraries
179 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
180 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
181 Group: Development/Libraries
182 Requires: %{name}-libs = %{version}-%{release}
183 Requires: rpm-devel >= %{ver_rpm}
186 Header files for poldek libraries.
188 %description devel -l hu.UTF-8
189 A poldek könyvtár fejlesztői fájljai.
191 %description devel -l pl.UTF-8
192 Pliki nagłówkowe bibliotek poldka.
195 Summary: poldek static libraries
196 Summary(hu.UTF-8): poldek statikus könyvtárak
197 Summary(pl.UTF-8): Biblioteki statyczne poldka
198 Group: Development/Libraries
199 Requires: %{name}-devel = %{version}-%{release}
202 poldek static libraries.
204 %description static -l hu.UTF-8
205 poldek statikus könyvtárak.
207 %description static -l pl.UTF-8
208 Biblioteki statyczne poldka.
210 %package -n python-poldek
211 Summary: Python modules for poldek
212 Summary(hu.UTF-8): Python modulok poldek-hez
213 Summary(pl.UTF-8): Moduły języka Python dla poldka
214 Group: Libraries/Python
215 Requires: %{name}-libs = %{version}-%{release}
216 Requires: python-libs
218 %description -n python-poldek
219 Python modules for poldek.
221 %description -n python-poldek -l hu.UTF-8
222 Python modulok poldek-hez.
224 %description -n python-poldek -l pl.UTF-8
225 Moduły języka Python dla poldka.
236 %{__rm} m4/libtool.m4 m4/lt*.m4
238 # cleanup backups after patching
239 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
240 chmod u+x ./configure ./doc/conf-xml2.sh
263 CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
265 %{?with_static:--enable-static --disable-shared} \
266 %{!?with_imode:--disable-imode} \
267 --with-pkglibdir=%{_libexecdir} \
269 %{?with_python:--with-python}
278 rm -rf $RPM_BUILD_ROOT
279 install -d $RPM_BUILD_ROOT/var/cache/%{name}
281 %{__make} install -j1 \
282 DESTDIR=$RPM_BUILD_ROOT
284 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
287 %{__make} -C python -j1 install \
288 DESTDIR=$RPM_BUILD_ROOT \
289 py_sitedir=%{py_sitedir}
292 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
294 %ifarch i486 i686 ppc sparc alpha athlon
295 %define ftp_arch %{_target_cpu}
298 %define ftp_arch x86_64
299 %define ftp_alt_arch i686
300 %define ftp_alt2_arch x32
304 %define ftp_alt_arch x86_64
305 %define ftp_alt2_arch i686
308 %define ftp_arch i486
310 %ifarch pentium2 pentium3 pentium4
311 %define ftp_arch i686
313 %ifarch sparcv9 sparc64
314 %define ftp_arch sparc
315 %define ftp_arch %{_target_cpu}
317 %define ftp_alt_arch sparcv9
321 %define pld_conf %{SOURCE1}
322 %define pld_debuginfo_conf %{SOURCE8}
323 %define pld_archive_conf %{SOURCE11}
326 %define pld_multilib_conf %{SOURCE2}
327 %define pld_multilib2_conf %{SOURCE2}
331 %ifarch sparcv9 sparc64
332 %define pld_conf %{SOURCE9}
333 %undefine pld_archive_conf
336 %define pld_multilib_conf %{SOURCE10}
339 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
341 %if 0%{?pld_multilib_conf:1}
342 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf
345 %if 0%{?pld_multilib2_conf:1}
346 %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.conf
349 %if 0%{?pld_debuginfo_conf:1}
350 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
353 %if 0%{?pld_archive_conf:1}
354 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
357 # Always install snapshot configs
358 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \
359 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
360 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \
361 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
363 %{__sed} -e 's|%%ARCH%%|%{ftp_alt_arch}|g' \
364 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf
365 %{__sed} -e 's|%%ARCH%%|%{ftp_alt2_arch}|g' \
366 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt2_arch}.conf
370 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
371 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
373 %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
374 %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
377 # create "all" meta repo
378 %if 0%{?ftp_alt_arch:1}%{?ftp_alt2_arch:1}
379 cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-all.conf
380 # group source for referring th+th-multiarch sources together, i.e poldek -n th-all
384 sources = th %{?ftp_alt_arch:th-%{ftp_alt_arch}} %{?ftp_alt2_arch:th-%{ftp_alt2_arch}}
388 # th-2014 snap does not exist for x32 yet
389 %if "%{ftp_arch}" == "x32"
390 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
392 %if "%{ftp_alt2_arch}" == "x32"
393 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-x32.conf
396 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
399 # add desktop file and icon
400 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
401 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
402 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
405 # sources we don't package
406 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
407 # include them in %doc
410 %{__rm} -f configs/Makefile*
414 %{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so}
420 rm -rf $RPM_BUILD_ROOT
423 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
424 if [ "$1" = "1" ]; then
425 # remove ignore = vserver-packages inside vserver on first install
428 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
429 done </proc/self/status
431 if [ -z "$ctx" -o "$ctx" = "0" ]; then
436 if [ "$VSERVER" = "yes" ]; then
437 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
441 %postun -p /sbin/postshell
442 -/usr/sbin/fix-info-dir -c %{_infodir}
444 %post libs -p /sbin/ldconfig
445 %postun libs -p /sbin/ldconfig
447 %triggerpostun -- poldek < 0.30-0.20080225.00.1
448 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
449 %{__sed} -i -e '/^%%include source.conf/{
451 a# /etc/poldek/repos.d/*.conf
452 a%%includedir repos.d
453 }' %{_sysconfdir}/%{name}/poldek.conf
456 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
457 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
459 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
460 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
461 %{__mv} -v %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
465 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
466 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
467 %{__mv} -v %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
471 %triggerpostun -- poldek < 0.30.1-3
472 if [ -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave ]; then
473 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf{,.rpmnew}
474 %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf
476 if [ -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave ]; then
477 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf{,.rpmnew}
478 %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf
481 %triggerpostun -- %{name} < 0.30.1-8
482 if [ $1 -le 1 ]; then
483 # revert change on --downgrade
484 %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
487 %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
490 %files -f %{name}.lang
491 %defattr(644,root,root,755)
492 %doc ChangeLog README* NEWS TODO configs
493 %dir %{_sysconfdir}/%{name}
494 %dir %{_sysconfdir}/%{name}/pre-install.d
495 %{_sysconfdir}/%{name}/pre-install.d/README
496 %dir %{_sysconfdir}/%{name}/post-install.d
497 %{_sysconfdir}/%{name}/post-install.d/README
498 %dir %{_sysconfdir}/%{name}/repos.d
499 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
500 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
501 %attr(755,root,root) %{_bindir}/ipoldek
502 %attr(755,root,root) %{_bindir}/poldek
503 %attr(755,root,root) %{_bindir}/poldek-config
504 %attr(755,root,root) %{_bindir}/rpmvercmp
506 %attr(755,root,root) %{_libexecdir}/pm-command.sh
507 %attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh
508 %attr(755,root,root) %{_libexecdir}/vfcompr
509 %attr(755,root,root) %{_libexecdir}/vfjuggle
510 %attr(755,root,root) %{_libexecdir}/vfsmb
511 %attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh
512 %{_mandir}/man1/%{name}*.1*
513 %lang(pl) %{_mandir}/pl/man1/%{name}*
514 %{_infodir}/poldek.info*
516 %{_desktopdir}/%{name}.desktop
517 %{_pixmapsdir}/%{name}.png
519 %dir /var/cache/%{name}
521 %if %{without static}
523 %defattr(644,root,root,755)
524 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
525 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
526 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
527 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
528 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
529 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
530 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
531 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
532 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
533 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
537 %defattr(644,root,root,755)
538 %if %{without static}
539 %attr(755,root,root) %{_libdir}/libpoclidek.so
540 %attr(755,root,root) %{_libdir}/libpoldek.so
541 %attr(755,root,root) %{_libdir}/libtndb.so
542 %attr(755,root,root) %{_libdir}/libtrurl.so
543 %attr(755,root,root) %{_libdir}/libvfile.so
545 %{_libdir}/libpoclidek.la
546 %{_libdir}/libpoldek.la
547 %{_libdir}/libtndb.la
548 %{_libdir}/libtrurl.la
549 %{_libdir}/libvfile.la
550 %{_includedir}/poldek
554 %{_pkgconfigdir}/tndb.pc
555 %{_pkgconfigdir}/trurlib.pc
558 %defattr(644,root,root,755)
560 %{_libdir}/libtrurl.a
563 %files -n python-poldek
564 %defattr(644,root,root,755)
565 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
566 %{py_sitescriptdir}/poldek.py[co]
567 %{py_sitescriptdir}/poldekmod.py[co]