#! /usr/bin/make -f # # TODO : document the role of this Makefile # RPM_TMP=~/rpmbuild BUILDRESULT=~/fusionforge_repo HTMLPURIFIER_VERSION=4.1.1 VER=$(shell LANG=C grep '>software_version' gforge/common/include/FusionForge.class.php | cut -d\' -f2) in_svn_repo:= $(wildcard .svn/) ifeq ($(strip $(in_svn_repo)),) ID=unknown URL=unknown TAG=unknown else ID=$(shell LANG=C svnversion) 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}') 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: fusionforge externals dist externals : htmlpurifier php-jpgraph rpmprep: -rm -Rf $(RPM_TMP)/* -rm -Rf ~/.rpmmacros sh tools/rpmdev-setuptree echo '%_tmppath %{_topdir}/TMP' >> ~/.rpmmacros echo '%_buildroot %{_tmppath}/%{name}-root' >> ~/.rpmmacros echo '%_sysconfdir /etc' >> ~/.rpmmacros mkdir $(RPM_TMP)/TMP dist: -mkdir -p $(BUILDRESULT) cp $(RPM_TMP)/SRPMS/*.rpm $(BUILDRESULT) cp $(RPM_TMP)/RPMS/noarch/*.rpm $(BUILDRESULT) createrepo $(BUILDRESULT) clean: # Clean files of fusionforge build # cd $(RPM_TMP)/SOURCES/; rm -rf fusionforge-$(version).tar.bz2 fusionforge-$(version) fusionforge: rpmprep # Build rpm fusionforge packages # cd gforge; 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 rm -f $(RPM_TMP)/SOURCES/fusionforge-$(version)/utils/fusionforge-shell-postgresql.spec cd $(RPM_TMP)/SOURCES/; cp fusionforge-$(version)/rpm-specific/patches/* . cd $(RPM_TMP)/SOURCES/; tar cjf fusionforge-$(version).tar.bz2 fusionforge-$(version) sed -e 's/@@VERSION@@/$(version)/g' < gforge/fusionforge.spec > $(RPM_TMP)/TMP/fusionforge.spec rpmbuild -bb $(RPM_TMP)/TMP/fusionforge.spec # # Building RPM for external components # htmlpurifier: rpmprep depot/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz cp depot/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz $(RPM_TMP)/SOURCES/ rpmbuild --quiet --clean -ba 3rd-party/htmlpurifier/htmlpurifier.spec php-jpgraph: rpmprep cp 3rd-party/php-jpgraph/libphp-jpgraph_1.5.2.orig.tar.gz $(RPM_TMP)/SOURCES/jpgraph-1.5.2.tar.gz zcat 3rd-party/php-jpgraph/libphp-jpgraph_1.5.2-12.diff.gz > $(RPM_TMP)/SOURCES/libphp-jpgraph_1.5.2-12.diff cp 3rd-party/php-jpgraph/*.patch $(RPM_TMP)/SOURCES/ rpmbuild --quiet --clean -ba 3rd-party/php-jpgraph/php-jpgraph.spec depot/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz: rpmprep mkdir -p depot cd depot; wget -q -N http://htmlpurifier.org/releases/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz