From 3a425a6db5aeb44a75a43e70a3bb22f9cfe2472c Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Thu, 29 Oct 2020 22:41:12 +0100 Subject: [PATCH] - 0.42.2 from PLD with rpm.org RPM support --- WTERMSIG.patch | 11 -- db-index-format.patch | 12 ++ openssl.patch | 266 ----------------------------------- pm-hooks.patch | 12 +- poldek-ext-down-enable.patch | 12 ++ poldek-info.patch | 22 +++ poldek-multiarch-x32.patch | 18 +++ poldek-multiproto.patch | 12 -- poldek-pc.patch | 11 ++ poldek-size-type.patch | 26 ---- poldek.conf | 2 +- poldek.spec | 112 ++++++++------- rpm-4.15.patch | 126 +++++++++++++++++ rpm4-uname-deps.patch | 12 ++ 14 files changed, 282 insertions(+), 372 deletions(-) delete mode 100644 WTERMSIG.patch create mode 100644 db-index-format.patch delete mode 100644 openssl.patch create mode 100644 poldek-ext-down-enable.patch create mode 100644 poldek-info.patch create mode 100644 poldek-multiarch-x32.patch delete mode 100644 poldek-multiproto.patch create mode 100644 poldek-pc.patch delete mode 100644 poldek-size-type.patch create mode 100644 rpm-4.15.patch create mode 100644 rpm4-uname-deps.patch diff --git a/WTERMSIG.patch b/WTERMSIG.patch deleted file mode 100644 index 5249c17..0000000 --- a/WTERMSIG.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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/db-index-format.patch b/db-index-format.patch new file mode 100644 index 0000000..76d9de0 --- /dev/null +++ b/db-index-format.patch @@ -0,0 +1,12 @@ +--- poldek-0.42.2/pm/rpmorg/rpmdb_depdirs.c~ 2020-10-21 15:02:08.000000000 +0200 ++++ poldek-0.42.2/pm/rpmorg/rpmdb_depdirs.c 2020-10-21 15:02:22.244854642 +0200 +@@ -74,9 +74,7 @@ + + index = "Requirename"; + +-#ifdef HAVE_RPM_5 + dbtype = DB_BTREE; /* XXX: should be detected at runtime */ +-#endif + if (rootdir == NULL) + rootdir = "/"; + diff --git a/openssl.patch b/openssl.patch deleted file mode 100644 index 559704d..0000000 --- a/openssl.patch +++ /dev/null @@ -1,266 +0,0 @@ ---- poldek-0.32.2/tndb/read.c~ 2016-01-30 17:59:59.000000000 +0100 -+++ poldek-0.32.2/tndb/read.c 2018-09-14 18:35:56.516594794 +0200 -@@ -53,20 +53,22 @@ static - int md5(FILE *stream, unsigned char *md, unsigned *md_size) - { - unsigned char buf[8*1024]; -- EVP_MD_CTX ctx; -+ EVP_MD_CTX *ctx; - unsigned n, nn = 0; - - - n_assert(md_size && *md_size); - -- EVP_DigestInit(&ctx, EVP_md5()); -+ ctx = EVP_MD_CTX_create(); -+ if (!EVP_DigestInit(ctx, EVP_md5())) -+ return 0; - - while ((n = fread(buf, 1, sizeof(buf), stream)) > 0) { -- EVP_DigestUpdate(&ctx, buf, n); -+ EVP_DigestUpdate(ctx, buf, n); - nn += n; - } - -- EVP_DigestFinal(&ctx, buf, &n); -+ EVP_DigestFinal(ctx, buf, &n); - - if (n > *md_size) { - *md = '\0'; -@@ -75,7 +77,9 @@ int md5(FILE *stream, unsigned char *md, - memcpy(md, buf, n); - *md_size = n; - } -- -+ -+ EVP_MD_CTX_destroy(ctx); -+ - return *md_size; - } - ---- poldek-0.32.2/tndb/tndb.c~ 2016-01-30 17:59:59.000000000 +0100 -+++ poldek-0.32.2/tndb/tndb.c 2018-09-14 18:40:57.805504132 +0200 -@@ -85,13 +85,13 @@ char *tndb_bin2hex_s(const unsigned char - //static - void tndb_sign_init(struct tndb_sign *sign) - { -- EVP_MD_CTX ctx; -+ EVP_MD_CTX *ctx; - - memset(sign, 0, sizeof(*sign)); - -- EVP_DigestInit(&ctx, EVP_sha1()); -- sign->ctx = n_malloc(sizeof(ctx)); -- memcpy(sign->ctx, &ctx, sizeof(ctx)); -+ ctx = EVP_MD_CTX_create(); -+ EVP_DigestInit(ctx, EVP_sha1()); -+ sign->ctx = ctx; - //printf("%p %p >> INIT\n", sign, sign->ctx); - } - -@@ -122,8 +122,8 @@ void tndb_sign_final(struct tndb_sign *s - *sign->md = '\0'; - else - memcpy(sign->md, buf, n); -- -- free(sign->ctx); -+ -+ EVP_MD_CTX_destroy((EVP_MD_CTX *)sign->ctx); - sign->ctx = NULL; - - } ---- poldek-0.32.2/pkgdir/pdir/digest.c~ 2016-01-30 15:05:57.000000000 +0100 -+++ poldek-0.32.2/pkgdir/pdir/digest.c 2018-09-14 18:52:42.783229333 +0200 -@@ -195,12 +195,13 @@ int hdr_digest(tn_stream *st, unsigned c - int nread, len, endvhdr_found = 0; - unsigned char buf[256]; - char line[4096]; -- EVP_MD_CTX ctx; -+ EVP_MD_CTX *ctx; - unsigned n; - - - n_assert(md_size && *md_size); -- EVP_DigestInit(&ctx, EVP_sha1()); -+ ctx = EVP_MD_CTX_create(); -+ EVP_DigestInit(ctx, EVP_sha1()); - - len = strlen(pdir_tag_endvarhdr); - n = 0; -@@ -208,7 +209,7 @@ int hdr_digest(tn_stream *st, unsigned c - while ((nread = n_stream_gets(st, line, sizeof(line))) > 0) { - char *p = line; - -- EVP_DigestUpdate(&ctx, line, nread); -+ EVP_DigestUpdate(ctx, line, nread); - if (_ctx) - EVP_DigestUpdate(_ctx, line, nread); - n++; -@@ -228,7 +229,8 @@ int hdr_digest(tn_stream *st, unsigned c - break; - } - -- EVP_DigestFinal(&ctx, buf, &n); -+ EVP_DigestFinal(ctx, buf, &n); -+ EVP_MD_CTX_destroy(ctx); - - if (!endvhdr_found) { - logn(LOGERR, _("broken index")); -@@ -251,22 +253,24 @@ static - int digest(tn_stream *st, unsigned char *md, int *md_size, EVP_MD_CTX *_ctx) - { - unsigned char buf[16*1024]; -- EVP_MD_CTX ctx; -+ EVP_MD_CTX *ctx; - int n, nn = 0; - - - n_assert(md_size && *md_size); - -- EVP_DigestInit(&ctx, EVP_sha1()); -+ ctx = EVP_MD_CTX_create(); -+ EVP_DigestInit(ctx, EVP_sha1()); - - while ((n = n_stream_read(st, buf, sizeof(buf))) > 0) { -- EVP_DigestUpdate(&ctx, buf, n); -+ EVP_DigestUpdate(ctx, buf, n); - if (_ctx) - EVP_DigestUpdate(_ctx, buf, n); - nn += n; - } - -- EVP_DigestFinal(&ctx, buf, &n); -+ EVP_DigestFinal(ctx, buf, &n); -+ EVP_MD_CTX_destroy(ctx); - - if (n > *md_size) { - *md = '\0'; -@@ -288,7 +292,7 @@ int pdir_digest_calc(struct pdir_digest - unsigned char mdh[64], mdd[64], md[64], mdhex[64]; - int mdh_size = sizeof(mdh), mdd_size = sizeof(mdd), - md_size = sizeof(md); -- EVP_MD_CTX ctx, *ctxp; -+ EVP_MD_CTX *ctx, *ctxp; - int is_err = 0, n; - - -@@ -300,27 +304,34 @@ int pdir_digest_calc(struct pdir_digest - - ctxp = NULL; - if (flags & CALC_MD) { -- EVP_DigestInit(&ctx, EVP_sha1()); -- ctxp = &ctx; -+ ctx = EVP_MD_CTX_create(); -+ EVP_DigestInit(ctx, EVP_sha1()); -+ ctxp = ctx; - } - - if ((flags & CALC_MDD) == 0) { /* no separate header && body digests */ - if (!digest(st, mdd, &mdd_size, ctxp)) { -- if (ctxp) -- EVP_DigestFinal(&ctx, md, &md_size); -+ if (ctxp) { -+ EVP_DigestFinal(ctx, md, &md_size); -+ EVP_MD_CTX_destroy(ctx); -+ } - return 0; - } - - } else { - if (!hdr_digest(st, mdh, &mdh_size, ctxp)) { -- if (ctxp) -- EVP_DigestFinal(&ctx, md, &md_size); -+ if (ctxp) { -+ EVP_DigestFinal(ctx, md, &md_size); -+ EVP_MD_CTX_destroy(ctx); -+ } - return 0; - } - - if (!digest(st, mdd, &mdd_size, ctxp)) { -- if (ctxp) -- EVP_DigestFinal(&ctx, md, &md_size); -+ if (ctxp) { -+ EVP_DigestFinal(ctx, md, &md_size); -+ EVP_MD_CTX_destroy(ctx); -+ } - return 0; - } - } -@@ -336,7 +347,8 @@ int pdir_digest_calc(struct pdir_digest - } - - if (ctxp) { -- EVP_DigestFinal(&ctx, md, &md_size); -+ EVP_DigestFinal(ctx, md, &md_size); -+ EVP_MD_CTX_destroy(ctx); - n = bin2hex(mdhex, sizeof(mdhex), md, md_size); - if (n != PDIR_DIGEST_SIZE) - is_err = 1; ---- poldek-0.32.2/pkgdir/pndir/digest.c~ 2016-01-30 15:05:57.000000000 +0100 -+++ poldek-0.32.2/pkgdir/pndir/digest.c 2018-09-14 18:53:40.521640846 +0200 -@@ -241,12 +241,13 @@ int pndir_digest_calc_pkgs(struct pndir_ - int pndir_digest_calc(struct pndir_digest *pdg, tn_array *keys) - { - unsigned char md[256]; -- EVP_MD_CTX ctx; -+ EVP_MD_CTX *ctx; - int i, n, nn = 0; - - -- EVP_DigestInit(&ctx, EVP_sha1()); -- EVP_DigestUpdate(&ctx, "md", strlen("md")); -+ ctx = EVP_MD_CTX_create(); -+ EVP_DigestInit(ctx, EVP_sha1()); -+ EVP_DigestUpdate(ctx, "md", strlen("md")); - - if (keys && n_array_size(keys)) { - n_array_sort(keys); -@@ -254,11 +255,12 @@ int pndir_digest_calc(struct pndir_diges - for (i=0; i < n_array_size(keys); i++) { - char *key = n_array_nth(keys, i); - DBGF("key = %s\n", key); -- EVP_DigestUpdate(&ctx, key, strlen(key)); -+ EVP_DigestUpdate(ctx, key, strlen(key)); - } - } - -- EVP_DigestFinal(&ctx, md, &n); -+ EVP_DigestFinal(ctx, md, &n); -+ EVP_MD_CTX_destroy(ctx); - - if (n > (int)sizeof(pdg->md)) - return 0; ---- poldek-0.32.2/misc.c~ 2016-01-30 15:05:57.000000000 +0100 -+++ poldek-0.32.2/misc.c 2018-09-14 18:55:01.440752874 +0200 -@@ -80,23 +80,25 @@ static - int mdigest(FILE *stream, unsigned char *md, unsigned *md_size, int digest_type) - { - unsigned char buf[8*1024]; -- EVP_MD_CTX ctx; -+ EVP_MD_CTX *ctx; - unsigned n, nn = 0; - - - n_assert(md_size && *md_size); - -+ ctx = EVP_MD_CTX_create(); - if (digest_type == DIGEST_MD5) -- EVP_DigestInit(&ctx, EVP_md5()); -+ EVP_DigestInit(ctx, EVP_md5()); - else -- EVP_DigestInit(&ctx, EVP_sha1()); -+ EVP_DigestInit(ctx, EVP_sha1()); - - while ((n = fread(buf, 1, sizeof(buf), stream)) > 0) { -- EVP_DigestUpdate(&ctx, buf, n); -+ EVP_DigestUpdate(ctx, buf, n); - nn += n; - } - -- EVP_DigestFinal(&ctx, buf, &n); -+ EVP_DigestFinal(ctx, buf, &n); -+ EVP_MD_CTX_destroy(ctx); - - if (n > *md_size) { - *md = '\0'; diff --git a/pm-hooks.patch b/pm-hooks.patch index 9a7d33b..7029b59 100644 --- a/pm-hooks.patch +++ b/pm-hooks.patch @@ -2,7 +2,7 @@ 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 ++++ poldek/scripts/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 @@ -38,7 +38,7 @@ but implement as "pm command" hack for now --- 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 @@ -52,10 +52,10 @@ but implement as "pm command" hack for now +++ 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 - +-vfscripts_SCRIPTS = scripts/zlib-in-rpm.sh scripts/vfjuggle scripts/vfcompr scripts/vfsmb scripts/poldekuser-setup.sh ++vfscripts_SCRIPTS = scripts/zlib-in-rpm.sh scripts/vfjuggle scripts/vfcompr scripts/vfsmb scripts/poldekuser-setup.sh scripts/pm-command.sh + EXTRA_DIST = \ $(vfscripts_SCRIPTS) \ diff --git a/poldek-ext-down-enable.patch b/poldek-ext-down-enable.patch new file mode 100644 index 0000000..002e991 --- /dev/null +++ b/poldek-ext-down-enable.patch @@ -0,0 +1,12 @@ +diff -urN poldek-0.32.2.org/conf/poldek.conf poldek-0.32.2/conf/poldek.conf +--- poldek-0.32.2.org/conf/poldek.conf 2016-02-03 22:02:49.000000000 +0100 ++++ poldek-0.32.2/conf/poldek.conf 2017-11-23 09:21:23.347551541 +0100 +@@ -15,7 +15,7 @@ + + # External downloaders configuration, not necessary in most cases, cause + # to internal HTTP and FTP client. +-#%include fetch.conf ++%include fetch.conf + + [global] + diff --git a/poldek-info.patch b/poldek-info.patch new file mode 100644 index 0000000..975e094 --- /dev/null +++ b/poldek-info.patch @@ -0,0 +1,22 @@ +--- poldek-0.42.2/doc/manual.xml.orig 2020-01-25 22:59:59.000000000 +0100 ++++ poldek-0.42.2/doc/manual.xml 2020-04-13 16:10:47.472359736 +0200 +@@ -44,7 +44,7 @@ + poldek + + +- full-featured frontend to RPM. ++ Full-featured frontend to RPM + + + +--- poldek-0.42.2/doc/Makefile.am.orig 2020-01-25 22:59:59.000000000 +0100 ++++ poldek-0.42.2/doc/Makefile.am 2020-04-13 16:12:58.478316683 +0200 +@@ -81,7 +81,7 @@ + docbook2X2texi --xinclude $< -o $(@D) || docbook2texi --xinclude $< || true + perl -pi -e 's|\@emph\{|\@samp\{|g' poldek.texi + makeinfo --no-split --force poldek.texi -o $@ +- perl -pi -e 's/^\* poldek manual: \(poldek\)(.+)$$/* poldek: (poldek)$$1/' $@ ++ perl -pi -e 's/^\* poldek manual: \(poldek\)\. *(.+)$$/* poldek: (poldek).\t\t\t$$1/' $@ + rm -f *.texi + + manual.html: manual.xml.xhtml.tmp diff --git a/poldek-multiarch-x32.patch b/poldek-multiarch-x32.patch new file mode 100644 index 0000000..50b7136 --- /dev/null +++ b/poldek-multiarch-x32.patch @@ -0,0 +1,18 @@ +diff --git a/pkg.c b/pkg.c +index 9e1bf9c..ed62efd 100644 +--- a/pkg.c ++++ b/pkg.c +@@ -74,8 +74,11 @@ int pkgmod_register_arch(const char *arch) + + an_arch->score = pm_architecture_score(arch); + n_assert(an_arch->score >= 0); +- if (!an_arch->score) /* make it most less preferred */ +- an_arch->score = INT_MAX - 1; ++ if (an_arch->score == 0) { ++ /* make it most less preferred, but differ from other zero-scored ++ archs (i686 and x86_64 on x32 case) */ ++ an_arch->score = INT_MAX - n_array_size(architecture_a) - 1; ++ } + DBGF("register %s with score %d\n", arch, an_arch->score); + + memcpy(an_arch->arch, arch, len + 1); diff --git a/poldek-multiproto.patch b/poldek-multiproto.patch deleted file mode 100644 index 3565009..0000000 --- a/poldek-multiproto.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur -x .svn -x .git -x .bzr -x CVS -ruNp poldek-0.32.2.orig/conf_sections.c poldek-0.32.2/conf_sections.c ---- poldek-0.32.2.orig/conf_sections.c 2016-01-30 18:21:06.000000000 +0100 -+++ poldek-0.32.2/conf_sections.c 2017-03-31 20:34:21.955834004 +0200 -@@ -362,7 +362,7 @@ static struct poldek_conf_tag fetcher_ta - 0, { 0 } }, - - { "proto", -- CONF_TYPE_STRING | CONF_TYPE_F_REQUIRED, -+ CONF_TYPE_STRING | CONF_TYPE_F_REQUIRED | CONF_TYPE_F_LIST, - NULL, - 0, { 0 } }, - diff --git a/poldek-pc.patch b/poldek-pc.patch new file mode 100644 index 0000000..983e08b --- /dev/null +++ b/poldek-pc.patch @@ -0,0 +1,11 @@ +--- poldek-0.42.0/Makefile.am.orig 2020-03-13 21:18:10.790060106 +0100 ++++ poldek-0.42.0/Makefile.am 2020-03-14 14:15:41.899317877 +0100 +@@ -135,7 +135,7 @@ + poldek.pc: + @ ( echo 'prefix=$(prefix)'; \ + echo 'exec_prefix=$${exec_prefix}'; \ +- echo 'libdir=$${exec_prefix}/lib'; \ ++ echo 'libdir=$(libdir)'; \ + echo 'includedir=$${includedir}'; \ + echo ''; \ + echo 'Name: poldek'; \ diff --git a/poldek-size-type.patch b/poldek-size-type.patch deleted file mode 100644 index 78440af..0000000 --- a/poldek-size-type.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- poldek-0.30-cvs20080820.23/trurlib/include/trurl/narray.h~ 2007-07-12 12:56:59.000000000 +0200 -+++ poldek-0.30-cvs20080820.23/trurlib/include/trurl/narray.h 2009-01-30 13:21:51.685019394 +0100 -@@ -97,10 +97,10 @@ - ... - */ - --int n_array_size(const tn_array *arr); -+size_t n_array_size(const tn_array *arr); - #ifndef SWIG - #define n_array_size(arr) n_array_size_inl(arr) --static inline int n_array_size_inl(const tn_array *arr) -+static inline size_t n_array_size_inl(const tn_array *arr) - { - return arr->items; - } ---- poldek-0.30-cvs20080820.23/trurlib/n_array_nth.c~ 2004-02-23 00:00:34.000000000 +0100 -+++ poldek-0.30-cvs20080820.23/trurlib/n_array_nth.c 2009-01-30 13:25:53.541072782 +0100 -@@ -20,7 +20,7 @@ - } - - #undef n_array_size --int n_array_size(const tn_array *arr) -+size_t n_array_size(const tn_array *arr) - { - return arr->items; - } diff --git a/poldek.conf b/poldek.conf index 1500bfe..ebbe65c 100644 --- a/poldek.conf +++ b/poldek.conf @@ -1,4 +1,4 @@ -# TLD Linux - http://www.tld-linux.org/ +# TLD Linux - https://tld-linux.org/ _arch = %ARCH% _prefix = ftp://ftp.tld-linux.org/TLD diff --git a/poldek.spec b/poldek.spec index 4eee4ca..55eae05 100644 --- a/poldek.spec +++ b/poldek.spec @@ -6,52 +6,59 @@ %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 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 8 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: 3 License: GPL v2 Group: Applications/System -Source0: https://launchpad.net/poldek/0.32/%{version}/+download/%{name}-%{version}.tar.xz -# Source0-md5: 60b964723880569531f88f084cd3ae65 +#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: %{name}.conf Source2: %{name}-multilib.conf Source3: %{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 -Patch7: openssl.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 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} @@ -59,11 +66,13 @@ BuildRequires: readline-devel >= 5.0 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 @@ -74,20 +83,21 @@ BuildRequires: popt-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 @@ -208,6 +218,7 @@ Moduły języka Python dla poldka. %patch6 -p1 %patch7 -p1 +%{__rm} doc/poldek.info %{__rm} m4/libtool.m4 m4/lt*.m4 # cleanup backups after patching @@ -235,47 +246,48 @@ cd ../trurlib %{__automake} cd .. -CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline -D_GNU_SOURCE=1" %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 %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} @@ -368,15 +380,15 @@ fi %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 @@ -395,13 +407,13 @@ fi %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* @@ -419,8 +431,8 @@ fi %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 diff --git a/rpm-4.15.patch b/rpm-4.15.patch new file mode 100644 index 0000000..d4168ed --- /dev/null +++ b/rpm-4.15.patch @@ -0,0 +1,126 @@ +--- poldek-0.42.2/pm/rpmorg/signature.c.orig 2020-10-07 23:33:17.051835958 +0200 ++++ poldek-0.42.2/pm/rpmorg/signature.c 2020-10-07 23:34:10.408960665 +0200 +@@ -101,18 +101,18 @@ + case RPMSIGTAG_RSA: + case RPMSIGTAG_PGP5: /* XXX legacy */ + case RPMSIGTAG_PGP: +- flags |= VRFYSIG_SIGNPGP; ++ flags |= PKGVERIFY_PGP; + break; + + case RPMSIGTAG_DSA: + case RPMSIGTAG_GPG: +- flags |= VRFYSIG_SIGNGPG; ++ flags |= PKGVERIFY_GPG; + break; + + case RPMSIGTAG_LEMD5_2: + case RPMSIGTAG_LEMD5_1: + case RPMSIGTAG_MD5: +- flags |= VRFYSIG_DGST; ++ flags |= PKGVERIFY_MD; + break; + + default: +@@ -137,7 +137,7 @@ + int rc; + + +- n_assert(flags & (VRFYSIG_DGST | VRFYSIG_SIGN)); ++ n_assert(flags & (PKGVERIFY_MD | PKGVERIFY_GPG | PKGVERIFY_PGP)); + + if (!rpm_signatures(path, &presented_signs, NULL)) + return 0; +@@ -146,13 +146,13 @@ + char signam[255]; + int n = 0; + +- if (flags & VRFYSIG_DGST) ++ if (flags & PKGVERIFY_MD) + n += n_snprintf(&signam[n], sizeof(signam) - n, "digest/"); + +- if (flags & VRFYSIG_SIGNGPG) ++ if (flags & PKGVERIFY_GPG) + n += n_snprintf(&signam[n], sizeof(signam) - n, "gpg/"); + +- if (flags & VRFYSIG_SIGNPGP) ++ if (flags & PKGVERIFY_PGP) + n += n_snprintf(&signam[n], sizeof(signam) - n, "pgp/"); + + n_assert(n > 0); +@@ -163,29 +163,27 @@ + signam); + return 0; + } +- unsigned qva_flags = RPMVSF_DEFAULT; ++ unsigned vfyflags = RPMVSF_DEFAULT; + +- if ((flags & (VRFYSIG_SIGNPGP | VRFYSIG_SIGNGPG)) == 0) { +- qva_flags |= RPMVSF_MASK_NOSIGNATURES; ++ if ((flags & (PKGVERIFY_PGP | PKGVERIFY_GPG)) == 0) { ++ vfyflags |= RPMVSF_MASK_NOSIGNATURES; + } + + // always check digests - without them rpmVerifySignature returns error +- //if ((flags & VRFYSIG_DGST) == 0) +- // qva_flags |= RPMVSF_MASK_NODIGESTS; +- +- memset(&qva, '\0', sizeof(qva)); +- qva.qva_flags = qva_flags; ++ //if ((flags & PKGVERIFY_MD) == 0) ++ // vfyflags |= RPMVSF_MASK_NODIGESTS; + + rc = -1; + fdt = Fopen(path, "r.ufdio"); + + if (fdt != NULL && Ferror(fdt) == 0) { + ts = rpmtsCreate(); ++ rpmtsSetVfyFlags(ts, vfyflags); + rc = rpmVerifySignatures(&qva, ts, fdt, n_basenam(path)); + rpmtsFree(ts); + + DBGF("rpmVerifySignatures[md=%d, sign=%d] %s %s\n", +- flags & VRFYSIG_DGST ? 1:0, flags & VRFYSIG_SIGN ? 1:0, ++ flags & PKGVERIFY_MD ? 1:0, flags & (PKGVERIFY_GPG | PKGVERIFY_PGP) ? 1:0, + n_basenam(path), rc == 0 ? "OK" : "BAD"); + } + +@@ -196,24 +196,12 @@ + static + int do_pm_rpm_verify_signature(void *pm_rpm, const char *path, unsigned flags) + { +- unsigned rpmflags = 0; +- +- pm_rpm = pm_rpm; + if (access(path, R_OK) != 0) { + logn(LOGERR, "%s: verify signature failed: %m", path); + return 0; + } + +- if (flags & PKGVERIFY_GPG) +- rpmflags |= VRFYSIG_SIGNGPG; +- +- if (flags & PKGVERIFY_PGP) +- rpmflags |= VRFYSIG_SIGNPGP; +- +- if (flags & PKGVERIFY_MD) +- rpmflags |= VRFYSIG_DGST; +- +- return do_verify_signature(path, rpmflags); ++ return do_verify_signature(path, flags); + } + + extern int pm_rpm_verbose; +--- poldek-0.42.2/pm/rpmorg/pm_rpm.h.orig 2020-10-07 23:34:34.276110954 +0200 ++++ poldek-0.42.2/pm/rpmorg/pm_rpm.h 2020-10-07 23:34:40.173648478 +0200 +@@ -69,10 +69,6 @@ + struct poldek_ts *ts); + + #include +-#define VRFYSIG_DGST VERIFY_DIGEST +-#define VRFYSIG_SIGN VERIFY_SIGNATURE +-#define VRFYSIG_SIGNGPG VERIFY_SIGNATURE +-#define VRFYSIG_SIGNPGP VERIFY_SIGNATURE + + int pm_rpm_verify_signature(void *pm_rpm, const char *path, unsigned flags); + diff --git a/rpm4-uname-deps.patch b/rpm4-uname-deps.patch new file mode 100644 index 0000000..611c0ed --- /dev/null +++ b/rpm4-uname-deps.patch @@ -0,0 +1,12 @@ +--- poldek-0.42.2/pm/rpmorg/misc.c~ 2020-01-25 22:59:59.000000000 +0100 ++++ poldek-0.42.2/pm/rpmorg/misc.c 2020-10-22 08:56:32.637093626 +0200 +@@ -76,6 +76,9 @@ + int i; + rpmcap_fn functions[] = { + rpmdsRpmlib, ++#ifdef HAVE_RPMDSUNAME ++ (rpmcap_fn)rpmdsUname, ++#endif + NULL, + }; + -- 2.46.0