3 FUSIONFORGE=FusionForge
4 ORIGIN=debian.fusionforge.org
5 BUILDPLACE=$(CURDIR)/cowbuilder/buildplace
6 BUILDFILES=$(CURDIR)/cowbuilder/buildfiles
7 BUILDRESULT=$(CURDIR)/result
8 TARBALLS=$(CURDIR)/tarballs
9 APTCACHE=$(CURDIR)/cowbuilder/cache
10 DISTRIB=$(shell echo $(XDISTRIB) | cut -c2-)
11 LOCALREPODEB=/var/www/debian-fusionforge
12 LOCALREPOUBU=/var/www/ubuntu-fusionforge
13 DEBIANLIST=1lenny 2squeeze 3sid
14 UBUNTULIST=1gutsy 1hardy 1intrepid
15 UBUNTUOP=--mirror http://archive.ubuntu.com/ubuntu --debootstrap debootstrap
16 UBUNTUOP=--mirror http://localhost/ubuntu --debootstrap debootstrap
18 gfversion=$(shell head -1 gforge/debian/changelog | sed 's/.*(\(.[^+-]*\).*).*/\1/')
19 gfminor=$(shell head -1 gforge/debian/changelog | sed 's/.*(.[^+-]*[+-]\(.*\)).*/\1/')
20 svnrev=$(shell LANG=C svn info | grep Revision | cut -d: -f2| sed 's/ //g')
25 #make -f Makefile.debian cowbuilddist XDISTRIB=2squeeze LOCALREPO=$(LOCALREPODEB)
28 @echo ======================================================================================
29 @echo '= Available target are listed below ='
30 @echo ======================================================================================
31 @cat Makefile.debian | grep '^.*:.*#$$' | sed 's/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
32 @echo ======================================================================================
35 documentor_vers=phpdocumentor-1.3.0rc3
41 orig: $(TARBALLS)/gforge_$(gfversion).orig.tar.gz # Make FUSIONFORGE orig file #
46 phpdoc: phpdocumentor_get phpdocumentor_unpack $(documentor_path)/$(documentor_vers)/patched gforge/docs/phpdoc/docs # Get phpdocumentor, install phpdocumentor, build gforge phpdoc #
49 [ ! -f $(documentor_path)/$(documentor_vers).tar.gz ] && cd $(documentor_path) && wget http://heanet.dl.sourceforge.net/sourceforge/phpdocu/$(documentor_vers).tar.gz || true
51 [ ! -d $(documentor_path)/$(documentor_vers) ] && cd $(documentor_path) && tar xvzf $(documentor_vers).tar.gz || true
52 $(documentor_path)/$(documentor_vers)/patched:
53 cd $(documentor_path)/ && patch -p2 < $(CURDIR)/gforge/docs/phpdoc/manageclass.patch && touch $(documentor_path)/$(documentor_vers)/patched
54 gforge/docs/phpdoc/docs:
55 cd gforge/docs/phpdoc/ && ./makedoc.sh
58 # Build with cowbuilder
62 DEBBUILDOPTS=--debbuildopts -sa
66 @echo "Will build gforge_$(gfversion)$(MINOR)$(DISTRIB)"
68 cowbuilddeb: # ***** This is the one to build debian packages ***** #
69 @for dist in $(DEBIANLIST); do \
70 make -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP="$(DEBIANOP)" LOCALREPO=$(LOCALREPODEB) DISTRIBLIST="$(DEBIANLIST)"; \
73 cowbuildubu: # ***** This is the one to build ubuntu packages ***** #
74 @for dist in $(UBUNTULIST); do \
75 make -f Makefile.debian cowbuilddist XDISTRIB=$$dist DISTROOP="$(UBUNTUOP)" LOCALREPO=$(LOCALREPOUBU) DISTRIBLIST="$(UBUNTULIST)" ; \
78 cowbuilddist: cowbuilderenv localrepo $(BUILDFILES) $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes
79 @echo "Building $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes"
81 $(BUILDRESULT)/gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes: $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB).dsc
82 cd $(BUILDFILES) ; sudo cowbuilder --build --basepath $(CURDIR)/cowbuilder/base-$(DISTRIB).cow --configfile $(CURDIR)/cowbuilder/config $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB).dsc
83 # Install in repository
84 #cd result; reprepro -Vb $(LOCALREPO) include $(DISTRIB) gforge_$(gfversion)$(MINOR)$(XDISTRIB)_i386.changes
86 $(BUILDFILES)/gforge_$(gfversion)$(MINOR)$(XDISTRIB).dsc: $(BUILDFILES)/gforge_$(gfversion).orig.tar.gz
87 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 -pdumB $(BUILDFILES)/
88 # Set version for given distrib
89 cd $(BUILDFILES)/gforge; dch -b -v $(gfversion)$(MINOR)$(XDISTRIB) -D UNRELEASED "This is $(DISTRIB) autobuild"
90 perl -pi -e "s/UNRELEASED/$(DISTRIB)/" $(BUILDFILES)/gforge/debian/changelog
91 cd $(BUILDFILES) ; dpkg-source -b gforge
92 rm -rf $(BUILDFILES)/gforge
94 $(BUILDFILES)/gforge_$(gfversion).orig.tar.gz: $(TARBALLS)/gforge_$(gfversion).orig.tar.gz
95 cp $(TARBALLS)/gforge_$(gfversion).orig.tar.gz $(BUILDFILES)
97 $(TARBALLS)/gforge_$(gfversion).orig.tar.gz: $(TARBALLS)
98 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
101 cowbuilderenv: cowbuilder cowbuilder/base-$(DISTRIB).stamp
102 @echo "Ready for $(DISTRIB)"
104 cowbuilder/base-$(DISTRIB).stamp: cowbuilder/config
105 -sudo /usr/sbin/cowbuilder --create --distribution $(DISTRIB) --basepath $(CURDIR)/cowbuilder/base-$(DISTRIB).cow --configfile $(CURDIR)/cowbuilder/config $(DISTROOP)
106 touch cowbuilder/base-$(DISTRIB).stamp
108 cowbuilder/config: /usr/sbin/cowbuilder
109 echo "APTCACHE=$(APTCACHE)" > $(CURDIR)/cowbuilder/config
110 echo "BUILDPLACE=$(BUILDPLACE)" >> $(CURDIR)/cowbuilder/config
111 echo "BUILDRESULT=$(BUILDRESULT)" >> $(CURDIR)/cowbuilder/config
113 /usr/sbin/cowbuilder:
114 sudo apt-get install cowdancer
119 localrepo: $(LOCALREPO) $(LOCALREPO)/conf $(LOCALREPO)/conf/distributions
121 $(LOCALREPO)/conf/distributions:
122 for dist in $(DISTRIBLIST); do \
123 echo "Codename: $$dist" ; \
124 echo "Suite: $$dist" ; \
125 echo "Components: main" ; \
126 echo "UDebComponents: main" ; \
127 echo "Architectures: i386 source" ; \
128 echo "Origin: $(ORIGIN)" ; \
129 echo "Version: 4.7" ; \
130 echo "Description: My $(FUSIONFORGE) $$dist repository" ; \
131 echo "SignWith: yes" ; \
132 echo "" ; done >> $(LOCALREPO)/conf/distributions
135 mkdir $(LOCALREPO)/conf
141 mkdir -p $(BUILDFILES)
144 sudo mkdir $(LOCALREPO)
145 sudo chown `id -u`.`id -g` $(LOCALREPO)