File: jkrelease.sh

package info (click to toggle)
libapache-mod-jk 1%3A1.2.18-3etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 5,008 kB
  • ctags: 2,664
  • sloc: ansic: 20,014; sh: 8,661; xml: 7,304; perl: 617; makefile: 321; awk: 59
file content (166 lines) | stat: -rw-r--r-- 3,772 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/ksh

# Make sure to set your path so that we can find
# the following binaries:
# cd, mkdir, cp, rm, find
# svn
# ant
# libtoolize, aclocal, autoheader, automake, autoconf
# tar, zip, gzip
# gpg
# And any one of: w3m, elinks, links

export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/local/jdk1.4.2

# You need to change the version numbers
JK_VERMAJOR="1"
JK_VERMINOR="2"
JK_VERFIX="18"
ASFROOT="http://svn.apache.org/repos/asf"
JK_CVST="tomcat-connectors"

JK_OWNER="asf"
JK_GROUP="asf"

COPY_TOP="KEYS LICENSE NOTICE"
COPY_JK="BUILD.txt native support tools xdocs"
COPY_CONF="uriworkermap.properties workers.properties workers.properties.minimal"

JK_VER="${JK_VERMAJOR}.${JK_VERMINOR}.${JK_VERFIX}"
JK_BRANCH="jk${JK_VERMAJOR}.${JK_VERMINOR}.x"
JK_TAG="JK_${JK_VERMAJOR}_${JK_VERMINOR}_${JK_VERFIX}"

JK_DIST=${JK_CVST}-${JK_VER}-src
JK_SVN_URL="${ASFROOT}/tomcat/connectors/tags/${JK_BRANCH}/${JK_TAG}"

#################### NO CHANGE BELOW THIS LINE ##############

umask 022

rm -rf ${JK_DIST}
rm -rf ${JK_DIST}.tmp

mkdir -p ${JK_DIST}.tmp
svn export "${JK_SVN_URL}/jk" ${JK_DIST}.tmp/jk
for item in ${COPY_TOP}
do
    svn export "${JK_SVN_URL}/${item}" ${JK_DIST}.tmp/${item}
done

# Build documentation.
cd ${JK_DIST}.tmp/jk/xdocs
ant
cd ../../..

# Copying things into source distribution
srcdir=${JK_DIST}.tmp
targetdir=${JK_DIST}
mkdir -p ${targetdir}
for item in ${COPY_TOP}
do
    echo "Copying $item from ${srcdir} ..."
    cp -pr ${srcdir}/$item ${targetdir}/
done

srcdir=${JK_DIST}.tmp/jk
targetdir=${JK_DIST}
mkdir -p ${targetdir}
for item in ${COPY_JK}
do
    echo "Copying $item from ${srcdir} ..."
    cp -pr ${srcdir}/$item ${targetdir}/
done

srcdir=${JK_DIST}.tmp/jk/build
targetdir=${JK_DIST}
mkdir -p ${targetdir}
for item in docs
do
    echo "Copying $item from ${srcdir} ..."
    cp -pr ${srcdir}/$item ${targetdir}/
done

srcdir=${JK_DIST}.tmp/jk/conf
targetdir=${JK_DIST}/conf
mkdir -p ${targetdir}
for item in ${COPY_CONF}
do
    echo "Copying $item from ${srcdir} ..."
    cp -pr ${srcdir}/$item ${targetdir}/
done

# Remove extra directories and files
targetdir=${JK_DIST}
rm -rf ${targetdir}/xdocs/jk2
rm -rf ${targetdir}/native/CHANGES.txt
rm -rf ${targetdir}/native/build.xml
find ${JK_DIST} -name .cvsignore -exec rm -rf \{\} \; 
find ${JK_DIST} -name CVS -exec rm -rf \{\} \; 
find ${JK_DIST} -name .svn -exec rm -rf \{\} \; 

cd ${JK_DIST}/native

# Check for links, elinks or w3m
W3MOPTS="-dump -cols 80 -t 4 -S -O iso-8859-1 -T text/html"
LNKOPTS="-dump"
ELNKOPTS="--dump --no-numbering --no-home"
failed=true
for tool in `echo "w3m elinks links"`
do
  found=false
  for dir in `echo ${PATH} | sed 's!^:!.:!;s!:$!:.!;s!::!:.:!g;s!:! !g'`
  do
    if [ -x ${dir}/${tool} ]
    then
      found=true
      break
    fi
  done

  # Try to run it
  if ${found}
  then
    case ${tool} in
      w3m)
        TOOL="w3m $W3MOPTS"
        ;;
      links)
        TOOL="links $LNKOPTS"
        ;;
      elinks)
        TOOL="elinks $ELNKOPTS"
        ;;
    esac
    rm -f CHANGES
    ${TOOL} ../docs/printer/changelog.html > CHANGES 2>/dev/null
    if [ -f CHANGES -a -s CHANGES ]
    then
      failed=false
      break
    fi
  fi
done
if [ ${failed} = "true" ]
then
  echo "Can't convert html to text (CHANGES)"
  exit 1
fi

# Export text docs
${TOOL} ../docs/printer/changelog.html >CHANGES
${TOOL} ../docs/news/printer/20060101.html >NEWS
${TOOL} ../docs/news/printer/20050101.html >>NEWS
${TOOL} ../docs/news/printer/20041100.html >>NEWS

# Generate configure et. al.
./buildconf.sh
cd ../../

# Pack and sign
tar cvf ${JK_DIST}.tar --owner="${JK_OWNER}" --group="${JK_GROUP}" ${JK_DIST}
gzip ${JK_DIST}.tar
zip -9 -r ${JK_DIST}.zip ${JK_DIST}
# Create detatched signature
gpg -ba ${JK_DIST}.tar.gz
gpg -ba ${JK_DIST}.zip