README.source 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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://freeswitch.org/stash/scm/fs/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 sid, though it
  54. will generate packages for all supported Debian releases. Simply run:
  55. ./debian/util.sh build-all -ibn -z9
  56. Building on Ubuntu
  57. ------------------
  58. Building on supported Ubuntu releases requires the main and universe
  59. APT components in the pbuilder chroot. You should enable the universe
  60. component in your system's APT sources.list and use the -t option to
  61. use your system sources in the chroot:
  62. ./debian/util.sh build-all -ibn -z9 -t
  63. Building only some modules
  64. --------------------------
  65. If you don't need all the modules to build, create a modules.conf file
  66. outside of your source tree and pass the -f option to build-all. e.g.:
  67. echo "applications/mod_commands" > /tmp/modules.conf
  68. ./debian/util.sh build-all -ibn -z9 -f /tmp/modules.conf
  69. Testing a particular module under packaging
  70. -------------------------------------------
  71. If you need to build a small set of modules for compile testing in the
  72. pbuilder environment, you can run:
  73. ./debian/util.sh build-all -dni -z1 -a amd64 -c sid -l "applications/mod_commands"
  74. Getting help with debian/util.sh
  75. --------------------------------
  76. The debian/util.sh has many options. You can see the documentation
  77. for these options by running:
  78. ./debian/util.sh -h
  79. The debian/control-modules file
  80. -------------------------------
  81. The build dependencies, runtime dependencies, and other details about
  82. modules can be configured in the debian/control-modules file. Even
  83. though this file looks a bit like a debian control file and has a
  84. similar format, we are parsing this file ourselves so the format is a
  85. bit more restricted.
  86. debian/control-modules currently supports the following fields:
  87. # lines that begin with the hash character are comments
  88. #
  89. # every block must start with a Module field
  90. Module: <category>/<module_name>
  91. Description: <short description>
  92. <long description> # empty lines with "."s are not yet supported
  93. Build-Depends: <build deps for this module>
  94. Depends: <runtime deps for this module>
  95. Recommends: <recommended packages>
  96. Suggests: <suggested packages>
  97. Distro-Conflicts: <distributions on which this module should not be built> # not yet implemented
  98. During bootstrap we build a file control-modules.gen. If the
  99. control-modules file is properly formatted, this generated file should
  100. be identical. This is a sanity check mechanism for our parsing, as
  101. well as a way to automatically reorganize the file.
  102. Building Debian packages without util.sh
  103. ----------------------------------------
  104. Building the packages without util.sh is not recommended as util.sh
  105. takes care of many non-trivial details. If needed, however, the
  106. packages can be built:
  107. distro=sid
  108. ver="$(cat build/next-release.txt | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
  109. git clean -fdx && git reset --hard origin/master
  110. ./build/set-fs-version.sh "$ver"
  111. git add configure.ac && git commit -m "bump to custom v$ver"
  112. (cd debian && ./bootstrap.sh -c $distro)
  113. dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
  114. dpkg-buildpackage -b -us -uc -Zxz -z9
  115. git reset --hard HEAD^
  116. To build for a stable branch, do this:
  117. distro=sid # update as needed
  118. stable_ver="1.2.1" # update as needed
  119. ver="$(echo "$stable_ver" | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
  120. git clean -fdx && git reset --hard refs/tags/v${stable_ver}
  121. ./build/set-fs-version.sh "$ver"
  122. git add configure.ac && git commit -m "bump to custom v$ver"
  123. (cd debian && ./bootstrap.sh -c $distro)
  124. dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
  125. dpkg-buildpackage -b -us -uc -Zxz -z9
  126. git reset --hard origin/master
  127. Building the freeswitch-sounds and freeswitch-music packages
  128. ------------------------------------------------------------
  129. The source packages for sounds and music on hold are maintained in a
  130. separate repository. Each set of sounds has a separate version number
  131. and the processing of the sounds is quite different from what we're
  132. doing here, so trying to maintain a merged debian/ between FreeSWITCH
  133. and the sounds and music would be a mess.
  134. To build the Debian packages for freeswitch-sounds-* and
  135. freeswitch-music-*:
  136. git clone https://github.com/traviscross/freeswitch-sounds.git
  137. cd freeswitch-sounds && cat debian/README.source
  138. -- Travis Cross <tc@traviscross.com>, Wed, 19 Mar 2014 19:07:23 +0000