shithub: sox

Download patch

ref: 38660e348fce3bb7b80cc9f4b9b2217b89315a0b
parent: 2e8d225e09824588754a0db37984ffad16235177
author: Pascal Giard <evilynux@gmail.com>
date: Tue Jan 22 18:12:25 EST 2013

More Debian packaging changes, these are more interesting, some highlights:
- multiarch support;
- binary hardening (e.g. stack protector, fortify source);
- updated to use latest dpkg-source format (3.0) and quilt, and got rid of CDBS.

--- a/debian/README.source
+++ b/debian/README.source
@@ -1,38 +1,12 @@
 Package Structure
 -----------------
-Say the SoX version is 14.3.0. the orig tarball is built by:
-1) Creating a sox-14.3.0 folder;
-2) Copying the upstream source tarball into it;
-3) Calling "tar -czvf sox_14.3.0.orig.tar.gz sox-14.3.0".
+Say the upstream SoX version is 14.4.1. The orig tarball is created by renaming
+sox-14.4.1.tar.gz to sox_14.4.1.orig.tar.gz .
 
 Modifying and Patching the Source
 ---------------------------------
-Patches can be applied by creating a debian/patches folder, adding patches to
-it and building the package again.
+Patches are or can be applied using quilt. See the excellent tutorial on how to
+use quilt by Raphaël Hertzog:
+http://raphaelhertzog.com/2012/08/08/how-to-use-quilt-to-manage-patches-in-debian-packages/
 
