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: Some fixes to the tutorial documentation
52
patch -p1 < update/$NEXT/maradns-1.2.12.02-tutorial_fixes.patch
54
# Patch #2: Fix some comments with the code that processes the LOC record
55
patch -p1 < update/$NEXT/maradns-1.2.12.02-loc_comments_fix.patch
57
# Patch #3: Update the advocacy documents
58
patch -p1 < update/$NEXT/maradns-1.2.12.02-advocacy.patch
60
# Patch #4: Update Daniel's maraconf.sh script
61
patch -p1 < update/$NEXT/maradns-1.2.12.02-maraconf.patch
63
# Patch #5: Update the main webpage to advocate MaraDNS more
64
patch -p1 < update/$NEXT/maradns-1.2.12.02-webpage.update.patch
66
# Patch #6: Tell them the IP a bad query came from
67
patch -p1 < update/$NEXT/maradns-1.2.12.02-more_bad_query_info.patch
69
# Patch #7: Fix spurious "bad query" log messages
70
patch -p1 < update/$NEXT/maradns-1.2.12.02-bad_query.patch
72
# Patch #8: Don't send a "no nameservers could be contacted" unless
73
# completely necessary
74
patch -p1 < update/$NEXT/maradns-1.2.12.02-no_bogus_notfound.patch
76
# Patch: Update RPM spec file (this is always done)
77
patch -p1 < update/$NEXT/maradns-$CURRENT-rpm_spec.patch
78
mv build/maradns-$CURRENT.spec build/maradns-$NEXT.spec
80
# Patch: Update changelog (this is always done)
81
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
83
# Patch: Update download link (this is always done)
84
patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch
86
# Other release-specific fixes and changes go here
87
# Since it may be a while before I release 1.2.07.9, make a backup of the
88
# script and patches to go from 1.2.07.8 to 1.2.07.9
89
cp ../1.2.07.8-to-1.2.07.9 update/1.2.07.9
90
cp ../patches/maradns-1.2.07.8* update/1.2.07.9
92
# Add the bind2csv2 zone file converter
93
cp ../newfiles/bind2csv2.py tools/
94
cp ../newfiles/bind2csv2.design doc/en/misc
95
cp ../newfiles/test.zonefile sqa/test.bind.zonefile
97
# Add the man page for maraconf
98
cp ../newfiles/maraconf.ej doc/en/source
100
# Add the advocacy document
101
cp ../newfiles/advocacy.embed doc/en/webpage
103
# Anything below this line normally is not changed between MaraDNS versions
104
echo updating documentation
106
# Update the documentation
111
# The following is time-consuming, so we only do it when making the final
113
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
114
echo making PDF reference
124
# Go back to the maradns dir
128
ln -s doc/en/changelog.txt CHANGELOG
130
# Go one level higher than the toplevel directory to copy this script
134
# Put this script in the "build" directory
135
cp $0 maradns-$NEXT/update/$NEXT
137
if [[ "$1" != "go" && "$1" != "snap" && "$1" != "work" ]] ; then
138
echo OK, maradns-$NEXT built. Confirm this compiles and
139
echo perform basic regression before re-running this to make
140
echo the tarballs. Once you have tested this, rerun this
141
echo script as: \"$0 go\" or as \"$0 snap\"
142
echo to make a daily snapshot
146
if [ "$1" == "work" ] ; then
147
cat maradns-$CURRENT.tar.lzma | lzma d -si -so | tar xf -
148
echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
149
echo now can make more patches as needed.
154
echo making new tarballs
156
if [ "$1" == "snap" ] ; then
157
SNAP=Q.$( date +%Y%m%d )$REVISION
159
mv maradns-$NEXT maradns-$SNAP
160
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
164
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
165
tar czf maradns-$SNAP.tar.gz maradns-$SNAP
167
# All of the compression we actually use was originally written by
168
# Igor Pavlov for the 7-zip compression suite
169
echo shrinking .gz tarball
170
advdef -z -3 maradns-$SNAP.tar.gz
173
echo using exotic compression
174
tar cf maradns-$SNAP.tar maradns-$SNAP
176
echo lzma compression \(this will take about 5 minutes\)
178
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
179
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
180
# (only a little over one meg needed for decompression)
181
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
185
# Clean up the uncompressed tarball
190
# The other exotic compressors can't be run in a pipeline
192
echo 7zip compression
194
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
198
echo paq6 compression \(This will take 2\-3 minutes\)
200
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
204
echo rzip compression
206
rzip maradns-$SNAP.tar