]> TLD Linux GIT Repositories - packages/poldek.git/commitdiff
- updated to 0.32.2, partial PLD merge
authorMarcin Krol <hawk@tld-linux.org>
Thu, 30 Mar 2017 14:24:02 +0000 (14:24 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 30 Mar 2017 14:24:02 +0000 (14:24 +0000)
WTERMSIG.patch [new file with mode: 0644]
pm-hooks.patch [new file with mode: 0644]
poldek-config.sh [new file with mode: 0755]
poldek.desktop
poldek.spec

diff --git a/WTERMSIG.patch b/WTERMSIG.patch
new file mode 100644 (file)
index 0000000..5249c17
--- /dev/null
@@ -0,0 +1,11 @@
+--- poldek-0.32.2/vfile/vopen3.c~      2016-01-30 15:05:57.000000000 +0100
++++ poldek-0.32.2/vfile/vopen3.c       2016-10-18 08:14:09.638596140 +0200
+@@ -347,7 +347,7 @@
+     } else if (WIFSIGNALED(status)) {
+ #ifdef HAVE_STRSIGNAL
+         st_seterr(st, _("%s terminated by signal %d (%s)"),
+-                   st->cmd, WTERMSIG(status), strsignal(WTERMSIG(st)));
++                   st->cmd, WTERMSIG(status), strsignal(WTERMSIG(status)));
+ #else
+         st_seterr(st, _("%s terminated by signal %d"),
+                    st->cmd, WTERMSIG(status));
diff --git a/pm-hooks.patch b/pm-hooks.patch
new file mode 100644 (file)
index 0000000..9a7d33b
--- /dev/null
@@ -0,0 +1,61 @@
+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) \
diff --git a/poldek-config.sh b/poldek-config.sh
new file mode 100755 (executable)
index 0000000..795e894
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# poldek-config - poldek(1) configuration program
+#
+# poldek-config is an program to provide consistent configurability.
+# It accesses the main configuration file /etc/poldek/poldek.conf(5)
+# in a manner that is easy to use by scripted applications.
+#
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+# Date: 2015-11-13
+
+usage() {
+       cat <<EOF
+Usage: $0 [options] command
+
+Commands:
+
+ignore [PACKAGE] [PACKAGE...]
+    Ignore package list - packages fits given mask will be invisible.
+
+hold [PACKAGE] [PACKAGE...]
+    Prevent package listed from being upgraded if they are already installed.
+
+keep_downloads yes|no
+    Do not remove downloaded packages after its successful installation.
+
+cachedir /var/cache/poldek
+    Cache directory for downloaded files. NOTE that parent directory of cachedir must exist.
+
+EOF
+}
+
+die() {
+       echo >&2 "$PROGRAM: $*"
+       exit 1
+}
+
+option_set() {
+       local option="$1"; shift
+       sed -i -re "/^#?$option\s*=/ s#.*#$option = $*#" "$poldek_conf"
+}
+
+# parse command line args
+parse_arguments() {
+       t=$(getopt -o hc: --long help -n "$PROGRAM" -- "$@")
+       [ $? != 0 ] && exit $?
+       eval set -- "$t"
+
+       while :; do
+               case "$1" in
+               -h|--help)
+                       usage
+                       exit 0
+               ;;
+               -c)
+                       shift
+                       poldek_conf=$1
+               ;;
+               --)
+                       shift
+                       break
+               ;;
+               *)
+                       die "Internal error: [$1] not recognized!"
+               ;;
+               esac
+               shift
+       done
+
+       if [ $# = 0 ]; then
+               usage
+               exit 1
+       fi
+
+       command=$1; shift
+       arguments="$*"
+}
+
+main() {
+       parse_arguments "$@"
+
+       case "$command" in
+               ignore|hold)
+                       option_set "$command" "$arguments"
+                       ;;
+               keep_downloads)
+                       option_set "keep downloads" "$arguments"
+                       ;;
+               cachedir|cache_dir)
+                       option_set "cachedir" "$arguments"
+                       ;;
+               *)
+                       die "Unknown command: $command"
+                       ;;
+       esac
+}
+
+PROGRAM="${0##*/}"
+poldek_conf=/etc/poldek/poldek.conf
+
+main "$@"
index bfd82b55692b845c0ac60e3dc8c74d3806f327f2..8fa8a1982a7f6488922fe53bf09a841f68d19e04 100644 (file)
@@ -8,4 +8,4 @@ Exec=poldek
 Terminal=true
 Icon=poldek
 Type=Application
-Categories=Settings;PackageManager;
+Categories=PackageManager;
index 60d97dd1a3ef413baf638c3eaf143bd0f6ae7c54..6bf59c0899a4e679d84d11625ca35516a654cf9b 100644 (file)
@@ -1,35 +1,41 @@
-#
+# TODO
+# - fix config having escaped html entities:
+#   # package A requires capability foo &gt;= 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
@@ -37,10 +43,10 @@ BuildRequires:      automake >= 1:1.11
 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
@@ -49,7 +55,6 @@ BuildRequires:        popt-devel
 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
@@ -71,12 +76,12 @@ Requires(triggerpostun):    awk
 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}
@@ -194,6 +199,7 @@ Moduły języka Python dla poldka.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %{__rm} m4/libtool.m4 m4/lt*.m4
 
@@ -230,14 +236,17 @@ CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
        --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 \
@@ -247,14 +256,14 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
 %{?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}
@@ -263,10 +272,10 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
        %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
@@ -279,7 +288,7 @@ cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
 %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
@@ -290,6 +299,7 @@ cp -a conf configs
 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
 %endif
 
+
 %find_lang %{name}
 
 %clean
@@ -320,50 +330,6 @@ fi
 %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/{
@@ -377,29 +343,54 @@ fi
 %{__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*