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: Update the download links on the web page
52
patch -p1 < update/$NEXT/maradns-1.2.09-download.patch
54
# Patch #2: I hate Perl.
55
patch -p1 < update/$NEXT/maradns-1.2.09-perl_broken.patch
57
# Patch #3: Add some more timestamp types Remmy wants
58
patch -p1 < update/$NEXT/maradns-1.2.09-timestamp.patch
60
# Patch #4: Restore FAQ information about dangling CNAME records
61
patch -p1 < update/$NEXT/maradns-1.2.09-dangling_faq.patch
63
# Patch #5: Make sure the init.d script exits 0 if invoked normally
64
# (having it exit anything besides 0 breaks Debian's upgrade script)
65
patch -p1 < update/$NEXT/maradns-1.2.09-startup_exit0.patch
67
# Patch: Update RPM spec file (this is always done)
68
patch -p1 < update/$NEXT/maradns-$CURRENT-rpm_spec.patch
69
mv build/maradns-$CURRENT.spec build/maradns-$NEXT.spec
71
# Patch: Update changelog (this is always done)
72
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
74
# Other release-specific fixes and changes go here
80
# Anything below this line normally is not changed between MaraDNS versions
81
echo updating documentation
83
# Update the documentation
88
# The following is time-consuming, so we only do it when making the final
90
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
91
echo making PDF reference
101
# Go back to the maradns dir
105
ln -s doc/en/changelog.txt CHANGELOG
107
# Go one level higher than the toplevel directory to copy this script
111
# Put this script in the "build" directory
112
cp $0 maradns-$NEXT/update/$NEXT
114
if [[ "$1" != "go" && "$1" != "snap" && "$1" != "work" ]] ; then
115
echo OK, maradns-$NEXT built. Confirm this compiles and
116
echo perform basic regression before re-running this to make
117
echo the tarballs. Once you have tested this, rerun this
118
echo script as: \"$0 go\" or as \"$0 snap\"
119
echo to make a daily snapshot
123
if [ "$1" == "work" ] ; then
124
cat maradns-$CURRENT.tar.lzma | lzma d -si -so | tar xf -
125
echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
126
echo now can make more patches as needed.
131
echo making new tarballs
133
if [ "$1" == "snap" ] ; then
134
SNAP=Q.$( date +%Y%m%d )$REVISION
136
mv maradns-$NEXT maradns-$SNAP
137
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
141
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
142
tar czf maradns-$SNAP.tar.gz maradns-$SNAP
144
# All of the compression we actually use was originally written by
145
# Igor Pavlov for the 7-zip compression suite
146
echo shrinking .gz tarball
147
advdef -z -3 maradns-$SNAP.tar.gz
150
echo using exotic compression
151
tar cf maradns-$SNAP.tar maradns-$SNAP
153
echo lzma compression \(this will take about 5 minutes\)
155
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
156
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
157
# (only a little over one meg needed for decompression)
158
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
162
# Clean up the uncompressed tarball
167
# The other exotic compressors can't be run in a pipeline
169
echo 7zip compression
171
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
175
echo paq6 compression \(This will take 2\-3 minutes\)
177
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
181
echo rzip compression
183
rzip maradns-$SNAP.tar