3 # Build 3rd party rpms like php-htmlpurifier, php-jpgraph.
5 # Once built, packages are in $RPM_TMP
7 #RPM_TMP=$(HOME)/rpmbuild
8 RPM_TMP=$(shell cd ..; pwd)/tmp
9 BUILDRESULT=$(HOME)/fusionforge_repo
11 HTMLPURIFYER_DIR=$(CURDIR)/php-htmlpurifier
12 HTMLPURIFIER_VERSION=4.3.0
13 HTMLPURIFIER_SPEC=$(HTMLPURIFYER_DIR)/php-htmlpurifier.spec
14 HTMLPURIFIER_TBZ=htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
15 HTMLPURIFIER_RPM=noarch/php-htmlpurifier-$(HTMLPURIFIER_VERSION)-1.noarch.rpm
17 JPGRAPH_DIR=$(CURDIR)/php-jpgraph
19 JPGRAPH_SPEC=$(JPGRAPH_DIR)/php-jpgraph.spec
20 JPGRAPH_TBZ=libphp-jpgraph_$(JPGRAPH_VERSION).tar.gz
21 JPGRAPH_RPM=noarch/php-jpgraph-$(JPGRAPH_VERSION)-1.noarch.rpm
22 JPGRAPH_DIFF=libphp-jpgraph_$(JPGRAPH_VERSION)-12.diff
24 WEBDAV_SERVER_DIR=$(CURDIR)/php-pear-HTTP_WebDAV_Server
25 WEBDAV_SERVER_VERSION=1.0.0RC5
26 WEBDAV_SERVER_SPEC=$(WEBDAV_SERVER_DIR)/php-pear-HTTP_WebDAV_Server.spec
27 WEBDAV_SERVER_TBZ=HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz
28 WEBDAV_SERVER_RPM=noarch/php-pear-HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION)-1.noarch.rpm
30 # rpmbuild --showrc | grep _topdir
32 # _builddir %{_topdir}/BUILD
33 # _buildrootdir %{_topdir}/BUILDROOT
34 # _rpmdir %{_topdir}/RPMS
35 # _sourcedir %{_topdir}/SOURCES
36 # _specdir %{_topdir}/SPECS
37 # _srcrpmdir %{_topdir}/SRPMS
38 # _topdir %{getenv:HOME}/rpmbuild
40 RPMBUILD=rpmbuild --define='_topdir $(RPM_TMP)' --define='_tmppath %{_topdir}' --define='_sysconfdir /etc' --define='_rpmdir $(BUILDRESULT)'
42 default: $(HTMLPURIFYER_DIR) $(JPGRAPH_DIR) $(WEBDAV_SERVER_DIR) dist getselenium
47 -rm -Rf $(HOME)/.rpmmacros $(RPM_TMP) $(BUILDRESULT)
50 -mkdir -p $(BUILDRESULT)
51 createrepo $(BUILDRESULT)/noarch 2>&1 | grep -v DeprecationWarning
54 cd selenium ; make getselenium
57 # Building RPM for external components
60 $(HTMLPURIFYER_DIR): $(BUILDRESULT)/$(HTMLPURIFIER_RPM)
62 $(BUILDRESULT)/$(HTMLPURIFIER_RPM): $(HTMLPURIFIER_SPEC) $(HTMLPURIFYER_DIR)/$(HTMLPURIFIER_TBZ)
63 $(RPMBUILD) --define='_sourcedir $(HTMLPURIFYER_DIR)' --quiet --clean -ba $(HTMLPURIFIER_SPEC)
65 $(HTMLPURIFYER_DIR)/$(HTMLPURIFIER_TBZ):
66 @cd $(HTMLPURIFYER_DIR); [ -f $@ ] || wget -q -N http://htmlpurifier.org/releases/$(HTMLPURIFIER_TBZ)
69 $(JPGRAPH_DIR): $(BUILDRESULT)/$(JPGRAPH_RPM)
71 $(BUILDRESULT)/$(JPGRAPH_RPM): $(JPGRAPH_SPEC) $(JPGRAPH_DIR)/$(JPGRAPH_DIFF)
72 $(RPMBUILD) --define='_sourcedir $(JPGRAPH_DIR)' --quiet --clean -ba $(JPGRAPH_SPEC)
74 $(JPGRAPH_DIR)/$(JPGRAPH_DIFF):
75 zcat $(JPGRAPH_DIR)/$(JPGRAPH_DIFF).gz > $(JPGRAPH_DIR)/$(JPGRAPH_DIFF)
78 $(WEBDAV_SERVER_DIR): $(BUILDRESULT)/$(WEBDAV_SERVER_RPM)
80 $(BUILDRESULT)/$(WEBDAV_SERVER_RPM): $(WEBDAV_SERVER_SPEC) $(WEBDAV_SERVER_DIR)/$(WEBDAV_SERVER_TBZ)
81 $(RPMBUILD) --define='_sourcedir $(WEBDAV_SERVER_DIR)' -v --quiet --clean -ba $(WEBDAV_SERVER_SPEC)
83 $(WEBDAV_SERVER_DIR)/$(WEBDAV_SERVER_TBZ):
84 @cd $(WEBDAV_SERVER_DIR); [ -f $@ ] || wget -q -N http://download.pear.php.net/package/$(WEBDAV_SERVER_TBZ)