README.source 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. FreeSWITCH for Debian
  2. =====================
  3. Introduction
  4. ------------
  5. Because FreeSWITCH has so many modules it was necessary to create a
  6. system to autogenerate the majority of the packaging. This in done
  7. mostly in the file debian/bootstrap.sh. This bootstrap needs to run
  8. before any other step of the packaging, though we do try to
  9. autogenerate it when possible.
  10. Getting the FreeSWITCH sources
  11. ------------------------------
  12. Everything that follows will assume that you're in the base directory
  13. of a FreeSWITCH git repository. You can achieve this with:
  14. aptitude update && aptitude install -y git
  15. mkdir -p /usr/src/freeswitch
  16. git clone https://github.com/signalwire/freeswitch.git /usr/src/freeswitch/src
  17. cd /usr/src/freeswitch/src
  18. Ensuring you have a clean build directory
  19. -----------------------------------------
  20. Every time you start over, you should make sure your build directory
  21. is perfectly clean and clear of untracked files. You can accomplish
  22. this with:
  23. git clean -fdx && git reset --hard origin/master
  24. Using the packaging to do a normal build
  25. ----------------------------------------
  26. Let's say you don't want to build the Debian packages; you just want
  27. to build FS. You'll need certain dependencies installed on your
  28. system to do this. And you probably want to configure FS in the same
  29. way we do for the packaging. You can let the packaging files do this
  30. work for you so you don't have to manually keep track of which
  31. dependencies are required to build FS. Build as follows:
  32. aptitude update && aptitude install -y devscripts equivs build-essential
  33. my_release=$(awk '/deb .*\/debian/{print $3; exit}' /etc/apt/sources.list)
  34. (cd debian && ./bootstrap.sh -c $my_release)
  35. sed -i debian/control -e '/^#/d' && sed -i debian/control -e '/^$/N;/^\n$/D'
  36. mk-build-deps -i
  37. make -f debian/rules .stamp-configure && make
  38. The debian/modules.conf file
  39. ----------------------------
  40. If the file debian/modules.conf is present, we read that file and only
  41. build and package the files listed there. Otherwise, we build every
  42. module except the ones that either should not be packaged, or for
  43. which we don't yet have good packaging.
  44. The format of debian/modules.conf is:
  45. ## comments should start with two hash characters
  46. <category>/<module_name>
  47. Building the Debian packaging
  48. -----------------------------
  49. If you want actualy Debian binary or source packages to upload to your
  50. own repository, you'll need to build them as described here. We have
  51. some fancy automatic tools to accomplish this. The tools allow you to
  52. start from a very bare Debian image and generate working packages.
  53. Building in this manner is only supported on Debian jessie, though it
  54. will generate packages for all supported Debian releases. Simply run as root:
  55. echo "USENETWORK=yes" >$HOME/.pbuilderrc
  56. ./debian/util.sh build-all -ibn -z9 -aamd64 -cjessie
  57. Building on Ubuntu
  58. ------------------
  59. Building on supported Ubuntu releases requires the main and universe
  60. APT components in the pbuilder chroot. You should enable the universe
  61. component in your system's APT sources.list and use the -t option to
  62. use your system sources in the chroot:
  63. ./debian/util.sh build-all -ibn -z9 -t
  64. Building only some modules
  65. --------------------------
  66. If you don't need all the modules to build, create a modules.conf file
  67. outside of your source tree and pass the -f option to build-all. e.g.:
  68. echo "applications/mod_commands" > /tmp/modules.conf
  69. ./debian/util.sh build-all -ibn -z9 -f /tmp/modules.conf
  70. Testing a particular module under packaging
  71. -------------------------------------------
  72. If you need to build a small set of modules for compile testing in the
  73. pbuilder environment, you can run:
  74. ./debian/util.sh build-all -dni -z1 -a amd64 -c sid -l "applications/mod_commands"
  75. Getting help with debian/util.sh
  76. --------------------------------
  77. The debian/util.sh has many options. You can see the documentation
  78. for these options by running:
  79. ./debian/util.sh -h
  80. The debian/control-modules file
  81. -------------------------------
  82. The build dependencies, runtime dependencies, and other details about
  83. modules can be configured in the debian/control-modules file. Even
  84. though this file looks a bit like a debian control file and has a
  85. similar format, we are parsing this file ourselves so the format is a
  86. bit more restricted.
  87. debian/control-modules currently supports the following fields:
  88. # lines that begin with the hash character are comments
  89. #
  90. # every block must start with a Module field
  91. Module: <category>/<module_name>
  92. Description: <short description>
  93. <long description> # empty lines with "."s are not yet supported
  94. Build-Depends: <build deps for this module>
  95. Depends: <runtime deps for this module>
  96. Recommends: <recommended packages>
  97. Suggests: <suggested packages>
  98. Distro-Conflicts: <distributions on which this module should not be built> # not yet implemented
  99. During bootstrap we build a file control-modules.gen. If the
  100. control-modules file is properly formatted, this generated file should
  101. be identical. This is a sanity check mechanism for our parsing, as
  102. well as a way to automatically reorganize the file.
  103. Building Debian packages without util.sh
  104. ----------------------------------------
  105. Building the packages without util.sh is not recommended as util.sh
  106. takes care of many non-trivial details. If needed, however, the
  107. packages can be built:
  108. distro=sid
  109. ver="$(cat build/next-release.txt | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
  110. git clean -fdx && git reset --hard origin/master
  111. ./build/set-fs-version.sh "$ver"
  112. git add configure.ac && git commit -m "bump to custom v$ver"
  113. (cd debian && ./bootstrap.sh -c $distro)
  114. dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
  115. dpkg-buildpackage -b -us -uc -Zxz -z9
  116. git reset --hard HEAD^
  117. To build for a stable branch, do this:
  118. distro=sid # update as needed
  119. stable_ver="1.2.1" # update as needed
  120. ver="$(echo "$stable_ver" | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
  121. git clean -fdx && git reset --hard refs/tags/v${stable_ver}
  122. ./build/set-fs-version.sh "$ver"
  123. git add configure.ac && git commit -m "bump to custom v$ver"
  124. (cd debian && ./bootstrap.sh -c $distro)
  125. dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
  126. dpkg-buildpackage -b -us -uc -Zxz -z9
  127. git reset --hard origin/master
  128. Building the freeswitch-sounds and freeswitch-music packages
  129. ------------------------------------------------------------
  130. The source packages for sounds and music on hold are maintained in a
  131. separate repository. Each set of sounds has a separate version number
  132. and the processing of the sounds is quite different from what we're
  133. doing here, so trying to maintain a merged debian/ between FreeSWITCH
  134. and the sounds and music would be a mess.
  135. To build the Debian packages for freeswitch-sounds-* and
  136. freeswitch-music-*:
  137. git clone https://github.com/traviscross/freeswitch-sounds.git
  138. cd freeswitch-sounds && cat debian/README.source
  139. -- Travis Cross <tc@traviscross.com>, Wed, 19 Mar 2014 19:07:23 +0000