From f7dddaa54f759c028e87c9dc56160cf4c8541c8e Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Thu, 27 Dec 2012 23:45:37 +0800 Subject: [PATCH 4/5] Use /usr/share/webapps for web reated files It is better to put static and templates files in a place other than /etc, /usr/share/webapps is a good choice which is a more Arch way. Munin hasn't officially provide the ability to configure these locations during the building period, so some dirty hacks have been performed. To avoid breaking any current installation during the upgrading, symlinks to the previous locations have been created, but this is only for an easy transition and should be removed in a later release. I have sent an email to the munin users mail list about the official support of the configurable ability for these locations, hope they could support this in a near future. --- modif/munin/Makefile.config | 2 ++ modif/munin/PKGBUILD | 10 ++++++++++ modif/munin/munin.install | 3 +++ 3 files changed, 15 insertions(+) diff --git a/modif/munin/Makefile.config b/modif/munin/Makefile.config index fd1ef6a..0f03b8f 100644 --- a/modif/munin/Makefile.config +++ b/modif/munin/Makefile.config @@ -37,6 +37,8 @@ LIBDIR = $(PREFIX)/usr/lib/munin # Server only - Output directory HTMLDIR = $(PREFIX)/var/lib/munin/www CGIDIR = $(PREFIX)/usr/share/webapps/munin/cgi +STATICDIR = $(PREFIX)/usr/share/webapps/munin/static +TMPLDIR = $(PREFIX)/usr/share/webapps/munin/templates # Where to put RRD files and other internal data, both master and node DBDIR = $(DESTDIR)/var/lib/munin diff --git a/modif/munin/PKGBUILD b/modif/munin/PKGBUILD index f038be6..db15372 100644 --- a/modif/munin/PKGBUILD +++ b/modif/munin/PKGBUILD @@ -31,6 +31,13 @@ build() { cd "$srcdir/munin-$pkgver" sed -i -e 's#/sbin/ip6tables#/usr/sbin/ip6tables#' plugins/node.d.linux/ip_.in + sed -i -e 's#$(CONFDIR)/static#$(STATICDIR)#' Makefile + sed -i -e 's#$(CONFDIR)/templates#$(TMPLDIR)#' Makefile + sed -i -e "s#-e 's|@@CONFDIR@@|\$(CONFDIR)|g'#-e 's|@@CONFDIR@@|\$(CONFDIR)|g' -e 's|@@STATICDIR@@|\$(STATICDIR)|g' -e 's|@@TMPLDIR@@|\$(TMPLDIR)|g'#" Makefile + sed -i -e 's:#staticdir\s*@@CONFDIR@@/static:staticdir @@STATICDIR@@:' master/munin.conf.in + sed -i -e 's:@@CONFDIR@@/static:@@STATICDIR@@:' master/doc/munin.conf.pod.in + sed -i -e 's:#tmpldir\s*@@CONFDIR@@/templates:tmpldir @@TMPLDIR@@:' master/munin.conf.in + sed -i -e 's:@@CONFDIR@@/templates:@@TMPLDIR@@:' master/doc/munin.conf.pod.in cp ../Makefile.config . # multithreading wrecks havoc on the build, should probably report this @@ -57,6 +64,9 @@ package_munin() { install -D -m644 ../08-munin-font-dir.conf "$pkgdir"/etc/fonts/conf.d/08-munin-font-dir.conf mv "$pkgdir"/var/lib/munin/www/.htaccess "$pkgdir"/etc/webapps/munin/.htaccess ln -s /etc/webapps/munin/.htaccess "$pkgdir"/var/lib/munin/www/.htaccess + # only for transition period, do not break anything + ln -s /usr/share/webapps/munin/static "$pkgdir"/etc/munin/static + ln -s /usr/share/webapps/munin/templates "$pkgdir"/etc/munin/templates rm -rf "$pkgdir/run" } diff --git a/modif/munin/munin.install b/modif/munin/munin.install index d7a45a9..50144a8 100644 --- a/modif/munin/munin.install +++ b/modif/munin/munin.install @@ -12,6 +12,9 @@ post_install () { echo " place you use. There is an example Apache configuration file at" echo " /etc/webapps/munin/apache.example.conf which could be included" echo " in your /etc/httd/conf/httpd.conf." + echo "==> The default location for static and template files has been changed" + echo " to /user/share/webapps/munin, please update your /etc/munin/munin.conf" + echo " accordingly." post_upgrade } -- 1.8.0.2