Permalink
Browse files

Fix for #1826 (Support for package staging

  • Loading branch information...
Carlos Vicente
Carlos Vicente committed Dec 8, 2014
1 parent 70eed02 commit 1493d5f86d100bb5f982fa810006e06188e45fac
Showing with 24 additions and 22 deletions.
  1. +7 −5 Makefile
  2. +2 −2 doc/Makefile
  3. +5 −5 etc/utility-Makefile
  4. +2 −2 export/Makefile
  5. +6 −6 htdocs/Makefile
  6. +2 −2 var/Makefile
View
@@ -8,6 +8,7 @@ SRCROOT := $(shell pwd)
#
PERL ?= /usr/bin/perl
PREFIX ?= /usr/local/netdot
STAGEDIR ?= $(PREFIX)
APACHEUSER ?= apache
APACHEGROUP ?= apache
MAKE ?= make
@@ -23,6 +24,7 @@ usage:
@echo
@echo " PERL = $(PERL)"
@echo " PREFIX = $(PREFIX)"
@echo " STAGEDIR = $(STAGEDIR)"
@echo " APACHEUSER = $(APACHEUSER)"
@echo " APACHEGROUP = $(APACHEGROUP)"
@echo " MAKE = $(MAKE)"
@@ -88,14 +90,14 @@ dir:
@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=$@
View
@@ -11,8 +11,8 @@ all: dir
$(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
View
@@ -41,7 +41,7 @@ define substitute
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 +51,10 @@ endef
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 +64,6 @@ endef
# left hanging around
define wipedir
@echo "Wiping out directory before installing"
rm -fr $(PREFIX)/$(DIR)
rm -fr $(STAGEDIR)/$(DIR)
@echo "done"
endef
View
@@ -11,8 +11,8 @@ all: dir
$(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
View
@@ -9,7 +9,7 @@ FILES := `find . -name "*" | egrep ".*(rest\/.*|handler|\.?html|\.css|\.png|\.gi
all: wipedir dir
$(substitute)
ln -s $(PREFIX)/doc/manual/netdot-manual.htm $(PREFIX)/$(DIR)/help/manual.html
ln -s $(STAGEDIR)/doc/manual/netdot-manual.htm $(STAGEDIR)/$(DIR)/help/manual.html
# Wipe out dir before installing
wipedir:
@@ -20,10 +20,10 @@ dir:
$(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
View
@@ -13,7 +13,7 @@ include $(SRCROOT)/etc/utility-Makefile
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 @@ all:
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;

0 comments on commit 1493d5f

Please sign in to comment.