-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-tree
executable file
·69 lines (57 loc) · 1.47 KB
/
build-tree
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
#!/bin/bash
set -e
## Set the variables for things
usage() { echo "Usage: $0 -a ASTERISK_VERSION -r RELEASE -v APP_RPT_VERSION" 1>&2; exit 1; }
while getopts "a:r:v:" o; do
case "${o}" in
a)
AST_VER=${OPTARG}
;;
r)
REL=${OPTARG}
;;
v)
RPT_VER=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${AST_VER}" ] || [ -z "${RPT_VER}" ] || [ -z "${REL}" ]; then
usage
fi
if [ -z "${EDITOR}" ]; then
export EDITOR=vim
fi
if [ -z "${EMAIL}" ]; then
export [email protected]
fi
FULL_REL="${REL}.deb$(lsb_release -rs 2> /dev/null)"
VSTR="${AST_VER}+asl3-${RPT_VER}"
EPOCH="2"
LPATH="asl3-asterisk-${VSTR}"
## Clean up and Prep the Build Environment
if [ -d ${LPATH} ]; then
rm -rf ${LPATH}
fi
if [ ! -f asterisk-${AST_VER}.tar.gz ]; then
wget -O asterisk-${AST_VER}.tar.gz https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${AST_VER}.tar.gz
fi
tar xfz asterisk-${AST_VER}.tar.gz
mv asterisk-${AST_VER} ${LPATH}
pushd ${LPATH}
../asl3-asterisk/add-app_rpt-modules ../app_rpt
../asl3-asterisk/add-debian ../asl3-asterisk
echo ${VSTR} > .version
( cd ChangeLogs && ln -s ChangeLog-${AST_VER}.md ChangeLog-${VSTR}.md5 )
rm debian/changelog
debchange --create --package asl3-asterisk \
-v ${EPOCH}:${VSTR}-${FULL_REL} -- "see https://github.com/AllStarLink/app_rpt"
debchange -r ""
popd
tar cfz asl3-asterisk_${VSTR}.orig.tar.gz ${LPATH}/
## Do the building
pushd ${LPATH}
dpkg-buildpackage -b --no-sign -j$(nproc --all)