1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2016-2017 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for baresip
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/debhelper.mk
# resolve supported architectures for arch-varying build-dependencies
# (in maintainer mode only: uses network and messes with control file)
ifneq (,$(DEB_MAINTAINER_MODE))
$(shell sh debian/pkgarchs.sh libdirectfb-dev > debian/ARCHS_directfb)
debian/control::
perl -i -p \
-e 's/\blibdirectfb-dev\K\s*(?:\[[^]]*\]\s*)?/ [$(ARCHS_directfb)]/' \
debian/control
endif
ARCHS_directfb := $(shell cat debian/ARCHS_directfb)
# Ignore wav files
DEB_COPYRIGHT_CHECK_IGNORE_EXTS = wav
# Needs and module hints for core package
core-deps = asound2 codec2 directfb jack gsm1 opus opencore-amrnb
core-deps += opencore-amrwb png re rem sdl2 sndfile1 sndio spandsp
core-deps += speex speexdsp srtp0 twolame vpx ssl
core-deps-extra = libevdev-dev [linux-any]
core-deps-extra +=, portaudio19-dev
core-mods-extra = b2bua codec2 echo jack snapshot sndio
core-mods-extra += $(if $(filter $(ARCHS_directfb),$(DEB_HOST_ARCH)),directfb)
CDBS_BUILD_DEPENDS +=, $(patsubst %,$(comma) lib%-dev,$(core-deps))
CDBS_BUILD_DEPENDS +=, $(core-deps-extra), pkg-config
EXTRA_MODULES += $(core-mods-extra)
CDBS_DEPENDS_baresip +=, baresip-core
# TODO: drop these after Stretch
CDBS_BREAKS_baresip-core = baresip (<= 0.5.0-2~)
CDBS_REPLACES_baresip-core = baresip (<= 0.5.0-2~)
# Needs and module hints for module packages
ffmpeg-deps = avcodec avformat avdevice swscale x265
ffmpeg-mods = avformat avcodec h265
ffmpeg-mods-extra = swscale
gstreamer-deps = gstreamer1.0 gstreamer-plugins-base1.0
gstreamer-mods = gst1 gst_video1
gtk-deps = gtk2.0
gtk-mods = gtk
x11-deps = cairo2 mpg123 pulse xext x11
x11-mods = cairo pulse rst sdl2 vidinfo x11 x11grab
define MODULE_template =
CDBS_BUILD_DEPENDS +=, $$(patsubst %,$$(comma) lib%-dev,$$($1-deps))
EXTRA_MODULES += $$($1-mods-extra)
DEB_DH_INSTALL_ARGS_baresip-$1 = \
$$(patsubst %,usr/lib/baresip/modules/%.so,$$($1-mods) $$($1-mods-extra)) \
usr/lib/baresip/modules
# Do not install these modules as part of baresip
DEB_DH_INSTALL_ARGS_baresip-core += \
$$(patsubst %,-X%.so,$$($1-mods) $$($1-mods-extra))
CDBS_RECOMMENDS_baresip +=, baresip-$1
CDBS_SUGGESTS_baresip-core +=, baresip-$1
CDBS_ENHANCES_baresip-$1 = baresip-core
# TODO: drop these after Stretch
CDBS_BREAKS_baresip-$1 = baresip (<= 0.5.0)
CDBS_REPLACES_baresip-$1 = baresip (<= 0.5.0)
endef
$(foreach module,ffmpeg gstreamer gtk x11,\
$(eval $(call MODULE_template,$(module))))
DEB_MAKE_EXTRA_ARGS = V=1 PREFIX=/usr RELEASE=1 \
EXTRA_MODULES="$(EXTRA_MODULES)" \
EXTRA_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
EXTRA_LFLAGS="$(LDFLAGS)" \
$(DEB_MAKE_PARALLEL)
DEB_MAKE_BUILD_TARGET = info all
DEB_MAKE_CHECK_TARGET = test
DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(cdbs_make_curdestdir)
DEB_INSTALL_CHANGELOGS_ALL = docs/ChangeLog
DEB_INSTALL_DOCS_ALL += README.md docs/TODO
DEB_INSTALL_EXAMPLES_baresip-core = docs/examples/*
# LIBDIR for installation
LIBDIR=/usr/lib
|