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 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 URL: http://poldek.pld-linux.org/
45 BuildRequires: %{db_pkg}-devel >= %{ver_db}
46 BuildRequires: autoconf >= 2.63
47 BuildRequires: automake >= 1:1.11
48 BuildRequires: bzip2-devel
49 BuildRequires: check-devel
50 BuildRequires: docbook-dtd412-xml
51 BuildRequires: docbook2X
52 BuildRequires: gettext-tools >= 0.11.5
53 BuildRequires: libgomp-devel
54 BuildRequires: libtool
55 BuildRequires: libxml2-devel >= 2
56 BuildRequires: ncurses-devel
57 BuildRequires: openssl-devel >= 0.9.7d
58 BuildRequires: pcre-devel
59 BuildRequires: perl-XML-Simple
60 BuildRequires: perl-base
61 BuildRequires: perl-modules
62 BuildRequires: pkgconfig
63 BuildRequires: popt-devel
64 %{?with_python:BuildRequires: python-devel}
65 BuildRequires: readline-devel >= 5.0
66 BuildRequires: rpm-devel >= %{ver_rpm}
67 %{?with_python:BuildRequires: rpm-pythonprov}
68 BuildRequires: tar >= 1:1.22
69 BuildRequires: texinfo
72 BuildRequires: zlib-devel
73 BuildRequires: zstd-devel
75 BuildRequires: %{db_pkg}-static >= %{ver_db}
76 BuildRequires: bzip2-static
77 BuildRequires: glibc-static
78 BuildRequires: libxml2-static
79 BuildRequires: ncurses-static
80 BuildRequires: openssl-static
81 BuildRequires: pcre-static
82 BuildRequires: popt-static
83 BuildRequires: readline-static
84 BuildRequires: rpm-static
85 BuildRequires: zlib-static
86 BuildRequires: zstd-static
89 Requires(postun): sed >= 4.0
90 Requires: %{db_pkg} >= %{ver_db_devel}
91 Requires: %{name}-libs = %{version}-%{release}
92 Requires: /bin/run-parts
93 Requires: rpm >= %{ver_rpm}
94 Requires: rpm-lib >= %{ver_rpm}
96 Conflicts: etckeeper < 1.18-2
97 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99 # it could be %{_libexecdir}/%{name}, but beware of compatibility (path hardcoded in configurations)
100 %define pkglibexecdir %{_prefix}/lib/%{name}
103 poldek is an RPM package management tool which allows you to easily
104 perform package verification, installation (including system
105 installation from scratch), upgrading, and removal.
107 Program can be used in batch (like apt-get from Debian's APT) or
108 interactive mode. The interactive mode puts you into a readline
109 interface with command line autocompletion and history, similar to the
110 shell mode of Perl's CPAN.
112 %{?with_static:This version is statically linked.}
114 %{!?with_imode:This version hasn't got interactive mode.}
117 %description -l hu.UTF-8
118 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
119 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
120 nulláról), frissítést és eltávolítást.
122 A program használható parancssorból (mint a Debian apt-get programja)
123 vagy interaktív módban. Az interaktív mód egy readline környezetet
124 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
127 %{?with_static:Ez a verzió statikusan linkelt.}
129 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
131 %description -l pl.UTF-8
132 poldek jest narzędziem linii poleceń służącym do weryfikacji,
133 instalacji (włączając instalację systemu od zera), aktualizacji i
136 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
137 interaktywnym. Tryb interaktywny posiada interfejs readline z
138 dopełnianiem komend i historią, podobny do trybu shell perlowego
141 %{?with_static:Ta wersja jest konsolidowana statycznie.}
143 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
146 Summary: poldek libraries
147 Summary(hu.UTF-8): A poldek könyvtárai
148 Summary(pl.UTF-8): Biblioteki poldka
154 %description libs -l hu.UTF-8
157 %description libs -l pl.UTF-8
161 Summary: Header files for poldek libraries
162 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
163 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
164 Group: Development/Libraries
165 Requires: %{name}-libs = %{version}-%{release}
166 Requires: rpm-devel >= %{ver_rpm}
169 Header files for poldek libraries.
171 %description devel -l hu.UTF-8
172 A poldek könyvtár fejlesztői fájljai.
174 %description devel -l pl.UTF-8
175 Pliki nagłówkowe bibliotek poldka.
178 Summary: poldek static libraries
179 Summary(hu.UTF-8): poldek statikus könyvtárak
180 Summary(pl.UTF-8): Biblioteki statyczne poldka
181 Group: Development/Libraries
182 Requires: %{name}-devel = %{version}-%{release}
185 poldek static libraries.
187 %description static -l hu.UTF-8
188 poldek statikus könyvtárak.
190 %description static -l pl.UTF-8
191 Biblioteki statyczne poldka.
193 %package -n python-poldek
194 Summary: Python modules for poldek
195 Summary(hu.UTF-8): Python modulok poldek-hez
196 Summary(pl.UTF-8): Moduły języka Python dla poldka
197 Group: Libraries/Python
198 Requires: %{name}-libs = %{version}-%{release}
199 Requires: python-libs
201 %description -n python-poldek
202 Python modules for poldek.
204 %description -n python-poldek -l hu.UTF-8
205 Python modulok poldek-hez.
207 %description -n python-poldek -l pl.UTF-8
208 Moduły języka Python dla poldka.
221 %{__rm} doc/poldek.info
222 %{__rm} m4/libtool.m4 m4/lt*.m4
224 # cleanup backups after patching
225 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
226 chmod u+x ./configure ./doc/conf-xml2.sh
250 %{?with_static:--enable-static --disable-shared} \
251 %{!?with_imode:--disable-imode} \
252 --with-pkglibdir=%{pkglibexecdir} \
254 %{?with_python:--with-python}
257 %{__make} -C doc poldek.info
268 rm -rf $RPM_BUILD_ROOT
269 install -d $RPM_BUILD_ROOT/var/cache/%{name}
272 DESTDIR=$RPM_BUILD_ROOT
274 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
277 %{__make} -C python install \
278 DESTDIR=$RPM_BUILD_ROOT \
279 py_sitedir=%{py_sitedir}
282 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
285 %define ftp_arch %{_target_cpu}
288 %define ftp_arch x86_64
289 %define ftp_alt_arch i686
292 %define tld_conf %{SOURCE1}
295 %define tld_multilib_conf %{SOURCE2}
298 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
300 %if 0%{?tld_multilib_conf:1}
301 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
304 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
307 # add desktop file and icon
308 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
309 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
310 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
313 # sources we don't package
314 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
315 # include them in %doc
318 %{__rm} -f configs/Makefile*
322 %{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so}
329 rm -rf $RPM_BUILD_ROOT
332 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
333 if [ "$1" = "1" ]; then
334 # remove ignore = vserver-packages inside vserver on first install
337 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
338 done </proc/self/status
340 if [ -z "$ctx" -o "$ctx" = "0" ]; then
345 if [ "$VSERVER" = "yes" ]; then
346 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
350 %postun -p /sbin/postshell
351 -/usr/sbin/fix-info-dir -c %{_infodir}
353 %post libs -p /sbin/ldconfig
354 %postun libs -p /sbin/ldconfig
356 %triggerpostun -- poldek < 0.30-0.20080225.00.1
357 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
358 %{__sed} -i -e '/^%%include source.conf/{
360 a# /etc/poldek/repos.d/*.conf
361 a%%includedir repos.d
362 }' %{_sysconfdir}/%{name}/poldek.conf
365 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
366 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
368 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
369 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
370 %{__mv} -v %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
374 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
375 %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
376 %{__mv} -v %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
380 %triggerpostun -- %{name} < 0.30.1-8
381 if [ $1 -le 1 ]; then
382 # revert change on --downgrade
383 %{__sed} -i -re 's,^pm command = %{pkglibexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
386 %{__sed} -i -re 's,#?(pm command =).*,\1 %{pkglibexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
389 %files -f %{name}.lang
390 %defattr(644,root,root,755)
391 %doc ChangeLog README* NEWS configs
392 %dir %{_sysconfdir}/%{name}
393 %dir %{_sysconfdir}/%{name}/pre-install.d
394 %{_sysconfdir}/%{name}/pre-install.d/README
395 %dir %{_sysconfdir}/%{name}/post-install.d
396 %{_sysconfdir}/%{name}/post-install.d/README
397 %dir %{_sysconfdir}/%{name}/repos.d
398 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/cli.conf
399 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fetch.conf
400 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/poldek.conf
401 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/source.conf
402 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld.conf
403 %if 0%{?tld_multilib_conf:1}
404 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
406 %attr(755,root,root) %{_bindir}/ipoldek
407 %attr(755,root,root) %{_bindir}/poldek
408 %attr(755,root,root) %{_bindir}/poldek-config
409 %attr(755,root,root) %{_bindir}/rpmvercmp
410 %dir %{pkglibexecdir}
411 %attr(755,root,root) %{pkglibexecdir}/pm-command.sh
412 %attr(755,root,root) %{pkglibexecdir}/poldekuser-setup.sh
413 %attr(755,root,root) %{pkglibexecdir}/vfcompr
414 %attr(755,root,root) %{pkglibexecdir}/vfjuggle
415 %attr(755,root,root) %{pkglibexecdir}/vfsmb
416 %attr(755,root,root) %{pkglibexecdir}/zlib-in-rpm.sh
417 %{_mandir}/man1/%{name}*.1*
418 %lang(pl) %{_mandir}/pl/man1/%{name}*
419 %{_infodir}/poldek.info*
421 %{_desktopdir}/%{name}.desktop
422 %{_pixmapsdir}/%{name}.png
424 %dir /var/cache/%{name}
426 %if %{without static}
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
430 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
431 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
432 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
433 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
434 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.1
435 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.3
436 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
437 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
438 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
442 %defattr(644,root,root,755)
443 %if %{without static}
444 %attr(755,root,root) %{_libdir}/libpoclidek.so
445 %attr(755,root,root) %{_libdir}/libpoldek.so
446 %attr(755,root,root) %{_libdir}/libtndb.so
447 %attr(755,root,root) %{_libdir}/libtrurl.so
448 %attr(755,root,root) %{_libdir}/libvfile.so
450 %{_libdir}/libpoclidek.la
451 %{_libdir}/libpoldek.la
452 %{_libdir}/libtndb.la
453 %{_libdir}/libtrurl.la
454 %{_libdir}/libvfile.la
455 %{_includedir}/poldek
459 %{_pkgconfigdir}/tndb.pc
460 %{_pkgconfigdir}/trurlib.pc
463 %defattr(644,root,root,755)
465 %{_libdir}/libtrurl.a
468 %files -n python-poldek
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
471 %{py_sitescriptdir}/poldek.py[co]
472 %{py_sitescriptdir}/poldekmod.py[co]