#!/usr/bin/make -f include /usr/share/dpkg/default.mk 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 = codec2 echo rtcpsummary snapshot sndio ifeq (, $(filter hurd-% kfreebsd-%, $(DEB_HOST_ARCH))) core-mods-extra += directfb endif # module hints for module packages ffmpeg-mods = avformat avcodec h265 swscale gstreamer-mods = gst1 gst_video1 gtk-mods = gtk x11-mods = cairo omx pulse rst sdl2 vidinfo x11 x11grab DEB_MAKE_EXTRA_ARGS = V=1 PREFIX=/usr RELEASE=1 \ EXTRA_MODULES="$(core-mods-extra) swscale" \ EXTRA_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \ EXTRA_LFLAGS="$(LDFLAGS)" \ DESTDIR=debian/tmp 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) %: dh $@