]> git.pld-linux.org Git - packages/pcp.git/commitdiff
- rpm support is gone, rel 1
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 28 Feb 2022 22:26:18 +0000 (23:26 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 28 Feb 2022 22:26:18 +0000 (23:26 +0100)
pcp-rpm.patch [deleted file]
pcp.spec

diff --git a/pcp-rpm.patch b/pcp-rpm.patch
deleted file mode 100644 (file)
index 1730930..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
---- pcp-3.9.6/configure.ac.orig        2014-05-28 22:05:42.575179206 +0200
-+++ pcp-3.9.6/configure.ac     2014-05-30 20:21:36.818374363 +0200
-@@ -2369,8 +2369,8 @@
- savedLIBS=$LIBS
- AC_MSG_CHECKING([for rpmlib > 4.4.2])
- AC_COMPILE_IFELSE(
--   [AC_LANG_PROGRAM([[#include <rpm/header.h>]],
--                    [[(void)HEADERGET_EXT;]])],
-+   [AC_LANG_PROGRAM([[#include <rpm/rpmtypes.h>]],
-+                    [[(void)RPMSCRIPT_PREIN;]])],
-    [AC_MSG_RESULT([yes])
-     have_rpmlib=1],
-    [AC_MSG_RESULT([no])
---- pcp-3.9.4/src/pmdas/rpm/GNUmakefile.orig   2014-04-15 11:10:23.000000000 +0200
-+++ pcp-3.9.4/src/pmdas/rpm/GNUmakefile        2014-06-01 07:52:17.205709769 +0200
-@@ -31,9 +31,9 @@ VERSION_SCRIPT       = exports
- LSRCFILES     = Install Remove pmns root help
- LDIRT         = domain.h $(IAM).log $(VERSION_SCRIPT)
--LIB_FOR_RPM   = -lrpm
-+LIB_FOR_RPM   = -lrpm -lrpmdb -lrpmio
- LLDLIBS               = $(PCP_PMDALIB) $(LIB_FOR_RPM) $(LIB_FOR_PTHREADS)
--LCFLAGS               = $(INVISIBILITY)
-+LCFLAGS               = $(INVISIBILITY) -I/usr/include/rpm
- default:      build-me
---- pcp-3.9.4/src/pmdas/rpm/rpm.c.orig 2014-04-15 11:10:23.000000000 +0200
-+++ pcp-3.9.4/src/pmdas/rpm/rpm.c      2014-06-01 07:51:37.589043928 +0200
-@@ -17,9 +17,9 @@
- #include <sys/stat.h>
- #include <pthread.h>
- #include <search.h>
-+#include <stdarg.h>
- #include <sys/inotify.h>
--#include <rpm/rpmlib.h>
--#include <rpm/header.h>
-+#include <rpm/rpm46compat.h>
- #include <rpm/rpmts.h>
- #include <rpm/rpmdb.h>
- #include <pcp/pmapi.h>
-@@ -436,7 +436,7 @@ rpm_extract_metadata(const char *name, r
-     m->license = dict_insert(rpm_extract_string(td, h, RPMTAG_LICENSE));
-     m->packager = dict_insert(rpm_extract_string(td, h, RPMTAG_PACKAGER));
-     m->release = dict_insert(rpm_extract_string(td, h, RPMTAG_RELEASE));
--    m->longsize = rpm_extract_value(td, h, RPMTAG_LONGSIZE);
-+    m->longsize = rpm_extract_value(td, h, RPMTAG_PACKAGESIZE);
-     m->sourcerpm = dict_insert(rpm_extract_string(td, h, RPMTAG_SOURCERPM));
-     m->summary = dict_insert(rpm_extract_string(td, h, RPMTAG_SUMMARY));
-     m->url = dict_insert(rpm_extract_string(td, h, RPMTAG_URL));
-@@ -444,6 +444,157 @@ rpm_extract_metadata(const char *name, r
-     m->version = dict_insert(rpm_extract_string(td, h, RPMTAG_VERSION));
- }
-+/* from rpm.org */
-+static char *rstrscat(char **dest, const char *arg, ...)
-+{
-+    va_list ap;
-+    size_t arg_size, dst_size;
-+    const char *s;
-+    char *dst, *p;
-+
-+    dst = dest ? *dest : NULL;
-+
-+    if ( arg == NULL ) {
-+        return dst;
-+    }
-+
-+    va_start(ap, arg);
-+    for (arg_size=0, s=arg; s; s = va_arg(ap, const char *))
-+        arg_size += strlen(s);
-+    va_end(ap);
-+
-+    dst_size = dst ? strlen(dst) : 0;
-+    dst = realloc(dst, dst_size+arg_size+1);    /* include '\0' */
-+    p = &dst[dst_size];
-+
-+    va_start(ap, arg);
-+    for (s = arg; s; s = va_arg(ap, const char *)) {
-+        size_t size = strlen(s);
-+        memmove(p, s, size);
-+        p += size;
-+    }
-+    va_end(ap);
-+    *p = '\0';
-+
-+    if ( dest ) {
-+        *dest = dst;
-+    }
-+
-+    return dst;
-+}
-+
-+static const char * headerGetString(Header h, int32_t tag)
-+{
-+    const char *res = NULL;
-+    struct rpmtd_s td;
-+
-+    if (headerGet(h, tag, &td, HEADERGET_MINMEM)) {
-+      if (rpmtdCount(&td) == 1) {
-+          res = rpmtdGetString(&td);
-+      }
-+      rpmtdFreeData(&td);
-+    }
-+    return res;
-+}
-+
-+static int rasprintf(char **strp, const char *fmt, ...)
-+{
-+    int n;
-+    va_list ap;
-+    char * p = NULL;
-+  
-+    if (strp == NULL) 
-+      return -1;
-+
-+    va_start(ap, fmt);
-+    n = vsnprintf(NULL, 0, fmt, ap);
-+    va_end(ap);
-+
-+    if (n >= -1) {
-+      size_t nb = n + 1;
-+      p = malloc(nb);
-+      va_start(ap, fmt);
-+        n = vsnprintf(p, nb, fmt, ap);
-+      va_end(ap);
-+    } 
-+    *strp = p;
-+    return n;
-+}
-+
-+static uint64_t rpmtdGetNumber(rpmtd td)
-+{
-+    uint64_t val = 0;
-+    int ix = (td->ix >= 0 ? td->ix : 0);
-+
-+    switch (td->type) {
-+    case RPM_INT64_TYPE:
-+      val = *((uint64_t *) td->data + ix);
-+      break;
-+    case RPM_INT32_TYPE:
-+      val = *((uint32_t *) td->data + ix);
-+      break;
-+    case RPM_INT16_TYPE:
-+      val = *((uint16_t *) td->data + ix);
-+      break;
-+    case RPM_INT8_TYPE:
-+      val = *((uint8_t *) td->data + ix);
-+      break;
-+    default:
-+      break;
-+    }
-+    return val;
-+}
-+
-+static char * headerGetNumericAsString(Header h, int32_t tag)
-+{
-+    char *res = NULL;
-+    struct rpmtd_s td;
-+
-+    if (headerGet(h, tag, &td, HEADERGET_EXT)) {
-+      if (rpmtdCount(&td) == 1) {
-+          rasprintf(&res, "%" PRIu64, rpmtdGetNumber(&td));
-+      }
-+      rpmtdFreeData(&td);
-+    }
-+    return res;
-+}
-+
-+static int headerIsSource(Header h)
-+{
-+    return (!headerIsEntry(h, RPMTAG_SOURCERPM));
-+}
-+
-+char *getNEVRA(Header h)
-+{
-+    const char *val = NULL;
-+    char *res = NULL;
-+
-+    {
-+      val = headerGetString(h, RPMTAG_NAME);
-+      if (val) rstrscat(&res, val, "-", NULL);
-+    }
-+    {
-+      char *e = headerGetNumericAsString(h, RPMTAG_EPOCH);
-+      if (e) rstrscat(&res, e, ":", NULL);
-+      free(e);
-+    }
-+    {
-+      val = headerGetString(h, RPMTAG_VERSION);
-+      if (val) rstrscat(&res, val, "-", NULL);
-+    }
-+    {
-+      val = headerGetString(h, RPMTAG_RELEASE);
-+      if (val) rstrscat(&res, val, NULL);
-+    }
-+    {
-+      val = headerGetString(h, RPMTAG_ARCH);
-+      if (headerIsSource(h) && val == NULL) val = "src";
-+      if (val) rstrscat(&res, ".", val, NULL);
-+    }
-+
-+    return res;
-+}
-+
- /*
-  * Refresh the RPM package names and values in the cache.
-  * This is to be only ever invoked from a single thread.
-@@ -470,7 +621,8 @@ rpm_update_cache(void *ptr)
-      * since the only (?) thing that can fail is memory allocation, which
-      * rpmlib internally maps to an exit(1).
-      */
--    td = rpmtdNew();
-+    td = malloc(sizeof(*td));
-+    rpmtdReset(td);
-     ts = rpmtsCreate();
-     if (rpmReadConfigFiles_p == 0) {
-@@ -483,8 +635,7 @@ rpm_update_cache(void *ptr)
-     /* Iterate through the entire list of RPMs, extract names and values */
-     mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, NULL, 0);
-     while ((h = rpmdbNextIterator(mi)) != NULL) {
--      headerGet(h, RPMTAG_NEVRA, td, HEADERGET_EXT | HEADERGET_MINMEM);
--      const char *name = rpmtdGetString(td);
-+      char *name = getNEVRA(h);
-       metadata meta;
-       package *pp = NULL;
-       int sts, err = 0;
-@@ -522,10 +673,13 @@ rpm_update_cache(void *ptr)
-           }
-       }
-       pthread_mutex_unlock(&indom_mutex);
-+      free(name);
-     }
-     rpmdbFreeIterator(mi);
-     rpmtsFree(ts);
-+    rpmtdFreeData(td);
-+    free(td);
-     pthread_mutex_lock(&indom_mutex);
-     stop_timing();
index d271ff545400aa48fdc91721f6d04f3b70cd5d6c..2ec831da5dff8063c3c8d459a8572afb988b1550 100644 (file)
--- a/pcp.spec
+++ b/pcp.spec
@@ -9,14 +9,13 @@
 #
 # Conditional build:
 %bcond_without qt              # Qt 5.x based GUI
-%bcond_with    rpm5            # build with rpm5
 %bcond_without systemtap       # systemtap/dtrace support
 
 Summary:       Performance Co-Pilot - system level performance monitoring and management
 Summary(pl.UTF-8):     Performance Co-Pilot - monitorowanie i zarządzanie wydajnością na poziomie systemu
 Name:          pcp
 Version:       5.3.6
-Release:       0.1
+Release:       1
 License:       LGPL v2.1 (libraries), GPL v2 (the rest)
 Group:         Applications/System
 Source0:       https://github.com/performancecopilot/pcp/archive/%{version}/%{name}-%{version}.tar.gz
@@ -25,7 +24,6 @@ Patch0:               build-man.patch
 Patch1:                %{name}-opt.patch
 Patch2:                %{name}-nspr.patch
 Patch3:                %{name}-saslconfdir.patch
-Patch4:                %{name}-rpm.patch
 Patch5:                python-install.patch
 Patch6:                install-icons.patch
 URL:           http://pcp.io/
@@ -234,7 +232,6 @@ Sondy systemtap/dtrace dla PCP.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%{?with_rpm5:%patch4 -p1}
 %patch5 -p1
 %patch6 -p1
 
@@ -504,8 +501,6 @@ fi
 %dir %{_sysconfdir}/pcp/pmproxy
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pcp/pmproxy/pmproxy.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pcp/pmproxy/pmproxy.options
-%dir %{_sysconfdir}/pcp/pmrep
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pcp/pmrep/pmrep.conf
 %dir %{_sysconfdir}/pcp/pmseries
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pcp/pmseries/pmseries.conf
 %dir %{_sysconfdir}/pcp/snmp
@@ -531,10 +526,6 @@ fi
 %{systemdunitdir}/pmie.service
 %{systemdunitdir}/pmlogger_check.service
 %{systemdunitdir}/pmlogger_check.timer
-%{systemdunitdir}/pmlogger_daily-poll.service
-%{systemdunitdir}/pmlogger_daily-poll.timer
-%{systemdunitdir}/pmlogger_daily_report-poll.service
-%{systemdunitdir}/pmlogger_daily_report-poll.timer
 %{systemdunitdir}/pmlogger_daily_report.service
 %{systemdunitdir}/pmlogger_daily_report.timer
 %{systemdunitdir}/pmlogger_daily.service
@@ -787,7 +778,6 @@ fi
 %config(noreplace) %verify(not md5 mtime size) /var/lib/pcp/config/pmlogrewrite/proc_kernel_ulong.conf
 %config(noreplace) %verify(not md5 mtime size) /var/lib/pcp/config/pmlogrewrite/proc_kernel_ulong_migrate.conf
 %config(noreplace) %verify(not md5 mtime size) /var/lib/pcp/config/pmlogrewrite/proc_scheduler.conf
-%config(noreplace) %verify(not md5 mtime size) /var/lib/pcp/config/pmlogrewrite/rpm_migrate.conf
 %dir /var/lib/pcp/pmdas
 %dir /var/lib/pcp/pmdas/activemq
 %attr(755,root,root) /var/lib/pcp/pmdas/activemq/Install
@@ -1151,15 +1141,6 @@ fi
 /var/lib/pcp/pmdas/root/help.pag
 /var/lib/pcp/pmdas/root/root
 /var/lib/pcp/pmdas/root/root_root
-%dir /var/lib/pcp/pmdas/rpm
-%attr(755,root,root) /var/lib/pcp/pmdas/rpm/Install
-%attr(755,root,root) /var/lib/pcp/pmdas/rpm/Remove
-%attr(755,root,root) /var/lib/pcp/pmdas/rpm/pmda_rpm.so
-%attr(755,root,root) /var/lib/pcp/pmdas/rpm/pmdarpm
-/var/lib/pcp/pmdas/rpm/domain.h
-/var/lib/pcp/pmdas/rpm/help
-/var/lib/pcp/pmdas/rpm/pmns
-/var/lib/pcp/pmdas/rpm/root
 %dir /var/lib/pcp/pmdas/rsyslog
 %attr(755,root,root) /var/lib/pcp/pmdas/rsyslog/Install
 %attr(755,root,root) /var/lib/pcp/pmdas/rsyslog/Remove
@@ -1291,10 +1272,6 @@ fi
 %attr(755,root,root) /var/lib/pcp/pmdas/unbound/Install
 %attr(755,root,root) /var/lib/pcp/pmdas/unbound/Remove
 %attr(755,root,root) /var/lib/pcp/pmdas/unbound/pmdaunbound.python
-%dir /var/lib/pcp/pmdas/vmware
-%attr(755,root,root) /var/lib/pcp/pmdas/vmware/Install
-%attr(755,root,root) /var/lib/pcp/pmdas/vmware/Remove
-%attr(755,root,root) /var/lib/pcp/pmdas/vmware/pmdavmware.pl
 %dir /var/lib/pcp/pmdas/weblog
 %doc /var/lib/pcp/pmdas/weblog/README
 %attr(755,root,root) /var/lib/pcp/pmdas/weblog/Install
@@ -1436,7 +1413,6 @@ fi
 %{_mandir}/man1/pmdaredis.1*
 %{_mandir}/man1/pmdaroomtemp.1*
 %{_mandir}/man1/pmdaroot.1*
-%{_mandir}/man1/pmdarpm.1*
 %{_mandir}/man1/pmdarsyslog.1*
 %{_mandir}/man1/pmdasample.1*
 %{_mandir}/man1/pmdasendmail.1*
This page took 0.120228 seconds and 4 git commands to generate.