2007-10-09 13:25:56 -04:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
2009-12-18 18:00:41 -05:00
|
|
|
export DH_VERBOSE=1
|
2007-12-02 18:50:45 -05:00
|
|
|
export DH_OPTIONS
|
|
|
|
export DEB_DH_INSTALL_SOURCEDIR=debian/tmp
|
2010-10-14 13:01:00 -04:00
|
|
|
export PASSTHRU_CODEC_MODULES=codecs/mod_g729 codecs/mod_g723_1 codecs/mod_amr codecs/mod_amrwb
|
2009-12-18 18:00:41 -05:00
|
|
|
# Modules listed by those built by default, then those that are added in this package
|
2010-10-14 13:01:00 -04:00
|
|
|
export APPLICATION_MODULES_AE= applications/mod_avmd applications/mod_callcenter applications/mod_cidlookup applications/mod_cluechoo \
|
2010-10-15 05:24:52 -04:00
|
|
|
applications/mod_commands applications/mod_conference applications/mod_curl applications/mod_db applications/mod_directory \
|
2010-10-15 03:19:44 -04:00
|
|
|
applications/mod_distributor applications/mod_dptools applications/mod_easyroute applications/mod_enum \
|
|
|
|
applications/mod_esf applications/mod_expr
|
2010-10-14 13:01:00 -04:00
|
|
|
export APPLICATION_MODULES_FM= applications/mod_fifo applications/mod_fsv applications/mod_hash applications/mod_lcr applications/mod_limit \
|
2010-10-15 03:19:44 -04:00
|
|
|
applications/mod_memcache
|
2010-10-14 13:01:00 -04:00
|
|
|
export APPLICATION_MODULES_NY= applications/mod_nibblebill applications/mod_redis applications/mod_rss applications/mod_snom \
|
2010-10-15 03:19:44 -04:00
|
|
|
applications/mod_spandsp applications/mod_spy applications/mod_stress \
|
|
|
|
applications/mod_valet_parking applications/mod_vmd applications/mod_voicemail
|
2010-10-14 13:01:00 -04:00
|
|
|
|
|
|
|
export APPLICATIONS_MODULES= $(APPLICATION_MODULES_AE) $(APPLICATION_MODULES_FM) $(APPLICATION_MODULES_NY) $(APPLICATION_MODULES_VZ)
|
2010-10-15 06:45:52 -04:00
|
|
|
export ASR_TTS_MODULES= asr_tts/mod_pocketsphinx asr_tts/mod_flite asr_tts/mod_tts_commandline
|
2010-10-14 13:01:00 -04:00
|
|
|
export CODECS_MODULES= codecs/mod_bv codecs/mod_h26x codecs/mod_speex codecs/mod_celt codecs/mod_codec2 codecs/mod_ilbc codecs/mod_mp4v \
|
2010-10-15 03:19:44 -04:00
|
|
|
codecs/mod_silk codecs/mod_siren codecs/mod_theora
|
2010-10-14 13:01:00 -04:00
|
|
|
export DIALPLANS_MODULES= dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml
|
2010-10-14 22:17:27 -04:00
|
|
|
export ENDPOINTS_MODULES= endpoints/mod_dingaling endpoints/mod_portaudio endpoints/mod_sofia endpoints/mod_loopback \
|
2010-10-15 03:19:44 -04:00
|
|
|
../../libs/freetdm/mod_freetdm endpoints/mod_skypopen endpoints/mod_skinny
|
2011-05-30 10:05:07 -04:00
|
|
|
export EVENT_HANDLERS_MODULES=event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_cdr_csv event_handlers/mod_cdr_sqlite
|
2011-03-30 05:40:52 -04:00
|
|
|
export FORMATS_MODULES= formats/mod_local_stream formats/mod_native_file formats/mod_portaudio_stream \
|
2010-10-15 03:19:44 -04:00
|
|
|
formats/mod_shout formats/mod_sndfile formats/mod_tone_stream
|
2010-09-17 19:10:26 -04:00
|
|
|
export LANGUAGES_MODULES=languages/mod_spidermonkey languages/mod_perl languages/mod_lua languages/mod_python
|
2007-12-02 18:50:45 -05:00
|
|
|
export LOGGERS_MODULES=loggers/mod_console loggers/mod_logfile loggers/mod_syslog
|
2011-04-01 21:13:06 -04:00
|
|
|
export SAY_MODULES=say/mod_say_en say/mod_say_it say/mod_say_de say/mod_say_fr say/mod_say_es say/mod_say_nl say/mod_say_ru say/mod_say_he
|
2007-12-02 18:50:45 -05:00
|
|
|
export XML_INT_MODULES=xml_int/mod_xml_rpc xml_int/mod_xml_curl xml_int/mod_xml_cdr
|
2011-03-23 08:46:56 -04:00
|
|
|
export TIMER_MODULES=timers/mod_timerfd
|
|
|
|
|
|
|
|
export MYMODULES= $(PASSTHRU_CODEC_MODULES) $(APPLICATIONS_MODULES) $(ASR_TTS_MODULES) $(CODECS_MODULES) $(DIALPLANS_MODULES) $(ENDPOINTS_MODULES) $(EVENT_HANDLERS_MODULES) $(FORMATS_MODULES) $(LANGUAGES_MODULES) $(LOGGERS_MODULES) $(SAY_MODULES) $(XML_INT_MODULES) $(TIMER_MODULES)
|
2007-12-02 18:50:45 -05:00
|
|
|
export MODULES=$(MYMODULES)
|
2007-10-09 13:25:56 -04:00
|
|
|
|
2010-10-15 03:19:44 -04:00
|
|
|
|
|
|
|
|
2007-11-27 17:51:17 -05:00
|
|
|
ifndef AUTOCONF
|
|
|
|
AUTOCONFS := $(wildcard /usr/bin/autoconf*)
|
|
|
|
AUTOCONF = $(shell which autoconf)
|
|
|
|
ifneq (,$(findstring 2.50,${AUTOCONFS}))
|
|
|
|
AUTOCONF = /usr/bin/autoconf2.50
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# These are used for cross-compiling and for saving the configure script
|
|
|
|
# from having to guess our platform (since we know it already)
|
|
|
|
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
|
|
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
|
|
|
|
2008-09-17 17:46:42 -04:00
|
|
|
CFLAGS = -ggdb
|
2010-02-24 07:48:40 -05:00
|
|
|
MOD_CFLAGS = -ggdb
|
2007-11-27 17:51:17 -05:00
|
|
|
|
|
|
|
FEATURES = --enable-core-libedit-support --enable-core-odbc-support --with-libcurl --with-openssl
|
|
|
|
|
|
|
|
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
|
|
|
FEATURES += --disable-optimization
|
|
|
|
endif
|
|
|
|
|
2010-10-14 23:43:25 -04:00
|
|
|
.pc/applied-patches:
|
2010-10-14 23:57:12 -04:00
|
|
|
@echo
|
|
|
|
@echo \ \ Sorry, currently this package cannot be built directly from upstream
|
|
|
|
@echo \ \ source git/tarball: patches are needed for policy compliance, and the
|
|
|
|
@echo \ \ "new 3.0 (quilt) source format requires patches to be already applied."
|
|
|
|
@echo
|
|
|
|
@echo \ \ Please first convert this tree by running:
|
|
|
|
@echo -e \\t./debian/rules upstream-convert
|
|
|
|
@echo
|
|
|
|
@echo \ \ Note that this will insert an entry in debian/changelog, rename the
|
|
|
|
@echo \ \ current directory to the version number there, create a .orig.tar.bz2
|
|
|
|
@echo \ \ archive and apply all the patches in debian/patches/series.
|
|
|
|
@echo
|
|
|
|
@echo \ \ Using git-buildpackage is not recommended for now.
|
|
|
|
@echo
|
|
|
|
@exit 1
|
2010-10-14 23:43:25 -04:00
|
|
|
|
|
|
|
upstream-convert:
|
2010-10-14 23:57:12 -04:00
|
|
|
@dh_testdir
|
|
|
|
@test -s .pc/applied-patches && \
|
|
|
|
echo "Aborted: patches are already applied." && \
|
|
|
|
exit 1 || exit 0
|
|
|
|
# update (or not) version number in debian/changelog
|
|
|
|
@set -e ; \
|
|
|
|
echo Checking version number ; \
|
|
|
|
v1="$$(dpkg-parsechangelog | sed -e '/^Version: / ! d' -e 's/^Version: //')" ; \
|
|
|
|
v2="$${v1}" ; \
|
|
|
|
echo " Current version: $${v1}" ; \
|
|
|
|
if [ "$$(which git)" = "" -o ! -d .git ] ; then \
|
|
|
|
echo Git not available. Keeping current version number. ; \
|
|
|
|
exit 0 ; \
|
|
|
|
fi ; \
|
|
|
|
if [ "$$(which debchange)" = "" ] ; then \
|
|
|
|
echo debchange not available. Keeping current version number. ; \
|
|
|
|
exit 0 ; \
|
|
|
|
fi ; \
|
|
|
|
if echo -n "$${v1}" | grep -q '~git\.[a-z0-9]\+\.20[0-9]\{6\}\.[0-9]\+-[^-]\+$$' ; then \
|
|
|
|
maj1="$$(echo -n "$${v1}" | sed -e 's/^\([^.]\+\)\..*$$/\1/')" ; \
|
|
|
|
min1="$$(echo -n "$${v1}" | sed -e 's/^[^.]\+\.\([^.]\+\)\..*$$/\1/')" ; \
|
|
|
|
mic1="$$(echo -n "$${v1}" | sed -e 's/^[^.]\+\.[^.]\+\.\([a-zA-Z0-9]\+\).*$$/\1/')" ; \
|
|
|
|
b1="$$(echo -n "$${v1}" | sed -e 's/^.*~git\.\([a-z0-9]\+\)\.\(20[0-9]\{6\}\)\.[0-9]\+-[^-]\+$$/\1/')" ; \
|
|
|
|
d1="$$(echo -n "$${v1}" | sed -e 's/^.*\.\(20[0-9]\{6\}\)\.[0-9]\+-[^-]\+$$/\1/')" ; \
|
|
|
|
n1="$$(echo -n "$${v1}" | sed -e 's/^.*\.20[0-9]\{6\}\.\([0-9]\+\)-[^-]\+$$/\1/')" ; \
|
|
|
|
maj2="$$(sed -e '/^AC_SUBST(SWITCH_VERSION_MAJOR/ ! d' -e 's/^.*\[\([^\[]\+\)\][^\]]*$$/\1/' configure.in)" ; \
|
|
|
|
min2="$$(sed -e '/^AC_SUBST(SWITCH_VERSION_MINOR/ ! d' -e 's/^.*\[\([^\[]\+\)\][^\]]*$$/\1/' configure.in)" ; \
|
|
|
|
mic2="$$(sed -e '/^AC_SUBST(SWITCH_VERSION_MICRO/ ! d' -e 's/^.*\[\([^\[]\+\)\][^\]]*$$/\1/' configure.in)" ; \
|
|
|
|
b2="$$(git branch | sed -e '/^[^*]/ d' -e 's/* \(.*\)/\1/')" ; \
|
|
|
|
d2="$$(TZ=UTC git log --date=local -1 --format='%ai' | sed -e 's/^\(....\).\(..\).\(..\).*$$/\1\2\3/')" ; \
|
|
|
|
n2="$$(TZ=UTC git log --date=local --format=oneline --since="$${d2::4}-$${d2:4:2}-$${d2:6:2} 00:00" | wc -l)" ; \
|
|
|
|
if [ "$${b2}" != "$$(echo "$${b2}" | tr -dc a-z0-9)" ] ; then \
|
|
|
|
echo Invalid branch name "'$${b2}'". Aborted. ; \
|
|
|
|
exit 1; \
|
|
|
|
fi ; \
|
|
|
|
if [ "$${b1}.$${d1}.$${n1}" != "$${b2}.$${d2}.$${n2}" \
|
|
|
|
-o "$${maj1}.$${min1}.$${mic1}" != "$${maj2}.$${min2}.$${mic2}" ] ; then \
|
|
|
|
v2="$$(echo -n "$${maj2}.$${min2}.$${mic2}")" ; \
|
|
|
|
v2="$${v2}$$(echo -n "$${v1}" | sed -e 's/^[^.]\+\.[^.]\+\.[^.]\+\(.*\)~git\..*$$/\1/')" ; \
|
|
|
|
v2="$${v2}~git.$${b2}.$${d2}.$${n2}-1" ; \
|
|
|
|
echo " New version: $${v2}" ; \
|
|
|
|
echo Updating debian/changelog with new version number ; \
|
|
|
|
debchange -v "$${v2}" "New upstream release" ; \
|
|
|
|
else \
|
|
|
|
echo Version number already correct, no change. ; \
|
|
|
|
fi ; \
|
|
|
|
else \
|
|
|
|
echo 'Not a ~git. version number. Keeping current version number.' ; \
|
|
|
|
fi
|
|
|
|
# rename (or not) current directory to match packagename-version.number
|
|
|
|
@set -e ; \
|
|
|
|
echo Checking directory name ; \
|
|
|
|
d1="$$(basename "$$(cd . && echo "$$PWD")")" ; \
|
|
|
|
d2="$$(dpkg-parsechangelog | sed -e '/^Source: / ! d' -e 's/^Source: //')" ; \
|
|
|
|
d2="$${d2}-$$(dpkg-parsechangelog | sed -e '/^Version: / ! d' -e 's/^Version: \(.*\)-[^-]\+$$/\1/')" ; \
|
|
|
|
if [ "$${d1}" != "$${d2}" ] ; then \
|
|
|
|
if [ -e "../$${d2}" ] ; then \
|
|
|
|
test . -ef "../$${d2}" && exit 0 ; \
|
|
|
|
echo Aborted: directory "../$${d2}" already exists. ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi ; \
|
|
|
|
echo Renaming current directory to "$${d2}" ; \
|
|
|
|
mv ../$${d1} ../$${d2} ; \
|
|
|
|
fi
|
|
|
|
# create .orig.tar.bz2
|
|
|
|
@set -e ; \
|
|
|
|
n="$$(dpkg-parsechangelog | sed -e '/^Source: / ! d' -e 's/^Source: //')" ; \
|
|
|
|
d="$${n}-$$(dpkg-parsechangelog | sed -e '/^Version: / ! d' -e 's/^Version: \(.*\)-[^-]\+$$/\1/')" ; \
|
|
|
|
n="$${n}_$$(dpkg-parsechangelog | sed -e '/^Version: / ! d' -e 's/^Version: \(.*\)-[^-]\+$$/\1/').orig.tar.bz2" ; \
|
|
|
|
echo "Creating source archive $${n}" ; \
|
|
|
|
cd .. && tar cjf "$${n}" --exclude='.git*' "$${d}"
|
|
|
|
# apply patches
|
|
|
|
@set -e ; \
|
|
|
|
echo "Applying patches in debian/patches/series" ; \
|
|
|
|
QUILT_PATCHES=debian/patches ; \
|
|
|
|
export QUILT_PATCHES ; \
|
|
|
|
while quilt next ; do \
|
|
|
|
quilt push -v ; \
|
|
|
|
quilt refresh ; \
|
|
|
|
done
|
|
|
|
# remind user to change dir
|
|
|
|
@echo Done.
|
|
|
|
@echo
|
|
|
|
@if [ "$(CURDIR)" != "$$PWD" ] ; then \
|
|
|
|
echo \ \ You should now tell your shell to update its current working directory: ; \
|
|
|
|
echo -e \\t'cd $$(pwd)' ; \
|
|
|
|
echo \ \ or ; \
|
|
|
|
echo -e "\\tcd $$PWD" ; \
|
|
|
|
echo ; \
|
|
|
|
fi
|
2010-10-14 23:43:25 -04:00
|
|
|
|
|
|
|
|
2007-11-27 17:51:17 -05:00
|
|
|
config.status: configure
|
|
|
|
dh_testdir
|
2008-07-08 05:49:53 -04:00
|
|
|
rm -f modules.conf
|
2007-12-02 18:50:45 -05:00
|
|
|
touch modules.conf
|
|
|
|
echo $(MODULES)
|
|
|
|
for i in $(MODULES); do echo $$i >> modules.conf; done
|
2009-02-16 10:34:39 -05:00
|
|
|
./configure --prefix=/opt/freeswitch --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) ${FEATURES}
|
2007-11-27 17:51:17 -05:00
|
|
|
|
2010-10-15 00:51:55 -04:00
|
|
|
configure: bootstrap.sh # .pc/applied-patches
|
2010-10-14 23:57:12 -04:00
|
|
|
dh_testdir
|
|
|
|
test -e /usr/share/misc/config.sub && cp -f /usr/share/misc/config.sub build/config/config.sub
|
|
|
|
test -e /usr/share/misc/config.guess && cp -f /usr/share/misc/config.guess build/config/config.guess
|
|
|
|
AUTOCONF=${AUTOCONF} ./bootstrap.sh
|
2010-10-14 23:43:25 -04:00
|
|
|
|
2007-11-27 17:51:17 -05:00
|
|
|
|
2007-10-09 13:25:56 -04:00
|
|
|
build: build-stamp
|
2007-11-27 17:51:17 -05:00
|
|
|
build-stamp: config.status
|
2007-10-09 13:25:56 -04:00
|
|
|
dh_testdir
|
|
|
|
|
|
|
|
$(MAKE)
|
2011-03-23 07:42:17 -04:00
|
|
|
cd libs/esl && $(MAKE) pymod && cd -
|
2007-11-27 17:51:17 -05:00
|
|
|
touch $@
|
2007-10-09 13:25:56 -04:00
|
|
|
|
2010-10-15 00:53:46 -04:00
|
|
|
clean: # .pc/applied-patches
|
2007-10-09 13:25:56 -04:00
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2007-11-27 17:51:17 -05:00
|
|
|
rm -f build-stamp
|
2007-10-09 13:25:56 -04:00
|
|
|
|
2008-05-23 21:27:19 -04:00
|
|
|
-$(MAKE) update-clean
|
2010-10-14 23:43:25 -04:00
|
|
|
rm -f configure config.status
|
2007-11-28 19:38:58 -05:00
|
|
|
rm -f */*/config.status
|
|
|
|
rm -f */*/*/config.status
|
|
|
|
dh_clean
|
2007-10-09 13:25:56 -04:00
|
|
|
|
|
|
|
install: build
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2010-10-14 23:43:25 -04:00
|
|
|
dh_prep
|
|
|
|
dh_installdirs -A
|
2007-10-09 13:25:56 -04:00
|
|
|
|
2009-12-18 18:00:41 -05:00
|
|
|
VERBOSE=1 $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
|
2011-03-23 07:42:17 -04:00
|
|
|
cd libs/esl && VERBOSE=1 $(MAKE) DESTDIR=$(CURDIR)/debian/tmp pymod-install && cd -
|
2007-11-27 17:51:17 -05:00
|
|
|
|
2007-10-09 13:25:56 -04:00
|
|
|
|
|
|
|
# Build architecture-independent files here.
|
|
|
|
binary-indep: build install
|
|
|
|
# We have nothing to do by default.
|
|
|
|
|
|
|
|
# Build architecture-dependent files here.
|
|
|
|
binary-arch: build install
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2009-02-04 11:45:38 -05:00
|
|
|
dh_installdocs
|
|
|
|
dh_installchangelogs
|
2009-11-17 14:12:20 -05:00
|
|
|
dh_installinit
|
2008-07-08 05:49:53 -04:00
|
|
|
cp debian/monit/freeswitch.monitrc debian/freeswitch/etc/monit/freeswitch.monitrc
|
2007-11-30 09:12:23 -05:00
|
|
|
dh_install --sourcedir=debian/tmp
|
2008-09-17 17:46:42 -04:00
|
|
|
dh_link
|
2010-10-14 23:43:25 -04:00
|
|
|
dh_strip --dbg-package=freeswitch-dbg
|
2007-10-09 13:25:56 -04:00
|
|
|
dh_compress
|
2009-02-16 10:34:39 -05:00
|
|
|
dh_fixperms --exclude /opt/freeswitch/conf
|
2010-10-14 23:43:25 -04:00
|
|
|
dh_makeshlibs
|
|
|
|
dh_shlibdeps
|
2007-10-09 13:25:56 -04:00
|
|
|
dh_installdeb
|
|
|
|
dh_gencontrol
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
|
|
|
|
|
|
|
binary: binary-indep binary-arch
|
2007-11-27 17:51:17 -05:00
|
|
|
.PHONY: build clean binary-indep binary-arch binary install
|