| 1 | #!/bin/bash |
| 2 | # This script intended to be run from the packager container. Please see the |
| 3 | # README.md file for more information on how this script is used. |
| 4 | # |
| 5 | set -ex |
| 6 | [ -n "$1" ] |
| 7 | mkdir -p /opt |
| 8 | |
| 9 | # move into the application directory where Asterisk source exists |
| 10 | cd /application |
| 11 | |
| 12 | # strip the source of any Git-isms |
| 13 | rsync -av --exclude='.git' . /tmp/application |
| 14 | |
| 15 | # move to the build directory and build Asterisk |
| 16 | cd /tmp/application |
| 17 | ./configure |
| 18 | cd menuselect |
| 19 | make menuselect |
| 20 | cd .. |
| 21 | make menuselect-tree |
| 22 | |
| 23 | menuselect/menuselect --check-deps menuselect.makeopts |
| 24 | |
| 25 | # Do not include sound files. You should be mounting these from and external |
| 26 | # volume. |
| 27 | sed -i -e 's/MENUSELECT_MOH=.*$/MENUSELECT_MOH=/' menuselect.makeopts |
| 28 | sed -i -e 's/MENUSELECT_CORE_SOUNDS=.*$/MENUSELECT_CORE_SOUNDS=/' menuselect.makeopts |
| 29 | |
| 30 | # Build it! |
| 31 | make all install DESTDIR=/tmp/installdir |
| 32 | |
| 33 | rm -rf /tmp/application |
| 34 | cd /build |
| 35 | |
| 36 | # Use the Fine Package Management system to build us an RPM without all that |
| 37 | # reeking effort. |
| 38 | fpm -t rpm -s dir -n asterisk-custom --version "$1" \ |
| 39 | --depends libedit \ |
| 40 | --depends libxslt \ |
| 41 | --depends jansson \ |
| 42 | --depends pjproject \ |
| 43 | --depends openssl \ |
| 44 | --depends libxml2 \ |
| 45 | --depends unixODBC \ |
| 46 | --depends libcurl \ |
| 47 | --depends libogg \ |
| 48 | --depends libvorbis \ |
| 49 | --depends speex \ |
| 50 | --depends spandsp \ |
| 51 | --depends freetds \ |
| 52 | --depends net-snmp \ |
| 53 | --depends iksemel \ |
| 54 | --depends corosynclib \ |
| 55 | --depends newt \ |
| 56 | --depends lua \ |
| 57 | --depends sqlite \ |
| 58 | --depends freetds \ |
| 59 | --depends radiusclient-ng \ |
| 60 | --depends postgresql \ |
| 61 | --depends neon \ |
| 62 | --depends libical \ |
| 63 | --depends openldap \ |
| 64 | --depends sqlite2 \ |
| 65 | --depends mysql \ |
| 66 | --depends bluez \ |
| 67 | --depends gsm \ |
| 68 | --depends libuuid \ |
| 69 | --depends libsrtp \ |
| 70 | -C /tmp/installdir etc usr var |
| 71 | |
| 72 | chown -R --reference /application/contrib/docker/make-package.sh . |