Makefile
author Timm S. Mueller <tmueller@neoscientists.org>
Wed, 28 Feb 2007 15:47:43 +0100
changeset 96 05626d3d948d
parent 93 f8e0c44094fc
child 105 e08375291339
permissions -rw-r--r--
Cleanup
tmueller@96
     1
root@2
     2
#
root@2
     3
#	Loona Makefile
root@2
     4
#	
tmueller@0
     5
tmueller@0
     6
WWWUSER ?= apache
tmueller@0
     7
GROUP ?= apache
tmueller@0
     8
LANGUAGE ?= en
tmueller@0
     9
root@2
    10
tmueller@0
    11
CONTENTDIR ?= content
tmueller@0
    12
VARDIR ?= var
tmueller@0
    13
SESSIONDIR ?= $(VARDIR)/sessions
tmueller@0
    14
CGIDIR ?= cgi-bin
tmueller@0
    15
ETCDIR ?= etc
tmueller@0
    16
tmueller@96
    17
tmueller@0
    18
help:
tmueller@0
    19
	@echo
tmueller@0
    20
	@echo "Loona make targets"
tmueller@0
    21
	@echo "-------------------------------------------------------------------------------"
tmueller@0
    22
	@echo "help .......... This help"
root@2
    23
	@echo
tmueller@0
    24
	@echo "modules ....... Build modules"
tmueller@0
    25
	@echo "setup ......... Create initial site structure [LANGUAGE: $(LANGUAGE)]"
tmueller@0
    26
	@echo "permissions ... Set permissions [WWWUSER: $(WWWUSER), GROUP: $(GROUP)]"
root@2
    27
	@echo
root@2
    28
	@echo "all ........... All of the above: modules, setup, permissions"
tmueller@0
    29
	@echo
tmueller@0
    30
	@echo "NOTE .......... Set environment variables to complement your setup, e.g."
tmueller@0
    31
	@echo "                % LANGUAGE=de WWWUSER=wwwrun make help"
root@2
    32
	@echo "                or make settings persistent by changing them in the Makefile"
tmueller@0
    33
	@echo
tmueller@0
    34
tmueller@96
    35
tmueller@0
    36
clean install modules: 
tmueller@0
    37
	$(MAKE) -C cgi-bin $@
tmueller@0
    38
tmueller@96
    39
tmueller@0
    40
setup:
tmueller@0
    41
	mkdir -p $(CONTENTDIR)
tmueller@0
    42
	-cd $(CONTENTDIR) && mkdir default_$(LANGUAGE)
tmueller@0
    43
	cd $(CONTENTDIR) && ln -snf default_$(LANGUAGE) current_$(LANGUAGE)
tmueller@0
    44
	mkdir -p $(SESSIONDIR)
tmueller@0
    45
	if test ! -f $(CONTENTDIR)/current_$(LANGUAGE)/.sections; then echo '[1] = { name = "login" }' >> $(CONTENTDIR)/current_$(LANGUAGE)/.sections; fi
tmueller@0
    46
	if test ! -f $(CONTENTDIR)/current_$(LANGUAGE)/login; then echo 'INCLUDE(login)' >> $(CONTENTDIR)/current_$(LANGUAGE)/login; fi
tmueller@0
    47
tmueller@96
    48
tmueller@0
    49
permissions:
tmueller@0
    50
	chmod -R 664 *
tmueller@0
    51
	chown -R :$(GROUP) *
tmueller@0
    52
	find . -type d | xargs chmod ugo+x
tmueller@93
    53
	chmod ugo+x $(CGIDIR)/loona.cgi
tmueller@0
    54
	chown -R $(WWWUSER) $(SESSIONDIR)
tmueller@0
    55
	chown -R $(WWWUSER) $(CONTENTDIR)
tmueller@0
    56
	find . -name CVS -type d | xargs -r chmod g+rw
tmueller@0
    57
	chown $(WWWUSER):$(GROUP) $(ETCDIR)/passwd.lua
tmueller@0
    58
	chmod 460 $(ETCDIR)/passwd.lua
tmueller@0
    59
tmueller@96
    60
tmueller@96
    61
all: modules setup permissions
tmueller@96
    62
tmueller@0
    63
tmueller@0
    64
distclean: 
tmueller@0
    65
	-rm -Rf $(CONTENTDIR)
tmueller@0
    66
	-rm -Rf $(VARDIR)