2012-02-23 20:03:09 -05:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- mode:makefile -*-
|
2012-05-10 20:35:17 -04:00
|
|
|
##### Author: Travis Cross <tc@traviscross.com>
|
|
|
|
|
2014-01-19 19:30:58 -05:00
|
|
|
export DH_VERBOSE=1
|
|
|
|
export VERBOSE=1
|
2014-03-19 17:07:21 -04:00
|
|
|
export V=1
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2012-06-24 04:46:00 -04:00
|
|
|
FS_CC?=gcc
|
|
|
|
FS_CXX?=g++
|
2014-02-09 18:35:10 -05:00
|
|
|
FS_CPPFLAGS?=-D_FORTIFY_SOURCE=2
|
|
|
|
FS_CFLAGS?=-g3 -O2 -fPIC -fstack-protector --param=ssp-buffer-size=4
|
2012-02-23 20:03:09 -05:00
|
|
|
FS_CXXFLAGS?=$(FS_CFLAGS)
|
2014-02-09 18:35:10 -05:00
|
|
|
FS_LDFLAGS?=-Wl,-z,relro
|
2012-05-06 20:45:04 -04:00
|
|
|
export PATH?=/usr/lib/ccache:/usr/sbin:/usr/bin:/sbin:/bin
|
2014-02-09 17:54:00 -05:00
|
|
|
export CC:=$(FS_CC)
|
|
|
|
export CXX:=$(FS_CXX)
|
|
|
|
export CPPFLAGS:=$(FS_CPPFLAGS)
|
2014-02-09 17:55:03 -05:00
|
|
|
export CFLAGS:=$(FS_CFLAGS)
|
2014-02-09 17:54:00 -05:00
|
|
|
export CXXFLAGS:=$(FS_CXXFLAGS)
|
2014-02-09 17:56:36 -05:00
|
|
|
export LDFLAGS:=$(FS_LDFLAGS)
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2014-12-25 01:42:14 -05:00
|
|
|
NJOBS=1
|
|
|
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
|
|
NJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
|
|
endif
|
|
|
|
|
2012-02-23 20:03:09 -05:00
|
|
|
show_vars= \
|
|
|
|
echo; \
|
|
|
|
echo "Making target $@"; \
|
|
|
|
echo "PATH='$(PATH)'"; \
|
2012-06-24 04:46:00 -04:00
|
|
|
echo "CC='$(CC)'"; \
|
|
|
|
echo "CXX='$(CXX)'"; \
|
2013-04-23 06:25:29 -04:00
|
|
|
echo "CPPFLAGS='$(CPPFLAGS)'"; \
|
2014-02-09 17:55:03 -05:00
|
|
|
echo "CFLAGS='$(CFLAGS)'"; \
|
2012-02-23 20:03:09 -05:00
|
|
|
echo "CXXFLAGS='$(CXXFLAGS)'"; \
|
2014-02-09 17:56:36 -05:00
|
|
|
echo "LDFLAGS='$(LDFLAGS)'"; \
|
2012-02-23 20:03:09 -05:00
|
|
|
echo "CCACHE_DIR='$(CCACHE_DIR)'"; \
|
|
|
|
echo;
|
|
|
|
|
|
|
|
binary:
|
|
|
|
@$(call show_vars)
|
|
|
|
dh $@
|
|
|
|
binary-arch:
|
|
|
|
@$(call show_vars)
|
|
|
|
dh $@
|
|
|
|
binary-indep:
|
|
|
|
@$(call show_vars)
|
|
|
|
dh $@
|
2012-05-06 03:14:22 -04:00
|
|
|
build-arch:
|
|
|
|
@$(call show_vars)
|
|
|
|
dh $@
|
|
|
|
build-indep:
|
|
|
|
@$(call show_vars)
|
|
|
|
dh $@
|
2012-02-23 20:03:09 -05:00
|
|
|
build: debian/.stamp-bootstrap
|
|
|
|
@$(call show_vars)
|
|
|
|
dh $@
|
|
|
|
clean:
|
|
|
|
dh $@
|
|
|
|
|
|
|
|
override_dh_auto_clean:
|
|
|
|
|
|
|
|
.stamp-bootstrap:
|
|
|
|
@$(call show_vars)
|
2015-02-16 19:04:24 -05:00
|
|
|
[ -f ./bootstrap.sh ] && ./bootstrap.sh -j || ./rebootstrap.sh -j
|
2012-02-23 20:03:09 -05:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
.stamp-configure: .stamp-bootstrap
|
|
|
|
@$(call show_vars)
|
|
|
|
touch noreg
|
|
|
|
cp debian/modules_.conf modules.conf
|
|
|
|
./configure -C --enable-portable-binary --disable-dependency-tracking \
|
|
|
|
--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
|
|
|
|
--with-gnu-ld --with-python --with-erlang --with-openssl \
|
2015-06-17 17:49:15 -04:00
|
|
|
--sysconfdir=/etc \
|
2012-02-23 20:03:09 -05:00
|
|
|
--enable-core-odbc-support --enable-zrtp \
|
2012-12-07 15:17:13 -05:00
|
|
|
--enable-core-pgsql-support \
|
2012-02-23 20:03:09 -05:00
|
|
|
--prefix=/usr --localstatedir=/var \
|
2015-06-17 20:30:51 -04:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--with-modinstdir=/usr/lib/freeswitch/mod \
|
|
|
|
--with-rundir=/var/run/freeswitch \
|
|
|
|
--with-logfiledir=/var/log/freeswitch \
|
|
|
|
--with-dbdir=/var/lib/freeswitch/db \
|
|
|
|
--with-htdocsdir=/usr/share/freeswitch/htdocs \
|
|
|
|
--with-soundsdir=/usr/share/freeswitch/sounds \
|
|
|
|
--with-storagedir=/var/lib/freeswitch/storage \
|
|
|
|
--with-cachedir=/var/cache/freeswitch \
|
|
|
|
--with-grammardir=/usr/share/freeswitch/grammar \
|
|
|
|
--with-certsdir=/etc/freeswitch/tls \
|
|
|
|
--with-scriptdir=/usr/share/freeswitch/scripts \
|
|
|
|
--with-recordingsdir=/var/lib/freeswitch/recordings \
|
2014-03-23 04:25:41 -04:00
|
|
|
--enable-static-v8 --disable-parallel-build-v8
|
2012-02-23 20:03:09 -05:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
override_dh_auto_configure: .stamp-configure
|
|
|
|
|
|
|
|
.stamp-build: .stamp-configure
|
|
|
|
@$(call show_vars)
|
2014-12-25 01:42:14 -05:00
|
|
|
make -j$(NJOBS)
|
2012-02-23 20:03:09 -05:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
override_dh_auto_build: .stamp-build
|
|
|
|
|
|
|
|
override_dh_auto_test:
|
|
|
|
|
|
|
|
override_dh_strip:
|
|
|
|
dh_strip -a -k
|
2012-05-05 16:23:53 -04:00
|
|
|
./debian/util.sh create-dbg-pkgs
|
2012-02-23 20:03:09 -05:00
|
|
|
|
|
|
|
override_dh_auto_install:
|
|
|
|
dh_auto_install
|
|
|
|
mkdir -p debian/tmp/lib/systemd/system
|
|
|
|
install -m0644 debian/freeswitch-systemd.freeswitch.service debian/tmp/lib/systemd/system/freeswitch.service
|
2012-05-13 01:59:03 -04:00
|
|
|
rm -f debian/tmp/usr/share/freeswitch/grammar/model/communicator/COPYING
|
2012-02-23 20:03:09 -05:00
|
|
|
|
|
|
|
override_dh_installinit:
|
|
|
|
dh_installinit -pfreeswitch-sysvinit --name=freeswitch
|
2013-10-18 04:17:50 -04:00
|
|
|
dh_installinit -pfreeswitch-all --name=freeswitch
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2013-12-09 04:18:38 -05:00
|
|
|
override_dh_makeshlibs:
|
|
|
|
dh_makeshlibs
|
|
|
|
sed \
|
|
|
|
-e '/^libfreeswitch 1/{s/freeswitch-all/libfreeswitch1/g}' \
|
|
|
|
-i debian/freeswitch-all/DEBIAN/shlibs
|
|
|
|
|
2012-02-23 20:03:09 -05:00
|
|
|
debian-bootstrap: debian/.stamp-bootstrap
|
|
|
|
debian/.stamp-bootstrap:
|
|
|
|
(cd debian && ./bootstrap.sh)
|
|
|
|
touch $@
|
|
|
|
|
2012-05-05 17:10:47 -04:00
|
|
|
build-depends: debian/.stamp-build-depends
|
|
|
|
debian/.stamp-build-depends:
|
|
|
|
./debian/util.sh install-build-depends
|
|
|
|
touch $@
|
|
|
|
|
2012-02-23 20:03:09 -05:00
|
|
|
binary-basetest:
|
|
|
|
@$(call show_vars)
|
|
|
|
echo "applications/mod_commands" > debian/modules.conf
|
|
|
|
(cd debian && ./bootstrap.sh)
|
|
|
|
dh binary
|
|
|
|
|
|
|
|
binary-quicktest:
|
|
|
|
@$(call show_vars)
|
|
|
|
echo "applications/mod_commands" > debian/modules.conf
|
|
|
|
(cd debian && ./bootstrap.sh)
|
2012-05-24 11:13:11 -04:00
|
|
|
dh binary
|