root/Makefile

Revision 596:9c4a640f4466, 3.4 kB (checked in by Steve Kemp <steve@…>, 7 weeks ago)

Added a new target - devel

Line 
1#
2#  Makefile for people working with the bytemark-vhost packages.
3#
4# Steve
5# --
6#
7SHELL="/bin/bash"
8
9
10a:
11        @echo "Valid targets are:"
12        @echo " "
13        @echo "General:"
14        @echo " "
15        @echo " all     - Generate all Debian packages [source + binary]."
16        @echo " clean   - Clean the generated files."
17        @echo " "
18        @echo "Releasing:"
19        @echo " sync-down - Sync remote repositories down."
20        @echo " sync-up   - Sync remote repositories up."
21        @echo " "
22        @echo "Tests:"
23        @echo " "
24        @echo " linda   - Run linda on the built packages."
25        @echo " lintian - Run lintian on the built packages."
26        @echo " "
27        @echo "Misc:"
28        @echo " pool    - Builds a local pool structure handy for quick tests."
29        @echo " "
30
31
32
33#
34#  Make all packages.
35#
36all: dependencies
37        for i in */; do if [ `which sautobuild` ] ; then sautobuild $$i ; else pushd $$i ; debuild --no-tgz-check -sa -us -uc ; popd ; fi ; done
38        -touch all
39
40changelog:
41         @date +%Y%m%d%H%M%S
42
43#
44# If we're using sautobuild, then there is no need to check for dependencies
45#
46dependencies:
47        [ `which sautobuild` ] || ./meta/dependencies
48        touch dependencies
49
50#
51#  Clean all auto-generated files from beneath the current directory
52#
53clean:
54        -rm */build-stamp
55        -rm */configure-stamp
56        -rm -rf */debian/bytemar*/
57        -rm bytemark-vhost[-_]*
58        -rm all
59        -rm -rf out/
60        -rm -rf staging/
61        -rm *.build
62        -rm dependencies
63        -rm libapache*
64        -find . -name '*.bak' -delete
65        -rm */*.1
66        for i in */; do pushd $$i; if [ -e Makefile ]; then make clean; fi ; popd; done
67
68
69
70#
71#  Run "linda" on all binary packages to test for Debian policy violations.
72#
73linda: all
74        linda *.changes
75
76
77#
78#  Run "lintian" on all binary packages to test for Debian policy violations.
79#
80lintian: all
81        lintian *.changes
82
83
84
85#
86# Create a suitable pool
87#
88pool: all
89        [ -d out ] || mkdir out
90        for i in */debian/.package ; do mv `cat $$i`_* out ; done
91        dpkg-scanpackages out /dev/null | gzip > out/Packages.gz
92        dpkg-scansources  out /dev/null | gzip > out/Sources.gz
93
94#
95#  Pull any changes from the remote mercurial repository.
96#
97update:
98        hg pull --update
99
100
101#
102#  Sync remote releases down to the local tree.
103#
104sync-down:
105        # download the current devel repository
106        if [ ! -d releases/devel/ ]; then mkdir -p releases/devel ; fi
107        -rsync -vazr vhost:/devel/ releases/devel/
108        # download the current staging repository
109        if [ ! -d releases/staging/ ]; then mkdir -p releases/staging ; fi
110        -rsync -vazr vhost:/staging/ releases/staging/
111        # download the current release repository
112        if [ ! -d releases/live/ ]; then mkdir -p releases/live ; fi
113        -rsync -vazr vhost:/incoming/ releases/live/
114        # remove irrelevent files
115        find ./releases -name '*.sh' -delete
116
117#
118#  Push releases live.
119#
120sync-up:
121        # upload the local copy to the remote server
122        -rsync -vazr --delete releases/devel/   vhost:/devel/
123        -rsync -vazr --delete releases/staging/ vhost:/staging/
124        -rsync -vazr --delete releases/live/    vhost:/incoming/
125
126
127#
128# Make a new devel release
129#
130devel:
131        make sync-up
132        ssh vhost sudo /home/www/vhost.bytemark.co.uk/htdocs/devel/build.sh
133
134#
135# copy everything from devel -> staging and make live
136#
137devel-staging: sync-down
138        rm ./releases/staging/*
139        cp ./releases/devel/* ./releases/staging/
140        make sync-up
141        ssh vhost sudo /home/www/vhost.bytemark.co.uk/htdocs/staging/build.sh
142
143
144#
145# copy everything from staging -> released and make live
146#
147staging-release: sync-down
148        rm ./releases/live/*
149        cp ./releases/staging/* ./releases/live/
150        make sync-up
151        ssh vhost sudo /home/www/vhost.bytemark.co.uk/htdocs/packages/build.sh
Note: See TracBrowser for help on using the browser.