forked from neymanna/fusionforge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.debian
145 lines (123 loc) · 6.23 KB
/
Makefile.debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#! /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/FUSIONFORGE/$(FUSIONFORGE)/' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
@echo ======================================================================================
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 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=""
debuildopts=-sa
debuildopts=-sa -us -uc
debuildopts=-us -uc
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
#
# FUSIONFORGE
#
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 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 FUSIONFORGE packages on where=<server> using dput #
dput $(where) gforge*.changes
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)
rm -rf gforge-$(gfversion)
#
# PHPDOCUMENTOR
#
phpdoc: phpdocumentor_get phpdocumentor_unpack $(documentor_path)/$(documentor_vers)/patched gforge/docs/phpdoc/docs # Get phpdocumentor, install phpdocumentor, build gforge 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:
[ ! -d $(documentor_path)/$(documentor_vers) ] && cd $(documentor_path) && tar xvzf $(documentor_vers).tar.gz || true
$(documentor_path)/$(documentor_vers)/patched:
cd $(documentor_path)/ && patch -p2 < $(CURDIR)/gforge/docs/phpdoc/manageclass.patch && touch $(documentor_path)/$(documentor_vers)/patched
gforge/docs/phpdoc/docs:
cd gforge/docs/phpdoc/ && ./makedoc.sh
#
# Build with pbuilder
#
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)