-Creating a Patch
-----------------
-Create your patch from the SoX root folder (e.g. /tmp/sox-14.3.0/build-tree).
-Copy it into the debian/patches folder. Patches are applied in the alphabetical
-order so you may want to use numbered prefixes.
-
-Patch Example
--------------
-Say you did an "apt-get source sox" in the /tmp/ folder and tried to build the
-package already, but want to create a patch. (The upstream tarball has been
-extracted in the build-tree/ folder).
-
-cd /tmp/sox-14.3.0/
-mkdir debian/patches
-cd build-tree/
-
-do your modifications to sox-14.3.0/src/sox.c and save your new file as 
-sox-14.3.0/src/sox.c.new
-
-diff -Naur sox-14.3.0/src/sox.c.old sox-14.3.0/src/sox.c > \
-  ../debian/patches/01-some_fix_to_sox.diff
-debuild
-
-Hope this helps!
-
- -- Pascal Giard <pascal@debian.org>  Mon, 29 Jun 2009 22:45:49 -0400
+ -- Pascal Giard <pascal@debian.org>  Tue, 22 Jan 2013 22:56:30 -0500
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,16 +1,33 @@
 sox (14.4.2git-0+git20130122-1) UNRELEASED; urgency=low
 
   * Git Version (closes: #676143).
+  * [debian/source/format]:
+    - Finally switched to dpkg-source 3.0 (quilt) format!
+  * [debian/rules]:
+    - No longer using CDBS and depricated makefiles, fixes lintian warnings
+      "debian-rules-uses-deprecated-makefile". 
+    - Added multiarch support.
   * [debian/control]:
     - Bumped libsox2 to libsox3, interface changes.
     - Added Vcs-Git and Vcs-Browser pointing to upstream VCS.
+    - Added Pre-Depends on multiarch-support for libsox3, does not seem to
+      required for the other packages (contradiction in the documentation?),
+      fixes lintian warning "missing-pre-dependency-on-multiarch-support".
+    - Bumped Standards-Version to 3.9.3, no changes needed.
+    - Set Multi-Arch on the shared libraries where appropriate.
     - Set Section to libs for all libsox* but libsox-dev.
   * [debian/patches/01_default_audio_driver_fallback.patch]:
     - Removed, fixed upstream.
+  * [debian/compat]:
+    - Bumped to 9 to automatically use dpkg-buildflags, fixes lintian warnings
+      "hardening-no-relro" and some "hardening-no-fortify-functions" (there
+      are still 5 false positives on the latter though).
   * [debian/watch]:
     - Updated watch file, thanks to Bart Martens <bartm@debian.org>.
+  * [debian/README.source]:
+    - Updated to reflect the much simplified packaging and usage of quilt.
 
- -- Pascal Giard <evilynux@gmail.com>  Tue, 22 Jan 2013 22:15:59 -0500
+ -- Pascal Giard <evilynux@gmail.com>  Tue, 22 Jan 2013 22:56:30 -0500
 
 sox (14.4.0-5) unstable; urgency=low
 
--- a/debian/compat
+++ b/debian/compat
@@ -1,1 +1,1 @@
-7
+9
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,7 @@
 Section: sound
 Priority: optional
 Maintainer: Pascal Giard <pascal@debian.org>
-Build-Depends: cdbs,
-               debhelper (>= 7),
+Build-Depends: debhelper (>= 9),
                ladspa-sdk,
                libao-dev,
                libasound2-dev [linux-any],
@@ -26,7 +25,7 @@
                libtwolame-dev,
                libvorbis-dev,
                libwavpack-dev
-Standards-Version: 3.9.1
+Standards-Version: 3.9.3
 Vcs-Git: git://sox.git.sourceforge.net/gitroot/sox/sox
 Vcs-Browser: http://sox.git.sourceforge.net/git/gitweb.cgi?p=sox/sox
 
@@ -56,7 +55,9 @@
 
 Package: libsox3
 Architecture: any
+Multi-Arch: same
 Section: libs
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Recommends: libsox-fmt-alsa [linux-any] | libsox-fmt-ao | libsox-fmt-oss | libsox-fmt-pulse,
             libsox-fmt-base
@@ -76,6 +77,7 @@
 
 Package: libsox-fmt-base
 Architecture: any
+Multi-Arch: same
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Replaces: libsox-fmt-flac,
@@ -92,6 +94,7 @@
 
 Package: libsox-fmt-alsa
 Architecture: linux-any
+Multi-Arch: same
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: SoX alsa format I/O library
@@ -103,6 +106,7 @@
 
 Package: libsox-fmt-ao
 Architecture: any
+Multi-Arch: same
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: SoX Libao format I/O library
@@ -114,6 +118,7 @@
 
 Package: libsox-fmt-mp3
 Architecture: any
+Multi-Arch: same
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: SoX MP2 and MP3 format library
@@ -128,6 +133,7 @@
 
 Package: libsox-fmt-oss
 Architecture: any
+Multi-Arch: same
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: SoX OSS format I/O library
@@ -140,6 +146,7 @@
 
 Package: libsox-fmt-pulse
 Architecture: any
+Multi-Arch: same
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: SoX PulseAudio format I/O library
@@ -151,6 +158,7 @@
 
 Package: libsox-fmt-all
 Architecture: any
+Multi-Arch: same
 Section: libs
 Depends: libsox-fmt-alsa (= ${binary:Version}) [linux-any],
          libsox-fmt-ao (= ${binary:Version}),
@@ -166,6 +174,7 @@
 
 Package: libsox-dev
 Architecture: any
+Multi-Arch: same
 Section: libdevel
 Depends: libsox-fmt-all (= ${binary:Version}),
          libsox3 (= ${binary:Version}),
--- a/debian/libsox-dev.dirs
+++ /dev/null
@@ -1,3 +1,0 @@
-usr/lib
-usr/lib/sox
-usr/include
--- /dev/null
+++ b/debian/libsox-dev.dirs.in
@@ -1,0 +1,3 @@
+usr/lib/@DEB_HOST_MULTIARCH@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
+usr/include
--- a/debian/libsox-dev.install
+++ /dev/null
@@ -1,6 +1,0 @@
-debian/tmp/usr/include/* usr/include/
-debian/tmp/usr/lib/lib*.a usr/lib/
-debian/tmp/usr/lib/lib*.so usr/lib/
-debian/tmp/usr/lib/pkgconfig/sox.pc usr/lib/pkgconfig/
-debian/tmp/usr/lib/sox/lib*.a usr/lib/sox/
-debian/tmp/usr/share/man/man3 usr/share/man/
--- /dev/null
+++ b/debian/libsox-dev.install.in
@@ -1,0 +1,6 @@
+debian/tmp/usr/include/* usr/include/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/lib*.a usr/lib/@DEB_HOST_MULTIARCH@/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/lib*.so usr/lib/@DEB_HOST_MULTIARCH@/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/sox.pc usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/lib*.a usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/share/man/man3 usr/share/man/
--- a/debian/libsox-fmt-alsa.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib/sox
--- /dev/null
+++ b/debian/libsox-fmt-alsa.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
--- a/debian/libsox-fmt-alsa.install
+++ /dev/null
@@ -1,1 +1,0 @@
-debian/tmp/usr/lib/sox/libsox_fmt_alsa.so* usr/lib/sox/
--- /dev/null
+++ b/debian/libsox-fmt-alsa.install.in
@@ -1,0 +1,1 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_alsa.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
--- a/debian/libsox-fmt-ao.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib/sox
--- /dev/null
+++ b/debian/libsox-fmt-ao.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
--- a/debian/libsox-fmt-ao.install
+++ /dev/null
@@ -1,1 +1,0 @@
-debian/tmp/usr/lib/sox/libsox_fmt_ao.so* usr/lib/sox/
--- /dev/null
+++ b/debian/libsox-fmt-ao.install.in
@@ -1,0 +1,1 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_ao.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
--- a/debian/libsox-fmt-base.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib/sox
--- /dev/null
+++ b/debian/libsox-fmt-base.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
--- a/debian/libsox-fmt-base.install
+++ /dev/null
@@ -1,8 +1,0 @@
-debian/tmp/usr/lib/sox/libsox_fmt_amr_nb.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_amr_wb.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_flac.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_gsm.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_lpc10.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_sndfile.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_vorbis.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_wavpack.so* usr/lib/sox/
--- /dev/null
+++ b/debian/libsox-fmt-base.install.in
@@ -1,0 +1,8 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_amr_nb.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_amr_wb.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_flac.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_gsm.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_lpc10.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_sndfile.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_vorbis.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_wavpack.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
--- a/debian/libsox-fmt-mp3.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib/sox
--- /dev/null
+++ b/debian/libsox-fmt-mp3.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
--- a/debian/libsox-fmt-mp3.install
+++ /dev/null
@@ -1,1 +1,0 @@
-debian/tmp/usr/lib/sox/libsox_fmt_mp3.so* usr/lib/sox/
--- /dev/null
+++ b/debian/libsox-fmt-mp3.install.in
@@ -1,0 +1,1 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_mp3.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
--- a/debian/libsox-fmt-oss.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib/sox
--- /dev/null
+++ b/debian/libsox-fmt-oss.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
--- a/debian/libsox-fmt-oss.install
+++ /dev/null
@@ -1,1 +1,0 @@
-debian/tmp/usr/lib/sox/libsox_fmt_oss.so* usr/lib/sox/
--- /dev/null
+++ b/debian/libsox-fmt-oss.install.in
@@ -1,0 +1,1 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_oss.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
--- a/debian/libsox-fmt-pulse.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib/sox
--- /dev/null
+++ b/debian/libsox-fmt-pulse.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@/sox
--- a/debian/libsox-fmt-pulse.install
+++ /dev/null
@@ -1,1 +1,0 @@
-debian/tmp/usr/lib/sox/libsox_fmt_pulseaudio.so* usr/lib/sox/
--- /dev/null
+++ b/debian/libsox-fmt-pulse.install.in
@@ -1,0 +1,1 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/sox/libsox_fmt_pulseaudio.so* usr/lib/@DEB_HOST_MULTIARCH@/sox/
--- a/debian/libsox3.dirs
+++ /dev/null
@@ -1,1 +1,0 @@
-usr/lib
--- /dev/null
+++ b/debian/libsox3.dirs.in
@@ -1,0 +1,1 @@
+usr/lib/@DEB_HOST_MULTIARCH@
--- a/debian/libsox3.install
+++ /dev/null
@@ -1,1 +1,0 @@
-debian/tmp/usr/lib/*.so.* usr/lib/
--- /dev/null
+++ b/debian/libsox3.install.in
@@ -1,0 +1,1 @@
+debian/tmp/usr/lib/@DEB_HOST_MULTIARCH@/*.so.* usr/lib/@DEB_HOST_MULTIARCH@/
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,30 @@
 #!/usr/bin/make -f
 # -*- mode: makefile; coding: utf-8 -*-
 
-DEB_TAR_SRCDIR := sox-14.4.2git
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-include /usr/share/cdbs/1/rules/tarball.mk
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/autotools.mk
-include /usr/share/cdbs/1/rules/simple-patchsys.mk
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-DEB_CONFIGURE_EXTRA_FLAGS := --with-distro="$(shell dpkg-vendor --query vendor)" --with-dyn-default --without-ffmpeg
+PREPROCESS_FILES := $(wildcard debian/*.in)
+
+$(PREPROCESS_FILES:.in=): %: %.in
+	sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- --with-distro="$(shell dpkg-vendor --query vendor)" --with-dyn-default --without-ffmpeg
+
 # Takes care of postinst-has-useless-call-to-ldconfig for libsox-fmt-*
-DEB_DH_MAKESHLIBS_ARGS := -Xfmt
+override_dh_makeshlibs:
+	dh_makeshlibs -Xfmt
+
+override_dh_auto_clean:
+	dh_auto_clean
+	rm -rf $(PREPROCESS_FILES:.in=)
+
+override_dh_auto_install: $(PREPROCESS_FILES:.in=)
+	dh_auto_install
+
+%:
+	dh $@
+
--- a/debian/source/format
+++ b/debian/source/format
@@ -1,1 +1,1 @@
-1.0
+3.0 (quilt)
--- a/debian/sox.dirs
+++ /dev/null
@@ -1,2 +1,0 @@
-usr/bin
-usr/lib
--- /dev/null
+++ b/debian/sox.dirs.in
@@ -1,0 +1,2 @@
+usr/bin
+usr/share