4 # TODO : document the role of this Makefile
8 RPM_TMP=$(FORGE_HOME)/../tmp
9 BUILDRESULT=$(FORGE_HOME)/../build/packages
10 RPMBUILD=rpmbuild --define='_topdir $(RPM_TMP)' --define='_tmppath %{_topdir}' --define='_sysconfdir /etc' --define='_rpmdir $(BUILDRESULT)'
12 VER=$(shell LC_ALL=C sed -n '/>software_version/s/^.*'\''\([0-9.]*\)'\''.*$$/\1/p' src/common/include/FusionForge.class.php)
13 in_svn_repo:= $(wildcard .svn/)
14 ifeq ($(strip $(in_svn_repo)),)
19 ID=$(shell LANG=C svnversion|cut -d: -f1)
20 URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
21 TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
30 @echo ======================================================================================
31 @echo '= Available target are listed below ='
32 @echo '= Today only to build rpm packages and tarballs ='
33 @echo ======================================================================================
34 @cat Makefile.rh | grep '^.*:.*#$$' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
36 all: 3rd-party fusionforge dist
40 createrepo $(BUILDRESULT)/noarch
42 clean: # Clean files of fusionforge build #
43 cd $(RPM_TMP)/SOURCES/; rm -rf fusionforge-$(version).tar.bz2 fusionforge-$(version)
45 fusionforge: # Build rpm fusionforge packages #
46 cd src; find . -type f -or -type l | grep -v '/.svn/' | grep -v '/debian/' | cpio -pdumB --quiet $(RPM_TMP)/SOURCES/fusionforge-$(version)
47 cd $(RPM_TMP)/SOURCES/fusionforge-$(version)/; utils/manage-translations.sh build ; utils/manage-apache-config.sh build
48 rm -f $(RPM_TMP)/SOURCES/fusionforge-$(version)/utils/fusionforge-shell-postgresql.spec
49 cd $(RPM_TMP)/SOURCES/; cp fusionforge-$(version)/rpm-specific/patches/* .
50 cd $(RPM_TMP)/SOURCES/; tar cjf fusionforge-$(version).tar.bz2 fusionforge-$(version)
51 [ -d $(RPM_TMP)/SPECS ] || mkdir $(RPM_TMP)/SPECS
52 sed -e 's/@@VERSION@@/$(version)/g' < src/fusionforge.spec > $(RPM_TMP)/SPECS/fusionforge.spec
53 $(RPMBUILD) -bb $(RPM_TMP)/SPECS/fusionforge.spec 2>&1| grep -v '/etc/magic'
56 $(MAKE) -C 3rd-party -f Makefile.rh BUILDRESULT=$(BUILDRESULT) all