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_with python # don't build python bindings
9 %bcond_with tests # tests
11 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
14 %define ver_rpm 1:4.14
15 %define ver_db_devel %(rpm -q --qf '%|E?{%{E}:}|%{V}-%{R}' --what-provides db-devel)
17 Summary: RPM packages management helper tool
18 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
19 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
24 Group: Applications/System
25 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
26 Source0: https://github.com/poldek-pm/poldek/releases/download/v%{version}/%{name}-%{version}.tar.xz
27 # Source0-md5: 2759fe45bc50efb6084d5338d725411a
29 Source2: %{name}-multilib.conf
30 Source3: %{name}-config.sh
31 Source5: %{name}-aliases.conf
32 Source6: %{name}.desktop
34 # Source7-md5: ee487abede50874e9eceb6495d5ee150
35 Patch0: %{name}-config.patch
36 Patch1: pm-hooks.patch
37 Patch2: %{name}-ext-down-enable.patch
38 Patch3: %{name}-pc.patch
39 Patch4: %{name}-info.patch
40 Patch5: %{name}-multiarch-x32.patch
41 Patch6: rpm-4.15.patch
42 Patch7: db-index-format.patch
43 Patch8: rpm4-uname-deps.patch
44 Patch9: sqlite-rpmdb.patch
45 Patch10: rpm4-cpuinfo-deps.patch
46 Patch11: rpm4-no-dir-deps.patch
47 Patch12: rpm4-rpmvercmp.patch
48 Patch13: trurlib-shared.patch
49 URL: http://poldek.pld-linux.org/
50 BuildRequires: %{db_pkg}-devel >= %{ver_db}
51 BuildRequires: autoconf >= 2.63
52 BuildRequires: automake >= 1:1.11
53 BuildRequires: bzip2-devel
54 BuildRequires: check-devel
55 BuildRequires: docbook-dtd412-xml
56 BuildRequires: docbook2X
57 BuildRequires: gettext-tools >= 0.11.5
58 BuildRequires: libgomp-devel
59 BuildRequires: libtool
60 BuildRequires: libxml2-devel >= 2
61 BuildRequires: ncurses-devel
62 BuildRequires: openssl-devel >= 0.9.7d
63 BuildRequires: pcre-devel
64 BuildRequires: perl-XML-Simple
65 BuildRequires: perl-base
66 BuildRequires: perl-modules
67 BuildRequires: pkgconfig
68 BuildRequires: popt-devel
69 %{?with_python:BuildRequires: python-devel}
70 BuildRequires: readline-devel >= 5.0
71 BuildRequires: rpm-devel >= %{ver_rpm}
72 %{?with_python:BuildRequires: rpm-pythonprov}
73 BuildRequires: tar >= 1:1.22
74 BuildRequires: texinfo
77 BuildRequires: zlib-devel
78 BuildRequires: zstd-devel
80 BuildRequires: %{db_pkg}-static >= %{ver_db}
81 BuildRequires: bzip2-static
82 BuildRequires: glibc-static
83 BuildRequires: libxml2-static
84 BuildRequires: ncurses-static
85 BuildRequires: openssl-static
86 BuildRequires: pcre-static
87 BuildRequires: popt-static
88 BuildRequires: readline-static
89 BuildRequires: rpm-static
90 BuildRequires: zlib-static
91 BuildRequires: zstd-static
94 Requires(postun): sed >= 4.0
95 Requires: %{db_pkg} >= %{ver_db_devel}
96 Requires: %{name}-libs = %{version}-%{release}
97 Requires: /bin/run-parts
98 Requires: rpm >= %{ver_rpm}
99 Requires: rpm-lib >= %{ver_rpm}
101 Conflicts: etckeeper < 1.18-2
102 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104 # it could be %{_libexecdir}/%{name}, but beware of compatibility (path hardcoded in configurations)
105 %define pkglibexecdir %{_prefix}/lib/%{name}
108 poldek is an RPM package management tool which allows you to easily
109 perform package verification, installation (including system
110 installation from scratch), upgrading, and removal.
112 Program can be used in batch (like apt-get from Debian's APT) or
113 interactive mode. The interactive mode puts you into a readline
114 interface with command line autocompletion and history, similar to the
115 shell mode of Perl's CPAN.
117 %{?with_static:This version is statically linked.}
119 %{!?with_imode:This version hasn't got interactive mode.}
122 %description -l hu.UTF-8
123 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
124 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
125 nulláról), frissítést és eltávolítást.
127 A program használható parancssorból (mint a Debian apt-get programja)
128 vagy interaktív módban. Az interaktív mód egy readline környezetet
129 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
132 %{?with_static:Ez a verzió statikusan linkelt.}
134 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
136 %description -l pl.UTF-8
137 poldek jest narzędziem linii poleceń służącym do weryfikacji,
138 instalacji (włączając instalację systemu od zera), aktualizacji i
141 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
142 interaktywnym. Tryb interaktywny posiada interfejs readline z
143 dopełnianiem komend i historią, podobny do trybu shell perlowego
146 %{?with_static:Ta wersja jest konsolidowana statycznie.}
148 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
151 Summary: poldek libraries
152 Summary(hu.UTF-8): A poldek könyvtárai
153 Summary(pl.UTF-8): Biblioteki poldka
159 %description libs -l hu.UTF-8
162 %description libs -l pl.UTF-8
166 Summary: Header files for poldek libraries
167 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
168 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
169 Group: Development/Libraries
170 Requires: %{name}-libs = %{version}-%{release}
171 Requires: rpm-devel >= %{ver_rpm}
174 Header files for poldek libraries.
176 %description devel -l hu.UTF-8
177 A poldek könyvtár fejlesztői fájljai.
179 %description devel -l pl.UTF-8
180 Pliki nagłówkowe bibliotek poldka.
183 Summary: poldek static libraries
184 Summary(hu.UTF-8): poldek statikus könyvtárak
185 Summary(pl.UTF-8): Biblioteki statyczne poldka
186 Group: Development/Libraries
187 Requires: %{name}-devel = %{version}-%{release}
190 poldek static libraries.
192 %description static -l hu.UTF-8
193 poldek statikus könyvtárak.
195 %description static -l pl.UTF-8
196 Biblioteki statyczne poldka.
198 %package -n python-poldek
199 Summary: Python modules for poldek
200 Summary(hu.UTF-8): Python modulok poldek-hez
201 Summary(pl.UTF-8): Moduły języka Python dla poldka
202 Group: Libraries/Python
203 Requires: %{name}-libs = %{version}-%{release}
204 Requires: python-libs
206 %description -n python-poldek
207 Python modules for poldek.
209 %description -n python-poldek -l hu.UTF-8
210 Python modulok poldek-hez.
212 %description -n python-poldek -l pl.UTF-8
213 Moduły języka Python dla poldka.
234 %{__rm} doc/poldek.info
235 %{__rm} m4/libtool.m4 m4/lt*.m4
237 # cleanup backups after patching
238 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
239 chmod u+x ./configure ./doc/conf-xml2.sh
263 %{?with_static:--enable-static --disable-shared} \
264 %{!?with_imode:--disable-imode} \
265 --with-pkglibdir=%{pkglibexecdir} \
267 %{?with_python:--with-python}
270 %{__make} -C doc poldek.info
281 rm -rf $RPM_BUILD_ROOT
282 install -d $RPM_BUILD_ROOT/var/cache/%{name}
285 DESTDIR=$RPM_BUILD_ROOT
287 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
290 %{__make} -C python install \
291 DESTDIR=$RPM_BUILD_ROOT \
292 py_sitedir=%{py_sitedir}
295 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
298 %define ftp_arch %{_target_cpu}
301 %define ftp_arch x86_64
302 %define ftp_alt_arch i686
305 %define tld_conf %{SOURCE1}
308 %define tld_multilib_conf %{SOURCE2}
311 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
313 %if 0%{?tld_multilib_conf:1}
314 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
317 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
320 # add desktop file and icon
321 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
322 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
323 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
326 # sources we don't package
327 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
328 # include them in %doc
331 %{__rm} -f configs/Makefile*
335 %{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so}
342 rm -rf $RPM_BUILD_ROOT
345 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
346 if [ "$1" = "1" ]; then
347 # remove ignore = vserver-packages inside vserver on first install
350 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
351 done </proc/self/status
353 if [ -z "$ctx" -o "$ctx" = "0" ]; then
358 if [ "$VSERVER" = "yes" ]; then
359 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
363 %postun -p /sbin/postshell
364 -/usr/sbin/fix-info-dir -c %{_infodir}
366 %post libs -p /sbin/ldconfig
367 %postun libs -p /sbin/ldconfig
369 %triggerpostun -- poldek < 0.30-0.20080225.00.1
370 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
371 %{__sed} -i -e '/^%%include source.conf/{
373 a# /etc/poldek/repos.d/*.conf
374 a%%includedir repos.d
375 }' %{_sysconfdir}/%{name}/poldek.conf
378 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
379 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
381 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
382 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
383 %{__mv} -v %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
387 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
388 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
389 %{__mv} -v %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
393 %triggerpostun -- %{name} < 0.30.1-8
394 if [ $1 -le 1 ]; then
395 # revert change on --downgrade
396 %{__sed} -i -re 's,^pm command = %{pkglibexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
399 %{__sed} -i -re 's,#?(pm command =).*,\1 %{pkglibexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
402 %files -f %{name}.lang
403 %defattr(644,root,root,755)
404 %doc ChangeLog README* NEWS configs
405 %dir %{_sysconfdir}/%{name}
406 %dir %{_sysconfdir}/%{name}/pre-install.d
407 %{_sysconfdir}/%{name}/pre-install.d/README
408 %dir %{_sysconfdir}/%{name}/post-install.d
409 %{_sysconfdir}/%{name}/post-install.d/README
410 %dir %{_sysconfdir}/%{name}/repos.d
411 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/cli.conf
412 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fetch.conf
413 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/poldek.conf
414 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/source.conf
415 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld.conf
416 %if 0%{?tld_multilib_conf:1}
417 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
419 %attr(755,root,root) %{_bindir}/ipoldek
420 %attr(755,root,root) %{_bindir}/poldek
421 %attr(755,root,root) %{_bindir}/poldek-config
422 %attr(755,root,root) %{_bindir}/rpmvercmp
423 %dir %{pkglibexecdir}
424 %attr(755,root,root) %{pkglibexecdir}/pm-command.sh
425 %attr(755,root,root) %{pkglibexecdir}/poldekuser-setup.sh
426 %attr(755,root,root) %{pkglibexecdir}/vfcompr
427 %attr(755,root,root) %{pkglibexecdir}/vfjuggle
428 %attr(755,root,root) %{pkglibexecdir}/vfsmb
429 %attr(755,root,root) %{pkglibexecdir}/zlib-in-rpm.sh
430 %{_mandir}/man1/%{name}*.1*
431 %lang(pl) %{_mandir}/pl/man1/%{name}*
432 %{_infodir}/poldek.info*
434 %{_desktopdir}/%{name}.desktop
435 %{_pixmapsdir}/%{name}.png
437 %dir /var/cache/%{name}
439 %if %{without static}
441 %defattr(644,root,root,755)
442 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
443 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
444 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
445 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
446 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
447 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.1
448 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.3
449 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
450 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
451 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
455 %defattr(644,root,root,755)
456 %if %{without static}
457 %attr(755,root,root) %{_libdir}/libpoclidek.so
458 %attr(755,root,root) %{_libdir}/libpoldek.so
459 %attr(755,root,root) %{_libdir}/libtndb.so
460 %attr(755,root,root) %{_libdir}/libtrurl.so
461 %attr(755,root,root) %{_libdir}/libvfile.so
463 %{_libdir}/libpoclidek.la
464 %{_libdir}/libpoldek.la
465 %{_libdir}/libtndb.la
466 %{_libdir}/libtrurl.la
467 %{_libdir}/libvfile.la
468 %{_includedir}/poldek
472 %{_pkgconfigdir}/tndb.pc
473 %{_pkgconfigdir}/trurlib.pc
476 %defattr(644,root,root,755)
478 %{_libdir}/libtrurl.a
481 %files -n python-poldek
482 %defattr(644,root,root,755)
483 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
484 %{py_sitescriptdir}/poldek.py[co]
485 %{py_sitescriptdir}/poldekmod.py[co]