~ubuntu-branches/ubuntu/quantal/maradns/quantal

« back to all changes in this revision

Viewing changes to update/2.0.02/2.0.01-to-2.0.02

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2012-01-12 23:35:38 UTC
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20120112233538-5jkaqrh9nbqtf1ey
Tags: upstream-2.0.04+really1.4.09
ImportĀ upstreamĀ versionĀ 2.0.04+really1.4.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
 
3
 
# This script updates MaraDNS 2.0
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.4.02 to 1.4.03, make sure 
10
 
# maradns-1.4.02.tar.bz2 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.4.02*.patch files.
13
 
 
14
 
CURRENT=${0%%-*}
15
 
CURRENT=${CURRENT##*/}
16
 
NEXT=${0##*-}
17
 
 
18
 
# The revision number; in the case of having multiple snapshots a day,
19
 
# the revision number can be incremented so as to minimize confusion
20
 
# This is only done when more than one snapshop is uploaded to the
21
 
# maradns.org server in a given day.
22
 
REVISION=.1
23
 
 
24
 
# Make a clean CURRENT install, which we rename NEXT
25
 
rm -fr maradns-$CURRENT 2> /dev/null
26
 
rm -fr maradns-$NEXT 2> /dev/null
27
 
echo extracting tarball
28
 
tar xjf maradns-$CURRENT.tar.bz2
29
 
if [ $? != 0 ] ; then
30
 
        echo run this from the correct directory
31
 
        exit 1
32
 
fi
33
 
rm -fr maradns-$NEXT*
34
 
mv maradns-$CURRENT maradns-$NEXT
35
 
cd maradns-$NEXT
36
 
 
37
 
# The patches
38
 
 
39
 
mkdir update/$NEXT
40
 
if [ "$1" != "new" ] ; then
41
 
        #cp ../patches/maradns-$CURRENT* update/$NEXT
42
 
        cp ../patches/maradns-* update/$NEXT
43
 
        #echo
44
 
fi
45
 
 
46
 
# This is one of the few places where we will need to change anything
47
 
# in this script from version to version
48
 
 
49
 
echo applying patches
50
 
 
51
 
#if [ "$1" != "new" ] ; then
52
 
 
53
 
        # Update download link (this is always done)
54
 
        #patch -p1 < update/$NEXT/maradns-$CURRENT-download.patch
55
 
 
56
 
        # Patch: Update changelog
57
 
        #patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
58
 
 
59
 
#fi
60
 
 
61
 
# Update RPM spec file (We now have a script make the .spec file)
62
 
rm -f build/maradns-$CURRENT.spec
63
 
tools/misc/make.maradns.spec $NEXT > build/maradns-$NEXT.spec
64
 
 
65
 
# Update Deadwood to 3.0.02
66
 
rm -fr deadwood-3.0.01
67
 
tar xjf ../deadwood-3.0.02.tar.bz2
68
 
 
69
 
# Regenerate Deadwood's random prime number
70
 
echo Making new random prime
71
 
cd deadwood-3.0.02/src
72
 
cc -o foo RandomPrime.c
73
 
./foo > DwRandPrime.h
74
 
rm foo
75
 
cd ../..
76
 
 
77
 
# Release-specific fixes and changes go here
78
 
 
79
 
# Patch #1: Update documentation
80
 
patch -p1 < update/$NEXT/maradns-2.0.01-docs.patch
81
 
 
82
 
# Patch #2: Corey's patch to fix a typo in fetchzone.c
83
 
patch -p1 < update/$NEXT/maradns-2.0.01-fetchzone.patch
84
 
 
85
 
# Patch #3: Yarin's patch to make "install.locations" more flexible
86
 
patch -p1 < update/$NEXT/maradns-2.0.01-install_locations.patch
87
 
 
88
 
# Patch #4: My adaptation of Yarin's patch to fix a bug where we could
89
 
#           not have SOA email addresses like "john.doe@example.com"
90
 
patch -p1 < update/$NEXT/maradns-2.0.01-dot_before_at.patch
91
 
 
92
 
# Patch #5: Fix error message to state we're running MaraDNS 2.0, not 1.2
93
 
patch -p1 < update/$NEXT/maradns-2.0.01-were_at_two.patch
94
 
 
95
 
# Patch #6: Fix for security bug CVE-2011-0520
96
 
# Impact: Remote denial of service ("packet of death" that terminates
97
 
# MaraDNS process; can not be used to escalate privileges)
98
 
patch -p1 < update/$NEXT/maradns-1.4.05-CVE-2011-0520.patch
99
 
 
100
 
# Patch #7: Update Copyright to mention 2011
101
 
patch -p1 < update/$NEXT/maradns-2.0.01-2011.patch
102
 
 
103
 
# Anything below this line normally is not changed between MaraDNS versions
104
 
 
105
 
# Make sure text changelog and FAQ are up-to-date
106
 
#cp doc/en/webpage/faq.embed doc/en/source/faq.embed
107
 
#cp doc/en/webpage/changelog.embed doc/en/source/changelog.embed
108
 
 
109
 
# Convert tabs in code to spaces, since this is inconsistant in different
110
 
# programs
111
 
echo removing tabs from source files
112
 
if true ; then
113
 
        for a in $( find . -type f -name \*.[ch] ) ; do 
114
 
                col -x < $a > foo
115
 
                mv foo $a
116
 
        done
117
 
fi
118
 
 
119
 
echo updating documentation
120
 
# Update the documentation
121
 
cd doc/en
122
 
make
123
 
cd man
124
 
make
125
 
cd ../examples
126
 
make
127
 
cd ../tutorial
128
 
make
129
 
cd ../text
130
 
make
131
 
cd ../webpage
132
 
#../../../tools/misc/make.download.embed > download.embed
133
 
make
134
 
# Go back to the maradns dir
135
 
cd ../../..
136
 
 
137
 
rm CHANGELOG
138
 
ln -s doc/en/changelog.txt CHANGELOG
139
 
 
140
 
# Go one level higher than the toplevel directory to copy this script
141
 
# over
142
 
cd ..
143
 
 
144
 
# Put this script in the "build" directory
145
 
cp $0 maradns-$NEXT/update/$NEXT
146
 
 
147
 
if [ "$1" = "new" ] ; then
148
 
        tar xjf maradns-$CURRENT.tar.bz2
149
 
        echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
150
 
        echo now can start making patches.
151
 
        exit 0
152
 
fi
153
 
 
154
 
if [ "$1" != "go" ] && [ "$1" != "snap" ] && [ "$1" != "work" ] ; then
155
 
        echo OK, maradns-$NEXT built.  Confirm this compiles and        
156
 
        echo perform basic regression before re-running this to make
157
 
        echo the tarballs.  Once you have tested this, rerun this 
158
 
        echo script as: \"$0 go\" or as \"$0 snap\" 
159
 
        echo to make a daily snapshot
160
 
        exit 0
161
 
fi
162
 
 
163
 
if [ "$1" = "work" ] ; then
164
 
        tar xjf maradns-$CURRENT.tar.bz2
165
 
        echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
166
 
        echo now can make more patches as needed.  
167
 
        exit 0
168
 
fi
169
 
 
170
 
# Build the tarballs
171
 
echo making new tarballs
172
 
 
173
 
if [ "$1" = "snap" ] ; then
174
 
        SNAP=Q.$( date +%Y%m%d )$REVISION
175
 
        rm -fr maradns-$SNAP
176
 
        mv maradns-$NEXT maradns-$SNAP
177
 
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
178
 
        exit 0
179
 
else
180
 
        SNAP=$NEXT
181
 
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
182
 
        tar czf maradns-$SNAP.tar.gz maradns-$SNAP
183
 
 
184
 
        # All of the compression we actually use was originally written by 
185
 
        # Igor Pavlov for the 7-zip compression suite
186
 
        echo shrinking .gz tarball
187
 
        advdef -z -4 maradns-$SNAP.tar.gz
188
 
fi
189
 
 
190
 
exit 0 # No exotic compression any more
191
 
 
192
 
echo using exotic compression
193
 
tar cf maradns-$SNAP.tar maradns-$SNAP
194
 
 
195
 
echo lzma compression \(this will take about 5 minutes\)
196
 
date
197
 
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
198
 
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
199
 
# (only a little over one meg needed for decompression)
200
 
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
201
 
date
202
 
echo
203
 
 
204
 
# Clean up the uncompressed tarball
205
 
rm maradns-$SNAP.tar
206
 
 
207
 
exit 0
208
 
 
209
 
# The other exotic compressors can't be run in a pipeline
210
 
 
211
 
echo 7zip compression
212
 
date
213
 
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
214
 
date
215
 
echo
216
 
 
217
 
echo paq6 compression \(This will take 2\-3 minutes\)
218
 
date
219
 
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
220
 
date
221
 
echo
222
 
 
223
 
echo rzip compression
224
 
date
225
 
rzip maradns-$SNAP.tar
226
 
date
227
 
echo