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 ifneq ($(strip $(in_svn_repo)),)
15 ID=$(shell LANG=C svnversion|cut -d: -f1)
16 URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
17 TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
19 is_git_repo:= $(wildcard .git/)
20 ifneq ($(strip $(is_git_repo)),)
21 id=$(shell git log --pretty=format:%h | wc -l)
22 hash=$(shell git log -1 --pretty=format:%h)
37 @echo ======================================================================================
38 @echo '= Available target are listed below ='
39 @echo '= Today only to build rpm packages and tarballs ='
40 @echo ======================================================================================
41 @cat Makefile.rh | grep '^.*:.*#$$' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
43 all: 3rd-party fusionforge dist
47 createrepo $(BUILDRESULT)/noarch
49 clean: # Clean files of fusionforge build #
50 cd $(RPM_TMP)/SOURCES/; rm -rf fusionforge-$(version).tar.bz2 fusionforge-$(version)
52 fusionforge: # Build rpm fusionforge packages #
53 cd src; find . -type f -or -type l | grep -v '/.svn/' | grep -v '/debian/' | cpio -pdumB --quiet $(RPM_TMP)/SOURCES/fusionforge-$(version)
54 cd $(RPM_TMP)/SOURCES/fusionforge-$(version)/; utils/manage-translations.sh build ; utils/manage-apache-config.sh build
55 rm -f $(RPM_TMP)/SOURCES/fusionforge-$(version)/utils/fusionforge-shell-postgresql.spec
56 cd $(RPM_TMP)/SOURCES/; tar cjf fusionforge-$(version).tar.bz2 fusionforge-$(version)
57 [ -d $(RPM_TMP)/SPECS ] || mkdir $(RPM_TMP)/SPECS
58 sed -e 's/@@VERSION@@/$(version)/g' < src/fusionforge.spec > $(RPM_TMP)/SPECS/fusionforge.spec
59 $(RPMBUILD) -bb $(RPM_TMP)/SPECS/fusionforge.spec 2>&1| grep -v '/etc/magic'
62 @echo "TODO: Makefile.rh $@"
65 $(MAKE) -C 3rd-party -f Makefile.rh BUILDRESULT=$(BUILDRESULT) all