3 # Build 3rd party rpms like php-htmlpurifier, php-jpgraph.
5 # Once built, packages are in $RPM_TMP
7 #RPM_TMP=$(HOME)/rpmbuild
8 FORGE_HOME=$(shell cd ..; pwd)
9 RPM_TMP=$(FORGE_HOME)/../tmp
10 BUILDRESULT=$(FORGE_HOME)/../build/packages
12 HTMLPURIFYER_DIR=$(CURDIR)/php-htmlpurifier
13 HTMLPURIFIER_VERSION=4.3.0
14 HTMLPURIFIER_SPEC=$(HTMLPURIFYER_DIR)/php-htmlpurifier.spec
15 HTMLPURIFIER_TBZ=htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
16 HTMLPURIFIER_RPM=noarch/php-htmlpurifier-$(HTMLPURIFIER_VERSION)-1.noarch.rpm
18 JPGRAPH_DIR=$(CURDIR)/php-jpgraph
20 JPGRAPH_SPEC=$(JPGRAPH_DIR)/php-jpgraph.spec
21 JPGRAPH_TBZ=libphp-jpgraph_$(JPGRAPH_VERSION).tar.gz
22 JPGRAPH_RPM=noarch/php-jpgraph-$(JPGRAPH_VERSION)-1.noarch.rpm
23 JPGRAPH_DIFF=libphp-jpgraph_$(JPGRAPH_VERSION)-12.diff
25 WEBDAV_SERVER_DIR=$(CURDIR)/php-pear-HTTP_WebDAV_Server
26 WEBDAV_SERVER_VERSION=1.0.0RC5
27 WEBDAV_SERVER_SPEC=$(WEBDAV_SERVER_DIR)/php-pear-HTTP_WebDAV_Server.spec
28 WEBDAV_SERVER_TBZ=HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz
29 WEBDAV_SERVER_RPM=noarch/php-pear-HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION)-1.noarch.rpm
31 # rpmbuild --showrc | grep _topdir
33 # _builddir %{_topdir}/BUILD
34 # _buildrootdir %{_topdir}/BUILDROOT
35 # _rpmdir %{_topdir}/RPMS
36 # _sourcedir %{_topdir}/SOURCES
37 # _specdir %{_topdir}/SPECS
38 # _srcrpmdir %{_topdir}/SRPMS
39 # _topdir %{getenv:HOME}/rpmbuild
41 RPMBUILD=rpmbuild --quiet --define='_topdir $(RPM_TMP)' --define='_tmppath %{_topdir}' --define='_sysconfdir /etc' --define='_rpmdir $(BUILDRESULT)'
43 default: $(HTMLPURIFYER_DIR) $(JPGRAPH_DIR) $(WEBDAV_SERVER_DIR) dist getselenium
48 -rm -Rf $(HOME)/.rpmmacros $(RPM_TMP) $(BUILDRESULT)
51 -mkdir -p $(BUILDRESULT)
52 createrepo $(BUILDRESULT)/noarch 2>&1 | grep -v DeprecationWarning
55 cd selenium ; make getselenium
58 # Building RPM for external components
61 $(HTMLPURIFYER_DIR): $(BUILDRESULT)/$(HTMLPURIFIER_RPM)
63 $(BUILDRESULT)/$(HTMLPURIFIER_RPM): $(HTMLPURIFIER_SPEC) $(HTMLPURIFYER_DIR)/$(HTMLPURIFIER_TBZ)
64 $(RPMBUILD) --define='_sourcedir $(HTMLPURIFYER_DIR)' --quiet --clean -ba $(HTMLPURIFIER_SPEC)
66 $(HTMLPURIFYER_DIR)/$(HTMLPURIFIER_TBZ):
67 @cd $(HTMLPURIFYER_DIR); [ -f $@ ] || wget -q -N http://htmlpurifier.org/releases/$(HTMLPURIFIER_TBZ)
70 $(JPGRAPH_DIR): $(BUILDRESULT)/$(JPGRAPH_RPM)
72 $(BUILDRESULT)/$(JPGRAPH_RPM): $(JPGRAPH_SPEC) $(JPGRAPH_DIR)/$(JPGRAPH_DIFF)
73 $(RPMBUILD) --define='_sourcedir $(JPGRAPH_DIR)' --quiet --clean -ba $(JPGRAPH_SPEC)
75 $(JPGRAPH_DIR)/$(JPGRAPH_DIFF):
76 zcat $(JPGRAPH_DIR)/$(JPGRAPH_DIFF).gz > $(JPGRAPH_DIR)/$(JPGRAPH_DIFF)
79 $(WEBDAV_SERVER_DIR): $(BUILDRESULT)/$(WEBDAV_SERVER_RPM)
81 $(BUILDRESULT)/$(WEBDAV_SERVER_RPM): $(WEBDAV_SERVER_SPEC) $(WEBDAV_SERVER_DIR)/$(WEBDAV_SERVER_TBZ)
82 $(RPMBUILD) --define='_sourcedir $(WEBDAV_SERVER_DIR)' -v --quiet --clean -ba $(WEBDAV_SERVER_SPEC)
84 $(WEBDAV_SERVER_DIR)/$(WEBDAV_SERVER_TBZ):
85 @cd $(WEBDAV_SERVER_DIR); [ -f $@ ] || wget -q -N http://download.pear.php.net/package/$(WEBDAV_SERVER_TBZ)