rules 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #!/usr/bin/make -f
  2. # -*- mode:makefile -*-
  3. ##### Author: Travis Cross <tc@traviscross.com>
  4. export DH_VERBOSE=1
  5. export VERBOSE=1
  6. export V=1
  7. FS_CC?=gcc
  8. FS_CXX?=g++
  9. FS_CPPFLAGS?=-D_FORTIFY_SOURCE=2
  10. FS_CFLAGS?=-g3 -O2 -fPIC -fstack-protector --param=ssp-buffer-size=4
  11. FS_CXXFLAGS?=$(FS_CFLAGS)
  12. FS_LDFLAGS?=-Wl,-z,relro
  13. export PATH?=/usr/lib/ccache:/usr/sbin:/usr/bin:/sbin:/bin
  14. export CC:=$(FS_CC)
  15. export CXX:=$(FS_CXX)
  16. export CPPFLAGS:=$(FS_CPPFLAGS)
  17. export CFLAGS:=$(FS_CFLAGS)
  18. export CXXFLAGS:=$(FS_CXXFLAGS)
  19. export LDFLAGS:=$(FS_LDFLAGS)
  20. NJOBS=1
  21. ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  22. NJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  23. endif
  24. show_vars= \
  25. echo; \
  26. echo "Making target $@"; \
  27. echo "PATH='$(PATH)'"; \
  28. echo "CC='$(CC)'"; \
  29. echo "CXX='$(CXX)'"; \
  30. echo "CPPFLAGS='$(CPPFLAGS)'"; \
  31. echo "CFLAGS='$(CFLAGS)'"; \
  32. echo "CXXFLAGS='$(CXXFLAGS)'"; \
  33. echo "LDFLAGS='$(LDFLAGS)'"; \
  34. echo "CCACHE_DIR='$(CCACHE_DIR)'"; \
  35. echo;
  36. binary:
  37. @$(call show_vars)
  38. dh $@
  39. binary-arch:
  40. @$(call show_vars)
  41. dh $@
  42. binary-indep:
  43. @$(call show_vars)
  44. dh $@
  45. build-arch:
  46. @$(call show_vars)
  47. dh $@
  48. build-indep:
  49. @$(call show_vars)
  50. dh $@
  51. build: debian/.stamp-bootstrap
  52. @$(call show_vars)
  53. dh $@
  54. clean:
  55. dh $@
  56. override_dh_auto_clean:
  57. .stamp-bootstrap:
  58. @$(call show_vars)
  59. [ -f ./bootstrap.sh ] && ./bootstrap.sh -j || ./rebootstrap.sh -j
  60. touch $@
  61. .stamp-configure: .stamp-bootstrap
  62. @$(call show_vars)
  63. touch noreg
  64. cp debian/modules_.conf modules.conf
  65. ./configure -C --enable-portable-binary --disable-dependency-tracking \
  66. --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  67. --with-gnu-ld --with-python --with-erlang --with-openssl \
  68. --enable-core-odbc-support --enable-zrtp \
  69. --enable-core-pgsql-support \
  70. --prefix=/usr --localstatedir=/var \
  71. --sysconfdir=/etc/freeswitch \
  72. --with-modinstdir=/usr/lib/freeswitch/mod \
  73. --with-rundir=/var/run/freeswitch \
  74. --with-logfiledir=/var/log/freeswitch \
  75. --with-dbdir=/var/lib/freeswitch/db \
  76. --with-htdocsdir=/usr/share/freeswitch/htdocs \
  77. --with-soundsdir=/usr/share/freeswitch/sounds \
  78. --with-storagedir=/var/lib/freeswitch/storage \
  79. --with-cachedir=/var/cache/freeswitch \
  80. --with-grammardir=/usr/share/freeswitch/grammar \
  81. --with-certsdir=/etc/freeswitch/tls \
  82. --with-scriptdir=/usr/share/freeswitch/scripts \
  83. --with-recordingsdir=/var/lib/freeswitch/recordings \
  84. --enable-static-v8 --disable-parallel-build-v8
  85. touch $@
  86. override_dh_auto_configure: .stamp-configure
  87. .stamp-build: .stamp-configure
  88. @$(call show_vars)
  89. make -j$(NJOBS)
  90. touch $@
  91. override_dh_auto_build: .stamp-build
  92. override_dh_auto_test:
  93. override_dh_strip:
  94. dh_strip -a -k
  95. ./debian/util.sh create-dbg-pkgs
  96. override_dh_auto_install:
  97. dh_auto_install
  98. mkdir -p debian/tmp/lib/systemd/system
  99. install -m0644 debian/freeswitch-systemd.freeswitch.service debian/tmp/lib/systemd/system/freeswitch.service
  100. rm -f debian/tmp/usr/share/freeswitch/grammar/model/communicator/COPYING
  101. override_dh_installinit:
  102. dh_installinit -pfreeswitch-sysvinit --name=freeswitch
  103. dh_installinit -pfreeswitch-all --name=freeswitch
  104. override_dh_makeshlibs:
  105. dh_makeshlibs
  106. sed \
  107. -e '/^libfreeswitch 1/{s/freeswitch-all/libfreeswitch1/g}' \
  108. -i debian/freeswitch-all/DEBIAN/shlibs
  109. debian-bootstrap: debian/.stamp-bootstrap
  110. debian/.stamp-bootstrap:
  111. (cd debian && ./bootstrap.sh)
  112. touch $@
  113. build-depends: debian/.stamp-build-depends
  114. debian/.stamp-build-depends:
  115. ./debian/util.sh install-build-depends
  116. touch $@
  117. binary-basetest:
  118. @$(call show_vars)
  119. echo "applications/mod_commands" > debian/modules.conf
  120. (cd debian && ./bootstrap.sh)
  121. dh binary
  122. binary-quicktest:
  123. @$(call show_vars)
  124. echo "applications/mod_commands" > debian/modules.conf
  125. (cd debian && ./bootstrap.sh)
  126. dh binary