# Conditional build:
%bcond_with static # don't use shared libraries
%bcond_without imode # don't build interactive mode
-%bcond_without python # don't build python bindings
+%bcond_with python # don't build python bindings
+%bcond_with tests # tests
# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-# NOTE: poldek links with "system db" (-ldb) anyway if it exists
-%define db_pkg db4.7
-%define ver_db 4.7.25
-%define ver_db_rel 1
-%define ver_rpm 4.5-49
+%define db_pkg db
+%define ver_db 5.3
+%define ver_rpm 1:4.14
+%define ver_db_devel %(rpm -q --qf '%|E?{%{E}:}|%{V}-%{R}' --what-provides db-devel)
-%define rel 5
Summary: RPM packages management helper tool
Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
Name: poldek
-Version: 0.32.2
-Release: %{rel}
+Version: 0.42.2
+Release: 6
License: GPL v2
Group: Applications/System
-Source0: https://launchpad.net/poldek/0.32/%{version}/+download/%{name}-%{version}.tar.xz
-# Source0-md5: 60b964723880569531f88f084cd3ae65
-Source1: %{name}.conf
-Source2: %{name}-multilib.conf
-Source3: %{name}-config.sh
+#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
+Source0: https://github.com/poldek-pm/poldek/releases/download/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 2759fe45bc50efb6084d5338d725411a
+Source1: tld.conf
+Source2: tld-multilib.conf
+Source3: tld-debuginfo.conf
+Source4: %{name}-config.sh
Source5: %{name}-aliases.conf
Source6: %{name}.desktop
Source7: %{name}.png
-Patch0: %{name}-size-type.patch
-Patch1: %{name}-config.patch
-Patch2: pm-hooks.patch
-Patch3: WTERMSIG.patch
-Patch4: %{name}-multiproto.patch
-Patch5: %{name}-python-fix.patch
-Patch6: %{name}-libdb.patch
+# Source7-md5: ee487abede50874e9eceb6495d5ee150
+Patch0: %{name}-config.patch
+Patch1: pm-hooks.patch
+Patch2: %{name}-ext-down-enable.patch
+Patch3: %{name}-pc.patch
+Patch4: %{name}-info.patch
+Patch5: %{name}-multiarch-x32.patch
+Patch6: rpm-4.15.patch
+Patch7: db-index-format.patch
+Patch8: rpm4-uname-deps.patch
+Patch9: sqlite-rpmdb.patch
+Patch10: rpm4-cpuinfo-deps.patch
+Patch11: rpm4-no-dir-deps.patch
+Patch12: rpm4-rpmvercmp.patch
+Patch13: trurlib-shared.patch
+Patch14: rpm4-script-req-workaround.patch
+Patch15: skip-buildid-obsoletes.patch
URL: http://poldek.pld-linux.org/
-BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
-BuildRequires: autoconf
+BuildRequires: %{db_pkg}-devel >= %{ver_db}
+BuildRequires: autoconf >= 2.63
BuildRequires: automake >= 1:1.11
BuildRequires: bzip2-devel
BuildRequires: check-devel
BuildRequires: docbook-dtd412-xml
-BuildRequires: gettext-tools
+BuildRequires: docbook2X
+BuildRequires: gettext-tools >= 0.11.5
BuildRequires: libgomp-devel
BuildRequires: libtool
-BuildRequires: libxml2-devel
+BuildRequires: libxml2-devel >= 2
+BuildRequires: ncurses-devel
BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: pcre-devel
+BuildRequires: perl-XML-Simple
+BuildRequires: perl-base
+BuildRequires: perl-modules
BuildRequires: pkgconfig
BuildRequires: popt-devel
%{?with_python:BuildRequires: python-devel}
BuildRequires: rpm-devel >= %{ver_rpm}
%{?with_python:BuildRequires: rpm-pythonprov}
BuildRequires: tar >= 1:1.22
+BuildRequires: texinfo
BuildRequires: xmlto
BuildRequires: xz
BuildRequires: zlib-devel
+BuildRequires: zstd-devel
%if %{with static}
-BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
+BuildRequires: %{db_pkg}-static >= %{ver_db}
BuildRequires: bzip2-static
BuildRequires: glibc-static
BuildRequires: libxml2-static
BuildRequires: readline-static
BuildRequires: rpm-static
BuildRequires: zlib-static
+BuildRequires: zstd-static
%endif
-Requires(triggerpostun): awk
-Requires(triggerpostun): sed >= 4.0
-Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
+Requires(postun): awk
+Requires(postun): sed >= 4.0
+Requires: %{db_pkg} >= %{ver_db_devel}
Requires: %{name}-libs = %{version}-%{release}
Requires: /bin/run-parts
Requires: rpm >= %{ver_rpm}
-Requires: rpm-db-ver = %{ver_db}
Requires: rpm-lib >= %{ver_rpm}
Requires: sed
Conflicts: etckeeper < 1.18-2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _libexecdir %{_prefix}/lib/%{name}
+# it could be %{_libexecdir}/%{name}, but beware of compatibility (path hardcoded in configurations)
+%define pkglibexecdir %{_prefix}/lib/%{name}
%description
poldek is an RPM package management tool which allows you to easily
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+cd trurlib
+%patch13 -p1
+cd ..
+%patch14 -p1
+%patch15 -p1
+%{__rm} doc/poldek.info
%{__rm} m4/libtool.m4 m4/lt*.m4
# cleanup backups after patching
%{__automake}
cd ..
-CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
%configure \
%{?with_static:--enable-static --disable-shared} \
%{!?with_imode:--disable-imode} \
- --with-pkglibdir=%{_libexecdir} \
+ --with-pkglibdir=%{pkglibexecdir} \
--enable-nls \
%{?with_python:--with-python}
-%{__make} -j1
-# --enable-trace
+%{__make}
+
+%{__make} -C doc poldek.info
%if %{with python}
%{__make} -C python
%endif
+%if %{with tests}
+%{__make} check
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/var/cache/%{name}
-%{__make} install -j1 \
+%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/poldek-config
%if %{with python}
-%{__make} -C python -j1 install \
+%{__make} -C python install \
DESTDIR=$RPM_BUILD_ROOT \
py_sitedir=%{py_sitedir}
%endif
%{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
-%ifarch i686
+%ifarch i686 aarch64
%define ftp_arch %{_target_cpu}
%endif
%ifarch %{x8664}
%define ftp_arch x86_64
%define ftp_alt_arch i686
%endif
-%ifarch pentium2 pentium3 pentium4
- %define ftp_arch i686
-%endif
%define tld_conf %{SOURCE1}
%define tld_multilib_conf %{SOURCE2}
%endif
+%define tld_debuginfo_conf %{SOURCE3}
+
%{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
%if 0%{?tld_multilib_conf:1}
%{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
%endif
+%{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{tld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-debuginfo.conf
+
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
%if %{with imode}
%triggerpostun -- %{name} < 0.30.1-8
if [ $1 -le 1 ]; then
# revert change on --downgrade
- %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
+ %{__sed} -i -re 's,^pm command = %{pkglibexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
else
# setup pm command
- %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
+ %{__sed} -i -re 's,#?(pm command =).*,\1 %{pkglibexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
fi
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc ChangeLog README* NEWS TODO configs
+%doc ChangeLog README* NEWS configs
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/pre-install.d
%{_sysconfdir}/%{name}/pre-install.d/README
%if 0%{?tld_multilib_conf:1}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
%endif
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld-debuginfo.conf
%attr(755,root,root) %{_bindir}/ipoldek
%attr(755,root,root) %{_bindir}/poldek
%attr(755,root,root) %{_bindir}/poldek-config
%attr(755,root,root) %{_bindir}/rpmvercmp
-%dir %{_libexecdir}
-%attr(755,root,root) %{_libexecdir}/pm-command.sh
-%attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh
-%attr(755,root,root) %{_libexecdir}/vfcompr
-%attr(755,root,root) %{_libexecdir}/vfjuggle
-%attr(755,root,root) %{_libexecdir}/vfsmb
-%attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh
+%dir %{pkglibexecdir}
+%attr(755,root,root) %{pkglibexecdir}/pm-command.sh
+%attr(755,root,root) %{pkglibexecdir}/poldekuser-setup.sh
+%attr(755,root,root) %{pkglibexecdir}/vfcompr
+%attr(755,root,root) %{pkglibexecdir}/vfjuggle
+%attr(755,root,root) %{pkglibexecdir}/vfsmb
+%attr(755,root,root) %{pkglibexecdir}/zlib-in-rpm.sh
%{_mandir}/man1/%{name}*.1*
%lang(pl) %{_mandir}/pl/man1/%{name}*
%{_infodir}/poldek.info*
%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
-%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
+%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.1
+%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.3
%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0