#! /usr/bin/make -f # # TODO : document the role of this Makefile # FORGE_HOME=$(CURDIR) RPM_TMP=$(FORGE_HOME)/../tmp BUILDRESULT=$(FORGE_HOME)/../build/packages RPMBUILD=rpmbuild --define='_topdir $(RPM_TMP)' --define='_tmppath %{_topdir}' --define='_sysconfdir /etc' --define='_rpmdir $(BUILDRESULT)' VER=$(shell LC_ALL=C sed -n '/>software_version/s/^.*'\''\([0-9.]*\)'\''.*$$/\1/p' src/common/include/FusionForge.class.php) in_svn_repo:= $(wildcard .svn/) ifneq ($(strip $(in_svn_repo)),) ID=$(shell LANG=C svnversion|cut -d: -f1) URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}') TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}') else is_git_repo:= $(wildcard .git/) ifneq ($(strip $(is_git_repo)),) id=$(shell git log --pretty=format:%h | wc -l) hash=$(shell git log -1 --pretty=format:%h) ID=$(id).$(hash) else ID=unknown URL=unknown TAG=unknown endif endif ifeq ($(TAG),) version=$(VER).$(ID) else version=$(VER) endif list: @echo ====================================================================================== @echo '= Available target are listed below =' @echo '= Today only to build rpm packages and tarballs =' @echo ====================================================================================== @cat Makefile.rh | grep '^.*:.*#$$' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/' all: 3rd-party fusionforge dist src: 3rd-party dist dist: createrepo $(BUILDRESULT)/noarch clean: # Clean files of fusionforge build # cd $(RPM_TMP)/SOURCES/; rm -rf fusionforge-$(version).tar.bz2 fusionforge-$(version) fusionforge: # Build rpm fusionforge packages # cd src; find . -type f -or -type l | grep -v '/.svn/' | grep -v '/debian/' | cpio -pdumB --quiet $(RPM_TMP)/SOURCES/fusionforge-$(version) cd $(RPM_TMP)/SOURCES/fusionforge-$(version)/; utils/manage-translations.sh build ; utils/manage-apache-config.sh build rm -f $(RPM_TMP)/SOURCES/fusionforge-$(version)/utils/fusionforge-shell-postgresql.spec cd $(RPM_TMP)/SOURCES/; tar cjf fusionforge-$(version).tar.bz2 fusionforge-$(version) [ -d $(RPM_TMP)/SPECS ] || mkdir $(RPM_TMP)/SPECS sed -e 's/@@VERSION@@/$(version)/g' < src/fusionforge.spec > $(RPM_TMP)/SPECS/fusionforge.spec $(RPMBUILD) -bb $(RPM_TMP)/SPECS/fusionforge.spec 2>&1| grep -v '/etc/magic' testdepends: @echo "TODO: Makefile.rh $@" 3rd-party: $(MAKE) -C 3rd-party -f Makefile.rh BUILDRESULT=$(BUILDRESULT) all .PHONY : 3rd-party