rules 3.1 KB

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