~samiam/MaraDNS

ref: 3.5.0002 MaraDNS/update/1.3.03/1.3.02-to-1.3.03 -rwxr-xr-x 7.7 KiB View raw
db09084f — Sam Trenholme MaraDNS release 3.5.0002 5 months ago
                                                                                
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#!/bin/bash -e

# This script updates MaraDNS 1.3

# To run this script, make sure that this script is in the directory
# containing the tarball for the version of MaraDNS you wish to update, and
# all of the patches are in a directory entitled 'patches'.

# For example, to update MaraDNS 1.3.02 to 1.3.03, make sure 
# maradns-1.3.02.tar.bz2 is in the same directory as this script, and
# that the directory containing this script has a directory called
# "patches/" which has all of the maradns-1.2.02*.patch files.

# You will need to have lzma 4.27 on your system to run this script

# Get the current and next version number

CURRENT=${0%%-*}
CURRENT=${CURRENT##*/}
NEXT=${0##*-}

# The revision number; in the case of having multiple snapshots a day,
# the revision number can be incremented so as to minimize confusion
# This is only done when more than one snapshop is uploaded to the
# maradns.org server in a given day.
REVISION=.1

# Make a clean CURRENT install, which we rename NEXT
rm -fr maradns-$CURRENT 2> /dev/null
rm -fr maradns-$NEXT 2> /dev/null
echo extracting tarball
cat maradns-$CURRENT.tar.lzma | lzma d -si -so | tar xf -
if [ $? != 0 ] ; then
	echo run this from the correct directory
	exit 1
fi
rm -fr maradns-$NEXT*
mv maradns-$CURRENT maradns-$NEXT
cd maradns-$NEXT

# The patches

mkdir update/$NEXT
cp ../patches/maradns-$CURRENT* update/$NEXT

# This is one of the few places where we will need to change anything
# in this script from version to version

echo applying patches

# Patch #1: Bugfix patch.  All '.' by itself to be a hostname
patch -p1 < update/$NEXT/maradns-1.3.02-root_hostname.patch

# Patch #2: Put link to blog on MaraDNS sidebar; move FAQ to doc page
patch -p1 < update/$NEXT/maradns-1.3.02-blog.patch

# Patch #3: recurse_delegation: Optional parameter to restore MaraDNS 1.2
#           behavior where, in the case where we would normally give a NS
#           delegation record, but the RD "recursion desired" flag is set,
#           we recurse.
patch -p1 < update/$NEXT/maradns-1.3.02-recurse_delegation.patch

# Patch #4: Update the mararc documentation to point out that root_servers
#           and upstream_servers can now have multiple elements
patch -p1 < update/$NEXT/maradns-1.3.02-mararc.patch

# Patch #5: Have the update document reflect the MaraDNS 1.3 changes
patch -p1 < update/$NEXT/maradns-1.3.02-update.patch

# Patch #6: Have is so Tversion.maradns. works in pure recursive mode
patch -p1 < update/$NEXT/maradns-1.3.02-version_maradns.patch

# Patch #7: I'm on vacation until late January (Disabled; I'm back)
#patch -p1 < update/$NEXT/maradns-1.3.02-vacation.patch

# Patch #8: Update recursive tutorial to note existance of custom root
#           servers for subtrees of the DNS space
patch -p1 < update/$NEXT/maradns-1.3.02-recurse_doc.patch

# Patch #9: Do not allow hash (#) and pipe (|) characters in TXT records
#           if the RR is tilde separated (this makes parsing by scripts
#           easier)
patch -p1 < update/$NEXT/maradns-1.3.02-restrict_hash_pipe.patch

# Patch #10: Allow WKS and LOC records to have newlines in places where
# the number of fields is unknown if we use the ~ to separate records
patch -p1 < update/$NEXT/maradns-1.3.02-tilde_wks_loc.patch

# Patch #11: Fix bug in LOC's handling of precision
patch -p1 < update/$NEXT/maradns-1.3.02-locfix.patch

# Patch #12: Fix up the csv2 documentation
patch -p1 < update/$NEXT/maradns-1.3.02-csv2_doc.patch

# Patch #13: Make MaraDNS able to compile with gcc 2.96 again
patch -p1 < update/$NEXT/maradns-1.3.02-gcc296_compile.patch

# Patch #14: Update the win32 build to not include the pthreads source in the
#            maradns zipfile (instead, I will just make it available on 
#            maradns.org)
patch -p1 < update/$NEXT/maradns-1.3.02-win32-update.patch

# Patch #15: Have the TXT field handle .'chunk 1' 'chunk 2' style RRs
if [ "$1" == "work" ] ; then
	cp parse/Csv2_rr_txt.c parse/Csv2_rr_txt.c.orig
fi
patch -p1 < update/$NEXT/maradns-1.3.02-txt_multichunk.patch

# Patch #16: Add -pipe option to mingw32 makefile (By request; however,
# this actually doesn't speed up the compile process)
patch -p1 < update/$NEXT/maradns-1.3.02-pipe.patch

# Patch #17: Add program that sends white noise over UDP to SQA quite
#            (This is a SQA test case for the following memory leak)
patch -p1 < update/$NEXT/maradns-1.3.02-noise.patch

# Patch #18: Fix a memory leak that happens if MaraDNS gets an invalid DNS
#            packet (Thanks to Rani Assaf for catching this)
patch -p1 < update/$NEXT/maradns-1.3.02-ect.d-leakfix.patch

# Patch #19: Make sure the franky.hosts.test SQA script regresses against 
#            the ect.d memleak bug
patch -p1 < update/$NEXT/maradns-1.3.02-ect.d-memleak-regression.patch

# Patch: Update RPM spec file (this is always done)
patch -p1 < update/$NEXT/maradns-$CURRENT-rpm_spec.patch
mv build/maradns-$CURRENT.spec build/maradns-$NEXT.spec

# Patch: Update changelog (this is always done)
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch

# Patch: Update download link (this is always done)
patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch

# Other release-specific fixes and changes go here

cp ../TODO.1.3 .
mkdir sqa/csv2-parse
cp ../newfiles/db.wks sqa/csv2-parse
cp ../newfiles/pthreads.txt build/win32
cp ../newfiles/README.marahash tools/misc
cp ../newfiles/sendnoise.c sqa/

# Anything below this line normally is not changed between MaraDNS versions
echo updating documentation

# Update the documentation
cd doc/en
make
cd man
make
# The following is time-consuming, so we only do it when making the final
# tarballs
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
	echo making PDF reference
	./make.pdf
	echo done
fi
cd ../examples
make
cd ../tutorial
make
cd ../text
make
cd ../webpage
make
# Go back to the maradns dir
cd ../../..

rm CHANGELOG
ln -s doc/en/changelog.txt CHANGELOG

# Go one level higher than the toplevel directory to copy this script
# over
cd ..

# Put this script in the "build" directory
cp $0 maradns-$NEXT/update/$NEXT

if [[ "$1" != "go" && "$1" != "snap" && "$1" != "work" ]] ; then
	echo OK, maradns-$NEXT built.  Confirm this compiles and	
	echo perform basic regression before re-running this to make
	echo the tarballs.  Once you have tested this, rerun this 
	echo script as: \"$0 go\" or as \"$0 snap\" 
        echo to make a daily snapshot
	exit 0
fi

if [ "$1" == "work" ] ; then
	cat maradns-$CURRENT.tar.lzma | lzma d -si -so | tar xf -
	echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
	echo now can make more patches as needed.  
	exit 0
fi

# Build the tarballs
echo making new tarballs

if [ "$1" == "snap" ] ; then
	SNAP=Q.$( date +%Y%m%d )$REVISION
	rm -fr maradns-$SNAP
	mv maradns-$NEXT maradns-$SNAP
	tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
	exit 0
else
	SNAP=$NEXT
	tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
	tar czf maradns-$SNAP.tar.gz maradns-$SNAP

	# All of the compression we actually use was originally written by 
	# Igor Pavlov for the 7-zip compression suite
	echo shrinking .gz tarball
	advdef -z -3 maradns-$SNAP.tar.gz
fi

echo using exotic compression
tar cf maradns-$SNAP.tar maradns-$SNAP

echo lzma compression \(this will take about 5 minutes\)
date
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
# (only a little over one meg needed for decompression)
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
date
echo

# Clean up the uncompressed tarball
rm maradns-$SNAP.tar

exit 0

# The other exotic compressors can't be run in a pipeline

echo 7zip compression
date
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
date
echo

echo paq6 compression \(This will take 2\-3 minutes\)
date
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
date
echo

echo rzip compression
date
rzip maradns-$SNAP.tar
date
echo