~ubuntu-branches/ubuntu/wily/maradns/wily-proposed

« back to all changes in this revision

Viewing changes to deadwood-3.2.07/update/2.9.06/2.9.05-to-2.9.06

  • Committer: Package Import Robot
  • Author(s): Dariusz Dwornikowski, Tomasz Buchert, Dariusz Dwornikowski
  • Date: 2015-03-27 18:34:08 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20150327183408-wnfachdkdjt96yu6
Tags: 2.0.11-1
[ Tomasz Buchert ]
* Imported Upstream version 2.0.11

[ Dariusz Dwornikowski ]
* d/patches: 
  - refreshed all patches for new deadwood version
  - removed generating of random prime on build (Closes: #785536) 
* d/rules: date taken from changelog (Closes: #785535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
 
 
3
# This script updates Deadwood 2.9
 
4
 
 
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'.
 
8
 
 
9
CURRENT=${0%%-*}
 
10
CURRENT=${CURRENT##*/}
 
11
NEXT=${0##*-}
 
12
 
 
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.
 
17
REVISION=1
 
18
 
 
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
 
24
if [ $? != 0 ] ; then
 
25
        echo run this from the correct directory
 
26
        exit 1
 
27
fi
 
28
rm -fr deadwood-$NEXT*
 
29
mv deadwood-$CURRENT deadwood-$NEXT
 
30
cd deadwood-$NEXT
 
31
 
 
32
# The patches
 
33
 
 
34
mkdir update/$NEXT
 
35
if [ "$1" != "new" ] ; then
 
36
        cp ../patches/deadwood-$CURRENT* update/$NEXT
 
37
        #cp ../patches/maradns* update/$NEXT
 
38
        #echo
 
39
fi
 
40
 
 
41
# This is one of the few places where we will need to change anything
 
42
# in this script from version to version
 
43
 
 
44
echo applying patches
 
45
 
 
46
# Regenerate Deadwood's random prime number
 
47
echo Making new random prime
 
48
cd src
 
49
rm -f *orig # While we're here, remove any pesky .orig files
 
50
cc -o foo RandomPrime.c
 
51
./foo > DwRandPrime.h
 
52
rm foo
 
53
cd ..
 
54
 
 
55
# Release-specific fixes and changes go here
 
56
 
 
57
# Patch #1: Update CHANGELOG
 
58
patch -p1 < update/$NEXT/deadwood-2.9.05-changelog.patch
 
59
 
 
60
# Patch #2: Update FAQ
 
61
patch -p1 < update/$NEXT/deadwood-2.9.05-FAQ.patch
 
62
 
 
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
 
65
 
 
66
# Patch #4: Update Deadwood man page
 
67
patch -p1 < update/$NEXT/deadwood-2.9.05-deadwood_manpage.patch
 
68
 
 
69
# Patch #5: Update deliver_all
 
70
patch -p1 < update/$NEXT/deadwood-2.9.05-deliver_all.patch
 
71
 
 
72
# Patch #6: Handle empty DNS packets better
 
73
patch -p1 < update/$NEXT/deadwood-2.9.05-mt_packet.patch
 
74
 
 
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
 
77
 
 
78
# Add Makefile.ipv6 (used by MaraDNS' build scripts)
 
79
cp ../files/Makefile.ipv6 src/
 
80
 
 
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 
 
86
                col -x < $a > foo
 
87
                mv foo $a
 
88
        done
 
89
fi
 
90
chmod 755 src/make.version.h
 
91
 
 
92
echo updating documentation
 
93
# Update the documentation
 
94
cd doc
 
95
make
 
96
# Go back to the deadwood dir
 
97
cd ..
 
98
 
 
99
# Go one level higher than the toplevel directory to copy this script
 
100
# over
 
101
cd ..
 
102
 
 
103
# Put this script in the "build" directory
 
104
cp $0 deadwood-$NEXT/update/$NEXT
 
105
 
 
106
# Version number always current
 
107
cd deadwood-$NEXT/src
 
108
./make.version.h > version.h
 
109
cd ../..
 
110
 
 
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.
 
115
        exit 0
 
116
fi
 
117
 
 
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
 
124
        exit 0
 
125
fi
 
126
 
 
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
 
133
        cd ../..
 
134
        exit 0
 
135
fi
 
136
 
 
137
# Build the tarballs
 
138
echo making new tarballs
 
139
 
 
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
 
146
        cd ../..
 
147
        tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP
 
148
        exit 0
 
149
else
 
150
        SNAP=$NEXT
 
151
        cd deadwood-$SNAP/src
 
152
        ./make.version.h > version.h
 
153
        cd ../..
 
154
        tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP
 
155
fi
 
156
 
 
157
exit 0 # Done