diff -bur Makefile.orig Makefile --- Makefile.orig 2013-12-19 15:09:48.000000000 +0000 +++ Makefile 2014-06-29 16:27:32.000000000 +0100 @@ -7,7 +7,8 @@ # Netdot Makefile # PERL ?= /usr/bin/perl -PREFIX ?= /usr/local/netdot +PREFIX ?= /usr/local/www/netdot +STAGEDIR ?= $(PREFIX) APACHEUSER ?= apache APACHEGROUP ?= apache MAKE ?= make @@ -23,6 +24,7 @@ @echo @echo " PERL = $(PERL)" @echo " PREFIX = $(PREFIX)" + @echo " STAGEDIR = $(STAGEDIR)" @echo " APACHEUSER = $(APACHEUSER)" @echo " APACHEGROUP = $(APACHEGROUP)" @echo " MAKE = $(MAKE)" @@ -88,14 +90,14 @@ @echo "Creating necessary directories..." echo $(PREFIX) > ./.prefix for dir in $(DIR); do \ - if test -d $(PREFIX)/$$dir; then \ - echo "Skipping dir $(PREFIX)/$$dir; already exists"; \ + if test -d $(STAGEDIR)/$$dir; then \ + echo "Skipping dir $(STAGEDIR)/$$dir; already exists"; \ else \ - mkdir -m $(DMOD) -p $(PREFIX)/$$dir ; \ + mkdir -m $(DMOD) -p $(STAGEDIR)/$$dir ; \ fi ; \ done - chown -R $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/tmp - chmod 750 $(PREFIX)/tmp + chown -R $(APACHEUSER):$(APACHEGROUP) $(STAGEDIR)/tmp + chmod 750 $(STAGEDIR)/tmp htdocs: cd $@ ; $(MAKE) all DIR=$@ diff -bur doc/Makefile.orig doc/Makefile --- doc/Makefile.orig 2011-09-23 16:00:36.000000000 +0100 +++ doc/Makefile 2014-06-29 16:32:27.000000000 +0100 @@ -11,8 +11,8 @@ $(substitute) for dir in $(NDIR); do \ - chown $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/$(DIR)/$$dir; \ - chmod 0755 $(PREFIX)/$(DIR)/$$dir; \ + chown $(APACHEUSER):$(APACHEGROUP) $(STAGEDIR)/$(DIR)/$$dir; \ + chmod 0755 $(STAGEDIR)/$(DIR)/$$dir; \ done # This section creates the doc/ subdirs diff -bur etc/utility-Makefile.orig etc/utility-Makefile --- etc/utility-Makefile.orig 2012-07-13 19:17:17.000000000 +0100 +++ etc/utility-Makefile 2014-06-29 16:37:23.000000000 +0100 @@ -17,6 +17,7 @@ # Defaults REPLACE_PREFIX = $(PREFIX) +REPLACE_STAGEDIR=$(STAGEDIR) REPLACE_LIB = $(REPLACE_PREFIX)/lib REPLACE_ETC = $(REPLACE_PREFIX)/etc REPLACE_PERL = $(PERL) @@ -41,7 +42,7 @@ for file in $(FILES); do\ $(SED) -r $(REPLACEMENT_EXPRESSIONS) $$file\ > $$file.tmp;\ - install -m $(FMOD) $$file.tmp $(PREFIX)/$(DIR)/$$file;\ + install -m $(FMOD) $$file.tmp $(STAGEDIR)/$(DIR)/$$file;\ rm -rf $$file.tmp;\ done @echo "Done." @@ -51,10 +52,10 @@ define mkdirs @echo "Creating necessary directories..." for dir in $(NDIR); do \ - if test -d $(PREFIX)/$(DIR)/$$dir; then \ - echo "Skipping dir $(PREFIX)/$(DIR)/$$dir; already exists"; \ + if test -d $(STAGEDIR)/$(DIR)/$$dir; then \ + echo "Skipping dir $(STAGEDIR)/$(DIR)/$$dir; already exists"; \ else \ - mkdir -m $(DMOD) -p $(PREFIX)/$(DIR)/$$dir ; \ + mkdir -m $(DMOD) -p $(STAGEDIR)/$(DIR)/$$dir ; \ fi ; \ done @echo "Done." @@ -64,6 +65,6 @@ # left hanging around define wipedir @echo "Wiping out directory before installing" -rm -fr $(PREFIX)/$(DIR) +rm -fr $(STAGEDIR)/$(DIR) @echo "done" endef diff -bur export/Makefile.orig export/Makefile --- export/Makefile.orig 2012-07-13 19:17:17.000000000 +0100 +++ export/Makefile 2014-06-29 16:32:47.000000000 +0100 @@ -11,8 +11,8 @@ $(substitute) for dir in $(NDIR); do \ - chown $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/$(DIR)/$$dir; \ - chmod 0755 $(PREFIX)/$(DIR)/$$dir; \ + chown $(APACHEUSER):$(APACHEGROUP) $(STAGEDIR)/$(DIR)/$$dir; \ + chmod 0755 $(STAGEDIR)/$(DIR)/$$dir; \ done # This section creates the export/ subdirs diff -bur htdocs/Makefile.orig htdocs/Makefile --- htdocs/Makefile.orig 2012-07-13 19:17:17.000000000 +0100 +++ htdocs/Makefile 2014-06-29 16:33:00.000000000 +0100 @@ -9,7 +9,7 @@ all: wipedir dir $(substitute) - ln -s $(PREFIX)/doc/manual/netdot-manual.htm $(PREFIX)/$(DIR)/help/manual.html + ln -s $(PREFIX)/doc/manual/netdot-manual.htm $(STAGEDIR)/$(DIR)/help/manual.html # Wipe out dir before installing wipedir: @@ -20,10 +20,10 @@ $(mkdirs) @echo "Hacking together mason permissions fix..." - touch $(PREFIX)/$(DIR)/masondata/obj/.__obj_create_marker - chown -R $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/$(DIR)/masondata - chmod 0755 $(PREFIX)/$(DIR)/masondata + touch $(STAGEDIR)/$(DIR)/masondata/obj/.__obj_create_marker + chown -R $(APACHEUSER):$(APACHEGROUP) $(STAGEDIR)/$(DIR)/masondata + chmod 0755 $(STAGEDIR)/$(DIR)/masondata # Graphs can be updated dynamically so apache needs +w - chown $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/$(DIR)/img/graphs - chmod 0750 $(PREFIX)/$(DIR)/img/graphs + chown $(APACHEUSER):$(APACHEGROUP) $(STAGEDIR)/$(DIR)/img/graphs + chmod 0750 $(STAGEDIR)/$(DIR)/img/graphs diff -bur var/Makefile.orig var/Makefile --- var/Makefile.orig 2011-09-23 16:00:38.000000000 +0100 +++ var/Makefile 2014-06-29 16:34:01.000000000 +0100 @@ -13,7 +13,7 @@ POLLSTATSRRD = pollstats.rrd all: - if ! test -r $(PREFIX)/$(DIR)/$(POLLSTATSRRD); then \ + if ! test -r $(STAGEDIR)/$(DIR)/$(POLLSTATSRRD); then \ rrdtool create $(POLLSTATSRRD) -s 3600 \ DS:ips:GAUGE:7200:0:4294967296 \ DS:macs:GAUGE:7200:0:4294967296 \ @@ -24,5 +24,5 @@ RRA:AVERAGE:0.5:24:365 \ RRA:MAX:0.5:24:30 \ RRA:MIN:0.5:24:30; \ - install -m $(FMOD) $(POLLSTATSRRD) $(PREFIX)/$(DIR)/$(POLLSTATSRRD); \ + install -m $(FMOD) $(POLLSTATSRRD) $(STAGEDIR)/$(DIR)/$(POLLSTATSRRD); \ fi;