From 76b4ba871596cb848a50ef5a132afc067901c8223ecf56c17700c2ee9f373daa Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 10 Dec 2019 15:58:59 +0000 Subject: [PATCH] Accepting request 755206 from home:mslacken:branches:network:cluster - updated to version 3.7.4 - added patches for a global user config under /etc/ganglia/conf.d/ and added download_js.sh which can download the external java script libararies. * new file: 0001-added-of-download_js.patch which adds download_js.sh * new file: 0002-looking-for-systemwide-user-config.patch which makes ganglia-web to serach for config in /etc/ganglia/conf.d/ OBS-URL: https://build.opensuse.org/request/show/755206 OBS-URL: https://build.opensuse.org/package/show/network:cluster/ganglia-web?expand=0&rev=16 --- 0001-added-of-download_js.patch | 145 ++++++++++++++++++ 0002-looking-for-systemwide-user-config.patch | 28 ++++ README.SUSE | 17 +- _service | 18 +++ ganglia-web-3.7.2.tar.gz | 3 - ganglia-web-3.7.4.obscpio | 3 + ganglia-web.changes | 11 ++ ganglia-web.obsinfo | 5 + ganglia-web.spec | 24 ++- 9 files changed, 234 insertions(+), 20 deletions(-) create mode 100644 0001-added-of-download_js.patch create mode 100644 0002-looking-for-systemwide-user-config.patch create mode 100644 _service delete mode 100644 ganglia-web-3.7.2.tar.gz create mode 100644 ganglia-web-3.7.4.obscpio create mode 100644 ganglia-web.obsinfo diff --git a/0001-added-of-download_js.patch b/0001-added-of-download_js.patch new file mode 100644 index 0000000..df80276 --- /dev/null +++ b/0001-added-of-download_js.patch @@ -0,0 +1,145 @@ +From 3d5c9c2e308123a9d37e7cbab33b854a304bb381 Mon Sep 17 00:00:00 2001 +From: Christian Goll +Date: Fri, 6 Dec 2019 16:42:28 +0100 +Subject: [PATCH 1/2] added of download_js + +--- + download_js.sh | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 126 insertions(+) + create mode 100755 download_js.sh + +diff --git a/download_js.sh b/download_js.sh +new file mode 100755 +index 0000000..67e26fd +--- /dev/null ++++ b/download_js.sh +@@ -0,0 +1,126 @@ ++#!/bin/bash ++CONFFILE="/srv/www/htdocs/ganglia-web/conf_default.php" ++SAVEDIR='/srv/www/htdocs/ganglia-web' ++PHPCONFDIR='/etc/apache2/conf.d/' ++PHPCONFNAME='conf.php' ++TARBALL='/tmp/ajax_ganglia.tar.gz' ++RESCRIPT='/tmp/download_js.sh' ++SUFFIX='ajax_libs' ++TMPDIR='/tmp' ++ ++function get_conf() { ++declare -f -F conf_stor > /dev/null ++if [ $? -eq 0 ] ; then ++ conf_stor ++else ++ cat ${CONFFILE} ++fi ++} ++ ++function usage() { ++cat < /dev/null ++ if [ $? -eq 0 ] ; then ++ echo "This script was recreated so could not recreate it." ++ exit 1 ++ fi ++ cat << EOF > $RESCRIPT ++#!/bin/bash ++# this file was recreated on $(uname -n) at $(date) ++function conf_stor() { ++cat <> $RESCRIPT ++ cat << EOF >> $RESCRIPT ++ ++ENDCONF ++} ++EOF ++ cat $0 | sed -e 's@#!/bin/bash@@' \ ++ -e 's@usage_set=1@usage_set=0@' \ ++ -e 's@tarball=0@tarball=1@' >> $RESCRIPT ++ echo "wrote $RESCRIPT" ++ exit 0 ++fi ++ ++ ++which curl &> /dev/null || echo "need curl to download ajax libraries" ++which curl &> /dev/null || exit 1 ++ ++if [ $tarball -eq 1 ] ; then ++ test -d ${TMPDIR}/${SUFFIX} || mkdir -vp ${TMPDIR}/${SUFFIX} ++ PHPCONFFILELOC=${TMPDIR}/${SUFFIX}/${PHPCONFNAME} ++ cd ${TMPDIR} ++else ++ test -d ${SAVEDIR}/${SUFFIX} || mkdir -vp ${SAVEDIR}/${SUFFIX} ++ PHPCONFFILELOC=${PHPCONFDIR}/${PHPCONFNAME} ++ cd ${SAVEDIR} ++fi ++ ++for lib_line in $(get_conf | grep -e '^$conf.* = \"https://cdnjs' | tr ' ' '@') ; do ++ conf_line=$(echo $lib_line | cut -f 1 -d '@') ++ url=$(echo $lib_line | cut -f 3 -d '@' |tr -d '"' | tr -d ';') ++ file_name=$(basename $url) ++ echo -n "getting ${file_name}: " ++ curl -# $url -o ${SUFFIX}/$file_name ++ echo "$conf_line = \"${SAVEDIR}/${SUFFIX}/${file_name}\";" >> ${PHPCONFFILELOC} ++done ++if [ $tarball -eq 1 ] ; then ++ tar czf ${TARBALL} ${SUFFIX} ++ echo "created ${TARBALL} , which also contains ${PHPCONFNAME}" ++fi ++cd - > /dev/null ++ +-- +2.16.4 + diff --git a/0002-looking-for-systemwide-user-config.patch b/0002-looking-for-systemwide-user-config.patch new file mode 100644 index 0000000..ca2c5db --- /dev/null +++ b/0002-looking-for-systemwide-user-config.patch @@ -0,0 +1,28 @@ +From b88b085b67e48ec5baf1bc66a973beb31b737360 Mon Sep 17 00:00:00 2001 +From: Christian Goll +Date: Mon, 9 Dec 2019 11:52:48 +0100 +Subject: [PATCH 2/2] looking for systemwide user config + +--- + eval_conf.php | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/eval_conf.php b/eval_conf.php +index b39fb2e..5e3d884 100644 +--- a/eval_conf.php ++++ b/eval_conf.php +@@ -12,6 +12,11 @@ require_once $base_dir . "/conf_default.php"; + require_once 'lib/GangliaAcl.php'; + require_once 'lib/GangliaAuth.php'; + ++# Include system-wide overrides if they exist. ++if( file_exists( "/etc/ganglia/conf.d/conf.php" ) ) { ++ include_once "/etc/ganglia/conf.d/conf.php"; ++} ++ + # Include user-defined overrides if they exist. + if( file_exists( $base_dir . "/conf.php" ) ) { + include_once $base_dir . "/conf.php"; +-- +2.16.4 + diff --git a/README.SUSE b/README.SUSE index e3dfe26..29247af 100644 --- a/README.SUSE +++ b/README.SUSE @@ -1,11 +1,10 @@ -You need to enable the apache2 php7 or php5 module, before ganglia-web works. -SLE-12* is shipped with php5 and SLE-15* is shipped with php7, for this -products you also have to add the "Web and Scripting Module". -This can be done with -a2enmod php7 -or -a2enmod php5 - -apache2 must be restarted after this +* The apache2 php7 or php5 module must be enabled , before ganglia-web works. + SLE-12* is shipped with php5 and SLE-15* is shipped with php7, for this + products you also have to add the "Web and Scripting Module". This can be done + with a2enmod php7 or a2enmod php5 + apache2 must be restarted after this +* The web interface uses some external java script libraries for a better user + experience. The script download_js.sh can be used to download this libraries + from a host with internet connection. -- cgoll@suse.de diff --git a/_service b/_service new file mode 100644 index 0000000..a7c36e8 --- /dev/null +++ b/_service @@ -0,0 +1,18 @@ + + + + https://github.com/ganglia/ganglia-web.git + + 3.7.4 + + 3.7.4 + git + + + + + *.tar + xz + + + diff --git a/ganglia-web-3.7.2.tar.gz b/ganglia-web-3.7.2.tar.gz deleted file mode 100644 index 4189ea7..0000000 --- a/ganglia-web-3.7.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98820187c98d24d3645b92d31060623de696dad331a361a19874898339523628 -size 704632 diff --git a/ganglia-web-3.7.4.obscpio b/ganglia-web-3.7.4.obscpio new file mode 100644 index 0000000..027b060 --- /dev/null +++ b/ganglia-web-3.7.4.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c33c603e9133b25bf5dc86a16d8292cf5eabec5b9020fe86db1c2ef9bcd80472 +size 2700812 diff --git a/ganglia-web.changes b/ganglia-web.changes index a15e390..e8e30d0 100644 --- a/ganglia-web.changes +++ b/ganglia-web.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Wed Dec 4 12:54:20 UTC 2019 - Christian Goll + +- updated to version 3.7.4 +- added patches for a global user config under /etc/ganglia/conf.d/ + and added download_js.sh which can download the external java + script libararies. + * new file: 0001-added-of-download_js.patch which adds download_js.sh + * new file: 0002-looking-for-systemwide-user-config.patch which + makes ganglia-web to serach for config in /etc/ganglia/conf.d/ + ------------------------------------------------------------------- Mon Apr 16 21:24:26 UTC 2018 - eich@suse.com diff --git a/ganglia-web.obsinfo b/ganglia-web.obsinfo new file mode 100644 index 0000000..8a562dd --- /dev/null +++ b/ganglia-web.obsinfo @@ -0,0 +1,5 @@ +name: ganglia-web +version: 3.7.4 +mtime: 1520973429 +commit: d4e14cce414dda46c303000b8f6c5db4db4083ed + diff --git a/ganglia-web.spec b/ganglia-web.spec index 61a771f..9136fce 100644 --- a/ganglia-web.spec +++ b/ganglia-web.spec @@ -1,7 +1,7 @@ # # spec file for package ganglia-web # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,22 +12,24 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define web_prefixdir /srv/www/htdocs/ganglia-web Name: ganglia-web -Version: 3.7.2 +Version: 3.7.4 Release: 0 Summary: Ganglia web frontend License: BSD-3-Clause Group: System/Monitoring -Url: http://ganglia.info/ -Source0: https://downloads.sourceforge.net/project/ganglia/ganglia-web/3.7.2/ganglia-web-3.7.2.tar.gz +URL: http://ganglia.info/ +Source0: ganglia-web-%{version}.tar.xz Source1: ganglia-httpd24.conf.d Source2: README.SUSE +Patch1: 0001-added-of-download_js.patch +Patch2: 0002-looking-for-systemwide-user-config.patch BuildRequires: apache2 BuildRequires: fdupes BuildRequires: rsync @@ -49,6 +51,7 @@ written in the PHP5/7 language and uses the Dwoo templating engine. %prep %setup -q +%autopatch -p1 %build cp %SOURCE2 . @@ -61,18 +64,23 @@ cp %SOURCE2 . make install install -d %{buildroot}/etc/apache2/conf.d -install %SOURCE1 %{buildroot}/etc/apache2/conf.d/%{name}.conf +install -m 644 %SOURCE1 %{buildroot}/etc/apache2/conf.d/%{name}.conf +mkdir -pv %{buildroot}%{_docdir}/%{name}/ +cp -v download_js.sh %{buildroot}%{_docdir}/%{name}/download_js.sh +# fix suprious buildroot in config +%{__sed} -i 's@%{buildroot}@@' %{buildroot}/%{web_prefixdir}/conf_default.php %fdupes %{buildroot}%{web_prefixdir} %fdupes %{buildroot}%{_localstatedir}/lib/ganglia-web %files %defattr(-,root,root) -%doc AUTHORS COPYING TODO README README.SUSE +%doc AUTHORS TODO README README.SUSE +%{_docdir}/%{name}/download_js.sh +%license COPYING %dir %{web_prefixdir}/ %dir %{web_prefixdir}/dwoo %{web_prefixdir}/* -%config(noreplace) %{web_prefixdir}/conf_default.php %config(noreplace) /etc/apache2/conf.d/%{name}.conf %dir %{_localstatedir}/lib/ganglia-web %{_localstatedir}/lib/ganglia-web/conf