~ubuntu-branches/ubuntu/saucy/maradns/saucy

« back to all changes in this revision

Viewing changes to update/1.2.12.01/1.2.11-to-1.2.12.01

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry
  • Date: 2006-10-09 17:44:21 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061009174421-yb151elg3m4t5shl
Tags: 1.2.12.03-1
* New upstream release with many new doc tweaks. Though most of the changes
  are with the webpages which I have chosen not to distribute as you can
  read them all rather online at http://maradns.org/
* The diffs in the Makefiles are due to upstream's configure script
* Added bind2csv2.py as an example from upstream's tools/
  There is a lot of little scripts in tools/ which can probably join this

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -e
 
2
 
 
3
# This script updates MaraDNS 1.2
 
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.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.
 
13
 
 
14
# You will need to have lzma on your system to run this script
 
15
 
 
16
# Get the current and next version number
 
17
 
 
18
CURRENT=${0%%-*}
 
19
CURRENT=${CURRENT##*/}
 
20
NEXT=${0##*-}
 
21
 
 
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 -
 
27
if [ $? != 0 ] ; then
 
28
        echo run this from the correct directory
 
29
        exit 1
 
30
fi
 
31
rm -fr maradns-$NEXT*
 
32
mv maradns-$CURRENT maradns-$NEXT
 
33
cd maradns-$NEXT
 
34
 
 
35
# The patches
 
36
 
 
37
mkdir update/$NEXT
 
38
cp ../patches/maradns-$CURRENT* update/$NEXT
 
39
 
 
40
# This is one of the few places where we will need to change anything
 
41
# in this script from version to version
 
42
 
 
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.
 
47
REVISION=.1
 
48
 
 
49
echo applying patches
 
50
 
 
51
# Patch #1: Vlatko Kosturjak from Croatia's chkconfig changes
 
52
patch -p1 < update/$NEXT/maradns-1.2.11-chkconfig.patch
 
53
 
 
54
# Patch #2: Add documentation about making MaraDNS a Windows XP service
 
55
patch -p1 < update/$NEXT/maradns-1.2.11-win_service.patch
 
56
 
 
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
 
61
 
 
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
 
65
 
 
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
 
68
# edited
 
69
patch -p1 < update/$NEXT/maradns-1.2.11-slash_serial.patch
 
70
 
 
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
 
74
 
 
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
 
78
 
 
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
 
84
 
 
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
 
88
 
 
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
 
92
 
 
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
 
95
 
 
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
 
99
 
 
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
 
103
 
 
104
# Patch #14: Add the '/read' slash command to csv2 zone files
 
105
patch -p1 < update/$NEXT/maradns-1.2.11-slash_read.patch
 
106
 
 
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
 
110
 
 
111
# Patch: Update changelog (this is always done)
 
112
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
 
113
 
 
114
# Patch: Update download link (this is always done)
 
115
patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch
 
116
 
 
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
 
120
cd sqa
 
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
 
125
cd ..
 
126
 
 
127
# Anything below this line normally is not changed between MaraDNS versions
 
128
echo updating documentation
 
129
 
 
130
# Update the documentation
 
131
cd doc/en
 
132
make
 
133
cd man
 
134
make
 
135
# The following is time-consuming, so we only do it when making the final
 
136
# tarballs
 
137
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
 
138
        echo making PDF reference
 
139
        ./make.pdf
 
140
        echo done
 
141
fi
 
142
cd ../tutorial
 
143
make
 
144
cd ../text
 
145
make
 
146
cd ../webpage
 
147
make
 
148
# Go back to the maradns dir
 
149
cd ../../..
 
150
 
 
151
rm CHANGELOG
 
152
ln -s doc/en/changelog.txt CHANGELOG
 
153
 
 
154
# Go one level higher than the toplevel directory to copy this script
 
155
# over
 
156
cd ..
 
157
 
 
158
# Put this script in the "build" directory
 
159
cp $0 maradns-$NEXT/update/$NEXT
 
160
 
 
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
 
167
        exit 0
 
168
fi
 
169
 
 
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.  
 
174
        exit 0
 
175
fi
 
176
 
 
177
# Build the tarballs
 
178
echo making new tarballs
 
179
 
 
180
if [ "$1" == "snap" ] ; then
 
181
        SNAP=Q.$( date +%Y%m%d )$REVISION
 
182
        rm -fr maradns-$SNAP
 
183
        mv maradns-$NEXT maradns-$SNAP
 
184
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
 
185
        exit 0
 
186
else
 
187
        SNAP=$NEXT
 
188
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
 
189
        tar czf maradns-$SNAP.tar.gz maradns-$SNAP
 
190
 
 
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
 
195
fi
 
196
 
 
197
echo using exotic compression
 
198
tar cf maradns-$SNAP.tar maradns-$SNAP
 
199
 
 
200
echo lzma compression \(this will take about 5 minutes\)
 
201
date
 
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
 
206
date
 
207
echo
 
208
 
 
209
# Clean up the uncompressed tarball
 
210
rm maradns-$SNAP.tar
 
211
 
 
212
exit 0
 
213
 
 
214
# The other exotic compressors can't be run in a pipeline
 
215
 
 
216
echo 7zip compression
 
217
date
 
218
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
 
219
date
 
220
echo
 
221
 
 
222
echo paq6 compression \(This will take 2\-3 minutes\)
 
223
date
 
224
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
 
225
date
 
226
echo
 
227
 
 
228
echo rzip compression
 
229
date
 
230
rzip maradns-$SNAP.tar
 
231
date
 
232
echo