asterisk/contrib/docker/make-package.sh
Leif Madsen 0da36fca6b Add initial support to build Docker images
This work-in-progress is the first step to being able to reliably
build Asterisk containers from the Asterisk source. I'm submitting
this based on feedback gained at AstriDevCon 2015.

Information about how to use this is provided in contrib/docker/README.md
and will result in a local Asterisk container being built right from
your source. I believe this can eventually be automated via
hub.docker.com.

Change-Id: Ifa070706d40e56755797097b6ed72c1e243bd0d1
2016-03-17 09:53:57 -05:00

73 lines
1.8 KiB
Bash
Executable file

#!/bin/bash
# This script intended to be run from the packager container. Please see the
# README.md file for more information on how this script is used.
#
set -ex
[ -n "$1" ]
mkdir -p /opt
# move into the application directory where Asterisk source exists
cd /application
# strip the source of any Git-isms
rsync -av --exclude='.git' . /tmp/application
# move to the build directory and build Asterisk
cd /tmp/application
./configure
cd menuselect
make menuselect
cd ..
make menuselect-tree
menuselect/menuselect --check-deps menuselect.makeopts
# Do not include sound files. You should be mounting these from and external
# volume.
sed -i -e 's/MENUSELECT_MOH=.*$/MENUSELECT_MOH=/' menuselect.makeopts
sed -i -e 's/MENUSELECT_CORE_SOUNDS=.*$/MENUSELECT_CORE_SOUNDS=/' menuselect.makeopts
# Build it!
make all install DESTDIR=/tmp/installdir
rm -rf /tmp/application
cd /build
# Use the Fine Package Management system to build us an RPM without all that
# reeking effort.
fpm -t rpm -s dir -n asterisk-custom --version "$1" \
--depends libedit \
--depends libxslt \
--depends jansson \
--depends pjproject \
--depends openssl \
--depends libxml2 \
--depends unixODBC \
--depends libcurl \
--depends libogg \
--depends libvorbis \
--depends speex \
--depends spandsp \
--depends freetds \
--depends net-snmp \
--depends iksemel \
--depends corosynclib \
--depends newt \
--depends lua \
--depends sqlite \
--depends freetds \
--depends radiusclient-ng \
--depends postgresql \
--depends neon \
--depends libical \
--depends openldap \
--depends sqlite2 \
--depends mysql \
--depends bluez \
--depends gsm \
--depends libuuid \
--depends libsrtp \
-C /tmp/installdir etc usr var
chown -R --reference /application/contrib/docker/make-package.sh .