rather use a symlink from make
[platal.git] / Makefile
index 31418c5..408fd4e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 ################################################################################
 # definitions
 
-VERSION := $(shell grep VERSION ChangeLog | head -1 | sed -e "s/VERSION //;s/\t.*//")
+VERSION := $(shell grep VERSION ChangeLog | head -1 | sed -e "s/VERSION //;s/\t.*//;s/ .*//")
 
 PKG_NAME = platal
 PKG_DIST = $(PKG_NAME)-$(VERSION)
@@ -16,59 +16,68 @@ VCS_FILTER = ! -name .arch-ids ! -name CVS
 
 all: build
 
+devel: build htdocs/valid.html
+
 headers:
        headache -c install.d/platal-dev/templates/header.conf -h install.d/platal-dev/templates/header \
                `find templates -name '*.tpl' ! -path 'templates/xnet/skin.tpl' ! -path 'templates/skin/*.tpl' ! -name 'vcard.tpl' `
 
-build: pkg-build 
-
-dist: clean pkg-dist
-
-bzdist: clean pkg-bzdist
+build: spool/templates_c wiki include/platal/globals.inc.php
 
 clean:
        rm -rf include/platal/globals.inc.php
-       rm -f htdocs/banana/banana.css htdocs/valid.html include/banana htdocs/banana/img
 
 %: %.in Makefile
        sed -e 's,@VERSION@,$(VERSION),g' $< > $@
 
 ################################################################################
-# devel targets
-templates_c:
-       mkdir templates_c
-       chmod o+w templates_c
+# targets
+
+spool/templates_c spool/uploads:
+       mkdir -p $@
+       chmod o+w $@
+
+spool/wiki.d:
+       mkdir -p $@
+       chmod o+w $@
+       cd $@ && ln -sf ../../install.d/wiki/wiki.d/* .
+
+wiki/cookbook/e-protect.php:
+       cd wiki/cookbook && ln -sf ../../install.d/wiki/e-protect.php
 
 htdocs/valid.html:
-       touch templates_c/valid.html
-       ln -sf ../templates_c/valid.html htdocs/valid.html
+       touch spool/templates_c/valid.html
+       chmod o+w spool/templates_c/valid.html
+       cd htdocs && ln -sf ../spool/templates_c/valid.html
+
+htdocs/uploads:
+       cd htdocs && ln -sf ../spool/uploads
 
-devel: build templates_c htdocs/valid.html
+htdocs/img:
+       cd htdocs && ln -sf /usr/share/banana/img
 
+htdocs/wiki:
+       cd htdocs && ln -sf ../wiki/pub wiki
+
+wiki/local/farmconfig.php:
+       cd wiki/local/     && ln -sf ../../plugins/pmwiki.config.php farmconfig.php
+
+wiki/pub/skins/empty:
+       cd wiki/pub/skins/ && ln -sf ../../../install.d/wiki/empty
+
+get-wiki:
+       @if ! test -d wiki; then                                          \
+           wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz;      \
+           tar -xzvf pmwiki-latest.tgz;                                  \
+           rm pmwiki-latest.tgz;                                         \
+           mv pmwiki-* wiki;                                             \
+       fi
+
+build-wiki: wiki/local/farmconfig.php wiki/pub/skins/empty spool/wiki.d
+
+wiki: get-wiki build-wiki spool/uploads htdocs/uploads htdocs/wiki wiki/cookbook/e-protect.php
 
 ################################################################################
-# diogenes package targets
-
-pkg-build: include/platal/globals.inc.php
-
-$(PKG_DIST): pkg-build
-       mkdir $(PKG_DIST)
-       cp -a $(PKG_FILES) $(PKG_DIST)
-       for dir in `find $(PKG_DIRS) -type d $(VCS_FILTER)`; \
-       do \
-          mkdir -p $(PKG_DIST)/$$dir; \
-         find $$dir -type f -maxdepth 1 -exec cp {} $(PKG_DIST)/$$dir \; ; \
-       done
-
-pkg-dist: $(PKG_DIST)
-       rm -f $(PKG_DIST).tar.gz
-       tar czf $(PKG_DIST).tar.gz $(PKG_DIST)
-       rm -rf $(PKG_DIST)
-
-pkg-bzdist: $(PKG_DIST)
-       rm -f $(PKG_DIST).tar.bz2
-       tar cjf $(PKG_DIST).tar.bz2 $(PKG_DIST)
-       rm -rf $(PKG_DIST)
-
-.PHONY: build dist clean pkg-build pkg-dist
+
+.PHONY: build dist clean wiki build-wiki