#! /usr/bin/make -f
+FUSIONFORGE=FusionForge
+ORIGIN=debian.fusionforge.org
list:
@echo ======================================================================================
@echo '= Available target are listed below ='
@echo '= Today only to build debian pakages and orig tarballs ='
@echo ======================================================================================
- @cat Makefile.debian | grep '^.*:.*#$$' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
+ @cat Makefile.debian | grep '^.*:.*#$$' | sed 's/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
+ @echo ======================================================================================
-all: allgf # Build gforge #
-clean: cleangf # Clean gforge #
-allor: orig origcvs origsvn # Build gforge orig tarball #
-cleanor: # Clean gforge orig tarball #
+clean: cleangf # Clean FUSIONFORGE #
+allor: orig origcvs origsvn # Build FUSIONFORGE orig tarball #
+clnor: # Clean FUSIONFORGE orig tarball #
rm -f gforge*orig.tar.gz
-allgf: orig cleangf build # Build gforge and orig tarballs #
+allgf: orig cleangf build # Build FUSIONFORGE and orig tarballs #
allup: upload # Upload all using dput and optional where=<server> #
+dchcmd=dch -v 4.5.6-1 -D unstable "New Upstream version"
dchcmd=dch -i
dchcmd=dch
dchcmd=""
-dchcmd=dch -v 4.5.6-1 -D unstable "New Upstream version"
debuildopts=-sa
debuildopts=-sa -us -uc
debuildopts=-us -uc
-gfversion=$(shell head -1 gforge/debian/changelog | sed 's/.*(\(.*\)-.*).*/\1/')
-where=g-rouille
-where=mercure
-where=local
+gfversion=$(shell head -1 gforge/debian/changelog | sed 's/.*(\(.*\)-.*).*/\1/'| sed 's/+something/+z/')
+gfminor=$(shell head -1 gforge/debian/changelog | sed 's/.*(.*-\(.*\)).*/\1/')
+where=localhost
documentor_path=/tmp
documentor_vers=phpdocumentor-1.3.0rc3
#
-# GFORGE
+# FUSIONFORGE
#
-cleangf: # Clean debian files of gforge build #
+clngf: # Clean debian files of FUSIONFORGE build #
@rm -f gforge*.deb sourceforge*.deb gforge*.changes gforge*.upload gforge*.build gforge*.dsc gforge*[^g].tar.gz gforge*.diff.gz gforge*.asc
@echo cleangf Done
-build: # Build debian gforge packages #
+build: # Build debian FUSIONFORGE packages #
cd gforge ; debclean; $(dchcmd) ; find . -type f -or -type l | grep -v '/CVS/' | grep -v '/.svn/' | grep -v rpm-specific | grep -v docs/phpdoc/docs | cpio -pdumvB ../gforge-$(gfversion)
cd gforge-$(gfversion); debuild $(debuildopts); fakeroot debian/rules clean
rm -rf gforge-$(gfversion)
-upload: # Upload gforge packages on where=<server> using dput #
+upload: # Upload FUSIONFORGE packages on where=<server> using dput #
dput $(where) gforge*.changes
-orig: gforge_$(gfversion).orig.tar.gz # Make gforge orig file #
+orig: gforge_$(gfversion).orig.tar.gz # Make FUSIONFORGE orig file #
gforge_$(gfversion).orig.tar.gz:
cd gforge ; debclean; find . -type f -or -type l | grep -v '/CVS/' | grep -v '/.svn/' | grep -v rpm-specific | grep -v docs/phpdoc/docs | grep -v ^./debian/ | cpio -pdumvB ../gforge-$(gfversion)
tar cvzf gforge_$(gfversion).orig.tar.gz gforge-$(gfversion)
cd gforge/docs/phpdoc/ && ./makedoc.sh
#
-# Developper personal use
+# Build with pbuilder
#
-chris:
- make -f Makefile.debian allgf dchcmd="dch -i" debuildopts=""
- make -f Makefile.debian upload where=localgforge
+DISTRIB=etch
+MINOR=1
+LOCALREPO=/var/www/debian-fusionforge
+LOCALREPOUBU=/var/www/ubuntu-fusionforge
+DISTRIBLIST=etch lenny sid
+UBUNTULIST=gutsy hardy intrepid
+UBUNTUOP=--mirror http://archive.ubuntu.com/ubuntu --debootstrap debootstrap
+UBUNTUOP=--mirror http://localhost/ubuntu --debootstrap debootstrap
+DEBUG=--debug
+DEBUG=
+
+svnbuildtest:
+ @echo "Will build gforge_$(gfversion)-$(MINOR)$(DISTRIB)"
+
+svnbuild: # ***** This is the one you should use ***** #
+ for dist in $(DISTRIBLIST); do \
+ make -f Makefile.debian svnbuilddist DISTRIB=$$dist ; \
+ done
+
+svnbuildubu: # ***** This is the one to build ubuntu packages ***** #
+ for dist in $(UBUNTULIST); do \
+ make -f Makefile.debian svnbuilddist DISTRIB=$$dist DISTROOP="$(UBUNTUOP)" LOCALREPO=$(LOCALREPOUBU) DISTRIBLIST="$(UBUNTULIST)" ; \
+ done
+
+svnbuilddist: pbuilderenv localrepo result/gforge_$(gfversion)-$(MINOR)$(DISTRIB)_i386.changes
+
+result/gforge_$(gfversion)-$(MINOR)$(DISTRIB)_i386.changes: tarballs/gforge_$(gfversion).orig.tar.gz
+ # Save changelog
+ cp gforge/debian/changelog .
+ # Set version for given distrib
+ cd gforge; dch -v $(gfversion)-$(MINOR)$(DISTRIB) -D UNRELEASED "This is $(DISTRIB) autobuild"
+ perl -pi -e "s/UNRELEASED/$(DISTRIB)/" gforge/debian/changelog
+ # Build the package
+ cd gforge; svn-buildpackage --svn-ignore --svn-builder="pdebuild --debbuildopts -sa --buildresult $(CURDIR)/result -- --basetgz $(CURDIR)/pbuilder/base-$(DISTRIB).tgz"
+ # Restore changelog
+ mv changelog gforge/debian/changelog
+ # Install in repository
+ cd result; reprepro -Vb $(LOCALREPO) include $(DISTRIB) gforge_$(gfversion)-$(MINOR)$(DISTRIB)_i386.changes
+
+tarballs/gforge_$(gfversion).orig.tar.gz: tarballs
+ debclean; find gforge -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/gforge_$(gfversion).orig.tar.gz
+
+tarballs:
+ mkdir tarballs
+
+pbuilderenv: pbuilder pbuilder/base-$(DISTRIB).tgz
+ @echo "Ready for $(DISTRIB)"
+
+pbuilder/base-$(DISTRIB).tgz: /usr/sbin/pbuilder
+ sudo /usr/sbin/pbuilder create $(DEBUG) --distribution $(DISTRIB) --basetgz $(CURDIR)/pbuilder/base-$(DISTRIB).tgz $(DISTROOP)
+
+/usr/sbin/pbuilder:
+ sudo apt-get install pbuilder
+
+pbuilder:
+ mkdir pbuilder
+
+localrepo: $(LOCALREPO) $(LOCALREPO)/conf $(LOCALREPO)/conf/distributions
+
+$(LOCALREPO)/conf/distributions:
+ for dist in $(DISTRIBLIST); do \
+ echo "Codename: $$dist" ; \
+ echo "Suite: $$dist" ; \
+ echo "Components: main" ; \
+ echo "UDebComponents: main" ; \
+ echo "Architectures: i386 source" ; \
+ echo "Origin: $(ORIGIN)" ; \
+ echo "Version: 4.7" ; \
+ echo "Description: My $(FUSIONFORGE) $$dist repository" ; \
+ echo "SignWith: yes" ; \
+ echo "" ; done >> $(LOCALREPO)/conf/distributions
+
+$(LOCALREPO)/conf:
+ mkdir $(LOCALREPO)/conf
+
+$(LOCALREPO):
+ sudo mkdir $(LOCALREPO)
+ sudo chown `id -u`.`id -g` $(LOCALREPO)