make-package.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. # move into the application directory where Asterisk source exists
  9. cd /application
  10. # strip the source of any Git-isms
  11. rsync -av --exclude='.git' . /tmp/application
  12. # move to the build directory and build Asterisk
  13. cd /tmp/application
  14. ./configure
  15. cd menuselect
  16. make menuselect
  17. cd ..
  18. make menuselect-tree
  19. menuselect/menuselect --check-deps menuselect.makeopts
  20. # Do not include sound files. You should be mounting these from and external
  21. # volume.
  22. sed -i -e 's/MENUSELECT_MOH=.*$/MENUSELECT_MOH=/' menuselect.makeopts
  23. sed -i -e 's/MENUSELECT_CORE_SOUNDS=.*$/MENUSELECT_CORE_SOUNDS=/' menuselect.makeopts
  24. # Build it!
  25. make all install DESTDIR=/tmp/installdir
  26. rm -rf /tmp/application
  27. cd /build
  28. # Use the Fine Package Management system to build us an RPM without all that
  29. # reeking effort.
  30. fpm -t rpm -s dir -n asterisk-custom --version "$1" \
  31. --depends libedit \
  32. --depends libxslt \
  33. --depends jansson \
  34. --depends pjproject \
  35. --depends openssl \
  36. --depends libxml2 \
  37. --depends unixODBC \
  38. --depends libcurl \
  39. --depends libogg \
  40. --depends libvorbis \
  41. --depends speex \
  42. --depends spandsp \
  43. --depends freetds \
  44. --depends net-snmp \
  45. --depends iksemel \
  46. --depends corosynclib \
  47. --depends newt \
  48. --depends lua \
  49. --depends sqlite \
  50. --depends freetds \
  51. --depends radiusclient-ng \
  52. --depends postgresql \
  53. --depends neon \
  54. --depends libical \
  55. --depends openldap \
  56. --depends sqlite2 \
  57. --depends mysql \
  58. --depends bluez \
  59. --depends gsm \
  60. --depends libuuid \
  61. --depends libsrtp \
  62. -C /tmp/installdir etc usr var
  63. chown -R --reference /application/contrib/docker/make-package.sh .