#
FUSIONFORGE=FusionForge
-PKGDIR=gforge
-PKGNAME=$(shell head -1 $(PKGDIR)/debian/changelog | sed 's/ .*//')
-PKGLETTER=$(shell echo $(PKGNAME) | cut -c1)
+PKGDIR=src
+PKGNAME:=$(shell head -1 $(PKGDIR)/debian/changelog | sed 's/ .*//')
+PKGLETTER:=$(shell echo $(PKGNAME) | cut -c1)
ORIGIN=debian.fusionforge.org
# BRANCH set to 'svn' if checkout from trunk or 'brc' otherwise
-BRANCH=$(shell [ "$(shell echo $(basename $(CURDIR)) | sed 's/.*runk.*/trunk/')" = "trunk" ] && echo svn || echo brc)
+BRANCH:=$(shell [ "$(shell echo $(basename $(CURDIR)) | sed 's/.*runk.*/trunk/')" = "trunk" ] && echo svn || echo brc)
#
ifeq (,$(shell echo "$$BUILDERDIR"))
BUILDERDIR=$(CURDIR)/builder
else
-BUILDERDIR=$(shell echo $$BUILDERDIR)
+BUILDERDIR:=$(shell echo $$BUILDERDIR)
endif
ifeq (,$(shell echo "$$BUILDRESULT"))
BUILDRESULT=$(CURDIR)/result
else
-BUILDRESULT=$(shell echo $$BUILDRESULT)
+BUILDRESULT:=$(shell echo $$BUILDRESULT)
endif
#
ifeq (,$(shell echo "$$UBUMIRROR"))
UBUMIRROR=http://archive.ubuntu.com/ubuntu
else
-UBUMIRROR=$(shell echo $$UBUMIRROR)
+UBUMIRROR:=$(shell echo $$UBUMIRROR)
endif
ifeq (,$(shell echo "$$DEBMIRROR"))
DEBMIRROR=http://ftp.fr.debian.org/debian
else
-DEBMIRROR=$(shell echo $$DEBMIRROR)
+DEBMIRROR:=$(shell echo $$DEBMIRROR)
+endif
+ifeq (,$(shell echo "$$DEBEMAIL"))
+DEBEMAIL=buildbot@$(shell hostname -f)
+else
+DEBEMAIL:=$(shell echo $$DEBEMAIL)
endif
#
TARBALLS=$(CURDIR)/tarballs
#
+# Local customization
+ifeq (../../3rd-party,$(shell ls -d ../../3rd-party 2>/dev/null))
+-include ../../config/local.$(shell hostname)
+else
+-include $(CURDIR)/config/local.$(shell hostname)
+endif
+#
BUILDPLACE=$(BUILDERDIR)/buildplace
BUILDFILES=$(BUILDERDIR)/buildfiles
COWBUILDERBASE=$(BUILDERDIR)/cow
LOCALREPOUBU=/var/www/ubuntu-fusionforge-$(BRANCH)
#
XDISTRIB:=3sid
-DISTRIB=$(shell echo $(XDISTRIB) | cut -c2-)
-SIGNKEY=yes
+DISTRIB:=$(shell echo $(XDISTRIB) | cut -c2-)
+SIGNKEY=$(DEBEMAIL)
+BOTKEY=botkey
DEBIANLIST=1lenny 2squeeze 3sid
DEBIANLISTP=1etch
DEBLIST=$(DEBIANLIST) $(DEBIANLISTP)
UBUNTULIST=1jaunty 1karmic 1lucid
UBUNTULISTP=1gutsy
UBULIST=$(UBUNTULIST) $(UBUNTULISTP)
-UBUNTUOP=--mirror $(UBUMIRROR) --debootstrap debootstrap
+# I had to add keyring: see https://bugs.launchpad.net/ubuntu/+source/pbuilder/+bug/599695, requires to install ubuntu-keyring package
+# wget http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2010.11.09_all.deb ; dpkg -i ubuntu-keyring_2010.11.09_all.deb
+UBUNTUOP=--mirror $(UBUMIRROR) --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg --debootstrap debootstrap
DEBIANOP=--mirror $(DEBMIRROR) --debootstrapopts --include=apt --debootstrap debootstrap
ASKPASS=--ask-passphrase
ASKPASS=
-MAJOR=$(shell head -1 $(PKGDIR)/debian/changelog | sed 's/.*(\(.*\)-[^-]*).*/\1/')
+MAJOR:=$(shell dpkg-parsechangelog -l$(PKGDIR)/debian/changelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
# SMAJOR is MAJOR without epoch if any
-SMAJOR=$(shell echo $(MAJOR) | sed 's/^.://')
+SMAJOR:=$(shell echo $(MAJOR) | sed 's/^.://')
in_svn_repo:= $(wildcard .svn/)
ifeq ($(strip $(in_svn_repo)),)
svnrev=bzr$(shell bzr revno)
endif # bzr
else
- svnrev=$(shell LANG=C svn info 2>&1 | grep Revision | cut -d: -f2| sed 's/ //g')
+ svnrev:=$(shell LANG=C svn info 2>&1 | grep Revision | cut -d: -f2| sed 's/ //g')
endif # svn
MINOR=-1
DEBUG=--debug
DEBUG=
DEBBUILDOPTS=--debbuildopts -sa
-ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
# Some doc found there http://wiki.debian.org/cowbuilder
# Hook are not anymore necessary, but I keep as an example
phpdoc: $(PKGDIR)/docs/phpdoc/docs
doc:
- (cd gforge/docs/docbook ; make debian)
+ (cd src/docs/docbook ; make debian TARGET=$(CURDIR)/build/docs/docbook/)
cleandoc:
- (cd gforge/docs/docbook ; make clean)
+ (cd src/docs/docbook ; make clean TARGET=$(CURDIR)/build/docs/docbook/)
phpdocumentor_get:
[ ! -f $(documentor_path)/$(documentor_file) ] && \
cowbuilddeb: # ***** This is the one to cowbuild debian packages ***** #
@for dist in $(DEBIANLIST); do \
- echo "$(MAKE) -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP='$(DEBIANOP)' HOOK='$(DEBHOOK)'" ; \
- $(MAKE) -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP="$(DEBIANOP)" HOOK='$(DEBHOOK)' ; \
+ echo "$(MAKE) -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP='$(DEBIANOP)' HOOK='$(DEBHOOK)' LOCALREPO=$(LOCALREPODEB)" ; \
+ $(MAKE) -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP="$(DEBIANOP)" HOOK='$(DEBHOOK)' LOCALREPO=$(LOCALREPODEB) ; \
done
cowbuildubu: # ***** This is the one to cowbuild ubuntu packages ***** #
pbuilddist: pbuilderenv $(BUILDFILES) $(BUILDRESULT)/$(PCHANGEFILE)
$(BUILDRESULT)/$(CHANGEFILE): $(BUILDFILES)/$(DSCFILE)
- $(COWBUILDERCMD)
+ @if [ -f $(LOCALREPO)/pool/main/$(PKGLETTER)/$(PKGNAME)/$(DSCFILE) ]; \
+ then echo "$@ already installed" ; \
+ else $(COWBUILDERCMD); fi
$(BUILDRESULT)/$(PCHANGEFILE): $(BUILDFILES)/$(PDSCFILE)
$(PBUILDERCMD)
$(PBUILDERTGZ)/base-$(DISTRIB)-$(ARCH).tgz: $(PBUILDERTGZ)/doconfig-$(ARCH)
[ -f $@ ] || sudo /usr/sbin/pbuilder --create --distribution $(DISTRIB) --basetgz $(PBUILDERTGZ)/base-$(DISTRIB).tgz --configfile $(PBUILDERTGZ)/configfile-$(ARCH) $(DISTROOP)
-$(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).stamp:
+$(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).stamp: /usr/sbin/cowbuilder
[ -d $(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).cow ] || sudo /usr/sbin/cowbuilder --create $(HOOK) --distribution $(DISTRIB) --basepath $(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).cow --configfile $(COWBUILDERBASE)/configfile-$(ARCH) $(DISTROOP)
touch $@.update
touch $@
/usr/sbin/cowbuilder:
@echo "Error: you need to install package 'cowdancer', for instance with 'sudo apt-get install cowdancer'." ; /bin/false
-localrepo: $(LOCALREPO) $(LOCALREPO)/conf $(LOCALREPO)/conf/distributions
+localrepo: $(LOCALREPO) $(LOCALREPO)/conf distributions #$(LOCALREPO)/conf/distributions
reprepro: $(LOCALREPO)/pool/main/$(PKGLETTER)/$(PKGNAME)/$(DSCFILE) # Install in repository
$(LOCALREPO)/pool/main/$(PKGLETTER)/$(PKGNAME)/$(DSCFILE): $(BUILDRESULT)/$(CHANGEFILE)
- @echo "Installing $(BUILDRESULT)/$(CHANGEFILE) in $@"
- cd $(BUILDRESULT); reprepro $(ASKPASS) -Vb $(LOCALREPO) include $(DISTRIB) $(CHANGEFILE)
-
-$(LOCALREPO)/conf/distributions:
+ @if [ ! -f $@ ] ; then \
+ echo "Installing $(BUILDRESULT)/$(CHANGEFILE) in $@"; \
+ cd $(BUILDRESULT); reprepro $(ASKPASS) -Vb $(LOCALREPO) include $(DISTRIB) $(CHANGEFILE); \
+ else \
+ echo "$@ already installed" ; \
+ fi
+
+#$(LOCALREPO)/conf/distributions:
+distributions:
+ -rm -f $(LOCALREPO)/conf/distributions
for xdist in $(DISTRIBLIST) ; do \
dist=`echo $$xdist | cut -c2-` ; \
echo "Codename: $$dist" ; \
mkdir -p $(PBUILDERTGZ)
$(LOCALREPO):
- sudo mkdir $@
- sudo chown `id -u`.`id -g` $@
+ if [ -w `dirname $@` ] ; then mkdir $@ ; else sudo mkdir $@ ; sudo chown `id -u`.`id -g` $@; fi
clean: # Clean $(BUILDPLACE) $(BUILDFILES) $(TARBALLS) (intermediate files) #
rm -rf $(BUILDPLACE) $(BUILDFILES) $(TARBALLS)
cleanorig: # Clean $(TARBALLS)/$(ORIGFILE) #
rm -f $(TARBALLS)/$(ORIGFILE)
+
+control:
+ cd src/packaging/control; $(MAKE)
+
+gnupgkey:
+ echo '%echo Generating a standard key' > $(BOTKEY)
+ echo 'Key-Type: DSA' >> $(BOTKEY)
+ echo 'Key-Length: 1024' >> $(BOTKEY)
+ echo 'Subkey-Type: ELG-E' >> $(BOTKEY)
+ echo 'Subkey-Length: 1024' >> $(BOTKEY)
+ echo 'Name-Real: FusionForge Bot' >> $(BOTKEY)
+ echo 'Name-Comment: with stupid passphrase' >> $(BOTKEY)
+ echo 'Name-Email: $(DEBEMAIL)' >> $(BOTKEY)
+ echo 'Expire-Date: 0' >> $(BOTKEY)
+ echo '#Passphrase: abc' >> $(BOTKEY)
+ echo '#%pubring $(BOTKEY).pub' >> $(BOTKEY)
+ echo '#%secring $(BOTKEY).sec' >> $(BOTKEY)
+ echo '# Do a commit here, so that we can later print "done" :-)' >> $(BOTKEY)
+ echo '%commit' >> $(BOTKEY)
+ echo '%echo done' >> $(BOTKEY)
+ [ -d ~/.gnupg ] || gpg --batch --gen-key $(BOTKEY)
+
+exportgnupgkey:
+ gpg --export --armor $(DEBEMAIL)