2 # This Makefile may be used to create packages for distributions
5 DISTDEBIAN=$(shell [ -f /etc/debian_version ] && echo debian)
6 DISTREDHAT=$(shell grep -qi 'Red Hat' /etc/issue && echo rh)
7 DISTSUSE=$(shell grep -qi 'SuSE' /etc/issue && echo rh)
8 DIST=$(DISTDEBIAN)$(DISTREDHAT)$(DISTSUSE)
10 ARCHIVE=$(CURDIR)/depot
14 BUILDRESULT=$(CURDIR)/result
18 VER=$(shell LC_ALL=C sed -n '/>software_version/s/^.*'\''\([0-9.]*\)'\''.*$$/\1/p' src/common/include/FusionForge.class.php)
19 in_svn_repo:= $(wildcard .svn/)
20 ifeq ($(strip $(in_svn_repo)),)
25 ID=$(shell LANG=C svnversion)
26 URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
27 TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
30 VERSION_ID=$(VER)-$(ID)
31 VERSION=fusionforge-$(VER)-$(ID)
34 VERSION=fusionforge-$(VER)
38 @echo "=========================================================================="
39 @echo "We have detected that your are running a '$(DIST)' distribution."
40 @echo "Use one of the following targets with "
41 @echo "$$ make -f Makefile.$(DIST) <target>"
42 @echo "=========================================================================="
43 @$(MAKE) -f Makefile.$(DIST)
46 ## To run test in verbose mode :
47 #cd tests ; phpunit --verbose unit; phpunit --verbose code;
48 cd tests ; php AllTests.php | perl -p -e '$$e=1 if /FAILURE/ ; END { exit 1 if $$e }'
50 checkfull: testdepends
51 ## To run test in verbose mode :
52 #cd tests ; phpunit --verbose unit; phpunit --verbose code; phpunit --verbose build
53 cd tests ; php AllFullTests.php
56 sudo apt-get install php5-cli phpunit php-htmlpurifier pcregrep moreutils createrepo xalan #ubuntu-keyring
58 buildtar: $(BUILDRESULT)
59 rm -fr /tmp/$(VERSION)
60 cd src; find . -type f -or -type l | grep -v '/.svn/' | grep -v '^./debian' | grep -v '^./deb-specific' | grep -v '^./rpm-specific' | grep -v '^./contrib' | grep -v '^./fusionforge.spec' | grep -v '~$$' | cpio -pdumB --quiet /tmp/$(VERSION)
61 cd /tmp/$(VERSION); utils/manage-translations.sh build
62 cd /tmp/; tar jcf $(BUILDRESULT)/$(VERSION).tar.bz2 $(VERSION)
63 rm -fr /tmp/$(VERSION)
69 mkdir -p $(BUILDDIR)/reports/coverage
70 cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllTests.php
71 cp $(BUILDDIR)/reports/phpunit.xml $(BUILDDIR)/reports/phpunit.xml.org; xalan -in $(BUILDDIR)/reports/phpunit.xml.org -xsl fix_phpunit.xslt -out $(BUILDDIR)/reports/phpunit.xml
74 $(DOXYGEN) src/docs/fusionforge.doxygen
75 $(DOXYGEN) src/plugins/wiki/www/doc/phpwiki.doxygen
78 mkdir -p $(BUILDDIR)/build/packages $(BUILDDIR)/reports/coverage
79 find $(BUILDDIR)/build/packages -type f -exec rm -f {} \;
80 -phpcs --tab-width=4 --standard=PEAR --report=checkstyle src/common > $(BUILDDIR)/reports/checkstyle.xml
81 cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllFullTests.php
82 cp $(BUILDDIR)/reports/phpunit.xml $(BUILDDIR)/reports/phpunit.xml.org; xalan -in $(BUILDDIR)/reports/phpunit.xml.org -xsl fix_phpunit.xslt -out $(BUILDDIR)/reports/phpunit.xml
83 cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit-selenium.xml TarCentos52Tests.php
84 cp $(BUILDDIR)/reports/phpunit-selenium.xml $(BUILDDIR)/reports/phpunit-selenium.xml.org; xalan -in $(BUILDDIR)/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $(BUILDDIR)/reports/phpunit-selenium.xml
87 src/plugins/mediawiki/mediawiki-skin/FusionForge.php:
88 $(MAKE) -C src/plugins/mediawiki/mediawiki-skin
90 %: src/plugins/mediawiki/mediawiki-skin/FusionForge.php
91 $(MAKE) -f Makefile.$(DIST) $@
93 wslink: /etc/apache2/mods-enabled/userdir.load
94 [ -d ~/public_html ] || mkdir ~/public_html
95 [ -L ~/public_html/ws ] || ln -s $(CURDIR) ~/public_html/ws
97 /etc/apache2/mods-enabled/userdir.load: