[Fusionforge-commits] r9246 - trunk/3rd-party/htmlpurifier

Christian Bayle cbayle at libremir.placard.fr.eu.org
Fri Mar 26 14:52:23 CET 2010


Author: cbayle
Date: 2010-03-26 14:52:22 +0100 (Fri, 26 Mar 2010)
New Revision: 9246

Added:
   trunk/3rd-party/htmlpurifier/Makefile
   trunk/3rd-party/htmlpurifier/Makefile.debian
Log:
Make helper to build on distro htmlpurifyer is missing


Added: trunk/3rd-party/htmlpurifier/Makefile
===================================================================
--- trunk/3rd-party/htmlpurifier/Makefile	                        (rev 0)
+++ trunk/3rd-party/htmlpurifier/Makefile	2010-03-26 13:52:22 UTC (rev 9246)
@@ -0,0 +1,10 @@
+DISTDEBIAN=$(shell [ -f /etc/debian_version ] && echo debian)
+DISTREDHAT=$(shell grep -qi 'Red Hat' /etc/issue && echo rh)
+DISTSUSE=$(shell grep -qi 'SuSE' /etc/issue && echo rh)
+DIST=$(DISTDEBIAN)$(DISTREDHAT)$(DISTSUSE)
+
+default:
+	@make -f Makefile.$(DIST) default
+
+%:
+	@make -f Makefile.$(DIST) $@

