3
# This script updates MaraDNS 1.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'.
9
# For example, to update MaraDNS 1.4.02 to 1.4.03, make sure
10
# maradns-1.3.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.
15
CURRENT=${CURRENT##*/}
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.
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
30
echo run this from the correct directory
34
mv maradns-$CURRENT maradns-$NEXT
40
if [ "$1" != "new" ] ; then
41
cp ../patches/maradns-1* update/$NEXT
44
# This is one of the few places where we will need to change anything
45
# in this script from version to version
49
# Update RPM spec file (We now have a script make the .spec file)
50
rm build/maradns-$CURRENT.spec
51
tools/misc/make.maradns.spec $NEXT 2> /dev/null > foo
52
grep -v EOF foo > build/maradns-$NEXT.spec
55
# Regenerate Deadwood's random prime number
56
echo Making new random prime
57
cd deadwood-3.0.05/src
58
cc -o foo RandomPrime.c
63
# Release-specific fixes and changes go here
65
# This can usually stay the same
66
for a in update/$NEXT/maradns*patch ; do
67
echo applying patch $a
71
# Anything below this line normally is not changed between MaraDNS versions
73
# Make sure text changelog and FAQ are up-to-date
74
cp doc/en/webpage/faq.embed doc/en/source/faq.embed
75
cp doc/en/webpage/changelog.embed doc/en/source/changelog.embed
77
# Convert tabs in code to spaces, since this is inconsistant in different
79
echo removing tabs from source files
81
for a in $( find . -type f -name \*.[ch] ) ; do
88
ln -s doc/en/changelog.txt CHANGELOG
90
# Go one level higher than the toplevel directory to copy this script
94
# Put this script in the "build" directory
95
cp $0 maradns-$NEXT/update/$NEXT
97
if [ "$1" = "new" ] ; then
98
tar xjf maradns-$CURRENT.tar.bz2
99
echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
100
echo now can start making patches.
104
if [ "$1" != "go" ] && [ "$1" != "snap" ] && [ "$1" != "work" ] ; then
105
echo OK, maradns-$NEXT built. Confirm this compiles and
106
echo perform basic regression before re-running this to make
107
echo the tarballs. Once you have tested this, rerun this
108
echo script as: \"$0 go\" or as \"$0 snap\"
109
echo to make a daily snapshot
113
if [ "$1" = "work" ] ; then
114
tar xjf maradns-$CURRENT.tar.bz2
115
echo OK, both maradns-$CURRENT and maradns-$NEXT made\; you
116
echo now can make more patches as needed.
121
echo making new tarballs
123
if [ "$1" = "snap" ] ; then
124
SNAP=Q.$( date +%Y%m%d )$REVISION
126
mv maradns-$NEXT maradns-$SNAP
127
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
131
tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
132
tar czf maradns-$SNAP.tar.gz maradns-$SNAP
134
# All of the compression we actually use was originally written by
135
# Igor Pavlov for the 7-zip compression suite
136
echo shrinking .gz tarball
137
advdef -z -4 maradns-$SNAP.tar.gz
140
exit 0 # No exotic compression any more
142
echo using exotic compression
143
tar cf maradns-$SNAP.tar maradns-$SNAP
145
echo lzma compression \(this will take about 5 minutes\)
147
# To decompress: cat file.tar.lzma | lzma d -si -so | tar xvf -
148
# -d20 makes the file almost as small as -d22, but uses 1/4 of the memory
149
# (only a little over one meg needed for decompression)
150
lzma e maradns-$SNAP.tar maradns-$SNAP.tar.lzma -a2 -d20 -fb255
154
# Clean up the uncompressed tarball
159
# The other exotic compressors can't be run in a pipeline
161
echo 7zip compression
163
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
167
echo paq6 compression \(This will take 2\-3 minutes\)
169
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
173
echo rzip compression
175
rzip maradns-$SNAP.tar