| 1 | |
| 2 | # $Id: Makefile,v 1.5 2004/11/25 20:18:39 x99laine Exp $ |
| 3 | ################################################################################ |
| 4 | # definitions |
| 5 | |
| 6 | VERSION := $(shell grep VERSION ChangeLog | head -1 | sed -e "s/VERSION //;s/\t.*//;s/ .*//") |
| 7 | |
| 8 | PKG_NAME = platal |
| 9 | PKG_DIST = $(PKG_NAME)-$(VERSION) |
| 10 | PKG_FILES = AUTHORS ChangeLog COPYING README Makefile |
| 11 | PKG_DIRS = configs htdocs include install.d plugins po scripts templates upgrade |
| 12 | |
| 13 | VCS_FILTER = ! -name .arch-ids ! -name CVS |
| 14 | |
| 15 | ################################################################################ |
| 16 | # global targets |
| 17 | |
| 18 | all: build |
| 19 | |
| 20 | build: core banana wiki jquery |
| 21 | |
| 22 | q: |
| 23 | @echo -e "Code statistics\n" |
| 24 | @sloccount $(filter-out wiki/ spool/, $(wildcard */)) 2> /dev/null | egrep '^[a-z]*:' |
| 25 | |
| 26 | %: %.in Makefile ChangeLog |
| 27 | sed -e 's,@VERSION@,$(VERSION),g' $< > $@ |
| 28 | |
| 29 | ################################################################################ |
| 30 | # targets |
| 31 | |
| 32 | ## |
| 33 | ## core |
| 34 | ## |
| 35 | |
| 36 | core: spool/templates_c spool/mails_c include/globals.inc.php configs/platal.cron htdocs/.htaccess |
| 37 | |
| 38 | spool/templates_c spool/mails_c spool/uploads: |
| 39 | mkdir -p $@ |
| 40 | chmod o+w $@ |
| 41 | |
| 42 | htdocs/.htaccess: htdocs/.htaccess.in Makefile |
| 43 | @REWRITE_BASE="/~$$(id -un)"; \ |
| 44 | test "$$REWRITE_BASE" = "/~web" && REWRITE_BASE="/"; \ |
| 45 | sed -e "s,@REWRITE_BASE@,$$REWRITE_BASE,g" $< > $@ |
| 46 | |
| 47 | ## |
| 48 | ## wiki |
| 49 | ## |
| 50 | |
| 51 | WIKI_NEEDS = \ |
| 52 | wiki/local/farmconfig.php \ |
| 53 | wiki/pub/skins/empty \ |
| 54 | wiki/cookbook/e-protect.php \ |
| 55 | spool/wiki.d \ |
| 56 | htdocs/uploads \ |
| 57 | htdocs/wiki \ |
| 58 | |
| 59 | wiki: get-wiki build-wiki |
| 60 | |
| 61 | build-wiki: $(WIKI_NEEDS) | get-wiki |
| 62 | |
| 63 | htdocs/uploads: spool/uploads |
| 64 | cd htdocs && ln -sf ../spool/uploads |
| 65 | |
| 66 | htdocs/wiki: |
| 67 | cd htdocs && ln -sf ../wiki/pub wiki |
| 68 | |
| 69 | |
| 70 | spool/wiki.d: |
| 71 | mkdir -p $@ |
| 72 | chmod o+w $@ |
| 73 | cd $@ && ln -sf ../../include/wiki/wiki.d/* . |
| 74 | |
| 75 | |
| 76 | wiki/cookbook/e-protect.php: |
| 77 | cd wiki/cookbook && ln -sf ../../include/wiki/e-protect.php |
| 78 | |
| 79 | wiki/local/farmconfig.php: |
| 80 | cd wiki/local/ && ln -sf ../../include/wiki/farmconfig.php |
| 81 | |
| 82 | wiki/pub/skins/empty: |
| 83 | cd wiki/pub/skins/ && ln -sf ../../../include/wiki/empty |
| 84 | |
| 85 | |
| 86 | get-wiki: |
| 87 | @if ! test -d wiki; then \ |
| 88 | wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz; \ |
| 89 | tar -xzvf pmwiki-latest.tgz; \ |
| 90 | rm pmwiki-latest.tgz; \ |
| 91 | mv pmwiki-* wiki; \ |
| 92 | fi |
| 93 | |
| 94 | ## |
| 95 | ## banana |
| 96 | ## |
| 97 | |
| 98 | banana: htdocs/images/banana htdocs/css/banana.css |
| 99 | htdocs/images/banana: |
| 100 | cd $(@D) && ln -sf /usr/share/banana/img $(@F) |
| 101 | |
| 102 | htdocs/css/banana.css: |
| 103 | cd $(@D) && ln -sf /usr/share/banana/css/style.css $(@F) |
| 104 | |
| 105 | ## |
| 106 | ## jquery |
| 107 | ## |
| 108 | |
| 109 | jquery: htdocs/javascript/jquery.js htdocs/javascript/jquery.autocomplete.js |
| 110 | htdocs/javascript/jquery.js: |
| 111 | wget http://jquery.com/src/jquery-latest.pack.js -O htdocs/javascript/jquery.js -q |
| 112 | |
| 113 | ################################################################################ |
| 114 | |
| 115 | .PHONY: build dist clean wiki build-wiki banana |
| 116 | |