File: buildconf

package info (click to toggle)
tomcat-native 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,956 kB
  • sloc: ansic: 12,920; sh: 3,809; java: 2,432; xml: 709; perl: 327; makefile: 46
file content (109 lines) | stat: -rwxr-xr-x 2,946 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#

# Default place to look for apr source.  Can be overridden with 
#   --with-apr=[directory]
apr_src_dir=`pwd`/srclib/apr-1.5.2

while [ $# -gt 0 ]
do
  # Normalize
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case "$1" in
  --with-apr=*)
    apr_src_dir=$optarg
    ;;
  esac

  shift
done

if [ -d "$apr_src_dir" ]; then
  echo ""
  echo "Looking for apr source in $apr_src_dir"
else
  echo ""
  echo "Problem finding apr source in $apr_src_dir."
  echo "Use:"
  echo "  --with-apr=[directory]" 
  exit 1
fi

if [ ! -d "$apr_src_dir/build" ]; then
  echo "Directory '$apr_src_dir/build' missing - wrong apr source directory?"
  exit 1
fi

# Remove some files, then copy them from apr source tree
for file in apr_common.m4 find_apr.m4 install.sh config.guess config.sub
do
  if [ ! -f "$apr_src_dir/build/$file" ]; then
    echo "File '$apr_src_dir/build/$file' missing - wrong apr source directory?"
    exit 1
  fi
  rm -f build/$file
  cp $apr_src_dir/build/$file build/
done

# Remove aclocal.m4 as it'll break some builds...
rm -rf aclocal.m4 autom4te*.cache

echo "Creating configure ..."
### do some work to toss config.cache?
${AUTOCONF:-autoconf}
if [ $? -gt 0 ]; then
  echo "autoconf failed"
  exit 1
fi

#
# Generate build-outputs.mk for the build systme
#
PYTHON=${PYTHON-`build/PrintPath python3 python2 python`}

echo "Generating 'make' outputs ..."
${PYTHON} $apr_src_dir/build/gen-build.py make
if [ $? -gt 0 ]; then
  echo "Creating build-outputs.mk failed"
  exit 1
fi

# Remove autoconf cache again
rm -rf autom4te*.cache

# Create RPM Spec file
echo rebuilding rpm spec file
REVISION=`build/get-version.sh all include/tcn_version.h TCN`
# Strip everything behind "-"
VERSION=`echo $REVISION | sed -e 's/-.*//'`
# Strip everything before "-"
RELEASE=`echo $REVISION | sed -e 's/.*-//'`
# Handle case of no "-" in REVISION
if [ "x$RELEASE" = "x$REVISION" ]; then
  RELEASE=1
fi
echo "Using version '$VERSION' and release '$RELEASE' in RPM spec file"
sed -e "s/TCN_VERSION/$VERSION/" \
    -e "s/TCN_RELEASE/$RELEASE/" \
    ./build/rpm/tcnative.spec.in \
    > tcnative.spec