$NetBSD$

Installation fixed to use all essential files, populate
PKG_SYSCONFDIR as expected by the Munin scripts.

--- Makefile.orig	2012-08-31 15:22:50.000000000 +0000
+++ Makefile
@@ -67,18 +67,13 @@ tags:
 install: install-master-prime install-common-prime install-node-prime install-plugins-prime $(JAVA_INSTALL) install-man install-async-prime
 
 install-pre: Makefile Makefile.config
-	@$(CHECKUSER)
-	mkdir -p $(LOGDIR)
-	mkdir -p $(STATEDIR)
-	mkdir -p $(SPOOLDIR)
-	mkdir -p $(CONFDIR)
-	$(CHOWN) $(USER) $(LOGDIR) $(STATEDIR) $(SPOOLDIR)
+	mkdir -p $(EGDIR)
 
 install-master-prime: $(INFILES_MASTER) install-pre install-master
-	mkdir -p $(CONFDIR)/templates
-	mkdir -p $(CONFDIR)/static
-	mkdir -p $(CONFDIR)/templates/partial
-	mkdir -p $(CONFDIR)/munin-conf.d
+	mkdir -p $(EGDIR)/templates
+	mkdir -p $(EGDIR)/static
+	mkdir -p $(EGDIR)/templates/partial
+	mkdir -p $(EGDIR)/munin-conf.d
 	mkdir -p $(LIBDIR)
 	mkdir -p $(BINDIR)
 	mkdir -p $(PERLLIB)
@@ -88,29 +83,26 @@ install-master-prime: $(INFILES_MASTER)
 	mkdir -p $(DBDIR)/cgi-tmp
 	mkdir -p $(CGIDIR)
 
-	$(CHOWN) $(USER) $(HTMLDIR) $(DBDIR)
-	$(CHMOD) 0755 $(DBDIR)
-
 	$(CHOWN) $(CGIUSER) $(DBDIR)/cgi-tmp
 	$(CHMOD) 0755 $(DBDIR)/cgi-tmp
 
 	for p in master/www/*.tmpl ;  do \
-		$(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
+		$(INSTALL) -m 0644 "$$p" $(EGDIR)/templates/ ; \
 	done
 
 	for p in master/static/* ; do \
-		$(INSTALL) -m 0644 "$$p" $(CONFDIR)/static/ ; \
+		$(INSTALL) -m 0644 "$$p" $(EGDIR)/static/ ; \
 	done
 
 	for p in master/www/partial/*.tmpl; do \
-		$(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/partial/ ; \
+		$(INSTALL) -m 0644 "$$p" $(EGDIR)/templates/partial/ ; \
 	done
 
 	$(INSTALL) -m 0644 master/DejaVuSansMono.ttf $(LIBDIR)/
 	$(INSTALL) -m 0644 master/DejaVuSans.ttf $(LIBDIR)/
 
-	test -f $(HTMLDIR)/.htaccess || $(INSTALL) -m 0644 build/master/www/munin-htaccess $(HTMLDIR)/.htaccess
-	test -f "$(CONFDIR)/munin.conf"  || $(INSTALL) -m 0644 build/master/munin.conf $(CONFDIR)/
+	$(INSTALL) -m 0644 build/master/www/munin-htaccess $(HTMLDIR)/.htaccess
+	$(INSTALL) -m 0644 build/master/munin.conf $(EGDIR)/
 
 	$(INSTALL) -m 0755 build/master/_bin/munin-cron $(BINDIR)/
 	$(INSTALL) -m 0755 build/master/_bin/munin-check $(BINDIR)/
@@ -137,16 +129,7 @@ HPUXONLY=true ||
 endif
 
 install-plugins-prime: install-plugins build $(PLUGINS) Makefile Makefile.config
-	@$(CHECKGROUP)
-
-	mkdir -p $(CONFDIR)/plugins
-	mkdir -p $(CONFDIR)/plugin-conf.d
 	mkdir -p $(LIBDIR)/plugins
-	mkdir -p $(PLUGSTATE)
-
-	$(CHOWN) root:root $(PLUGSTATE)
-	$(CHMOD) 0755 $(PLUGSTATE)
-	$(CHMOD) 0755 $(CONFDIR)/plugin-conf.d
 
 	for p in build/plugins/node.d/* build/plugins/node.d.$(OSTYPE)/* ; do \
 	    if test -f "$$p" ; then                            \
@@ -181,7 +164,7 @@ install-async-prime:
 install-node-prime: install-node-pre install-node
 
 install-node-pre: build/node/munin-node.conf install-pre
-	test -f "$(CONFDIR)/munin-node.conf" || $(INSTALL) -m 0644 build/node/munin-node.conf $(CONFDIR)/
+	$(INSTALL) -m 0644 build/node/munin-node.conf $(EGDIR)/
 
 
 install-common-prime: build-common install-common
