[Fusionforge-commits] r9518 - trunk/plugins/coclico

Christian Bayle cbayle at libremir.placard.fr.eu.org
Mon Apr 19 17:47:10 CEST 2010


Author: cbayle
Date: 2010-04-19 17:47:07 +0200 (Mon, 19 Apr 2010)
New Revision: 9518

Modified:
   trunk/plugins/coclico/Makefile
   trunk/plugins/coclico/Makefile.debian
Log:
Make a multitarget makefile


Modified: trunk/plugins/coclico/Makefile
===================================================================
--- trunk/plugins/coclico/Makefile	2010-04-19 14:51:08 UTC (rev 9517)
+++ trunk/plugins/coclico/Makefile	2010-04-19 15:47:07 UTC (rev 9518)
@@ -3,8 +3,24 @@
 DISTSUSE=$(shell grep -qi 'SuSE' /etc/issue && echo rh)
 DIST=$(DISTDEBIAN)$(DISTREDHAT)$(DISTSUSE)
 
+PKGDIR1=mailman
+PKGDIR2=forumml
+PKGDIR=mailman
+
+MINOR=$(shell head -1 $(PKGDIR)/debian/changelog | sed 's/.*(.*-\([^-]*\)).*/\1/')
+
+PARAM=PKGDIR=$(PKGDIR) svnrev=$(MINOR)
+
+def:
+	@echo "Use make PKGDIR=<$(PKGDIR1)|$(PKGDIR2)> <target>"	
+	@#make -f Makefile.$(DIST) $(PARAM) default
+	@echo "target=default displays all params"
+	@echo "other available targets are: "
+	@cat ../../Makefile.$(DIST) | grep '^.*:.*#$$' | sed 's/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1		\2/'
+
 default:
-	@make -f Makefile.$(DIST) default
+	@make -f Makefile.$(DIST) $(PARAM) default
+	@cat ../../Makefile.$(DIST) | grep '^.*:.*#$$' | sed 's/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1		\2/'
 
 %:
-	@make -f Makefile.$(DIST) $@
+	@make -f Makefile.$(DIST) $(PARAM) $@

Modified: trunk/plugins/coclico/Makefile.debian
===================================================================
--- trunk/plugins/coclico/Makefile.debian	2010-04-19 14:51:08 UTC (rev 9517)
+++ trunk/plugins/coclico/Makefile.debian	2010-04-19 15:47:07 UTC (rev 9518)
@@ -1,271 +1 @@
-#! /usr/bin/make -f
-
-PKGLONGNAME=LocalRepository
-
-PKGDIR=mailman
-#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
-#
-ifeq (,$(shell echo "$$BUILDERDIR"))
-BUILDERDIR=$(CURDIR)/builder
-else
-BUILDERDIR=$(shell echo $$BUILDERDIR)
-endif
-BUILDRESULT=$(CURDIR)/result
-TARBALLS=$(CURDIR)/tarballs
-#
-BUILDPLACE=$(BUILDERDIR)/buildplace
-BUILDFILES=$(BUILDERDIR)/buildfiles
-COWBUILDERBASE=$(BUILDERDIR)/cow
-PBUILDERTGZ=$(BUILDERDIR)/tgz
-APTCACHE=$(BUILDERDIR)/cache
-#
-LOCALREPODEB=/var/www/debian-fusionforge-$(BRANCH)
-LOCALREPOUBU=/var/www/ubuntu-fusionforge-$(BRANCH)
-#
-DISTRIB=$(shell echo $(XDISTRIB) | cut -c2-)
-LOCALREPODEB=/var/www/debian-fusionforge-$(BRANCH)
-LOCALREPOUBU=/var/www/ubuntu-fusionforge-$(BRANCH)
-DEBIANLIST=1lenny 2squeeze 3sid
-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)/configfile $(BUILDFILES)/$(DSCFILE) $(DEBBUILDOPTS)
-
-PBUILDERCMD=cd $(BUILDFILES) && sudo /usr/sbin/pbuilder --build --basetgz $(PBUILDERTGZ)/base-$(DISTRIB).tgz --configfile $(PBUILDERTGZ)/configfile $(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):
-	apt-get source nusoap
-#
-# 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).cow
-	@echo "Ready for $(DISTRIB)"
-
-$(PBUILDERTGZ)/base-$(DISTRIB).tgz: $(PBUILDERTGZ)/doconfig
-	[ -d $@ ] || sudo /usr/sbin/pbuilder --create --distribution $(DISTRIB) --basetgz $@ --configfile $(PBUILDERTGZ)/configfile $(DISTROOP)
-
-$(COWBUILDERBASE)/base-$(DISTRIB).cow: $(COWBUILDERBASE)/doconfig
-	[ -d $@ ] || sudo /usr/sbin/cowbuilder --create $(HOOK) --distribution $(DISTRIB) --basepath $@ --configfile $(COWBUILDERBASE)/configfile $(DISTROOP)
-
-$(PBUILDERTGZ)/doconfig: /usr/sbin/pbuilder
-	echo "APTCACHE=$(APTCACHE)" > $(PBUILDERTGZ)/configfile
-	echo "BUILDPLACE=$(BUILDPLACE)" >> $(PBUILDERTGZ)/configfile
-	echo "BUILDRESULT=$(BUILDRESULT)" >> $(PBUILDERTGZ)/configfile
-
-$(COWBUILDERBASE)/doconfig: /usr/sbin/cowbuilder
-	echo "APTCACHE=$(APTCACHE)" > $(COWBUILDERBASE)/configfile
-	echo "BUILDPLACE=$(BUILDPLACE)" >> $(COWBUILDERBASE)/configfile
-	echo "BUILDRESULT=$(BUILDRESULT)" >> $(COWBUILDERBASE)/configfile
-
-/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)
+include ../../Makefile.debian




More information about the Fusionforge-commits mailing list