Added: trunk/3rd-party/htmlpurifier/Makefile.debian
===================================================================
--- trunk/3rd-party/htmlpurifier/Makefile.debian	                        (rev 0)
+++ trunk/3rd-party/htmlpurifier/Makefile.debian	2010-03-26 13:52:22 UTC (rev 9246)
@@ -0,0 +1,263 @@
+#! /usr/bin/make -f
+
+PKGLONGNAME=LocalRepository
+
+PKGDIR=php-htmlpurifier-4.0.0+dfsg1
+#PKGDIR=$(shell dirname */debian)
+PKGNAME=$(shell head -1 $(PKGDIR)/debian/changelog 2>/dev/null| sed 's/\(.[^ ]*\) .*/\1/')
+BRANCH=$(shell [ "$(shell echo $(basename $(CURDIR)) | sed 's/.*runk.*/trunk/')" = "trunk" ] && echo svn || echo brc)
+
+PKGLETTER=$(shell echo $(PKGNAME) | cut -c1)
+ORIGIN=debian.bayle.eu
+COWPLACE=$(CURDIR)
+BUILDPLACE=$(COWPLACE)/builder/buildplace
+BUILDFILES=$(COWPLACE)/builder/buildfiles
+BUILDRESULT=$(COWPLACE)/result
+COWBUILDERBASE=$(COWPLACE)/builder/cow
+PBUILDERTGZ=$(COWPLACE)/builder/tgz
+TARBALLS=$(COWPLACE)/tarballs
+APTCACHE=$(COWPLACE)/builder/cache
+DISTRIB=$(shell echo $(XDISTRIB) | cut -c2-)
+LOCALREPODEB=/var/www/debian-fusionforge-$(BRANCH)
+LOCALREPOUBU=/var/www/ubuntu-fusionforge-$(BRANCH)
+DEBIANLIST=1lenny
+UBUNTULIST=1jaunty 1karmic 1lucid
+ASKPASS=--ask-passphrase
+#ASKPASS=
+
+# Try if a local mirror is available
+UBUNTUOP=$(shell wget -q -S http://localhost/ubuntu -O /dev/null && echo "--mirror http://localhost/ubuntu" || echo "--mirror http://archive.ubuntu.com/ubuntu") --debootstrap debootstrap
+DEBIANOP=$(shell wget -q -S http://localhost/debian -O /dev/null && echo "--mirror http://localhost/debian" || echo "--mirror http://ftp.fr.debian.org/debian") --debootstrapopts --include=apt
+
+MAJOR=$(shell head -1 $(PKGDIR)/debian/changelog 2>/dev/null| sed 's/.*(\(.[^-]*\).*).*/\1/')
+ORIGMINOR=$(shell head -1 $(PKGDIR)/debian/changelog 2>/dev/null| sed 's/.*(.[^-]*[-]\(.*\)).*/\1/')
+#svnrev=$(shell LANG=C svn info | grep Revision | cut -d: -f2| sed 's/ //g')
+
+MINOR=-1
+MINOR=-$(ORIGMINOR)+$(XDISTRIB)
+
+DEBUG=--debug
+DEBUG=
+DEBBUILDOPTS=--debbuildopts -sa 
+ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+
+UBUHOOK="--hookdir $(CURDIR)/hook/ubuntu"
+# Some doc found there http://wiki.debian.org/cowbuilder
+# Hook are not anymore necessary, but I keep as an example
+UBUHOOK="--components 'main universe' --debootstrapopts --exclude=udev,pcmciautils,initramfs-tools"
+UBUHOOK=--components "main universe" --hookdir $(CURDIR)/hook/ubuntu
+
+ORIGFILE=$(PKGNAME)_$(MAJOR).orig.tar.gz
+
+DSCFILE=$(PKGNAME)_$(MAJOR)$(MINOR).dsc
+CHANGEFILE=$(PKGNAME)_$(MAJOR)$(MINOR)_$(ARCH).changes
+
+PDSCFILE=$(PKGNAME)_$(MAJOR)$(MINOR)+p.dsc
+PCHANGEFILE=$(PKGNAME)_$(MAJOR)$(MINOR)+p_$(ARCH).changes
+
+COWBUILDERCMD=sudo /usr/sbin/cowbuilder --build --basepath $(COWBUILDERBASE)/base-$(DISTRIB).cow --configfile $(COWBUILDERBASE)/config $(BUILDFILES)/$(DSCFILE) $(DEBBUILDOPTS)
+
+PBUILDERCMD=cd $(BUILDFILES) && sudo /usr/sbin/pbuilder --build --basetgz $(PBUILDERTGZ)/base-$(DISTRIB).tgz --configfile $(PBUILDERTGZ)/config $(BUILDFILES)/$(PDSCFILE)
+
+default: list
+
+list:
+	@echo ======================================================================================
+	@echo '=                    Available target are listed below $(BRANCH)                    ='
+	@echo ======================================================================================
+	@cat Makefile.debian | grep '^.*:.*#$$' | sed 's/PKGLONGNAME/$(PKGLONGNAME)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1		\2/'
+	@echo ======================================================================================
+
+$(PKGDIR):
+	dget http://ftp.fr.debian.org/debian/pool/main/p/php-htmlpurifier/php-htmlpurifier_4.0.0+dfsg1-1.dsc
+	dpkg-source -x php-htmlpurifier_4.0.0+dfsg1-1.dsc
+#
+# Simple targets
+#
+#:======== Debian Builds ============#
+lenny:    # Simply build lenny packages #
+	make cowbuilddeb DEBIANLIST=1lenny
+
+rlenny:   # Make a lenny repository #
+	make repodeb DEBIANLIST=1lenny
+
+squeeze:  # Simply build squeeze packages #
+	make cowbuilddeb DEBIANLIST=2squeeze
+
+rsqueeze: # Make a squeeze repository #
+	make repodeb DEBIANLIST=2squeeze
+
+sid:      # Simply build sid packages #
+	make cowbuilddeb DEBIANLIST=3sid
+
+rsid:     # Make a sid repository #
+	make repodeb DEBIANLIST=3sid
+
+#:======== Ubuntu Builds ============#
+intrepid:  # Simply build intrepid packages #
+	make cowbuildubu UBUNTULIST=1intrepid
+
+rintrepid: # Make an intrepid repository #
+	make repoubu UBUNTULIST=1intrepid
+
+jaunty:    # Simply build jaunty packages #
+	make cowbuildubu UBUNTULIST=1jaunty
+
+rjaunty:   # Make a jaunty repository #
+	make repoubu UBUNTULIST=1jaunty
+
+karmic:    # Simply build karmic packages #
+	make cowbuildubu UBUNTULIST=1karmic
+
+rkarmic:   # Make a karmic repository #
+	make repoubu UBUNTULIST=1karmic
+
+#:======== Other Builds ============#
+#
+# PKGLONGNAME
+#
+orig: $(TARBALLS)/$(ORIGFILE) # Make PKGLONGNAME orig file                                      #
+
+#
+# Build with cowbuilder or pbuilder
+#
+all: $(PKGDIR) cowbuilddeb cowbuildubu # ***** Build all package for debian and ubuntu ***** #
+
+deploy: repodeb repoubu # ***** Deploy packages in Debian and Ubuntu repositories ***** #
+
+repodeb: cowbuilddeb
+	@for dist in $(DEBIANLIST); do \
+	make localrepo reprepro XDISTRIB=$$dist LOCALREPO=$(LOCALREPODEB) DISTRIBLIST="$(DEBIANLIST)" ; \
+	done
+
+repoubu: cowbuildubu
+	@for dist in $(UBUNTULIST); do \
+	make localrepo reprepro XDISTRIB=$$dist LOCALREPO=$(LOCALREPOUBU) DISTRIBLIST="$(UBUNTULIST)" ; \
+	done
+
+cowbuildtest:
+	@echo "Will build $(PKGNAME)_$(MAJOR)$(MINOR)$(DISTRIB)"
+
+cowbuilddeb: $(PKGDIR) # ***** This is the one to cowbuild debian packages ***** #
+	@for dist in $(DEBIANLIST); do \
+	make cowbuilddist XDISTRIB=$$dist DISTROOP="$(DEBIANOP)" ; \
+	done
+
+cowbuildubu: $(PKGDIR) # ***** This is the one to cowbuild ubuntu packages ***** #
+	@for dist in $(UBUNTULIST); do \
+	make cowbuilddist XDISTRIB=$$dist DISTROOP="$(UBUNTUOP)" HOOK='$(UBUHOOK)' ; \
+	done
+
+cowbuilddist: cowbuilderenv $(BUILDFILES) $(BUILDRESULT)/$(CHANGEFILE)
+	@echo "Building $(BUILDRESULT)/$(CHANGEFILE)"
+
+pbuilddist: pbuilderenv $(BUILDFILES) $(BUILDRESULT)/$(PCHANGEFILE)
+	@echo "Building $(BUILDRESULT)/$(PCHANGEFILE)"
+
+$(BUILDRESULT)/$(CHANGEFILE): $(BUILDFILES)/$(DSCFILE)
+	$(COWBUILDERCMD)
+
+$(BUILDRESULT)/$(PCHANGEFILE): $(BUILDFILES)/$(PDSCFILE)
+	$(PBUILDERCMD)
+
+$(BUILDFILES)/$(DSCFILE): $(BUILDFILES)/$(ORIGFILE)
+	cd $(PKGDIR) ; debclean
+	find $(PKGDIR) -type f -or -type l | grep -v '/CVS/' | grep -v '/.svn/' | grep -v rpm-specific | grep -v docs/phpdoc/docs | grep -v ^./debian/ | cpio -pdumB $(BUILDFILES)/
+	# Set version for given distrib
+	cd $(BUILDFILES)/$(PKGDIR); dch -b -v $(MAJOR)$(MINOR) -D UNRELEASED "This is $(DISTRIB) autobuild"
+	perl -pi -e "s/UNRELEASED/$(DISTRIB)/" $(BUILDFILES)/$(PKGDIR)/debian/changelog
+	cd $(BUILDFILES) ; dpkg-source -b $(PKGDIR)
+	rm -rf $(BUILDFILES)/$(PKGDIR)
+
+$(BUILDFILES)/$(PDSCFILE): $(BUILDFILES)/$(ORIGFILE)
+	cd $(PKGDIR) ; debclean
+	find $(PKGDIR) -type f -or -type l | grep -v '/CVS/' | grep -v '/.svn/' | grep -v rpm-specific | grep -v docs/phpdoc/docs | grep -v ^./debian/ | cpio -pdumB $(BUILDFILES)/
+	# Set version for given distrib
+	cd $(BUILDFILES)/$(PKGDIR); dch -b -v $(MAJOR)$(MINOR)+p -D UNRELEASED "This is $(DISTRIB) autobuild"
+	perl -pi -e "s/UNRELEASED/$(DISTRIB)/" $(BUILDFILES)/$(PKGDIR)/debian/changelog
+	cd $(BUILDFILES) ; dpkg-source -b $(PKGDIR)
+	rm -rf $(BUILDFILES)/$(PKGDIR)
+
+$(BUILDFILES)/$(ORIGFILE): $(TARBALLS)/$(ORIGFILE)
+	cp $(TARBALLS)/$(ORIGFILE) $(BUILDFILES)
+
+$(TARBALLS)/$(ORIGFILE): $(TARBALLS) $(ORIGFILE)
+	cp $(ORIGFILE) $(TARBALLS)/$(ORIGFILE)
+	#ln -s ../$(ORIGFILE) $(TARBALLS)/$(ORIGFILE)
+
+#$(TARBALLS)/$(ORIGFILE): $(TARBALLS)
+#	cd $(PKGDIR) ; debclean
+#	find $(PKGDIR) -type f -or -type l | grep -v '/CVS/' | grep -v '/.svn/' | grep -v rpm-specific | grep -v docs/phpdoc/docs | grep -v ^./debian/ | cpio -o -H ustar | gzip > $(TARBALLS)/$(ORIGFILE)
+	
+pbuilderenv: $(PBUILDERTGZ) $(PBUILDERTGZ)/base-$(DISTRIB).tgz
+	@echo "Ready for $(DISTRIB)"
+
+cowbuilderenv: $(COWBUILDERBASE) $(COWBUILDERBASE)/base-$(DISTRIB).stamp
+	@echo "Ready for $(DISTRIB)"
+
+$(PBUILDERTGZ)/base-$(DISTRIB).tgz: $(PBUILDERTGZ)/config
+	sudo /usr/sbin/pbuilder --create --distribution $(DISTRIB) --basetgz $(PBUILDERTGZ)/base-$(DISTRIB).tgz --configfile $(PBUILDERTGZ)/config $(DISTROOP)
+
+$(COWBUILDERBASE)/base-$(DISTRIB).stamp: $(COWBUILDERBASE)/config
+	sudo /usr/sbin/cowbuilder --create $(HOOK) --distribution $(DISTRIB) --basepath $(COWBUILDERBASE)/base-$(DISTRIB).cow --configfile $(COWBUILDERBASE)/config $(DISTROOP)
+	touch $(COWBUILDERBASE)/base-$(DISTRIB).stamp
+
+$(PBUILDERTGZ)/config: /usr/sbin/pbuilder
+	echo "APTCACHE=$(APTCACHE)" > $(PBUILDERTGZ)/config
+	echo "BUILDPLACE=$(BUILDPLACE)" >> $(PBUILDERTGZ)/config
+	echo "BUILDRESULT=$(BUILDRESULT)" >> $(PBUILDERTGZ)/config
+
+$(COWBUILDERBASE)/config: /usr/sbin/cowbuilder
+	echo "APTCACHE=$(APTCACHE)" > $(COWBUILDERBASE)/config
+	echo "BUILDPLACE=$(BUILDPLACE)" >> $(COWBUILDERBASE)/config
+	echo "BUILDRESULT=$(BUILDRESULT)" >> $(COWBUILDERBASE)/config
+
+/usr/sbin/pbuilder:
+	sudo apt-get install pbuilder
+
+ubukey:
+	gpg --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
+	gpg --export --armor 40976EAF437D05B5 | sudo apt-key add -
+
+/usr/sbin/cowbuilder:
+	sudo apt-get install cowdancer
+
+localrepo: $(LOCALREPO) $(LOCALREPO)/conf $(LOCALREPO)/conf/distributions
+	
+reprepro: $(LOCALREPO)/pool/main/$(PKGLETTER)/$(PKGNAME)/$(DSCFILE) # Install in repository
+
+$(LOCALREPO)/pool/main/$(PKGLETTER)/$(PKGNAME)/$(DSCFILE): $(BUILDRESULT)/$(CHANGEFILE)
+	cd $(BUILDRESULT); reprepro $(ASKPASS) -Vb $(LOCALREPO) include $(DISTRIB) $(CHANGEFILE)
+
+$(LOCALREPO)/conf/distributions:
+	for xdist in $(DISTRIBLIST) ; do \
+	dist=`echo $$xdist | cut -c2-` ; \
+	echo "Codename: $$dist" ; \
+	echo "Suite: $$dist" ; \
+	echo "Components: main" ; \
+	echo "UDebComponents: main" ; \
+	echo "Architectures: amd64 i386 source" ; \
+	echo "Origin: $(ORIGIN)" ; \
+	echo "Version: 0.1" ; \
+	echo "Description: My $(PKGLONGNAME) $$dist repository" ; \
+	echo "SignWith: yes" ; \
+	echo "" ; done >> $(LOCALREPO)/conf/distributions
+
+$(LOCALREPO)/conf:
+	mkdir $(LOCALREPO)/conf
+
+$(TARBALLS):
+	mkdir -p $(TARBALLS)
+
+$(BUILDFILES):
+	mkdir -p $(BUILDFILES)
+
+$(COWBUILDERBASE):
+	mkdir -p $(COWBUILDERBASE)
+
+$(PBUILDERTGZ):
+	mkdir -p $(PBUILDERTGZ)
+
+$(LOCALREPO):
+	sudo mkdir $(LOCALREPO)
+	sudo chown `id -u`.`id -g` $(LOCALREPO)




More information about the Fusionforge-commits mailing list