3
# This script updates MaraDNS 1.2
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'.
9
# For example, to update MaraDNS 1.2.02 to 1.2.03, make sure
10
# maradns-1.2.02.tar.lzma 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.2.02*.patch files.
14
# You will need to have lzma on your system to run this script
16
# Get the current and next version number
19
CURRENT=${CURRENT##*/}
22
# Make a clean CURRENT install, which we rename NEXT
23
rm -fr maradns-$CURRENT 2> /dev/null
24
rm -fr maradns-$NEXT 2> /dev/null
25
echo extracting tarball
26
cat maradns-$CURRENT.tar.lzma | lzma d -si -so | tar xf -
28
echo run this from the correct directory
32
mv maradns-$CURRENT maradns-$NEXT
38
cp ../patches/maradns-$CURRENT* update/$NEXT
40
# This is one of the few places where we will need to change anything
41
# in this script from version to version
43
# The revision number; in the case of having multiple snapshots a day,
44
# the revision number can be incremented so as to minimize confusion
45
# This is only done when more than one snapshop is uploaded to the
46
# maradns.org server in a given day.
51
# Patch #1: Vlatko Kosturjak from Croatia's chkconfig changes
52
patch -p1 < update/$NEXT/maradns-1.2.11-chkconfig.patch
54
# Patch #2: Add documentation about making MaraDNS a Windows XP service
55
patch -p1 < update/$NEXT/maradns-1.2.11-win_service.patch
57
# Patch #3: Add function which removs last record from DNS packet; this will
58
# be used to improve truncation, and to remove a compression error we get when
59
# we can't get the PTR with the recursive resolver.
60
patch -p1 < update/$NEXT/maradns-1.2.11-fancy_truncation.patch
62
# Patch #4: Close zone file descriptors after reading the zone file (thanks
63
# Paul Wankadia for pointing this out)
64
patch -p1 < update/$NEXT/maradns-1.2.11-csv2_close.patch
66
# Patch #5: Have a special '/serial' field which one can put in the SOA serial
67
# field if one wishes to have the serial updated whenever a zone file is
69
patch -p1 < update/$NEXT/maradns-1.2.11-slash_serial.patch
71
# Patch #6: Implement (and document) a special '/ttl' slash command that allows
72
# the default TTL to be changed in a zone file
73
patch -p1 < update/$NEXT/maradns-1.2.11-default_ttl.patch
75
# Patch #7: Implement (and document) a special '/origin' slash command that
76
# allows the default "origin" (string used to substitute %) to be changed
77
patch -p1 < update/$NEXT/maradns-1.2.11-origin.patch
79
# Patch #8: Plug a memory leak the code has had for a while (since 1.1.50 and
80
# 1.0.33); basically we'd leak about 300 bytes every time we ask for a
81
# PTR address, the PTR address pointed to a CNAME, and the CNAME didn't
82
# point to a valid PTR record
83
patch -p1 < update/$NEXT/maradns-1.2.11-ptrq_memleak.patch
85
# Patch #9: Add support for /opush {name} and /opop commands; this allows
86
# more flexibility in changing origins
87
patch -p1 < update/$NEXT/maradns-1.2.11-opush.patch
89
# Patch #10: Make sure we deallocate unused data while parsing zone files;
90
# this should help reduce MaraDNS memory usage on setups with a lot of zones
91
patch -p1 < update/$NEXT/maradns-1.2.11-tidy_parse.patch
93
# Patch #11: An origin is not the zone and vice versa
94
patch -p1 < update/$NEXT/maradns-1.2.11-origin_vs_zone.patch
96
# Patch #12: Data in the authoritative half, with the exception of NS
97
# delegations, is always marked authoritative in the DNS header
98
patch -p1 < update/$NEXT/maradns-1.2.11-always_authoritative.patch
100
# Patch #13: Point out that people may be able to get help with 1.0
101
# on the MaraDNS mailing list
102
patch -p1 < update/$NEXT/maradns-1.2.11-maillist_help.patch
104
# Patch #14: Add the '/read' slash command to csv2 zone files
105
patch -p1 < update/$NEXT/maradns-1.2.11-slash_read.patch
107
# Patch: Update RPM spec file (this is always done)
108
patch -p1 < update/$NEXT/maradns-$CURRENT-rpm_spec.patch
109
mv build/maradns-$CURRENT.spec build/maradns-$NEXT.spec
111
# Patch: Update changelog (this is always done)
112
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
114
# Patch: Update download link (this is always done)
115
patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch
117
# Other release-specific fixes and changes go here
118
# Copy over the document on making MaraDNS a win32 service
119
cp ../win_service.ej doc/en/source
121
tar xvjf ../../roottest.tar.bz2
122
cp /etc/maradns/db.example.net roottest
123
cp /etc/maradns/db.test01.maradns roottest
124
cp /etc/maradns/testfile roottest
127
# Anything below this line normally is not changed between MaraDNS versions
128
echo updating documentation
130
# Update the documentation
135
# The following is time-consuming, so we only do it when making the final
137
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
138
echo making PDF reference
148
# Go back to the maradns dir
152
ln -s doc/en/changelog.txt CHANGELOG
154
# Go one level higher than the toplevel directory to copy this script
158
# Put this script in the "build" directory
159
cp $0 maradns-$NEXT/update/$NEXT
161
if [[ "$1" != "go" && "$1" != "snap" && "$1" != "work" ]] ; then
162
echo OK, maradns-$NEXT built. Confirm this compiles and
163
echo perform basic regression before re-running this to make
164
echo the tarballs. Once you have tested this, rerun this
165
echo script as: \"$0 go\" or as \"$0 snap\"
166
echo to make a daily snapshot
170
if [ "$1" == "work" ] ; then
171
cat maradns-$CURRENT.tar.lzma | lzma d -si -so | tar xf -
172
echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
173
echo now can make more patches as needed.
178
echo making new tarballs
180
if [ "$1" == "snap" ] ; then
181
SNAP=Q.$( date +%Y%m%d )$REVISION
183
mv maradns-$NEXT maradns-$SNAP
184
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
188
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
189
tar czf maradns-$SNAP.tar.gz maradns-$SNAP
191
# All of the compression we actually use was originally written by
192
# Igor Pavlov for the 7-zip compression suite
193
echo shrinking .gz tarball
194
advdef -z -3 maradns-$SNAP.tar.gz
197
echo using exotic compression
198
tar cf maradns-$SNAP.tar maradns-$SNAP
200
echo lzma compression \(this will take about 5 minutes\)
202
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
203
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
204
# (only a little over one meg needed for decompression)
205
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
209
# Clean up the uncompressed tarball
214
# The other exotic compressors can't be run in a pipeline
216
echo 7zip compression
218
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
222
echo paq6 compression \(This will take 2\-3 minutes\)
224
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
228
echo rzip compression
230
rzip maradns-$SNAP.tar