-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·65 lines (56 loc) · 1.2 KB
/
build.sh
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
#!/usr/bin/env bash
# Requires:
# For DEB build:
# app-arch/dpkg
# sys-apps/fakeroot
# For RPM build:
# app-arch/createrepo
# app-arch/rpm
set -e
read -r -d '!' USAGE <<EOF
Usage: `basename $0` (deb|rpm|all) <version> [<package version>]
with:
deb build a DEB package of Silverpeas
rpm build a RPM package of Silverpeas
all build both a DEB and a RPM packages of Silverpeas
If the package release isn't set, then it is set at 1 by default!
EOF
print_usage()
{
echo "$USAGE"
}
fetch_sources()
{
pushd files/
silverpeasFile=silverpeas-${VER}-jboss6.tar.gz
if [ ! -e "${silverpeasFile}" ]; then
rm -v silverpeas-*.tar.gz || true
wget http://www.silverpeas.org/files/silverpeas-${VER}-jboss6.tar.gz
fi
if [ ! -e "jboss-as-distribution-6.1.0.Final.zip" ]; then
wget http://download.jboss.org/jbossas/6.1/jboss-as-distribution-6.1.0.Final.zip
fi
popd
}
if [ $# -lt 2 ]; then
print_usage
exit 1
fi
VER=$2
PKG_VER=$3
fetch_sources
case "$1" in
"deb")
./build-deb.sh ${VER} ${PKG_VER}
;;
"rpm")
./build-rpm.sh ${VER} ${PKG_VER}
;;
"all")
./build-deb.sh ${VER} ${PKG_VER}
./build-rpm.sh ${VER} ${PKG_VER}
;;
*)
print_usage
;;
esac