--- /dev/null
+--- libdvdread-4.1.3.orig/debian/libdvdread-dev.install
++++ libdvdread-4.1.3/debian/libdvdread-dev.install
+@@ -0,0 +1,5 @@
++/usr/bin
++/usr/include
++/usr/lib/*.a
++/usr/lib/*.so
++/usr/lib/pkgconfig
+--- libdvdread-4.1.3.orig/debian/rules
++++ libdvdread-4.1.3/debian/rules
+@@ -0,0 +1,76 @@
++#!/usr/bin/make -f
++
++include /usr/share/quilt/quilt.make
++
++DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
++DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
++
++ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
++ CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
++else
++ CROSS=
++endif
++
++clean: unpatch
++ dh_testdir
++ dh_testroot
++ rm -f build-stamp
++ rm -f config.guess config.sub
++
++ [ ! -f config.mak ] || $(MAKE) distclean
++ rm -f config.h
++
++ dh_clean
++
++config.status: configure2 patch
++ dh_testdir
++
++ifneq "$(wildcard /usr/share/misc/config.guess)" ""
++ cp -f /usr/share/misc/config.guess config.guess
++endif
++ifneq "$(wildcard /usr/share/misc/config.sub)" ""
++ cp -f /usr/share/misc/config.sub config.sub
++endif
++
++ ./configure2 $(CROSS) --prefix=/usr CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
++
++build: build-stamp
++build-stamp: config.status
++ dh_testdir
++
++ $(MAKE)
++
++ touch build-stamp
++
++install: build
++ dh_testdir
++ dh_testroot
++ dh_prep
++ dh_installdirs
++
++ $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
++
++ install -D -m 0755 debian/bug/libdvdread4.script debian/libdvdread4/usr/share/bug/libdvdread4/script
++ install -D -m 0755 debian/bug/libdvdread-dev.script debian/libdvdread-dev/usr/share/bug/libdvdread-dev/script
++
++binary: binary-arch
++
++binary-arch: install
++ dh_testdir
++ dh_testroot
++ dh_installchangelogs ChangeLog
++ dh_installdocs
++ dh_install --fail-missing --sourcedir=debian/tmp
++ dh_strip --dbg-package=libdvdread-dbg
++ dh_compress
++ dh_fixperms
++ dh_makeshlibs
++ dh_installdeb
++ dh_shlibdeps
++ dh_gencontrol
++ dh_md5sums
++ dh_builddeb
++
++binary-indep:
++
++.PHONY: clean build install binary binary-arch binary-indep
+--- libdvdread-4.1.3.orig/debian/compat
++++ libdvdread-4.1.3/debian/compat
+@@ -0,0 +1 @@
++7
+--- libdvdread-4.1.3.orig/debian/libdvdread4.docs
++++ libdvdread-4.1.3/debian/libdvdread4.docs
+@@ -0,0 +1,2 @@
++AUTHORS
++README
+--- libdvdread-4.1.3.orig/debian/control
++++ libdvdread-4.1.3/debian/control
+@@ -0,0 +1,47 @@
++Source: libdvdread
++Section: graphics
++Priority: optional
++Maintainer: Daniel Baumann <daniel@debian.org>
++Build-Depends: debhelper (>= 7), quilt, autotools-dev
++Standards-Version: 3.8.1
++Vcs-Browser: http://git.debian.net/?p=debian/libdvdread.git
++Vcs-Git: git://git.debian.net/git/debian/libdvdread.git
++
++Package: libdvdread4
++Section: libs
++Architecture: any
++Depends: ${shlibs:Depends}, ${misc:Depends}
++Recommends: libdvdnav4
++Suggests: libdvdcss2
++Description: library for reading DVDs
++ libdvdread provides the functionality that is required to access many DVDs. It
++ parses IFO files, reads NAV-blocks, and performs CSS authentication and
++ descrambling.
++ .
++ libdvdread currently uses libdl to dynamically probe for libdvdcss at runtime.
++ If found, libdvdcss will be used to decrypt sections of the DVD as necessary.
++
++Package: libdvdread-dbg
++Section: debug
++Priority: extra
++Architecture: any
++Depends: libdvdread4 (= ${binary:Version}), libdvdread-dev (= ${binary:Version})
++Description: library for reading DVDs (debug)
++ libdvdread provides the functionality that is required to access many DVDs. It
++ parses IFO files, reads NAV-blocks, and performs CSS authentication and
++ descrambling.
++ .
++ This package contains the debugging symbols.
++
++Package: libdvdread-dev
++Section: libdevel
++Architecture: any
++Depends: libdvdread4 (= ${binary:Version}), pkg-config
++Recommends: libdvdnav-dev
++Suggests: libdvdcss-dev
++Description: library for reading DVDs (development)
++ libdvdread provides the functionality that is required to access many DVDs. It
++ parses IFO files, reads NAV-blocks, and performs CSS authentication and
++ descrambling.
++ .
++ This package contains the development files.
+--- libdvdread-4.1.3.orig/debian/libdvdread4.README.Debian
++++ libdvdread-4.1.3/debian/libdvdread4.README.Debian
+@@ -0,0 +1,17 @@
++libdvdread for Debian
++---------------------
++
++Many DVDs use CSS[0]. To play these discs, a special library is needed to decode
++them, libdvdcss. Due to legal problems in some particular countries, Debian does
++not distribute libdvdcss.
++
++If it is legal for you to use CSS in your juristiction, you can:
++
++ * Install the packages from <http://www.debian-unofficial.org/>.
++
++ * Manually download and compile the source code from
++ <http://www.videolan.org/developers/libdvdcss.html>.
++
++ [0] <http://en.wikipedia.org/wiki/Content_Scramble_System>
++
++ -- Daniel Baumann <daniel@debian.org> Sat, 29 Jul 2006 20:03:00 +0200
+--- libdvdread-4.1.3.orig/debian/changelog
++++ libdvdread-4.1.3/debian/changelog
+@@ -0,0 +1,342 @@
++libdvdread (4.1.3-5) unstable; urgency=low
++
++ * Adding patch to fix symbol conflicts with other MD5 implementations
++ (Closes: #522512).
++ * Upgrading package to standards 3.8.1.
++ * Updating section for debug packages.
++
++ -- Daniel Baumann <daniel@debian.org> Sun, 5 Apr 2009 11:46:00 +0200
++
++libdvdread (4.1.3-4) unstable; urgency=low
++
++ * Adding patch from Erik Hovland <erik@hovland.org> to add DVDFileStat
++ (Closes: #515842).
++
++ -- Daniel Baumann <daniel@debian.org> Sat, 28 Feb 2009 08:43:00 +0100
++
++libdvdread (4.1.3-3) unstable; urgency=low
++
++ * Uploading to unstable.
++
++ -- Daniel Baumann <daniel@debian.org> Sun, 15 Feb 2009 18:16:00 +0100
++
++libdvdread (4.1.3-2) experimental; urgency=low
++
++ * Using patch-stamp rather than patch in rules file.
++ * Replacing obsolete dh_clean -k with dh_prep.
++ * Using quilt rather than dpatch.
++ * Removing old homepage location in control file.
++ * Updating year in copyright file.
++ * Making wording in README.Debian more precise.
++ * Updating rules to current state of the art.
++
++ -- Daniel Baumann <daniel@debian.org> Sun, 25 Jan 2009 01:43:00 +0100
++
++libdvdread (4.1.3-1) experimental; urgency=low
++
++ * Updating vcs fields in control file.
++ * Merging upstream version 4.1.3.
++ * Rediffing 01-css.dpatch.
++ * Rediffing 02-kfreebsd.dpatch.
++ * Removing 03-udf.dpatch, went upstream.
++ * Bumping soname major to 4.
++ * Updating rules to new upstream.
++ * Including pkgconfig files.
++ * Correcting permissions of /usr/share/bug/libdvdread-dev/script.
++ * Updating debhelper docs file to new upstream.
++ * Updating cross compiling handling in rules.
++
++ -- Daniel Baumann <daniel@debian.org> Tue, 9 Sep 2008 07:56:00 +0200
++
++libdvdread (0.9.7-11) unstable; urgency=low
++
++ * Adding recomments to libdvdnav-dev in libdvdread-dev.
++ * Removing lintian overrides cruft.
++ * Adding bug scripts for libdvdread3 and libdvdread-dev.
++ * Adding libdvdcss-dev suggests in libdvdread-dev.
++ * Removing libdvdread3-dev provides in libdvdread-dev, eventually not used
++ anymore.
++ * Updating to standards 3.8.0.
++ * Shortening long description of libdvdread-dev.
++
++ -- Daniel Baumann <daniel@debian.org> Wed, 16 Jul 2008 11:34:00 +0200
++
++libdvdread (0.9.7-10) unstable; urgency=low
++
++ * Adding debug package.
++
++ -- Daniel Baumann <daniel@debian.org> Mon, 28 Apr 2008 16:14:00 +0200
++
++libdvdread (0.9.7-9) unstable; urgency=low
++
++ * Reordering rules file.
++ * Using wildcards in install files consistenly.
++ * Sanitizing dpatch series file.
++ * Removing watch file.
++ * Removing old lintian overrides.
++ * Adding link to wikipedia about CSS (Content Scramble System).
++ * Rewriting copyright file in machine-interpretable format.
++ * Adding recommends to libdvdnav4.
++ * Adding vcs fields in control file.
++ * Updating package to debhelper 7.
++ * Removing useless whitespaces from changelog file.
++ * Reverting config.guess and config.sub to upstream.
++
++ -- Daniel Baumann <daniel@debian.org> Mon, 28 Apr 2008 16:08:00 +0200
++
++libdvdread (0.9.7-8) unstable; urgency=low
++
++ * Applied change from Bastian Blank <waldi@debian.org> to improve udf patch.
++
++ -- Daniel Baumann <daniel@debian.org> Fri, 22 Feb 2008 20:32:00 +0100
++
++libdvdread (0.9.7-7) unstable; urgency=low
++
++ * Applied change from Petr Salinger <Petr.Salinger@seznam.cz> to update
++ kfreebsd patch (Closes: #466969).
++
++ -- Daniel Baumann <daniel@debian.org> Fri, 22 Feb 2008 10:21:00 +0100
++
++libdvdread (0.9.7-6) unstable; urgency=low
++
++ * Maintainer upload from the Zürich BSP
++ * Applied patch from Bastian Blank <waldi@debian.org> to adjusts the internal
++ knowledge of the filesize for IFO files in case their size doesn't match
++ with the entry in the UDF fs (Closes: #460400).
++
++ -- Daniel Baumann <daniel@debian.org> Sat, 12 Jan 2008 15:16:00 +0100
++
++libdvdread (0.9.7-5) unstable; urgency=low
++
++ * Updated url to libdvdcss upstream in README.Debian (Closes: #458368).
++
++ -- Daniel Baumann <daniel@debian.org> Sun, 30 Dec 2007 19:19:00 +0100
++
++libdvdread (0.9.7-4) unstable; urgency=low
++
++ * Bumped to new policy.
++ * Using new homepage field in control.
++ * Don't hide make errors in clean target of rules.
++ * Added fail-missing to dh_install call in rules.
++
++ -- Daniel Baumann <daniel@debian.org> Sun, 23 Dec 2007 11:33:00 +0100
++
++libdvdread (0.9.7-3) unstable; urgency=medium
++
++ * Improved wording in README.Debian as suggested by Filipus Klutiero
++ <cheal@hotpop.com> (Closes: #412628).
++ * Bumped to debhelper 5.
++ * Minor cleanups.
++
++ -- Daniel Baumann <daniel@debian.org> Tue, 26 Feb 2007 08:09:00 +0100
++
++libdvdread (0.9.7-2) unstable; urgency=medium
++
++ * Fixed typo in README.Debian (Closes: #396733).
++
++ -- Daniel Baumann <daniel@debian.org> Thu, 2 Nov 2006 19:56:00 +0100
++
++libdvdread (0.9.7-1) unstable; urgency=low
++
++ * New upstream release.
++
++ -- Daniel Baumann <daniel@debian.org> Fri, 6 Oct 2006 23:08:00 +0200
++
++libdvdread (0.9.6-5) unstable; urgency=low
++
++ * Removed install-css.sh which is useless since we have binary packages
++ on debian-unofficial.org (Closes: #390544).
++
++ -- Daniel Baumann <daniel@debian.org> Sun, 1 Oct 2006 22:04:00 +0200
++
++libdvdread (0.9.6-4) unstable; urgency=low
++
++ * Made install-css.sh executable as suggested by
++ Sarah Hobbs <hobbsee@ubuntu.com>.
++
++ -- Daniel Baumann <daniel@debian.org> Tue, 1 Aug 2006 10:27:00 +0200
++
++libdvdread (0.9.6-3) unstable; urgency=low
++
++ * Hrm, to bad... I forgot to change the email in control :(
++
++ -- Daniel Baumann <daniel@debian.org> Sat, 29 Jul 2006 20:25:00 +0200
++
++libdvdread (0.9.6-2) unstable; urgency=low
++
++ * New email address.
++ * Bumped policy version.
++ * Updated README.Debian, refering to debian-unofficial.org (Closes: #374383).
++
++ -- Daniel Baumann <daniel@debian.org> Sat, 29 Jul 2006 20:03:00 +0200
++
++libdvdread (0.9.6-1) unstable; urgency=low
++
++ * New upstream release:
++ - With libdvdread 0.9.4, the UDFFindFile symbol was exportet unintenionally.
++ Since then, the only software known which did depend on it, is dvdbackup.
++ With 0.9.5, this symbol was removed, therefore dvdbackup failed to work.
++ Now, in 0.9.6, there are some changes made to give dvdbackup the desired
++ information in a saner way (Closes: #364972, #365332, #365620).
++
++ -- Daniel Baumann <daniel.baumann@panthera-systems.net> Wed, 3 May 2006 21:07:00 +0100
++
++libdvdread (0.9.5-3) unstable; urgency=low
++
++ * Added patch to export UDFFindFile (Closes: #364972).
++
++ -- Daniel Baumann <daniel.baumann@panthera-systems.net> Thu, 26 Apr 2006 15:19:00 +0100
++
++libdvdread (0.9.5-2) unstable; urgency=low
++
++ * Added compatiblity Provides: for libdvdread3-dev (Closes: #364719).
++
++ -- Daniel Baumann <daniel.baumann@panthera-systems.net> Fri, 25 Apr 2006 15:51:00 +0100
++
++libdvdread (0.9.5-1) unstable; urgency=low
++
++ * New upstream release:
++ - proper UTF-8 handling in IFO (Closes: #246165).
++ - uses updated libtool (Closes: #272516).
++ * New maintainer (Closes: #361295).
++ * Acknoledge NMU (Closes: #314896).
++ * Remade debian directory:
++ - added a watch file.
++ - renamed libdvdread3-dev to the proper name libdvdread-dev.
++ - using dpatch for patches management.
++ * Added amd64 to install-css.sh (Closes: #329725).
++ * Added patch to support kFreeBSD (Closes: #272499).
++
++ -- Daniel Baumann <daniel.baumann@panthera-systems.net> Fri, 7 Apr 2006 21:39:00 +0200
++
++libdvdread (0.9.4-5.1) unstable; urgency=medium
++
++ * Non-maintainer upload.
++ * Drop the debconf code from the package; it's useless without a
++ debconf templates file to go with it. Closes: #314896.
++
++ -- Steve Langasek <vorlon@debian.org> Sat, 9 Jul 2005 01:58:40 -0700
++
++libdvdread (0.9.4-5) unstable; urgency=low
++
++ * Update french README, thanks to barbier@linuxfr.org.
++ * Fix spelling in README, thanks to Thomas Schoepf (Closes: #232360).
++ * Bump standards-version to 3.6.1, no change.
++
++ -- Mikael Hedin <micce@debian.org> Tue, 13 Jul 2004 14:27:30 +0200
++
++libdvdread (0.9.4-4) unstable; urgency=low
++
++ * Adjust section to libdevel.
++ * Remove libdvdread3.template, info is in README.Debian (Closes: #221591).
++ * Add text in README.Debian about possible use of css (Closes: #223961).
++
++ -- Mikael Hedin <micce@debian.org> Thu, 15 Jan 2004 16:00:55 +0100
++
++libdvdread (0.9.4-3) unstable; urgency=low
++
++ * Move text about css into README.Debian* (closes: #154659). Added a
++ runtime notice if libdvdcss is not found.
++ * Update libtool etc (closes: #190229).
++
++ -- Mikael Hedin <micce@debian.org> Tue, 29 Apr 2003 15:20:06 +0200
++
++libdvdread (0.9.4-2) unstable; urgency=low
++
++ * Removed two blank lines in changelog, it made dpkg-gencontrol upset
++ (closes: #186315).
++
++ -- Mikael Hedin <micce@debian.org> Thu, 27 Mar 2003 22:35:10 +0100
++
++libdvdread (0.9.4-1) unstable; urgency=low
++
++ * New upstream release
++ * Check if libdvdcss is installed before whining (closes: #157939).
++ * Suggest wget and check in the script (closes: #180488)
++ * Only ship the intended header files (closes: #159296).
++ * Added italian template from fabbione@fabbione.net, thanks.
++
++ -- Mikael Hedin <micce@debian.org> Fri, 7 Mar 2003 22:15:50 +0100
++
++libdvdread2 (0.9.3-2) unstable; urgency=low
++
++ * Use the upstream configure (enable the use of large file images).
++ * Copy config.* files automagic.
++
++ -- Mikael Hedin <micce@debian.org> Mon, 26 Aug 2002 19:51:47 +0200
++
++libdvdread2 (0.9.3-1) unstable; urgency=low
++
++ * New upstream version (closes: #151708).
++ * Adopt the package with permission from wolfie.
++ * Fixed typo in description (closes: #150674).
++ * Put info etc about css in this package instead of ogle.
++
++ -- Mikael Hedin <micce@debian.org> Sat, 27 Jul 2002 13:57:19 +0200
++
++libdvdread2 (0.9.2-0.1) unstable; urgency=low
++
++ * New upstream version (closes: #116870, #119581).
++ * NMU with permission from wolfie.
++ * Removed ldconfig from postinst and use dh_makeshlibs.
++
++ -- Mikael Hedin <micce@debian.org> Tue, 18 Dec 2001 16:08:19 +0100
++
++libdvdread2 (0.9.1-5) unstable; urgency=low
++
++ * Doh, actually close/fix 116929 (Closes: #116929)
++
++ -- Brian Russo <wolfie@debian.org> Thu, 1 Nov 2001 12:21:23 -1000
++
++libdvdread2 (0.9.1-4) unstable; urgency=low
++
++ * add casts to fix bugs in dvd_reader.c (Closes: #116828)
++ * Fix auto* more mess (Closes: #116927)
++ * Revert build-dep to 'regular' automake since 1.4 was epoch'ed
++ * (Closes: #114884)
++
++ -- Brian Russo <wolfie@debian.org> Sun, 28 Oct 2001 10:10:29 -1000
++
++libdvdread2 (0.9.1-3) unstable; urgency=low
++
++ * We're not worthy.. we're not worthy...
++ * Add automake build-dep
++
++ -- Brian Russo <wolfie@debian.org> Wed, 17 Oct 2001 10:03:52 -1000
++
++libdvdread2 (0.9.1-2) unstable; urgency=low
++
++ * New branch (so2) due to incompatible API/ABI (Closes: #113407)
++ * Use libdvdread1 for older stuff..
++ * Should fix sparc problems (Closes: #110589)
++ * Thanks to Eduard Bloch
++
++ -- Brian Russo <wolfie@debian.org> Sat, 6 Oct 2001 18:41:14 -1000
++
++libdvdread (0.9.1-1) unstable; urgency=low
++
++ * New upstream version
++ * Added URI (Closes: #113157, #112291)
++ * Fixed sparc re configure.in (Closes: #110589)
++ * Fix binary-arch target in rules (Closes: #112248, #112979)
++
++ -- Brian Russo <wolfie@debian.org> Sun, 23 Sep 2001 15:21:24 -1000
++
++libdvdread (0.8.0-3) unstable; urgency=low
++
++ * Fix ia64 issue with patch supplied by tausq (see #104646).
++
++ -- Brian Russo <wolfie@debian.org> Tue, 28 Aug 2001 10:57:40 -1000
++
++libdvdread (0.8.0-2) unstable; urgency=medium
++
++ * Fixed make distclean problem. (closes: #103485, #103595, #104646)
++ * Corrected shlibs (closes: #109739)
++
++ -- Brian Russo <wolfie@debian.org> Sun, 26 Aug 2001 10:45:40 -1000
++
++libdvdread (0.8.0-1) unstable; urgency=low
++
++ * Initial Release.
++
++ -- Brian Russo <wolfie@debian.org> Sat, 30 Jun 2001 01:10:54 +1100
+--- libdvdread-4.1.3.orig/debian/copyright
++++ libdvdread-4.1.3/debian/copyright
+@@ -0,0 +1,46 @@
++Author: Bjorn Englund <d4bjorn@dtek.chalmers.se>
++Download: http://www.dtek.chalmers.se/~dvd/
++
++Files: *
++Copyright:
++ (C) 2000-2001 Bjorn Englund <d4bjorn@dtek.chalmers.se>
++ (C) 2000-2001 Hakan Hjort <d95hjort@dtek.chalmers.se>
++ (C) 2000-2001 Billy Biggs <vektor@dumbterm.net>
++ (C) 2000-2001 Christian Wolff <scarabaeus@convergence.de>
++License: GPL-2+
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License
++ as published by the Free Software Foundation; either version 2
++ 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 General Public License for more details.
++ .
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ .
++ On Debian systems, the complete text of the GNU General Public License
++ can be found in /usr/share/common-licenses/GPL-2 file.
++
++Files: debian/*
++Copyright: (C) 2006-2009 Daniel Baumann <daniel@debian.org>
++License: GPL-2+
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License
++ as published by the Free Software Foundation; either version 2
++ 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 General Public License for more details.
++ .
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ .
++ On Debian systems, the complete text of the GNU General Public License
++ can be found in /usr/share/common-licenses/GPL-2 file.
+--- libdvdread-4.1.3.orig/debian/libdvdread-dev.docs
++++ libdvdread-4.1.3/debian/libdvdread-dev.docs
+@@ -0,0 +1,3 @@
++AUTHORS
++DEVELOPMENT-POLICY.txt
++TODO
+--- libdvdread-4.1.3.orig/debian/libdvdread4.shlibs
++++ libdvdread-4.1.3/debian/libdvdread4.shlibs
+@@ -0,0 +1 @@
++libdvdread 4 libdvdread4 (>= 4.1.3)
+--- libdvdread-4.1.3.orig/debian/libdvdread4.install
++++ libdvdread-4.1.3/debian/libdvdread4.install
+@@ -0,0 +1 @@
++/usr/lib/*.so.*
+--- libdvdread-4.1.3.orig/debian/patches/02-kfreebsd.patch
++++ libdvdread-4.1.3/debian/patches/02-kfreebsd.patch
+@@ -0,0 +1,15 @@
++Author: Aurelien Jarno <aurel32@debian.org>
++Description: Adds support for Debian GNU/kFreeBSD.
++
++diff -Naurp libdvdread.orig/src/dvd_reader.c libdvdread/src/dvd_reader.c
++--- libdvdread.orig/src/dvd_reader.c 2008-09-06 21:55:51.000000000 +0000
+++++ libdvdread/src/dvd_reader.c 2008-09-09 05:26:20.000000000 +0000
++@@ -51,7 +51,7 @@ static inline int _private_gettimeofday(
++ #define lseek64 _lseeki64
++ #endif
++
++-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
+++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
++ #define SYS_BSD 1
++ #endif
++
+--- libdvdread-4.1.3.orig/debian/patches/04-md5-symbols.patch
++++ libdvdread-4.1.3/debian/patches/04-md5-symbols.patch
+@@ -0,0 +1,22 @@
++Author: Daniel Baumann <daniel@debian.org>
++Description: Fixing symbol conflicts with other MD5 implementations (Closes: #522512).
++
++diff -Naurp libdvdread.orig/src/md5.h libdvdread/src/md5.h
++--- libdvdread.orig/src/md5.h 2008-06-01 15:16:10.000000000 +0000
+++++ libdvdread/src/md5.h 2009-04-05 09:42:30.000000000 +0000
++@@ -21,6 +21,15 @@
++ #ifndef _MD5_H
++ #define _MD5_H 1
++
+++/* Change function names to prevent symbol conflicts */
+++#define md5_init_ctx _DVD_md5_init_ctx
+++#define md5_process_block _DVD_md5_process_block
+++#define md5_process_bytes _DVD_md5_process_bytes
+++#define md5_finish_ctx _DVD_md5_finish_ctx
+++#define md5_read_ctx _DVD_md5_read_ctx
+++#define md5_stream _DVD_md5_stream
+++#define md5_buffer _DVD_md5_buffer
+++
++ #include <stdio.h>
++
++ #if defined HAVE_LIMITS_H || _LIBC
+--- libdvdread-4.1.3.orig/debian/patches/01-libdvdcss.patch
++++ libdvdread-4.1.3/debian/patches/01-libdvdcss.patch
+@@ -0,0 +1,22 @@
++Author: Daniel Baumann <daniel@debian.org>
++Description: Print information about the CSS README.
++
++diff -Naurp libdvdread.orig/src/dvd_input.c libdvdread/src/dvd_input.c
++--- libdvdread.orig/src/dvd_input.c 2008-09-06 21:55:51.000000000 +0000
+++++ libdvdread/src/dvd_input.c 2008-09-09 05:31:07.000000000 +0000
++@@ -348,7 +348,14 @@ int dvdinput_setup(void)
++ return 1;
++
++ } else {
++- fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");
+++ fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n"
+++ "************************************************\n"
+++ "** **\n"
+++ "** No css library available. See **\n"
+++ "** /usr/share/doc/libdvdread4/README.Debian **\n"
+++ "** for more information. **\n"
+++ "** **\n"
+++ "************************************************\n");
++
++ /* libdvdcss replacement functions */
++ dvdinput_open = file_open;
+--- libdvdread-4.1.3.orig/debian/patches/03-dvdfilestat.patch
++++ libdvdread-4.1.3/debian/patches/03-dvdfilestat.patch
+@@ -0,0 +1,240 @@
++Author: Erik Hovland <erik@hovland.org>
++Description: Adding DVDFileStat and dvd_stat_t, see http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/2009-February/000986.html (Closes: #515842).
++
++diff -Naurp libdvdread.orig/src/dvd_reader.c libdvdread/src/dvd_reader.c
++--- libdvdread.orig/src/dvd_reader.c 2008-10-19 14:34:33.000000000 +0000
+++++ libdvdread/src/dvd_reader.c 2009-02-28 07:37:39.000000000 +0000
++@@ -889,6 +889,187 @@ void DVDCloseFile( dvd_file_t *dvd_file
++ }
++ }
++
+++static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title,
+++ int menu, dvd_stat_t *statbuf)
+++{
+++ char filename[ MAX_UDF_FILE_NAME_LEN ];
+++ uint32_t size;
+++ off_t tot_size;
+++ off_t parts_size[9];
+++ int nr_parts = 0;
+++ int n;
+++
+++ if( title == 0 ) {
+++ sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
+++ } else {
+++ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
+++ }
+++ if(!UDFFindFile( dvd, filename, &size )) {
+++ return -1;
+++ }
+++ tot_size = size;
+++ nr_parts = 1;
+++ parts_size[0] = size;
+++
+++ if( !menu ) {
+++ int cur;
+++
+++ for( cur = 2; cur < 10; cur++ ) {
+++ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
+++ if( !UDFFindFile( dvd, filename, &size ) ) {
+++ break;
+++ }
+++ parts_size[nr_parts] = size;
+++ tot_size += size;
+++ nr_parts++;
+++ }
+++ }
+++
+++ statbuf->size = tot_size;
+++ statbuf->nr_parts = nr_parts;
+++ for(n = 0; n < nr_parts; n++) {
+++ statbuf->parts_size[n] = parts_size[n];
+++ }
+++ return 0;
+++}
+++
+++
+++static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
+++ int menu, dvd_stat_t *statbuf )
+++{
+++ char filename[ MAX_UDF_FILE_NAME_LEN ];
+++ char full_path[ PATH_MAX + 1 ];
+++ struct stat fileinfo;
+++ off_t tot_size;
+++ off_t parts_size[9];
+++ int nr_parts = 0;
+++ int n;
+++
+++
+++
+++ if( title == 0 ) {
+++ sprintf( filename, "VIDEO_TS.VOB" );
+++ } else {
+++ sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
+++ }
+++ if( !findDVDFile( dvd, filename, full_path ) ) {
+++ return -1;
+++ }
+++
+++ if( stat( full_path, &fileinfo ) < 0 ) {
+++ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
+++ return -1;
+++ }
+++
+++
+++ tot_size = fileinfo.st_size;
+++ nr_parts = 1;
+++ parts_size[0] = fileinfo.st_size;
+++
+++ if( !menu ) {
+++ int cur;
+++
+++ for( cur = 2; cur < 10; cur++ ) {
+++
+++ sprintf( filename, "VTS_%02d_%d.VOB", title, cur );
+++ if( !findDVDFile( dvd, filename, full_path ) ) {
+++ break;
+++ }
+++
+++ if( stat( full_path, &fileinfo ) < 0 ) {
+++ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
+++ break;
+++ }
+++
+++ parts_size[nr_parts] = fileinfo.st_size;
+++ tot_size += parts_size[nr_parts];
+++ nr_parts++;
+++ }
+++ }
+++
+++ statbuf->size = tot_size;
+++ statbuf->nr_parts = nr_parts;
+++ for(n = 0; n < nr_parts; n++) {
+++ statbuf->parts_size[n] = parts_size[n];
+++ }
+++ return 0;
+++}
+++
+++
+++int DVDFileStat(dvd_reader_t *dvd, int titlenum,
+++ dvd_read_domain_t domain, dvd_stat_t *statbuf)
+++{
+++ char filename[ MAX_UDF_FILE_NAME_LEN ];
+++ char full_path[ PATH_MAX + 1 ];
+++ struct stat fileinfo;
+++ uint32_t size;
+++
+++ /* Check arguments. */
+++ if( dvd == NULL || titlenum < 0 ) {
+++ errno = EINVAL;
+++ return -1;
+++ }
+++
+++ switch( domain ) {
+++ case DVD_READ_INFO_FILE:
+++ if( titlenum == 0 ) {
+++ sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
+++ } else {
+++ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
+++ }
+++ break;
+++ case DVD_READ_INFO_BACKUP_FILE:
+++ if( titlenum == 0 ) {
+++ sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
+++ } else {
+++ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
+++ }
+++ break;
+++ case DVD_READ_MENU_VOBS:
+++ if( dvd->isImageFile ) {
+++ return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf );
+++ } else {
+++ return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf );
+++ }
+++ break;
+++ case DVD_READ_TITLE_VOBS:
+++ if( titlenum == 0 ) {
+++ return -1;
+++ }
+++ if( dvd->isImageFile ) {
+++ return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf );
+++ } else {
+++ return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf );
+++ }
+++ break;
+++ default:
+++ fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" );
+++ errno = EINVAL;
+++ return -1;
+++ }
+++
+++ if( dvd->isImageFile ) {
+++ if( UDFFindFile( dvd, filename, &size ) ) {
+++ statbuf->size = size;
+++ statbuf->nr_parts = 1;
+++ statbuf->parts_size[0] = size;
+++ return 0;
+++ }
+++ } else {
+++ if( findDVDFile( dvd, filename, full_path ) ) {
+++ if( stat( full_path, &fileinfo ) < 0 ) {
+++ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
+++ } else {
+++ statbuf->size = fileinfo.st_size;
+++ statbuf->nr_parts = 1;
+++ statbuf->parts_size[0] = statbuf->size;
+++ return 0;
+++ }
+++ }
+++ }
+++ return -1;
+++}
+++
++ /* Internal, but used from dvd_udf.c */
++ int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
++ size_t block_count, unsigned char *data,
++diff -Naurp libdvdread.orig/src/dvd_reader.h libdvdread/src/dvd_reader.h
++--- libdvdread.orig/src/dvd_reader.h 2008-10-19 14:34:33.000000000 +0000
+++++ libdvdread/src/dvd_reader.h 2009-02-28 07:37:39.000000000 +0000
++@@ -115,6 +115,42 @@ typedef enum {
++ } dvd_read_domain_t;
++
++ /**
+++ *
+++ */
+++typedef struct {
+++ off_t size; /**< Total size of file in bytes */
+++ int nr_parts; /**< Number of file parts */
+++ off_t parts_size[9]; /**< Size of each part in bytes */
+++} dvd_stat_t;
+++
+++/**
+++ * Stats a file on the DVD given the title number and domain.
+++ * The information about the file is stored in a dvd_stat_t
+++ * which contains information about the size of the file and
+++ * the number of parts in case of a multipart file and the respective
+++ * sizes of the parts.
+++ * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB
+++ * The size of VTS_02_1.VOB will be stored in stat->parts_size[0],
+++ * VTS_02_2.VOB in stat->parts_size[1], ...
+++ * The total size (sum of all parts) is stored in stat->size and
+++ * stat->nr_parts will hold the number of parts.
+++ * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files.
+++ *
+++ * This function is only of use if you want to get the size of each file
+++ * in the filesystem. These sizes are not needed to use any other
+++ * functions in libdvdread.
+++ *
+++ * @param dvd A dvd read handle.
+++ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
+++ * @param domain Which domain.
+++ * @param stat Pointer to where the result is stored.
+++ * @return If successful 0, otherwise -1.
+++ *
+++ * int DVDFileStat(dvd, titlenum, domain, stat);
+++ */
+++int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *);
+++
+++/**
++ * Opens a file on the DVD given the title number and domain.
++ *
++ * If the title number is 0, the video manager information is opened
+--- libdvdread-4.1.3.orig/debian/patches/series
++++ libdvdread-4.1.3/debian/patches/series
+@@ -0,0 +1,4 @@
++01-libdvdcss.patch
++02-kfreebsd.patch
++03-dvdfilestat.patch
++04-md5-symbols.patch
+--- libdvdread-4.1.3.orig/debian/bug/libdvdread-dev.script
++++ libdvdread-4.1.3/debian/bug/libdvdread-dev.script
+@@ -0,0 +1,3 @@
++#!/bin/sh
++
++dpkg -l libdvdread-dev libdvdnav-dev libdvdcss-dev
+--- libdvdread-4.1.3.orig/debian/bug/libdvdread4.script
++++ libdvdread-4.1.3/debian/bug/libdvdread4.script
+@@ -0,0 +1,3 @@
++#!/bin/sh
++
++dpkg -l libdvdread4 libdvdnav4 libdvdcss2