Package: mp3check
Severity: wishlist
Tags: patch

Hi Sandro,

I had some free time; see attached patch to migrate to new package
format[*] and fix FTBFS #667288. Note that all files in debian/patches/*
are canocalized to *.patch.

Thanks,
Jari

[*] The dpatch patch management system has been deprecated for some time. The
Lintian currently flags use of dpatch packages as an error. The new 3.0
packaging format is an improved version which, among other things, contains
patch management built-in. For more information, see:
<http://wiki.debian.org/Projects/DebSrc3.0>

Thanks,
Jari

>From e431fb031fa8f6b1268e4a6c7f8e29e62c273a5e Mon Sep 17 00:00:00 2001
From: Jari Aalto <[email protected]>
Date: Fri, 20 Apr 2012 15:21:48 +0300
Subject: [PATCH] format-3.0
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Signed-off-by: Jari Aalto <[email protected]>
---
 debian/README.source                               |    4 --
 debian/changelog                                   |   15 ++++++++
 debian/compat                                      |    2 +-
 debian/control                                     |    6 +--
 debian/patches/00list                              |    2 -
 ..._code.dpatch => 01-restore-pristine-code.patch} |    8 +---
 ...tch => 10-bts450532-455727-manpage-fixes.patch} |    8 +---
 debian/patches/15-gcc-4.7.patch                    |   39 ++++++++++++++++++++
 debian/patches/series                              |    3 ++
 debian/rules                                       |   11 ++++--
 debian/source/format                               |    1 +
 11 files changed, 73 insertions(+), 26 deletions(-)
 delete mode 100644 debian/README.source
 delete mode 100644 debian/patches/00list
 rename debian/patches/{01_restore_pristine_code.dpatch => 01-restore-pristine-code.patch} (79%)
 rename debian/patches/{10_bts450532-455727_manpage_fixes.dpatch => 10-bts450532-455727-manpage-fixes.patch} (88%)
 create mode 100644 debian/patches/15-gcc-4.7.patch
 create mode 100644 debian/patches/series
 create mode 100644 debian/source/format

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 0d0aa40..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,4 +0,0 @@
-This package uses dpatch to handle patches against upstream source code; you
-can find additional information about dpatch at
-
-    /usr/share/doc/dpatch/
diff --git a/debian/changelog b/debian/changelog
index 6a665de..a1f46dc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+mp3check (0.8.3-3) unstable; urgency=low
+
+  [ Jari Aalto ]
+  * Remove deprecated dpatch and upgrade to packaging format "3.0 quilt".
+  * debian/control
+    - Bump Standards-Version to 3.9.3
+    - Update to debhelper 9.
+  * debian/rules
+    - Add required build-arch and build-indep targets
+    - Update to use dh_prep.
+  * debian/patches
+    - Path 15 is new; fix for gcc 4.7 (FTBFS ; Closes: #667288).
+
+ -- Jari Aalto <[email protected]>  Fri, 20 Apr 2012 15:20:38 +0300
+
 mp3check (0.8.3-2) unstable; urgency=low
 
   * debian/control
diff --git a/debian/compat b/debian/compat
index 7ed6ff8..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+9
diff --git a/debian/control b/debian/control
index 4064220..a51f56d 100644
--- a/debian/control
+++ b/debian/control
@@ -2,13 +2,13 @@ Source: mp3check
 Section: sound
 Priority: optional
 Maintainer: Sandro Tosi <[email protected]>
-Build-Depends: debhelper (>= 5.0), dpatch
-Standards-Version: 3.8.1
+Build-Depends: debhelper (>= 9)
+Standards-Version: 3.9.3
 Homepage: http://jo.ath.cx/soft/mp3check/
 
 Package: mp3check
 Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Suggests: mpg321
 Description: tool to check mp3 files for consistency
  Prints several errors and warnings concerning the consistency of mp3 files.
diff --git a/debian/patches/00list b/debian/patches/00list
deleted file mode 100644
index a955604..0000000
--- a/debian/patches/00list
+++ /dev/null
@@ -1,2 +0,0 @@
-01_restore_pristine_code
-10_bts450532-455727_manpage_fixes
diff --git a/debian/patches/01_restore_pristine_code.dpatch b/debian/patches/01-restore-pristine-code.patch
similarity index 79%
rename from debian/patches/01_restore_pristine_code.dpatch
rename to debian/patches/01-restore-pristine-code.patch
index 7d0e29c..6d6a254 100644
--- a/debian/patches/01_restore_pristine_code.dpatch
+++ b/debian/patches/01-restore-pristine-code.patch
@@ -1,10 +1,6 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 01_restore_pristine_code.dpatch by Sandro Tosi <[email protected]>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: New patch generated from mp3check 0.8.0-5 diff.gz
+From: Sandro Tosi <[email protected]>
+Subject: New patch generated from mp3check 0.8.0-5 diff.gz
 
-@DPATCH@
 diff -urNad mp3check~/mp3check.cc mp3check/mp3check.cc
 --- mp3check~/mp3check.cc	2008-03-19 22:36:02.000000000 +0100
 +++ mp3check/mp3check.cc	2008-03-19 22:54:00.529146931 +0100
diff --git a/debian/patches/10_bts450532-455727_manpage_fixes.dpatch b/debian/patches/10-bts450532-455727-manpage-fixes.patch
similarity index 88%
rename from debian/patches/10_bts450532-455727_manpage_fixes.dpatch
rename to debian/patches/10-bts450532-455727-manpage-fixes.patch
index 70dd085..3ecbb1f 100644
--- a/debian/patches/10_bts450532-455727_manpage_fixes.dpatch
+++ b/debian/patches/10-bts450532-455727-manpage-fixes.patch
@@ -1,10 +1,6 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 10_bts450532-455727_manpage_fixes.dpatch by Sandro Tosi <[email protected]>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix manpage as reported in BTS #450532 and #455727 and minus signs
+From: Sandro Tosi <[email protected]>
+Subject: Fix manpage as reported in BTS #450532 and #455727 and minus signs
 
-@DPATCH@
 diff -urNad mp3check~/mp3check.1 mp3check/mp3check.1
 --- mp3check~/mp3check.1	2008-02-17 16:49:38.000000000 +0100
 +++ mp3check/mp3check.1	2008-03-19 23:22:42.103253846 +0100
diff --git a/debian/patches/15-gcc-4.7.patch b/debian/patches/15-gcc-4.7.patch
new file mode 100644
index 0000000..6c118af
--- /dev/null
+++ b/debian/patches/15-gcc-4.7.patch
@@ -0,0 +1,39 @@
+From: Jari Aalto <[email protected]>
+Subject: Gcc 4.7 compiling fixes
+
+---
+ tmap.h    |    6 +++---
+ tvector.h |    4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/tmap.h
++++ b/tmap.h
+@@ -54,11 +54,11 @@
+    // new functionality
+ 
+    /// return whether an element with key is contained or not
+-    bool contains(const K& key) const { return find(key) != tmap_base<K,T>::end(); }
++    bool contains(const K& key) const { return this->find(key) != tmap_base<K,T>::end(); }
+    /// access element read only (const)
+ // g++ 2.95.2 does not allow this:
+-// const T& operator[](const K& key) const { const_iterator i = find(key); if(i != end()) return i->second; else throw TNotFoundException(); } // throw(TNotFoundException)
+-   const T& operator[](const K& key) const { if(contains(key)) return find(key)->second; else throw TNotFoundException(); } // throw(TNotFoundException)
++// const T& operator[](const K& key) const { const_iterator i = this->find(key); if(i != end()) return i->second; else throw TNotFoundException(); } // throw(TNotFoundException)
++   const T& operator[](const K& key) const { if(contains(key)) return this->find(key)->second; else throw TNotFoundException(); } // throw(TNotFoundException)
+ };
+ 
+ 
+--- a/tvector.h
++++ b/tvector.h
+@@ -58,9 +58,9 @@
+    // new functionality
+    
+    /// append an element to the end
+-   const tvector& operator += (const T& a) { push_back(a); return *this; }
++   const tvector& operator += (const T& a) { this->push_back(a); return *this; }
+    /// append another tvector to the end
+-   const tvector& operator += (const tvector& a) { insert(tvector_base<T>::end(), a.tvector_base<T>::begin(), a.tvector_base<T>::end()); return *this; }
++   const tvector& operator += (const tvector& a) { this->insert(tvector_base<T>::end(), a.tvector_base<T>::begin(), a.tvector_base<T>::end()); return *this; }
+    /// direct read only access, safe
+    const T& operator[](size_t i) const { if(i < tvector_base<T>::size()) return tvector_base<T>::operator[](i); else throw TZeroBasedIndexOutOfRangeException(i, tvector_base<T>::size()); } // throw(TZeroBasedIndexOutOfRangeException);
+    /// direct read/write access, automatically create new elements
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..004ae68
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+01-restore-pristine-code.patch
+10-bts450532-455727-manpage-fixes.patch
+15-gcc-4.7.patch
diff --git a/debian/rules b/debian/rules
index ba2bff5..31bd1a4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,6 @@
 # Uncomment this to turn on verbose mode.
 # export DH_VERBOSE=1
 
-include /usr/share/dpatch/dpatch.make
 
 configure: configure-stamp
 configure-stamp:
@@ -15,8 +14,12 @@ configure-stamp:
 
 	touch configure-stamp
 
+
+build-arch: build
+build-indep: build
+
 build: configure-stamp build-stamp
-build-stamp: patch-stamp
+build-stamp:
 	dh_testdir
 
 	# Add here commands to compile the package.
@@ -24,7 +27,7 @@ build-stamp: patch-stamp
 
 	touch build-stamp
 
-clean: unpatch
+clean:
 	dh_testdir
 	dh_testroot
 
@@ -36,7 +39,7 @@ clean: unpatch
 install: build
 	dh_testdir
 	dh_testroot
-	dh_clean -k
+	dh_prep
 	dh_installdirs
 
 	# Add here commands to install the package into debian/tmp.
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
-- 
1.7.9.5

Reply via email to