0_20-20'.
Sprout from master 2007-01-31 19:03:12 UTC Elan Ruusamäe <glen@pld-linux.org> '- hold = kernel* until "installonlypkgs" is not implemented;'
Cherrypick from master 2006-04-02 20:24:23 UTC Elan Ruusamäe <glen@pld-linux.org> '- bugfixes from mis':
poldek-bug-5774.patch -> 1.1
poldek-notimestamps.patch -> 1.1
poldek-obsoletes.patch -> 1.1
poldek-uninstall-multilib.patch -> 1.1
Cherrypick from AC-branch 2007-07-17 21:43:04 UTC Elan Ruusamäe <glen@pld-linux.org> '- fix for current autotools (inspired from poldek@cvs)':
poldek-ac.patch -> 1.1.2.1
poldek-completion.patch -> 1.1.2.1
Cherrypick from unlabeled-1.1.2 2007-06-14 22:43:48 UTC Arkadiusz Miśkiewicz <arekm@maven.pl> 'ignore cpuinfo() and uname() caps':
poldek-ignorecaps.patch -> 1.1.2.1
Cherrypick from unlabeled-1.1.2 2007-11-18 13:00:08 UTC Adam Gołębiowski <adamg@pld-linux.org> '- new':
poldek-nohold-fix.patch -> 1.1.2.1
Cherrypick from unlabeled-1.197.2.89.2 2007-11-22 17:43:04 UTC Elan Ruusamäe <glen@pld-linux.org> '- fixed multilib poldek conf; rel 20':
poldek.spec -> 1.197.2.89.2.6
Cherrypick from unlabeled-1.35.2 2007-11-14 19:21:56 UTC Elan Ruusamäe <glen@pld-linux.org> '- signed=yes for repos that are signed':
poldek.conf -> 1.35.2.22
Cherrypick from unlabeled-1.5.2 2007-11-22 17:41:55 UTC Elan Ruusamäe <glen@pld-linux.org> '- duplicate signed lines':
poldek-multilib.conf -> 1.5.2.9
Delete:
poldek-deprecated.patch
poldek-refcnt-overflow.patch
poldek-rpm_4_4_3.patch
--- /dev/null
+--- poldek-0.20/configure.in 2007-07-18 00:40:06.808430585 +0300
++++ poldek-0.21-cvs20070703.00/configure.in 2007-07-03 01:05:52.000000000 +0300
+@@ -58,11 +59,8 @@
+ AM_CFLAGS="-Wall -W"
+ AC_SUBST(AM_CFLAGS)
+
+-AM_PATH_CHECK(,[have_check="yes"],
+- [AC_MSG_WARN([check library not found; cannot run unit tests])
+- have_check="no"])
+-
+-
++PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check=yes, have_check=no)
++
+ dnl Process features.
+ AC_CHECK_LIB(tinfo, tigetstr,,[
+ AC_CHECK_LIB(ncurses, tigetstr, ,[
--- /dev/null
+===================================================================
+RCS file: /cvsroot/poldek/poldek/vfile/vfetch.c,v
+retrieving revision 1.13
+retrieving revision 1.14
+diff -u -r1.13 -r1.14
+--- poldek/poldek/vfile/vfetch.c 2005/05/15 15:47:00 1.13
++++ poldek/poldek/vfile/vfetch.c 2006/04/02 19:49:12 1.14
+@@ -11,7 +11,7 @@
+ */
+
+ /*
+- $Id$
++ $Id$
+ */
+ #ifdef HAVE_CONFIG_H
+ # include "config.h"
+@@ -299,7 +299,7 @@
+ snprintf(url, sizeof(url), req->url);
+ vf_request_free(req);
+ req = NULL;
+- rc = vf_fetch(req->url, destdir, flags, NULL);
++ rc = vf_fetch(url, destdir, flags, NULL);
+ }
+ }
+ if (req)
--- /dev/null
+===================================================================
+RCS file: /cvsroot/installer/poldek/cli/shell.c,v
+retrieving revision 1.27
+retrieving revision 1.28
+diff -u -r1.27 -r1.28
+--- installer/poldek/cli/shell.c 2005/11/06 19:26:27 1.27
++++ installer/poldek/cli/shell.c 2005/11/10 19:21:04 1.28
+@@ -76,13 +76,13 @@
+ struct pkg *ipkg = NULL;
+ tn_array *dents;
+ char name[256];
+- int n;
++ int n, name_len;
+
+ dents = poclidek_get_dent_ents(cctx, POCLIDEK_INSTALLEDDIR);
+ if (dents == NULL)
+ return 1;
+
+- snprintf(name, sizeof(name), "%s-", pkg->name);
++ name_len = snprintf(name, sizeof(name), "%s-", pkg->name);
+ n = n_array_bsearch_idx_ex(dents, name, (tn_fn_cmp)pkg_dent_strncmp);
+
+ if (n == -1)
+@@ -90,14 +90,15 @@
+
+ while (n < n_array_size(dents)) {
+ struct pkg_dent *ent = n_array_nth(dents, n++);
++
+ if (pkg_dent_isdir(ent))
+ continue;
++
++ if (strncmp(name, ent->name, name_len) != 0)
++ break;
+
+ ipkg = ent->pkg_dent_pkg;
+- if (strcmp(pkg->name, ipkg->name) != 0)
+- break;
+-
+- if (pkg_cmp_evr(pkg, ipkg) > 0)
++ if (strcmp(pkg->name, ipkg->name) == 0 && pkg_cmp_evr(pkg, ipkg) > 0)
+ return 1;
+
+ }
+++ /dev/null
---- poldek-0.20.1-cvs20060823.21/pm/rpm/misc.c~ 2006-07-10 13:17:36.000000000 +0200
-+++ poldek-0.20.1-cvs20060823.21/pm/rpm/misc.c 2006-10-30 16:19:12.548718000 +0100
-@@ -171,24 +171,25 @@
-
- int pm_rpm_machine_score(void *pm_rpm, int tag, const char *val)
- {
-- int rpmtag = 0;
--
- pm_rpm = pm_rpm;
- switch (tag) {
- case PMMSTAG_ARCH:
-- rpmtag = RPM_MACHTABLE_INSTARCH;
-+ return 1;
-+ // no longer supported, decided it was
-+ // not reliable enough
- break;
-
- case PMMSTAG_OS:
-- rpmtag = RPM_MACHTABLE_INSTOS;
-+ return 1;
-+ // no longer supported, always returned 1
-+ // as linux is the only ARCH supported
- break;
-
- default:
- n_assert(0);
- break;
- }
--
-- return rpmMachineScore(rpmtag, val);
-+ return 0;
- }
-
-
-@@ -197,6 +196,6 @@
- if (arch == NULL)
- return 0;
-
-- return rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch);
-+ return 1;
- }
-
---- poldek-0.20.1-cvs20060823.21/configure.in~ 2006-08-21 13:20:12.000000000 +0200
-+++ poldek-0.20.1-cvs20060823.21/configure.in 2006-10-30 16:17:00.008718000 +0100
-@@ -273,7 +273,7 @@
- [$DBLIB -lrpmdb]),
- [$DBLIB])
-
--AC_CHECK_FUNCS(rpmMachineScore,,[ AC_MSG_ERROR(["rpmlib not found"])])
-+#AC_CHECK_FUNCS(rpmMachineScore,,[ AC_MSG_ERROR(["rpmlib not found"])])
- AC_CHECK_FUNCS(rpmlog rpmCheckSig rpmVerifySignature)
-
- dnl rpm 4.2?
---- poldek-0.20.1-cvs20060823.21/pm/rpm/rpm.c~ 2006-08-22 16:53:28.000000000 +0200
-+++ poldek-0.20.1-cvs20060823.21/pm/rpm/rpm.c 2006-11-02 21:10:17.138247000 +0100
-@@ -402,7 +402,7 @@
- #endif /* HAVE_RPMLOG */
-
-
--extern int rpmvercmp(const char *one, const char *two);
-+extern int (*rpmvercmp)(const char *one, const char *two);
- int pm_rpm_vercmp(const char *one, const char *two)
- {
- return rpmvercmp(one, two);
---- poldek-0.20.1-cvs20060823.21/pm/rpm/rpmvercmp.c~ 2004-08-09 01:03:54.000000000 +0200
-+++ poldek-0.20.1-cvs20060823.21/pm/rpm/rpmvercmp.c 2006-11-02 21:15:35.218247000 +0100
-@@ -5,7 +5,7 @@
-
- #include "i18n.h"
-
--extern int rpmvercmp(const char * one, const char * two);
-+extern int (*rpmvercmp)(const char * one, const char * two);
-
-
- int main(int argc, char *argv[])
---- poldek-0.20.1-cvs20060823.21/pm/rpm/misc.c~ 2006-11-02 21:17:09.000000000 +0100
-+++ poldek-0.20.1-cvs20060823.21/pm/rpm/misc.c 2006-11-02 21:39:35.168247000 +0100
-@@ -166,7 +166,7 @@
- const char *pm_rpm_get_arch(void *pm_rpm)
- {
- pm_rpm = pm_rpm;
-- return rpmGetVar(RPM_MACHTABLE_INSTARCH);
-+ return rpmExpand("%{_target_cpu}", NULL);
- }
-
- int pm_rpm_machine_score(void *pm_rpm, int tag, const char *val)
--- /dev/null
+diff -urN poldek-0.20.org/pkgset-req.c poldek-0.20/pkgset-req.c
+--- poldek-0.20.org/pkgset-req.c 2005-10-20 19:27:27.000000000 +0200
++++ poldek-0.20/pkgset-req.c 2007-06-15 00:42:42.499942887 +0200
+@@ -332,6 +332,9 @@
+ n_assert(0);
+ */
+
++ if (strncmp("cpuinfo(", capreq_name(req), sizeof("cpuinfo(")-1) == 0 || strncmp("uname(", capreq_name(req), sizeof("uname(")-1) == 0)
++ matched = 1;
++
+ if (capreq_is_rpmlib(req)) {
+ if (matched) {
+ int i;
-# Alternative multilib PLD 3.0 (Th)
+# $Id$
+# PLD Linux Distribution <http://www.pld-linux.org/>.
+#
+# Alternative multilib sources for PLD Linux 2.0 (Ac)
+
_pld_arch = %ARCH%
-_pld_prefix = ftp://ftp.th.pld-linux.org/dists/th
+_pld_main_prefix = ftp://ftp.ac.pld-linux.org/dists/ac
+
## Some mirrors
## You can use them if you have better connection there
# CI TASK:
-#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/th
+#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/ac
+_pld_prefix = %{_pld_main_prefix}
-_th_idxtype = pndir
+_ac_idxtype = pndir
[source]
-type = %{_th_idxtype}
-name = th-%{_pld_arch}
+type = %{_ac_idxtype}
+name = ac-%{_pld_arch}
path = %{_pld_prefix}/PLD/%{_pld_arch}/PLD/RPMS/
+ignore = kernel*
+signed = yes
auto = no
-autoup = no
+autoup = yes
+pri = 2
[source]
-type = %{_th_idxtype}
-name = th-updates-security-%{_pld_arch}
-path = %{_pld_prefix}/updates/security/%{_pld_arch}/
+type = %{_ac_idxtype}
+name = ac-updates-%{_pld_arch}
+path = %{_pld_prefix}/updates/%{_pld_arch}/
+ignore = kernel*
+signed = yes
auto = no
-autoup = no
+autoup = yes
+pri = 2
[source]
-type = %{_th_idxtype}
-name = th-updates-general-%{_pld_arch}
-path = %{_pld_prefix}/updates/general/%{_pld_arch}/
+type = %{_ac_idxtype}
+name = ac-supported-%{_pld_arch}
+path = %{_pld_prefix}/supported/%{_pld_arch}/
+ignore = kernel*
+signed = yes
auto = no
autoup = no
[source]
-type = %{_th_idxtype}
-name = th-supported-%{_pld_arch}
-path = %{_pld_prefix}/supported/%{_pld_arch}/
+type = %{_ac_idxtype}
+name = ac-ready-%{_pld_arch}
+path = %{_pld_main_prefix}/ready/%{_pld_arch}/
+#signed = yes
auto = no
autoup = no
[source]
-type = %{_th_idxtype}
-name = th-ready-%{_pld_arch}
-path = %{_pld_prefix}/ready/%{_pld_arch}/
+type = %{_ac_idxtype}
+name = ac-test-%{_pld_arch}
+path = %{_pld_main_prefix}/test/%{_pld_arch}/
auto = no
autoup = no
+# alias ac-updates-ARCH as ac-ARCH-updates
[source]
-type = %{_th_idxtype}
-name = th-test-%{_pld_arch}
-path = %{_pld_prefix}/test/%{_pld_arch}/
-auto = no
-autoup = no
+type = group
+name = ac-%{_pld_arch}-updates
+sources = ac-updates-%{_pld_arch}
+
+# alias ac-ready-ARCH as ac-ARCH-ready
+[source]
+type = group
+name = ac-%{_pld_arch}-ready
+sources = ac-ready-%{_pld_arch}
--- /dev/null
+diff -urN poldek/cli/install.c poldek.new/cli/install.c
+--- poldek/cli/install.c 2007-07-01 23:04:26.000000000 +0200
++++ poldek.new/cli/install.c 2007-11-17 18:19:06.000000000 +0100
+@@ -174,6 +174,9 @@
+ {"hold", OPT_INST_HOLD, "PACKAGE[,PACKAGE]...", 0,
+ N_("Prevent packages listed from being upgraded if they are already installed."),
+ OPT_GID },
++
++{"nohold", OPT_INST_NOHOLD, 0, 0,
++ N_("Do not hold any packages. Disables --hold settings."), OPT_GID },
+
+ {"ignore", OPT_INST_IGNORE, "PACKAGE[,PACKAGE]...", 0,
+ N_("Make packages listed invisible."), OPT_GID },
+@@ -323,17 +326,21 @@
+ poldek_configure(ts->ctx, POLDEK_CONF_ROOTDIR, arg);
+ break;
+
+-
+ case OPT_INST_HOLD:
+ poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_HOLD, 1);
+ poldek_configure(ts->ctx, POLDEK_CONF_HOLD, arg);
+ break;
+-
++
++ case OPT_INST_NOHOLD:
++ ts->setop(ts, POLDEK_OP_HOLD, 0);
++ poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_HOLD, 0);
++ break;
++
+ case OPT_INST_IGNORE:
+ poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_IGNORE, 1);
+ poldek_configure(ts->ctx, POLDEK_CONF_IGNORE, arg);
+ break;
+-
++
+ case OPT_INST_NOIGNORE:
+ ts->setop(ts, POLDEK_OP_IGNORE, 0);
+ poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_IGNORE, 0);
--- /dev/null
+--- poldek-0.20/pkgdir/pdir/pdir_pkg_store.c.orig 2005-10-13 20:24:50.000000000 +0200
++++ poldek-0.20/pkgdir/pdir/pdir_pkg_store.c 2005-11-30 12:41:46.000000000 +0100
+@@ -132,7 +132,7 @@
+ if (pkg->fn)
+ n_buf_printf(nbuf, "n: %s\n", pkg->fn);
+
+- if (pkg->fmtime)
++ if (((flags & PKGSTORE_NOTIMESTAMP) == 0) && pkg->fmtime)
+ n_buf_printf(nbuf, "t: %u\n", pkg->fmtime);
+
+ n_buf_printf(nbuf, "F:\n");
+--- poldek-0.20/cli/op_makeidx.c.orig 2005-10-10 00:35:28.000000000 +0200
++++ poldek-0.20/cli/op_makeidx.c 2005-11-30 12:52:31.000000000 +0100
+@@ -45,6 +45,7 @@
+ #define OPT_TYPE_ALIAS (OPT_GID + 11) /* XXX argp bug? with +8 this doesn't work... */
+ #define OPT_NODIFF (OPT_GID + 9)
+ #define OPT_MOPT (OPT_GID + 10)
++#define OPT_NOTIMESTAMP (OPT_GID + 12)
+
+ /* The options we understand. */
+ static struct argp_option options[] = {
+@@ -79,6 +80,10 @@
+
+ {"mo", OPT_MOPT, "OPTION[,OPTION]", OPTION_HIDDEN, /* not finished yet */
+ N_("index type specific options"), OPT_GID },
++
++{"notimestamp", OPT_NOTIMESTAMP, 0, 0,
++ N_("Don't put package timestamps into created pdir index (poldek 0.18.x compat)."), OPT_GID },
++
+ { 0, 0, 0, 0, 0, 0 },
+
+
+@@ -176,6 +181,10 @@
+ poclidek_op_source_nodesc = 1;
+ break;
+
++ case OPT_NOTIMESTAMP:
++ arg_s->crflags |= PKGDIR_CREAT_v018x;
++ break;
++
+ case OPT_NODIFF:
+ arg_s->crflags |= PKGDIR_CREAT_NOPATCH;
+ break;
--- /dev/null
+Index: pkgset-install.c
+===================================================================
+RCS file: /cvsroot/installer/poldek/pkgset-install.c,v
+retrieving revision 1.149
+diff -u -r1.149 pkgset-install.c
+--- pkgset-install.c 3 Nov 2005 00:21:00 -0000 1.149
++++ pkgset-install.c 21 Nov 2005 20:42:04 -0000
+@@ -126,6 +126,13 @@
+ static int marked_for_removal(struct pkg *pkg, struct upgrade_s *upg);
+
+
++#define mark_package(a, b) do_mark_package(a, b, PKGMARK_MARK);
++
++static int do_mark_package(struct pkg *pkg, struct upgrade_s *upg,
++ unsigned mark);
++
++
++
+ /* anyone of pkgs is marked? */
+ static inline int one_is_marked(struct pkgmark_set *pms, struct pkg *pkgs[],
+ int npkgs)
+@@ -226,6 +233,30 @@
+ return install;
+ }
+
++static
++struct pkg *installset_obsoletes(const struct pkg *pkg, struct pkgset *ps,
++ struct upgrade_s *upg)
++{
++ tn_array *pkgs;
++ int i;
++
++ pkgs = pkgset_search(ps, PS_SEARCH_OBSL, pkg->name);
++ DBGF("%s => found %d packages\n", pkg->name, pkgs ? n_array_size(pkgs) : 0);
++ if (pkgs == NULL)
++ return NULL;
++
++ for (i=0; i<n_array_size(pkgs); i++) {
++ struct pkg *pkg = n_array_nth(pkgs, i);
++
++ if (pkg_is_marked_i(upg->ts->pms, pkg))
++ mark_package(pkg, upg);
++
++ if (pkg_is_marked(upg->ts->pms, pkg))
++ return pkg;
++ }
++ return NULL;
++}
++
+
+ /* looks into Obsoletes only */
+ static
+@@ -235,14 +266,21 @@
+ struct pkg *bypkg = NULL;
+ tn_array *pkgs;
+ int i, best_i;
+-
+- if ((pkgs = pkgset_search(ps, PS_SEARCH_CAP, pkg->name)) == NULL)
++
++ pkgs = pkgset_search(ps, PS_SEARCH_CAP, pkg->name);
++ if (pkgs == NULL) {
++ DBGF("%s => found 0 packages\n");
+ return NULL;
++ }
++
+
+ best_i = select_best_pkg(pkg, pkgs, ps, upg);
++ DBGF("%s => found %d packages, best=%d\n", pkg->name, n_array_size(pkgs),
++ best_i);
++
+ for (i=best_i; i < n_array_size(pkgs); i++) {
+ struct pkg *p = n_array_nth(pkgs, i);
+-
++
+ if (strcmp(pkg->name, p->name) == 0)
+ continue;
+
+@@ -264,6 +302,8 @@
+ return bypkg;
+ }
+
++
++
+ static
+ int other_version_marked(struct pkgmark_set *pms, struct pkg *pkg,
+ tn_array *pkgs, struct capreq *req)
+@@ -605,8 +645,6 @@
+
+
+
+-#define mark_package(a, b) do_mark_package(a, b, PKGMARK_MARK);
+-
+ static int do_mark_package(struct pkg *pkg, struct upgrade_s *upg,
+ unsigned mark)
+ {
+@@ -1146,8 +1184,11 @@
+ p = select_pkg(pkg->name, ps->pkgs, upg);
+ if ((p == NULL || pkg_cmp_evr(p, pkg) == 0) &&
+ upg->ts->getop(upg->ts, POLDEK_OP_OBSOLETES)) {
+- p = select_supersede_pkg(pkg, ps, upg);
+- *by_obsoletes = 1;
++ if ((p = installset_obsoletes(pkg, ps, upg)) == NULL)
++ p = select_supersede_pkg(pkg, ps, upg);
++
++ if (p)
++ *by_obsoletes = 1;
+ }
+ return p;
+ }
+++ /dev/null
-Index: pkgmark.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/pkgmark.c,v
-retrieving revision 1.7
-diff -u -r1.7 pkgmark.c
---- pkgmark.c 12 Jun 2005 20:17:13 -0000 1.7
-+++ pkgmark.c 11 Sep 2006 21:35:51 -0000
-@@ -145,6 +145,7 @@
- const char *id;
-
- id = package_id(idbuf, sizeof(idbuf), pmark, pkg);
-+ n_assert(id);
-
- if ((pkg_mark = n_hash_get(pmark->ht, id)))
- return pkg_mark->flags & flag;
-Index: pkg.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/pkg.c,v
-retrieving revision 1.111
-diff -u -r1.111 pkg.c
---- pkg.c 20 Aug 2006 21:13:19 -0000 1.111
-+++ pkg.c 11 Sep 2006 21:35:53 -0000
-@@ -1380,7 +1380,8 @@
- pkg->na ? pkg->na->_refcnt : -1,
- pkg->_refcnt, &pkg->_refcnt);
- }
--#endif
-+#endif
-+ n_assert(pkg->_refcnt < INT16_MAX - 1);
- pkg->_refcnt++;
- return pkg;
- }
-Index: pkgset-req.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/pkgset-req.c,v
-retrieving revision 1.45
-diff -u -r1.45 pkgset-req.c
---- pkgset-req.c 20 Aug 2006 21:13:19 -0000 1.45
-+++ pkgset-req.c 11 Sep 2006 21:35:54 -0000
-@@ -332,13 +332,24 @@
- } else { /* n is 0 */
- tn_array *pkgs;
- if ((pkgs = pkgset_search_reqdir(ps, NULL, reqname))) {
-+ int i;
- n = 0;
-+
-+ for (i=0; i < n_array_size(pkgs); i++) {
-+ pkgsbuf[n++] = n_array_nth(pkgs, i);
-+ if (n == pkgsbuf_size)
-+ break;
-+ }
-+
-+/* XXX: TOFIX: pkgsbuf is not free()d by caller, so pkg _refcnts must
-+ be decreased here */
-+#if 0
- while (n_array_size(pkgs)) {
- pkgsbuf[n++] = n_array_shift(pkgs);
- if (n == pkgsbuf_size)
- break;
- }
--
-+#endif
- *npkgs = n;
- if (n) {
- matched = 1;
+++ /dev/null
-Index: pm/rpm/misc.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pm/rpm/misc.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- pm/rpm/misc.c 12 May 2005 15:44:41 -0000 1.4
-+++ pm/rpm/misc.c 21 Nov 2005 17:01:34 -0000 1.5
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -23,6 +23,9 @@
- #include <string.h>
-
- #include <rpm/rpmlib.h>
-+#if HAVE_RPMDSRPMLIB
-+# include <rpm/rpmds.h>
-+#endif
-
- #include <trurl/nassert.h>
- #include <trurl/nstr.h>
-@@ -33,21 +36,49 @@
- #include "log.h"
- #include "pm/pm.h"
-
--tn_array *pm_rpm_rpmlib_caps(void)
-+#if HAVE_RPMDSRPMLIB /* rpmdsRpmlib() => rpm >= 4.4.3 */
-+static int get_rpmlib_caps(tn_array *caps)
-+{
-+ rpmds ds = NULL;
-+
-+ if (rpmdsRpmlib(&ds, NULL) != 0)
-+ return 0;
-+
-+ ds = rpmdsInit(ds);
-+ while (rpmdsNext(ds) >= 0) {
-+ const char *name, *evr;
-+ char tmp[256];
-+ struct capreq *cr;
-+ uint32_t flags;
-+
-+ name = rpmdsN(ds);
-+ evr = rpmdsEVR(ds);
-+ flags = rpmdsFlags(ds);
-+
-+ n_assert(flags & RPMSENSE_EQUAL);
-+ n_assert((flags & (RPMSENSE_LESS | RPMSENSE_GREATER)) == 0);
-+
-+ n_strncpy(tmp, evr, 128);
-+ cr = capreq_new_evr(name, tmp, REL_EQ, 0);
-+ if (cr)
-+ n_array_push(caps, cr);
-+ }
-+ ds = rpmdsFree(ds);
-+ return n_array_size(caps);
-+}
-+#endif /* HAVE_RPMDSRPMLIB */
-+
-+#if HAVE_RPMGETRPMLIBPROVIDES /* rpmGetRpmlibProvides() => rpm < 4.4.3 */
-+static int get_rpmlib_caps_rpm_lt_4_4_3(tn_array *caps)
- {
- char **names = NULL, **versions = NULL, *evr;
- int *flags = NULL, n = 0, i;
-- tn_array *caps;
--
--#if HAVE_RPMGETRPMLIBPROVIDES
-+
- n = rpmGetRpmlibProvides((const char ***)&names, &flags, (const char ***)&versions);
--#endif
--
- if (n <= 0)
-- return NULL;
-+ return 0;
-
- caps = capreq_arr_new(0);
--
- evr = alloca(128);
-
- for (i=0; i<n; i++) {
-@@ -62,19 +93,39 @@
- n_array_push(caps, cr);
- }
-
-- if (names)
-- free(names);
--
-- if (flags)
-- free(flags);
-+ n_cfree(&names);
-+ n_cfree(&flags);
-+ n_cfree(&versions);
-+ return 1;
-+}
-+#endif
-
-- if (versions)
-- free(versions);
-+tn_array *pm_rpm_rpmlib_caps(void)
-+{
-+ tn_array *caps;
-+ int rc = 0;
-+
-+ caps = capreq_arr_new(0);
-
-- n_array_sort(caps);
-+#if HAVE_RPMDSRPMLIB /* rpm >= 4.4.3 */
-+ rc = get_rpmlib_caps(caps);
-+#else
-+# if HAVE_RPMGETRPMLIBPROVIDES
-+ rc = get_rpmlib_caps_rpm_lt_4_4_3(caps);
-+# endif
-+#endif
-+
-+ if (rc) {
-+ n_array_sort(caps);
-+
-+ } else {
-+ n_array_free(caps);
-+ caps = NULL;
-+ }
- return caps;
- }
-
-+
- const char *pm_rpm_get_arch(void *pm_rpm)
- {
- pm_rpm = pm_rpm;
-Index: pm/rpm/pm_rpm.h
-===================================================================
-RCS file: /cvsroot/installer/poldek/pm/rpm/pm_rpm.h,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- pm/rpm/pm_rpm.h 24 Oct 2005 15:25:58 -0000 1.11
-+++ pm/rpm/pm_rpm.h 21 Nov 2005 17:01:34 -0000 1.12
-@@ -10,6 +10,14 @@
- # include <rpm/rpmts.h>
- #endif
-
-+/* RPMTAG_COPYRIGHT disappears in 4.4.3 but don't know from
-+ when RPMTAG_LICENSE starts */
-+#ifdef RPMTAG_COPYRIGHT
-+# define PM_RPMTAG_LICENSE RPMTAG_COPYRIGHT
-+#else
-+# define PM_RPMTAG_LICENSE RPMTAG_LICENSE
-+#endif
-+
- #include <trurl/trurl.h>
- #include "poldek.h"
- #include "pm/pm.h"
-Index: pkgu.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pkgu.c,v
-retrieving revision 1.30
-retrieving revision 1.31
-diff -u -r1.30 -r1.31
---- pkgu.c 18 Oct 2005 16:25:12 -0000 1.30
-+++ pkgu.c 21 Nov 2005 17:01:34 -0000 1.31
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -337,7 +337,7 @@
- }
-
- pkgu->vendor = cp_tag(pkgu->_na, h, RPMTAG_VENDOR);
-- pkgu->license = cp_tag(pkgu->_na, h, RPMTAG_COPYRIGHT);
-+ pkgu->license = cp_tag(pkgu->_na, h, PM_RPMTAG_LICENSE);
- pkgu->url = cp_tag(pkgu->_na, h, RPMTAG_URL);
- pkgu->distro = cp_tag(pkgu->_na, h, RPMTAG_DISTRIBUTION);
- pkgu->buildhost = cp_tag(pkgu->_na, h, RPMTAG_BUILDHOST);
-@@ -370,7 +370,7 @@
- headerAddEntry(hdr, RPMTAG_VENDOR, RPM_STRING_TYPE, pkgu->vendor, 1);
-
- if (pkgu->license)
-- headerAddEntry(hdr, RPMTAG_COPYRIGHT, RPM_STRING_TYPE, pkgu->license, 1);
-+ headerAddEntry(hdr, PM_RPMTAG_LICENSE, RPM_STRING_TYPE, pkgu->license, 1);
-
- if (pkgu->url)
- headerAddEntry(hdr, RPMTAG_URL, RPM_STRING_TYPE, pkgu->url, 1);
-Index: configure.in
-===================================================================
-RCS file: /cvsroot/installer/poldek/configure.in,v
-retrieving revision 1.121
-retrieving revision 1.122
-diff -u -r1.121 -r1.122
---- configure.in 4 Nov 2005 17:44:21 -0000 1.121
-+++ configure.in 21 Nov 2005 17:01:34 -0000 1.122
-@@ -293,9 +293,10 @@
- LIBS="$LIBS -lbz2 -lrpmio"
- fi
-
--AC_CHECK_FUNCS(rpmGetRpmlibProvides,,
-- [AC_MSG_WARN("[poldek will not work fine with rpmlib\(...\) capabilities"])],
-- [$CONF_IN_LDFLAGS])
-+AC_CHECK_FUNCS(rpmdsRpmlib,,
-+ [ AC_CHECK_FUNCS(rpmGetRpmlibProvides,,
-+ [AC_MSG_WARN(["poldek will not work fine with rpmlib\(...\) capabilities"])],
-+ [$CONF_IN_LDFLAGS])], [$CONF_IN_LDFLAGS])
-
-
- dnl metadata & xml2
--- /dev/null
+Index: arg_packages.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/arg_packages.c,v
+retrieving revision 1.24
+retrieving revision 1.25
+diff -u -r1.24 -r1.25
+--- arg_packages.c 7 Jan 2006 01:13:20 -0000 1.24
++++ arg_packages.c 2 Apr 2006 19:10:36 -0000 1.25
+@@ -42,6 +42,8 @@
+ #include "pkgset.h"
+ #include "pm/pm.h"
+
++extern int poldek_conf_MULTILIB;
++
+ #define ARG_PACKAGES_SETUPDONE (1 << 0)
+
+ /* @VIRTUAL [DEFAULT_MASK [EVR]] */
+@@ -227,36 +229,6 @@
+ // n_hash_size(aps->resolved_caps);
+ }
+
+-#if 0 /* XXX: disabled, #5702 */
+-/* tries to convert N-[E:]V-R to N#[E:]V-R */
+-static char *mask2evrhashedmask(const char *mask)
+-{
+- const char *name, *ver, *rel, *p;
+- char nmask[1024], e[32] = "", *tmp;
+- int32_t epoch = 0;
+- int n;
+-
+- n_strdupap(mask, &tmp);
+- if (!poldek_util_parse_nevr(tmp, &name, &epoch, &ver, &rel))
+- return NULL;
+-
+- p = ver; /* check if it is really version */
+- while (*p) {
+- if (isdigit(*p))
+- break;
+- p++;
+- }
+-
+- if (*p == '\0') /* no digits => part of name propably */
+- return NULL;
+-
+- if (epoch)
+- snprintf(e, sizeof(e), "%d:", epoch);
+- n = n_snprintf(nmask, sizeof(nmask), "%s#%s%s-%s", name, e, ver, rel);
+- return n_strdupl(nmask, n);
+-}
+-#endif
+-
+ tn_array *arg_packages_get_masks(struct arg_packages *aps, int hashed)
+ {
+ tn_array *masks;
+@@ -264,19 +236,11 @@
+
+ masks = n_array_clone(aps->package_masks);
+ for (i=0; i < n_array_size(aps->package_masks); i++) {
+- const char *mask;
+-
+- mask = n_array_nth(aps->package_masks, i);
+- if (hashed && strchr(mask, '-') && strchr(mask, '*') == NULL) {
+-#if 0 /* XXX: disabled so smart NEVR parsing, #5702 */
+- char *nmask;
+- if ((nmask = mask2evrhashedmask(mask)))
+- mask = nmask;
+-#endif
+- }
++ const char *mask = n_array_nth(aps->package_masks, i);
+ n_array_push(masks, n_strdup(mask));
+ }
+-
++
++ hashed = 0; /* disabled for a while */
+ for (i=0; i < n_array_size(aps->packages); i++) {
+ struct pkg *pkg = n_array_nth(aps->packages, i);
+ char mask[1024], e[32] = "";
+@@ -284,9 +248,13 @@
+
+ if (pkg->epoch)
+ snprintf(e, sizeof(e), "%d:", pkg->epoch);
+-
++
+ n = n_snprintf(mask, sizeof(mask), "%s%s%s%s-%s", pkg->name,
+- hashed ? "#" : "-", e, pkg->ver, pkg->rel);
++ hashed ? "#" : "-", e, pkg->ver, pkg->rel);
++
++ if (0 && poldek_conf_MULTILIB && pkg_arch(pkg))
++ n += n_snprintf(&mask[n], sizeof(mask) - n, ".%s", pkg_arch(pkg));
++
+ n_array_push(masks, n_strdupl(mask, n));
+ }
+
+Index: uninstall.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/uninstall.c,v
+retrieving revision 1.39
+retrieving revision 1.40
+diff -u -r1.39 -r1.40
+--- uninstall.c 18 Mar 2006 17:03:48 -0000 1.39
++++ uninstall.c 2 Apr 2006 19:10:36 -0000 1.40
+@@ -227,6 +227,7 @@
+ MEMINF("START");
+ DBGF("%s\n", pkg_id(pkg));
+
++ msg_i(3, indent, "%s\n", pkg_id(pkg));
+ for (i=0; i < n_array_size(pkg->reqs); i++) {
+ struct capreq *req = n_array_nth(pkg->reqs, i);
+
+@@ -235,7 +236,7 @@
+
+ DBGF("req %s\n", capreq_snprintf_s(req));
+
+- if (pkg_satisfies_req(pkg, req, 1)) { /* self match, should be handled
++ if (pkg_satisfies_req(pkg, req, 1)) { /* XXX: self match, should be handled
+ at lower level; TOFIX */
+ DBGF("%s: satisfied by itself\n", capreq_snprintf_s(req));
+
+@@ -243,7 +244,7 @@
+ uctx->uninst_set->dbpkgs)) {
+
+ DBGF("%s: satisfied by db\n", capreq_snprintf_s(req));
+- msg_i(3, indent, "%s: satisfied by db\n", capreq_snprintf_s(req));
++ msg_i(3, indent, " %s: satisfied by db\n", capreq_snprintf_s(req));
+
+ } else if (!uctx->ts->getop(uctx->ts, POLDEK_OP_FOLLOW)) {
+ logn(LOGERR, _("%s (cap %s) is required by %s"),
+@@ -402,7 +403,8 @@
+
+ static
+ int do_resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
+- const char *mask, const struct capreq *cr)
++ const char *mask, const struct capreq *cr,
++ const char *arch)
+ {
+ tn_array *dbpkgs;
+ int i, nmatches = 0;
+@@ -446,6 +448,12 @@
+ pkg_evr_match_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
+ matched = 1;
+ }
++
++ if (matched && arch) {
++ const char *dbarch = pkg_arch(dbpkg);
++ matched = n_str_eq(arch, dbarch ? dbarch : "none");
++ }
++
+ }
+
+ if (matched) {
+@@ -459,7 +467,7 @@
+ }
+
+ static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
+- const char *mask)
++ const char *mask, const char *arch)
+ {
+ char *p;
+ struct capreq *cr, *cr_evr;
+@@ -491,7 +499,7 @@
+ }
+ }
+
+- if (do_resolve_package(uctx, ts, mask, cr))
++ if (do_resolve_package(uctx, ts, mask, cr, arch))
+ resolved = 1;
+
+ if (cr_evr)
+@@ -500,6 +508,58 @@
+ return resolved;
+ }
+
++static int resolve_mask(struct uninstall_ctx *uctx, struct poldek_ts *ts,
++ const char *mask)
++{
++ char *p, *tmp;
++ const char *n, *v, *r;
++ char nmask[256];
++ int32_t e = 0;
++ int matched = 0;
++
++ msgn(2, "Trying %s\n", mask);
++ if (resolve_package(uctx, ts, mask, NULL))
++ return 1;
++
++ if ((p = strchr(mask, '-')) == NULL) /* try N-[E:]V */
++ return 0;
++
++ /* try N-[E:]V-R */
++ n_strdupap(mask, &tmp);
++ p = strrchr(tmp, '-');
++ *p = '#';
++
++ msgn(2, " Trying %s\n", tmp);
++
++ if (resolve_package(uctx, ts, tmp, NULL))
++ return 1;
++
++ n_strdupap(mask, &tmp);
++ if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
++ if (e)
++ n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
++ else
++ n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
++
++ msgn(2, " Trying %s\n", nmask);
++ DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
++ matched = resolve_package(uctx, ts, nmask, NULL);
++
++ if (!matched && (p = strchr(r, '.'))) { /* try N-[E:]-V-R.ARCH */
++ *p = '\0';
++ p++;
++
++ if (e)
++ n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
++ else
++ n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
++ msgn(2, " Trying %s (arch=%s)\n", nmask, p);
++ matched = resolve_package(uctx, ts, nmask, p);
++ }
++ }
++
++ return matched;
++}
+
+ static int resolve_packages(struct uninstall_ctx *uctx, struct poldek_ts *ts)
+ {
+@@ -509,51 +569,11 @@
+ masks = poldek_ts_get_args_asmasks(ts, 1);
+
+ for (i=0; i < n_array_size(masks); i++) {
+- char *mask = n_array_nth(masks, i);
+- int matched = 0;
+-
+- msgn(2, "Trying %s\n", mask);
+- if (resolve_package(uctx, ts, mask)) {
+- matched = 1;
+-
+- } else {
+- char *p;
+-
+- if ((p = strchr(mask, '-'))) { /* try N-[E:]V */
+- char *tmp;
+- n_strdupap(mask, &tmp);
+-
+- p = strrchr(tmp, '-');
+- *p = '#';
++ char *mask = n_array_nth(masks, i);
+
+- msgn(2, " Trying %s\n", tmp);
+-
+- if (resolve_package(uctx, ts, tmp)) {
+- matched = 1;
+-
+- } else { /* try N-[E:]V-R */
+- const char *n, *v, *r;
+- char nmask[256];
+- int32_t e = 0;
+-
+- n_strdupap(mask, &tmp);
+- if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
+- if (e)
+- n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
+- else
+- n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
+-
+- msgn(2, " Trying %s\n", nmask);
+- DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
+- matched = resolve_package(uctx, ts, nmask);
+- }
+- }
+- }
+-
+- if (!matched) {
+- logn(LOGERR, _("%s: no such package"), mask);
+- nerr++;
+- }
++ if (!resolve_mask(uctx, ts, mask)) {
++ logn(LOGERR, _("%s: no such package"), mask);
++ nerr++;
+ }
+ }
+
+# $Id$
# PLD Linux Distribution <http://www.pld-linux.org/>.
+#
+# Main sources for PLD Linux 2.0 (Ac)
+# specify our packages architecture
_pld_arch = %ARCH%
-_pld_prefix = ftp://ftp.th.pld-linux.org/dists/th
+
+# main PLD-site for often changed things:
+_pld_main_prefix = ftp://ftp.ac.pld-linux.org/dists/ac
+
## Some mirrors
## You can use them if you have better connection there
# CI TASK:
-#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/th
-
-_th_idxtype = pndir
-
-# PLD 3.0 (Th)
-[source]
-type = %{_th_idxtype}
-name = th
-path = %{_pld_prefix}/PLD/%{_pld_arch}/RPMS/
-
-[source]
-type = %{_th_idxtype}
-name = th
-path = %{_pld_prefix}/PLD/noarch/RPMS/
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-security
-path = %{_pld_prefix}/updates-security/%{_pld_arch}/RPMS/
+#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/ac
+_pld_prefix = %{_pld_main_prefix}
-[source]
-type = %{_th_idxtype}
-name = th-updates-security
-path = %{_pld_prefix}/updates-security/noarch/RPMS/
+_ac_idxtype = pndir
+# PLD 2.0 (Ac)
[source]
-type = %{_th_idxtype}
-name = th-updates-general
-path = %{_pld_prefix}/updates-general/%{_pld_arch}/RPMS/
-auto = no
+type = %{_ac_idxtype}
+name = ac
+path = %{_pld_prefix}/PLD/%{_pld_arch}/PLD/RPMS/
+signed = yes
+# buggy deps -- use one from updates instead
+ignore = msmtp-sendmail*
+pri = 1
[source]
-type = %{_th_idxtype}
-name = th-updates-general
-path = %{_pld_prefix}/updates-general/noarch/RPMS/
-auto = no
-
-#[source]
-#type = %{_th_idxtype}
-#name = th-supported
-#path = %{_pld_prefix}/supported/%{_pld_arch}/
-#auto = no
+type = %{_ac_idxtype}
+name = ac-updates
+path = %{_pld_prefix}/updates/%{_pld_arch}/
+signed = yes
+pri = 1
[source]
-type = %{_th_idxtype}
-name = th-ready
-path = %{_pld_prefix}/ready/%{_pld_arch}/RPMS/
+type = %{_ac_idxtype}
+name = ac-supported
+path = %{_pld_prefix}/supported/%{_pld_arch}/
+signed = yes
auto = no
autoup = no
[source]
-type = %{_th_idxtype}
-name = th-ready
-path = %{_pld_prefix}/ready/noarch/RPMS/
+type = %{_ac_idxtype}
+name = ac-ready
+path = %{_pld_main_prefix}/ready/%{_pld_arch}/
+#signed = yes
auto = no
autoup = no
[source]
-type = %{_th_idxtype}
-name = th-test
-path = %{_pld_prefix}/test/%{_pld_arch}/RPMS/
+type = %{_ac_idxtype}
+name = ac-test
+path = %{_pld_main_prefix}/test/%{_pld_arch}/
auto = no
autoup = no
-
-[source]
-type = %{_th_idxtype}
-name = th-test
-path = %{_pld_prefix}/test/noarch/RPMS/
-auto = no
-autoup = no
-
+# TODO
+# - python bindings need some patch :)
#
# 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
#
+%ifarch %{x8664} alpha ppc
+%undefine with_python
+%endif
+#
# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-%define ver_db 4.3.27-1
-%define ver_rpm 4.4.7
-%define snap 20070108.22
+%define ver_db 4.2.50-1
+%define ver_rpm 4.4.1
Summary: RPM packages management helper tool
Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
Name: poldek
-Version: 0.20.1
-Release: 0.20070108.1.2
+Version: 0.20
+Release: 20
License: GPL v2
Group: Applications/System
-Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
-# Source0-md5: 47025233d8ebb7082567cbf1392cf16f
+Source0: http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
+# Source0-md5: 61c0c03ee4a9de36339fc943b6901266
Source1: %{name}.conf
Source2: %{name}-multilib.conf
Source3: %{name}-aliases.conf
-Patch1: %{name}-vserver-packages.patch
-Patch2: %{name}-config.patch
-Patch3: %{name}-multilib.patch
+Patch0: %{name}-cvs-fixes.patch
+Patch1: %{name}-ask-abort.patch
+Patch2: %{name}-obsoletes.patch
+Patch3: %{name}-completion.patch
+Patch4: %{name}-notimestamps.patch
+Patch5: %{name}-config.patch
+Patch6: %{name}-uninstall-multilib.patch
+Patch7: %{name}-bug-5774.patch
+Patch8: %{name}-cli-hist.patch
+Patch9: %{name}-vserver-packages.patch
+Patch10: %{name}-multilib.patch
+Patch11: %{name}-as_needed-fix.patch
+Patch12: %{name}-ignorecaps.patch
+Patch13: %{name}-ac.patch
+Patch14: %{name}-nohold-fix.patch
URL: http://poldek.pld-linux.org/
BuildRequires: autoconf
BuildRequires: automake
%{?with_python:BuildRequires: python-devel}
BuildRequires: readline-devel >= 5.0
BuildRequires: rpm-devel >= %{ver_rpm}
-BuildRequires: xmlto
+BuildRequires: sed >= 4.0
BuildRequires: zlib-devel
%if %{with static}
BuildRequires: bzip2-static
Requires(triggerpostun): sed >= 4.0
Requires: %{name}-libs = %{version}-%{release}
Requires: db >= %{ver_db}
+Requires: openssl >= 0.9.7d
Requires: rpm >= %{ver_rpm}
Requires: sed
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%{?with_static:This version is statically linked.}
%{!?with_imode:This version hasn't got interactive mode.}
-#'vim
+
+#'
%description -l pl
poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
Modu³y jêzyka Python dla poldka.
%prep
-%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
-%patch1 -p1
-%patch2 -p1
+%setup -q
+%patch0 -p2
+%patch1 -p0
+%patch2 -p0
+%patch3 -p2
+%patch4 -p1
+%patch5 -p1
+%patch6 -p0
+%patch7 -p2
+%patch8 -p2
+%patch9 -p1
%ifarch %{x8664}
-%patch3 -p1
+%patch10 -p1
%endif
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
%build
+%{__libtoolize}
%{__autopoint}
%{__aclocal} -I m4
%{__autoconf}
%{__automake}
-cp -f config.sub trurlib
+cd trurlib
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+cd ../tndb
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+cd ..
%configure \
%{?with_static:--enable-static --disable-shared} \
%{!?with_imode:--disable-imode} \
- --enable-nls \
- %{?with_python:--with-python}
+ %{?with_python:--with-python} \
+ --enable-nls
%{__make}
%install
%if %{with python}
%{__make} -C python install \
- DESTDIR=$RPM_BUILD_ROOT \
- libdir=%{py_sitedir}
+ DESTDIR=$RPM_BUILD_ROOT
%endif
%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
-%ifarch i486 i686 ppc sparc alpha athlon
+#
+# CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
+#
+%ifarch i386 i586 i686 ppc sparc alpha athlon
%define _ftp_arch %{_target_cpu}
%else
%ifarch %{x8664}
-%define _ftp_arch x86_64
+%define _ftp_arch amd64
%define _ftp_alt_arch i686
%else
-%ifarch i586
-%define _ftp_arch i486
+%ifarch i486
+%define _ftp_arch i386
%else
%ifarch pentium2 pentium3 pentium4
%define _ftp_arch i686
cp -a conf configs
rm -f configs/Makefile*
+%find_lang %{name}
+
%if %{with python}
%py_postclean
-rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
+install -d $RPM_BUILD_ROOT%{py_sitedir}
+mv $RPM_BUILD_ROOT{%{_libdir},%{py_sitedir}}/_poldekmod.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/_poldekmod.la
%endif
-%find_lang %{name}
-
%clean
rm -rf $RPM_BUILD_ROOT
fi
fi
+%triggerpostun -- poldek < 0.20-15
+# add ignore = msmtp-sendmail* to [ac] source
+# as it would otherwise replace postfix with msmtp-sendmail without even asking!!!
+%{__sed} -i -e '/^path.*=.*%%{_pld_prefix}\/PLD\/%%{_pld_arch}\/PLD\/RPMS\//aignore = msmtp-sendmail*' %{_sysconfdir}/%{name}/pld-source.conf
+
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc README* NEWS TODO configs/
%lang(pl) %{_mandir}/pl/man1/%{name}*
%{_infodir}/poldek.info*
-%if !%{with static}
+%if %{without static}
%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/lib*.so.*.*.*