3
# This script updates Deadwood 2.9
5
# To run this script, make sure that this script is in the directory
6
# containing the tarball for the version of Deadwood you wish to update, and
7
# all of the patches are in a directory entitled 'patches'.
10
CURRENT=${CURRENT##*/}
13
# The revision number; in the case of having multiple snapshots a day,
14
# the revision number can be incremented so as to minimize confusion
15
# This is only done when more than one snapshop is uploaded to the
16
# maradns.org server in a given day.
19
# Make a clean CURRENT install, which we rename NEXT
20
rm -fr deadwood-$CURRENT 2> /dev/null
21
rm -fr deadwood-$NEXT 2> /dev/null
22
echo extracting tarball
23
tar xjf deadwood-$CURRENT.tar.bz2
25
echo run this from the correct directory
28
rm -fr deadwood-$NEXT*
29
mv deadwood-$CURRENT deadwood-$NEXT
35
if [ "$1" != "new" ] ; then
36
cp ../patches/deadwood-$CURRENT* update/$NEXT
37
#cp ../patches/maradns* update/$NEXT
41
# This is one of the few places where we will need to change anything
42
# in this script from version to version
46
# Regenerate Deadwood's random prime number
47
echo Making new random prime
49
rm -f *orig # While we're here, remove any pesky .orig files
50
cc -o foo RandomPrime.c
55
# Release-specific fixes and changes go here
57
# Patch #1: Update CHANGELOG
58
patch -p1 < update/$NEXT/deadwood-2.9.05-changelog.patch
60
# Patch #2: Update FAQ
61
patch -p1 < update/$NEXT/deadwood-2.9.05-FAQ.patch
63
# Patch #3: Add OTHER_STUFF flag to trim a little fat from Deadwood
64
patch -p1 < update/$NEXT/deadwood-2.9.05-other_stuff.patch
66
# Patch #4: Update Deadwood man page
67
patch -p1 < update/$NEXT/deadwood-2.9.05-deadwood_manpage.patch
69
# Patch #5: Update deliver_all
70
patch -p1 < update/$NEXT/deadwood-2.9.05-deliver_all.patch
72
# Patch #6: Handle empty DNS packets better
73
patch -p1 < update/$NEXT/deadwood-2.9.05-mt_packet.patch
75
# Patch #7: Handle SERVER FAIL from upstream w/o caching "not there"
76
patch -p1 < update/$NEXT/deadwood-2.9.05-serv_fail.patch
78
# Add Makefile.ipv6 (used by MaraDNS' build scripts)
79
cp ../files/Makefile.ipv6 src/
81
# Convert tabs in code to spaces, since this is inconsistant in different
82
# programs; disable when in "work" mode since it messes up patches
83
if [ "$1" != "work" ] ; then
84
echo removing tabs from source files
85
for a in $( find . -type f -name \*.[ch] ) ; do
90
chmod 755 src/make.version.h
92
echo updating documentation
93
# Update the documentation
96
# Go back to the deadwood dir
99
# Go one level higher than the toplevel directory to copy this script
103
# Put this script in the "build" directory
104
cp $0 deadwood-$NEXT/update/$NEXT
106
# Version number always current
107
cd deadwood-$NEXT/src
108
./make.version.h > version.h
111
if [ "$1" = "new" ] ; then
112
tar xjf deadwood-$CURRENT.tar.bz2
113
echo OK, both deadwood-$CURRENT and deadwood-$NEXT made\; you
114
echo now can start making patches.
118
if [ "$1" != "go" ] && [ "$1" != "snap" ] && [ "$1" != "work" ] ; then
119
echo OK, deadwood-$NEXT built. Confirm this compiles and
120
echo perform basic regression before re-running this to make
121
echo the tarballs. Once you have tested this, rerun this
122
echo script as: \"$0 go\" or as \"$0 snap\"
123
echo to make a daily snapshot
127
if [ "$1" = "work" ] ; then
128
tar xjf deadwood-$CURRENT.tar.bz2
129
echo OK, both deadwood-$CURRENT and deadwood-$NEXT made\; you
130
echo now can make more patches as needed.
131
cd deadwood-$NEXT/src
132
echo '#define VERSION "'$NEXT'-pre"' > version.h
138
echo making new tarballs
140
if [ "$1" = "snap" ] ; then
141
SNAP=H-$( date +%Y%m%d )-$REVISION
142
rm -fr deadwood-$SNAP
143
mv deadwood-$NEXT deadwood-$SNAP
144
cd deadwood-$SNAP/src
145
./make.version.h > version.h
147
tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP
151
cd deadwood-$SNAP/src
152
./make.version.h > version.h
154
tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP