Source: mp3gain
Followup-For: Bug #1119785

Please use this slightly improved version instead.
Thanks.
>From 69d69b4cc40932936867aa7555bb0b128213efe8 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <[email protected]>
Date: Fri, 31 Oct 2025 00:19:00 +0100
Subject: [PATCH] Refresh the packaging

Apply changes not specific to Debian as patches and forward them.
Package with debputy instead of debhelper.
Update watch file to format version 5.
Refresh Standards-Version, copyright years, FSF contact, patch headers.
Replace HTTP with HTTPS: control/Homepage copyright/Format.
Format whitespaces:: README.method changelog copyright mp3gain.sgml.
---
 debian/README.method                          |  23 -
 debian/changelog                              |  20 +-
 debian/compat                                 |   1 -
 debian/control                                |  12 +-
 debian/copyright                              |  19 +-
 debian/debputy.manifest                       |   5 +
 debian/dirs                                   |   3 -
 debian/mp3gain.lintian-overrides              |   2 +
 debian/mp3gain.sgml                           | 441 ----------------
 ...-and-create-installation-directories.patch |  41 ++
 ...0003-install-a-small-FAQ-for-mp3gain.patch |  55 ++
 debian/patches/0004-add-an-UNIX-manpage.patch | 496 ++++++++++++++++++
 debian/patches/fix-security-bugs.patch        |  41 +-
 debian/patches/series                         |   3 +
 debian/rules                                  |  68 ---
 debian/watch                                  |   8 +-
 16 files changed, 664 insertions(+), 574 deletions(-)
 delete mode 100644 debian/README.method
 delete mode 100644 debian/compat
 create mode 100644 debian/debputy.manifest
 delete mode 100644 debian/dirs
 create mode 100644 debian/mp3gain.lintian-overrides
 delete mode 100644 debian/mp3gain.sgml
 create mode 100644 debian/patches/0002-Configure-and-create-installation-directories.patch
 create mode 100644 debian/patches/0003-install-a-small-FAQ-for-mp3gain.patch
 create mode 100644 debian/patches/0004-add-an-UNIX-manpage.patch
 delete mode 100755 debian/rules

diff --git a/debian/README.method b/debian/README.method
deleted file mode 100644
index a2f09e9..0000000
--- a/debian/README.method
+++ /dev/null
@@ -1,23 +0,0 @@
-Q: What dB value does mp3gain normalize to? How does this compare with
-normalize-audio?
-
-A: mp3gain and normalize-audio use different methods to determine the 
-perceived volume of a file, so the numbers are not comparable. As I  understand
-it, normalize-audio applies a smoothing filter and then  sets the maximum to
--12dBFS. mp3gain sorts the volume and then uses  the value at 95% (i.e. 5% of
-the file are louder, 95% are quieter).  This value is set to -20dBFS. I have
-tried a few files and found the  difference in the recomended values to vary
-between 3dB and 6dB.
-
-The method mp3gain uses to determine the perceived volume is described at
-http://www.replaygain.org/.
-
-
-
-
-Q: Why are the files not exactly at the same volume?
-
-A: Since mp3gain changes the global gain value in every mp3 frame, it can only
-use 1.5dB steps for adjusting the volume. It will however write replaygain
-values to tags with finer accuracy than these 1.5dB steps. 
-
diff --git a/debian/changelog b/debian/changelog
index fd1a695..01410a0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+mp3gain (1.6.2-3) unstable; urgency=medium
+
+  [ Nicolas Boulenguez ]
+  * Package with debputy instead of debhelper.
+  * Patch upstream when the changes are not specific to Debian.
+  * Use httpS in Homepage and copyright format URLs.
+  * Standards-Version: 4.7.2.
+  * Update copyright years, FSF contact, fix-security-bugs.patch header.
+  * Remove tabulations and trailing whitespaces from README.method,
+    changelog, copyright, mp3gain.sgml.
+  * Update watch file to format version 5.
+
+ -- Stefan Fritsch <[email protected]>  Thu, 30 Oct 2025 23:09:44 +0000
+
 mp3gain (1.6.2-2) unstable; urgency=medium
 
   [ Helmut Grohne ]
