[SCM] libav/experimental: import bits from ubuntu to minimize the diff

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Mon Nov 12 18:33:49 UTC 2012


The following commit has been merged in the experimental branch:
commit 81dd7088574951d3495f37fc01964416aa095105
Author: Reinhard Tartler <siretart at tauware.de>
Date:   Sun Nov 11 17:24:08 2012 +0100

    import bits from ubuntu to minimize the diff

diff --git a/debian/rules b/debian/rules
index e5a2d87..0dee0cc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,12 +6,47 @@ DEB_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
 UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -r 's/[^:]+://; s/-[^-]+$$//')
 SHLIBS_VERSION := $(EPOCH)9~beta2-1
 
+ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
+# In Ubuntu, all -extra- packages are built from a special source
+# package called 'libav-extra', which is found in the universe section
+# of the archive because it requires extra build dependencies that are
+# not found in 'main'
+#
+# In order to ease the transition period when libav is uploaded to the
+# archive and libav-extra is not built yet, all libraries in libav
+# produce -extra variants. However, only libavcodec-extra comes with
+# additional functionality.
+VENDOR := Ubuntu
+
+# these package do not build -extra variants
+LIB_PKGS := 
+# these packages do build -extra variants
+LIB_PKGS2 := $(shell sed -nr 's/^Package:[[:space:]]*(lib(avutil|avcodec|avdevice|avformat|avresample|avfilter|swscale)[0-9]+)[[:space:]]*$$/\1/p' debian/control)
+# these packages are the -extra- variants
+LIB_EXTRA_PKGS := $(shell sed -nr 's/^Package:[[:space:]]*(lib(avutil|avcodec|avdevice|avformat|avresample|avfilter|swscale)(-extra-)[0-9]+)[[:space:]]*$$/\1/p' debian/control)
+
+else
+# In Debian, there is no need (anymore) for a separate libav-extra
+# source package. Instead, the libavcodec-extra package is built
+# directly from the 'main' source package.
+#
+# the libavcodec-extra package is necessary because it links against
+# libraries that are GPLv3 licensed. Make sure that you do not link
+# GPLv2 only applications against the libavcodec-extra flavor!
+#
+# Because of the lack of archive skew problems, only libavcodec produces
+# an -extra variant.
+
+VENDOR := Debian
 # these package do not build -extra variants
 LIB_PKGS := $(shell sed -nr 's/^Package:[[:space:]]*(lib(avutil|avdevice|avformat|avfilter|avresample|swscale)[0-9]+)[[:space:]]*$$/\1/p' debian/control)
 # these packages do build -extra variants
 LIB_PKGS2 := $(shell sed -nr 's/^Package:[[:space:]]*(libavcodec[0-9]+)[[:space:]]*$$/\1/p' debian/control)
 # these packages are the -extra- variants
 LIB_EXTRA_PKGS := $(shell sed -nr 's/^Package:[[:space:]]*(libavcodec-extra-[0-9]+)[[:space:]]*$$/\1/p' debian/control)
+endif
+
+
 # these are the -dev packages
 DEV_PKGS := $(shell echo $(LIB_PKGS) $(LIB_PKGS2) | sed 's/[0-9]\+\>/-dev/g')
 
@@ -47,17 +82,25 @@ $(DH_INSTALL_FILES):
 	sed 's/@DEB_HOST_MULTIARCH\(_OPT\)\?@/$(DEB_HOST_MULTIARCH)/g' $@.in > $@
 	$(foreach opt_flavor,$(OPT_FLAVORS),$(call dh_install_file_opt_flavor,$@,$(opt_flavor)))
 
+ifeq ($(DEB_SOURCE),libav-extra)
+CONFIGURE := libav/configure
+libav/configure:
+	tar xvf /usr/src/libav-source.tar.gz
+else
+CONFIGURE := configure
+endif
+
 configure-%: configure-stamp-%
-configure-stamp-%:
+configure-stamp-%: $(CONFIGURE)
 	dh_testdir
 	mkdir -p debian-$*
-	cd debian-$* && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/configure \
+	cd debian-$* && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/$(CONFIGURE) \
 		$($*_build_confflags) $(extra_$*_build_confflags)
 	touch $@
 configure-extra-stamp-%:
 	dh_testdir
 	mkdir -p debian-extra-$*
-	cd debian-extra-$* && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/configure \
+	cd debian-extra-$* && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/$(CONFIGURE) \
 		$($*_build_confflags) $(v3_confflags) $(extra_$*_build_confflags)
 	touch $@
 
@@ -93,6 +136,7 @@ clean:
 	    $(addprefix configure-stamp-, $(FLAVORS)) \
 	    $(addprefix configure-extra-stamp-, $(FLAVORS)) \
 	    build-doxy-stamp
+	rm -rf libav/ # created by the libav-extra variant
 	rm -rf $(addprefix debian-, $(FLAVORS)) \
 		$(addprefix debian-extra-, $(FLAVORS)) doxy
 	dh_clean $(DH_INSTALL_FILES) $(wildcard formats*.txt) $(wildcard codecs*.txt)
@@ -116,6 +160,15 @@ install-common: build $(DH_INSTALL_FILES)
 	dh_testdir
 	dh_testroot
 	dh_prep
+ifeq ($(DEB_SOURCE), libav)
+	# the libav-source package does exist in some derivatives such as ubuntu, etc.
+	if grep -q 'Package: libav-source' debian/control; then \
+	  dh_installdirs -ptmp usr/src;  \
+	  tar czvf debian/tmp/usr/src/libav-source.tar.gz . \
+	  	 --exclude 'debian*' --exclude .git  --exclude .pc --exclude '*-stamp' \
+	  	 --transform 's,^./,libav/,' ; \
+	fi
+endif
 	dh_installdirs -ptmp usr/src
 	dh_installdirs -ptmp usr/share/doc/libav/html etc
 	dh_installdirs -ptmp usr/share/doc/libav-doc/html
@@ -151,20 +204,24 @@ binary-arch: build install
 	dh_testdir
 	dh_testroot
 	dh_installman -plibav-tools debian/qt-faststart.1
-	dh_installdocs doc/optimization.txt
 	dh_installdocs -A debian/README.Debian
+ifeq ($(DEB_SOURCE), libav)
 	dh_installdocs -p libavcodec-dev -plibavdevice-dev \
 		-plibavformat-dev -plibavfilter-dev -plibavresample-dev \
 		-plibswscale-dev -plibavutil-dev -plibav-doc \
 		doc/APIchanges
 	dh_installexamples -p libav-tools doc/avserver.conf debian/recordshow.sh
 	dh_installexamples -p libavcodec-dev libavcodec/api-example.c
+	dh_strip --dbg-package=libav-dbg
 	dh_installchangelogs Changelog
+else
+	dh_strip --dbg-package=libav-extra-dbg
+	dh_installchangelogs libav/Changelog
+endif
 	dh_lintian
 	dh_link
 	dh_compress
 	dh_fixperms
-	dh_strip --dbg-package=libav-dbg
 
 	for pkg in $(LIB_PKGS) $(LIB_EXTRA_PKGS); do \
 	    dh_makeshlibs -p"$$pkg" -V"$$pkg (>= $(SHLIBS_VERSION))"; \

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list