#! /usr/bin/make -f # # Build 3rd party rpms like php-htmlpurifier, php-jpgraph. # # Once built, packages are in $RPM_TMP #RPM_TMP=$(HOME)/rpmbuild FORGE_HOME=$(shell cd ..; pwd) RPM_TMP=$(FORGE_HOME)/../tmp BUILDRESULT=$(FORGE_HOME)/../build/packages HTMLPURIFYER_DIR=$(CURDIR)/php-htmlpurifier HTMLPURIFIER_VERSION=4.4.0 HTMLPURIFIER_SPEC=$(HTMLPURIFYER_DIR)/php-htmlpurifier.spec HTMLPURIFIER_TBZ=htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz HTMLPURIFIER_RPM=noarch/php-htmlpurifier-$(HTMLPURIFIER_VERSION)-1.noarch.rpm JPGRAPH_DIR=$(CURDIR)/php-jpgraph JPGRAPH_VERSION=1.5.2 JPGRAPH_SPEC=$(JPGRAPH_DIR)/php-jpgraph.spec JPGRAPH_TBZ=libphp-jpgraph_$(JPGRAPH_VERSION).tar.gz JPGRAPH_RPM=noarch/php-jpgraph-$(JPGRAPH_VERSION)-1.noarch.rpm JPGRAPH_DIFF=libphp-jpgraph_$(JPGRAPH_VERSION)-12.diff WEBDAV_SERVER_DIR=$(CURDIR)/php-pear-HTTP_WebDAV_Server WEBDAV_SERVER_VERSION=1.0.0RC5 WEBDAV_SERVER_SPEC=$(WEBDAV_SERVER_DIR)/php-pear-HTTP_WebDAV_Server.spec WEBDAV_SERVER_TBZ=HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz WEBDAV_SERVER_RPM=noarch/php-pear-HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION)-1.noarch.rpm # rpmbuild --showrc | grep _topdir # gives # _builddir %{_topdir}/BUILD # _buildrootdir %{_topdir}/BUILDROOT # _rpmdir %{_topdir}/RPMS # _sourcedir %{_topdir}/SOURCES # _specdir %{_topdir}/SPECS # _srcrpmdir %{_topdir}/SRPMS # _topdir %{getenv:HOME}/rpmbuild RPMBUILD=rpmbuild --quiet --define='_topdir $(RPM_TMP)' --define='_tmppath %{_topdir}' --define='_sysconfdir /etc' --define='_rpmdir $(BUILDRESULT)' default: $(HTMLPURIFYER_DIR) $(JPGRAPH_DIR) $(WEBDAV_SERVER_DIR) dist getselenium all: clean default clean: -rm -Rf $(HOME)/.rpmmacros $(RPM_TMP) $(BUILDRESULT) dist: -mkdir -p $(BUILDRESULT) createrepo $(BUILDRESULT)/noarch 2>&1 | grep -v DeprecationWarning getselenium: cd selenium ; make getselenium # # Building RPM for external components # # HTML PURIFIER $(HTMLPURIFYER_DIR): $(BUILDRESULT)/$(HTMLPURIFIER_RPM) $(BUILDRESULT)/$(HTMLPURIFIER_RPM): $(HTMLPURIFIER_SPEC) $(HTMLPURIFYER_DIR)/$(HTMLPURIFIER_TBZ) $(RPMBUILD) --define='_sourcedir $(HTMLPURIFYER_DIR)' --quiet --clean -ba $(HTMLPURIFIER_SPEC) $(HTMLPURIFYER_DIR)/$(HTMLPURIFIER_TBZ): @cd $(HTMLPURIFYER_DIR); [ -f $@ ] || wget -q -N http://htmlpurifier.org/releases/$(HTMLPURIFIER_TBZ) # PHP JPGRAPH $(JPGRAPH_DIR): $(BUILDRESULT)/$(JPGRAPH_RPM) $(BUILDRESULT)/$(JPGRAPH_RPM): $(JPGRAPH_SPEC) $(JPGRAPH_DIR)/$(JPGRAPH_DIFF) $(RPMBUILD) --define='_sourcedir $(JPGRAPH_DIR)' --quiet --clean -ba $(JPGRAPH_SPEC) $(JPGRAPH_DIR)/$(JPGRAPH_DIFF): zcat $(JPGRAPH_DIR)/$(JPGRAPH_DIFF).gz > $(JPGRAPH_DIR)/$(JPGRAPH_DIFF) # WEBDAV SERVER $(WEBDAV_SERVER_DIR): $(BUILDRESULT)/$(WEBDAV_SERVER_RPM) $(BUILDRESULT)/$(WEBDAV_SERVER_RPM): $(WEBDAV_SERVER_SPEC) $(WEBDAV_SERVER_DIR)/$(WEBDAV_SERVER_TBZ) $(RPMBUILD) --define='_sourcedir $(WEBDAV_SERVER_DIR)' -v --quiet --clean -ba $(WEBDAV_SERVER_SPEC) $(WEBDAV_SERVER_DIR)/$(WEBDAV_SERVER_TBZ): @cd $(WEBDAV_SERVER_DIR); [ -f $@ ] || wget -q -N http://download.pear.php.net/package/$(WEBDAV_SERVER_TBZ)