@@ -145,11 +159,11 @@ mp3gain (1.4.6-8) unstable; urgency=medium
 
   * Rebuild with non-buggy gcc. This fixes mp3gain giving wrong results on
     i386 (closes: #519949).
-  * Fix lintian warnings: 
+  * Fix lintian warnings:
     - Bump standards version:
       + Add homepage to debian/control.
       + Add README.source.
-    - Use UTF8 for debian/copyright. 
+    - Use UTF8 for debian/copyright.
     - Switch to debhelper compatibility level 7.
 
  -- Stefan Fritsch <[email protected]>  Mon, 23 Mar 2009 11:51:58 +0100
@@ -230,5 +244,3 @@ mp3gain (1.4.3-1) unstable; urgency=low
   * Initial Upload sponsored by Joachim Breitner; Closes: #241748: ITP
 
  -- Stefan Fritsch <[email protected]>  Thu, 15 Apr 2004 23:12:05 +0200
-
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index f599e28..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/debian/control b/debian/control
index 36b1f88..2c1942a 100644
--- a/debian/control
+++ b/debian/control
@@ -3,15 +3,19 @@ Section: sound
 Priority: optional
 Maintainer: Scott Hardin <[email protected]>
 Uploaders: Stefan Fritsch <[email protected]>
-Build-Depends: debhelper (>= 10), docbook-to-man, libmpg123-dev
-Homepage: http://mp3gain.sourceforge.net/
-Standards-Version: 4.3.0
+Build-Depends:
+  debputy (>= 0.1.45~),
+  docbook-to-man,
+  dpkg-dev (>= 1.22.7~),
+  libmpg123-dev,
+Build-Driver: debputy
+Homepage: https://mp3gain.sourceforge.net/
+Standards-Version: 4.7.2
 Vcs-Git: https://salsa.debian.org/snhardin-guest/mp3gain.git
 Vcs-Browser: https://salsa.debian.org/snhardin-guest/mp3gain
 
 Package: mp3gain
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Lossless mp3 normalizer with statistical analysis
  MP3Gain analyzes and adjusts mp3 files so that they have the same volume.
  MP3Gain does not just do peak normalization, as many normalizers do. Instead,
diff --git a/debian/copyright b/debian/copyright
index 83e9dec..e8346d2 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: mp3gain
 Upstream-Contact: Glen Sawyer <[email protected]>
 Source: http://mp3gain.sourceforge.net/download.php
@@ -8,17 +8,17 @@ Copyright: 2001-2009 Glen Sawyer
            2004-2009 David Lasker, Altos Design, Inc.
            2002 John Zitterkopf
            2001-2009 David Robinson
-	   Stefan Partheymüller
-	   Artur Polaczynski
-	   Frank Klemm
-	   Mark Armbrust
+           Stefan Partheymüller
+           Artur Polaczynski
+           Frank Klemm
+           Mark Armbrust
 License: LGPL-2+
 
 Files: debian/*
-Copyright: 2004 Stefan Fritsch <[email protected]>
+Copyright: 2004-2025 Stefan Fritsch <[email protected]>
            2011 Fabrizio Regalli <[email protected]>
 License: LGPL-2+
-	 
+
 License: LGPL-2+
     This package is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -31,9 +31,8 @@ License: LGPL-2+
     Lesser General Public License for more details.
     .
     You should have received a copy of the GNU Lesser General Public
-    License along with this package; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
-    USA.
+    License along with this package; if not, see
+    https://www.gnu.org/licenses/.
     .
     On Debian systems, the complete text of the GNU Lesser General
     Public License can be found in `/usr/share/common-licenses/LGPL-2'.
diff --git a/debian/debputy.manifest b/debian/debputy.manifest
new file mode 100644
index 0000000..ceef796
--- /dev/null
+++ b/debian/debputy.manifest
@@ -0,0 +1,5 @@
+manifest-version: '0.1'
+default-build-environment:
+    set:
+        DEB_BUILD_MAINT_OPTIONS: hardening=+all
+        prefix: /usr
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644
index 625e527..0000000
--- a/debian/dirs
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/bin
-usr/share/man/man1
-
diff --git a/debian/mp3gain.lintian-overrides b/debian/mp3gain.lintian-overrides
new file mode 100644
index 0000000..cba1608
--- /dev/null
+++ b/debian/mp3gain.lintian-overrides
@@ -0,0 +1,2 @@
+# https://bugs.debian.org/1112495
+unknown-field Commands
diff --git a/debian/mp3gain.sgml b/debian/mp3gain.sgml
deleted file mode 100644
index 3c5d8c4..0000000
--- a/debian/mp3gain.sgml
+++ /dev/null
@@ -1,441 +0,0 @@
-<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
-     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
-     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
-     less'.  A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.sgml
-	docbook-to-man $< > $@
-
-    
-	The docbook-to-man binary is found in the docbook-to-man package.
-	Please remember that if you create the nroff version in one of the
-	debian/rules file targets (such as build), you will need to include
-	docbook-to-man in your Build-Depends control field.
-
-  -->
-
-  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
-  <!ENTITY dhfirstname "<firstname>STEFAN</firstname>">
-  <!ENTITY dhsurname   "<surname>FRITSCH</surname>">
-  <!-- Please adjust the date whenever revising the manpage. -->
-  <!ENTITY dhdate      "<date>February  4, 2004</date>">
-  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
-       allowed: see man(7), man(1). -->
-  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
-  <!ENTITY dhemail     "<email>[email protected]</email>">
-  <!ENTITY dhusername  "Stefan Fritsch">
-  <!ENTITY dhucpackage "<refentrytitle>MP3GAIN</refentrytitle>">
-  <!ENTITY dhpackage   "mp3gain">
-  <!ENTITY debian      "<productname>Debian</productname>">
-  <!ENTITY gnu         "<acronym>GNU</acronym>">
-  <!ENTITY lgpl         "&gnu; <acronym>LGPL</acronym>">
-]>
-
-<refentry>
-  <refentryinfo>
-    <address>
-      &dhemail;
-    </address>
-    <author>
-      &dhfirstname;
-      &dhsurname;
-    </author>
-    <copyright>
-      <year>2004</year>
-      <holder>Glen Sawyer and &dhusername;</holder>
-    </copyright>
-    &dhdate;
-  </refentryinfo>
-  <refmeta>
-    &dhucpackage;
-
-    &dhsection;
-  </refmeta>
-  <refnamediv>
-    <refname>&dhpackage;</refname>
-
-    <refpurpose>lossless mp3 normalizer</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>&dhpackage;</command>
-
-      <arg><option>options</option></arg>
-
-      <arg><replaceable>infile</replaceable></arg>
-      
-      <arg><option><replaceable>infile 2</replaceable> ...</option></arg>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-  
-  <refsect1>
-    <title>DESCRIPTION</title>
-
-    <para>This manual page documents briefly the
-      <command>&dhpackage;</command>
-      command.</para>
-
-    <para>This manual page was written for the &debian; distribution
-      because the original program does not have a manual page.
-     </para>
-
-    <para><command>&dhpackage;</command> can analyze and adjust mp3 files
-    so that they have the same volume.</para>
-    
-    <para><command>&dhpackage;</command> does not just do peak normalization,
-    as many normalizers do. Instead, it does some statistical analysis to
-    determine how loud the file actually sounds to the human ear. Also, the
-    changes <command>&dhpackage;</command> makes are completely lossless. There
-    is no quality lost in the change because the program adjusts the mp3 file
-    directly, without decoding and re-encoding.</para>
-
-    <para><command>&dhpackage;</command> optionally writes gain adjustments
-    directly into the encoded data. In this case, the adjustment works
-    with all mp3 players, i.e. no support for a special tag is required.
-    This mode is activated by any of the options <option>-r</option>,
-    <option>-a</option>, <option>-g</option>, or <option>-l</option>.</para>
-
-    <para>If none of the above options are given, the recommended gain change
-    is instead written to a special tag in the mp3 file. In this case, the
-    adjustment only works with mp3 players that support this tag.
-    Some mp3 players refer to this as ReplayGain.
-    The tag is written either in APEv2 format (default) or in ID3v2 format
-    (with <option>-s&nbsp;i</option>).
-    If you only want to print the recommended gain change (and not modify
-    the file at all) you may use the <option>-s s</option> (skip tag)
-    option. </para>
-
-    <para>The method mp3gain uses to determine the desired volume
-    is described at
-    <ulink url="http://www.replaygain.org/";>www.replaygain.org</ulink>.
-    See also <filename>/usr/share/doc/mp3gain/README.method</filename> .
-    </para>
-    
-  
-
-
-  </refsect1>
-  <refsect1>
-    <title>OPTIONS</title>
-
-
-    <variablelist>
-      <varlistentry>
-        <term><option>-?</option>
-          <option>-h</option>
-        </term>
-        <listitem>
-          <para>Show summary of options.</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-g <replaceable>i</replaceable></option>
-        </term>
-        <listitem>
-          <para>apply gain <replaceable>i</replaceable> to mp3 without
-	   doing any analysis</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-l 0 <replaceable>i</replaceable></option>
-        </term>
-        <listitem>
-          <para>apply gain <replaceable>i</replaceable> to channel 0 
-	  	(left channel) of mp3
-                  without doing any analysis (ONLY works for STEREO mp3s,
-                  not Joint Stereo mp3s)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-l 1 <replaceable>i</replaceable></option>
-        </term>
-        <listitem>
-          <para>apply gain <replaceable>i</replaceable> to channel 1
-	  	(right channel) of mp3
-                  without doing any analysis (ONLY works for STEREO mp3s,
-                  not Joint Stereo mp3s)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-r</option>
-        </term>
-        <listitem>
-          <para>apply Track gain automatically (all files set to equal loudness)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-k</option>
-        </term>
-        <listitem>
-          <para>automatically lower Track gain to not clip audio</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-a</option>
-        </term>
-        <listitem>
-          <para>apply Album gain automatically (files are all from the same
-                      album: a single gain change is applied to all files, so
-                      their loudness relative to each other remains unchanged,
-                      but the average album loudness is normalized)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-m <replaceable>i</replaceable></option>
-        </term>
-        <listitem>
-          <para>modify suggested MP3 gain by integer <replaceable>i</replaceable></para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-d <replaceable>n</replaceable></option>
-        </term>
-        <listitem>
-          <para>modify suggested dB gain by floating-point
-	  <replaceable>n</replaceable></para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-c</option>
-        </term>
-        <listitem>
-          <para>ignore clipping warning when applying gain</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-o</option>
-        </term>
-        <listitem>
-          <para>output is a database-friendly tab-delimited list</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-t</option>
-        </term>
-        <listitem>
-          <para>mp3gain writes modified mp3 to temp file, then deletes original
-             instead of modifying bytes in original file (This is the default in
-	     Debian)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-T</option>
-        </term>
-        <listitem>
-          <para>mp3gain modifies bytes in original file instead of
-	   writing to temp file.</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-q</option>
-        </term>
-        <listitem>
-          <para>Quiet mode: no status messages</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-p</option>
-        </term>
-        <listitem>
-          <para>Preserve original file timestamp</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-x</option>
-        </term>
-        <listitem>
-          <para>Only find max. amplitude of mp3</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-f</option>
-        </term>
-        <listitem>
-          <para>Force <command>mp3gain</command> to assume input file
-	  is an MPEG 2 Layer III file
-             (i.e. don't check for mis-named Layer I or Layer II files)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-s c</option>
-        </term>
-        <listitem>
-          <para>only check stored tag info (no other processing)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-s d</option>
-        </term>
-        <listitem>
-          <para>delete stored tag info (no other processing)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-s i</option>
-        </term>
-        <listitem>
-          <para>use ID3v2 tag for gain information;
-          if the file contained gain data in APEv2 format, it is upgraded
-          to ID3v2</para>
-        </listitem>
-      </varlistentry>
-      
-       <varlistentry>
-        <term><option>-s a</option>
-        </term>
-        <listitem>
-          <para>use APEv2 tag for gain information (default)</para>
-        </listitem>
-      </varlistentry>
-      
-       <varlistentry>
-        <term><option>-s s</option>
-        </term>
-        <listitem>
-          <para>skip (ignore) stored tag info (do not read or write tags)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-s r</option>
-        </term>
-        <listitem>
-          <para>force re-calculation (do not read tag info)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-u</option>
-        </term>
-        <listitem>
-          <para>undo changes made by mp3gain (based on stored tag info)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-w</option>
-        </term>
-        <listitem>
-          <para>"wrap" gain change if gain+change &gt; 255 or gain+change &lt; 0
-              (see below or use <option>-? wrap</option> switch for a complete
-	      explanation)</para>
-        </listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>-v</option>
-        </term>
-        <listitem>
-          <para>Show version of program.</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-    <para>If you specify <option>-r</option> and <option>-a</option>,
-    only the second one will work.</para>
-    <para>If you do not specify <option>-c</option>, the program will
-    stop and ask before
-     applying gain change to a file that might clip</para>
-   <refsect2><title>The WRAP option</title>
-   <para>Here's the problem:
-     The "global gain" field that mp3gain adjusts is an 8-bit unsigned integer, so
-     the possible values are 0 to 255.
-   </para><para>
-     MOST mp3 files (in fact, ALL the mp3 files I've examined so far) don't go
-     over 230. So there's plenty of headroom on top-- you can increase the gain
-     by 37dB (multiplying the amplitude by 76) without a problem.
-   </para><para>
-     The problem is at the bottom of the range. Some encoders create frames with
-     0 as the global gain for silent frames.
-     What happens when you _lower_ the global gain by 1?
-     Well, in the past, mp3gain always simply wrapped the result up to 255.
-     That way, if you lowered the gain by any amount and then raised it by the
-     same amount, the mp3 would always be _exactly_ the same.
-   </para><para>
-     There are a few encoders out there, unfortunately, that create 0-gain frames
-     with other audio data in the frame.
-     As long as the global gain is 0, you'll never hear the data.
-     But if you lower the gain on such a file, the global gain is suddenly _huge_.
-     If you play this modified file, there might be a brief, very loud blip.
-   </para><para>
-     So now the default behavior of mp3gain is to _not_ wrap gain changes.
-     In other words,
-     <orderedlist>
-     <listitem><para>
-        If the gain change would make a frame's global gain drop below 0,
-	then the global gain is set to 0.
-     </para></listitem><listitem><para>
-        If the gain change would make a frame's global gain grow above 255,
-	then the global gain is set to 255.
-     </para></listitem><listitem><para> 
-        If a frame's global gain field is already 0, it is not changed, even if
-	the gain change is a positive number.
-     </para></listitem>
-     </orderedlist>
-   </para><para>
-     To use the original "wrapping" behavior, use the <option>-w</option> switch.
-   </para>
-   </refsect2>
-  </refsect1>
-  <refsect1>
-    <title>SEE ALSO</title>
-
-    <para>The homepage of mp3gain is located at
-     <ulink url="http://mp3gain.sourceforge.net/";>http://mp3gain.sourceforge.net/</ulink> .
-    </para>
-  </refsect1> 
-  <refsect1>
-    <title>AUTHOR</title>
-
-    <para>This manual page was written by &dhusername; &dhemail; for
-      the &debian; system (but may be used by others).  Permission is
-      granted to copy, distribute and/or modify this document under
-      the terms of the &gnu; Lesser General Public License, Version 2.1 or 
-      any later version published by the Free Software Foundation.
-    </para>
-	<para>
-	  On Debian systems, the complete text of the GNU Lesser General Public
-	  License can be found in /usr/share/common-licenses/LGPL.
-	</para>
-
-  </refsect1>
-</refentry>
-
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:2
-sgml-indent-data:t
-sgml-parent-document:nil
-sgml-default-dtd-file:nil
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
--->
-
-
diff --git a/debian/patches/0002-Configure-and-create-installation-directories.patch b/debian/patches/0002-Configure-and-create-installation-directories.patch
new file mode 100644
index 0000000..3ca5835
--- /dev/null
+++ b/debian/patches/0002-Configure-and-create-installation-directories.patch
@@ -0,0 +1,41 @@
+From: Nicolas Boulenguez <[email protected]>
+Forwarded: https://sourceforge.net/p/mp3gain/bugs/62/
+Subject: [PATCH 2/4] Configure and create installation directories
+
+Allow non-default DESTDIR for stagged installations.
+Allow prefix other than '/usr/local'.
+Create intermediate directories when installing.
+
+--- a/Makefile
++++ b/Makefile
+@@ -5,6 +5,8 @@
+ #
+ 
+ CC?= gcc
++DESTDIR ?=
++prefix ?= /usr/local
+ 
+ CFLAGS+= -Wall -DHAVE_MEMCPY
+ 
+@@ -19,7 +21,8 @@
+ endif
+ 
+ ifneq ($(OSTYPE),beos)
+-INSTALL_PATH= /usr/local/bin
++INSTALL_PATH= $(prefix)/bin
++
+ else
+ INSTALL_PATH= $(HOME)/config/bin
+ endif
+@@ -59,9 +62,9 @@
+ 
+ install: mp3gain
+ ifneq ($(OSTYPE),win)
+-	cp -p mp3gain$(EXE_EXT) "$(INSTALL_PATH)"
++	install '-Dt$(DESTDIR)$(INSTALL_PATH)' mp3gain$(EXE_EXT)
+ ifeq ($(OSTYPE),beos)
+-	mimeset -f "$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
++	mimeset -f "$(DESTDIR)$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
+ endif
+ else
+ 	@echo install target is not implemented on windows
diff --git a/debian/patches/0003-install-a-small-FAQ-for-mp3gain.patch b/debian/patches/0003-install-a-small-FAQ-for-mp3gain.patch
new file mode 100644
index 0000000..91235f7
--- /dev/null
+++ b/debian/patches/0003-install-a-small-FAQ-for-mp3gain.patch
@@ -0,0 +1,55 @@
+From: Stefan Fritsch <[email protected]>
+Forwarded: https://sourceforge.net/p/mp3gain/bugs/62/
+Subject: [PATCH 3/4] install a small FAQ for mp3gain
+
+--- a/Makefile
++++ b/Makefile
+@@ -7,6 +7,7 @@
+ CC?= gcc
+ DESTDIR ?=
+ prefix ?= /usr/local
++docdir ?= $(prefix)/share/doc/mp3gain
+ 
+ CFLAGS+= -Wall -DHAVE_MEMCPY
+ 
+@@ -63,6 +64,7 @@
+ install: mp3gain
+ ifneq ($(OSTYPE),win)
+ 	install '-Dt$(DESTDIR)$(INSTALL_PATH)' mp3gain$(EXE_EXT)
++	install '-Dt$(DESTDIR)$(docdir)' README.method
+ ifeq ($(OSTYPE),beos)
+ 	mimeset -f "$(DESTDIR)$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
+ endif
+@@ -73,6 +75,7 @@
+ uninstall:
+ ifneq ($(OSTYPE),win)
+ 	-rm -f "$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
++	$(RM) '$(INSTALL_PATH)$(docndir)/README.method'
+ else
+ 	@echo uninstall target is not implemented on windows
+ endif
+--- /dev/null
++++ b/README.method
+@@ -0,0 +1,22 @@
++Q: What dB value does mp3gain normalize to? How does this compare with
++normalize-audio?
++
++A: mp3gain and normalize-audio use different methods to determine the
++perceived volume of a file, so the numbers are not comparable. As I  understand
++it, normalize-audio applies a smoothing filter and then  sets the maximum to
++-12dBFS. mp3gain sorts the volume and then uses  the value at 95% (i.e. 5% of
++the file are louder, 95% are quieter).  This value is set to -20dBFS. I have
++tried a few files and found the  difference in the recomended values to vary
++between 3dB and 6dB.
++
++The method mp3gain uses to determine the perceived volume is described at
++http://www.replaygain.org/.
++
++
++
++
++Q: Why are the files not exactly at the same volume?
++
++A: Since mp3gain changes the global gain value in every mp3 frame, it can only
++use 1.5dB steps for adjusting the volume. It will however write replaygain
++values to tags with finer accuracy than these 1.5dB steps.
diff --git a/debian/patches/0004-add-an-UNIX-manpage.patch b/debian/patches/0004-add-an-UNIX-manpage.patch
new file mode 100644
index 0000000..3858c54
--- /dev/null
+++ b/debian/patches/0004-add-an-UNIX-manpage.patch
@@ -0,0 +1,496 @@
+From: Stefan Fritsch <[email protected]>
+Forwarded: https://sourceforge.net/p/mp3gain/bugs/62/
+Subject: [PATCH 4/4] Add an UNIX manpage
+
+--- a/Makefile
++++ b/Makefile
+@@ -8,6 +8,7 @@
+ DESTDIR ?=
+ prefix ?= /usr/local
+ docdir ?= $(prefix)/share/doc/mp3gain
++mandir ?= $(prefix)/share/man/man1
+ 
+ CFLAGS+= -Wall -DHAVE_MEMCPY
+ 
+@@ -50,7 +51,10 @@
+ RC_OBJ = VerInfo.o
+ endif
+ 
+-all: mp3gain
++all: mp3gain mp3gain.1
++
++mp3gain.1: mp3gain.sgml
++	docbook-to-man $< > $@
+ 
+ $(RC_OBJ): 
+ 	$(WINDRES) $(RC_OBJ:.o=.rc) $(RC_OBJ)
+@@ -61,10 +65,11 @@
+ 	mimeset -f mp3gain$(EXE_EXT)
+ endif
+ 
+-install: mp3gain
++install: all
+ ifneq ($(OSTYPE),win)
+ 	install '-Dt$(DESTDIR)$(INSTALL_PATH)' mp3gain$(EXE_EXT)
+ 	install '-Dt$(DESTDIR)$(docdir)' README.method
++	install '-Dt$(DESTDIR)$(mandir)' mp3gain.1
+ ifeq ($(OSTYPE),beos)
+ 	mimeset -f "$(DESTDIR)$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
+ endif
+@@ -76,12 +81,14 @@
+ ifneq ($(OSTYPE),win)
+ 	-rm -f "$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
+ 	$(RM) '$(INSTALL_PATH)$(docndir)/README.method'
++	$(RM) '$(INSTALL_PATH)$(mandir)/mp3gain.1'
+ else
+ 	@echo uninstall target is not implemented on windows
+ endif
+ 
+ clean: 
+ 	-rm -rf mp3gain$(EXE_EXT) mp3gain.zip $(OBJS) $(RC_OBJ)
++	$(RM) mp3gain.1
+ 
+ dist:   clean
+ ifneq ($(OSTYPE),win)
+--- /dev/null
++++ b/mp3gain.sgml
+@@ -0,0 +1,439 @@
++<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
++
++<!-- Process this file with docbook-to-man to generate an nroff manual
++     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
++     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
++     less'.  A typical entry in a Makefile or Makefile.am is:
++
++manpage.1: manpage.sgml
++[TAB]docbook-to-man $< > $@
++
++
++        The docbook-to-man binary is found in the docbook-to-man package.
++        Please remember that if you create the nroff version in one of the
++        debian/rules file targets (such as build), you will need to include
++        docbook-to-man in your Build-Depends control field.
++
++  -->
++
++  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
++  <!ENTITY dhfirstname "<firstname>STEFAN</firstname>">
++  <!ENTITY dhsurname   "<surname>FRITSCH</surname>">
++  <!-- Please adjust the date whenever revising the manpage. -->
++  <!ENTITY dhdate      "<date>February  4, 2004</date>">
++  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
++       allowed: see man(7), man(1). -->
++  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
++  <!ENTITY dhemail     "<email>[email protected]</email>">
++  <!ENTITY dhusername  "Stefan Fritsch">
++  <!ENTITY dhucpackage "<refentrytitle>MP3GAIN</refentrytitle>">
++  <!ENTITY dhpackage   "mp3gain">
++  <!ENTITY debian      "<productname>Debian</productname>">
++  <!ENTITY gnu         "<acronym>GNU</acronym>">
++  <!ENTITY lgpl         "&gnu; <acronym>LGPL</acronym>">
++]>
++
++<refentry>
++  <refentryinfo>
++    <address>
++      &dhemail;
++    </address>
++    <author>
++      &dhfirstname;
++      &dhsurname;
++    </author>
++    <copyright>
++      <year>2004</year>
++      <holder>Glen Sawyer and &dhusername;</holder>
++    </copyright>
++    &dhdate;
++  </refentryinfo>
++  <refmeta>
++    &dhucpackage;
++
++    &dhsection;
++  </refmeta>
++  <refnamediv>
++    <refname>&dhpackage;</refname>
++
++    <refpurpose>lossless mp3 normalizer</refpurpose>
++  </refnamediv>
++  <refsynopsisdiv>
++    <cmdsynopsis>
++      <command>&dhpackage;</command>
++
++      <arg><option>options</option></arg>
++
++      <arg><replaceable>infile</replaceable></arg>
++
++      <arg><option><replaceable>infile 2</replaceable> ...</option></arg>
++    </cmdsynopsis>
++  </refsynopsisdiv>
++
++  <refsect1>
++    <title>DESCRIPTION</title>
++
++    <para>This manual page documents briefly the
++      <command>&dhpackage;</command>
++      command.</para>
++
++    <para>This manual page was written for the &debian; distribution
++      because the original program does not have a manual page.
++     </para>
++
++    <para><command>&dhpackage;</command> can analyze and adjust mp3 files
++    so that they have the same volume.</para>
++
++    <para><command>&dhpackage;</command> does not just do peak normalization,
++    as many normalizers do. Instead, it does some statistical analysis to
++    determine how loud the file actually sounds to the human ear. Also, the
++    changes <command>&dhpackage;</command> makes are completely lossless. There
++    is no quality lost in the change because the program adjusts the mp3 file
++    directly, without decoding and re-encoding.</para>
++
++    <para><command>&dhpackage;</command> optionally writes gain adjustments
++    directly into the encoded data. In this case, the adjustment works
++    with all mp3 players, i.e. no support for a special tag is required.
++    This mode is activated by any of the options <option>-r</option>,
++    <option>-a</option>, <option>-g</option>, or <option>-l</option>.</para>
++
++    <para>If none of the above options are given, the recommended gain change
++    is instead written to a special tag in the mp3 file. In this case, the
++    adjustment only works with mp3 players that support this tag.
++    Some mp3 players refer to this as ReplayGain.
++    The tag is written either in APEv2 format (default) or in ID3v2 format
++    (with <option>-s&nbsp;i</option>).
++    If you only want to print the recommended gain change (and not modify
++    the file at all) you may use the <option>-s s</option> (skip tag)
++    option. </para>
++
++    <para>The method mp3gain uses to determine the desired volume
++    is described at
++    <ulink url="http://www.replaygain.org/";>www.replaygain.org</ulink>.
++    See also <filename>/usr/share/doc/mp3gain/README.method</filename> .
++    </para>
++
++
++
++
++  </refsect1>
++  <refsect1>
++    <title>OPTIONS</title>
++
++
++    <variablelist>
++      <varlistentry>
++        <term><option>-?</option>
++          <option>-h</option>
++        </term>
++        <listitem>
++          <para>Show summary of options.</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-g <replaceable>i</replaceable></option>
++        </term>
++        <listitem>
++          <para>apply gain <replaceable>i</replaceable> to mp3 without
++            doing any analysis</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-l 0 <replaceable>i</replaceable></option>
++        </term>
++        <listitem>
++          <para>apply gain <replaceable>i</replaceable> to channel 0
++                  (left channel) of mp3
++                  without doing any analysis (ONLY works for STEREO mp3s,
++                  not Joint Stereo mp3s)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-l 1 <replaceable>i</replaceable></option>
++        </term>
++        <listitem>
++          <para>apply gain <replaceable>i</replaceable> to channel 1
++                  (right channel) of mp3
++                  without doing any analysis (ONLY works for STEREO mp3s,
++                  not Joint Stereo mp3s)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-r</option>
++        </term>
++        <listitem>
++          <para>apply Track gain automatically (all files set to equal loudness)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-k</option>
++        </term>
++        <listitem>
++          <para>automatically lower Track gain to not clip audio</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-a</option>
++        </term>
++        <listitem>
++          <para>apply Album gain automatically (files are all from the same
++                      album: a single gain change is applied to all files, so
++                      their loudness relative to each other remains unchanged,
++                      but the average album loudness is normalized)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-m <replaceable>i</replaceable></option>
++        </term>
++        <listitem>
++          <para>modify suggested MP3 gain by integer <replaceable>i</replaceable></para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-d <replaceable>n</replaceable></option>
++        </term>
++        <listitem>
++          <para>modify suggested dB gain by floating-point
++            <replaceable>n</replaceable></para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-c</option>
++        </term>
++        <listitem>
++          <para>ignore clipping warning when applying gain</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-o</option>
++        </term>
++        <listitem>
++          <para>output is a database-friendly tab-delimited list</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-t</option>
++        </term>
++        <listitem>
++          <para>mp3gain writes modified mp3 to temp file, then deletes original
++             instead of modifying bytes in original file (This is the default in
++             Debian)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-T</option>
++        </term>
++        <listitem>
++          <para>mp3gain modifies bytes in original file instead of
++            writing to temp file.</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-q</option>
++        </term>
++        <listitem>
++          <para>Quiet mode: no status messages</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-p</option>
++        </term>
++        <listitem>
++          <para>Preserve original file timestamp</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-x</option>
++        </term>
++        <listitem>
++          <para>Only find max. amplitude of mp3</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-f</option>
++        </term>
++        <listitem>
++          <para>Force <command>mp3gain</command> to assume input file
++             is an MPEG 2 Layer III file
++             (i.e. don't check for mis-named Layer I or Layer II files)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-s c</option>
++        </term>
++        <listitem>
++          <para>only check stored tag info (no other processing)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-s d</option>
++        </term>
++        <listitem>
++          <para>delete stored tag info (no other processing)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-s i</option>
++        </term>
++        <listitem>
++          <para>use ID3v2 tag for gain information;
++          if the file contained gain data in APEv2 format, it is upgraded
++          to ID3v2</para>
++        </listitem>
++      </varlistentry>
++
++       <varlistentry>
++        <term><option>-s a</option>
++        </term>
++        <listitem>
++          <para>use APEv2 tag for gain information (default)</para>
++        </listitem>
++      </varlistentry>
++
++       <varlistentry>
++        <term><option>-s s</option>
++        </term>
++        <listitem>
++          <para>skip (ignore) stored tag info (do not read or write tags)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-s r</option>
++        </term>
++        <listitem>
++          <para>force re-calculation (do not read tag info)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-u</option>
++        </term>
++        <listitem>
++          <para>undo changes made by mp3gain (based on stored tag info)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-w</option>
++        </term>
++        <listitem>
++          <para>"wrap" gain change if gain+change &gt; 255 or gain+change &lt; 0
++              (see below or use <option>-? wrap</option> switch for a complete
++              explanation)</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>-v</option>
++        </term>
++        <listitem>
++          <para>Show version of program.</para>
++        </listitem>
++      </varlistentry>
++    </variablelist>
++    <para>If you specify <option>-r</option> and <option>-a</option>,
++    only the second one will work.</para>
++    <para>If you do not specify <option>-c</option>, the program will
++    stop and ask before
++     applying gain change to a file that might clip</para>
++   <refsect2><title>The WRAP option</title>
++   <para>Here's the problem:
++     The "global gain" field that mp3gain adjusts is an 8-bit unsigned integer, so
++     the possible values are 0 to 255.
++   </para><para>
++     MOST mp3 files (in fact, ALL the mp3 files I've examined so far) don't go
++     over 230. So there's plenty of headroom on top-- you can increase the gain
++     by 37dB (multiplying the amplitude by 76) without a problem.
++   </para><para>
++     The problem is at the bottom of the range. Some encoders create frames with
++     0 as the global gain for silent frames.
++     What happens when you _lower_ the global gain by 1?
++     Well, in the past, mp3gain always simply wrapped the result up to 255.
++     That way, if you lowered the gain by any amount and then raised it by the
++     same amount, the mp3 would always be _exactly_ the same.
++   </para><para>
++     There are a few encoders out there, unfortunately, that create 0-gain frames
++     with other audio data in the frame.
++     As long as the global gain is 0, you'll never hear the data.
++     But if you lower the gain on such a file, the global gain is suddenly _huge_.
++     If you play this modified file, there might be a brief, very loud blip.
++   </para><para>
++     So now the default behavior of mp3gain is to _not_ wrap gain changes.
++     In other words,
++     <orderedlist>
++     <listitem><para>
++        If the gain change would make a frame's global gain drop below 0,
++        then the global gain is set to 0.
++     </para></listitem><listitem><para>
++        If the gain change would make a frame's global gain grow above 255,
++        then the global gain is set to 255.
++     </para></listitem><listitem><para>
++        If a frame's global gain field is already 0, it is not changed, even if
++        the gain change is a positive number.
++     </para></listitem>
++     </orderedlist>
++   </para><para>
++     To use the original "wrapping" behavior, use the <option>-w</option> switch.
++   </para>
++   </refsect2>
++  </refsect1>
++  <refsect1>
++    <title>SEE ALSO</title>
++
++    <para>The homepage of mp3gain is located at
++     <ulink url="http://mp3gain.sourceforge.net/";>http://mp3gain.sourceforge.net/</ulink> .
++    </para>
++  </refsect1>
++  <refsect1>
++    <title>AUTHOR</title>
++
++    <para>This manual page was written by &dhusername; &dhemail; for
++      the &debian; system (but may be used by others).  Permission is
++      granted to copy, distribute and/or modify this document under
++      the terms of the &gnu; Lesser General Public License, Version 2.1 or
++      any later version published by the Free Software Foundation.
++    </para>
++    <para>
++      On Debian systems, the complete text of the GNU Lesser General Public
++      License can be found in /usr/share/common-licenses/LGPL.
++    </para>
++
++  </refsect1>
++</refentry>
++
++<!-- Keep this comment at the end of the file
++Local variables:
++mode: sgml
++sgml-omittag:t
++sgml-shorttag:t
++sgml-minimize-attributes:nil
++sgml-always-quote-attributes:t
++sgml-indent-step:2
++sgml-indent-data:t
++sgml-parent-document:nil
++sgml-default-dtd-file:nil
++sgml-exposed-tags:nil
++sgml-local-catalogs:nil
++sgml-local-ecat-files:nil
++End:
++-->
diff --git a/debian/patches/fix-security-bugs.patch b/debian/patches/fix-security-bugs.patch
index 4259c91..d4d7159 100644
--- a/debian/patches/fix-security-bugs.patch
+++ b/debian/patches/fix-security-bugs.patch
@@ -1,6 +1,13 @@
-# From https://build.opensuse.org/package/view_file/openSUSE:Maintenance:12304/mp3gain.openSUSE_Leap_15.1_Update/0001-fix-security-bugs.patch?rev=0db47562b2545871d0be3fc88083e0cd
---- mp3gain.orig/apetag.c
-+++ mp3gain/apetag.c
+From: Jason Craig <[email protected]>
+Date: Mon, 30 Mar 2020 12:43:20 -0600
+References: boo#1154971
+Origin: https://build.opensuse.org/package/view_file/openSUSE:Maintenance:12304/mp3gain.openSUSE_Leap_15.1_Update/0001-fix-security-bugs.patch?rev=0db47562b2545871d0be3fc88083e0cd
+Bug-Debian: https://bugs.debian.org/973932
+Forwarded: https://sourceforge.net/p/mp3gain/bugs/62/
+Subject: [PATCH 1/4] Fix various security issues including CVE-2019-18359
+
+--- a/apetag.c
++++ b/apetag.c
 @@ -16,6 +16,13 @@
  #define _stricmp strcasecmp
  #endif /* WIN32 */
@@ -15,7 +22,7 @@
  int ReadMP3ID3v1Tag(FILE *fi, unsigned char **tagbuff, long *tag_offset) {
      char tmp[128];
  
-@@ -102,9 +109,9 @@ static int ReadMP3Lyrics3v2Tag ( FILE *f
+@@ -102,9 +109,9 @@
  	if ( fseek (fp, *tag_offset - 128 - (long)sizeof (T) - len, SEEK_SET) ) return 0;
      if ( fread  (tmp, 1, 11, fp) != 11 ) return 0;
      if ( memcmp (tmp, "LYRICSBEGIN", 11) ) return 0;
@@ -27,7 +34,7 @@
      *tag_offset -= taglen;
      if (*tagbuff != NULL) {
          free(*tagbuff);
-@@ -142,7 +149,7 @@ enum {
+@@ -142,7 +149,7 @@
  
  unsigned long strlen_max(const char * ptr, unsigned long max) {
  	unsigned long n = 0;
@@ -36,7 +43,7 @@
  	return n;
  }
  
-@@ -234,6 +241,14 @@ int ReadMP3APETag ( FILE *fp,  struct MP
+@@ -234,6 +241,14 @@
                  info->albumPeak = atof(value);
              } else if (!_stricmp(name,"MP3GAIN_UNDO")) {
  				/* value should be something like "+003,+003,W" */
@@ -51,7 +58,7 @@
                  info->haveUndo = !0;
                  vp = value;
  				memcpy(tmpString,vp,4);
-@@ -251,6 +266,14 @@ int ReadMP3APETag ( FILE *fp,  struct MP
+@@ -251,6 +266,14 @@
                  }
              } else if (!_stricmp(name,"MP3GAIN_MINMAX")) {
  				/* value should be something like "001,153" */
@@ -66,7 +73,7 @@
                  info->haveMinMaxGain = !0;
                  vp = value;
  				memcpy(tmpString,vp,3);
-@@ -289,7 +312,7 @@ int ReadMP3APETag ( FILE *fp,  struct MP
+@@ -289,7 +312,7 @@
      }
  
      free (buff);
@@ -75,7 +82,7 @@
  	*tag_offset -= TagLen;
  	(*apeTag)->originalTagSize = TagLen;
  
-@@ -318,7 +341,7 @@ int ReadMP3APETag ( FILE *fp,  struct MP
+@@ -318,7 +341,7 @@
  int truncate_file (char *filename, long truncLength) {
  
  #ifdef WIN32
@@ -84,7 +91,7 @@
     int fh, result;
  
     /* Open a file */
-@@ -370,10 +393,10 @@ int ReadMP3GainAPETag (char *filename, s
+@@ -370,10 +393,10 @@
      fi = fopen(filename, "rb");
      if (fi == NULL)
  		return 0;
@@ -97,7 +104,7 @@
  	fileTags->lyrics3TagSize = 0;
  
      do {
-@@ -515,7 +538,7 @@ int WriteMP3GainAPETag (char *filename,
+@@ -515,7 +538,7 @@
  		Write_LE_Uint32(newFooter.Flags,1<<31); /* tag has header */
  		memset(newFooter.Reserved,0,sizeof(newFooter.Reserved));
  	}
@@ -106,7 +113,7 @@
  	if (info->haveMinMaxGain) {
  		/* 8 bytes + "MP3GAIN_MINMAX" + '/0' + "123,123" = 30 bytes */
  		Write_LE_Uint32(mp3gainTagData,7);
-@@ -575,7 +598,10 @@ int WriteMP3GainAPETag (char *filename,
+@@ -575,7 +598,10 @@
  		mp3gainTagData += 4;
  		strcpy(mp3gainTagData, "REPLAYGAIN_TRACK_GAIN");
  		mp3gainTagData += 22;
@@ -118,7 +125,7 @@
  		memcpy(mp3gainTagData, valueString, 9);
  		mp3gainTagData += 9;
  		memcpy(mp3gainTagData, " dB", 3);
-@@ -589,7 +615,10 @@ int WriteMP3GainAPETag (char *filename,
+@@ -589,7 +615,10 @@
  		mp3gainTagData += 4;
  		strcpy(mp3gainTagData, "REPLAYGAIN_TRACK_PEAK");
  		mp3gainTagData += 22;
@@ -130,7 +137,7 @@
  		memcpy(mp3gainTagData, valueString, 8);
  		mp3gainTagData += 8;
  	}
-@@ -601,7 +630,9 @@ int WriteMP3GainAPETag (char *filename,
+@@ -601,7 +630,9 @@
  		mp3gainTagData += 4;
  		strcpy(mp3gainTagData, "REPLAYGAIN_ALBUM_GAIN");
  		mp3gainTagData += 22;
@@ -141,7 +148,7 @@
  		memcpy(mp3gainTagData, valueString, 9);
  		mp3gainTagData += 9;
  		memcpy(mp3gainTagData, " dB", 3);
-@@ -615,7 +646,9 @@ int WriteMP3GainAPETag (char *filename,
+@@ -615,7 +646,9 @@
  		mp3gainTagData += 4;
  		strcpy(mp3gainTagData, "REPLAYGAIN_ALBUM_PEAK");
  		mp3gainTagData += 22;
@@ -152,7 +159,7 @@
  		memcpy(mp3gainTagData, valueString, 8);
  		mp3gainTagData += 8;
  	}
-@@ -641,7 +674,7 @@ int WriteMP3GainAPETag (char *filename,
+@@ -641,7 +674,7 @@
      }                                                  //no Lyrics3 tag
  
  	fclose(outputFile);
@@ -161,7 +168,7 @@
  	if (saveTimeStamp)
  		fileTime(filename,setStoredTime);
  
-@@ -666,7 +699,7 @@ int RemoveMP3GainAPETag (char *filename,
+@@ -666,7 +699,7 @@
  	info.haveMinMaxGain = 0;
  	info.haveAlbumMinMaxGain = 0;
  	info.haveUndo = 0;
diff --git a/debian/patches/series b/debian/patches/series
index cdae975..1d7eda2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
 fix-security-bugs.patch
+0002-Configure-and-create-installation-directories.patch
+0003-install-a-small-FAQ-for-mp3gain.patch
+0004-add-an-UNIX-manpage.patch
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index c586ef3..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-DEB_BUILD_MAINT_OPTIONS = hardening=+all
-DPKG_EXPORT_BUILDFLAGS=1
-
-include /usr/share/dpkg/default.mk
-
-make_vars = \
-	INSTALL_PATH='$$(DESTDIR)/usr/bin'
-
-build: build-stamp
-build-arch: build-stamp
-build-indep: build
-
-build-stamp:
-	dh_testdir
-
-	dh_auto_build
-	docbook-to-man  debian/mp3gain.sgml > debian/mp3gain.1
-
-	touch build-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp
-
-	$(MAKE) clean
-	rm -f debian/mp3gain.1
-
-	dh_clean 
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
-
-	$(MAKE) install $(make_vars) DESTDIR=$(CURDIR)/debian/mp3gain
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs 
-	dh_installdocs debian/README.method
-	dh_installman debian/mp3gain.1
-	dh_link
-	dh_strip
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/watch b/debian/watch
index 65de089..dfc0323 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,3 +1,5 @@
-version=4
-opts="uversionmangle=s/_/\./g" \
-https://sf.net/mp3gain/ mp3gain-(\d+_\d+_\d+)-src\.zip debian uupdate
+Version: 5
+
+Uversion-Mangle: s/_/\./g
+Source: https://sf.net/mp3gain/
+Matching-Pattern: mp3gain-(\d+_\d+_\d+)-src\.zip
-- 
2.47.3

Reply via email to