DISTRIB=$(shell echo $(XDISTRIB) | cut -c2-)
LOCALREPODEB=/var/www/debian-fusionforge-$(BRANCH)
LOCALREPOUBU=/var/www/ubuntu-fusionforge-$(BRANCH)
+SIGNKEY=yes
DEBIANLIST=1lenny 2squeeze 3sid
DEBIANLISTP=1etch
DEBLIST=$(DEBIANLIST) $(DEBIANLISTP)
-UBUNTULIST=1hardy 1intrepid 1jaunty
+UBUNTULIST=1hardy 1intrepid 1jaunty 1karmic
UBUNTULISTP=1gutsy
UBULIST=$(UBUNTULIST) $(UBUNTULISTP)
# 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
+LOCALMIRROR=http://localhost/ubuntu
+UBUNTUOP=$(shell wget -q -S http://localhost/ubuntu -O /dev/null && echo "--mirror $(LOCALMIRROR)" || echo "--mirror http://archive.ubuntu.com/ubuntu") --debootstrap debootstrap
gfversion=$(shell head -1 $(PKGNAME)/debian/changelog | sed 's/.*(\(.[^+-]*\).*).*/\1/')
gfminor=$(shell head -1 $(PKGNAME)/debian/changelog | sed 's/.*(.[^+-]*[+-]\(.*\)).*/\1/')
-svnrev=$(shell LANG=C svn info | grep Revision | cut -d: -f2| sed 's/ //g')
-
+in_svn_repo:= $(wildcard .svn/)
+ifeq ($(strip $(in_svn_repo)),)
+ svnrev=unknown
+else
+ svnrev=$(shell LANG=C svn info | grep Revision | cut -d: -f2| sed 's/ //g')
+endif
MINOR=-1
MINOR=-$(BRANCH)$(svnrev)+$(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
ORIGFILE=$(PKGNAME)_$(gfversion).orig.tar.gz
DSCFILE=$(PKGNAME)_$(gfversion)$(MINOR).dsc
PDSCFILE=$(PKGNAME)_$(gfversion)$(MINOR)+p.dsc
-CHANGEFILE=$(PKGNAME)_$(gfversion)$(MINOR)_i386.changes
-PCHANGEFILE=$(PKGNAME)_$(gfversion)$(MINOR)+p_i386.changes
+CHANGEFILE=$(PKGNAME)_$(gfversion)$(MINOR)_$(ARCH).changes
+PCHANGEFILE=$(PKGNAME)_$(gfversion)$(MINOR)+p_$(ARCH).changes
# Quite heavy version, but still requires to be root
COWBUILDERCMD=cd $(BUILDPLACE) && dpkg-source -x $(BUILDFILES)/$(DSCFILE) ; cd $(BUILDPLACE)/$(PKGNAME)-$(gfversion) && pdebuild --pbuilder cowbuilder --buildresult $(BUILDRESULT) -- --basepath $(COWBUILDERBASE)/base-$(DISTRIB).cow --buildplace $(BUILDPLACE) --aptcache $(APTCACHE) ; rm -rf $(BUILDPLACE)/$(PKGNAME)-$(gfversion)
list:
@echo ======================================================================================
- @echo '= Available target are listed below ($(BRANCH)) ='
+ @echo '= Available targets are listed below ($(BRANCH))($(ARCH)) ='
@echo ======================================================================================
@cat Makefile.debian | grep '^.*:.*#$$' | sed 's/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
@echo ======================================================================================
#
# Simple targets
#
+#:======== Debian Builds ============#
lenny: # Simply build lenny packages #
make cowbuilddeb DEBIANLIST=1lenny
-rlenny:
+rlenny: # Make a lenny repository #
make repodeb DEBIANLIST=1lenny
-intrepid: # Simply build intrepid packages #
+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 and Multiple Builds ============#
documentor_path=/tmp
documentor_vers=phpdocumentor-1.3.0rc3
# PHPDOCUMENTOR
#
phpdoc: phpdocumentor_get phpdocumentor_unpack $(documentor_path)/$(documentor_vers)/patched $(PKGNAME)/docs/phpdoc/docs # Get phpdocumentor, install phpdocumentor, build $(PKGNAME) phpdoc #
-
+
phpdocumentor_get:
[ ! -f $(documentor_path)/$(documentor_vers).tar.gz ] && cd $(documentor_path) && wget http://heanet.dl.sourceforge.net/sourceforge/phpdocu/$(documentor_vers).tar.gz || true
phpdocumentor_unpack:
$(TARBALLS)/$(ORIGFILE): $(TARBALLS)
cd $(PKGNAME) ; debclean
find $(PKGNAME) -type f -or -type l | grep -v '/CVS/' | grep -v '/.svn/' | grep -v '/.testbox/' | 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)"
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)
echo "Origin: $(ORIGIN)" ; \
echo "Version: 4.7" ; \
echo "Description: My $(FUSIONFORGE) $$dist repository" ; \
- echo "SignWith: yes" ; \
+ echo "SignWith: $(SIGNKEY)" ; \
echo "" ; done >> $(LOCALREPO)/conf/distributions
$(LOCALREPO)/conf:
rm -rf $(APTCACHE)
cleanorig: # Clean $(TARBALLS)/$(ORIGFILE) #
- rm -f $(TARBALLS)/$(ORIGFILE)
\ No newline at end of file
+ rm -f $(TARBALLS)/$(ORIGFILE)