From 78d0c8c28f80546951c3c9a4239add06f105e25a886a5fb3b8174e8c60dfe655 Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Thu, 19 Nov 2015 09:14:21 +0000 Subject: [PATCH 1/2] Accepting request 344076 from home:aeneas_jaissle:branches:devel:languages:python Update to 1.5.4 OBS-URL: https://build.opensuse.org/request/show/344076 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=67 --- cgilib-0.7.tar.gz | 3 - cgilib-fix_automake.patch | 18 - ...7-CVE-2013-2131-imginfo_format_check.patch | 69 --- rrdtool-1.4.7.tar.gz | 3 - rrdtool-1.5.4.tar.gz | 3 + rrdtool-lua-ruby_lib64.patch | 44 -- rrdtool-tclversion.patch | 15 - rrdtool.changes | 143 +++++ rrdtool.spec | 515 ++++++++++-------- 9 files changed, 437 insertions(+), 376 deletions(-) delete mode 100644 cgilib-0.7.tar.gz delete mode 100644 cgilib-fix_automake.patch delete mode 100644 rrdtool-1.4.7-CVE-2013-2131-imginfo_format_check.patch delete mode 100644 rrdtool-1.4.7.tar.gz create mode 100644 rrdtool-1.5.4.tar.gz delete mode 100644 rrdtool-lua-ruby_lib64.patch delete mode 100644 rrdtool-tclversion.patch diff --git a/cgilib-0.7.tar.gz b/cgilib-0.7.tar.gz deleted file mode 100644 index 28aac24..0000000 --- a/cgilib-0.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:09b7d71bd1eea10bb404cd665fd5abe69282144ce01d96f2863c85fd42d5d692 -size 268783 diff --git a/cgilib-fix_automake.patch b/cgilib-fix_automake.patch deleted file mode 100644 index 93455b5..0000000 --- a/cgilib-fix_automake.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- configure.ac.orig 2010-12-28 03:10:53.000000000 +0100 -+++ configure.ac 2010-12-28 03:15:03.000000000 +0100 -@@ -1,11 +1,11 @@ --AC_INIT(cgi.c) -- --AM_INIT_AUTOMAKE(cgilib, 0.7) -+AC_INIT(cgilib, 0.7) -+AC_CONFIG_SRCDIR([cgi.c]) -+AM_INIT_AUTOMAKE - SO_VERSION=1:0:0 - - AC_PROG_CC - AC_PROG_INSTALL --AC_PROG_LIBTOOL -+AM_PROG_LIBTOOL - - AC_SUBST(SO_VERSION) - diff --git a/rrdtool-1.4.7-CVE-2013-2131-imginfo_format_check.patch b/rrdtool-1.4.7-CVE-2013-2131-imginfo_format_check.patch deleted file mode 100644 index 59cdd79..0000000 --- a/rrdtool-1.4.7-CVE-2013-2131-imginfo_format_check.patch +++ /dev/null @@ -1,69 +0,0 @@ -Index: rrdtool-1.4.7/src/rrd_graph.c -=================================================================== ---- rrdtool-1.4.7.orig/src/rrd_graph.c -+++ rrdtool-1.4.7/src/rrd_graph.c -@@ -4016,6 +4016,12 @@ rrd_info_t *rrd_graph_v( - char *path; - char *filename; - -+ if (bad_format_imginfo(im.imginfo)) { -+ rrd_info_free(im.grinfo); -+ im_free(&im); -+ rrd_set_error("bad format for imginfo"); -+ return NULL; -+ } - path = strdup(im.graphfile); - filename = basename(path); - info.u_str = -@@ -4820,6 +4826,51 @@ int bad_format( - } - - -+int bad_format_imginfo( -+ char *fmt) -+{ -+ char *ptr; -+ int n = 0; -+ -+ ptr = fmt; -+ while (*ptr != '\0') -+ if (*ptr++ == '%') { -+ -+ /* line cannot end with percent char */ -+ if (*ptr == '\0') -+ return 1; -+ /* '%%' is allowed */ -+ if (*ptr == '%') -+ ptr++; -+ /* '%s', '%S' are allowed */ -+ else if (*ptr == 's' || *ptr == 'S') { -+ n = 1; -+ ptr++; -+ } -+ -+ /* or else '% 4lu' and such are allowed */ -+ else { -+ /* optional padding character */ -+ if (*ptr == ' ') -+ ptr++; -+ /* This should take care of 'm' */ -+ while (*ptr >= '0' && *ptr <= '9') -+ ptr++; -+ /* 'lu' must follow here */ -+ if (*ptr++ != 'l') -+ return 1; -+ if (*ptr == 'u') -+ ptr++; -+ else -+ return 1; -+ n++; -+ } -+ } -+ -+ return (n != 3); -+} -+ -+ - int vdef_parse( - struct graph_desc_t - *gdes, diff --git a/rrdtool-1.4.7.tar.gz b/rrdtool-1.4.7.tar.gz deleted file mode 100644 index 6e70fb9..0000000 --- a/rrdtool-1.4.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:956aaf431c955ba88dd7d98920ade3a8c4bad04adb1f9431377950a813a7af11 -size 1349040 diff --git a/rrdtool-1.5.4.tar.gz b/rrdtool-1.5.4.tar.gz new file mode 100644 index 0000000..f8a7ff0 --- /dev/null +++ b/rrdtool-1.5.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3feea3da87c02128a27083f1c7b2cb797ef673e946564c0ce008c1c25a5c3f99 +size 2181438 diff --git a/rrdtool-lua-ruby_lib64.patch b/rrdtool-lua-ruby_lib64.patch deleted file mode 100644 index b0df1c5..0000000 --- a/rrdtool-lua-ruby_lib64.patch +++ /dev/null @@ -1,44 +0,0 @@ -Index: configure -=================================================================== ---- configure.orig -+++ configure -@@ -27550,7 +27550,7 @@ fi - if test "${enable_ruby_site_install+set}" = set; then - enableval=$enable_ruby_site_install; RUBY_MAKE_OPTIONS= - else -- RUBY_MAKE_OPTIONS="sitedir=$langpref/lib/ruby" -+ RUBY_MAKE_OPTIONS="sitedir=$langpref/lib64/ruby" - fi - - -@@ -29316,7 +29316,7 @@ fi - done - fi - -- LUA_RRD_LIBDIR="$langpref/lib/lua/$lua_vdot" -+ LUA_RRD_LIBDIR="$langpref/lib64/lua/$lua_vdot" - # if lua 5.0 can't find compat-5.1, force installation of - # compat-5.1.lua together with RRDtool. - if test "$lua_vdot" = "5.0" -a "$LUA_HAVE_COMPAT51" != "HAVE_COMPAT51"; then -Index: configure.ac -=================================================================== ---- configure.ac.orig -+++ configure.ac -@@ -675,7 +675,7 @@ fi - dnl pass additional ruby options when generating Makefile from Makefile.PL - AC_ARG_ENABLE(ruby-site-install, - AS_HELP_STRING([--enable-ruby-site-install],[by default the rrdtool ruby modules are installed together with rrdtool in $prefix/lib/ruby. You have to add $prefix/lib/ruby/$ruby_version/$sitearch to your $: variable for ruby to find the RRD.so file.]), --[RUBY_MAKE_OPTIONS=],[RUBY_MAKE_OPTIONS="sitedir=$langpref/lib/ruby"]) -+[RUBY_MAKE_OPTIONS=],[RUBY_MAKE_OPTIONS="sitedir=$langpref/lib64/ruby"]) - - - AC_ARG_WITH(ruby-options, -@@ -782,7 +782,7 @@ LUA_EOF - done - fi - -- LUA_RRD_LIBDIR="$langpref/lib/lua/$lua_vdot" -+ LUA_RRD_LIBDIR="$langpref/lib64/lua/$lua_vdot" - # if lua 5.0 can't find compat-5.1, force installation of - # compat-5.1.lua together with RRDtool. - if test "$lua_vdot" = "5.0" -a "$LUA_HAVE_COMPAT51" != "HAVE_COMPAT51"; then diff --git a/rrdtool-tclversion.patch b/rrdtool-tclversion.patch deleted file mode 100644 index 817c6ae..0000000 --- a/rrdtool-tclversion.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: bindings/tcl/tclrrd.c -=================================================================== ---- bindings/tcl/tclrrd.c.orig -+++ bindings/tcl/tclrrd.c -@@ -678,10 +678,6 @@ static int init( - if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) - return TCL_ERROR; - -- if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1) == NULL) { -- return TCL_ERROR; -- } -- - /* - * Why a global array? In keeping with the Rrd:: namespace, why - * not simply create a normal variable Rrd::version and set it? diff --git a/rrdtool.changes b/rrdtool.changes index cb730b2..81ace7b 100644 --- a/rrdtool.changes +++ b/rrdtool.changes @@ -1,3 +1,146 @@ +------------------------------------------------------------------- +Wed Sep 23 07:55:35 UTC 2015 - aj@ajaissle.de + +- Update to 1.5.4 + + Bug Fixes + * parse floating point numbers according to C locale in rrdtool create + arguments, regardless of the systems locale setting. + * include missing rrd_rados.h into distribution archive + * make rrdtool work on ARM again + * make rrdtool test suit pass on 32bit OSs + * fix --grid-dash option regression in graph + * fix systemd support + * fix link dependency for libpng since we are using functions directly + * fix python module name + * fix rrdtool tune to accept U in minimum and maximum options + * fi + * rrd_parsetime now uses a mutex lock to become thread safe + * rrd_xport is now thread safe + * stop using MAX_PATH and make everything dynamic and make rrdtool work on + Gnu HURD ... thanks nirgal! + + Features + * new RPN operators: STEPWIDTH, NEWDAY, NEWWEEK, NEWMONTH and NEWWEEK + together they allow to draw graphs where a rate is converted back to + absolute numbers and accumulated over a period.. + +- Changelog 1.5.3 + + Bug Fixes + * Brought commmand-line options and documentation back into sync. + * Make LINE dashes option work again + +- Changelog 1.5.2 + + Bug Fixes + * paramters in VDEF are vnames and not data source names, hence + they can be 255 chars long and not only 20 + +- Changelog 1.5.1 + + Bug Fixes + * parse numbers up to 40 characters long .. + * fix install rules for Python and Lua + * include missing VERSION and LICENSE file + * unlink before rename in rrd_create when running on WIN32 + +- Changelog 1.5.0 + + New Features + * automatic x-axis labels that work from 1s to 30y on a single chart + * librados integration + * new datasource types: DCOUNTER and DDERIVE (they work the same as the + original DS, except that they can deal with floatingpoint numbers). + * compile without graphics libraries: ./configure --disable-rrd_graph + * updated windows port (see WIN32-BUILD-TIPS.txt) + * single step RRAs for MIN,MAX,LAST are generated virtually from + an AVERAGE RRA + * ignore updates in the past with rrdtool update --skip-past-updates + * ignore a LINE when scaling a chart using the skipscale option + * detect 32bit timeoverflows + * massive performance boost for charts with more than 100 DEF line by + switching form a linear search to a HASH when searching for data + * improved cross compilation support + * .Net bindings + * allow rrdtool graph to silently skip non-existing source files using the + --use-nan-for-all-missing-data option + * restore from a pipe (rrdtool restore - y.rrd) + * in rrdtool create, row count and step can be defined in absolute time + * all new "create on steroids" can pull both data and configuration from + existing rrd files + * use rrdtool graph to chart arbitrary data via a callback function for data fetching + support is integrated in the perl bindings. + * re-written parser for rrdtool graph commands. It now follows a simple key + value pattern, compatible with the previous syntax. + * MEDIAN op for CDEF expressions + * DEPTH,INDEX,COPY,ROL ops for CDEF (as seen in PostScript) + * gradient AREA backgrounds + * no more locale magic while reading numeric data. + + Bugfixes + * all the bugs fixed in 1.4.x during 1.5 development + +- Changelog 1.4.9 + + New Features + * allows rrdrestore to read input from stdin + * add documentation for RRDs::xport + * RPN operators MINNAN and MAXNAN + * --left-axis-format option to rrd_graph + + Bugfixes + * properly verify validity of user suplied format strings + * remove graph functions from python module when compiled without graphing + support + * verify that only short integers are used in COMPUTE rpn expressions + * eliminate duplicate setlocale calls + * fixed endless loop and double frees in rrd_restore + * fixed missing variable initializations in rrd_graph + * fixed JSON output format to actually be valid JSON + * detect failing fallocate and fall back to seeking + * fixed format string in ruby bindings + +- Changelog 1.4.8 + + Highlights + * rrd_graph now uses a map to lookup variable names causing graphs with many + items to be drawn magnitudes faster as the linear search of the variable + tables is gone now. + * the optional argument :skipscale allows for a LINE or AREA instruction to be + excluded from having an effect on the scaling of the graph + * TRENDNAN is now working properly and als not crashing anymore + * Added a no-op string positioning combo "\." this allows to write + COMMENT:OS\2\. which would otherwise not be possible. + * JSON output of xport is now actually json compilant by its keys + being properly quoted now. + * The label positioner in rrd_graph is now properly ignoring the current + state of DST. + * fixes and enhancements for Python, Ruby, TCL and Perl bindings + * improved error reporting in rrd_graph + * portability and cross compilation + * code and bugtracker moved to https://github.com/oetiker/rrdtool-1.x + +- Dropped patches (included upstream): + - rrdtool-1.4.7-CVE-2013-2131-imginfo_format_check.patch + +- Dropped patches (resolved otherwise): + - rrdtool-lua-ruby_lib64.patch + - rrdtool-tclversion.patch + +- Dropped cgilib-0.7.tar.gz + cglilib-fix_automake.patch (no + references to cgilib or cgi.h found, so benefit unclear) + +- Spec cleanup + + Added new perl-rrdtool subpackage containing the perl bindings + + Added new -doc subpackge + * bcond_without for lua, python, ruby and tcl + * bcond_without for libdbi, libwrap (tcpd) + * bcond_with for rados (ceph) + - Dropped BuildRequires: autoconf + automake (was needed for cgilib) + - Dropped BuildRequires: libart_lgpl-devel (replaced by cairo/pango + in earlier releases) + ------------------------------------------------------------------- Fri Jul 31 18:07:53 UTC 2015 - jengelh@inai.de diff --git a/rrdtool.spec b/rrdtool.spec index f854820..7f78896 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -16,131 +16,173 @@ # -%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d} +%bcond_without lua +%bcond_without python +%bcond_without ruby +%bcond_without tcl + +%bcond_without libdbi +%bcond_without libwrap +%bcond_with rados Name: rrdtool -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: cairo-devel -BuildRequires: freetype2-devel -BuildRequires: gettext-tools -BuildRequires: glib2-devel -BuildRequires: groff -BuildRequires: intltool -BuildRequires: libart_lgpl-devel -BuildRequires: libpng-devel -BuildRequires: libtool -BuildRequires: libxml2-devel -BuildRequires: lua51-devel -BuildRequires: pango-devel -BuildRequires: python-devel -BuildRequires: ruby-devel -BuildRequires: systemd-rpm-macros -BuildRequires: tcl-devel -BuildRequires: tcpd-devel -Requires: perl = %{perl_version} -Version: 1.4.7 +Version: 1.5.4 Release: 0 -%define cgilib_version 0.7 -Source: http://oss.oetiker.ch/rrdtool/pub/rrdtool-%{version}.tar.gz -Patch1: rrdtool-lua-ruby_lib64.patch -Patch2: rrdtool-tclversion.patch -Patch3: rrdtool-tclsegfault.patch -# PATCH-FIX-UPSTREAM bnc#828003 kstreitova@suse.com -- adds check to the imginfo format to prevent crash or exploit -Patch4: rrdtool-1.4.7-CVE-2013-2131-imginfo_format_check.patch -Source1: http://www.infodrom.org/projects/cgilib/download/cgilib-%{cgilib_version}.tar.gz -Patch11: cgilib-fix_automake.patch -#PATCH FIX UPSTREAM BNC#793636 -Patch12: rrdtool-zero_vs_nothing.patch +Summary: Round Robin Database Tool to store and display time-series data +License: GPL-2.0+ and LGPL-2.0+ +Group: Productivity/Scientific/Math +Url: http://oss.oetiker.ch/rrdtool/ +Source0: http://oss.oetiker.ch/%{name}/pub/%{name}-%{version}.tar.gz Source2: sysconfig.rrdcached Source4: rrdcached-systemd-pre Source5: rrdcached.service Source99: %{name}.changes -Url: http://oss.oetiker.ch/rrdtool/ -Summary: A tool for data logging and analysis -License: GPL-2.0+ -Group: Productivity/Scientific/Math +# PATCH-FIX-UPSTREAM -- Prevent possible segfault +Patch3: rrdtool-tclsegfault.patch +# PATCH-FIX-UPSTREAM -- bnc#793636 +Patch12: rrdtool-zero_vs_nothing.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: cairo-devel >= 1.2 +BuildRequires: freetype2-devel +BuildRequires: gcc-c++ +BuildRequires: gettext-tools +BuildRequires: glib2-devel +BuildRequires: groff +BuildRequires: intltool >= 0.35.0 +BuildRequires: libpng-devel +BuildRequires: libtool +BuildRequires: libxml2-devel +BuildRequires: openssl-devel +BuildRequires: pango-devel >= 1.14 +BuildRequires: systemd-rpm-macros +BuildRequires: zlib-devel + +%if %{with libdbi} +BuildRequires: libdbi-devel +%endif +%if %{with libwrap} +BuildRequires: tcpd-devel +%endif +%if %{with rados} +BuildRequires: librados2-devel +%endif + Requires: dejavu -Requires(pre): pwdutils %description -A tool to log and analyze data gathered from all kinds of data sources. -The data analysis part of RRDtool is based on the ability to quickly -generate graphical representations of the data values collected over a -definable time period. +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). It stores the data in a very compact way that will not +expand over time, and it presents useful graphs by processing the data to +enforce a certain data density. It can be used either via simple wrapper +scripts (from shell or Perl) or via frontends that poll network devices and +put a friendly user interface on it. + %package devel -Summary: A tool for data logging and analysis - Development files +Summary: RRDtool libraries and header files Group: Development/Libraries/C and C++ -Requires: %name = %version +Requires: %{name} = %{version}-%{release} %description devel -A tool to log and analyze data gathered from all kinds of data sources. -The data analysis part of RRDtool is based on the ability to quickly -generate graphical representations of the data values collected over a -definable time period. - -%package -n python-rrdtool -Summary: Python bindings for rrdtool -Group: Development/Languages/Python -Requires: %name = %version -%py_requires - -%description -n python-rrdtool -A tool to log and analyze data gathered from all kinds of data sources. -The data analysis part of RRDtool is based on the ability to quickly -generate graphical representations of the data values collected over a -definable time period. - -This package contains the Python bindings +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). This package allow you to use directly this library. -%package -n lua-rrdtool -Summary: Lua bindings for rrdtool +%package doc +Summary: RRDtool documentation +Group: Documentation + +%description doc +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). This package contains documentation on using RRD. + + +%package -n perl-%{name} +Summary: Perl bindings for RRDtool +Group: Development/Languages/Perl +Requires: %{name} = %{version}-%{release} +Requires: perl = %{perl_version} + +%description -n perl-%{name} +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). This package contains documentation on using RRD. + +This package contains the Perl bindings. + + +%if %{with lua} +%package -n lua-%{name} +Summary: Lua bindings for RRDtool Group: Development/Languages/Other -Requires: %name = %version +BuildRequires: lua51-devel +Requires: %{name} = %{version}-%{release} +Requires: lua -%description -n lua-rrdtool -A tool to log and analyze data gathered from all kinds of data sources. -The data analysis part of RRDtool is based on the ability to quickly -generate graphical representations of the data values collected over a -definable time period. +%description -n lua-%{name} +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). This package contains documentation on using RRD. -This package contains the Lua bindings +This package contains the Lua bindings. +%endif -%package -n ruby-rrdtool -Summary: Ruby bindings for rrdtool +%if %{with python} +%package -n python-%{name} +Summary: Python bindings for RRDtool +Group: Development/Languages/Python +BuildRequires: python-devel >= 2.3 +Requires: %{name} = %{version}-%{release} +Requires: python >= %{python_version} + +%description -n python-%{name} +Python RRDtool bindings. +%endif + +%if %{with ruby} +%package -n ruby-%{name} +Summary: Ruby bindings for RRDtool Group: Development/Languages/Ruby +BuildRequires: ruby-devel +Requires: %{name} = %{version}-%{release} Requires: ruby(abi) >= %{rb_ver} -%description -n ruby-rrdtool -A tool to log and analyze data gathered from all kinds of data sources. -The data analysis part of RRDtool is based on the ability to quickly -generate graphical representations of the data values collected over a -definable time period. +%description -n ruby-%{name} +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). This package contains documentation on using RRD. -This package contains the Ruby bindings +This package contains the Ruby bindings. +%endif -%package -n tcl-rrdtool -Summary: Tcl bindings for rrdtool +%if %{with tcl} +%package -n tcl-%{name} +Summary: Tcl bindings for RRDtool Group: Development/Languages/Tcl -Requires: tcl +BuildRequires: tcl-devel >= 8.0 +Requires: %{name} = %{version}-%{release} +Requires: tcl >= 8.0 -%description -n tcl-rrdtool -A tool to log and analyze data gathered from all kinds of data sources. -The data analysis part of RRDtool is based on the ability to quickly -generate graphical representations of the data values collected over a -definable time period. +%description -n tcl-%{name} +RRD is the Acronym for Round Robin Database. RRD is a system to store and +display time-series data (i.e. network bandwidth, machine-room temperature, +server load average). This package contains documentation on using RRD. -This package contains the Tcl bindings +This package contains the Tcl bindings. +%endif %package cached +%define rrdcached_user rrdcached +%define rrdcached_group rrdcached Summary: Data caching daemon for RRDtool Group: Productivity/Scientific/Math -Requires: %{name} = %{version} +Requires: %{name} = %{version}-%{release} Requires(pre): %fillup_prereq -%define rrdcached_user rrdcached -%define rrdcached_group rrdcached +Requires(pre): pwdutils %description cached rrdcached is a daemon that receives updates to existing RRD files, @@ -149,186 +191,211 @@ passed, writes the updates to the RRD file. The daemon was written with big setups in mind which usually runs into I/O related problems. This daemon was written to alleviate these problems. + %prep -%setup -q -a1 -%if %{_lib}==lib64 -%patch1 -%endif -%patch2 +%setup -q %patch3 -%patch4 -p1 -pushd "cgilib-%{cgilib_version}" -%patch11 -popd #cgilib %patch12 -p1 + +# rrd_tool/rrd_cgi: use the date of the last change modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" -DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" -TIME="\"$(date -d "${modified}" "+%%R")\"" -find . -name '*.[ch]' | xargs sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" +DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" +TIME="\"$(date -d "${modified}" "+%%R")\"" +find . -name '*.c' -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} \; %build -# first prepare cgilib -pushd cgilib-%{cgilib_version} -echo -n > NEWS -aclocal --force -autoreconf -fiv -CGILIB_CFLAGS="%{optflags} -fPIC -I." -CGILIB_CFLAGS="$CGILIB_CFLAGS -fexcess-precision=fast" -CFLAGS="$CGILIB_CFLAGS" \ -%configure -make %{?jobs:-j %jobs} -%__mkdir_p ../lb/include -%__cp *.h ../lb/include/ -%__mkdir_p ../lb/lib/ -%__cp -a .libs/libcgi.so* ../lb/lib/ -popd #cgilib +%configure \ + --enable-shared \ + --disable-static\ + --disable-rpath \ +%if %{with lua} + --enable-lua \ + --enable-lua-site-install \ +%else + --disable-lua \ +%endif + --enable-perl \ + --enable-perl-site-install \ + --with-perl-options='INSTALLDIRS="vendor"' \ +%if %{with python} + --enable-python \ +%else + --disable-python \ +%endif +%if %{with ruby} + --enable-ruby \ + --enable-ruby-site-install \ + --with-ruby-options='sitedir="%{rb_sitearchdir}"' \ +%else + --disable-ruby \ +%endif +%if %{with tcl} + --enable-tcl \ + --enable-tcl-site \ + --with-tcllib=%{_libdir} \ +%else + --disable-tcl \ +%endif + --with-rrd-default-font="monospace" \ + --with-pic \ + --with-gnu-ld \ + --with-systemdsystemunitdir=%{_unitdir} -# build rrdtool -if [ ! -d m4 ]; then mkdir m4; fi -# we need getext 0.18 -#autoreconf -i -f -export LDFLAGS="-L`pwd`/lb/lib" CPPFLAGS="-I`pwd`/lb/include" \ -%configure --disable-static --with-pic --enable-shared \ - --enable-tcl-site \ - --with-tcllib=%{_libdir} \ - --with-gnu-ld \ - --enable-python \ - --enable-ruby \ - --enable-ruby-site-install \ - --disable-rpath \ - --with-rrd-default-font="monospace" -make %{?jobs:-j %jobs} V=1 +make %{?_smp_mflags} %install -#eval `perl -V:installarchlib` -# Override hdrdir and rubyhdrdir to avoid makefile dependencies on -# installed ruby headers to be prefixed with %{buildroot} make \ - DESTDIR=$RPM_BUILD_ROOT \ - idocdir=%{_docdir}/%{name}/txt/ \ - ihtmldir=%{_docdir}/%{name}/html/ \ - examplesdir=%{_docdir}/%{name}/examples/ \ - libdir=%{_libdir} \ - pkglibdir=%tcl_archdir/tclrrd%version \ - install -# we install this later again -rm -r $RPM_BUILD_ROOT%{_prefix}/lib/perl -# do not install fonts (use system fonts instead) -rm -rf $RPM_BUILD_ROOT%_datadir/rrdtool/fonts -# install correctly perl modules -pushd bindings/perl-piped -perl Makefile.PL -make DESTDIR=$RPM_BUILD_ROOT install_vendor -popd -pushd bindings/perl-shared -perl Makefile.PL -make DESTDIR=$RPM_BUILD_ROOT install_vendor -popd + DESTDIR="%{buildroot}" \ + idocdir=%{_docdir}/%{name}/txt/ \ + ihtmldir=%{_docdir}/%{name}/html/ \ + examplesdir=%{_docdir}/%{name}/examples/ \ + libdir=%{_libdir} \ +%if %{with tcl} + pkglibdir=%{tcl_archdir}/tclrrd%{version} \ +%endif + install + %perl_process_packlist -#fix build (it would be better to split cgilib) -#sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*/ /' $RPM_BUILD_ROOT/%{_libdir}/librrd.la > tmp -#mv tmp $RPM_BUILD_ROOT/%{_libdir}/librrd.la -#sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*/ /' $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la > tmp -#mv tmp $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la -find "%{buildroot}" -type f -name '*.la' -exec %__rm {} \; -# install ruby bindings -pushd bindings/ruby -mkdir -p %{buildroot}/%{rb_sitearchdir} -make DESTDIR=%{buildroot} install -popd + +%if %{with lua} +# install ruby bindings manually +mv %{buildroot}/usr/local/lib/lua %{buildroot}%{_libdir}/lua +%endif + +%if %{with ruby} +# install ruby bindings manually +%if 0%{?suse_version} == 1310 +rm -r %{buildroot}%{rb_sitearchdir}/* +%endif +install -D bindings/ruby/RRD.so %{buildroot}%{rb_sitearchdir}/RRD.so +%endif + +# remove cruft +find %{buildroot}%{_libdir} -type f -name "*.la" -delete -print + # documentation -install -m 644 CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO $RPM_BUILD_ROOT/%{_docdir}/%{name} -pushd doc -mkdir txt -mkdir html -mv *.txt txt/ -mv *.html html/ -popd -rm examples/rrdcached/Makefile* -chmod -x examples/* -chmod +x examples/rrdcached +rm %{buildroot}%{_docdir}/%{name}/txt/*.pod +find %{buildroot}%{_docdir}/%{name}/examples/ -type f -exec chmod 0644 {} \; + # install rrdcached specials -install -Dm644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached +install -D -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached + # install systemd specific files -install -Dm755 %{SOURCE4} %{buildroot}%{_datadir}/rrdcached/rrdcached-systemd-pre -install -Dm644 %{SOURCE5} %{buildroot}%{_unitdir}/rrdcached.service -install -d -m 0755 %{buildroot}/%{_tmpfilesdir} -echo "d /run/rrdcached 0755 %{rrdcached_user} %{rrdcached_group}" > %{buildroot}/%{_tmpfilesdir}/rrdcached.conf -chmod 644 %{buildroot}/%{_tmpfilesdir}/rrdcached.conf +install -D -m 0755 %{SOURCE4} %{buildroot}%{_datadir}/rrdcached/rrdcached-systemd-pre +install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/rrdcached.service +install -d -m 0755 %{buildroot}%{_tmpfilesdir} +echo "d /run/rrdcached 0755 %{rrdcached_user} %{rrdcached_group}" > %{buildroot}%{_tmpfilesdir}/rrdcached.conf +chmod 644 %{buildroot}%{_tmpfilesdir}/rrdcached.conf + +mkdir -p %{buildroot}%{_sbindir} +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcrrdcached + +%pre cached +getent group %{rrdcached_group} >/dev/null || groupadd %{rrdcached_group} || : +getent passwd %{rrdcached_user} >/dev/null || useradd -s /sbin/nologin -g %{rrdcached_group} -c %{rrdcached_user} -d %{_localstatedir}/lib %{rrdcached_user} || : +%service_add_pre rrdcached.service +%service_add_pre rrdcached.socket + +%post cached +%fillup_only rrdcached +%service_add_post rrdcached.service +%service_add_post rrdcached.socket +%if 0%{?suse_version} <= 1320 +systemd-tmpfiles --create %{_tmpfilesdir}/rddcached.conf >/dev/null 2>&1 || : +%else +%tmpfiles_create %{_tmpfilesdir}/rddcached.conf +%endif + +%preun cached +%service_del_preun rrdcached.service +%service_del_preun rrdcached.socket + +%postun cached +%service_del_postun rrdcached.service +%service_del_postun rrdcached.socket %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%defattr(-, root, root) -%doc %{_docdir}/rrdtool -%doc %{_mandir}/*/* +%defattr(-,root,root,-) +%exclude %{_docdir}/%{name} +%{_mandir}/*/* +%exclude %{_mandir}/man1/rrdcached* +%exclude %{_mandir}/man3/RRD* %{_bindir}/* %exclude %{_bindir}/rrdcached %{_libdir}/librrd.so.* %{_libdir}/librrd_th.so.* -%{perl_vendorlib}/RRDp.pm -%{perl_vendorarch}/RRDs.pm -#%{perl_vendorarch}/ntmake.pl -%{perl_vendorarch}/auto/* -#%{_datadir}/%{name} %files devel -%defattr(-, root, root) -%{_includedir}/* +%defattr(-,root,root,-) +%{_includedir}/*.h %{_libdir}/librrd_th.so %{_libdir}/librrd.so %{_libdir}/pkgconfig/librrd.pc -%files -n python-rrdtool -%defattr(-, root, root) -%{py_sitedir}/* +%files doc +%defattr(-,root,root,-) +%doc CONTRIBUTORS COPYRIGHT NEWS THREADS TODO +%doc %{_docdir}/rrdtool +%exclude %{_docdir}/rrdtool/html/RRD*.html -%files -n lua-rrdtool -%defattr(-, root, root) +%files -n perl-%{name} +%defattr(-,root,root,-) +%doc %{_docdir}/rrdtool/html/RRD*.html +%{_mandir}/man3/RRD* +%{perl_vendorlib}/RRDp.pm +%{perl_vendorarch}/RRDs.pm +%{perl_vendorarch}/auto/* + +%if %{with lua} +%files -n lua-%{name} +%defattr(-,root,root,-) +%doc bindings/lua/README %dir %{_libdir}/lua %dir %{_libdir}/lua/* %{_libdir}/lua/*/rrd.so %{_libdir}/lua/*/rrd.so.* +%endif -%files -n tcl-rrdtool -%defattr(-, root, root) +%if %{with python} +%files -n python-%{name} +%defattr(-,root,root,-) +%doc bindings/python/AUTHORS bindings/python/COPYING bindings/python/README +%{py_sitedir}/* +%endif + +%if %{with ruby} +%files -n ruby-%{name} +%defattr(-,root,root,-) +%doc bindings/ruby/README +%{rb_sitearchdir}/RRD.so +%endif + +%if %{with tcl} +%files -n tcl-%{name} +%defattr(-,root,root,-) +%doc bindings/tcl/README %{tcl_archdir}/* %{_libdir}/tclrrd*.so - -#%{!?rb_sitearchdir: %define rb_sitearchdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]')} - -%files -n ruby-rrdtool -%defattr(-, root, root) -%{rb_sitearchdir}/RRD.so +%endif %files cached -%defattr(-, root, root) +%defattr(-,root,root,-) +%{_mandir}/man1/rrdcached* %{_bindir}/rrdcached +%{_sbindir}/rcrrdcached %{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached %{_datadir}/rrdcached %{_datadir}/rrdcached/rrdcached-systemd-pre %{_unitdir}/rrdcached.service +%{_unitdir}/rrdcached.socket %if 0%{?suse_version} <= 1320 -%dir %_prefix/lib/tmpfiles.d +%dir %{_libexecdir}/tmpfiles.d %endif %{_tmpfilesdir}/rrdcached.conf - -%pre cached -getent group %rrdcached_group >/dev/null || groupadd %rrdcached_group || : -getent passwd %rrdcached_user >/dev/null || useradd -s /sbin/nologin -g %rrdcached_group -c %rrdcached_user -d %{_localstatedir}/lib %rrdcached_user || : -%service_add_pre rrdcached.service - -%post cached -%service_add_post rrdcached.service -%fillup_only rrdcached -systemd-tmpfiles --create %{_tmpfilesdir}/rrdcached.conf || : - -%preun cached -%service_del_preun rrdcached.service - -%postun cached -%service_del_postun rrdcached.service +%ghost /run/rrdcached %changelog From e7145e9282e94dff8238da19b6e97c518453c56ba3b3ff0f5962ee6d3fa7c327 Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Fri, 20 Nov 2015 09:18:56 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=68 --- rrdtool.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rrdtool.changes b/rrdtool.changes index 81ace7b..bf75b14 100644 --- a/rrdtool.changes +++ b/rrdtool.changes @@ -128,7 +128,7 @@ Wed Sep 23 07:55:35 UTC 2015 - aj@ajaissle.de - rrdtool-lua-ruby_lib64.patch - rrdtool-tclversion.patch -- Dropped cgilib-0.7.tar.gz + cglilib-fix_automake.patch (no +- Dropped cgilib-0.7.tar.gz + cgilib-fix_automake.patch (no references to cgilib or cgi.h found, so benefit unclear) - Spec cleanup