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

« back to all changes in this revision

Viewing changes to update/1.2.12.03/1.2.12.02-to-1.2.12.03

  • 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: Some fixes to the tutorial documentation
 
52
patch -p1 < update/$NEXT/maradns-1.2.12.02-tutorial_fixes.patch
 
53
 
 
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
 
56
 
 
57
# Patch #3: Update the advocacy documents
 
58
patch -p1 < update/$NEXT/maradns-1.2.12.02-advocacy.patch
 
59
 
 
60
# Patch #4: Update Daniel's maraconf.sh script
 
61
patch -p1 < update/$NEXT/maradns-1.2.12.02-maraconf.patch
 
62
 
 
63
# Patch #5: Update the main webpage to advocate MaraDNS more
 
64
patch -p1 < update/$NEXT/maradns-1.2.12.02-webpage.update.patch
 
65
 
 
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
 
68
 
 
69
# Patch #7: Fix spurious "bad query" log messages
 
70
patch -p1 < update/$NEXT/maradns-1.2.12.02-bad_query.patch
 
71
 
 
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
 
75
 
 
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
 
79
 
 
80
# Patch: Update changelog (this is always done)
 
81
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
 
82
 
 
83
# Patch: Update download link (this is always done)
 
84
patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch
 
85
 
 
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
 
91
 
 
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
 
96
 
 
97
# Add the man page for maraconf
 
98
cp ../newfiles/maraconf.ej doc/en/source
 
99
 
 
100
# Add the advocacy document
 
101
cp ../newfiles/advocacy.embed doc/en/webpage
 
102
 
 
103
# Anything below this line normally is not changed between MaraDNS versions
 
104
echo updating documentation
 
105
 
 
106
# Update the documentation
 
107
cd doc/en
 
108
make
 
109
cd man
 
110
make
 
111
# The following is time-consuming, so we only do it when making the final
 
112
# tarballs
 
113
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
 
114
        echo making PDF reference
 
115
        ./make.pdf
 
116
        echo done
 
117
fi
 
118
cd ../tutorial
 
119
make
 
120
cd ../text
 
121
make
 
122
cd ../webpage
 
123
make
 
124
# Go back to the maradns dir
 
125
cd ../../..
 
126
 
 
127
rm CHANGELOG
 
128
ln -s doc/en/changelog.txt CHANGELOG
 
129
 
 
130
# Go one level higher than the toplevel directory to copy this script
 
131
# over
 
132
cd ..
 
133
 
 
134
# Put this script in the "build" directory
 
135
cp $0 maradns-$NEXT/update/$NEXT
 
136
 
 
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
 
143
        exit 0
 
144
fi
 
145
 
 
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.  
 
150
        exit 0
 
151
fi
 
152
 
 
153
# Build the tarballs
 
154
echo making new tarballs
 
155
 
 
156
if [ "$1" == "snap" ] ; then
 
157
        SNAP=Q.$( date +%Y%m%d )$REVISION
 
158
        rm -fr maradns-$SNAP
 
159
        mv maradns-$NEXT maradns-$SNAP
 
160
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
 
161
        exit 0
 
162
else
 
163
        SNAP=$NEXT
 
164
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
 
165
        tar czf maradns-$SNAP.tar.gz maradns-$SNAP
 
166
 
 
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
 
171
fi
 
172
 
 
173
echo using exotic compression
 
174
tar cf maradns-$SNAP.tar maradns-$SNAP
 
175
 
 
176
echo lzma compression \(this will take about 5 minutes\)
 
177
date
 
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
 
182
date
 
183
echo
 
184
 
 
185
# Clean up the uncompressed tarball
 
186
rm maradns-$SNAP.tar
 
187
 
 
188
exit 0
 
189
 
 
190
# The other exotic compressors can't be run in a pipeline
 
191
 
 
192
echo 7zip compression
 
193
date
 
194
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
 
195
date
 
196
echo
 
197
 
 
198
echo paq6 compression \(This will take 2\-3 minutes\)
 
199
date
 
200
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
 
201
date
 
202
echo
 
203
 
 
204
echo rzip compression
 
205
date
 
206
rzip maradns-$SNAP.tar
 
207
date
 
208
echo