--- /dev/null
+this could be handled natively by poldek
+but implement as "pm command" hack for now
+
+--- /dev/null 2015-05-20 12:11:30.089022100 +0300
++++ poldek/pm-command.sh 2015-05-31 18:21:15.748917981 +0300
+@@ -0,0 +1,11 @@
++#!/bin/sh
++# wrapper to add pre-install.d and post-install.d support for pm command in poldek
++
++/bin/run-parts /etc/poldek/pre-install.d
++
++/bin/rpm "$@"
++rc=$?
++
++/bin/run-parts /etc/poldek/post-install.d
++
++exit $rc
+--- /dev/null 2015-05-20 12:11:30.089022100 +0300
++++ poldek/conf/pre-install.d/README 2015-05-31 18:18:35.539100326 +0300
+@@ -0,0 +1,2 @@
++Files in this directory are run before packages are installed, upgraded,
++etc.
+--- /dev/null 2015-05-20 12:11:30.089022100 +0300
++++ poldek/conf/post-install.d/README 2015-05-31 18:18:45.883922914 +0300
+@@ -0,0 +1 @@
++Files in this directory are run after packages are installed, upgraded, etc.
+--- poldek-0.30.1/conf/poldek.conf~ 2015-05-31 18:25:35.000000000 +0300
++++ poldek-0.30.1/conf/poldek.conf 2015-05-31 18:26:28.410188923 +0300
+@@ -56,7 +56,7 @@
+ #exclude path =
+
+ # Full path name to a PM (rpm for now) binary.
+-#pm command = /bin/rpm
++pm command = /usr/lib/poldek/pm-command.sh
+
+ # Full path name to sudo binary.
+ #sudo command = /usr/bin/sudo
+--- poldek-0.30.1/conf/Makefile.am 2015-05-31 18:28:29.319806773 +0300
++++ poldek-0.30.1/conf/Makefile.am 2015-05-31 19:12:22.206571793 +0300
+@@ -26,6 +26,10 @@
+
+ install-data-local: $(GENCONFIGS)
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/$(PACKAGE)/repos.d
++ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/$(PACKAGE)/pre-install.d
++ $(INSTALL_DATA) pre-install.d/README $(DESTDIR)$(sysconfdir)/$(PACKAGE)/pre-install.d
++ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/$(PACKAGE)/post-install.d
++ $(INSTALL_DATA) post-install.d/README $(DESTDIR)$(sysconfdir)/$(PACKAGE)/post-install.d
+ for a in $(CONFIGS); do \
+ $(INSTALL_DATA) $(srcdir)/$$a $(DESTDIR)$(sysconfdir)/$(PACKAGE); \
+ done
+--- poldek-0.30.1/Makefile.am~ 2014-03-26 00:32:25.000000000 +0200
++++ poldek-0.30.1/Makefile.am 2015-05-31 19:10:22.240340180 +0300
+@@ -79,7 +79,7 @@
+ LDADD_ = @INTLLIBS@
+
+ vfscriptsdir = $(PKGLIBDIR)
+-vfscripts_SCRIPTS = zlib-in-rpm.sh vfjuggle vfcompr vfsmb poldekuser-setup.sh
++vfscripts_SCRIPTS = zlib-in-rpm.sh vfjuggle vfcompr vfsmb poldekuser-setup.sh pm-command.sh
+
+ EXTRA_DIST = \
+ $(vfscripts_SCRIPTS) \
-#
+# TODO
+# - fix config having escaped html entities:
+# # package A requires capability foo >= 1.0 while package B provides "foo"
+
# 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
# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-%define db_pkg db4.5
-%define ver_db 4.5.20.2
-%define ver_db_rel 2
-%define ver_rpm 4.5-71
+# 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 rel 5
+%define rel 1
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.30.1
+Version: 0.32.2
Release: %{rel}
License: GPL v2
Group: Applications/System
-#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
-Source0: http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz
-# Source0-md5: e569c8454df0932df53b09cee9998927
+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
Source5: %{name}-aliases.conf
Source6: %{name}.desktop
Source7: %{name}.png
+# Source7-md5: ee487abede50874e9eceb6495d5ee150
Patch0: %{name}-size-type.patch
Patch1: %{name}-config.patch
-Patch2: %{name}-libdb.patch
+Patch2: pm-hooks.patch
+Patch3: WTERMSIG.patch
URL: http://poldek.pld-linux.org/
BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
BuildRequires: autoconf
BuildRequires: bzip2-devel
BuildRequires: check-devel
BuildRequires: docbook-dtd412-xml
-BuildRequires: gettext-devel
+BuildRequires: gettext-tools
+BuildRequires: libgomp-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
-BuildRequires: neon-devel
BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel >= 5.0
BuildRequires: rpm-devel >= %{ver_rpm}
%{?with_python:BuildRequires: rpm-pythonprov}
-BuildRequires: swig-python
BuildRequires: tar >= 1:1.22
BuildRequires: xmlto
BuildRequires: xz
Requires(triggerpostun): sed >= 4.0
Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
Requires: %{name}-libs = %{version}-%{release}
+Requires: /bin/run-parts
Requires: rpm >= %{ver_rpm}
Requires: rpm-db-ver = %{ver_db}
-#Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
Requires: rpm-lib >= %{ver_rpm}
-# vf* scripts use sed
Requires: sed
+Conflicts: etckeeper < 1.18-2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _libexecdir %{_prefix}/lib/%{name}
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%{__rm} m4/libtool.m4 m4/lt*.m4
--enable-nls \
%{?with_python:--with-python}
%{__make} -j1
+# --enable-trace
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
+install -d $RPM_BUILD_ROOT/var/cache/%{name}
%{__make} install -j1 \
DESTDIR=$RPM_BUILD_ROOT
+install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
+
%if %{with python}
%{__make} -C python -j1 install \
DESTDIR=$RPM_BUILD_ROOT \
%{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
%ifarch i686
- %define _ftp_arch %{_target_cpu}
+ %define ftp_arch %{_target_cpu}
%endif
%ifarch %{x8664}
- %define _ftp_arch x86_64
- %define _ftp_alt_arch i686
+ %define ftp_arch x86_64
+ %define ftp_alt_arch i686
%endif
%ifarch pentium2 pentium3 pentium4
- %define _ftp_arch i686
+ %define ftp_arch i686
%endif
%define tld_conf %{SOURCE1}
%define tld_multilib_conf %{SOURCE2}
%endif
-%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
+%{__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
+ %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
%endif
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
%endif
# sources we don't package
-%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,fedora,centos}-source,repos.d/pld}.conf
+%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
# include them in %doc
%{__rm} -rf configs
cp -a conf configs
%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
%endif
+
%find_lang %{name}
%clean
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
-%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
-if [ -f /etc/poldek.conf.rpmsave ]; then
- awk '/^source/ {
- name = $3;
- path = $4;
- auto = "yes";
- autoup = "yes";
- type = "pdir";
- pri = "";
-
- if (sub(",noauto", "", name)) {
- auto = "no";
- }
-
- # process pri=\d+
- if (match(name, /,pri=[0-9]+/)) {
- pri = substr(name, RSTART + 5, RLENGTH - 5);
- name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
- }
-
- # skip ac sources. already in new config.
- if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
- print "";
- print "[source]";
- print "name = " name;
- print "type = " type;
- print "path = " path;
- print "auto = " auto;
- print "autoup = " autoup;
- if (pri) {
- print "pri = " pri;
- }
- }
-
- }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
- echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
-
- # copy hold=
- hold=$(grep ^hold /etc/poldek.conf.rpmsave)
- if [ "$hold" ]; then
- %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
- fi
-fi
-
%triggerpostun -- poldek < 0.30-0.20080225.00.1
if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
%{__sed} -i -e '/^%%include source.conf/{
%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
- cp -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
- cp -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
+ %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
+ %{__mv} -v %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
fi
%ifarch %{x8664}
if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
- cp -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
- cp -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
+ %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
+ %{__mv} -v %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
fi
%endif
+%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
+else
+ # setup pm command
+ %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
+fi
+
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc ChangeLog README* NEWS TODO configs
%dir %{_sysconfdir}/%{name}
+%dir %{_sysconfdir}/%{name}/pre-install.d
+%{_sysconfdir}/%{name}/pre-install.d/README
+%dir %{_sysconfdir}/%{name}/post-install.d
+%{_sysconfdir}/%{name}/post-install.d/README
%dir %{_sysconfdir}/%{name}/repos.d
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/cli.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fetch.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/poldek.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/source.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld.conf
+%if 0%{?tld_multilib_conf:1}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
+%endif
%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}/*
+%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
%{_mandir}/man1/%{name}*.1*
%lang(pl) %{_mandir}/pl/man1/%{name}*
%{_infodir}/poldek.info*