Makefile
author tmueller@vstst.herrje.net
Mon, 12 Feb 2007 02:14:11 +0100
changeset 0 d4b36cfa50e8
child 2 1cc19e4dfa82
permissions -rw-r--r--
initial import
tmueller@0
     1
tmueller@0
     2
WWWUSER ?= apache
tmueller@0
     3
GROUP ?= apache
tmueller@0
     4
LANGUAGE ?= en
tmueller@0
     5
tmueller@0
     6
CONTENTDIR ?= content
tmueller@0
     7
VARDIR ?= var
tmueller@0
     8
SESSIONDIR ?= $(VARDIR)/sessions
tmueller@0
     9
CGIDIR ?= cgi-bin
tmueller@0
    10
ETCDIR ?= etc
tmueller@0
    11
tmueller@0
    12
help:
tmueller@0
    13
	@echo
tmueller@0
    14
	@echo "Loona make targets"
tmueller@0
    15
	@echo "-------------------------------------------------------------------------------"
tmueller@0
    16
	@echo "help .......... This help"
tmueller@0
    17
	@echo "modules ....... Build modules"
tmueller@0
    18
	@echo "setup ......... Create initial site structure [LANGUAGE: $(LANGUAGE)]"
tmueller@0
    19
	@echo "permissions ... Set permissions [WWWUSER: $(WWWUSER), GROUP: $(GROUP)]"
tmueller@0
    20
	@echo "all ........... All of the above: modules, setup, permissions."
tmueller@0
    21
	@echo
tmueller@0
    22
	@echo "NOTE .......... Set environment variables to complement your setup, e.g."
tmueller@0
    23
	@echo "                % LANGUAGE=de WWWUSER=wwwrun make help"
tmueller@0
    24
	@echo
tmueller@0
    25
tmueller@0
    26
clean install modules: 
tmueller@0
    27
	$(MAKE) -C cgi-bin $@
tmueller@0
    28
tmueller@0
    29
setup:
tmueller@0
    30
	mkdir -p $(CONTENTDIR)
tmueller@0
    31
	-cd $(CONTENTDIR) && mkdir default_$(LANGUAGE)
tmueller@0
    32
	cd $(CONTENTDIR) && ln -snf default_$(LANGUAGE) current_$(LANGUAGE)
tmueller@0
    33
	mkdir -p $(SESSIONDIR)
tmueller@0
    34
	if test ! -f $(CONTENTDIR)/current_$(LANGUAGE)/.sections; then echo '[1] = { name = "login" }' >> $(CONTENTDIR)/current_$(LANGUAGE)/.sections; fi
tmueller@0
    35
	if test ! -f $(CONTENTDIR)/current_$(LANGUAGE)/login; then echo 'INCLUDE(login)' >> $(CONTENTDIR)/current_$(LANGUAGE)/login; fi
tmueller@0
    36
tmueller@0
    37
permissions:
tmueller@0
    38
	chmod -R 664 *
tmueller@0
    39
	chown -R :$(GROUP) *
tmueller@0
    40
	find . -type d | xargs chmod ugo+x
tmueller@0
    41
	chmod ugo+x $(CGIDIR)/weblua.cgi
tmueller@0
    42
	chown -R $(WWWUSER) $(SESSIONDIR)
tmueller@0
    43
	chown -R $(WWWUSER) $(CONTENTDIR)
tmueller@0
    44
	find . -name CVS -type d | xargs -r chmod g+rw
tmueller@0
    45
	chown $(WWWUSER):$(GROUP) $(ETCDIR)/passwd.lua
tmueller@0
    46
	chmod 460 $(ETCDIR)/passwd.lua
tmueller@0
    47
tmueller@0
    48
all:	modules setup permissions
tmueller@0
    49
tmueller@0
    50
distclean: 
tmueller@0
    51
	-rm -Rf $(CONTENTDIR)
tmueller@0
    52
	-rm -Rf $(VARDIR)