--- p7zip-9.20.1~dfsg.1.orig/debian/NEWS.Debian
+++ p7zip-9.20.1~dfsg.1/debian/NEWS.Debian
@@ -0,0 +1,18 @@
+p7zip (4.37.dfsg-1) unstable; urgency=low
+
+  * New upstream release
+    - introduces 7zr, a light version of 7za
+  * debian/control:
+    - now p7zip only provides 7zr (Closes: #343513)
+    - p7zip recommends p7zip-full, much more similar to the old p7zip
+    - p7zip-full conflicts and replaces old p7zip versions
+  * debian/patches:
+    - 01_add_help_switch.dpatch: applies on new upstream version
+    - 01_main_help.dpatch: removed from diff.gz; correct the result of "7z -h"
+    - 01_makefile.dpatch: removed from diff.gz; remove non-free targets like Rar2.9
+    - 02_man.dpatch: removed from diff.gz; adds 7zr.1 and other corrections
+  * debian/copyright: correct copyright according to d-d-a suggestions
+  * debian/rules:
+    - move all dh_installed stuff to debian/p7zip{,-full}.install
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 11 Apr 2006 14:50:16 +0200
--- p7zip-9.20.1~dfsg.1.orig/debian/README.Debian
+++ p7zip-9.20.1~dfsg.1/debian/README.Debian
@@ -0,0 +1,22 @@
+Notes for anyone wanting to build Debian packages of p7zip.
+-----------------------------------------------------------
+
+ - 7z is the full featured command line version of 7-Zip. 7z uses other
+   modules from 7-Zip package. 7za is a standalone command line version
+   of 7-Zip. 7za supports only 7z, zip, gzip, bzip2 and tar formats. 7za
+   doesn't use other modules. Modules are in /usr/lib/p7zip.
+
+ - These packages of p7zip (source and binary) do not contain the RAR
+   decoder which is released under the terms of the UnRAR license (which
+   is non-free). A non-free so file is provided in the non-free package
+   p7zip-rar available at http://adn.diwi.org/debian/p7zip-rar (should be
+   up-to-date).
+
+Note concerning directory exclusion.
+------------------------------------
+
+ - Directory exclusion only works when an exclude list file is provided
+   and if directories to exclude are listed as relative paths of the
+   location 7z or 7za is run from.
+
+ - Using absolute directories *won't* work, as noted in #296665.
--- p7zip-9.20.1~dfsg.1.orig/debian/README.source
+++ p7zip-9.20.1~dfsg.1/debian/README.source
@@ -0,0 +1,58 @@
+This package uses quilt to manage all modifications to the upstream
+source.  Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+To configure quilt to use debian/patches instead of patches, you want
+either to export QUILT_PATCHES=debian/patches in your environment
+or use this snippet in your ~/.quiltrc:
+
+    for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do
+        if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then
+                export QUILT_PATCHES=debian/patches
+                break
+        fi
+    done
+
+To get the fully patched source after unpacking the source package, cd to
+the root level of the source package and run:
+
+    quilt push -a
+
+The last patch listed in debian/patches/series will become the current
+patch.
+
+To add a new set of changes, first run quilt push -a, and then run:
+
+    quilt new <patch>
+
+where <patch> is a descriptive name for the patch, used as the filename in
+debian/patches.  Then, for every file that will be modified by this patch,
+run:
+
+    quilt add <file>
+
+before editing those files.  You must tell quilt with quilt add what files
+will be part of the patch before making changes or quilt will not work
+properly.  After editing the files, run:
+
+    quilt refresh
+
+to save the results as a patch.
+
+Alternately, if you already have an external patch and you just want to
+add it to the build system, run quilt push -a and then:
+
+    quilt import -P <patch> /path/to/patch
+    quilt push -a
+
+(add -p 0 to quilt import if needed). <patch> as above is the filename to
+use in debian/patches.  The last quilt push -a will apply the patch to
+make sure it works properly.
+
+To remove an existing patch from the list of patches that will be applied,
+run:
+
+    quilt delete <patch>
+
+You may need to run quilt pop -a to unapply patches first before running
+this command.
--- p7zip-9.20.1~dfsg.1.orig/debian/changelog
+++ p7zip-9.20.1~dfsg.1/debian/changelog
@@ -0,0 +1,432 @@
+p7zip (9.20.1~dfsg.1-4.1+deb8u1) jessie-security; urgency=medium
+
+  * Non-maintainer upload.
+  * Delay creation of symlinks to prevent arbitrary file writes (CVE-2015-1038)
+    (Closes: #774660)
+
+ -- Ben Hutchings <ben@decadent.org.uk>  Sun, 31 May 2015 23:45:58 +0100
+
+p7zip (9.20.1~dfsg.1-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Stop building unpackaged 7zG binary and eliminate dependency on
+    libwxgtk2.8-dev.  (Closes: #748639)
+
+ -- Olly Betts <olly@survex.com>  Mon, 19 May 2014 17:39:26 +1200
+
+p7zip (9.20.1~dfsg.1-4) unstable; urgency=low
+
+  * Acknowledge NMU. Thanks to Gregor Herrmann.
+  * debian/control: bump Standards-Version to 3.9.2.
+  * debian/rules: add build-* targets.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun, 08 Jan 2012 14:17:13 +0100
+
+p7zip (9.20.1~dfsg.1-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix "p7zip FTBFS with multiarch libwxgtk2.8-dev": fix from peter green:
+    adjust 01_makefile.patch to the multiarched libwxgtk2.8-dev, and add
+    appropriate build dependencies.
+    (Closes: #652446)
+
+ -- gregor herrmann <gregoa@debian.org>  Sat, 31 Dec 2011 16:09:00 +0100
+
+p7zip (9.20.1~dfsg.1-3) unstable; urgency=low
+
+  * debian/patches:
+     + fix 7zr.1 and 7za.1 ambiguous sentence. (Closes: #636174)
+  * debian/control:
+     + fix p7zip-full's description
+        - wrong reference to p7zip. (Closes: #636186)
+        - capitalise Nautilus, uppercase GUI. (Closes: #636172)
+        - missing comma. (Closes: #636178)
+     + fix p7zip's description accordingly.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Wed, 03 Aug 2011 12:43:08 +0200
+
+p7zip (9.20.1~dfsg.1-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 28 Jun 2011 17:05:01 +0200
+
+p7zip (9.20.1~dfsg.1-1) experimental; urgency=low
+
+  * New upstream release (Closes: #620619)
+  * debian/control
+     + bump Standards-Version to 3.9.1.
+     + update and improve description. (Closes: #545871, #612770)
+  * manpages
+     + add supported formats. (Closes: #570427)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 01 Apr 2011 21:20:22 +0200
+
+p7zip (9.04~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Bump Standards-Version to 3.8.2.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 27 Jun 2009 16:20:41 +0200
+
+p7zip (4.65~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
+    intended to be built).
+  * Use dh_clean without -k.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 14 Feb 2009 20:12:27 +0100
+
+p7zip (4.61~dfsg.1-1) experimental; urgency=low
+
+  * New upstream release:
+     + use BCJ /BCJ2 filters for executables. (Closes: #506657)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Thu, 04 Dec 2008 23:34:59 +0100
+
+p7zip (4.58~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control:
+     + bump Standards-Version to 3.8.0.
+     + bump build-dependency on debhelper 7.
+  * debian/compat: set compatibility level to 7.
+  * Don't use hyphen as a minus in man pages.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 21 Jun 2008 15:29:00 +0200
+
+p7zip (4.57~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control:
+     + add Homepage field.
+     + bump Standards-Version to 3.7.3.
+     + tighten description to tell about /usr/bin/p7zip.
+  * debian/copyright converted to Unicode encoding.
+  * debian/patches:
+     + 03_fix_FTBFS_GNU-kFreeBSD.diff: removed, included upstream.
+     + 02_man.patch: refreshed and fixed link to DOCS. (Closes: #452084)
+  * Don't install /usr/share/p7zip/ which is empty.
+  * Install 7zr to /usr/lib/p7zip and use a wrapper to call it so as
+    to have -sfx option working.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 21 Dec 2007 16:41:17 +0100
+
+p7zip (4.55~dfsg.1-2) unstable; urgency=low
+
+  * Bump debhelper compatibility to 5.
+  * Our Makefile is called makefile. (Closes: #442697)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun, 16 Sep 2007 23:19:51 +0200
+
+p7zip (4.55~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 14 Sep 2007 22:42:17 +0200
+
+p7zip (4.53~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 11 Sep 2007 16:39:29 +0200
+
+p7zip (4.51~dfsg.1-2) unstable; urgency=low
+
+  * Our clean rule is clean, not distclean!
+  * 04_no_strip_by_default.diff: don't strip binaries by default.
+    (Closes: #437736)
+  * Don't install License.txt.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 14 Aug 2007 22:35:09 +0200
+
+p7zip (4.51~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release
+  * Fix FTBFS on GNU/kFreeBSD (Closes: #430357)
+     + patch courtesy from Petr Salinger.
+  * Suggest p7zip-full instead of Recommend-ing it. (Closes: #435592)
+  * Install 7za to /usr/lib/p7zip and use a wrapper to call it so as
+    to have -sfx option working. (Closes: #435556)
+  * Fix lintian warnings:
+     + don't hide clean target errors.
+     + don't install DOCS/License.txt.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 04 Aug 2007 21:27:22 +0200
+
+p7zip (4.47~dfsg.1-1) unstable; urgency=low
+
+  * New upstream version:
+     + refresh patches.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 08 Jun 2007 10:33:32 +0200
+
+p7zip (4.45~dfsg.1-2) unstable; urgency=low
+
+  * Install 7zCon.sfx so enable SFX archives too.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 28 Apr 2007 01:31:22 +0200
+
+p7zip (4.45~dfsg.1-1) unstable; urgency=low
+
+  * New upstream version:
+     + (new -b command to benchmark).
+     + if -t is not specified, try to autodetect format using file extension.
+     + all the Codecs are now linked in 7z.so and no more stored in Codecs/.
+  * Add AES code license to debian/copyright.
+  * Suggests: p7zip-rar.
+  * Refresh 01_makefile.patch.
+  * Update debian/rules with new makefile name.
+  * p7zip-full.install: bin/Formats no longer exists.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 21 Apr 2007 23:00:15 +0200
+
+p7zip (4.44~dfsg.1-2) unstable; urgency=low
+
+  * Correct path to HTML documentation in manpage. (Closes: #411491)
+  * 03_respect-umask.diff:
+     + new patch from Joshua Rodman <jrodman@debbugs.spamportal.net>
+     + not applied currently
+     + don't always create world-writable directories. (Ref: #413829)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 10 Apr 2007 00:28:08 +0200
+
+p7zip (4.44~dfsg.1-1) experimental; urgency=low
+
+  * New upstream version.
+  * Refresh patches and escape hyphens in manpages.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 27 Jan 2007 01:30:00 +0100
+
+p7zip (4.43~dfsg.1-2) unstable; urgency=low
+
+  * Improve description wording. (Closes: #391066, #404081, #404092)
+  * Correct manpages: 02_man.patch and debian/p7zip.1
+     + replace {DEST_SHARE_DOC} with /usr/share/doc/p7zip.
+       (Closes: #404096)
+     + improve "SEE ALSO" section by adding references to other tools and by
+       ordering them alphabetically (Closes: #403968)
+     + correct title and NAME. (Closes: #404095)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 26 Dec 2006 20:13:19 +0100
+
+p7zip (4.43~dfsg.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Refresh debian/patches.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Mon, 25 Sep 2006 00:14:37 +0200
+
+p7zip (4.42.dfsg.1-3) unstable; urgency=low
+
+  * Include improvements to Robert Millan's wrapper script. (Closes: #379397)
+  * Correct watch file to use <http://qa.debian.org/watch/sf.php/>.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 19 Sep 2006 02:15:01 +0200
+
+p7zip (4.42.dfsg.1-2) unstable; urgency=low
+
+  * Backup makefile.machine before replacing it and restore it after build.
+  * Put ${file} between quotes for the case the filename contains spaces.
+  * Pop all patches first in clean target so that it does not fail.
+
+   Thanks Ingo Saitz for pointing these.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Thu, 29 Jun 2006 00:01:56 +0200
+
+p7zip (4.42.dfsg.1-1) unstable; urgency=low
+
+  * New upstream version (Closes: #369284)
+  * Switch to quilt patch management
+     + changes to debian/rules
+     + build-depend on quilt
+  * debian/script/p7zip: correct typo on file extension
+  * [asac@debian.org] - removed version from Recommends of p7zip-full
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun,  4 Jun 2006 10:43:06 +0200
+
+p7zip (4.39.dfsg.1-3) unstable; urgency=low
+
+  * debian/rules: 7z is in /usr/lib/p7zip, not /usr/lib/p7zip-full.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Mon, 29 May 2006 18:29:25 +0200
+
+p7zip (4.39.dfsg.1-2) unstable; urgency=low
+
+  * Bump Standards-Version to 3.7.2 (no changes needed)
+  * Remove link to p7zip-rar from debian/p7zip.1
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Mon,  1 May 2006 02:34:52 +0200
+
+p7zip (4.39.dfsg.1-1) unstable; urgency=low
+
+  * New upstream release
+    - introduces 7zr, a light version of 7za
+  * debian/control:
+    - now p7zip only provides 7zr (Closes: #343513)
+    - p7zip recommends p7zip-full, much more similar to the old p7zip
+    - p7zip-full conflicts and replaces old p7zip versions
+  * debian/patches:
+    - 01_makefile.dpatch: removed from diff.gz; remove non-free targets like Rar2.9
+    - 02_man.dpatch: removed from diff.gz; adds 7zr.1 and other corrections
+  * debian/copyright: correct copyright according to d-d-a suggestions
+  * debian/rules:
+    - move all dh_installed stuff to debian/p7zip{,-full}.install
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 11 Apr 2006 14:50:16 +0200
+
+p7zip (4.33.dfsg-1) unstable; urgency=low
+
+  * New upstream release
+  * Move p7zip from /usr/share to /usr/bin
+     - modify debian/install
+     - write debian/p7zip.1
+  * debian/README.Debian: document directory exclusion
+  * patches/01_add_help_switch: 7z --help works now (Closes: #353235)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 10 Feb 2006 20:54:59 +0100
+
+p7zip (4.30.dfsg-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun, 27 Nov 2005 12:44:34 +0100
+
+p7zip (4.29.dfsg-3) unstable; urgency=low
+
+  * Drop p7zip-rar suggestion
+      - debian/control
+  * Add a link to a p7zip-rar package not in Debian
+      - debian/README.Debian
+      - 7z.1 manpage
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun, 20 Nov 2005 10:53:52 +0100
+
+p7zip (4.29.dfsg-2) unstable; urgency=low
+
+  * Precise the use of -so switch in manual pages
+    and -h output (Closes: #323932)
+  * Add a gzip-like CLI wrapper script to /usr/share/p7zip
+    thanks to Robert Millan <rmh@aybabtu.com> (Closes: #334106)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Mon, 17 Oct 2005 13:06:26 +0000
+
+p7zip (4.29.dfsg-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat,  8 Oct 2005 00:18:00 +0200
+
+p7zip (4.27.dfsg-1) unstable; urgency=low
+
+  * New upstream release (Closes: #330828)
+     - "echo foo | 7z a dummy -si -so" no more segfaults 
+       but causes an error (Closes: #324449)
+  * In -w[path], path is optionnal.
+     - corrected manual pages (Closes: #325736)
+     - corrected --help output
+  * Add a link in manual pages to a list of methods (Closes: #325737)
+  * Correct FSF address
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 30 Sep 2005 10:29:42 +0000
+
+p7zip (4.20-2) unstable; urgency=low
+
+  * Bump Standards-Version to 3.6.2
+  * Recompile against new gcc and g++ versions
+  * Included patch for GNU/kFreeBSD provided by 
+      Robert Millan <rmh@aybabtu.com> [applied by asac@debian.org] 
+      (Closes: 322195)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Thu, 11 Aug 2005 01:45:00 +0200
+
+p7zip (4.20-1) unstable; urgency=low
+
+  * New upstream release
+      - compile with -fPIC flag
+  * Update to manpages and -h output (Closes: #311993)
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue,  7 Jun 2005 23:01:29 +0200
+
+p7zip (4.18-2) unstable; urgency=low
+
+  * debian/rules: compile p7zip with -fPIC. Closes: #309734
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Wed, 18 May 2005 12:08:00 +0200
+
+p7zip (4.18-1) unstable; urgency=low
+
+  * First upload to unstable:
+      - many thanks to my sponsor Alexander Sack (asac@debian.org)
+  * New upstream release. Closes: #306912
+      - fixes some symlinks issues (Closes: #295643)
+      - preserve unix file attributes (Closes: #297329)
+      - libs are no more called dll but so
+  * debian/7z*.1: removed to use upstream manpages
+  * debian/rules: Call 7z with exec
+  * debian/README.Debian: update due to upstream changes
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri, 12 May 2005 23:46:00 +0200
+
+p7zip (4.14.01-1) experimental; urgency=low
+
+  * New upstream release. Closes: #293788
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat,  5 Feb 2005 22:22:22 +0200
+
+p7zip (4.14-2) experimental; urgency=low
+
+  * Corrected copyright
+  * debian/rules : corrected shell script in /usr/bin. Closes: #292321
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun, 23 Jan 2005 21:44:35 +0200
+
+p7zip (4.14-1) experimental; urgency=low
+
+  * New upstream release
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Fri,  1 Jan 2005 21:23:35 +0200
+
+
+p7zip (4.13-2) experimental; urgency=low
+
+  * Codecs are back to their initial dll name. Closes: #286673, Closes: #290613
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Tue, 21 Dec 2004 21:18:45 +0200
+
+p7zip (4.13-1) experimental; urgency=low
+
+  * New upstream release
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Thu, 16 Dec 2004 21:18:45 +0200
+
+p7zip (4.12-2) experimental; urgency=low
+
+  * Now, 7z and its codecs are also compiled (7za 7z, zip, gzip, bzip2 and tar
+    formats)
+  * Added some docs (Manual in html)
+  * Added a mention to LZMA compression algorithm. Closes: #284703
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Thu, 12 Dec 2004 14:22:54 +0200
+
+p7zip (4.12-1) experimental; urgency=low
+
+  * New upstream release
+  * At last, p7zip is in Debian. Closes: #265329
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Thu, 18 Nov 2004 23:29:54 +0200
+
+p7zip (4.10-1) experimental; urgency=low
+
+  * New upstream release
+  * Now both big and little endian computers are supported
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sat, 30 Oct 2004 21:14:50 +0200
+
+p7zip (0.90-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Mohammed Adnène Trojette <adn+deb@diwi.org>  Sun, 15 Aug 2004 20:49:27 +0200
+
--- p7zip-9.20.1~dfsg.1.orig/debian/compat
+++ p7zip-9.20.1~dfsg.1/debian/compat
@@ -0,0 +1 @@
+7
--- p7zip-9.20.1~dfsg.1.orig/debian/control
+++ p7zip-9.20.1~dfsg.1/debian/control
@@ -0,0 +1,54 @@
+Source: p7zip
+Section: utils
+Priority: optional
+Maintainer: Mohammed Adnène Trojette <adn+deb@diwi.org>
+Build-Depends: debhelper (>= 7), quilt, dpkg-dev (>= 1.16.0)
+Standards-Version: 3.9.2
+Homepage: http://p7zip.sourceforge.net/
+
+Package: p7zip
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Suggests: p7zip-full
+Description: 7z file archiver with high compression ratio
+ p7zip is the Unix command-line port of 7-Zip, a file archiver that
+ archives with high compression ratios.
+ .
+ p7zip provides:
+  - /usr/bin/7zr
+    a standalone minimal version of the 7-zip tool that only handles
+    7z archives. 7z compression is 30-50% better than ZIP compression.
+  - /usr/bin/p7zip
+    a gzip-like wrapper around 7zr.
+ .
+ p7zip can be used with popular compression interfaces (such as File
+ Roller or Nautilus).
+ .
+ p7zip-full provides 7z and 7za which support more compression formats.
+
+Package: p7zip-full
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: p7zip (<< 4.39-1)
+Replaces: p7zip (<< 4.39-1)
+Suggests: p7zip-rar
+Description: 7z and 7za file archivers with high compression ratio
+ p7zip is the Unix command-line port of 7-Zip, a file archiver that
+ archives with high compression ratios.
+ .
+ p7zip-full provides utilities to pack and unpack 7z archives within
+ a shell or using a GUI (such as Ark, File Roller or Nautilus).
+ .
+ Installing p7zip-full allows File Roller to use the very efficient 7z
+ compression format for packing and unpacking files and directories.
+ Additionally, it provides the 7z and 7za commands.
+ .
+ List of supported formats:
+   - Packing / unpacking: 7z, ZIP, GZIP, BZIP2, XZ and TAR
+   - Unpacking only: APM, ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT,
+     HFS, ISO, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RAR (only
+     if non-free p7zip-rar package is installed), RPM, SquashFS, UDF,
+     VHD, WIM, XAR and Z.
+ .
+ p7zip provides 7zr, a light version of 7za, and p7zip, a gzip-like
+ wrapper around 7zr.
--- p7zip-9.20.1~dfsg.1.orig/debian/copyright
+++ p7zip-9.20.1~dfsg.1/debian/copyright
@@ -0,0 +1,66 @@
+This package was debianized by Mohammed Adnène Trojette
+<adn+deb@diwi.org> on Sun, 12 Dec 2004 14:28:27 +0200.
+
+The current Debian maintainer is Mohammed Adnène Trojette
+<adn+deb@diwi.org>.
+
+It was downloaded from <http://p7zip.sourceforge.net/>.
+
+Files in CPP/7zip/Crypto/AES files are released the termes of the GNU
+LGPL and AES code license (a BSD-like license, see below).
+
+7zip is Copyright (C) 1999-2006 Igor Pavlov.
+p7zip is ported from 7zip by my space <myspace@users.sourceforge.net>
+
+LGPL
+----
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+On Debian systems, the complete text of the GNU Lesser General Public
+License, can be found in /usr/share/common-licenses/LGPL.
+
+AES License
+-----------
+
+ Copyright (c) 2001, Dr Brian Gladman
+
+ LICENSE TERMS
+
+ The free distribution and use of this software in both source and binary 
+ form is allowed (with or without changes) provided that:
+
+   1. distributions of this source code include the above copyright 
+      notice, this list of conditions and the following disclaimer;
+
+   2. distributions in binary form include the above copyright
+      notice, this list of conditions and the following disclaimer
+      in the documentation and/or other associated materials;
+
+   3. the copyright holder's name is not used to endorse products 
+      built using this software without specific written permission. 
+
+ DISCLAIMER
+
+ This software is provided 'as is' with no explicit or implied warranties
+ in respect of its properties, including, but not limited to, correctness 
+ and fitness for purpose.
+
+Packaging
+---------
+
+The current Debian packaging is (C) 2004-2006, Mohammed Adnène
+Trojette <adn+deb@diwi.org> and is licensed under the GPL, see
+/usr/share/common-licenses/GPL.
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip-full.dirs
+++ p7zip-9.20.1~dfsg.1/debian/p7zip-full.dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/lib/p7zip
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip-full.docs
+++ p7zip-9.20.1~dfsg.1/debian/p7zip-full.docs
@@ -0,0 +1,4 @@
+ChangeLog
+README
+TODO
+DOCS/
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip-full.install
+++ p7zip-9.20.1~dfsg.1/debian/p7zip-full.install
@@ -0,0 +1,7 @@
+bin/7z usr/lib/p7zip
+bin/7zCon.sfx usr/lib/p7zip
+bin/7za usr/lib/p7zip
+bin/7z.so usr/lib/p7zip
+
+debian/scripts/7z usr/bin
+debian/scripts/7za usr/bin
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip-full.links
+++ p7zip-9.20.1~dfsg.1/debian/p7zip-full.links
@@ -0,0 +1,2 @@
+usr/share/doc/p7zip-full/ChangeLog.gz usr/share/doc/p7zip-full/changelog.gz
+
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip.1
+++ p7zip-9.20.1~dfsg.1/debian/p7zip.1
@@ -0,0 +1,28 @@
+.TH p7zip 1 "October 31 2004" "Mohammed Adnene Trojette"
+.SH NAME
+p7zip \- Wrapper on 7zr, a 7-zip file archiver with high compression ratio
+.SH SYNOPSIS
+.B p7zip
+.BR [-d]
+.BR [-h|--help]
+.BR [file]
+    \-h print this help
+    \-d decompress file
+.SH DESCRIPTION
+7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), LZMA2, XZ, ZIP, Zip64, CAB, RAR (if the non-free p7zip-rar package is installed), ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, most filesystem images and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
+.TP
+p7zip is a gzip-like CLI wrapper script for 7zip
+.PP
+.SH FUNCTION LETTERS
+.TP
+.B \-d
+Decompress file
+.TP
+.B \-h, \--help
+Print usage
+.SH "SEE ALSO"
+7z(1), 7za(1), 7zr(1), bzip2(1), gzip(1), zip(1)
+.PP
+.SH AUTHOR
+.TP
+Written for Debian by Mohammed Adnene Trojette.
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip.dirs
+++ p7zip-9.20.1~dfsg.1/debian/p7zip.dirs
@@ -0,0 +1 @@
+usr/bin
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip.docs
+++ p7zip-9.20.1~dfsg.1/debian/p7zip.docs
@@ -0,0 +1,4 @@
+ChangeLog
+README
+TODO
+DOCS/
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip.install
+++ p7zip-9.20.1~dfsg.1/debian/p7zip.install
@@ -0,0 +1,3 @@
+bin/7zr usr/lib/p7zip
+debian/scripts/p7zip usr/bin
+debian/scripts/7zr usr/bin
--- p7zip-9.20.1~dfsg.1.orig/debian/p7zip.links
+++ p7zip-9.20.1~dfsg.1/debian/p7zip.links
@@ -0,0 +1,2 @@
+usr/share/doc/p7zip/ChangeLog.gz usr/share/doc/p7zip/changelog.gz
+
--- p7zip-9.20.1~dfsg.1.orig/debian/patches/01_makefile.patch
+++ p7zip-9.20.1~dfsg.1/debian/patches/01_makefile.patch
@@ -0,0 +1,324 @@
+Index: p7zip-9.20.1~dfsg.1/makefile
+===================================================================
+--- p7zip-9.20.1~dfsg.1.orig/makefile	2011-12-17 06:19:16.000000000 +0000
++++ p7zip-9.20.1~dfsg.1/makefile	2011-12-17 06:19:16.000000000 +0000
+@@ -68,7 +68,6 @@
+ common7z:common
+ 	$(MKDIR) bin/Codecs
+ 	$(MAKE) -C CPP/7zip/Bundles/Format7zFree all
+-	$(MAKE) -C CPP/7zip/Compress/Rar         all
+ 
+ 7z: common7z
+ 	$(MAKE) -C CPP/7zip/UI/Console           all
+@@ -93,7 +92,6 @@
+ 	$(MAKE) -C CPP/7zip/UI/FileManager       clean
+ 	$(MAKE) -C CPP/7zip/UI/GUI               clean
+ 	$(MAKE) -C CPP/7zip/Bundles/Format7zFree clean
+-	$(MAKE) -C CPP/7zip/Compress/Rar         clean
+ 	$(MAKE) -C CPP/7zip/Compress/LZMA_Alone  clean
+ 	$(MAKE) -C CPP/7zip/Bundles/AloneGCOV    clean
+ 	$(MAKE) -C CPP/7zip/TEST/TestUI          clean
+Index: p7zip-9.20.1~dfsg.1/makefile.machine
+===================================================================
+--- p7zip-9.20.1~dfsg.1.orig/makefile.machine	2011-12-17 06:19:16.000000000 +0000
++++ p7zip-9.20.1~dfsg.1/makefile.machine	2011-12-17 06:19:16.000000000 +0000
+@@ -4,17 +4,19 @@
+ 
+ OPTFLAGS=-O
+ 
+-ALLFLAGS=${OPTFLAGS} -pipe -s \
++ALLFLAGS=${OPTFLAGS} -pipe \
+     	-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+ 	-DNDEBUG -D_REENTRANT -DENV_UNIX \
+ 	-D_7ZIP_LARGE_PAGES \
+ 	$(LOCAL_FLAGS)
+ 
+-CXX=g++ $(ALLFLAGS)
++CXX=g++ $(ALLFLAGS) -DENV_HAVE_GCCVISIBILITYPATCH -fvisibility=hidden -fvisibility-inlines-hidden
+ CC=gcc $(ALLFLAGS)
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+ 
++PRE_COMPILED_HEADER=StdAfx.h.gch
++
+ LOCAL_LIBS=-lpthread
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+ 
+Index: p7zip-9.20.1~dfsg.1/CPP/7zip/UI/FileManager/makefile.depend
+===================================================================
+--- p7zip-9.20.1~dfsg.1/CPP/7zip/UI/FileManager/makefile.depend	2011-04-01 20:14:01.000000000 +0100
++++ p7zip-9.20.1~dfsg.1.new/CPP/7zip/UI/FileManager/makefile.depend	2011-12-17 09:59:13.000000000 +0000
+@@ -445,7 +445,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -589,7 +589,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -751,7 +751,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1090,7 +1090,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1644,7 +1644,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1848,7 +1848,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1969,7 +1969,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2096,7 +2096,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2244,7 +2244,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2365,7 +2365,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2488,7 +2488,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2613,7 +2613,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2734,7 +2734,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -3367,7 +3367,7 @@
+  ../../../Common/MyString.h ../../../Common/MyVector.h \
+  /usr/include/wx-2.8/wx/config.h /usr/include/wx-2.8/wx/confbase.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -3408,7 +3408,7 @@
+  ../../../Common/Defs.h ../../../Windows/Defs.h \
+  ../../../Windows/../Common/MyWindows.h /usr/include/wx-2.8/wx/clipbrd.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -3439,7 +3439,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -3547,7 +3547,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -3660,7 +3660,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+Index: p7zip-9.20.1~dfsg.1/CPP/7zip/UI/GUI/makefile.depend
+===================================================================
+--- p7zip-9.20.1~dfsg.1/CPP/7zip/UI/GUI/makefile.depend	2011-04-01 20:14:01.000000000 +0100
++++ p7zip-9.20.1~dfsg.1.new/CPP/7zip/UI/GUI/makefile.depend	2011-12-17 09:33:25.000000000 +0000
+@@ -42,7 +42,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include//gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -173,7 +173,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -312,7 +312,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -581,7 +581,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1396,7 +1396,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1522,7 +1522,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1652,7 +1652,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -1776,7 +1776,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2293,7 +2293,7 @@
+  ../../../Common/MyString.h ../../../Common/MyVector.h \
+  /usr/include/wx-2.8/wx/config.h /usr/include/wx-2.8/wx/confbase.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2333,7 +2333,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2441,7 +2441,7 @@
+  ../../../include_windows/windows.h ../../../include_windows/basetyps.h \
+  ../../../include_windows/tchar.h /usr/include/wx-2.8/wx/wxprec.h \
+  /usr/include/wx-2.8/wx/defs.h /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
+@@ -2554,7 +2554,7 @@
+  ../../../include_windows/basetyps.h ../../../include_windows/tchar.h \
+  /usr/include/wx-2.8/wx/wxprec.h /usr/include/wx-2.8/wx/defs.h \
+  /usr/include/wx-2.8/wx/platform.h \
+- /usr/lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
++ /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wx/include/gtk2-unicode-release-2.8/wx/setup.h \
+  /usr/include/wx-2.8/wx/chkconf.h /usr/include/wx-2.8/wx/features.h \
+  /usr/include/wx-2.8/wx/version.h /usr/include/wx-2.8/wx/cpp.h \
+  /usr/include/wx-2.8/wx/dlimpexp.h /usr/include/wx-2.8/wx/debug.h \
--- p7zip-9.20.1~dfsg.1.orig/debian/patches/02_man.patch
+++ p7zip-9.20.1~dfsg.1/debian/patches/02_man.patch
@@ -0,0 +1,110 @@
+Index: p7zip-9.20.1~dfsg.1/man1/7z.1
+===================================================================
+--- p7zip-9.20.1~dfsg.1.orig/man1/7z.1	2011-08-03 12:39:44.000000000 +0200
++++ p7zip-9.20.1~dfsg.1/man1/7z.1	2011-08-03 12:39:51.000000000 +0200
+@@ -10,7 +10,7 @@
+ .BR <ARGUMENTS>...
+ .PP
+ .SH DESCRIPTION
+-7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
++7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), LZMA2, XZ, ZIP, Zip64, CAB, RAR (if the non-free p7zip-rar package is installed), ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, most filesystem images and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
+ .TP
+ 7z uses plugins to handle archives.
+ .PP
+@@ -55,7 +55,7 @@
+ don't store symlinks; store the files/directories they point to (CAUTION : the scanning stage can never end because of recursive symlinks like 'ln \-s .. ldir')
+ .TP
+ .B \-m{Parameters}
+-Set Compression Method (see {DEST_SHARE_DOC}/MANUAL/switches/method.htm for a list of methods)
++Set Compression Method (see /usr/share/doc/p7zip-full/DOCS/MANUAL/switches/method.htm for a list of methods)
+ .TP
+ .B \-mhe=on|off
+ 7z format only : enables or disables archive header encryption (Default : off)
+@@ -168,7 +168,7 @@
+ 7za(1), 7zr(1), bzip2(1), gzip(1), zip(1)
+ .PP
+ .SH "HTML Documentation"
+-{DEST_SHARE_DOC}/MANUAL/index.htm
++/usr/share/doc/p7zip-full/DOCS/MANUAL/index.htm
+ .SH AUTHOR
+ .TP
+ Written for Debian by Mohammed Adnene Trojette.
+Index: p7zip-9.20.1~dfsg.1/man1/7za.1
+===================================================================
+--- p7zip-9.20.1~dfsg.1.orig/man1/7za.1	2011-08-03 12:39:45.000000000 +0200
++++ p7zip-9.20.1~dfsg.1/man1/7za.1	2011-08-03 12:40:25.000000000 +0200
+@@ -10,9 +10,9 @@
+ .BR <ARGUMENTS>...
+ .PP
+ .SH DESCRIPTION
+-7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
++7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), LZMA2, XZ, ZIP, Zip64, CAB, RAR (if the non-free p7zip-rar package is installed), ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, most filesystem images and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
+ .TP
+-7za is a stand-alone executable. 7za handles less archive formats than 7z, but does not need any others.
++7za is a stand-alone executable. 7za handles less archive formats than 7z.
+ .PP
+ .SH FUNCTION LETTERS
+ .TP
+@@ -55,7 +55,7 @@
+ don't store symlinks; store the files/directories they point to (CAUTION : the scanning stage can never end because of recursive symlinks like 'ln \-s .. ldir')
+ .TP
+ .B \-m{Parameters}
+-Set Compression Method (see {DEST_SHARE_DOC}/MANUAL/switches/method.htm for a list of methods)
++Set Compression Method (see /usr/share/doc/p7zip-full/DOCS/MANUAL/switches/method.htm for a list of methods)
+ .TP
+ .B \-mhe=on|off
+ 7z format only : enables or disables archive header encryption (Default : off)
+@@ -168,7 +168,7 @@
+ 7z(1), 7zr(1), bzip2(1), gzip(1), zip(1)
+ .PP
+ .SH "HTML Documentation"
+-{DEST_SHARE_DOC}/MANUAL/index.htm
++/usr/share/doc/p7zip-full/DOCS/MANUAL/index.htm
+ .SH AUTHOR
+ .TP
+ Written for Debian by Mohammed Adnene Trojette.
+Index: p7zip-9.20.1~dfsg.1/man1/7zr.1
+===================================================================
+--- p7zip-9.20.1~dfsg.1.orig/man1/7zr.1	2011-08-03 12:39:44.000000000 +0200
++++ p7zip-9.20.1~dfsg.1/man1/7zr.1	2011-08-03 12:40:39.000000000 +0200
+@@ -10,9 +10,9 @@
+ .BR <ARGUMENTS>...
+ .PP
+ .SH DESCRIPTION
+-7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
++7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), LZMA2, XZ, ZIP, Zip64, CAB, RAR (if the non-free p7zip-rar package is installed), ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, most filesystem images and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
+ .TP
+-7zr is a stand-alone executable. 7zr handles less archive formats than 7z, but does not need any others. 7zr is a "light-version" of 7za that only handles 7z archives.
++7zr is a stand-alone executable. 7zr handles less archive formats than 7z. 7zr is a "light-version" of 7za that only handles 7z archives.
+ .PP
+ .SH FUNCTION LETTERS
+ .TP
+@@ -55,7 +55,7 @@
+ don't store symlinks; store the files/directories they point to (CAUTION : the scanning stage can never end because of recursive symlinks like 'ln \-s .. ldir')
+ .TP
+ .B \-m{Parameters}
+-Set Compression Method (see {DEST_SHARE_DOC}/MANUAL/switches/method.htm for a list of methods)
++Set Compression Method (see /usr/share/doc/p7zip/DOCS/MANUAL/switches/method.htm for a list of methods)
+ .TP
+ .B \-mhe=on|off
+ 7z format only : enables or disables archive header encryption (Default : off)
+@@ -117,8 +117,8 @@
+ 
+ .LP
+ On Linux/Unix, in order to backup directories you must use tar :
+- \- to backup a directory  : tar cf - directory | 7zr a -si directory.tar.7z
+- \- to restore your backup : 7zr x -so directory.tar.7z | tar xf -
++ \- to backup a directory  : tar cf \- directory | 7zr a \-si directory.tar.7z
++ \- to restore your backup : 7zr x \-so directory.tar.7z | tar xf \-
+ 
+ If you want to send files and directories (not the owner of file)
+ to others Unix/MacOS/Windows users, you can use the 7-zip format.
+@@ -165,7 +165,7 @@
+ 7z(1), 7za(1), bzip2(1), gzip(1), zip(1)
+ .PP
+ .SH "HTML Documentation"
+-{DEST_SHARE_DOC}/MANUAL/index.htm
++/usr/share/doc/p7zip/DOCS/MANUAL/index.htm
+ .SH AUTHOR
+ .TP
+ Written for Debian by Mohammed Adnene Trojette.
--- p7zip-9.20.1~dfsg.1.orig/debian/patches/03_respect-umask.diff
+++ p7zip-9.20.1~dfsg.1/debian/patches/03_respect-umask.diff
@@ -0,0 +1,68 @@
+Index: p7zip-4.44~dfsg.1/CPP/Windows/FileDir.cpp
+===================================================================
+--- p7zip-4.44~dfsg.1.orig/CPP/Windows/FileDir.cpp	2007-04-10 00:26:22.000000000 +0200
++++ p7zip-4.44~dfsg.1/CPP/Windows/FileDir.cpp	2007-04-10 00:26:25.000000000 +0200
+@@ -18,6 +18,7 @@
+ 
+ #include <sys/stat.h> // mkdir
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #include <fcntl.h>
+ 
+ #include <utime.h>
+@@ -332,6 +333,13 @@
+     }
+   }
+ 
++  mode_t user_mask = umask(0);
++  // This is a race condition. Any parallel thread or forked process at
++  // this point gets an undesirable umask. The correct fix is to remove
++  // all chmod calls from the code, and determine permissions before files
++  // are open()ed or mkdir()ed.
++  umask(user_mask);
++
+   if (fileAttributes & FILE_ATTRIBUTE_UNIX_EXTENSION) {
+      stat_info.st_mode = fileAttributes >> 16;
+ #ifdef HAVE_LSTAT
+@@ -343,11 +351,11 @@
+      } else
+ #endif
+      if (S_ISREG(stat_info.st_mode)) {
+-       chmod(name,stat_info.st_mode);
++       chmod(name,stat_info.st_mode & ~user_mask);
+      } else if (S_ISDIR(stat_info.st_mode)) {
+        // user/7za must be able to create files in this directory
+        stat_info.st_mode |= (S_IRUSR | S_IWUSR | S_IXUSR);
+-       chmod(name,stat_info.st_mode);
++       chmod(name,stat_info.st_mode & ~user_mask);
+      }
+ #ifdef HAVE_LSTAT
+   } else if (!S_ISLNK(stat_info.st_mode)) {
+@@ -365,7 +373,7 @@
+       stat_info.st_mode |= (0600 | ((stat_info.st_mode & 044) >> 1)) ;
+     }
+ 
+-    chmod(name,stat_info.st_mode);
++    chmod(name,stat_info.st_mode & ~user_mask);
+   }
+   TRACEN((printf("MySetFileAttributes(%s,%d) : true\n",name,fileAttributes)))
+ 
+Index: p7zip-4.44~dfsg.1/CPP/myWindows/myAddExeFlag.cpp
+===================================================================
+--- p7zip-4.44~dfsg.1.orig/CPP/myWindows/myAddExeFlag.cpp	2007-04-10 00:26:43.000000000 +0200
++++ p7zip-4.44~dfsg.1/CPP/myWindows/myAddExeFlag.cpp	2007-04-10 00:27:15.000000000 +0200
+@@ -13,9 +13,13 @@
+ 
+ void myAddExeFlag(LPCTSTR filename)
+ {
++	struct stat fileinfo;
+ 	const char * name = nameWindowToUnix(filename);
+ 	// printf("myAddExeFlag(%s)\n",name);
+-	chmod(name,0777);
++        // should detect error, but this interface gives no capability to do so
++        stat(name, &fileinfo);
++        mode_t filemode = fileinfo.st_mode;
++        chmod(name, filemode | S_IXUSR | S_IXGRP | S_IXOTH);
+ }
+ 
+ void myAddExeFlag(const UString &u_name)
--- p7zip-9.20.1~dfsg.1.orig/debian/patches/04_no_strip_by_default.diff
+++ p7zip-9.20.1~dfsg.1/debian/patches/04_no_strip_by_default.diff
@@ -0,0 +1,13 @@
+Index: p7zip-9.20.1~dfsg.1/makefile.linux_any_cpu_gcc_4.X
+===================================================================
+--- p7zip-9.20.1~dfsg.1.orig/makefile.linux_any_cpu_gcc_4.X	2011-04-01 21:34:28.000000000 +0200
++++ p7zip-9.20.1~dfsg.1/makefile.linux_any_cpu_gcc_4.X	2011-04-01 21:35:11.000000000 +0200
+@@ -4,7 +4,7 @@
+ 
+ OPTFLAGS=-O
+ 
+-ALLFLAGS=${OPTFLAGS} -pipe -s \
++ALLFLAGS=${OPTFLAGS} -pipe \
+     	-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+ 	-DNDEBUG -D_REENTRANT -DENV_UNIX \
+ 	-D_7ZIP_LARGE_PAGES \
--- p7zip-9.20.1~dfsg.1.orig/debian/patches/CVE-2015-1038.patch
+++ p7zip-9.20.1~dfsg.1/debian/patches/CVE-2015-1038.patch
@@ -0,0 +1,315 @@
+Author: Ben Hutchings <ben@decadent.org.uk>
+Date: Tue, 19 May 2015 02:38:40 +0100
+Description: Delay creation of symlinks to prevent arbitrary file writes (CVE-2015-1038)
+Bug: http://sourceforge.net/p/p7zip/bugs/147/
+Bug-Debian: https://bugs.debian.org/774660
+
+Alexander Cherepanov discovered that 7zip is susceptible to a
+directory traversal vulnerability.  While extracting an archive, it
+will extract symlinks and then follow them if they are referenced in
+further entries.  This can be exploited by a rogue archive to write
+files outside the current directory.
+
+We have to create placeholder files (which we already do) and delay
+creating symlinks until the end of extraction.
+
+Due to the possibility of anti-items (deletions) in the archive, it is
+possible for placeholders to be deleted and replaced before we create
+the symlinks.  It's not clear that this can be used for mischief, but
+GNU tar guards against similar problems by checking that the placeholder
+still exists and is the same inode.  XXX It also checks 'birth time' but
+this isn't portable.  We can probably get away with comparing ctime
+since we don't support hard links.
+
+--- a/CPP/7zip/UI/Agent/Agent.cpp
++++ b/CPP/7zip/UI/Agent/Agent.cpp
+@@ -424,6 +424,8 @@ STDMETHODIMP CAgentFolder::Extract(const
+   CMyComPtr<IArchiveExtractCallback> extractCallback = extractCallbackSpec;
+   UStringVector pathParts;
+   CProxyFolder *currentProxyFolder = _proxyFolderItem;
++  HRESULT res;
++
+   while (currentProxyFolder->Parent)
+   {
+     pathParts.Insert(0, currentProxyFolder->Name);
+@@ -445,8 +447,11 @@ STDMETHODIMP CAgentFolder::Extract(const
+       (UInt64)(Int64)-1);
+   CUIntVector realIndices;
+   GetRealIndices(indices, numItems, realIndices);
+-  return _agentSpec->GetArchive()->Extract(&realIndices.Front(),
++  res = _agentSpec->GetArchive()->Extract(&realIndices.Front(),
+       realIndices.Size(), testMode, extractCallback);
++  if (res == S_OK && !extractCallbackSpec->CreateSymLinks())
++    res = E_FAIL;
++  return res;
+   COM_TRY_END
+ }
+ 
+--- a/CPP/7zip/UI/Agent/ArchiveFolder.cpp
++++ b/CPP/7zip/UI/Agent/ArchiveFolder.cpp
+@@ -20,6 +20,8 @@ STDMETHODIMP CAgentFolder::CopyTo(const
+   CMyComPtr<IArchiveExtractCallback> extractCallback = extractCallbackSpec;
+   UStringVector pathParts;
+   CProxyFolder *currentProxyFolder = _proxyFolderItem;
++  HRESULT res;
++
+   while (currentProxyFolder->Parent)
+   {
+     pathParts.Insert(0, currentProxyFolder->Name);
+@@ -46,8 +48,11 @@ STDMETHODIMP CAgentFolder::CopyTo(const
+       (UInt64)(Int64)-1);
+   CUIntVector realIndices;
+   GetRealIndices(indices, numItems, realIndices);
+-  return _agentSpec->GetArchive()->Extract(&realIndices.Front(),
++  res = _agentSpec->GetArchive()->Extract(&realIndices.Front(),
+       realIndices.Size(), BoolToInt(false), extractCallback);
++  if (res == S_OK && !extractCallbackSpec->CreateSymLinks())
++    res = E_FAIL;
++  return res;
+   COM_TRY_END
+ }
+ 
+--- a/CPP/7zip/UI/Client7z/Client7z.cpp
++++ b/CPP/7zip/UI/Client7z/Client7z.cpp
+@@ -197,8 +197,11 @@ private:
+   COutFileStream *_outFileStreamSpec;
+   CMyComPtr<ISequentialOutStream> _outFileStream;
+ 
++  CObjectVector<NWindows::NFile::NDirectory::CDelayedSymLink> _delayedSymLinks;
++
+ public:
+   void Init(IInArchive *archiveHandler, const UString &directoryPath);
++  bool CreateSymLinks();
+ 
+   UInt64 NumErrors;
+   bool PasswordIsDefined;
+@@ -392,11 +395,22 @@ STDMETHODIMP CArchiveExtractCallback::Se
+   }
+   _outFileStream.Release();
+   if (_extractMode && _processedFileInfo.AttribDefined)
+-    NFile::NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attrib);
++    NFile::NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attrib, &_delayedSymLinks);
+   PrintNewLine();
+   return S_OK;
+ }
+ 
++bool CArchiveExtractCallback::CreateSymLinks()
++{
++  bool success = true;
++
++  for (int i = 0; i != _delayedSymLinks.Size(); ++i)
++    success &= _delayedSymLinks[i].Create();
++
++  _delayedSymLinks.Clear();
++
++  return success;
++}
+ 
+ STDMETHODIMP CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password)
+ {
+--- a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
++++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
+@@ -453,12 +453,24 @@ STDMETHODIMP CArchiveExtractCallback::Se
+     NumFiles++;
+ 
+   if (_extractMode && _fi.AttribDefined)
+-    NFile::NDirectory::MySetFileAttributes(_diskFilePath, _fi.Attrib);
++    NFile::NDirectory::MySetFileAttributes(_diskFilePath, _fi.Attrib, &_delayedSymLinks);
+   RINOK(_extractCallback2->SetOperationResult(operationResult, _encrypted));
+   return S_OK;
+   COM_TRY_END
+ }
+ 
++bool CArchiveExtractCallback::CreateSymLinks()
++{
++  bool success = true;
++
++  for (int i = 0; i != _delayedSymLinks.Size(); ++i)
++    success &= _delayedSymLinks[i].Create();
++
++  _delayedSymLinks.Clear();
++
++  return success;
++}
++
+ /*
+ STDMETHODIMP CArchiveExtractCallback::GetInStream(
+     const wchar_t *name, ISequentialInStream **inStream)
+--- a/CPP/7zip/UI/Common/ArchiveExtractCallback.h
++++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.h
+@@ -6,6 +6,8 @@
+ #include "Common/MyCom.h"
+ #include "Common/Wildcard.h"
+ 
++#include "Windows/FileDir.h"
++
+ #include "../../IPassword.h"
+ 
+ #include "../../Common/FileStreams.h"
+@@ -83,6 +85,8 @@ class CArchiveExtractCallback:
+   UInt64 _packTotal;
+   UInt64 _unpTotal;
+ 
++  CObjectVector<NWindows::NFile::NDirectory::CDelayedSymLink> _delayedSymLinks;
++
+   void CreateComplexDirectory(const UStringVector &dirPathParts, UString &fullPath);
+   HRESULT GetTime(int index, PROPID propID, FILETIME &filetime, bool &filetimeIsDefined);
+   HRESULT GetUnpackSize();
+@@ -138,6 +142,7 @@ public:
+       const UStringVector &removePathParts,
+       UInt64 packSize);
+ 
++  bool CreateSymLinks();
+ };
+ 
+ #endif
+--- a/CPP/7zip/UI/Common/Extract.cpp
++++ b/CPP/7zip/UI/Common/Extract.cpp
+@@ -96,6 +96,9 @@ static HRESULT DecompressArchive(
+   else
+     result = archive->Extract(&realIndices.Front(), realIndices.Size(), testMode, extractCallbackSpec);
+ 
++  if (result == S_OK && !extractCallbackSpec->CreateSymLinks())
++    result = E_FAIL;
++
+   return callback->ExtractResult(result);
+ }
+ 
+--- a/CPP/Windows/FileDir.cpp
++++ b/CPP/Windows/FileDir.cpp
+@@ -453,9 +453,10 @@ bool SetDirTime(LPCWSTR fileName, const
+ }
+ 
+ #ifndef _UNICODE
+-bool MySetFileAttributes(LPCWSTR fileName, DWORD fileAttributes)
++bool MySetFileAttributes(LPCWSTR fileName, DWORD fileAttributes,
++			 CObjectVector<CDelayedSymLink> *delayedSymLinks)
+ {  
+-  return MySetFileAttributes(UnicodeStringToMultiByte(fileName, CP_ACP), fileAttributes);
++  return MySetFileAttributes(UnicodeStringToMultiByte(fileName, CP_ACP), fileAttributes, delayedSymLinks);
+ }
+ 
+ bool MyRemoveDirectory(LPCWSTR pathName)
+@@ -488,7 +489,8 @@ static int convert_to_symlink(const char
+   return -1;
+ }
+ 
+-bool MySetFileAttributes(LPCTSTR fileName, DWORD fileAttributes)
++bool MySetFileAttributes(LPCTSTR fileName, DWORD fileAttributes,
++			 CObjectVector<CDelayedSymLink> *delayedSymLinks)
+ {
+   if (!fileName) {
+     SetLastError(ERROR_PATH_NOT_FOUND);
+@@ -520,7 +522,9 @@ bool MySetFileAttributes(LPCTSTR fileNam
+      stat_info.st_mode = fileAttributes >> 16;
+ #ifdef ENV_HAVE_LSTAT
+      if (S_ISLNK(stat_info.st_mode)) {
+-        if ( convert_to_symlink(name) != 0) {
++        if (delayedSymLinks)
++          delayedSymLinks->Add(CDelayedSymLink(name));
++        else if ( convert_to_symlink(name) != 0) {
+           TRACEN((printf("MySetFileAttributes(%s,%d) : false-3\n",name,fileAttributes)))
+           return false;
+         }
+@@ -924,4 +928,41 @@ bool CTempDirectory::Create(LPCTSTR pref
+ }
+ 
+ 
++#ifdef ENV_UNIX
++
++CDelayedSymLink::CDelayedSymLink(LPCSTR source)
++  : _source(source)
++{
++  struct stat st;
++
++  if (lstat(_source, &st) == 0) {
++    _dev = st.st_dev;
++    _ino = st.st_ino;
++  } else {
++    _dev = 0;
++  }
++}
++
++bool CDelayedSymLink::Create()
++{
++  struct stat st;
++
++  if (_dev == 0) {
++    errno = EPERM;
++    return false;
++  }
++  if (lstat(_source, &st) != 0)
++    return false;
++  if (_dev != st.st_dev || _ino != st.st_ino) {
++    // Placeholder file has been overwritten or moved by another
++    // symbolic link creation
++    errno = EPERM;
++    return false;
++  }
++
++  return convert_to_symlink(_source) == 0;
++}
++
++#endif // ENV_UNIX
++
+ }}}
+--- a/CPP/Windows/FileDir.h
++++ b/CPP/Windows/FileDir.h
+@@ -4,6 +4,7 @@
+ #define __WINDOWS_FILEDIR_H
+ 
+ #include "../Common/MyString.h"
++#include "../Common/MyVector.h"
+ #include "Defs.h"
+ 
+ /* GetFullPathName for 7zAES.cpp */
+@@ -13,11 +14,15 @@ namespace NWindows {
+ namespace NFile {
+ namespace NDirectory {
+ 
++class CDelayedSymLink;
++
+ bool SetDirTime(LPCWSTR fileName, const FILETIME *creationTime, const FILETIME *lastAccessTime, const FILETIME *lastWriteTime);
+ 
+-bool MySetFileAttributes(LPCTSTR fileName, DWORD fileAttributes);
++bool MySetFileAttributes(LPCTSTR fileName, DWORD fileAttributes,
++			 CObjectVector<CDelayedSymLink> *delayedSymLinks = 0);
+ #ifndef _UNICODE
+-bool MySetFileAttributes(LPCWSTR fileName, DWORD fileAttributes);
++bool MySetFileAttributes(LPCWSTR fileName, DWORD fileAttributes,
++			 CObjectVector<CDelayedSymLink> *delayedSymLinks = 0);
+ #endif
+ 
+ bool MyMoveFile(LPCTSTR existFileName, LPCTSTR newFileName);
+@@ -80,6 +85,31 @@ public:
+   bool Remove();
+ };
+ 
++// Symbolic links must be created last so that they can't be used to
++// create or overwrite files above the extraction directory.
++class CDelayedSymLink
++{
++#ifdef ENV_UNIX
++  // Where the symlink should be created.  The target is specified in
++  // the placeholder file.
++  AString _source;
++
++  // Device and inode of the placeholder file.  Before creating the
++  // symlink, we must check that these haven't been changed by creation
++  // of another symlink.
++  dev_t _dev;
++  ino_t _ino;
++
++public:
++  explicit CDelayedSymLink(LPCSTR source);
++  bool Create();
++#else // !ENV_UNIX
++public:
++  CDelayedSymLink(LPCSTR source) {}
++  bool Create() { return true; }
++#endif // ENV_UNIX
++};
++
+ #ifdef _UNICODE
+ typedef CTempFile CTempFileW;
+ #endif
--- p7zip-9.20.1~dfsg.1.orig/debian/patches/series
+++ p7zip-9.20.1~dfsg.1/debian/patches/series
@@ -0,0 +1,4 @@
+04_no_strip_by_default.diff
+01_makefile.patch
+02_man.patch
+CVE-2015-1038.patch
--- p7zip-9.20.1~dfsg.1.orig/debian/rules
+++ p7zip-9.20.1~dfsg.1/debian/rules
@@ -0,0 +1,76 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+build: build-arch build-indep
+build-arch: build-stamp
+build-indep: build-stamp
+
+build-stamp:
+	dh_testdir
+
+	# Add here commands to compile the package.
+	QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
+	cp makefile.machine makefile.machine.bak
+	cp makefile.linux_any_cpu_gcc_4.X makefile.machine
+	$(MAKE) all3
+	cp makefile.machine.bak makefile.machine
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	# Add here commands to clean up after the build process.
+	QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
+	QUILT_PATCHES=debian/patches quilt push -a
+	[ ! -f makefile ] || $(MAKE) clean
+
+	QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
+	rm -rf .pc bin/
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean
+	dh_installdirs
+
+# 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
+	rm -f debian/p7zip-full/usr/share/doc/p7zip-full/DOCS/copying.txt
+	rm -f debian/p7zip/usr/share/doc/p7zip/DOCS/copying.txt
+	rm -f debian/p7zip-full/usr/share/doc/p7zip-full/DOCS/License.txt
+	rm -f debian/p7zip/usr/share/doc/p7zip/DOCS/License.txt
+	dh_install
+	dh_installman -pp7zip-full man1/7z.1 man1/7za.1
+	dh_installman -pp7zip man1/7zr.1 debian/p7zip.1
+	dh_strip
+	dh_compress
+	dh_link -pp7zip-full usr/share/doc/p7zip-full/ChangeLog.gz \
+                             usr/share/doc/p7zip-full/changelog.gz
+	dh_link -pp7zip usr/share/doc/p7zip/ChangeLog.gz \
+                        usr/share/doc/p7zip/changelog.gz
+	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
--- p7zip-9.20.1~dfsg.1.orig/debian/scripts/7z
+++ p7zip-9.20.1~dfsg.1/debian/scripts/7z
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec /usr/lib/p7zip/7z "$@"
--- p7zip-9.20.1~dfsg.1.orig/debian/scripts/7zG
+++ p7zip-9.20.1~dfsg.1/debian/scripts/7zG
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec /usr/lib/p7zip/7zG "$@"
--- p7zip-9.20.1~dfsg.1.orig/debian/scripts/7za
+++ p7zip-9.20.1~dfsg.1/debian/scripts/7za
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec /usr/lib/p7zip/7za "$@"
--- p7zip-9.20.1~dfsg.1.orig/debian/scripts/7zr
+++ p7zip-9.20.1~dfsg.1/debian/scripts/7zr
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec /usr/lib/p7zip/7zr "$@"
--- p7zip-9.20.1~dfsg.1.orig/debian/scripts/p7zip
+++ p7zip-9.20.1~dfsg.1/debian/scripts/p7zip
@@ -0,0 +1,77 @@
+#!/bin/bash
+# gzip-like CLI wrapper for p7zip
+set -e
+
+compress=true
+file=
+
+usage ()
+  {
+    echo "Usage: $0 [-d] [-h|--help] [file]"
+    echo ""
+    echo "    -h print this help"
+    echo "    -d decompress file"
+    echo ""
+    exit 1
+  }
+
+while [ "$#" != "0" ] ; do
+  case "$1" in
+    -d) compress=false ;; # decompressing
+    -c) echo "$0: ignoring $1 option (not yet implemented)" ;;
+    -h|--help|-*) usage ;;
+    *)
+      if [ "${file}" = "" ] ; then
+        file="$1"
+      else
+        usage
+      fi
+    ;;
+  esac
+  shift
+done
+
+# make sure they're present, before we screw up
+for i in mktemp 7zr rm cat tty ; do
+  if ! which $i > /dev/null ; then
+    echo "$0: $i: command not found"
+    exit 1
+  fi
+done
+
+if [ "${file}" != "" ] ; then
+  if ${compress} ; then
+    7zr a "${file}.7z" "${file}"
+    exec rm "${file}"
+  else
+    case "${file}" in
+      *.7z)
+        7zr x "${file}"
+        exec rm "${file}"
+      ;;
+      *)
+        echo "$0: ${file}: unknown suffix -- ignored"
+        exit 0
+      ;;
+    esac
+  fi
+fi
+
+tmp=`mktemp`
+trap "rm -f ${tmp}" 0
+
+if ${compress} ; then
+  if tty -s <&1 >/dev/null ; then
+    echo "$0: compressed data not written to a terminal."
+    echo "For help, type: $0 -h"
+    exit 1
+  fi
+  rm -f ${tmp}
+  7zr a ${tmp} -si >/dev/null
+  cat ${tmp}
+else
+  cat > ${tmp}
+  7zr x ${tmp} -so 2>/dev/null | cat
+fi
+
+exec rm -f ${tmp}
--- p7zip-9.20.1~dfsg.1.orig/debian/source/format
+++ p7zip-9.20.1~dfsg.1/debian/source/format
@@ -0,0 +1 @@
+1.0
--- p7zip-9.20.1~dfsg.1.orig/debian/watch
+++ p7zip-9.20.1~dfsg.1/debian/watch
@@ -0,0 +1,6 @@
+# format version number, currently 3; this line is compulsory!
+version=3
+
+# Line continuations are performed with \
+opts=dversionmangle=s/\.dfsg\.\d+$// \
+ http://qa.debian.org/watch/sf.php/p7zip/p7zip_(.*)_src_all.tar.bz2 debian uupdate
