2
0

rules 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
  68. --with-gnu-ld --with-python --with-python3 --with-erlang --with-openssl \
  69. --enable-core-odbc-support --enable-zrtp
  70. touch $@
  71. override_dh_auto_configure: .stamp-configure
  72. .stamp-build: .stamp-configure
  73. @$(call show_vars)
  74. make -j$(NJOBS) core
  75. make iksemel-dep
  76. make -j$(NJOBS)
  77. make -C libs/esl pymod
  78. make -C libs/esl py3mod
  79. make -C libs/esl perlmod
  80. touch $@
  81. override_dh_auto_build: .stamp-build
  82. override_dh_auto_test:
  83. override_dh_strip:
  84. dh_strip -a -k
  85. ./debian/util.sh create-dbg-pkgs
  86. override_dh_auto_install:
  87. dh_auto_install
  88. dh_auto_install -- -C libs/esl pymod-install
  89. dh_auto_install -- -C libs/esl py3mod-install
  90. dh_auto_install -- -C libs/esl perlmod-install
  91. rm -f debian/tmp/usr/share/freeswitch/grammar/model/communicator/COPYING
  92. override_dh_installinit:
  93. if [ `cat debian/freeswitch-init.provided_by` = freeswitch-systemd ]; then \
  94. dh_systemd_enable -pfreeswitch-systemd --name=freeswitch; \
  95. dh_systemd_start -pfreeswitch-systemd --name=freeswitch; \
  96. else \
  97. dh_installinit -pfreeswitch-sysvinit --name=freeswitch; \
  98. fi
  99. debian-bootstrap: debian/.stamp-bootstrap
  100. debian/.stamp-bootstrap:
  101. (cd debian && ./bootstrap.sh)
  102. touch $@
  103. build-depends: debian/.stamp-build-depends
  104. debian/.stamp-build-depends:
  105. ./debian/util.sh install-build-depends
  106. touch $@
  107. binary-basetest:
  108. @$(call show_vars)
  109. echo "applications/mod_commands" > debian/modules.conf
  110. (cd debian && ./bootstrap.sh)
  111. dh binary
  112. binary-quicktest:
  113. @$(call show_vars)
  114. echo "applications/mod_commands" > debian/modules.conf
  115. (cd debian && ./bootstrap.sh)
  116. dh binary