forked from dogtagpki/tomcatjss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_tomcatjss
executable file
·43 lines (38 loc) · 1.09 KB
/
build_tomcatjss
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
#! /bin/bash
# This script may ONLY be run on Linux!
OS=`uname`
if [ ${OS} != "Linux" ]; then
printf "The '$0' script is ONLY executable on a 'Linux' machine!\n"
exit 255
fi
# If Fedora, retrieve the release
if [ -f /etc/fedora-release ]; then
FEDORA_RELEASE=`cat /etc/fedora-release | awk {'print $3'}`
fi
ARCH=`uname -p`
if [ "${ARCH}" = "x86_64" ]; then
if [ -f /etc/fedora-release ] &&
[ ${FEDORA_RELEASE} -ge 19 ]; then
JNIDIR=/usr/lib/java
elif [ -f /etc/fedora-release ] &&
[ ${FEDORA_RELEASE} -ge 16 ]; then
JNIDIR=/usr/lib64/java
else
JNIDIR=/usr/lib/java
fi
elif [ ${ARCH} != "i686" ] ||
[ ${ARCH} != "i586" ] ||
[ ${ARCH} != "i486" ] ||
[ ${ARCH} != "i386" ]; then
JNIDIR=/usr/lib/java
else
printf "The '$0' script is NOT executable on the '${ARCH}' architecture!\n"
exit 255
fi
if [ -f /etc/fedora-release ]; then
# Script is being run on Fedora
ant -f build.xml -Drhel=0 -Djnidir=${JNIDIR} -Dspecfile=tomcatjss.spec rpms
elif [ -f /etc/redhat-release ]; then
# Script is being run on RHEL
ant -f build.xml -Drhel=1 -Djnidir=${JNIDIR} -Dspecfile=tomcatjss.spec rpms
fi