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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DOCS = README.md docs/TODO
# generate manpage with help2man from -h option
_mkman = \
help2man $(if $3,--name "$(strip $3)") --no-info --help-option -h --no-discard-stderr --version-string $(DEB_VERSION_UPSTREAM) --output $2 $1 \
|| [ $? -eq 254 ] || { $1 -h; false; }
# install into package baresip-$1 modules $($1-mods)
_installmods = dh_install --package baresip-$1 \
$(patsubst %, usr/lib/baresip/modules/%.so, $($1-mods)) \
usr/lib/baresip/modules
# module hints for core package
core-mods-extra = rtcpsummary snapshot
ifeq (, $(filter hurd-% kfreebsd-%, $(DEB_HOST_ARCH)))
core-mods-extra += directfb
endif
# module hints for module packages
ffmpeg-mods = avcodec avfilter avformat swscale
gstreamer-mods = gst gst_video
gtk-mods = gtk
x11-mods = cairo omx pulse rst sdl vidinfo x11 x11grab
DEB_MAKE_EXTRA_ARGS = V=1 PREFIX=/usr RELEASE=1 \
EXTRA_MODULES="$(core-mods-extra) avfilter swscale" \
EXTRA_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
EXTRA_LFLAGS="$(LDFLAGS)" \
DESTDIR=debian/tmp
%:
dh $@
override_dh_auto_build:
dh_auto_build -- $(DEB_MAKE_EXTRA_ARGS) info all
$(call _mkman, ./baresip, debian/baresip.1, \
portable and modular command-line SIP user-agent)
override_dh_auto_install:
dh_auto_install -- $(DEB_MAKE_EXTRA_ARGS)
override_dh_install:
$(call _installmods,ffmpeg)
$(call _installmods,gstreamer)
$(call _installmods,gtk)
$(call _installmods,x11)
dh_install \
$(patsubst %, --no-package baresip-%,\
ffmpeg gstreamer gtk x11) \
$(patsubst %, -X%.so,\
$(ffmpeg-mods) $(gstreamer-mods) \
$(gtk-mods) $(x11-mods))
override_dh_installchangelogs:
dh_installchangelogs -- docs/ChangeLog
override_dh_installdocs:
dh_installdocs --all -- $(DOCS)
|