3 FUSIONFORGE=FusionForge
4 ORIGIN=debian.fusionforge.org
5 BUILDPLACE=$(CURDIR)/builder/buildplace
6 BUILDFILES=$(CURDIR)/builder/buildfiles
7 BUILDRESULT=$(CURDIR)/result
8 COWBUILDERBASE=$(CURDIR)/builder/cow
9 PBUILDERTGZ=$(CURDIR)/builder/tgz
10 TARBALLS=$(CURDIR)/tarballs
11 APTCACHE=$(CURDIR)/builder/cache
13 DISTRIB=$(shell echo $(XDISTRIB) | cut -c2-)
14 LOCALREPODEB=/var/www/debian-fusionforge
15 LOCALREPOUBU=/var/www/ubuntu-fusionforge
16 DEBIANLIST=1lenny 2squeeze 3sid
18 UBUNTULIST=1gutsy 1hardy 1intrepid 1jaunty
20 # Try if a local mirror is available
21 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
23 gfversion=$(shell head -1 gforge/debian/changelog | sed 's/.*(\(.[^+-]*\).*).*/\1/')
24 gfminor=$(shell head -1 gforge/debian/changelog | sed 's/.*(.[^+-]*[+-]\(.*\)).*/\1/')
25 svnrev=$(shell LANG=C svn info | grep Revision | cut -d: -f2| sed 's/ //g')
30 #make -f Makefile.debian cowbuilddist XDISTRIB=2squeeze LOCALREPO=$(LOCALREPODEB)
33 @echo ======================================================================================
34 @echo '= Available target are listed below ='
35 @echo ======================================================================================
36 @cat Makefile.debian | grep '^.*:.*#$$' | sed 's/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
37 @echo ======================================================================================
40 documentor_vers=phpdocumentor-1.3.0rc3
46 orig: $(TARBALLS)/gforge_$(gfversion).orig.tar.gz # Make FUSIONFORGE orig file #
51 phpdoc: phpdocumentor_get phpdocumentor_unpack $(documentor_path)/$(documentor_vers)/patched gforge/docs/phpdoc/docs # Get phpdocumentor, install phpdocumentor, build gforge phpdoc #
54 [ ! -f $(documentor_path)/$(documentor_vers).tar.gz ] && cd $(documentor_path) && wget http://heanet.dl.sourceforge.net/sourceforge/phpdocu/$(documentor_vers).tar.gz || true
56 [ ! -d $(documentor_path)/$(documentor_vers) ] && cd $(documentor_path) && tar xvzf $(documentor_vers).tar.gz || true
57 $(documentor_path)/$(documentor_vers)/patched:
58 cd $(documentor_path)/ && patch -p2 < $(CURDIR)/gforge/docs/phpdoc/manageclass.patch && touch $(documentor_path)/$(documentor_vers)/patched
59 gforge/docs/phpdoc/docs:
60 cd gforge/docs/phpdoc/ && ./makedoc.sh
63 # Build with cowbuilder or pbuilder
67 DEBBUILDOPTS=--debbuildopts -sa
70 all: cowbuilddeb cowbuildubu # ***** Build all package for debian and ubuntu ***** #
73 @echo "Will build gforge_$(gfversion)$(MINOR)$(DISTRIB)"
75 cowbuilddeb: # ***** This is the one to cowbuild debian packages ***** #
76 @for dist in $(DEBIANLIST); do \
77 make -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP="$(DEBIANOP)" LOCALREPO=$(LOCALREPODEB) ; \
80 cowbuildubu: # ***** This is the one to cowbuild ubuntu packages ***** #
81 @for dist in $(UBUNTULIST); do \
82 make -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP="$(UBUNTUOP)" LOCALREPO=$(LOCALREPOUBU) HOOK="--no-cowdancer-update --hookdir $(CURDIR)/hook/ubuntu"; \
85 pbuilddeb: # ***** This is the one to pbuild debian packages ***** #
86 @for dist in $(DEBIANLISTP); do \
87 make -f Makefile.debian pbuilddist XDISTRIB=$$dist DISTROOP="$(DEBIANOP)" LOCALREPO=$(LOCALREPODEB) ; \
90 pbuildubu: # ***** This is the one to pbuild ubuntu packages ***** #
91 @for dist in $(UBUNTULISTP); do \
92 make -f Makefile.debian pbuilddist XDISTRIB=$$dist DISTROOP="$(UBUNTUOP)" LOCALREPO=$(LOCALREPOUBU) ; \
95 cowbuilddist: cowbuilderenv localrepo $(BUILDFILES) $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes
96 @echo "Building $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes"
98 pbuilddist: pbuilderenv localrepo $(BUILDFILES) $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)+p_i386.changes
99 @echo "Building $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)+p_i386.changes"
101 $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes: $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB).dsc
102 cd $(BUILDFILES) ; sudo cowbuilder --build --basepath $(COWBUILDERBASE)/base-$(DISTRIB).cow --configfile $(COWBUILDERBASE)/config $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB).dsc
104 $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)+p_i386.changes: $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)+p.dsc
105 cd $(BUILDFILES) ; sudo pbuilder --build --basetgz $(PBUILDERTGZ)/base-$(DISTRIB).tgz --configfile $(PBUILDERTGZ)/config $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)+p.dsc
107 # Install in repository
108 #TODO#cd $(BUILDRESULT); reprepro -Vb $(LOCALREPO) include $(DISTRIB) gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes
110 $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB).dsc: $(BUILDFILES)/gforge_$(gfversion).orig.tar.gz
112 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 -pdumB $(BUILDFILES)/
113 # Set version for given distrib
114 cd $(BUILDFILES)/gforge; dch -b -v $(gfversion)$(MINOR)$(XDISTRIB) -D UNRELEASED "This is $(DISTRIB) autobuild"
115 perl -pi -e "s/UNRELEASED/$(DISTRIB)/" $(BUILDFILES)/gforge/debian/changelog
116 cd $(BUILDFILES) ; dpkg-source -b gforge
117 rm -rf $(BUILDFILES)/gforge
119 $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)+p.dsc: $(BUILDFILES)/gforge_$(gfversion).orig.tar.gz
121 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 -pdumB $(BUILDFILES)/
122 # Set version for given distrib
123 cd $(BUILDFILES)/gforge; dch -b -v $(gfversion)$(MINOR)$(XDISTRIB)+p -D UNRELEASED "This is $(DISTRIB) autobuild"
124 perl -pi -e "s/UNRELEASED/$(DISTRIB)/" $(BUILDFILES)/gforge/debian/changelog
125 cd $(BUILDFILES) ; dpkg-source -b gforge
126 rm -rf $(BUILDFILES)/gforge
128 $(BUILDFILES)/gforge_$(gfversion).orig.tar.gz: $(TARBALLS)/gforge_$(gfversion).orig.tar.gz
129 cp $(TARBALLS)/gforge_$(gfversion).orig.tar.gz $(BUILDFILES)
131 $(TARBALLS)/gforge_$(gfversion).orig.tar.gz: $(TARBALLS)
132 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
135 pbuilderenv: $(PBUILDERTGZ) $(PBUILDERTGZ)/base-$(DISTRIB).tgz
136 @echo "Ready for $(DISTRIB)"
138 cowbuilderenv: $(COWBUILDERBASE) $(COWBUILDERBASE)/base-$(DISTRIB).stamp
139 @echo "Ready for $(DISTRIB)"
141 $(PBUILDERTGZ)/base-$(DISTRIB).tgz: $(PBUILDERTGZ)/config
142 sudo /usr/sbin/pbuilder --create --distribution $(DISTRIB) --basetgz $(PBUILDERTGZ)/base-$(DISTRIB).tgz --configfile $(PBUILDERTGZ)/config $(DISTROOP)
144 $(COWBUILDERBASE)/base-$(DISTRIB).stamp: $(COWBUILDERBASE)/config
145 sudo /usr/sbin/cowbuilder --create $(HOOK) --distribution $(DISTRIB) --basepath $(COWBUILDERBASE)/base-$(DISTRIB).cow --configfile $(COWBUILDERBASE)/config $(DISTROOP)
146 touch $(COWBUILDERBASE)/base-$(DISTRIB).stamp
148 $(PBUILDERTGZ)/config: /usr/sbin/pbuilder
149 echo "APTCACHE=$(APTCACHE)" > $(PBUILDERTGZ)/config
150 echo "BUILDPLACE=$(BUILDPLACE)" >> $(PBUILDERTGZ)/config
151 echo "BUILDRESULT=$(BUILDRESULT)" >> $(PBUILDERTGZ)/config
153 $(COWBUILDERBASE)/config: /usr/sbin/cowbuilder
154 echo "APTCACHE=$(APTCACHE)" > $(COWBUILDERBASE)/config
155 echo "BUILDPLACE=$(BUILDPLACE)" >> $(COWBUILDERBASE)/config
156 echo "BUILDRESULT=$(BUILDRESULT)" >> $(COWBUILDERBASE)/config
159 sudo apt-get install pbuilder
162 gpg --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
163 gpg --export --armor 40976EAF437D05B5 | sudo apt-key add -
165 /usr/sbin/cowbuilder:
166 sudo apt-get install cowdancer
168 localrepo: $(LOCALREPO) $(LOCALREPO)/conf $(LOCALREPO)/conf/distributions
170 $(LOCALREPO)/conf/distributions:
171 for dist in $(DISTRIBLIST); do \
172 echo "Codename: $$dist" ; \
173 echo "Suite: $$dist" ; \
174 echo "Components: main" ; \
175 echo "UDebComponents: main" ; \
176 echo "Architectures: i386 source" ; \
177 echo "Origin: $(ORIGIN)" ; \
178 echo "Version: 4.7" ; \
179 echo "Description: My $(FUSIONFORGE) $$dist repository" ; \
180 echo "SignWith: yes" ; \
181 echo "" ; done >> $(LOCALREPO)/conf/distributions
184 mkdir $(LOCALREPO)/conf
190 mkdir -p $(BUILDFILES)
193 mkdir -p $(COWBUILDERBASE)
196 mkdir -p $(PBUILDERTGZ)
199 sudo mkdir $(LOCALREPO)
200 sudo chown `id -u`.`id -g` $(LOCALREPO)