Source: zoneminder Version: 1.26.5-3 Severity: wishlist Tags: patch Usertags: reintroducing-ffmpeg
Dear maintainer, I am working on reintroducing FFmpeg to Debian [1-2]. In order to make FFmpeg co-installable with Libav, the libraries were renamed to lib*-ffmpeg. Thus using linker flags like '-lavcodec' doesn't work with the FFmpeg packages. To get the correct linking flags for both FFmpeg and Libav, one can (and should) use pkg-config. Attached patch achieves that for this package. Please apply it to facilitate building your package with FFmpeg in Debian. If you want to facilitate this even further, you can also add lib*-ffmpeg-dev alternatives to the Libav build-dependencies. While the FFmpeg package is still waiting in the NEW queue [3], it can already be built from the git repository [4]. Best regards, Andreas 1: https://lists.debian.org/debian-devel/2014/07/msg01010.html 2: https://bugs.debian.org/729203 3: https://ftp-master.debian.org/new/ffmpeg_7:2.3.1-1.html 4: https://anonscm.debian.org/cgit/collab-maint/ffmpeg.git
diff --git a/debian/control b/debian/control index b6348ad..a2c6d0b 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Peter Howard <[email protected]> Uploaders: Vagrant Cascadian <[email protected]> DM-Upload-Allowed: yes -Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libphp-serialization-perl, libmysqlclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libsys-mmap-perl, dh-autoreconf, libavdevice-dev, libgnutls-openssl-dev, libgcrypt11-dev +Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libphp-serialization-perl, libmysqlclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libsys-mmap-perl, dh-autoreconf, libavdevice-dev, libgnutls-openssl-dev, libgcrypt11-dev, pkg-config Standards-Version: 3.9.3 Homepage: http://www.zoneminder.com/ Vcs-Hg: http://hg.debian.org/hg/collab-maint/zoneminder diff --git a/debian/patches/pkg-config.patch b/debian/patches/pkg-config.patch new file mode 100644 index 0000000..94e8a64 --- /dev/null +++ b/debian/patches/pkg-config.patch @@ -0,0 +1,38 @@ +Description: Use pkg-config to determine FFmpeg linker flags + +Author: Andreas Cadhalpun <[email protected]> +Last-Update: <2014-05-20> + +--- zoneminder-1.26.5.orig/configure.ac ++++ zoneminder-1.26.5/configure.ac +@@ -266,15 +266,25 @@ fi + AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support)) + AC_CHECK_LIB(z,zlibVersion) + AC_CHECK_LIB(x264,x264_predict_16x16_init) +-AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) ++PKG_CHECK_MODULES(AVUTIL, libavutil) ++avu_name=`echo $AVUTIL_LIBS | sed 's/-l//'` ++AC_CHECK_LIB([$avu_name],av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) + # Don't bother to warn about this one + AC_CHECK_LIB(avcore,av_image_copy,,) +-AC_CHECK_LIB(avcodec,avcodec_version,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) +-AC_CHECK_LIB(avformat,avformat_version,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) ++PKG_CHECK_MODULES(AVCODEC, libavcodec) ++avc_name=`echo $AVCODEC_LIBS | sed 's/-l//'` ++AC_CHECK_LIB([$avc_name],avcodec_version,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) ++PKG_CHECK_MODULES(AVFORMAT, libavformat) ++avf_name=`echo $AVFORMAT_LIBS | sed 's/-l//'` ++AC_CHECK_LIB([$avf_name],avformat_version,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) + #AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) + #AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) +-AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) +-AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) ++PKG_CHECK_MODULES(AVDEVICE, libavdevice) ++avd_name=`echo $AVDEVICE_LIBS | sed 's/-l//'` ++AC_CHECK_LIB([$avd_name],avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) ++PKG_CHECK_MODULES(SWSCALE, libswscale) ++sws_name=`echo $SWSCALE_LIBS | sed 's/-l//'` ++AC_CHECK_LIB([$sws_name],sws_scale,,) + AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg)) + AC_CHECK_LIB(z,compress,,) + diff --git a/debian/patches/series b/debian/patches/series index 1b55ee1..bfdb515 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ libv4l1-videodev.h do_not_check_for_updates_by_default libav_path non_x86_guards +pkg-config.patch

