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

« back to all changes in this revision

Viewing changes to deadwood-3.2.07/update/2.9.04/2.9.03-to-2.9.04

  • 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: Unless STRICT_RFC2671_COMPLIANCE is defined, we handle a
 
58
#       DNS packet with EDNS information as if the EDNS part of the packet
 
59
#       did not exist
 
60
patch -p1 < update/2.9.04/deadwood-2.9.03-handle_edns.patch 
 
61
 
 
62
# Patch #2: Convert DNS queries in to lower case before sending them
 
63
#       upstream
 
64
#cp src/DwUdpSocket.c src/DwUdpSocket.c.orig
 
65
patch -p1 < update/2.9.04/deadwood-2.9.03-lower_case.patch
 
66
 
 
67
# Patch #3: Tune the default timeout_seconds down to 2 seconds and
 
68
# increase the cap on the maximum number of DNS queries we can process at
 
69
# the same time up to 16,384
 
70
patch -p1 < update/2.9.04/deadwood-2.9.03-tune_params.patch
 
71
 
 
72
# Patch #4: Update CHANGELOG
 
73
patch -p1 < update/2.9.04/deadwood-2.9.03-changelog.patch
 
74
 
 
75
# Convert tabs in code to spaces, since this is inconsistant in different
 
76
# programs; disable when in "work" mode since it messes up patches
 
77
if [ "$1" != "work" ] ; then 
 
78
        echo removing tabs from source files
 
79
        for a in $( find . -type f -name \*.[ch] ) ; do 
 
80
                col -x < $a > foo
 
81
                mv foo $a
 
82
        done
 
83
fi
 
84
chmod 755 src/make.version.h
 
85
 
 
86
echo updating documentation
 
87
# Update the documentation
 
88
cd doc
 
89
make
 
90
# Go back to the deadwood dir
 
91
cd ..
 
92
 
 
93
# Go one level higher than the toplevel directory to copy this script
 
94
# over
 
95
cd ..
 
96
 
 
97
# Put this script in the "build" directory
 
98
cp $0 deadwood-$NEXT/update/$NEXT
 
99
 
 
100
# Version number always current
 
101
cd deadwood-$NEXT/src
 
102
./make.version.h > version.h
 
103
cd ../..
 
104
 
 
105
if [ "$1" = "new" ] ; then
 
106
        tar xjf deadwood-$CURRENT.tar.bz2
 
107
        echo OK, both deadwood-$CURRENT and deadwood-$NEXT made\; you
 
108
        echo now can start making patches.
 
109
        exit 0
 
110
fi
 
111
 
 
112
if [ "$1" != "go" ] && [ "$1" != "snap" ] && [ "$1" != "work" ] ; then
 
113
        echo OK, deadwood-$NEXT built.  Confirm this compiles and       
 
114
        echo perform basic regression before re-running this to make
 
115
        echo the tarballs.  Once you have tested this, rerun this 
 
116
        echo script as: \"$0 go\" or as \"$0 snap\" 
 
117
        echo to make a daily snapshot
 
118
        exit 0
 
119
fi
 
120
 
 
121
if [ "$1" = "work" ] ; then
 
122
        tar xjf deadwood-$CURRENT.tar.bz2
 
123
        echo OK, both deadwood-$CURRENT and deadwood-$NEXT made\; you
 
124
        echo now can make more patches as needed.  
 
125
        cd deadwood-$NEXT/src
 
126
        echo '#define VERSION "'$NEXT'-pre"' > version.h
 
127
        cd ../..
 
128
        exit 0
 
129
fi
 
130
 
 
131
# Build the tarballs
 
132
echo making new tarballs
 
133
 
 
134
if [ "$1" = "snap" ] ; then
 
135
        SNAP=H-$( date +%Y%m%d )-$REVISION
 
136
        rm -fr deadwood-$SNAP
 
137
        mv deadwood-$NEXT deadwood-$SNAP
 
138
        cd deadwood-$SNAP/src
 
139
        ./make.version.h > version.h
 
140
        cd ../..
 
141
        tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP
 
142
        exit 0
 
143
else
 
144
        SNAP=$NEXT
 
145
        cd deadwood-$SNAP/src
 
146
        ./make.version.h > version.h
 
147
        cd ../..
 
148
        tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP
 
149
fi
 
150
 
 
151
exit 0 # Done