~ubuntu-branches/ubuntu/utopic/maradns/utopic

« back to all changes in this revision

Viewing changes to update/1.2.10/1.2.09-to-1.2.10

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry
  • Date: 2006-06-21 22:08:54 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060621220854-51ev9apuhyiia6f3
Tags: 1.2.10-1
* New upstream release
* Added --oknodo to stop case
* Stopping maradns: invoke-rc.d: initscript maradns, action "stop"
  failed. (Closes: #374655)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -e
 
2
 
 
3
# This script updates MaraDNS 1.2
 
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'.
 
8
 
 
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.
 
13
 
 
14
# You will need to have lzma on your system to run this script
 
15
 
 
16
# Get the current and next version number
 
17
 
 
18
CURRENT=${0%%-*}
 
19
CURRENT=${CURRENT##*/}
 
20
NEXT=${0##*-}
 
21
 
 
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 -
 
27
if [ $? != 0 ] ; then
 
28
        echo run this from the correct directory
 
29
        exit 1
 
30
fi
 
31
rm -fr maradns-$NEXT*
 
32
mv maradns-$CURRENT maradns-$NEXT
 
33
cd maradns-$NEXT
 
34
 
 
35
# The patches
 
36
 
 
37
mkdir update/$NEXT
 
38
cp ../patches/maradns-$CURRENT* update/$NEXT
 
39
 
 
40
# This is one of the few places where we will need to change anything
 
41
# in this script from version to version
 
42
 
 
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.
 
47
REVISION=.1
 
48
 
 
49
echo applying patches
 
50
 
 
51
# Patch #1: Update the download links on the web page
 
52
patch -p1 < update/$NEXT/maradns-1.2.09-download.patch
 
53
 
 
54
# Patch #2: I hate Perl. 
 
55
patch -p1 < update/$NEXT/maradns-1.2.09-perl_broken.patch
 
56
 
 
57
# Patch #3: Add some more timestamp types Remmy wants
 
58
patch -p1 < update/$NEXT/maradns-1.2.09-timestamp.patch
 
59
 
 
60
# Patch #4: Restore FAQ information about dangling CNAME records
 
61
patch -p1 < update/$NEXT/maradns-1.2.09-dangling_faq.patch 
 
62
 
 
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
 
66
 
 
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
 
70
 
 
71
# Patch: Update changelog (this is always done)
 
72
patch -p1 < update/$NEXT/maradns-$CURRENT-changelog.patch
 
73
 
 
74
# Other release-specific fixes and changes go here
 
75
 
 
76
cd doc/en/man
 
77
make clean
 
78
cd ../../..
 
79
 
 
80
# Anything below this line normally is not changed between MaraDNS versions
 
81
echo updating documentation
 
82
 
 
83
# Update the documentation
 
84
cd doc/en
 
85
make
 
86
cd man
 
87
make
 
88
# The following is time-consuming, so we only do it when making the final
 
89
# tarballs
 
90
if [[ "$1" == "go" || "$1" == "snap" ]] ; then
 
91
        echo making PDF reference
 
92
        ./make.pdf
 
93
        echo done
 
94
fi
 
95
cd ../tutorial
 
96
make
 
97
cd ../text
 
98
make
 
99
cd ../webpage
 
100
make
 
101
# Go back to the maradns dir
 
102
cd ../../..
 
103
 
 
104
rm CHANGELOG
 
105
ln -s doc/en/changelog.txt CHANGELOG
 
106
 
 
107
# Go one level higher than the toplevel directory to copy this script
 
108
# over
 
109
cd ..
 
110
 
 
111
# Put this script in the "build" directory
 
112
cp $0 maradns-$NEXT/update/$NEXT
 
113
 
 
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
 
120
        exit 0
 
121
fi
 
122
 
 
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.  
 
127
        exit 0
 
128
fi
 
129
 
 
130
# Build the tarballs
 
131
echo making new tarballs
 
132
 
 
133
if [ "$1" == "snap" ] ; then
 
134
        SNAP=Q.$( date +%Y%m%d )$REVISION
 
135
        rm -fr maradns-$SNAP
 
136
        mv maradns-$NEXT maradns-$SNAP
 
137
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
 
138
        exit 0
 
139
else
 
140
        SNAP=$NEXT
 
141
        tar cjf maradns-$SNAP.tar.bz2 maradns-$SNAP
 
142
        tar czf maradns-$SNAP.tar.gz maradns-$SNAP
 
143
 
 
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
 
148
fi
 
149
 
 
150
echo using exotic compression
 
151
tar cf maradns-$SNAP.tar maradns-$SNAP
 
152
 
 
153
echo lzma compression \(this will take about 5 minutes\)
 
154
date
 
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
 
159
date
 
160
echo
 
161
 
 
162
# Clean up the uncompressed tarball
 
163
rm maradns-$SNAP.tar
 
164
 
 
165
exit 0
 
166
 
 
167
# The other exotic compressors can't be run in a pipeline
 
168
 
 
169
echo 7zip compression
 
170
date
 
171
7za a maradns-$SNAP.tar.7z maradns-$SNAP.tar
 
172
date
 
173
echo
 
174
 
 
175
echo paq6 compression \(This will take 2\-3 minutes\)
 
176
date
 
177
paq6v2 -2 maradns-$SNAP.tar.pq6 maradns-$SNAP.tar
 
178
date
 
179
echo
 
180
 
 
181
echo rzip compression
 
182
date
 
183
rzip maradns-$SNAP.tar
 
184
date
 
185
echo