1 DISTDEBIAN=$(shell [ -f /etc/debian_version ] && echo debian)
2 DISTREDHAT=$(shell grep -qi 'Red Hat' /etc/issue && echo rh)
3 DISTSUSE=$(shell grep -qi 'SuSE' /etc/issue && echo rh)
4 DIST=$(DISTDEBIAN)$(DISTREDHAT)$(DISTSUSE)
6 ARCHIVE=$(CURDIR)/depot
7 BUILDRESULT=$(CURDIR)/result
9 VER=$(shell LANG=C grep '>software_version' gforge/common/include/FusionForge.class.php | cut -d\' -f2)
10 in_svn_repo:= $(wildcard .svn/)
11 ifeq ($(strip $(in_svn_repo)),)
16 ID=$(shell LANG=C svnversion)
17 URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
18 TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
21 VERSION=fusionforge-$(VER)-$(ID)
23 VERSION=fusionforge-$(VER)
27 @echo "=========================================================================="
28 @echo "Use one of the following target with "
29 @echo "make -f Makefile.$(DIST) <target>"
30 @echo "=========================================================================="
31 @make -f Makefile.$(DIST)
34 cd tests ; php AllTests.php
37 rm -fr /tmp/$(VERSION)
38 cd gforge; 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 '^./gforge.spec' | grep -v '^./README.setup' | grep -v '^./setup' | cpio -pdumB --quiet /tmp/$(VERSION)
39 cd /tmp/$(VERSION); utils/manage-translations.sh build
40 cd /tmp/; tar jcf $(BUILDRESULT)/$(VERSION).tar.bz2 $(VERSION)
41 cd /tmp/$(VERSION); tar zxf $(ARCHIVE)/libphp-jpgraph_1.5.2.orig.tar.gz
42 cd /tmp/$(VERSION); patch -p0 < $(ARCHIVE)/jpgraph-1.5.2-php5_and_liberation_fonts.patch
43 cd /tmp/$(VERSION); mkdir jpgraph; mv jpgraph-1.5.2/src/* jpgraph; rm -fr jpgraph-1.5.2
44 cd /tmp; tar jcf $(BUILDRESULT)/$(VERSION)-allinone.tar.bz2 $(VERSION)
45 rm -fr /tmp/$(VERSION)
48 mkdir -p $(BUILDDIR)/reports/coverage
49 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit.xml --log-pmd $(BUILDDIR)/reports/phpunit.pmd.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllTests.php
50 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
53 find $(BUILDDIR)/build/packages -type f -exec rm -f {} \;
54 mkdir -p $(BUILDDIR)/reports/coverage
55 phpdoc --title 'API Documentation' -ue on -t $(BUILDDIR)/apidocs -d gforge/common -tb '/usr/share/php/data/phpUnderControl/data/phpdoc' -o HTML:Phpuc:phpuc
56 -phpcs --tab-width=4 --standard=PEAR --report=checkstyle gforge/common > $(BUILDDIR)/reports/checkstyle.xml
57 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit.xml --log-pmd $(BUILDDIR)/reports/phpunit.pmd.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllFullTests.php
58 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
59 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit-selenium.xml TarCentos52Tests.php
60 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
63 @make -f Makefile.$(DIST) $@