commit 2c7c565db9c6c9f94d723e133d14e038e105f23b Author: CentOS Sources Date: Tue Oct 5 21:10:29 2021 -0400 import sblim-gather-2.2.9-24.el8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd5357e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/missing-providers.tgz +SOURCES/sblim-gather-2.2.9.tar.bz2 diff --git a/.sblim-gather.metadata b/.sblim-gather.metadata new file mode 100644 index 0000000..a8a1e69 --- /dev/null +++ b/.sblim-gather.metadata @@ -0,0 +1,2 @@ +aa7e595344da78bab75b1eba6b1d5ca4a773cd6a SOURCES/missing-providers.tgz +a8f56d1b270441d51301280d251cb11a26484906 SOURCES/sblim-gather-2.2.9.tar.bz2 diff --git a/SOURCES/gather-config.h b/SOURCES/gather-config.h new file mode 100644 index 0000000..59a1f4f --- /dev/null +++ b/SOURCES/gather-config.h @@ -0,0 +1,30 @@ +/* This file is here to prevent a file conflict on multiarch systems. A + * conflict will frequently occur because arch-specific build-time + * configuration options are stored (and used, so they can't just be stripped + * out) in gather-config.h. The original gather-config.h has been renamed. + * DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */ + +#ifdef gather_config_multilib_redirection_h +#error "Do not define gather_config_multilib_redirection_h!" +#endif +#define gather_config_multilib_redirection_h + +#if defined(__i386__) +#include "sblim-gather-i386.h" +#elif defined(__ia64__) +#include "sblim-gather-ia64.h" +#elif defined(__powerpc64__) +#include "sblim-gather-ppc64.h" +#elif defined(__powerpc__) +#include "sblim-gather-ppc.h" +#elif defined(__s390x__) +#include "sblim-gather-s390x.h" +#elif defined(__s390__) +#include "sblim-gather-s390.h" +#elif defined(__x86_64__) +#include "sblim-gather-x86_64.h" +#else +#error "This sblim-gather-devel package does not work your architecture?" +#endif + +#undef gather_config_multilib_redirection_h diff --git a/SOURCES/gather-config.h.prepend b/SOURCES/gather-config.h.prepend new file mode 100644 index 0000000..99a374c --- /dev/null +++ b/SOURCES/gather-config.h.prepend @@ -0,0 +1,7 @@ +/* Prepended at sblim package build-time. Don't include this file directly, + * use "gather-config.h" instead. */ + +#ifndef gather_config_multilib_redirection_h +#error "Don't include this file directly, use instead!" +#endif + diff --git a/SOURCES/gatherer.service b/SOURCES/gatherer.service new file mode 100644 index 0000000..5bc02bd --- /dev/null +++ b/SOURCES/gatherer.service @@ -0,0 +1,12 @@ +[Unit] +Description=SBLIM Data Gatherer metric service +After=syslog.target +Before=reposd.service +Requires=reposd.service + +[Service] +Type=forking +ExecStart=/usr/sbin/gatherd + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/reposd.service b/SOURCES/reposd.service new file mode 100644 index 0000000..227be6f --- /dev/null +++ b/SOURCES/reposd.service @@ -0,0 +1,12 @@ +[Unit] +Description=SBLIM Data Gatherer repository of metrics +After=syslog.target +After=gatherer.service +Requires=gatherer.service + +[Service] +Type=forking +ExecStart=/usr/sbin/reposd + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/sblim-gather-2.2.7-missing_providers.patch b/SOURCES/sblim-gather-2.2.7-missing_providers.patch new file mode 100644 index 0000000..e465927 --- /dev/null +++ b/SOURCES/sblim-gather-2.2.7-missing_providers.patch @@ -0,0 +1,43 @@ +diff -up sblim-gather-2.2.7/provider/mof/Linux_Metric.mof.missing_providers sblim-gather-2.2.7/provider/mof/Linux_Metric.mof +--- sblim-gather-2.2.7/provider/mof/Linux_Metric.mof.missing_providers 2013-02-27 13:59:55.590221724 +0100 ++++ sblim-gather-2.2.7/provider/mof/Linux_Metric.mof 2013-02-27 14:03:28.630982849 +0100 +@@ -137,7 +137,8 @@ class Linux_MetricDefForME : CIM_MetricD + CIM_BaseMetricDefinition REF Dependent; + }; + +-[ Description ("Plugin Control") ++[ Description ("Plugin Control"), ++ Provider("cmpi:OSBase_MetricPluginProvider") + ] + class Linux_MetricPlugin : CIM_Setting + { +@@ -149,7 +150,8 @@ class Linux_MetricPlugin : CIM_Setting + boolean Enabled; + }; + +-[ Description ("Plugin Control for Repository") ++[ Description ("Plugin Control for Repository"), ++ Provider("cmpi:OSBase_RepositoryPluginProvider") + ] + class Linux_RepositoryPlugin : CIM_Setting + { +@@ -163,7 +165,8 @@ class Linux_RepositoryPlugin : CIM_Setti + boolean Enabled; + }; + +-[ Description ("Definition to Value mapping") ++[ Description ("Definition to Value mapping"), ++ Provider("cmpi:OSBase_MetricValueDefinitionProvider") + ] + class Linux_MetricValueDefinition : CIM_Setting + { +diff -up sblim-gather-2.2.7/provider/mof/Linux_Metric.registration.missing_providers sblim-gather-2.2.7/provider/mof/Linux_Metric.registration +--- sblim-gather-2.2.7/provider/mof/Linux_Metric.registration.missing_providers 2013-02-27 13:59:35.288958848 +0100 ++++ sblim-gather-2.2.7/provider/mof/Linux_Metric.registration 2013-02-27 13:59:39.822017667 +0100 +@@ -12,3 +12,6 @@ Linux_MetricRepositoryService root/cimv2 + Linux_MetricIndication root/cimv2 OSBase_MetricIndicationProvider OSBase_MetricIndicationProvider indication + CIM_InstModification root/cimv2 OSBase_MetricLifeCycleProvider OSBase_MetricLifeCycleProvider indication + Linux_MetricElementConformsToProfile root/cimv2 OSBase_MetricElementConformsToProfileProvider OSBase_MetricElementConformsToProfileProvider instance association ++Linux_MetricPlugin root/cimv2 OSBase_MetricPluginProvider OSBase_MetricPluginProvider instance ++Linux_RepositoryPlugin root/cimv2 OSBase_RepositoryPluginProvider OSBase_RepositoryPluginProvider instance ++Linux_MetricValueDefinition root/cimv2 OSBase_MetricValueDefinitionProvider OSBase_MetricValueDefinitionProvider instance diff --git a/SOURCES/sblim-gather-2.2.7-typos.patch b/SOURCES/sblim-gather-2.2.7-typos.patch new file mode 100644 index 0000000..787eaea --- /dev/null +++ b/SOURCES/sblim-gather-2.2.7-typos.patch @@ -0,0 +1,12 @@ +diff -up sblim-gather-2.2.7/provider/provider-register.sh.typos sblim-gather-2.2.7/provider/provider-register.sh +--- sblim-gather-2.2.7/provider/provider-register.sh.typos 2013-02-28 14:47:57.480692224 +0100 ++++ sblim-gather-2.2.7/provider/provider-register.sh 2013-02-28 14:48:08.350826141 +0100 +@@ -280,7 +280,7 @@ pegasus_uninstall() + do + if test -w $_TEMPDIR + then +- _DELETE_NAME=$TEMPDIR/delete-class.mof ++ _DELETE_NAME=$_TEMPDIR/delete-class.mof + break + fi + done diff --git a/SOURCES/sblim-gather-2.2.8-docdir.patch b/SOURCES/sblim-gather-2.2.8-docdir.patch new file mode 100644 index 0000000..c7cba77 --- /dev/null +++ b/SOURCES/sblim-gather-2.2.8-docdir.patch @@ -0,0 +1,12 @@ +diff -up sblim-gather-2.2.8/Makefile.in.orig sblim-gather-2.2.8/Makefile.in +--- sblim-gather-2.2.8/Makefile.in.orig 2013-08-28 12:53:38.468175893 +0200 ++++ sblim-gather-2.2.8/Makefile.in 2013-08-28 12:53:48.018209290 +0200 +@@ -685,7 +685,7 @@ datadir = @datadir@ + datarootdir = @datarootdir@ + + # docdir defines where the documentation goes +-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION) ++docdir = $(datadir)/doc/$(PACKAGE) + dvidir = @dvidir@ + enable_man = @enable_man@ + exec_prefix = @exec_prefix@ diff --git a/SOURCES/sblim-gather-2.2.8-multilib.patch b/SOURCES/sblim-gather-2.2.8-multilib.patch new file mode 100644 index 0000000..6cd177e --- /dev/null +++ b/SOURCES/sblim-gather-2.2.8-multilib.patch @@ -0,0 +1,26 @@ +diff -up sblim-gather-2.2.8/man/gatherd.conf.5.xml.pre.in.orig sblim-gather-2.2.8/man/gatherd.conf.5.xml.pre.in +--- sblim-gather-2.2.8/man/gatherd.conf.5.xml.pre.in.orig 2013-02-12 02:08:25.000000000 +0100 ++++ sblim-gather-2.2.8/man/gatherd.conf.5.xml.pre.in 2014-03-17 12:23:54.825349694 +0100 +@@ -71,7 +71,8 @@ Valid components are: comm, util, gather + =dir + + Directory where metric collection plugins are located. Default is +-@libdir@/gather/mplug. ++/usr/lib/gather/mplug ++(/usr/lib64/gather/mplug). + + + +diff -up sblim-gather-2.2.8/man/reposd.conf.5.xml.pre.in.orig sblim-gather-2.2.8/man/reposd.conf.5.xml.pre.in +--- sblim-gather-2.2.8/man/reposd.conf.5.xml.pre.in.orig 2014-03-17 12:24:10.634427699 +0100 ++++ sblim-gather-2.2.8/man/reposd.conf.5.xml.pre.in 2014-03-17 12:24:38.697566201 +0100 +@@ -71,7 +71,8 @@ Valid components are: comm, util, repos. + =dir + + Directory where repository metric plugins are located. Default is +-@libdir@/gather/rplug. ++/usr/lib/gather/rplug ++(/usr/lib64/gather/rplug). + + + diff --git a/SOURCES/sblim-gather-2.2.9-covscan-fixes.patch b/SOURCES/sblim-gather-2.2.9-covscan-fixes.patch new file mode 100644 index 0000000..8e3aebf --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-covscan-fixes.patch @@ -0,0 +1,59 @@ +diff -up sblim-gather-2.2.9/plugin/cimplugLocalFileSystem.c.orig sblim-gather-2.2.9/plugin/cimplugLocalFileSystem.c +--- sblim-gather-2.2.9/plugin/cimplugLocalFileSystem.c.orig 2014-10-09 23:29:09.000000000 +0200 ++++ sblim-gather-2.2.9/plugin/cimplugLocalFileSystem.c 2021-08-16 11:44:16.249428364 +0200 +@@ -28,14 +28,15 @@ CMPIObjectPath* COP4VALID (CMPIBroker *b + { + CMPIObjectPath *cop; + char *fsclass; +- char fsname[300]; ++ char fsname[301]; + char *fstype, *idx2; + + if (id==NULL || systemid==NULL) { + return NULL; + } + +- strncpy(fsname,id,sizeof(fsname)); ++ strncpy(fsname,id,sizeof(fsname)-1); ++ fsname[sizeof(fsname)-1] = '\0'; + fstype = strchr(fsname,'('); + idx2 = strchr(fsname,')'); + if (fstype && idx2 && fstype < idx2) { +diff -up sblim-gather-2.2.9/provider/OSBase_MetricIndicationProvider.c.orig sblim-gather-2.2.9/provider/OSBase_MetricIndicationProvider.c +--- sblim-gather-2.2.9/provider/OSBase_MetricIndicationProvider.c.orig 2014-10-09 23:29:10.000000000 +0200 ++++ sblim-gather-2.2.9/provider/OSBase_MetricIndicationProvider.c 2021-08-16 11:40:35.511820637 +0200 +@@ -364,10 +364,13 @@ static int removeListenFilter(const CMPI + free (lf->lf_namespace); + } + free(lf); ++ lf = NULL; + state=0; + } +- prev = lf; +- lf = lf->lf_next; ++ if (lf) { ++ prev = lf; ++ lf = lf->lf_next; ++ } + } + pthread_mutex_unlock(&listenMutex); + return state; +diff -up sblim-gather-2.2.9/provider/OSBase_MetricLifeCycleProvider.c.orig sblim-gather-2.2.9/provider/OSBase_MetricLifeCycleProvider.c +--- sblim-gather-2.2.9/provider/OSBase_MetricLifeCycleProvider.c.orig 2014-10-09 23:29:10.000000000 +0200 ++++ sblim-gather-2.2.9/provider/OSBase_MetricLifeCycleProvider.c 2021-08-16 11:40:35.511820637 +0200 +@@ -384,10 +384,13 @@ static int removeListenFilter(const CMPI + free (lf->lf_namespace); + } + free(lf); ++ lf = NULL; + state=0; + } +- prev = lf; +- lf = lf->lf_next; ++ if (lf) { ++ prev = lf; ++ lf = lf->lf_next; ++ } + } + pthread_mutex_unlock(&listenMutex); + return state; diff --git a/SOURCES/sblim-gather-2.2.9-fix-use-of-temp-paths.patch b/SOURCES/sblim-gather-2.2.9-fix-use-of-temp-paths.patch new file mode 100644 index 0000000..65cd02d --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-fix-use-of-temp-paths.patch @@ -0,0 +1,134 @@ +diff -up sblim-gather-2.2.9/plugin/metricVirt.c.orig sblim-gather-2.2.9/plugin/metricVirt.c +--- sblim-gather-2.2.9/plugin/metricVirt.c.orig 2014-10-09 23:29:10.000000000 +0200 ++++ sblim-gather-2.2.9/plugin/metricVirt.c 2021-08-19 14:29:14.500341897 +0200 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #define PIDDIR "/var/run/libvirt/qemu/" + #define L_piddir 22 +@@ -239,7 +240,8 @@ static void collectDomainSchedStats(int + FILE * fd = NULL; + char * pidfile = NULL; + char * tidfile = NULL; +- char tmpfile[L_tmpnam]; ++ char pidtmpfile[] = "/tmp/pidtmp-XXXXXX"; ++ int tfd = -1; + char cmdbuf[128]; + char buf[bufsize]; + int * tids = NULL; +@@ -266,10 +268,12 @@ static void collectDomainSchedStats(int + + /* determine thread ids for each vcpu via ps */ + if (pid) { +- if (tmpnam(tmpfile)) { +- sprintf(cmdbuf, "ps --no-headers -p %d -Lo lwp > %s", pid, tmpfile); ++ tfd = mkstemp(pidtmpfile); ++ if (tfd != -1) { ++ unlink(pidtmpfile); ++ sprintf(cmdbuf, "ps --no-headers -p %d -Lo lwp > %s", pid, pidtmpfile); + if (system(cmdbuf) == 0) { +- if ((fd = fopen(tmpfile, "r")) != NULL) { ++ if ((fd = fdopen(tfd, "r")) != NULL) { + /* ignore master thread (vm pid) */ + fgets(buf, bufsize, fd); + +@@ -282,7 +286,6 @@ static void collectDomainSchedStats(int + fclose(fd); + } + } +- remove(tmpfile); + } + } + +@@ -293,17 +296,20 @@ static void collectDomainSchedStats(int + /* for each vcpu/tid grab stats from /proc/$pid/task/$tid/sched */ + for (i = 0; i < domain_statistics.vcpus[cnt]; i++) { + float used, ready; ++ char tidtmpfile[] = "/tmp/tidtmp-XXXXXX"; + +- if (tmpnam(tmpfile)) { ++ tfd = mkstemp(tidtmpfile); ++ if (tfd != -1) { ++ unlink(tidtmpfile); + sprintf(tidfile, "%s%d%s%d%s", PROC, pid, TASK, tids[i], SCHED); + + /* interested in se.sum_exec_runtime and se.wait_sum */ + sprintf(cmdbuf, "cat %s | awk '/exec_runtime/ || /wait_sum/ {print $3}' > %s", +- tidfile, tmpfile); ++ tidfile, tidtmpfile); + + /* stats are in floating point ms, convert to microseconds */ + if (system(cmdbuf) == 0) { +- if ((fd = fopen(tmpfile, "r")) != NULL) { ++ if ((fd = fdopen(tfd, "r")) != NULL) { + fgets(buf, bufsize, fd); + sscanf(buf, "%f", &used); + used = used * 1000; +@@ -317,7 +323,6 @@ static void collectDomainSchedStats(int + fclose(fd); + } + } +- remove(tmpfile); + } + + } +diff -up sblim-gather-2.2.9/reposdump.c.orig sblim-gather-2.2.9/reposdump.c +--- sblim-gather-2.2.9/reposdump.c.orig 2014-10-09 23:29:11.000000000 +0200 ++++ sblim-gather-2.2.9/reposdump.c 2021-08-19 14:33:27.612564618 +0200 +@@ -55,6 +55,7 @@ int main(int argc, char * argv[]) + /* output file handling */ + char fname[400]; + char *dumpdir; ++ int tfd; + FILE * fhdl; + /* rrepos API related */ + char **plugins; +@@ -119,7 +120,8 @@ int main(int argc, char * argv[]) + + /* we will need the current time later on */ + now = time(NULL); +- strcpy(timestr,time_chars_unsafe(now)); ++ strncpy(timestr, time_chars_unsafe(now), sizeof(timestr)-1); ++ timestr[sizeof(timestr)-1] = '\0'; + + /* construct output filename and open for writing */ + if (argc > 3) { +@@ -127,8 +129,14 @@ int main(int argc, char * argv[]) + } else { + dumpdir = "/tmp"; + } +- sprintf(fname,"%s/reposd-dump-%s.out",dumpdir,timestr); +- fhdl = fopen(fname,"w"); ++ snprintf(fname, sizeof(fname)-1, "%s/reposd-dump-%s-XXXXXX.out", dumpdir, timestr); ++ fname[sizeof(fname)-1] = '\0'; ++ tfd = mkstemps(fname, 4); ++ if (tfd == -1) { ++ fprintf(stderr, "Could not create %s\n", fname); ++ return REPOSDUMP_FILEWRITE; ++ } ++ fhdl = fdopen(tfd,"w"); + if (fhdl == NULL) { + fprintf(stderr, "Could not open %s for writing\n", fname); + return REPOSDUMP_FILEWRITE; +diff -up sblim-gather-2.2.9/slisten.c.orig sblim-gather-2.2.9/slisten.c +--- sblim-gather-2.2.9/slisten.c.orig 2014-10-09 23:29:11.000000000 +0200 ++++ sblim-gather-2.2.9/slisten.c 2021-08-19 14:29:14.501341906 +0200 +@@ -64,6 +64,7 @@ static void subs_listener_cleanup(void * + /* reset to initial state */ + long fds = (long)fdsocket; + close(fds); ++ close(fdsockfile); + unlink(listener); + strcpy(listener,SOCKFILE_TEMPLATE); + fdsockfile=-1; +@@ -139,7 +140,6 @@ int add_subscription_listener(char *list + M_TRACE(MTRACE_DETAILED,MTRACE_RREPOS, + ("listener socket name = %s",listener)); + if (fdsockfile != -1) { +- close(fdsockfile); + unlink(listener); + pthread_create(&pt_listener,NULL,subs_listener,NULL); + pthread_detach(pt_listener); diff --git a/SOURCES/sblim-gather-2.2.9-inline.patch b/SOURCES/sblim-gather-2.2.9-inline.patch new file mode 100644 index 0000000..cb54237 --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-inline.patch @@ -0,0 +1,12 @@ +diff -up sblim-gather-2.2.9/repos.c.orig sblim-gather-2.2.9/repos.c +--- sblim-gather-2.2.9/repos.c.orig 2014-10-09 23:29:11.000000000 +0200 ++++ sblim-gather-2.2.9/repos.c 2019-11-05 15:01:49.529369051 +0100 +@@ -781,7 +781,7 @@ static RepositoryPlugin* pl_find(const c + } + return p?p->plugin:NULL; + } +-inline int valueCompare(int type, ValueItem *v, ValueItem *w, int dir) ++static inline int valueCompare(int type, ValueItem *v, ValueItem *w, int dir) + { + long long llv, llw; + unsigned long long ulv, ulw; diff --git a/SOURCES/sblim-gather-2.2.9-pegasus-interop.patch b/SOURCES/sblim-gather-2.2.9-pegasus-interop.patch new file mode 100644 index 0000000..521a137 --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-pegasus-interop.patch @@ -0,0 +1,12 @@ +diff -up sblim-gather-2.2.9/provider/provider-register.sh.orig sblim-gather-2.2.9/provider/provider-register.sh +--- sblim-gather-2.2.9/provider/provider-register.sh.orig 2014-10-13 11:20:01.000000000 +0200 ++++ sblim-gather-2.2.9/provider/provider-register.sh 2014-10-13 11:41:55.374300205 +0200 +@@ -216,7 +216,7 @@ pegasus_install() + then + chatter Registering providers with $state cimserver + $CIMMOF -uc -I $mofpath -n $namespace $mymofs && +- $CIMMOF -uc -n root/PG_Interop $_REGFILENAME ++ $CIMMOF -uc -n root/interop $_REGFILENAME + else + echo "Failed to build pegasus registration MOF." >&2 + return 1 diff --git a/SOURCES/sblim-gather-2.2.9-prov-reg-sfcb-systemd.patch b/SOURCES/sblim-gather-2.2.9-prov-reg-sfcb-systemd.patch new file mode 100644 index 0000000..374f7b2 --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-prov-reg-sfcb-systemd.patch @@ -0,0 +1,42 @@ +diff -up sblim-gather-2.2.9/provider/provider-register.sh.orig sblim-gather-2.2.9/provider/provider-register.sh +--- sblim-gather-2.2.9/provider/provider-register.sh.orig 2015-03-03 12:46:57.671267255 +0100 ++++ sblim-gather-2.2.9/provider/provider-register.sh 2015-03-03 12:48:00.501535717 +0100 +@@ -351,20 +351,8 @@ sfcb_rebuild() + if ps -C sfcbd > /dev/null 2>&1 + then + # sfcb is running -- need to restart +- for INITSCRIPT in /etc/init.d/sfcb /usr/local/etc/init.d/sfcb none +- do +- if test -x $INITSCRIPT +- then +- break; +- fi +- done + chatter "Shutting down sfcb." +- if test $INITSCRIPT = none +- then +- killall sfcbd +- else +- $INITSCRIPT stop +- fi ++ systemctl stop sblim-sfcb + t=0 + while ps -C sfcbd > /dev/null 2>&1 + do +@@ -385,14 +373,8 @@ sfcb_rebuild() + return 1 + fi + +- if test $INITSCRIPT = none +- then +- echo "No init script found - you need to start sfcbd manually." >&2 +- return 1 +- else +- chatter "Restarting sfcb." +- $INITSCRIPT start +- fi ++ chatter "Restarting sfcb." ++ systemctl start sblim-sfcb + else + # Not running - rebuild repository + chatter "Rebuilding repository." diff --git a/SOURCES/sblim-gather-2.2.9-remove-assoc-conflict.patch b/SOURCES/sblim-gather-2.2.9-remove-assoc-conflict.patch new file mode 100644 index 0000000..b348ffa --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-remove-assoc-conflict.patch @@ -0,0 +1,20 @@ +diff -up sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.mof.orig sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.mof +--- sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.mof.orig 2014-10-09 23:29:10.000000000 +0200 ++++ sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.mof 2015-03-05 13:17:35.657778506 +0100 +@@ -22,9 +22,3 @@ + + class Linux_MetricRegisteredProfile : CIM_RegisteredProfile + { }; +- +-[ +- Association +-] +-class Linux_MetricElementConformsToProfile : CIM_ElementConformsToProfile +-{ }; +diff -up sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.registration.orig sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.registration +--- sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.registration.orig 2014-10-09 23:29:10.000000000 +0200 ++++ sblim-gather-2.2.9/provider/mof/Linux_MetricProfile.registration 2015-03-05 13:17:40.169798969 +0100 +@@ -1,3 +1,2 @@ + # Classname Namespace ProviderName ProviderModule ProviderTypes ... + Linux_MetricRegisteredProfile root/interop OSBase_MetricRegisteredProfileProvider OSBase_MetricRegisteredProfileProvider instance +-Linux_MetricElementConformsToProfile root/interop OSBase_MetricElementConformsToProfileProvider OSBase_MetricElementConformsToProfileProvider instance association diff --git a/SOURCES/sblim-gather-2.2.9-remove-cxx-check.patch b/SOURCES/sblim-gather-2.2.9-remove-cxx-check.patch new file mode 100644 index 0000000..3810c04 --- /dev/null +++ b/SOURCES/sblim-gather-2.2.9-remove-cxx-check.patch @@ -0,0 +1,9 @@ +diff -up sblim-gather-2.2.9/missing-providers/CMakeLists.txt.orig sblim-gather-2.2.9/missing-providers/CMakeLists.txt +--- sblim-gather-2.2.9/missing-providers/CMakeLists.txt.orig 2013-02-27 12:38:07.000000000 +0100 ++++ sblim-gather-2.2.9/missing-providers/CMakeLists.txt 2018-02-26 10:47:07.892292626 +0100 +@@ -1,3 +1,5 @@ ++PROJECT(PROVIDERS C) ++ + cmake_minimum_required(VERSION 2.6) + + # Set flags and definitions diff --git a/SOURCES/sblim-gather.tmpfiles b/SOURCES/sblim-gather.tmpfiles new file mode 100644 index 0000000..b32d8d2 --- /dev/null +++ b/SOURCES/sblim-gather.tmpfiles @@ -0,0 +1 @@ +d /run/gather 0755 root root - diff --git a/SPECS/sblim-gather.spec b/SPECS/sblim-gather.spec new file mode 100644 index 0000000..2895d4c --- /dev/null +++ b/SPECS/sblim-gather.spec @@ -0,0 +1,469 @@ +%global sblim_testsuite_version 1.2.4 +%global provider_dir %{_libdir}/cmpi + +Name: sblim-gather +Version: 2.2.9 +Release: 24%{?dist} +Summary: SBLIM Gatherer + +License: EPL +URL: http://sourceforge.net/projects/sblim/ +Source0: http://downloads.sourceforge.net/project/sblim/%{name}/%{version}/%{name}-%{version}.tar.bz2 +Source1: gather-config.h.prepend +Source2: gather-config.h +Source3: sblim-gather.tmpfiles +Source4: missing-providers.tgz +Source5: gatherer.service +Source6: reposd.service + +BuildRequires: make +BuildRequires: sblim-cmpi-devel +BuildRequires: sblim-cmpi-base-devel +BuildRequires: libsysfs-devel +BuildRequires: libvirt-devel +BuildRequires: xmlto +BuildRequires: gcc +# for missing providers +BuildRequires: cmake +Patch1: sblim-gather-2.2.7-missing_providers.patch +Patch2: sblim-gather-2.2.7-typos.patch +Patch8: sblim-gather-2.2.9-remove-cxx-check.patch + +# Patch3: removes version from docdir +Patch3: sblim-gather-2.2.8-docdir.patch +# Patch4: fixes multilib conflicts +Patch4: sblim-gather-2.2.8-multilib.patch +# Patch5: use Pegasus root/interop instead of root/PG_Interop +Patch5: sblim-gather-2.2.9-pegasus-interop.patch +# Patch6: call systemctl in provider registration +Patch6: sblim-gather-2.2.9-prov-reg-sfcb-systemd.patch +# Patch7: remove conflicting assoc class Linux_MetricElementConformsToProfile +# from Linux_MetricProfile.mof (already included in Linux_Metric.mof) +Patch7: sblim-gather-2.2.9-remove-assoc-conflict.patch +# Patch9: fix link fail with gcc-10 (patch by Jeff Law) +Patch9: sblim-gather-2.2.9-inline.patch +# Patch10: fix important issues found by coverity scan +Patch10: sblim-gather-2.2.9-covscan-fixes.patch +# Patch11: fix incorrect use of temporary paths +Patch11: sblim-gather-2.2.9-fix-use-of-temp-paths.patch + +Requires: cim-server +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%description +Standards Based Linux Instrumentation for Manageability +Performance Data Gatherer Base. +This package contains the agents and control programs for gathering +and providing performance data. + +%package provider +Summary: SBLIM Gatherer Provider +Requires: %{name} = %{version}-%{release} +Requires: sblim-cmpi-base +Requires: cim-server + +%description provider +The CIM (Common Information Model) Providers for the +SBLIM (Standards Based Linux Instrumentation for Manageability) +Gatherer. + +%package devel +Summary: SBLIM Gatherer Development Support +Requires: %{name} = %{version}-%{release} +Requires: cim-server + +%description devel +This package is needed to develop new plugins for the +SBLIM (Standards Based Linux Instrumentation for Manageability) +Gatherer. + +%package test +Summary: SBLIM Gatherer Testcase Files +Requires: %{name}-provider = %{version}-%{release} +Requires: sblim-testsuite +Requires: cim-server + +%description test +Gatherer Testcase Files for the +SBLIM (Standards Based Linux Instrumentation for Manageability) +Testsuite + +%prep +%setup -q +# for missing providers +tar xfvz %{SOURCE4} +%patch1 -p1 -b .missing_providers +%patch2 -p1 -b .typos +%patch3 -p1 -b .docdir +%patch4 -p1 -b .multilib +%patch5 -p1 -b .pegasus-interop +%patch6 -p1 -b .prov-reg-sfcb-systemd +%patch7 -p1 -b .remove-assoc-conflict +%patch8 -p1 -b .remove-cxx-check +%patch9 -p1 -b .inline +%patch10 -p1 -b .covscan-fixes +%patch11 -p1 -b .fix-use-of-temp-paths + +%build +%ifarch s390 s390x ppc ppc64 +export CFLAGS="$RPM_OPT_FLAGS -fsigned-char -fno-strict-aliasing" +%else +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +%endif +%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite \ +%ifarch s390 s390x + --enable-z \ +%endif + PROVIDERDIR=%{provider_dir} +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +make %{?_smp_mflags} + +# for missing providers +pushd missing-providers + mkdir -p %{_target_platform} + pushd %{_target_platform} + %{cmake} .. + make %{?_smp_mflags} + popd +popd + +%install +make install DESTDIR=$RPM_BUILD_ROOT +# remove unused libtool files +rm -f $RPM_BUILD_ROOT/%{_libdir}/*a +rm -f $RPM_BUILD_ROOT/%{provider_dir}/*a +rm -f $RPM_BUILD_ROOT/%{_libdir}/gather/*plug/*a +# Install a redirection so that the arch-specific autoconf stuff continues to +# work but doesn't create multilib conflicts. +cat %{SOURCE1} \ + $RPM_BUILD_ROOT/%{_includedir}/gather/gather-config.h > \ + $RPM_BUILD_ROOT/%{_includedir}/gather/gather-config-%{_arch}.h +chmod 644 $RPM_BUILD_ROOT/%{_includedir}/gather/gather-config.h +install -m644 %{SOURCE2} $RPM_BUILD_ROOT/%{_includedir}/gather/ + +mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} +install -p -D -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_tmpfilesdir}/sblim-gather.conf + +# shared libraries +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d +echo "%{_libdir}/cmpi" > $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf + +# for missing providers +make install/fast DESTDIR=$RPM_BUILD_ROOT -C missing-providers/%{_target_platform} +mkdir -p $RPM_BUILD_ROOT/var/lib/gather + +# remove init script, install service files +rm $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/gatherer +mkdir -p ${RPM_BUILD_ROOT}%{_unitdir} +install -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir}/gatherer.service +install -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/reposd.service + +%files +%config(noreplace) %{_sysconfdir}/*.conf +%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf +%{_unitdir}/gatherer.service +%{_unitdir}/reposd.service +%docdir %{_datadir}/doc/%{name} +%{_bindir}/* +%{_sbindir}/* +%{_datadir}/doc/%{name} +%{_tmpfilesdir}/sblim-gather.conf +%ghost /var/run/gather +%{_libdir}/lib[^O]*.so.* +%dir %{_libdir}/gather +%{_libdir}/gather/mplug +%{_libdir}/gather/rplug +%{_mandir}/*/* + +%files provider +%{_libdir}/gather/cplug +%{_libdir}/libOSBase_MetricUtil.so +%{_libdir}/libOSBase*.so.* +%{_libdir}/cmpi +%{_datadir}/%{name} +%dir /var/lib/gather + +%files devel +%{_libdir}/lib[^O]*.so +%{_includedir}/gather + +%files test +%{_datadir}/sblim-testsuite/cim/Linux* +%{_datadir}/sblim-testsuite/system/linux/Linux* +%{_datadir}/sblim-testsuite/system/linux/gather-systemname.sh +%{_datadir}/sblim-testsuite/test-gather.sh + +%global GATHER_1ST_SCHEMA %{_datadir}/%{name}/Linux_Metric.mof %{_datadir}/%{name}/Linux_MetricProfile.mof +%global GATHER_1ST_REGISTRATION %{_datadir}/%{name}/Linux_Metric.registration %{_datadir}/%{name}/Linux_MetricProfile.registration + +%global G_GLOB_IGNORE */Linux_Metric.* + +%global SCHEMA %{_datadir}/%{name}/*.mof +%global REGISTRATION %{_datadir}/%{name}/*.registration + +%post +install -d -m 0755 -o root -g root /var/run/gather +%{?ldconfig} +%systemd_post gatherer.service +%systemd_post reposd.service + +%preun +%systemd_preun gatherer.service +%systemd_preun reposd.service +if [ $1 -eq 0 ]; then + rm -rf /var/run/gather + rm -rf /var/lib/gather +fi + +%postun +%{?ldconfig} +%systemd_postun_with_restart gatherer.service +%systemd_postun_with_restart reposd.service + +%pre provider +function unregister() +{ + # don't let registration failure when server not running fail upgrade! + GLOBIGNORE=%{G_GLOB_IGNORE} + %{_datadir}/%{name}/provider-register.sh -v -d $1 -m %{SCHEMA} -r %{REGISTRATION} #> /dev/null 2>&1 || :; + %{_datadir}/%{name}/provider-register.sh -v -d $1 -m %{GATHER_1ST_SCHEMA} -r %{GATHER_1ST_REGISTRATION} #> /dev/null 2>&1 || :; +} + +# if upgrading, deregister old version +if [ $1 -gt 1 ]; then + unregistered=no + if [ -e /usr/sbin/cimserver ]; then + unregister "-t pegasus"; + unregistered=yes + fi + if [ -e /usr/sbin/sfcbd ]; then + unregister "-t sfcb"; + unregistered=yes + fi + if [ "$unregistered" != yes ]; then + unregister + fi +fi + +%post provider +function register() +{ + # don't let registration failure when server not running fail install! + %{_datadir}/%{name}/provider-register.sh -v $1 -m %{GATHER_1ST_SCHEMA} -r %{GATHER_1ST_REGISTRATION} > /dev/null 2>&1 || :; + GLOBIGNORE=%{G_GLOB_IGNORE} + %{_datadir}/%{name}/provider-register.sh -v $1 -m %{SCHEMA} -r %{REGISTRATION} > /dev/null 2>&1 || :; +} + +%{?ldconfig} +if [ $1 -ge 1 ]; then + registered=no + if [ -e /usr/sbin/cimserver ]; then + register "-t pegasus"; + registered=yes + fi + if [ -e /usr/sbin/sfcbd ]; then + register "-t sfcb"; + registered=yes + fi + if [ "$registered" != yes ]; then + register + fi +fi + +%preun provider +function unregister() +{ + # don't let registration failure when server not running fail upgrade! + GLOBIGNORE=%{G_GLOB_IGNORE} + %{_datadir}/%{name}/provider-register.sh -v -d $1 -m %{SCHEMA} -r %{REGISTRATION} > /dev/null 2>&1 || :; + %{_datadir}/%{name}/provider-register.sh -v -d $1 -m %{GATHER_1ST_SCHEMA} -r %{GATHER_1ST_REGISTRATION} > /dev/null 2>&1 || :; +} + +if [ $1 -eq 0 ]; then + unregistered=no + if [ -e /usr/sbin/cimserver ]; then + unregister "-t pegasus"; + unregistered=yes + fi + if [ -e /usr/sbin/sfcbd ]; then + unregister "-t sfcb"; + unregistered=yes + fi + if [ "$unregistered" != yes ]; then + unregister + fi +fi + +%ldconfig_postun provider + +%changelog +* Tue Aug 24 2021 Vitezslav Crhonek - 2.2.9-24 +- Fix important coverity issues + Resolves: #1989603 +- Fix incorrect use of temporary paths + Resolves: #1989605 + +* Wed Jul 21 2021 Vitezslav Crhonek - 2.2.9-23 +- Fix undefined symbol in libmetricKvm plugin +- Fix tmpfiles path + Related: #1959078 + +* Thu Jun 10 2021 Vitezslav Crhonek - 2.2.9-22 +- Fix build issues + Related: #1959078 + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.2.9-21 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Wed Jan 27 2021 Fedora Release Engineering - 2.2.9-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Aug 06 2020 Vitezslav Crhonek - 2.2.9-19 +- Fix FTBFS + Resolves: #1865457 + +* Sat Aug 01 2020 Fedora Release Engineering - 2.2.9-18 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 2.2.9-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Feb 13 2020 Vitezslav Crhonek - 2.2.9-16 +- Fix multiple definiton of variables (FTBFS with GCC 10) + Resolves: #1800073 + +* Thu Jan 30 2020 Fedora Release Engineering - 2.2.9-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Nov 05 2019 Vitezslav Crhonek - 2.2.9-14 +- Fix link fail with gcc-10 (patch by Jeff Law) + +* Fri Jul 26 2019 Fedora Release Engineering - 2.2.9-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 2.2.9-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 2.2.9-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Mar 27 2018 Vitezslav Crhonek - 2.2.9-10 +- Add BuildRequires gcc, remove cxx check from cmake +- Remove Group tag +- Enable System Z specific providers for s390 and s390x architecture +- Silence providers (un)registration + +* Fri Feb 09 2018 Fedora Release Engineering - 2.2.9-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 2.2.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 2.2.9-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 2.2.9-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 2.2.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jun 19 2015 Fedora Release Engineering - 2.2.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Mar 05 2015 Vitezslav Crhonek - 2.2.9-3 +- Update provider registration script to use systemctl to stop/start sfcb +- Fix registration/deregistration +- Require cim-server instead of tog-pegasus, don't BuildRequire tog-pegasus-devel + +* Thu Jan 15 2015 Vitezslav Crhonek - 2.2.9-2 +- Fix packaging of tmpfiles + +* Mon Oct 13 2014 Vitezslav Crhonek - 2.2.9-1 +- Update to sblim-gather-2.2.9 +- Use Pegasus root/interop instead of root/PG_Interop + +* Mon Aug 18 2014 Fedora Release Engineering - 2.2.8-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 2.2.8-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Mar 24 2014 Vitezslav Crhonek - 2.2.8-7 +- Fix failing scriptlets when CIMOM is not running + +* Mon Mar 17 2014 Vitezslav Crhonek - 2.2.8-6 +- Fix multilib conflicts + +* Tue Feb 04 2014 Vitezslav Crhonek - 2.2.8-5 +- Fix sblim-gather FTBFS if "-Werror=format-security" flag is used + Resolves: #1037318 + +* Wed Aug 28 2013 Vitezslav Crhonek - 2.2.8-4 +- Fix for unversioned docdir change + Resolves: #994086 + +* Sun Aug 04 2013 Fedora Release Engineering - 2.2.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon May 06 2013 Vitezslav Crhonek - 2.2.8-2 +- Add -fno-strict-aliasing +- Do not ship old init script, add systemd support + +* Mon Mar 18 2013 Vitezslav Crhonek - 2.2.8-1 +- Update to sblim-gather-2.2.8 + +* Wed Feb 27 2013 Roman Rakus - 2.2.7-3 +- Fixed a typo +- Added missing providers +- improved providers registration +- Fixed owning of filesystem's directories (man) + +* Thu Feb 14 2013 Fedora Release Engineering - 2.2.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Dec 04 2012 Vitezslav Crhonek - 2.2.7-1 +- Update to sblim-gather-2.2.7 +- Add man page BuildRequires, ship man pages + +* Thu Sep 06 2012 Vitezslav Crhonek - 2.2.6-2 +- Fix issues found by fedora-review utility in the spec file + +* Wed Aug 15 2012 Vitezslav Crhonek - 2.2.6-1 +- Update to sblim-gather-2.2.6 + +* Sat Jul 21 2012 Fedora Release Engineering - 2.2.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Apr 30 2012 Vitezslav Crhonek - 2.2.5-1 +- Update to sblim-gather-2.2.5 + +* Wed Jan 04 2012 Vitezslav Crhonek - 2.2.4-1 +- Update to sblim-gather-2.2.4 + +* Wed May 18 2011 Vitezslav Crhonek - 2.2.3-1 +- Update to sblim-gather-2.2.3 + +* Thu Mar 24 2011 Vitezlsav Crhonek - 2.2.2-3 +- Use %%ghost for /var/run/gather + Resolves: #656686 + +* Wed Feb 09 2011 Fedora Release Engineering - 2.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Feb 7 2011 Vitezslav Crhonek - 2.2.2-1 +- Update to sblim-gather-2.2.2 + +* Mon Jun 7 2010 Vitezslav Crhonek - 2.2.1-2 +- Fix broken dependency because of missing libOSBase_MetricUtil.so + +* Wed Jun 2 2010 Vitezslav Crhonek - 2.2.1-1 +- Update to sblim-gather-2.2.1 + +* Tue Oct 13 2009 Vitezslav Crhonek - 2.1.9-1 +- Initial support