~ubuntu-branches/ubuntu/quantal/maradns/quantal

« back to all changes in this revision

Viewing changes to update/2.0.03/2.0.02-to-2.0.03

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2012-01-12 23:35:38 UTC
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20120112233538-5jkaqrh9nbqtf1ey
Tags: upstream-2.0.04+really1.4.09
ImportĀ upstreamĀ versionĀ 2.0.04+really1.4.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
 
3
 
# This script updates MaraDNS 2.0
4
 
 
5
 
# To run this script, make sure that this script is in the directory
6
 
# containing the tarball for the version of MaraDNS you wish to update, and
7
 
# all of the patches are in a directory entitled 'patches'.
8
 
 
9
 
# For example, to update MaraDNS 1.4.02 to 1.4.03, make sure 
10
 
# maradns-1.4.02.tar.bz2 is in the same directory as this script, and
11
 
# that the directory containing this script has a directory called
12
 
# "patches/" which has all of the maradns-1.4.02*.patch files.
13
 
 
14
 
CURRENT=${0%%-*}
15
 
CURRENT=${CURRENT##*/}
16
 
NEXT=${0##*-}
17
 
 
18
 
# The revision number; in the case of having multiple snapshots a day,
19
 
# the revision number can be incremented so as to minimize confusion
20
 
# This is only done when more than one snapshop is uploaded to the
21
 
# maradns.org server in a given day.
22
 
REVISION=.1
23
 
 
24
 
# Make a clean CURRENT install, which we rename NEXT
25
 
rm -fr maradns-$CURRENT 2> /dev/null
26
 
rm -fr maradns-$NEXT 2> /dev/null
27
 
echo extracting tarball
28
 
tar xjf maradns-$CURRENT.tar.bz2
29
 
if [ $? != 0 ] ; then
30
 
        echo run this from the correct directory
31
 
        exit 1
32
 
fi
33
 
rm -fr maradns-$NEXT*
34
 
mv maradns-$CURRENT maradns-$NEXT
35
 
cd maradns-$NEXT
36
 
 
37
 
# The patches
38
 
 
39
 
mkdir update/$NEXT
40
 
if [ "$1" != "new" ] ; then
41
 
        cp ../patches/maradns-$CURRENT* update/$NEXT
42
 
        #cp ../patches/maradns-* update/$NEXT
43
 
        #echo
44
 
fi
45
 
 
46
 
# This is one of the few places where we will need to change anything
47
 
# in this script from version to version
48
 
 
49
 
echo applying patches
50
 
 
51
 
if [ "$1" != "new" ] ; then
52
 
 
53
 
        # Update download link (this is always done)
54
 
        patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch
55
 
 
56
 
        # Patch: Update changelog
57
 
        patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
58
 
 
59
 
fi
60
 
 
61
 
# Update RPM spec file (We now have a script make the .spec file)
62
 
rm -f build/maradns-$CURRENT.spec
63
 
tools/misc/make.maradns.spec $NEXT > build/maradns-$NEXT.spec
64
 
 
65
 
# Update Deadwood to 3.0.0X (if needed)
66
 
rm -fr deadwood-3.0.02
67
 
tar xjf ../deadwood-3.0.03.tar.bz2
68
 
 
69
 
# Regenerate Deadwood's random prime number
70
 
echo Making new random prime
71
 
cd deadwood-3.0.03/src
72
 
cc -o foo RandomPrime.c
73
 
./foo > DwRandPrime.h
74
 
rm foo
75
 
cd ../..
76
 
 
77
 
# Release-specific fixes and changes go here
78
 
 
79
 
# Patch #1: Correctly handle ANY packets larger than 512 bytes in size
80
 
patch -p1 < update/$NEXT/maradns-2.0.02-big_any.patch
81
 
 
82
 
# Patch #2: Allow slashes in hostnames so MaraDNS is RFC2317 compliant
83
 
patch -p1 < update/$NEXT/maradns-2.0.02-rfc2317.patch
84
 
 
85
 
# Patch #3: Don't just install the Deadwood binary; also install the Deadwood
86
 
# man page and default configuration file
87
 
patch -p1 < update/$NEXT/maradns-2.0.02-full_Deadwood_install.patch
88
 
 
89
 
# Patch #4: Fix Debian bug 607739 (give hostnames for DDIP MX records)
90
 
patch -p1 < update/$NEXT/maradns-2.0.02-debian_bug_607739_fix.patch
91
 
 
92
 
# Patch #5: Update webpage
93
 
patch -p1 < update/$NEXT/maradns-2.0.02-webpage.patch 
94
 
 
95
 
# Patch #6: Correctly handle IXFR and AXFR requests sent over UDP (by giving
96
 
# out a TRUNCATED reply)
97
 
cp server/MaraDNS.c server/MaraDNS.c.orig
98
 
patch -p1 < update/$NEXT/maradns-2.0.02-axfr_over_udp.patch
99
 
 
100
 
# Patch #7: Update the BUGS section in the manpage to not mention "one thread
101
 
# per recursive query" and to point out MaraDNS won't expand/resolve based
102
 
# on regexes
103
 
patch -p1 < update/$NEXT/maradns-2.0.02-maradns_man_page.patch
104
 
 
105
 
# Patch #8: Update ej2man to make &lt; < etc.
106
 
patch -p1 < update/$NEXT/maradns-2.0.02-ej2man.patch
107
 
 
108
 
# Patch #9: RTFM (correct manpage pointed out) if a csv2 file doesn't parse
109
 
patch -p1 < update/$NEXT/maradns-2.0.02-RTFM.patch
110
 
 
111
 
# Patch #10: Add support for --pid=/path/to/file to Duende (courtesy Yarin)
112
 
patch -p1 < update/$NEXT/maradns-2.0.02-duende_pid.patch
113
 
 
114
 
# Patch #11: Make sure MaraDNS will work with ipv6 without annoying "authonly
115
 
# needed" message
116
 
patch -p1 < update/$NEXT/maradns-2.0.02-ipv6_fix.patch
117
 
 
118
 
# Patch #12: Make sure "classic" Duende reaps all children and chroots in to
119
 
# logger directory
120
 
#cp tools/duende.c tools/duende.c.orig
121
 
patch -p1 < update/$NEXT/maradns-2.0.02-duende_bamber_bugfix.patch
122
 
# Also, add Bamber's greatly improved Duende to the tools available
123
 
cp ../duende-ng.c tools/
124
 
cp ../README.Duende .
125
 
 
126
 
# Patch #13: Fix "authonly" messages in MaraDNS binary
127
 
patch -p1 < update/$NEXT/maradns-2.0.02-authonly_messages.patch
128
 
 
129
 
# Patch #14: Update the SQA regressions
130
 
patch -p1 < update/$NEXT/maradns-2.0.02-sqa_regressions_update.patch
131
 
 
132
 
# Anything below this line normally is not changed between MaraDNS versions
133
 
 
134
 
# Make sure text changelog and FAQ are up-to-date
135
 
#cp doc/en/webpage/faq.embed doc/en/source/faq.embed
136
 
#cp doc/en/webpage/changelog.embed doc/en/source/changelog.embed
137
 
 
138
 
# Convert tabs in code to spaces, since this is inconsistant in different
139
 
# programs
140
 
echo removing tabs from source files
141
 
if true ; then
142
 
        for a in $( find . -type f -name \*.[ch] ) ; do 
143
 
                col -x < $a > foo
144
 
                mv foo $a
145
 
        done
146
 
fi
147
 
 
148
 
echo updating documentation
149
 
# Update the documentation
150
 
cd doc/en
151
 
make
152
 
cd man
153
 
make
154
 
cd ../examples
155
 
make
156
 
cd ../tutorial
157
 
make
158
 
cd ../text
159
 
make
160
 
cd ../webpage
161
 
#../../../tools/misc/make.download.embed > download.embed
162
 
make
163
 
# Go back to the maradns dir
164
 
cd ../../..
165
 
 
166
 
rm CHANGELOG
167
 
ln -s doc/en/changelog.txt CHANGELOG
168
 
 
169
 
# Go one level higher than the toplevel directory to copy this script
170
 
# over
171
 
cd ..
172
 
 
173
 
# Put this script in the "build" directory
174
 
cp $0 maradns-$NEXT/update/$NEXT
175
 
 
176
 
if [ "$1" = "new" ] ; then
177
 
        tar xjf maradns-$CURRENT.tar.bz2
178
 
        echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
179
 
        echo now can start making patches.
180
 
        exit 0
181
 
fi
182
 
 
183
 
if [ "$1" != "go" ] && [ "$1" != "snap" ] && [ "$1" != "work" ] ; then
184
 
        echo OK, maradns-$NEXT built.  Confirm this compiles and        
185
 
        echo perform basic regression before re-running this to make
186
 
        echo the tarballs.  Once you have tested this, rerun this 
187
 
        echo script as: \"$0 go\" or as \"$0 snap\" 
188
 
        echo to make a daily snapshot
189
 
        exit 0
190
 
fi
191
 
 
192
 
if [ "$1" = "work" ] ; then
193
 
        tar xjf maradns-$CURRENT.tar.bz2
194
 
        echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
195
 
        echo now can make more patches as needed.  
196
 
        exit 0
197
 
fi
198
 
 
199
 
# Build the tarballs
200
 
echo making new tarballs
201
 
 
202
 
if [ "$1" = "snap" ] ; then
203
 
        SNAP=Q.$( date +%Y%m%d )$REVISION
204
 
        rm -fr maradns-$SNAP
205
 
        mv maradns-$NEXT maradns-$SNAP
206
 
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
207
 
        exit 0
208
 
else
209
 
        SNAP=$NEXT
210
 
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
211
 
        # CentOS 5 doesn't have "J" tar option
212
 
        tar cf maradns-$SNAP.tar maradns-$SNAP
213
 
        xz -9 maradns-$SNAP.tar
214
 
        tar czf maradns-$SNAP.tar.gz maradns-$SNAP
215
 
 
216
 
        # All of the compression we actually use was originally written by 
217
 
        # Igor Pavlov for the 7-zip compression suite
218
 
        echo shrinking .gz tarball
219
 
        advdef -z -4 maradns-$SNAP.tar.gz
220
 
fi
221
 
 
222
 
exit 0 # No exotic compression any more
223
 
 
224
 
echo using exotic compression
225
 
tar cf maradns-$SNAP.tar maradns-$SNAP
226
 
 
227
 
echo lzma compression \(this will take about 5 minutes\)
228
 
date
229
 
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
230
 
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
231
 
# (only a little over one meg needed for decompression)
232
 
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
233
 
date
234
 
echo
235
 
 
236
 
# Clean up the uncompressed tarball
237
 
rm maradns-$SNAP.tar
238
 
 
239
 
exit 0
240
 
 
241
 
# The other exotic compressors can't be run in a pipeline
242
 
 
243
 
echo 7zip compression
244
 
date
245
 
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
246
 
date
247
 
echo
248
 
 
249
 
echo paq6 compression \(This will take 2\-3 minutes\)
250
 
date
251
 
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
252
 
date
253
 
echo
254
 
 
255
 
echo rzip compression
256
 
date
257
 
rzip maradns-$SNAP.tar
258
 
date
259
 
echo