include $(CURDIR)/../Makefile.inc

GWIKIBRANCH = default
GWIKISOURCE = https://bitbucket.org/clarifiednetworks/graphingwiki/get/$(GWIKIBRANCH).tar.gz
GWIKITARGET = graphingwiki-$(GWIKIBRANCH)-$(TIMESTAMP).tar.gz

MOINVERSION = 1.9.6
MOINSOURCE = http://static.moinmo.in/files/moin-$(MOINVERSION).tar.gz
MOINTARGET = moin-$(MOINVERSION).tar.gz

all:      tarball manifest
tarball:  $(PACKAGES)/$(GWIKITARGET) $(PACKAGES)/$(MOINTARGET)
manifest: $(MANIFESTS)/wiki.pp

$(PACKAGES)/$(GWIKITARGET):
	@umask 022; echo $@; \
	test -f $@ || curl -o $@ $(GWIKISOURCE)

$(PACKAGES)/$(MOINTARGET):
	@umask 022; echo $@; \
	test -f $@ || curl -o $@ $(MOINSOURCE)

$(MANIFESTS)/wiki.pp: $(PACKAGES)/$(GWIKITARGET) $(PACKAGES)/$(MOINTARGET)
	@umask 022; echo $@; \
	echo '$$graphingwiki_package_latest = "$(GWIKITARGET)"' > $@ && \
	echo '$$moin_package_latest = "$(MOINTARGET)"' >> $@
