--- cdrtools-2.01+01a01.orig/debian/cdrecord.install
+++ cdrtools-2.01+01a01/debian/cdrecord.install
@@ -0,0 +1,8 @@
+debian/tmp/usr/bin/cdrecord*
+debian/tmp/usr/bin/readcd
+debian/tmp/usr/sbin/rscsi
+debian/tmp/usr/share/man/man1/readcd.1
+debian/tmp/usr/share/man/man1/cdrecord.1
+debian/README.DVD.Debian usr/share/doc/cdrecord/
+debian/README.ATAPI.setup.ubuntu usr/share/doc/cdrecord/
+
--- cdrtools-2.01+01a01.orig/debian/cdrecord.dirs
+++ cdrtools-2.01+01a01/debian/cdrecord.dirs
@@ -0,0 +1,4 @@
+etc/default
+etc/cdrecord
+usr/share/bug/cdrecord
+
--- cdrtools-2.01+01a01.orig/debian/README.ATAPI.setup.ubuntu
+++ cdrtools-2.01+01a01/debian/README.ATAPI.setup.ubuntu
@@ -0,0 +1,20 @@
+Howto setup an ATAPI CD-RW/DVD+-RW recorder on Ubuntu
+=====================================================
+
+If you have just one CD burner in your computer, burning should work
+out of the box, since there should be a symbolic link /dev/cdrw which
+points to your actual CD burner (e. g. /dev/hdb). If the link is not
+present or you want to use a different burner device as default, you
+can configure the device in /etc/default/cdrecord:
+
+  CDR_DEVICE=/dev/hdd
+
+would configure the default device to be /dev/hdd, i. e. the slave
+device on the secondary IDE bus.
+
+You can always override this default setting with cdrecord's "dev"
+option:
+
+  cdrecord dev=/dev/hdc ...
+
+Only users who are in the group "cdrom" are able to burn CDs.
--- cdrtools-2.01+01a01.orig/debian/copyright
+++ cdrtools-2.01+01a01/debian/copyright
@@ -0,0 +1,217 @@
+This package was first debianized by Erik Andersen andersee@debian.org. The
+current debian maintainer is Joerg Jaspert <joerg@debian.org>
+
+Co-Maintainer: Eduard Bloch
+
+It was downloaded from ftp://ftp.berlios.de/pub/cdrecord/
+HomePage is at:
+http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
+
+Upstream authors: Joerg Schilling <js@cs.tu-berlin.de> and others.
+
+The package contains also parts of zisofs-tools, downloaded from
+ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/.
+
+Upstream Author: H. Peter Anvin <hpa@zytor.com>
+
+Copyright:
+----------------------------------------------------------------------------
+* cdrecord -- Record data on a CD-Recorder
+  Copyright (c) 1995-2004 J. Schilling
+  License: GPLv2 with the following additional requirement:
+-       You may not modify certain copyright messages in cdrecord.c
+        See cdrecord.c for further information.
+
+-       You may (with a few exceptions) not modify the location of the
+        configuration file /etc/default/cdrecord.
+        See defaults.c for further information.
+
+cdrecord.c says (but see below):
+------------------------------------------
+|   Warning: you are not allowed to modify or to remove the
+|   Copyright and version printing code below!
+|   See also GPL § 2 subclause c)
+|  
+|   If you modify cdrecord you need to include additional version
+|   printing code that:
+|  
+|  	-	Clearly states that the current version is an
+|  		inofficial (modified) version and thus may have bugs
+|  		that are not present in the original.
+|  
+|  	-	Print your support e-mail address and tell people that
+|  		you will do complete support for this version of
+|  		cdrecord.
+|  
+|  		Or clearly state that there is absolutely no support
+|  		for the modified version you did create.
+|  
+|  	-	Tell the users not to ask the original author for
+|  		help.
+|  
+|   This limitation definitely also applies when you use any other
+|   cdrecord release together with libscg-0.6 or later, or when you
+|   use any amount of code from cdrecord-1.11a17 or later.
+|   In fact, it applies to any version of cdrecord, see also
+|   GPL Preamble, subsection 6.
+|  
+|   I am sorry for the inconvenience but I am forced to do this because
+|   some people create inofficial branches. These branches create
+|   problems but the initiators do not give support and thus cause the
+|   development of the official cdrecord versions to slow down because
+|   I am loaded with unneeded work.
+|  
+|   Please note that this is a memorandum on how I interpret the GPL.
+|   If you use/modify/redistribute cdrecord, you need to accept it
+|   this way.
+|   
+|  
+|   The above statement is void if there has been neither a new version
+|   of cdrecord nor a new version of star from the original author
+|   within more then a year.
+------------------------------------------
+
+For that Andreas Metzler had a mail conversation with Joerg, the last
+and important mail is included below, except an unrelated part I
+removed. Its in german, translation follows after the original mail.
+------------------------------------------------------------
+From: Joerg Schilling <schilling@fokus.fraunhofer.de>
+Subject: Re: Geaendertes Copyright in a36
+To: ametzler@logic.univie.ac.at
+Date: Thu, 19 Aug 2004 18:10:31 +0200
+
+>From ametzler@logic.univie.ac.at  Thu Aug 19 18:04:42 2004
+
+[...]
+>und im Rahmen des Zulaessigen[1].
+
+>Darf ich nochmal nachbohren: linuxcheck() faellt auch nicht unter
+>"you are not allowed to modify or to remove the Copyright and version
+>printing code below!"?
+
+Darf geaendert werden. und ich habe auch absichtlich ein "Loch" gelassen, so
+dasz jemand den uname() Test mit einem automatischen Patch versehen kann.
+
+Jörg
+
+-- 
+ EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
+       js@cs.tu-berlin.de		(uni)  If you don't have iso-8859-1
+       schilling@fokus.fraunhofer.de	(work) chars I am J"org Schilling
+ URL:  http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
+------------------------------------------------------------
+
+And now the english translation of the mail above. Only content:
+------------------------------------------------------------
+Andreas asks:
+Let me ask again: linuxcheck() is not restricted with
+"you are not allowed to modify or to remove the Copyright and version
+printing code below!"?
+
+Jörg answers:
+It is allowed to change this and I have a "gap" there intentionally, so
+one can change the uname() check with an automated patch.
+------------------------------------------------------------
+
+Thats not a Debian-specific license and it only leaves the version
+printing stuff in cdrecord.c. Which is allowed from GPL.
+
+defaults.c says:
+------------------------------------------
+ | WARNING you are only allowed to change this filename if you also
+ | change the documentation and add a statement that makes clear
+ | where the official location of the file is why you did choose a
+ | nonstandard location and that the nonstandard location only refers
+ | to unofficial cdrecord versions.
+ |
+ | I was forced to add this because some people change cdrecord without
+ | rational reason and then publish the result. As those people
+ | don't contribute work and don't give support, they are causing extra
+ | work for me and this way slow down the cdrecord development.
+------------------------------------------
+* cdda2wav 
+  Copyright 1998-2003 Heiko Eissfeldt
+  parts    (C) Peter Widow
+  parts    (C) Thomas Niederreiter
+  parts    (C) RSA Data Security, Inc.
+  License: GPLv2
+ 
+* mkisofs
+  Written by Eric Youngdale (1993).
+  Copyright 1993 Yggdrasil Computing, Incorporated
+  Copyright (c) 1999,2000-2004 J. Schilling
+  APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 22/2/2000
+  License: GPLv2
+
+* libedc compact disc reed-solomon routines
+ (c) 1998-2002 by Heiko Eissfeldt, heiko@colossus.escape.de
+ (c) 2002 by Joerg Schilling
+  License: GPLv2
+
+libfile - code from file(1)
+ (c) Ian F. Darwin, 1987
+ License
+ | This software is not subject to any license of the American Telephone
+ | and Telegraph Company or of the Regents of the University of California.
+ |
+ | Permission is granted to anyone to use this software for any purpose on
+ | any computer system, and to alter it and redistribute it freely, subject
+ | to the following restrictions:
+ |
+ | 1. The author is not responsible for the consequences of use of this
+ |    software, no matter how awful, even if they arise from flaws in it.
+ |
+ | 2. The origin of this software must not be misrepresented, either by
+ |    explicit claim or by omission.  Since few users ever read sources,
+ |    credits must appear in the documentation.
+ |
+ | 3. Altered versions must be plainly marked as such, and must not be
+ |    misrepresented as being the original software.  Since few users
+ |    ever read sources, credits must appear in the documentation.
+ |
+ | 4. This notice may not be removed or altered.
+
+libhfs_iso - Modified version of libhfs (v2.0) to work with mkhybrid.
+ (C) 1996, 1997 Robert Leslie
+  License: GPLv2
+
+libcdparanoia
+ (C) by Monty (xiphmont@mit.edu)
+ Modifications to make the code portable Copyright (c) 2002 J. Schilling
+  License: GPLv2
+
+readcd
+  Copyright (c) 1987, 1995-2003 J. Schilling
+  License: GPLv2
+
+*
+ *
+ * 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; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+
+---
+
+Copyright of zisofs-tools:
+Copyright 2001 H. Peter Anvin - All Rights Reserved
+ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version; incorporated herein by reference.
+
+=====================================================================
+=====================================================================
+Note that the complete text of the GNU General Public License is available in
+/usr/share/common-licenses/GPL on a Debian system.
--- cdrtools-2.01+01a01.orig/debian/cdrtools-doc.install
+++ cdrtools-2.01+01a01/debian/cdrtools-doc.install
@@ -0,0 +1,22 @@
+cdda2wav/Frontends usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/HOWTOUSE usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/NEEDED usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/OtherProgs usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/README usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/THANKS usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/TODO usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/cdda_links usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/tracknames.pl usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/tracknames.txt usr/share/doc/cdrtools-doc/cdda2wav/
+cdda2wav/FAQ usr/share/doc/cdrtools-doc/cdda2wav/
+README* usr/share/doc/cdrtools-doc/cdrecord/
+ABOUT usr/share/doc/cdrtools-doc/
+AN* usr/share/doc/cdrtools-doc/
+START usr/share/doc/cdrtools-doc/cdrecord/
+PORTING usr/share/doc/cdrtools-doc/
+doc/cdrecord.ps usr/share/doc/cdrtools-doc/cdrecord/
+mkisofs/README* usr/share/doc/cdrtools-doc/mkisofs/
+mkisofs/TODO usr/share/doc/cdrtools-doc/mkisofs/
+debian/README.silo usr/share/doc/cdrtools-doc/mkisofs/
+zisofs_tools/README.zisofs usr/share/doc/cdrtools-doc/mkisofs/
+zisofs_tools/zisofs.magic usr/share/doc/cdrtools-doc/mkisofs/
--- cdrtools-2.01+01a01.orig/debian/rules
+++ cdrtools-2.01+01a01/debian/rules
@@ -0,0 +1,241 @@
+#!/usr/bin/make -f
+#
+# debian/rules file for cdrtools.  GPL2
+# Original from Erik Andersen <andersee@debian.org>
+#
+
+PACKAGE = cdrtools
+
+COPTX = -g
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+COPTX += -O0
+else
+COPTX += -O2
+endif
+
+include /usr/share/dpatch/dpatch.make
+
+i=$(shell pwd)/debian/tmp/usr
+b=$(shell pwd)/debian/build
+iso=mkisofs
+cdd=cdda2wav
+cdr=cdrecord
+ziso_VERSION = $(shell cat zisofs_tools/version)
+source_VERSION= $(shell dpkg-parsechangelog | sed -ne '/^Version:/s/^V.*://p')
+
+ifeq ($(dvd),yes)
+dvdclean=unapplydvd
+dvdbuild=applydvd-stamp
+endif
+
+applydvd-stamp:
+	@if test -e debian/patched/06_dautipps.dpatch ; then \
+	debian/patches/06_dautipps.dpatch -unpatch && \
+	rm -f debian/patched/06_dautipps.dpatch; \
+	fi
+	@if test -e debian/patched/07_noadvertising.dpatch ; then \
+	debian/patches/07_noadvertising.dpatch -unpatch && \
+	rm -f debian/patched/07_noadvertising.dpatch; \
+	fi
+	@if test -e debian/patched/17_argv0_beautify.dpatch ; then \
+	debian/patches/17_argv0_beautify.dpatch -unpatch && \
+	rm -f debian/patched/17_argv0_beautify.dpatch; \
+	fi
+	@chmod +x debian/patches/07_dvdsup.dpatch && \
+	debian/patches/07_dvdsup.dpatch -patch && \
+	touch applydvd-stamp
+
+unapplydvd:
+	@if test -e applydvd-stamp ; then \
+	chmod +x debian/patches/07_dvdsup.dpatch ; \
+	debian/patches/07_dvdsup.dpatch -unpatch ; \
+	rm -f applydvd-stamp ; \
+	fi
+
+build: patch $(dvdbuild) build-debstamp
+build-debstamp: cdrecord.mmap
+	if test -f ../cdrtools_$(source_VERSION).tar.gz ; then \
+		echo "You should not create native packages! Remove ../cdrtools_$(source_VERSION).tar.gz and copy upstream source to .orig.tar.gz" ; \
+		exit 1 ; \
+	fi
+	@echo "--- Compiling"
+	dh_testdir
+	cp /usr/share/misc/config.sub /usr/share/misc/config.guess conf
+	echo "#define ZISOFS_TOOLS_VERSION \"$(ziso_VERSION)\"" > zisofs_tools/version.h
+
+	smake COPTX='-DUSE_USGSHM $(COPTX)' INS_BASE=/usr
+
+	# work around a build system bug
+	touch mkisofs/write.c
+	cd mkisofs && make 
+
+	touch build-debstamp
+
+cdrecord.mmap:
+	@echo "--- Compiling cdrecord mmap variant"
+	dh_testdir
+	cp /usr/share/misc/config.sub /usr/share/misc/config.guess conf
+	smake COPTX='$(COPTX)' INS_BASE=/usr
+	mv `find cdrecord/OBJ/ -name cdrecord -type f` cdrecord.mmap
+	smake COPTX='$(COPTX)' INS_BASE=/usr clean
+
+clean: unpatch $(dvdclean)
+	@echo "--- Cleaning"
+	dh_testdir
+	dh_testroot
+	-rm -rf debian/patched
+	-rm -rf cdrecord-1.8.1_de-doc_0.1
+	-./.clean
+	rm -f build-debstamp install-debstamp conf/config.sub conf/config.guess
+	dh_clean -k
+	 # clean up the stuff dh_clean leaves behind
+	-rm -rf debian/build debian/files
+	-rm -f `find . -type d | grep OBJ`
+	-rm -f `find . -type d | grep CVS`
+	-rm -f `find . -name "*~"`
+	-rm -rf `find . -name "\.deps"`
+	-rm -rf `find . -name "\.libs"`
+	-rm -rf `find . -name "*\.rej"`
+	-rm -rf zisofs_tools
+	-rm -f cdrecord.mmap
+
+install: build install-debstamp
+install-debstamp:
+	@echo "--- Installing"
+	dh_testdir
+	dh_testroot
+	dh_clean
+	rm -rf $(b)
+	smake install INS_BASE=$(i) MANDIR=share/man
+
+	mv $(i)/bin/cdrecord $(i)/bin/cdrecord.shm
+	install -m 755 cdrecord.mmap $(i)/bin/
+	install -m 755 debian/cdrecord.wrapper $(i)/bin/cdrecord
+
+	install -m 755 cdda2wav/cdda2ogg $(i)/bin/
+	install -m 755 cdda2wav/cdda2mp3 $(i)/bin/
+	install -m 755 cdda2wav/readmult $(i)/bin/
+	install -m 755 cdda2wav/pitchplay $(i)/bin/
+	touch install-debstamp
+
+install-save: install
+	rm -rf $(i).saved
+	cp -a $(i) $(i).saved
+
+install-saved:
+	rm -rf $(i)
+	cp -a $(i).saved $(i)
+	rm -rf $(b)
+	touch install-debstamp
+
+binary-indep: build install cdrtools-doc
+
+binary-arch: build install \
+	cdrecord \
+	mkisofs \
+	cdda2wav
+
+#
+# cdrecord
+#
+
+cdrecord: install
+	@echo "--- Building: $@"
+	dh_installdirs 		 -p$@ -P$(b)/$@ 
+	cp -a cdrecord/cdrecord.dfl $(b)/$@/etc/default/cdrecord
+	cp -a rscsi/rscsi.dfl $(b)/$@/etc/default/rscsi
+	cp debian/reportbug.presubj $(b)/$@/usr/share/bug/cdrecord/presubj
+ifeq ($(dvd),yes)
+	install -m755 debian/dvd.reportbug $(b)/$@/usr/share/bug/cdrecord/script
+endif
+	dh_link              -p$@ -P$(b)/$@ 
+	dh_installdocs       -p$@ -P$(b)/$@
+	dh_installchangelogs -p$@ -P$(b)/$@ Changelog
+	dh_install			 -p$@ -P$(b)/$@
+	dh_strip             -p$@ -P$(b)/$@
+	dh_installexamples   -p$@ -P$(b)/$@ rscsi/rscsi.dfl cdrecord/cdrecord.dfl
+	dh_compress          -p$@ -P$(b)/$@
+	dh_fixperms          -p$@ -P$(b)/$@
+	dh_installdeb        -p$@ -P$(b)/$@
+	dh_shlibdeps         -p$@ -P$(b)/$@
+	dh_installdebconf    -p$@ -P$(b)/$@
+	dh_gencontrol        -p$@ -P$(b)/$@
+	dh_makeshlibs        -p$@ -P$(b)/$@ -V
+	dh_md5sums           -p$@ -P$(b)/$@
+	dh_builddeb          -p$@ -P$(b)/$@
+
+
+#
+# mkisofs
+#
+
+mkisofs: install
+	@echo "--- Building: $@"
+	dh_installdirs 		 -p$@ -P$(b)/$@ 
+	dh_installdocs       -p$@ -P$(b)/$@
+	dh_installchangelogs -p$@ -P$(b)/$@ $(iso)/ChangeLog zisofs_tools/CHANGES
+	dh_install           -p$@ -P$(b)/$@
+	dh_installman        -p$@ -P$(b)/$@ debian/dirsplit.1
+	cp debian/reportbug.presubj $(b)/$@/usr/share/bug/mkisofs/presubj
+	rm -f $(b)/$@/usr/bin/mkhybrid $(b)/$@/usr/share/man/man8/mkhybrid*
+	dh_link              -p$@ -P$(b)/$@
+	dh_strip             -p$@ -P$(b)/$@
+	dh_compress          -p$@ -P$(b)/$@
+	dh_fixperms          -p$@ -P$(b)/$@
+	dh_installdeb        -p$@ -P$(b)/$@
+	dh_shlibdeps         -p$@ -P$(b)/$@
+	dh_gencontrol        -p$@ -P$(b)/$@
+	dh_makeshlibs        -p$@ -P$(b)/$@ -V
+	dh_md5sums           -p$@ -P$(b)/$@
+	dh_builddeb          -p$@ -P$(b)/$@
+
+
+#
+# cdda2wav
+#
+
+cdda2wav: install
+	@echo "--- Building: $@"
+	dh_installdirs 		 -p$@ -P$(b)/$@ 
+	dh_installdocs       -p$@ -P$(b)/$@ 
+	dh_installchangelogs -p$@ -P$(b)/$@ 
+	dh_install           -p$@ -P$(b)/$@
+	cp debian/reportbug.presubj $(b)/$@/usr/share/bug/cdda2wav/presubj
+	dh_strip             -p$@ -P$(b)/$@
+	chmod 755 $(b)/$@/usr/bin/cdda2*
+	dh_link              -p$@ -P$(b)/$@
+	chmod 755 $(b)/$@/usr/bin/readmult
+	chmod 755 $(b)/$@/usr/bin/pitchplay
+	dh_installman        -p$@ -P$(b)/$@
+	dh_compress          -p$@ -P$(b)/$@
+	dh_fixperms          -p$@ -P$(b)/$@
+	dh_installdeb        -p$@ -P$(b)/$@
+	dh_shlibdeps         -p$@ -P$(b)/$@
+	dh_gencontrol        -p$@ -P$(b)/$@
+	dh_makeshlibs        -p$@ -P$(b)/$@ -V
+	dh_md5sums           -p$@ -P$(b)/$@
+	dh_builddeb          -p$@ -P$(b)/$@
+
+
+#
+# cdrtools-doc
+#
+
+cdrtools-doc: install
+	@echo "--- Building: $@"
+	dh_installdirs 		 -p$@ -P$(b)/$@ 
+	dh_installdocs       -p$@ -P$(b)/$@
+	dh_installchangelogs -p$@ -P$(b)/$@
+	dh_install           -p$@ -P$(b)/$@
+	dh_link              -p$@ -P$(b)/$@
+	dh_strip             -p$@ -P$(b)/$@
+	dh_compress          -p$@ -P$(b)/$@
+	dh_fixperms          -p$@ -P$(b)/$@
+	dh_installdeb        -p$@ -P$(b)/$@
+	dh_shlibdeps         -p$@ -P$(b)/$@
+	dh_gencontrol        -p$@ -P$(b)/$@
+	dh_md5sums           -p$@ -P$(b)/$@
+	dh_builddeb          -p$@ -P$(b)/$@
+
+binary: binary-indep binary-arch
+.PHONY: binary clean binary-indep binary-arch build install install-save install-saved patch unpatch unapplydvd
--- cdrtools-2.01+01a01.orig/debian/reportbug.presubj
+++ cdrtools-2.01+01a01/debian/reportbug.presubj
@@ -0,0 +1,23 @@
+Reporting Bugs to one of the cdrtools packages:
+-----------------------------------------------
+
+If you report a bug please follow the guidelines from
+http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/problems.html
+(its in /usr/share/doc/cdrecord/README.Debian if cdrecord is installed).
+
+The most important points you should follow are:
+
+- Always test with latest release if it is still a bug first.
+- Include the following information in your report:
+
+  # The version number of cdrecord that caused the bug.
+  # The command line that was used for the failing command.
+  # The complete output (including error messages) from 'cdrecord -v ...'
+  # The OS name, release and hardware (processor)
+  # Special conditions of your environment (libc vers. SCSI transport ...)
+  # Sufficient information on the media used. This is at least the ATIP
+    data, a note to CD-R/CD-RW and information on the state and the case
+    history of this media.
+
+Of course, if it is only a Bug in the Debian Package (like a build
+failure) skip this. :)
--- cdrtools-2.01+01a01.orig/debian/cdrtools-doc.dirs
+++ cdrtools-2.01+01a01/debian/cdrtools-doc.dirs
@@ -0,0 +1,3 @@
+/usr/share/doc/cdrtools-doc/cdda2wav
+/usr/share/doc/cdrtools-doc/cdrecord
+/usr/share/doc/cdrtools-doc/mkisofs
--- cdrtools-2.01+01a01.orig/debian/cdrecord.postinst
+++ cdrtools-2.01+01a01/debian/cdrecord.postinst
@@ -0,0 +1,113 @@
+#!/bin/sh
+# Debian cdrecord package post-installation script
+# Copyright 1999 Erik Andersen.  Licensed under the GNU GPL.
+# Changes by Eduard Bloch, Andreas Metzler (2002/2003)
+#
+# Source debconf library -- we have a Depends line
+# where we depend on it, so it had better be there...
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+doit ()
+{
+   if ! "$@" ; then
+      echo ERROR: the following senstivie operation failed: "$@"
+      exit 1
+   fi
+}
+
+if [ "$1" = "configure" ] ; then
+   # check for upgrade from versions where the cdrecord variants did not
+   # exist and copy the permission set from dpkg-statoverride
+   if dpkg --compare-versions "$2" le "4:2.0+a16-1" ; then
+      if dpkg-statoverride --list /usr/bin/cdrecord 1>/dev/null 2>&1; then
+         statover="`dpkg-statoverride --list /usr/bin/cdrecord`" || true
+         # reset silly permissions from xcdroast 0.98+0alpha10-4
+         if [ "$statover" = "root cdrom 4710 /usr/bin/cdrecord" ] ; then
+            dpkg-statoverride --remove /usr/bin/cdrecord
+         else
+            for i in mmap shm ; do
+               dpkg-statoverride --update --add ${statover}.$i || true
+            done
+         fi
+      fi
+   fi
+
+   if dpkg-statoverride --list /usr/bin/cdrecord.mmap 1>/dev/null 2>&1; then
+      cdrmmapstatoverride=true
+   fi
+   if dpkg-statoverride --list /usr/bin/cdrecord.shm 1>/dev/null 2>&1; then
+      cdrshmstatoverride=true
+   fi
+   if dpkg-statoverride --list /usr/bin/cdrecord 1>/dev/null 2>&1; then
+      cdrstatoverride=true
+   fi
+
+   # if no variant has been overriden by local admin before...
+   if [ "$cdrshmstatoverride" != "true" ] || [ "$cdrmmapstatoverride" != "true" ] ; then
+      # check if we are installing suid or not
+      RET=false
+      db_get cdrecord/SUID_bit
+      if [ "$RET" = "true" ]; then
+         # if choosed to be SUID and not overriden before, set our permissions
+         if [ "$cdrshmstatoverride" != "true" ] ; then
+            chown root:cdrom /usr/bin/cdrecord.shm
+            chmod 4754 /usr/bin/cdrecord.shm
+         fi
+         #  same for mmap version
+         if [  "$cdrmmapstatoverride" != "true" ] ; then
+            chown root:cdrom /usr/bin/cdrecord.mmap
+            chmod 4754 /usr/bin/cdrecord.mmap
+         fi
+         # same for wrapper script, to work around broken frontends
+         if [  "$cdrstatoverride" != "true" ] ; then
+            chown root:cdrom /usr/bin/cdrecord
+            chmod 4754 /usr/bin/cdrecord
+         fi
+      else
+         # if not to be SUID and not overriden, reset permissions to defaults
+         if [ "$cdrshmstatoverride" != "true" ] ; then
+            chown root:root /usr/bin/cdrecord.shm
+            doit chmod 0755 /usr/bin/cdrecord.shm
+         fi
+         # same for the mmap version
+         if [  "$cdrmmapstatoverride" != "true" ] ; then
+            chown root:root /usr/bin/cdrecord.mmap
+            doit chmod 0755 /usr/bin/cdrecord.mmap
+         fi
+         # same for wrapper script, to work around broken frontends
+         if [  "$cdrstatoverride" != "true" ] ; then
+            chown root:root /usr/bin/cdrecord
+            doit chmod 0755 /usr/bin/cdrecord
+         fi
+      fi
+   fi
+
+   unset RET
+
+   # use /dev/MAKEDEV instead of /sbin/MAKEDEV because it is a sane
+   # wrapper on udev
+   if [ ! -c /dev/.devfsd -a ! -d /dev/scsi ] && [ -e /dev/MAKEDEV ] ; then
+     if [ ! -c /dev/sg0 -a ! -b /dev/scd0 ]; then
+       printf "Generating missing device files needed by cdrecord" 1>&2
+       (cd /dev && /dev/MAKEDEV sg) || true
+       (cd /dev && /dev/MAKEDEV scd) || true
+       echo '.' 1>&2
+     fi
+   fi
+
+   # if no nodes exist or don't have the right major numbers...
+   [ "/dev/sg*" != '/dev/sg*' ] && MAJORS="`LANG=C LC_MESSAGES=C ls -l /dev/sg* | tr -s ' ' | cut -f5 -d' ' | grep -v 21, 2>/dev/null`"
+
+   if [ -e /dev/MAKEDEV ] && [ -n "$MAJORS" ] ; then
+      db_get cdrecord/MAKEDEVNEW
+      if [ "$RET" = "true" ] ; then
+         (cd /dev && /dev/MAKEDEV sg) || true
+         (cd /dev && /dev/MAKEDEV scd) || true
+      fi
+   fi
+fi
+
+
+#DEBHELPER#
+# vim:tabstop=3:expandtab:shiftwidth=3
--- cdrtools-2.01+01a01.orig/debian/README.debian
+++ cdrtools-2.01+01a01/debian/README.debian
@@ -0,0 +1,107 @@
+cdrecord for Debian
+----------------------
+
+The author of cdrecord is Jörg Schilling <schilling@fokus.gmd.de>
+and it was initally packaged for Debian by
+Erik Andersen <andersee@debian.org>.
+
+The Debian package includes few modifications:
+
+ - /usr/bin/cdrecord is a shell script that automatically chooses the
+   correct executable:
+   * /usr/bin/cdrecord.shm, for Kernel 2.0.* and 2.2.*, using SHM method.
+   * /usr/bin/cdrecord.mmap for Kernel >= 2.4.
+   This is needed to make it work with all kernels versions in Debian, not
+   depending on the build time version.
+
+ - with default kernel configuration, cdrecord will fail with this message if
+   you specify a fs= value larger than 31MiB:
+
+   "cdrecord: Invalid argument. shmget failed."
+
+   To fix this, change the value in /proc/sys/kernel/shmmax file. To set it
+   permanently, add this line to /etc/sysctl.conf:
+
+   kernel/shmmax = 33554432
+
+ - Per default the debian version of mkisofs does not include the
+   commandline used to create the iso image in the image itself. To get
+   this (for problem reports to Upstream) set the environment
+   variable ISODEBUG to any value.
+ 
+ - The error messages like these are okay:
+ 
+   cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
+   cdrecord: Permission denied. WARNING: Cannot set priority using
+   setpriority().
+   cdrecord: WARNING: This causes a high risk for buffer underruns.
+
+   They come from cdrecord dropping root privileges too early.
+
+- Most Cdrecord documentations requires to install cdrtools-doc package.
+
+- dev=ATA:x,y.z will work for non-root.
+
+If you are looking for a program for DVD-recording please take a look at
+README.DVD.Debian.
+
+If you want to report Bugs please read the following, taken from
+http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/problems.html
+
+(I refers to Joerg Schilling in this text).
+
+Please use only the recent version of cdrecord for bug-reports, it
+may be found on: ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha.
+I don't have the time to check if your problem was recently fixed. For
+a list of the enhancements and bug fixes read the announcement files
+in the same directory. If you are using XCDroast, please first check
+the actual cdrecord version from command line to verify your bug.
+
+ Please always include the following information in your bug-report:
+
+# The version number of cdrecord that caused the bug.
+# The command line that was used for the failing command.
+# The complete output (including error messages) from 'cdrecord -v ...'
+# Probably the important part of the 'cdrecord -V' output if we agreed
+  on it
+# The OS name, release and hardware (processor)
+# Special conditions of your environment (libc vers. SCSI transport ...)
+# Sufficient information on the media used. This is at least the ATIP
+  data, a note to CD-R/CD-RW and information on the state and the case
+  history of this media.
+
+A message in the form: "Sorry, no CD/DVD-Recorder or unsupported
+CD/DVD-Recorder found" is inaceptable as error report because I cannot
+see any reason why this message has been printed by cdrecord. For this
+reason, I would need the complete inquiry output to understand why this
+message was printed.
+
+Note that Linux is no Operating System, it is only a kernel. It does not
+help if you tell me: "I have RH-6.2". From this I know that you are
+using a buggy glibc-2.1.3 but I still don't know which Linux version you
+are using. 
+
+The output from cdrecord -VVVVVV -vvvvvvv -debug is totally useless. It
+contains too much information to read it in an acceptable time. Try to
+write your mail in a way that the important information may be gathered
+in less than a minute. You then will have the best chance to get an
+answer that will help you with your problem. Please prepare your mail
+well and take care of my time.
+
+Top news Forums related to cdrecord: de.comp.periph.cdrom
+comp.os.linux.misc comp.os.linux.hardware
+
+It is always a good idea to first look at groups.google.com for your
+problem.
+
+If you are using Linux and get the error message:
+
+    cdrecord: Cannot allocate memory. Cannot send SCSI cmd via ioctl
+
+then you have encountered a Linux kernel incompatibility. Recompile
+cdrecord and read README.linux from the current cdrecord alpha
+distribution. Please send a bug report to your Linux distributor too.
+
+
+Eduard Bloch <blade@debian.org>, Mon, 26 Aug 2002 20:57:50 +0200
+Joerg Jaspert <joerg@debian.org>, Mon, 18 Nov 2002 21:24:00 +0100
--- cdrtools-2.01+01a01.orig/debian/changelog
+++ cdrtools-2.01+01a01/debian/changelog
@@ -0,0 +1,980 @@
+cdrtools (4:2.01+01a01-4ubuntu4) dapper; urgency=low
+
+  * Apply Steve McIntyre's JTE patch from jigit 1.15.
+  * Disable -Werror in JTE patch; it fails with a few unimportant (I think)
+    signedness warnings on powerpc.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sun,  6 Nov 2005 04:08:11 -0500
+
+cdrtools (4:2.01+01a01-4ubuntu3) breezy; urgency=low
+
+  * debian/rules: Build mkisofs/write.c with GNU make again to work around a
+    bug in the crackful upstream build system. (Ubuntu #14990)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 13 Sep 2005 14:46:54 +0200
+
+cdrtools (4:2.01+01a01-4ubuntu2) breezy; urgency=low
+
+  * Add and install README.ATAPI.setup.ubuntu instead of the obsolete
+    README.ATAPI.setup, which mostly contains stuff that is unnecessary in
+    Ubuntu. (Ubuntu #13386)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Thu, 18 Aug 2005 09:51:51 +0200
+
+cdrtools (4:2.01+01a01-4ubuntu1) breezy; urgency=low
+
+  * Add 27_default_device.dpatch:
+    - Change the default device in /etc/default/cdrecord from "yamaha" (which
+      certainly works almost nowhere) to "/dev/cdrw" (which should work in the
+      common case).
+    - Ubuntu bug #13386
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 16 Aug 2005 18:47:20 +0200
+
+cdrtools (4:2.01+01a01-4) unstable; urgency=low
+
+  * O_EXCL issue becoming hot, uploading to unstable
+  * sync with Ubuntu Breezy (renamed as needed):
+    + 23_o_excl.dpatch (replaced with Ubuntu's version, closes: #262678)
+    + 24_debug_tmpfile.dpatch (secure file access in rscsi, closes: #291376)
+    + 25_mkisofs_iconv_manpage.dpatch (explicit note about iconv support)
+    + 26_author_locale.dpatch (replace ö in his name with an ascci
+      transliteration)
+
+ -- Eduard Bloch <blade@debian.org>  Tue, 26 Apr 2005 10:30:34 +0200
+
+cdrtools (4:2.01+01a01-3) experimental; urgency=low
+
+  * testing bug fix release
+  * Eduard Bloch:
+    + Updated dirsplit to 0.3.x (lots of bugfixes and feature improvements)
+    + "Mandrake patches": 22_linux_rawio_capability.dpatch (from Keenan Pepper
+      <cherylgpepper@comcast.net> and others to get RAWIO capabilites before
+      changing the EUID, closes: #267273, #266009), 23_o_excl.dpatch
+      (exclusive access to the device files, closes: #262678)
+  * Steve McIntyre <93sam@debian.org>:
+     + Added Danish debconf translation. Closes: #296993. Thanks to Claus
+       Hindsgaul for the patch.
+ -- Eduard Bloch <blade@debian.org>  Fri, 22 Apr 2005 15:38:44 +0200
+
+cdrtools (4:2.01+01a01-2) unstable; urgency=high
+
+  * Bug fix: "cdrtools: FTBFS when /usr/src/linux points to kernel
+    sources", thanks to Ken Bloom (Closes: #286025). Patch from
+  	Bas Zoetekouw. Also (Closes: #228529)
+
+ -- Joerg Jaspert <joerg@debian.org>  Sun,  9 Jan 2005 17:48:43 +0100
+
+cdrtools (4:2.01+01a01-1) unstable; urgency=low
+
+  * New Upstream 2.01.01a01
+  * We have a clarification from Upstream on the license issue. (Closes: #270060)
+  * Removed Andreas Metzler from Co-Maintainer on his wish.
+    THANKS for all your good work in the past Andreas!
+  
+ -- Joerg Jaspert <joerg@debian.org>  Sat,  8 Jan 2005 19:55:19 +0100
+
+cdrtools (4:2.0+a38-1) unstable; urgency=low
+
+  * New upstream 2.01a38
+  * Added hints for cdrtools-doc in the descriptions of the packages as
+    most people don't find it.
+
+ -- Joerg Jaspert <joerg@debian.org>  Sat,  4 Sep 2004 13:56:53 +0200
+
+cdrtools (4:2.0+a34-2) unstable; urgency=high
+
+  * Fix typo in Brazilian Portuguese (pt_BR) translation (Andre Luis Lopes)
+    (Closes: #261396)
+  * Fix local root exploit in cdrecord found by Max Vozeler. (CAN-2004-0806)
+
+ -- Andreas Metzler <ametzler@debian.org>  Tue, 24 Aug 2004 17:21:23 +0200
+
+cdrtools (4:2.0+a34-1) unstable; urgency=low
+
+  * New upstream 2.01a34. (Closes: #260499)
+    - mkisofs -q is quiet even about Eltorito boot. (Closes: #217845)
+    - typo in cdda2mp3(1) fixed. (Closes: #257312)
+    - Speed up mkisofs by 30% in the case that a directory contains many (>
+      5000) pathological file name entries (that _all_ do not differ in 8.3).
+      (Closes: #240251)
+    - fix cdrtools-2.01a31-dvd.patch.bz2 to actually apply. Untested
+      otherwise, if it breaks you keep both pieces. (am)
+  * Remove reference to "woody" from NEWS.Debian. (Closes: #243395).
+  * Spanish translation of debconf-templates by Javi Castelo
+    (Closes: Bug#254170)
+  * Moved the directly refered file README.ATAPI.setup back to cdrecord and
+    set Replaces more fuzzy (eb, closes: #257517)
+  * Adapted README.ATAPI.setup to the *cough* "JS' new style" syntax (eb)
+  * Bugfixes and improvements of the dirsplit script and its manpage (eb)
+  * restructure cdrtools-doc package:
+    * files now live in /usr/share/doc/cdrtools-doc/(mkisofs|cdrecord|...)
+      instead of in /usr/share/doc/(mkisofs|cdrecord|...)
+    * drop BUILD and COMPILE.
+    * (Some) files that apply to the complete cdrtools suite live directly in
+      /usr/share/doc/cdrtools-doc/.
+  * Czech translation of debconf-templates by Jan Outrata . (Closes: #259172)
+
+ -- Andreas Metzler <ametzler@debian.org>  Wed, 21 Jul 2004 12:11:54 +0200
+
+cdrtools (4:2.0+a30.pre1-1) unstable; urgency=low
+
+  * New upstream release 2.01a30-pre1
+    + fixes a manpage typo (closes: #243001)
+    + no more  8-bit characters in manpages  (Closes: #243280,#222936)
+    + Includes the fixes for typos in cdrecord(1) from Jens Seidel's patch.
+      (Closes: #246831)
+    + Remarks about FIFO size in manpage updated (Closes: #245501)
+    + supports more SCSI bus numbers (closes: #235783)
+    + Fixes eject/reload problem on tray CD-ROMs. (Closes: #245303)
+  * Use /dev/MAKEDEV instead of /sbin/MAKEDEV to generate device-files because
+    it does the right thing for udev. Thanks to Juergen Kreileder.
+    (Closes: #241609)
+  * Turkish translation of debconf templates by Gürkan Aslan (Closes: #246081)
+  * updated DVD patch (a28, 14-May-2004)
+  * disable 06_dautipps.dpatch for dvd=yes. (Closes: #248187)
+
+ -- Andreas Metzler <ametzler@debian.org>  Wed, 19 May 2004 20:17:24 +0200
+
+cdrtools (4:2.0+a27-1) unstable; urgency=low
+
+  * New upstream version 2.01a27, featuring new -root & -old-root options to
+    mkisofs for incremental backups.
+  * Add NEWS.Debian to cdrecord (which will be shown before installation by
+    apt-listchanges) warning of changed behavior for people upgrading from
+    woody. (Closes: #230066)
+  * Added my dirsplit utility (EB)
+  * update DVD patch. (a27 - 12-Mar-2004)
+
+ -- Andreas Metzler <ametzler@debian.org>  Thu,  1 Apr 2004 16:15:44 +0200
+
+cdrtools (4:2.0+a26pre27-1) unstable; urgency=low
+
+  * A pre27 Upstream because last version broke burning with anything
+    except -tao.
+  * Updated dpatch 02 (do we still need the second half of it?) so it applies.
+
+ -- Joerg Jaspert <joerg@debian.org>  Thu,  4 Mar 2004 20:52:08 +0100
+
+cdrtools (4:2.0+a26-1) unstable; urgency=low
+
+  * Updated dvd-patch (a26, 02-Mar-2004) included in source package. (am)
+    (Closes: #233845)
+  * Mkisofs failed on files with same utf-8 prefix. (Closes: #230725). Updated
+    patch by Jaakko Heinonen
+  * 17_argv0_beautify.dpatch: strips the .shm/.mmap suffix from the executable
+    filename (Closes: #231253) (EB)
+  * Italian translation of debconf templates by Renato Gini.
+    (Closes: #234778)
+  * Strip down and reformat pointer to README.ATAPI.setup, add pointer in
+    README.debian. (am) (Closes: #234990)
+  * Patch libscg to stop it from opening /dev/hda when it was told explicitely
+    to open /dev/hdc by dev=ATA:1,0,0. (am) (Closes: #228215, #230127)
+
+ -- Andreas Metzler <ametzler@debian.org>  Wed,  3 Mar 2004 16:40:16 +0100
+
+cdrtools (4:2.0+a25-1) unstable; urgency=low
+
+  * New upstream release (eb)
+  * Updated iconv patch with pre9 which disables iconv support for non-unicode
+    filesystems like HFS and RR (closes: #224544) and moved our interdiff to
+    15_mkisofs_iconv_debianize.dpatch (eb)
+  * 16_debian_email.dpatch: setting our contact address to show that Debian
+    has a modified version (eb)
+  * Update README.ATAPI.setup for Kernel 2.6. (am)
+  * pt_BR translation updated by andrelop (Closes: #227382) (eb)
+
+ -- Eduard Bloch <blade@debian.org>  Fri, 16 Jan 2004 15:54:08 +0100
+
+cdrtools (4:2.0+a24-1) unstable; urgency=low
+
+  * update info about dvdrtools in README.DVD.Debian (Closes: #221465)
+  * Use uname -r instead of /sbin/kernelversion in the wrapper script
+    (Closes: #223631) (AM/EB)
+  * Complains loudly if removing of the SUID bit failed (closes: #224476) (EB)
+  * Note about #196116 (cdrecord dropping priviledges) in README.debian.
+  * new upstream version (Closes: #224605)
+    * Does not dump core when microscopic fifo size is specified
+      (Closes: #211419)
+    * License clarification.
+  * update mkisofs-iconv patch (Closes: #226719)
+  * Change mkisofs' version info to reflect that it is a patched version.
+  * update dvd patch to version for a20, slightly modified to apply to a24.
+
+ -- Andreas Metzler <ametzler@debian.org>  Fri,  9 Jan 2004 17:16:41 +0100
+
+cdrtools (4:2.0+a19-6) unstable; urgency=low
+
+  * 14_mkisofs_iconv.dpatch: problem with sometimes disappearing files 
+    (best reproducible on Woody) fixed by patch upstream (closes: #220570)
+  * Updated error information to tell about cdrtools-doc package and
+    -joliet-long option (really closes: #219865)
+
+ -- Eduard Bloch <blade@debian.org>  Thu, 13 Nov 2003 14:10:34 +0100
+
+cdrtools (4:2.0+a19-5) unstable; urgency=low
+
+  * Fix mkisofs segfault on PowerPC (Closes: #220178)
+
+ -- Andreas Metzler <ametzler@debian.org>  Tue, 11 Nov 2003 21:47:36 +0100
+
+cdrtools (4:2.0+a19-4) unstable; urgency=low
+
+  * cdrecord replaces README.DVD.Debian in cdrtools-doc (Closes: #219771)
+
+ -- Eduard Bloch <blade@debian.org>  Sun,  9 Nov 2003 01:25:10 +0100
+
+cdrtools (4:2.0+a19-3) unstable; urgency=low
+
+  * Andreas Metzler:
+   - Add Dutch po-debconf translation by Tim Vandermeersch (Closes: #216934)
+   - Don't start cdrecord's description with "A". (Closes: #218106)
+  * Eduard Bloch
+   - new: 14_mkisofs_iconv.dpatch, provides additional charset conversion via
+     iconv (Closes: #213033, #213056)
+   - moved README.DVD.Debian to the cdrecord package (Closes: #216504)
+
+ -- Eduard Bloch <blade@debian.org>  Sat, 08 Nov 2003 14:56:04 +0100
+
+cdrtools (4:2.0+a19-2) unstable; urgency=low
+
+  * Eduard Bloch:
+    - Changed the group setting of cdrecord script to make it readable for the
+      cdrom group (Closes: #214280)
+  * Joerg Jaspert:
+    - Split out another package - cdrtools-doc - which contains almost all
+      documentation.
+    - Let cdrecord, mkisofs, cdda2wav suggest the new package.
+    - Kill {cdda2wav|cdrecord|mkisofs}.doc files, no longer needed.
+    - cdrtools-doc replaces/conflicts with all 3 packages prior to this
+      version because it overwrites files from them.
+
+ -- Joerg Jaspert <joerg@debian.org>  Tue,  7 Oct 2003 22:01:31 +0200
+
+cdrtools (4:2.0+a19-1) unstable; urgency=low
+
+  * New upstream version. (No user visible changes on Linux), makes 
+    patches/15_cdda2oggmanpage.dpatch unnecessary again.
+  * Updated French debconf translation by Michel Grentzinger
+    (Closes: #211811)
+  * Updated Japanese debconf translation by Kenshi Muto (Closes: #211892)
+  * Add note about the dvd+rw-tools to README.DVD.Debian. (Closes: #213035)
+  * Conflict with xcdroast << 0.98+0alpha14-5, because it cannot not
+    parse cdrecord's changed version string (Closes: #210941)
+  * If cdrecord is made SUID via debconf we also make the
+    wrapper-script SUID. - Should help frontends, especially k3b.
+
+ -- Andreas Metzler <ametzler@debian.org>  Wed,  1 Oct 2003 16:02:31 +0200
+
+cdrtools (4:2.0+a18-1) unstable; urgency=low
+
+  * New upstream version: add clone-writing and fix a security issue with
+    suid-rscsi (Not enabled on Debian)
+  * Replaced . with : in chown calls (Closes: #205524) (EB)
+  * fix wrong debconf.translation (Closes: #202953) (AM)
+  * Fix compilation with dvd=yes (Closes: #200945) (AM)
+  * remove 14_clone_noraw.dpatch. New upstream does support -clone. (AM)
+  * Policy 3.6.1.0 (changelog converted to UTF-8) (AM)
+
+ -- Andreas Metzler <ametzler@debian.org>  Fri, 12 Sep 2003 13:54:20 +0200
+
+cdrtools (4:2.0+a16-2) unstable; urgency=low
+
+  * update DVD patch from
+    http://people.mandrakesoft.com/~warly/files/cdrtools/ (thanks to Sven
+    Gohlke for the hint.) (AM)
+  * fixed in previous upload: loosing suid permissions when compiled with
+    -DUSE_USGSHM (Closes: #196116) (AM)
+  * Fix broken cdrecord statoverrides inherited from xcdroast 
+    (Closes: #199498, #199773, #200375) (AM, EB)
+  * Copy existing statoverrides from the cdrecord-wrapper script to the new
+    executables (EB)
+
+ -- Eduard Bloch <blade@debian.org>  Tue, 08 Jul 2003 18:57:49 +0200
+
+cdrtools (4:2.0+a16-1) unstable; urgency=low
+
+  * New upstream version:
+    - El-torito boot-CD + "-iso-level 4" works. (Closes: #194233)
+    - -sort file handling fixed (Closes: #198266)
+  * French debconf translation by Michel Grentzinger (Closes: #197720)
+  * Compiling with -USE_USGSHM had broken access to cdrecord for non-root
+    users, if cdrecord was not suid. We ship two versions of the cdrecord
+    binary and a wrapper script as /usr/bin/cdrecord, which selects
+    cdrecord.shm for kernels << 2.4 and cdrecord.mmap for newer ones. If you
+    use dpkg-statoverride you'll have to update your settings.
+  * Ship README.ATAPI.setup. (Closes: #199135)
+  * EB: Additional check in debian/rules to warn us to not package as native
+    source (Closes: #196501)
+
+ -- Andreas Metzler <ametzler@debian.org>  Sat, 28 Jun 2003 17:19:46 +0200
+
+cdrtools (4:2.0+a15-1) unstable; urgency=low
+
+  * New upstream 2.01a15
+    - Fixed DAO mode on Plextor drives (Closes: #196172)
+    - CUE/BIN fixes included, removed patches: 10_fixcuebin, 11_cue-audio
+  * Japanese debconf translation from Kenshi Muto (Closes: #195356)
+  * Changed defaults setting method in cdda2mp3 and cdda2ogg to respect the
+    environment variables (Closes: #195680)
+  * 14_clone_noraw.dpatch: documented the different behaviour readcd -clone in
+    the manpage (Closes: #196047)
+
+ -- Eduard Bloch <blade@debian.org>  Mon, 02 Jun 2003 18:09:31 +0200
+
+cdrtools (4:2.0+a14-1) unstable; urgency=low
+
+  * New upstream 2.01a14:
+    - mkisofs doesn't print debug statements anymore (Closes: #191045, #191896)
+    - experimental support for bin/cue.
+  * mkzftree(8) '--crib-tree' instead of '--crib-path' (Closes: #191367)
+  * adapt 08_privacy.dpatch to upstream's changes.
+  * Upstream patch from JS to fix bin/cue.
+
+ -- Andreas Metzler <ametzler@debian.org>  Tue, 13 May 2003 14:32:19 +0200
+
+cdrtools (4:2.0+a10-2) unstable; urgency=low
+
+  * Fix multisession-support (Closes: #189086)
+
+ -- Andreas Metzler <ametzler@debian.org>  Tue, 15 Apr 2003 10:59:13 +0200
+
+cdrtools (4:2.0+a10-1) unstable; urgency=low
+
+  * add conflicts with old versions of xcdroast (Closes: #187184)
+  * add @DPATCH@-tag to patches, as required by dpatch-edit-patch in
+    dpatch 1.17
+  * new upstream version 2.0a10 (Owners of Plextor drives should read
+    AN-2.01a09)
+  * Fix mkzftree --sloppy. Patch by Andreas Krueger (Closes: #188212)
+  * fix lintian error "internal error: cannot run po-debconf check on package
+    cdrtools" by removing superfluous entries from debian/po/POTFILES.in
+
+ -- Andreas Metzler <ametzler@debian.org>  Mon, 14 Apr 2003 13:31:49 +0200
+
+cdrtools (4:2.0+a07-1) unstable; urgency=low
+
+  * remove "DVD" from package description.
+  * Don't invoke MAKEDEV if /dev/scsi exists. (Closes: #179321) 
+  * minor improvements in README.DVD.Debian (Eduard Bloch)
+  * 07_noadvertising points to README.DVD.Debian
+  * update pt_BR debconf template translation (Andre Luis Lopes)
+    (Closes: #184952)
+  * new upstream version 2.0a07
+      - adds sighandler for HUP, closing a terminal window during execution
+        of cdrecord should make the drive unresponsive until reboot anymore
+        (Closes: #185559)
+
+ -- Andreas Metzler <ametzler@debian.org>  Fri, 28 Mar 2003 14:55:41 +0100
+
+cdrtools (4:2.0+a05-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Joerg Jaspert <joerg@debian.org>  Thu, 13 Mar 2003 13:55:59 +0100
+
+cdrtools (4:2.0+a04-2) unstable; urgency=low
+
+  * Joerg Jaspert:
+    - Changed priority from extra to optional as in the override files.
+  * rethink dvdrecord issue:
+    - disable advertising by default (07_noadvertising.dpatch)
+    - 07_dvdsup.dpatch: set INSERT_YOUR_EMAIL_ADDRESS_HERE and tell $user to
+      pester the local admin. Don't apply it per default.
+    - offer am easy possibilty for building packages with dvd-patch and add
+      code to identify bugreports for these unofficial packages
+    - document everthing in README.DVD.Debian
+
+ -- Andreas Metzler <ametzler@debian.org>  Wed, 12 Mar 2003 20:13:15 +0100
+
+cdrtools (4:2.0+a04-1) unstable; urgency=low
+
+  * New upstream release
+  * Eduard Bloch:
+    - 06_dautipps.dpatch: hints where to look for documentation and reminds on
+      needed modules. Better README.Debian.setup or interactive assistant (eg.
+      HTML based call-and-response docs) should be written sooner or later
+      (closes: #182131)
+    - 07_dvdsup.dpatch : extracted dvdrecord patch from Ben Collins, (closes: #181028)
+    - 08_privacy.dpatch: having consens among developers, we re-enable the
+      patch to exclude mkisofs command line (#87043, see below). To get it the way
+      Upstream wants for support, define Environment variable ISODEBUG
+  * Andreas Metzler:
+    - Don't ask for permission to generate device files, it's not needed
+      anymore (policy 3.5.7)
+  * Joerg Jaspert:
+    - Deactivate 04_silo.dpatch, it doesnt apply anymore. See README.silo 
+      for details.
+    - Build-depend on debhelper >= 4.1.16 now, we use po-debconf
+    - Removed dh_undocumented from rules file
+    - Permissions of cdrecord binary now 4754 if setuid debconf. (closes: #182384)
+
+ -- Joerg Jaspert <joerg@debian.org>  Sun,  9 Mar 2003 14:34:35 +0100
+
+cdrtools (4:2.0-2) unstable; urgency=low
+
+  * Added build-depends to dpatch and adjusted rules file, patch/unpatch
+    target now in included file from dpatch.
+  * Moved zisofs things in a patch in debian/patches where they belong.
+
+ -- Joerg Jaspert <joerg@debian.org>  Tue, 31 Dec 2002 21:13:11 +0100
+
+cdrtools (4:2.0-1) unstable; urgency=low
+
+  * New upstream release, 2.0 is now released :)
+  * mkisofs: Description now mentions that it includes zisofs_tools
+  * Upstream removed (outdated) german translation of documentation.
+    Kill commands for it out of debian/rules.
+
+ -- Joerg Jaspert <joerg@debian.org>  Fri, 27 Dec 2002 20:36:16 +0100
+
+cdrtools (4:1.10+alpha2.0pre3-1) unstable; urgency=low
+
+  * Andreas Metzler
+    - new upstream 2.0pre3
+    - Update ftp-URL in debian/copyright
+    - dropped manpage debian/cdda2ogg.1, it has been included upstream
+  * Eduard Bloch
+    - added zisofs tree to the package (closes: #118503)
+  * Joerg Jaspert
+    - Install zisofs changelog and Readme
+    - Added Build-Depends for zlib
+    - Adjusted Build-System of zisofs to be more like the rest of cdrtools.
+
+ -- Joerg Jaspert <joerg@debian.org>  Fri, 20 Dec 2002 17:26:49 +0100
+
+cdrtools (4:1.10+alpha2.0pre2-0.amwoody2) unstable; urgency=low
+
+  * recompiled for woody
+  * Don't use dh_install --sourcedir, debhelper in woody does not support it.
+
+ -- Andreas Metzler <ametzler@logic.univie.ac.at>  Wed, 11 Dec 2002 14:12:23 +0100
+
+cdrtools (4:1.10+alpha2.0pre2-1) unstable; urgency=low
+
+  * Updated Standards-Version to 3.5.8.0
+  * Sparc-People: Remember changelog entry from 4:1.10+11a39-1?
+    2.0 release is scheduled for next weekend. Silo patch for mkisofs will go
+    away then. (Yes, this will be mailed again to -sparc of course).
+  * Moved all symlink stuff in $PACKAGE.link files for dh_link.
+  * Same thing for dh_installdocs. And for dh_installdirs.
+  * Drop dh_movefiles, use only dh_install now.
+  * Kicked -dev package a few versions ago - now kick the install code for it
+    out of rules too :)
+  * Added presubj files for reportbug for all packages.
+
+ -- Joerg Jaspert <joerg@debian.org>  Tue, 10 Dec 2002 22:26:49 +0100
+
+cdrtools (4:1.10+alpha2.0pre2-0.amwoody1) unstable; urgency=low
+
+  * new upstream 2.0pre2
+
+ -- Andreas Metzler <ametzler@logic.univie.ac.at>  Mon,  9 Dec 2002 17:10:48 +0100
+
+cdrtools (4:1.10+alpha2.0pre1-0.amwoody1) unstable; urgency=low
+
+  * new upstream 2.0pre1: (Closes: #171438) mkisofs ignores all but
+    first path argument
+  * install manpage/symlink for cdda2(ogg|mp3) instead of linking to
+    undocumented
+
+ -- Andreas Metzler <ametzler@logic.univie.ac.at>  Mon,  2 Dec 2002 16:34:49 +0100
+
+cdrtools (4:1.10+11a39-2) unstable; urgency=low
+
+  * (closes: #123111) - cdda2wav doesn't fail properly. Looks like it
+    returns a 1 now.
+  * Changed Priority to match with override file.
+  * Modified 03_script.dpatch. Now cdda2mp3 and cdda2ogg only using
+    /etc/default/cdda2* if it is there. cdda2mp3 now also fails if
+    selected encoder is not available (like cdda2ogg already does).
+    Also set CDDA_DEVICE in both scripts if not already set.
+    (closes: #163076)
+  * Removed cdrecord-dev package. Not used anywhere.
+  * Dropped Provides, Replaces to mkhybrid from mkisofs.
+    Its gone since woody, we dont need it any longer.
+  * (closes: #143786) - /etc/cdrecord.conf ignored.
+    Only if you upgrade from a pre-woody package. There was an error with
+    the location. If you upgrade directly from pre-woody then mv the file
+    to /etc/default/cdrecord (or add your changes there).
+  * Ok ok, use a symlink for /etc/cdrecord/* and not a hardlink.
+    (closes: #170302)
+  * (closes: #169932) - cdda2wav: cd-text problems
+    Tested on 2 different systems - cdtext burn and read works. (use last
+    example from cdrecord manpage for it). Use the sg driver, not atapi
+    for it.
+
+ -- Joerg Jaspert <joerg@debian.org>  Sat, 23 Nov 2002 17:50:45 +0100
+
+cdrtools (4:1.10+11a39-1) unstable; urgency=low
+
+  * New Maintainer. Thx to Michael Stone (former Maintainer) and to
+    Eduard Bloch for his NMU's. Thx also to Andreas Metzler who did (outside of
+    Debian Archive) work on cdrtools Package, some of which I included here.
+  	Andreas and Eduard helping me as Co-Maintainers.
+  	This closes all NMU fixed bugs:
+  	(closes: #162027, #161502, #161689, #159830)
+  * New upstream release
+    (closes: #163041) - cdrecord: Input/output errors when burning CDs
+    (closes: #165745) - cdrecord: Copyright problems - libedc used in 1.11a34 is
+                        non-free
+    (closes: #161070) - cdrecord: when cdrecord is stopped by Ctrl-C in dummy
+                        burning mode, asus 1610A is blocked
+    (closes: #168635) - cdrecord: Typo in man page    
+    (closes: #162579) - mkisofs: isoinfo does not accept coalesced options any
+                        more. That was always an user error. It works as
+                        documented now.
+    (closes: #165015) - cdrtools: Patch to work with 2.5.43. (Read AN-1.11a38)
+  * finally completely GPL (including libedc!)
+  * Update debian/copyright.
+  * Don't mention DVD-writing in description (Closes: #162660)
+  * Removed 01_cdr_gnuisms. gcc defines __linux__, __linux and linux,
+    so we dont need to patch it that way (and linux is not POSIX
+    compliant (even if it is defined), __linux__ is)
+  * Upstream includes ia64 rules, delete that patch.
+  * We now have smake in the Archive. Build-Depend on that, because it is
+    the make-system Upstream really supports for his packages. (And with it
+    we never need to include a patch for missing rules-files again, it creates
+    them automagically)    
+  * Include a symlink from /etc/cdrecord/* to /etc/default/*, (closes: #159506)
+    That makes it easy to find the cdrecord config and still is compatible with
+    upstream *and self-compiled* versions of cdr-tools.
+  * Removed 03-cdr-mmap patch and use -DUSE_USGSHM in COPTX - it can be so simple
+    to be compatible with old kernels.
+  * Make cdrecord only executable for users in the cdrom group (mode 4750)
+    if it set SUID (Closes: #164283)
+  * Updated to 3.5.7.1 standards version.
+  * Do not strip options/commandline out of iso-files. That is *NO* security
+    risk. It only contains the options used to create the isofile and the name
+    of the directory you created the iso (path is truncated to ../) of it.
+  * Drop dbs from Build-Depends, use dpatch system.
+  * patch to get silo bootable cds will be deleted with next Upstream
+    release of cdrtools. Ben wants to fix silo, but as always: patches
+    are welcome, we are all low on time. If you use sparc and want
+    bootable linux cd's - go on and send patches for silo please. Look
+    into README.silo in /usr/share/doc/mkisofs for more details.
+
+ -- Joerg Jaspert <joerg@debian.org>  Thu, 21 Nov 2002 01:15:00 +0100
+
+cdrtools (4:1.10+11a34-1) unstable; urgency=low
+
+  * NMU, blessed by maintainer
+  * Changes by Andreas Metzler <ametzler@logic.univie.ac.at>:
+    - New upstream version, updated 01_cdr_gnuisms
+    - Build as nonnative package (Closes: #162027)
+    - Ship tar.bz2 in orig tar.gz to save bandwith
+    - Disabled 09_cdr_joliet_nameconversion - it causes a segfault. 
+      (Closes: #161502)
+  * Updated cdda2ogg to have a better description (Closes: #161689)
+
+ -- Eduard Bloch <blade@debian.org>  Fri, 27 Sep 2002 22:17:20 +0200
+
+cdrtools (4:1.10+11a31-1.1) unstable; urgency=low
+
+  * NMU. Sorry, this cannot wait.
+  * Fixed verbose output in 09_cdr_joliet_nameconversion, closes: #159830
+
+ -- Eduard Bloch <blade@debian.org>  Fri,  6 Sep 2002 20:09:15 +0200
+
+cdrtools (4:1.10+11a31-1) unstable; urgency=low
+
+  * New upstream version (Closes: #155513)
+    - adds compressed fs option to mkisofs (Closes: #155414)
+    - another silly hurd maxlen complaint addressed (Closes: #146396)
+    - adds -z compressed iso support (Closes: #120707, #126388, #155414)
+    - devfs-aware (Closes: #143455, #116279, #146412)
+    - better usb burner support (Closes: #150437)
+    - more forgiving config file (Closes: #115508)
+    - clarified description of utf-8 in mkisofs man page (Closes: #128270)
+    - readcd man page updates (Closes: #153806)
+  * added hint about shmmax (closes: #146726)
+  * changed the default mode of cdrecord binary to 4750 (closes: #150092)
+  * changed vorbis-tools relationship (closes: #143237)
+  * removed the ugly extension-protection patch, included my name-conversion
+    patch instead (closes: #149456, #145038)
+  * changed to DBS
+  * using german docs from the upstream tarball instead of debian/DEUTSCH
+  * Thanks to Eduard Bloch for above
+
+ -- Michael Stone <mstone@debian.org>  Tue, 27 Aug 2002 19:57:24 -0400
+
+cdrtools (4:1.10-8) unstable; urgency=low
+
+  * New maintainer
+  * No config.sub in diff
+  * Updated copyright file
+
+ -- Michael Stone <mstone@debian.org>  Fri, 21 Jun 2002 22:17:14 -0400
+
+cdrtools (4:1.10-7) unstable; urgency=medium
+
+  * The seventh-time-lucky release. This should go into Woody.
+  * Simplified the old crap^h^h^h^hdebconf interaction part, moved makedev
+    calls to cdrecord.postinst, since makedev != essential. Closes: #141905
+
+ -- Eduard Bloch <blade@debian.org>  Tue,  9 Apr 2002 10:03:06 +0200
+
+cdrtools (4:1.10-6) unstable; urgency=medium
+
+  * clean up in the clean rule
+  * reverted the change of cdrecord.conf location. It was completely useless
+    and non-compliant with upstream's defaults or other distributions.
+    Disabled the transition hack. I won't screw up users config file just
+    because of Erik's personal preferences.
+  * placed rscsi.dfl file as /etc/default/rscsi, but with commented lines to
+    not break security by default
+
+ -- Eduard Bloch <blade@debian.org>  Sun,  7 Apr 2002 12:14:28 +0200
+
+cdrtools (4:1.10-5) unstable; urgency=medium
+
+  * Oh no, there was no rscsi, ffmppffmf mmpmmmfmmfmpmmmpffmpmfmm...
+  * added rscsi and rscsi.dfl to cdrecord package, closes: #118048
+  * added devdump.8 symlink
+
+ -- Eduard Bloch <blade@debian.org>  Sun,  7 Apr 2002 00:15:05 +0200
+
+cdrtools (4:1.10-4) unstable; urgency=medium
+
+  * removed the ugly was-not-compiled-with-your-kernel warning, closes: #115697
+  * merging default and old config file on upgrades, closes: #122309
+  * new warning about wrong device files, closes: #137339
+  * cooked cdda2ogg from cdda2mp3, added Recommends: vorbis-tools. They do
+    also parse the /etc/default/$APP file, closes: #51929
+  * extracted and renamed german documentation add-on, was hard to find
+
+ -- Eduard Bloch <blade@debian.org>  Sat,  6 Apr 2002 17:20:53 +0200
+
+cdrtools (4:1.10-3) unstable; urgency=medium
+
+  * New maintainer
+  * forces use of SHM instead of MMAP, ignoring tests at build time which
+    depend on the kernel version,
+    closes: #127895, #131325, #136754, #138581
+  * blackout the build arguments and version info string in mkisofs, 
+    closes: #87043. Set NOPRIVACY environment to force the default behaviour.
+  * cdda2wav's output channel problem is fixed by upstream, closes: #55695
+  * symlink mkhybrid and mkisofs, closes: #132479
+  * updated upstream's mail address, closes: #115496
+  * fixed formatting error in mkisofs.8, closes: #135385
+  * respect extension of filenames when creating Joliet info for filenames
+    longer than 64 chars, closes: #80202
+  * fixed typo in templates, closes: #126870
+  * using debconf-utils to merge templates
+
+ -- Eduard Bloch <blade@debian.org>  Fri,  5 Apr 2002 00:04:07 +0200
+
+cdrtools (4:1.10-2.4) unstable; urgency=low
+
+  * NMU to fix outstanding sparc bug
+  * Applied patch to allow SILO sparc bootable to be built. Closes: #120266
+    Now debian-cd can use mkisofs instead of mkhybrid
+
+ -- Ben Collins <bcollins@debian.org>  Sun, 10 Feb 2002 16:33:55 -0500
+
+cdrtools (4:1.10-2.3) unstable; urgency=low
+
+  * NMU
+  * debian/cdrecord.postinst:
+    - Redirect output of dpkg-statoverride to /dev/null (Closes: #126682)
+  * mkisofs/mkisofs.8:
+    - Fix minor manpage error (Closes: #108700)
+  * cdrecord/cdrecord.1:
+    - Fix minor manpage error (Closes: #126266)
+
+ -- Colin Walters <walters@debian.org>  Fri, 28 Dec 2001 20:42:14 -0500
+
+cdrtools (4:1.10-2.2) unstable; urgency=medium
+
+  * NMU
+  * debian/rules:
+    - Add symlinks in RULES for s390, parisc{,64}, and update
+      config.{guess,sub} in clean target (Closes: #116013, #123120, #104966).
+    - Don't install build/install documentation for other operating systems.
+  * debian/control:
+    - Add Build-Depends on autotools-dev.
+    - Fix minor spelling errors and typos in descriptions
+      (Closes: #124486, #124490).
+  * debian/cdrecord.config:
+    - Don't prompt for creating devices in /dev if DevFS is active
+      (Closes: #114297).
+  * debian/cdrecord.templates:
+    - Fix spelling errors (Closes: #114037).
+    - Add pt_BR translation (Closes: #116441).
+    - Add de translation (Closes: #115170).
+  * debian/cdrecord.postinst:
+    - Don't meddle with cdrecord permissions if the admin is using
+      dpkg-statoverride (Closes: #115696).
+  * debian/cdrecord.prerm:
+    - Remove obsolete suidunregister stuff.  Add #DEBHELPER# token.
+  * debian/cdrecord.postrm:
+    - Purge debconf database.
+  * mkisofs/mkisofs.8:
+    - Fix formatting (Closes: #123568).
+
+ -- Colin Walters <walters@debian.org>  Fri, 21 Dec 2001 17:12:13 -0500
+
+cdrtools (4:1.10-2) frozen unstable; urgency=high
+
+  * Recompile under 2.2.x (closes: #98953, #102916)
+  * Support for /etc/cdrecord.conf (closes: #97886)
+  * Ask whether to make cdrecord SUID (closes: #107109)
+  * Fixed version number in abort message (closes: #102197, #103060, #110184)
+  * Hopefully this upload will put mkisofs back in testing (closes: #103853)
+
+ -- Erik Andersen <andersee@debian.org>  Sat, 29 Sep 2001 15:41:11 -0600
+
+cdrtools (4:1.10-1) unstable; urgency=low
+
+  * Move to cdrecord 1.10 final version (closes: #93125, #97219)
+  * Make sure /dev/sg0 is a char and /dev/scd0 is a block dev 
+    (closes: #93592, #92836)
+  * Make sure that if cdrecord is compiled under 2.4.x that folks 
+    running 2.2.x get informed they must recompile.
+    (closes: #92927, #92949, #93001, #93281, #96832, #95622)
+  * Add in man page for readcd (closes: #93772)
+  * cdrecord supports Disc at Once and Track at Once modes 
+    these days (closes: #69308)
+  * Linux 2.4.x kernels use shmfs these days, so alpha boxes should
+    be taken care of now (closes: #67995)
+  * Newer kernels should no longer crash (closes: #71746)
+  * Include some german docs, submitted by Eduard Bloch <edi@gmx.de>
+  * Those wanting cdrecord to be setuid root, or similar, can use
+    the dpkg-statoverride utility provided by dpkg. (closes: #78505)
+  * Added ia64 support (RULES/ia64*) from Bdale <bdale@itanium.gag.com>
+    (closes: #100858)
+  * Added in a patch from Chris Lawrence <lawrencc@debian.org> for
+    mkisofs symlink tree support (closes: #85672)
+  * If upstream feels it is best to write args to CD, I'm not going 
+    to argue with him.  (closes: #87043)
+  * Both cdrecord and mkisofs are built from the same package, so 
+    of course they have the same changelog. (closes: #95829)
+
+ -- Erik Andersen <andersee@debian.org>  Sun, 24 Jun 2001 00:41:44 -0600
+
+cdrtools (3:1.10a18-2) unstable; urgency=low
+
+  * Fix conflict with the mkhybrid package (closes: #82411, #92851)
+
+ -- Erik Andersen <andersee@debian.org>  Wed,  4 Apr 2001 00:52:20 -0600
+
+cdrtools (3:1.10a18-1) unstable; urgency=low
+
+  * New upstream version -- code freeze release for 1.10.
+  * links for mips and mipsel architectures are now included from upstream
+    thanks to Marcelo E. Magallon <mmagallo@debian.org> (closes: #85251)
+  * The postinst script now checks for block, not char filetypes (closes: #79353)
+  * Removed cruft from changelog (closes: #90499)
+  * manpage bad escape sequence fixed and sent upstream (closes: #82815)
+  * Joerg Schilling is German.  The English word "Identification" is spelled
+    "Identifikation" in German, and so he is not going to change it.  Besides,
+    changing it would break gcombust, xcdrecord, etc.  (closes: #69945)
+
+ -- Erik Andersen <andersee@debian.org>  Mon,  2 Apr 2001 23:39:09 -0600
+
+cdrecord (3:1.9-1) unstable; urgency=low
+
+  * New upstream version. (closes: #64225, #68538, #65612, #65656, #64409) 
+  
+ -- Erik Andersen <andersee@debian.org>  Thu,  7 Sep 2000 21:52:05 -0600
+
+cdrecord (3:1.8-3) frozen unstable; urgency=low
+
+  * Included the fixed linux scsi driver from 1.8.1 -- the previous release
+    has a bug causing CD's to fail to fixate properly. This fixes an 
+    important bug, and so should go into frozen.  (closes: #62855)
+  * Group "cdrom" always exists on a Debian system (closes: #63058)
+  * Cdrecord doesn't even refer to root in the postinst (closes: #59763)
+  * Cdrecord now uses suidregister.  Cdrecord is still installed 0755, but 
+    now those foolish enough to want to make it suid root can do so on their 
+    own systems.  (closes: #61899)
+  * Many thanks to Torsten Landschoff <torsten@debian.org> for his help
+    on this release.
+
+ -- Erik Andersen <andersee@debian.org>  Sat, 29 Apr 2000 12:28:02 -0600
+
+cdrecord (3:1.8-2) frozen unstable; urgency=low
+
+  * Fix path problem (I assumed . was in the path) to 
+      allow autobuilders to work, fixing an important bug.
+      (closes: #59186)
+
+ -- Erik Andersen <andersee@debian.org>  Tue, 29 Feb 2000 10:02:15 -0700
+
+cdrecord (3:1.8-1) frozen unstable; urgency=low
+
+  * Final version of cdrecord 1.8 was released, which is almost 
+    identical to 1.8a40.  This release closes 2 bugs marked
+    as important, and one marked critical.
+  * The MAKEDEV postinst bug is fixed (closes: #55677)
+  * Remove debian/files in the debian/rules 'clean' target (closes: #56043)
+  * Added  /usr/doc -> /usr/share/doc symlink (closes: #56206, #56750)
+  * Fixed cdda2mp3 so it is a proper shell script. (closes: #55646)
+  * Adjusted libscg/scsitransp.c per discussion on bug 57765
+    to avoid a potential kernel crash. (closes: #57765)
+
+ -- Erik Andersen <andersee@debian.org>  Mon, 21 Feb 2000 22:29:39 -0700
+
+cdrecord (2:1.8a40-1) frozen unstable; urgency=low
+
+  * Fixed a release critical bug for potato where the postinst 
+      script called the /dev/MAKEDEV symlink, instead of /sbin/MAKEDEV, 
+      but the /dev/MAKEDEV symlink is not there till makdev is configured. 
+      (closes: #55694)
+  * Fixed the /usr/bin/list_audio_tracks symlink (closes: #55694)
+  * Final version of a40 from upstream.
+
+ -- Erik Andersen <andersee@debian.org>  Sat, 22 Jan 2000 12:40:27 -0700
+
+cdrecord (1:1.8a40r3-1) frozen unstable; urgency=low
+
+  * New upstream (bugfixing) version
+  * Applied patch from Tuomas Jormola <tj@sgic.fi> to help
+    set up /usr/doc symlinks to /usr/share/doc, and
+    also fix the following 2 items...
+  * Updated to standards version 3.1.1.
+  * Fixed all important lintian errors and warnings.
+  * cdrecord is not designed to be setuid, and has never
+    been audited for such a task.  Folks wanting non-root
+    to use cdrecord, should be able to set perms on /dev/sg*
+    (closes: #38711)
+  * cdda2wav --help seems to work these days. (closes: #41663)
+  * I found a 7 track cd "Heifetz Concertos -- Tchaikovsky, Mendelssohn",
+    and "sudo cdda2wav -D /dev/hdc -t1+8 file.wav" didn't segfault
+    (closes: #44353)
+  * Added the /usr/bin/list_audio_tracks ->  /usr/bin/cdda2mp3
+    symlink.  (closes: #51928)
+
+ -- Erik Andersen <andersee@debian.org>  Sun, 16 Jan 2000 10:13:14 -0700
+
+cdrecord (1:1.8a39-1) unstable; urgency=low
+
+  * New upstream version
+  * In discussions with the upstream author Joerg Schilling, a 
+    boatload of bugs can now be closed (closes: #39396, #39878, #41011, #12761, #17277, #21849, #31366, #33545, #33794, #39498, #3539, #3540, #3703, #5901, #10748, #11814)
+
+ -- Erik Andersen <andersee@debian.org>  Fri,  7 Jan 2000 23:26:25 -0700
+
+cdrecord (1:1.8a38-1) unstable; urgency=low
+
+  * New upstream version
+  * Close an ancient bug (closes: #37007)
+
+ -- Erik Andersen <andersee@debian.org>  Sun,  2 Jan 2000 17:16:30 -0700
+
+cdrecord (1:1.8a30-1) unstable; urgency=low
+
+  * New upstream version (closes: #46506)
+  * Should now (hopefully) compile on sparc64 (closes: #46700)
+
+ -- Erik Andersen <andersee@debian.org>  Sun, 24 Oct 1999 23:17:42 -0600
+
+cdrecord (1:1.8a25-1) unstable; urgency=low
+
+  * New upstream source with bunches of updates
+
+ -- Erik Andersen <andersee@debian.org>  Mon, 30 Aug 1999 21:18:00 -0600
+
+cdrecord (1:1.8a23-1) unstable; urgency=low
+
+  * New upstream source with bunches of updates (closes: #38258, 31366)
+  * Package now built using pristine upstream source (closes: #37068)
+  * Fixed some man page strangeness (closes: #39492, #37234, #41383)
+
+ -- Erik Andersen <andersee@debian.org>  Sat, 24 Jul 1999 13:43:21 -0600
+
+cdrecord (1:1.8a20-1) unstable; urgency=low
+
+  * Initial re-release using the cdrecord source to build cdrecord as
+    well as mkisofs, cdda2wav, and cdrecord-dev.  They used to all be 
+    built from separate sources.
+  * I now check for the existance of the needed /dev/sg?? devices, and if
+    they are not there (as seems to be the case for a stock Debian 2.1
+    install), I go ahead and make these devices.
+
+ -- Erik Andersen <andersee@debian.org>  Fri, 16 Apr 1999 15:00:40 -0600
+
+cdrecord (1:1.6final-0.2) unstable frozen; urgency=low
+
+  * Fixes build on m68k (closes Bug #23631)
+  * Fixed so it doesn't poke about in /opt/schily during build/install
+    thanks to Paul Slootman <paul@debian.org>. (closes Bug #22953).
+  * Maintainer Release (I have recovered from surgery and am nearly
+    done with radiation therapy now).
+
+ -- Erik Andersen <andersee@debian.org>  Mon, 22 Jun 1998 10:15:15 -0600
+
+cdrecord (1:1.6final-0.1) unstable frozen; urgency=low
+
+  * Non-maintainer release (get better, Erik!)
+  * Upstream non-beta release, fixes some bugs. No new features.
+  * Don't include extra manpages (Bug# 22355)
+  * Changelog is a changelog, not a doc
+
+ -- Wichert Akkerman <wakkerma@debian.org>  Sat, 16 May 1998 22:15:51 +0200
+
+cdrecord (1:1.6a14-1) unstable frozen; urgency=low
+
+  * New upstream version -- Upgraded to 1.6a14.  This is _supposed_
+     to be identical to the final 1.6 release, modulo any as yet
+     undiscovered bugs.
+
+ -- Erik Andersen <andersee@debian.org>  Thu,  2 Apr 1998 00:44:46 -0700
+
+cdrecord (1:1.6a12-1) unstable frozen; urgency=low
+
+  * New upstream version -- Upgraded to 1.6a12 so that the 
+     version of cdrecord matches the version of xcdrost already 
+     in the distribution (these two packages are really designed 
+     to work together).
+  * Converted to using debhelper.   
+  * Changed the copyright file to point to the current address of the
+     Free Software Foundation.
+
+ -- Erik Andersen <andersee@debian.org>  Sat, 28 Mar 1998 12:07:06 -0700
+
+cdrecord (1:1.5-3) unstable; urgency=low
+
+  * New maintainer
+
+ -- Erik Andersen <andersee@debian.org>  Sun, 30 Nov 1997 03:09:46 -0700
+
+cdrecord (1:1.5-2) unstable; urgency=low
+
+  * Removed mkisofs.8 man page (fixes #13326)
+
+ -- Christian Schwarz <schwarz@debian.org>  Sun, 12 Oct 1997 21:59:11 +0200
+
+cdrecord (1:1.5-1) unstable; urgency=low
+
+  * New upstream version.
+  * Upgraded to standards version 2.3.0.0.
+  * Recompiled to use /dev/sg0... devices (fixes #12191)
+  * Included one new README file.
+  * Included epoch in version number.
+  * Pristine source.
+
+ -- Christian Schwarz <schwarz@debian.org>  Tue, 16 Sep 1997 22:16:57 +0200
+
+cdrecord (1.5a5-1) experimental; urgency=low
+
+  * New upstream version.
+  * Upload to experimental since it is alpha.
+  * Recompiled with libc6.
+  * Upgraded to standards version 2.2.0.0.
+
+ -- Christian Schwarz <schwarz@debian.org>  Tue, 29 Jul 1997 12:01:23 +0200
+
+cdrecord (1.4-2) unstable; urgency=low
+
+  * Recompiled with libc6.
+  * Upgraded to standards version 2.2.0.0.
+
+ -- Christian Schwarz <schwarz@debian.org>  Sun, 13 Jul 1997 22:09:27 +0200
+
+cdrecord (1.4-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Christian Schwarz <schwarz@debian.org>  Mon, 26 May 1997 17:05:05 +0200
+
--- cdrtools-2.01+01a01.orig/debian/cdrecord.config
+++ cdrtools-2.01+01a01/debian/cdrecord.config
@@ -0,0 +1,29 @@
+#!/bin/sh 
+# Debian cdrecord package configuration script
+# Copyright 2001 Erik Andersen.  Licensed under the GNU GPL.
+#
+
+action=$1
+version=$2
+
+# Source debconf library -- we have a Depends line
+# to make sure it is there...
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+# these devices need to be sane
+[ "/dev/sg*" != '/dev/sg*' ] && MAJORS="`LANG=C LC_MESSAGES=C ls -l /dev/sg* | tr -s ' ' | cut -f5 -d' ' | grep -v 21, 2>/dev/null`"
+
+if [ -n "$MAJORS" ] ; then
+	 db_input medium cdrecord/MAKEDEVNEW || true
+   db_go
+fi
+
+if ! dpkg-statoverride --list /usr/bin/cdrecord.mmap 1>/dev/null 2>&1 || ! dpkg-statoverride --list /usr/bin/cdrecord.shm 1>/dev/null 2>&1 ; then
+	# check if we are installing suid or not
+	RET=false
+	db_input medium cdrecord/SUID_bit || true
+	db_go
+fi
+
+exit 0;
--- cdrtools-2.01+01a01.orig/debian/cdrecord.links
+++ cdrtools-2.01+01a01/debian/cdrecord.links
@@ -0,0 +1,4 @@
+etc/default/cdrecord etc/cdrecord/cdrecord
+etc/default/rscsi etc/cdrecord/rscsi
+usr/share/man/man1/cdrecord.1.gz usr/share/man/man1/cdrecord.shm.1.gz
+usr/share/man/man1/cdrecord.1.gz usr/share/man/man1/cdrecord.mmap.1.gz
--- cdrtools-2.01+01a01.orig/debian/control
+++ cdrtools-2.01+01a01/debian/control
@@ -0,0 +1,63 @@
+Source: cdrtools
+Priority: optional
+Section: otherosfs
+Maintainer: Joerg Jaspert <joerg@debian.org>
+Uploaders: Eduard Bloch <blade@debian.org>
+Build-Depends: debhelper (>=4.1.16), autotools-dev, smake, zlib1g-dev, dpatch, libcap-dev
+Standards-Version: 3.6.1.0
+
+Package: cdrecord
+Architecture: any
+Depends: ${shlibs:Depends}, debconf, makedev (>= 2.3.1-24)
+Recommends: mkisofs
+Replaces: cdrtools-doc
+Suggests: xcdroast, cdrtools-doc
+Conflicts: xcdroast (<< 0.98+0alpha14-5)
+Description: command line CD writing tool
+ cdrecord allows you to create CDs on a CD recorder.
+ It supports writing data, audio, mixed, multi-session, and CD+
+ discs, on just about every type of CD recorder out there.
+ .
+ Please install cdrtools-doc if you want most of the documentation and
+ Readme-files.
+
+Package: mkisofs
+Architecture: any
+Depends: ${shlibs:Depends}
+Suggests: cdrecord, cdrtools-doc
+Conflicts: mkhybrid, xcdroast (<< 0.98+0alpha11)
+Description: Creates ISO-9660 CD-ROM filesystem images
+ mkisofs is a pre-mastering program for creating ISO-9660 CD-ROM 
+ filesystem images, which can then be written to a CD-ROM (or DVD-ROM) using
+ the cdrecord program. mkisofs now includes support for making bootable 
+ "El Torito" CD-ROMs, as well as CD-ROMs with support for the
+ Macintosh HFS filesystem.
+ .
+ The package also includes tools needed to create compressed isofs images
+ (mkzftree from zisofs_tools source).
+ .
+ Please install cdrtools-doc if you want most of the documentation and
+ Readme-files.
+
+Package: cdda2wav
+Architecture: any
+Suggests: vorbis-tools, cdrtools-doc
+Depends: ${shlibs:Depends}
+Conflicts: xcdroast (<< 0.98+0alpha11)
+Section: sound
+Description: Creates WAV files from audio CDs
+ cdda2wav lets you digitally copy audio tracks from a CD-ROM, avoiding
+ the distortion that is introduced when recording via a sound card. Data 
+ can be dumped into raw (cdr), wav or sun format sound files. Options control
+ the recording format (stereo/mono; 8/16 bits; sampling rate, etc).
+ .
+ Please install cdrtools-doc if you want most of the documentation and
+ Readme-files.
+
+Package: cdrtools-doc
+Architecture: all
+Section: doc
+Suggests: cdrecord, mkisofs, cdda2wav
+Description: Documentation for the cdrtools package-suite
+ This is the documentation for the cdrtools package-suite, namely
+ cdrecord, mkisofs and cdda2wav.
--- cdrtools-2.01+01a01.orig/debian/cdrecord.wrapper
+++ cdrtools-2.01+01a01/debian/cdrecord.wrapper
@@ -0,0 +1,11 @@
+#!/bin/sh
+VERS=`uname -r`
+case "$VERS" in
+  2.0.*|2.2.*)
+    exec cdrecord.shm "$@"
+  ;;
+  *)
+    exec cdrecord.mmap "$@"
+  ;;
+esac
+
--- cdrtools-2.01+01a01.orig/debian/mkisofs.install
+++ cdrtools-2.01+01a01/debian/mkisofs.install
@@ -0,0 +1,12 @@
+debian/tmp/usr/bin/mkisofs
+debian/tmp/usr/bin/mkhybrid
+debian/tmp/usr/bin/devdump
+debian/tmp/usr/bin/isoinfo
+debian/tmp/usr/bin/isodump
+debian/tmp/usr/bin/isovfy
+debian/tmp/usr/bin/mkzftree
+debian/tmp/usr/share/man/man8/mkisofs.8
+debian/tmp/usr/share/man/man8/isoinfo.8
+debian/tmp/usr/share/man/man8/mkhybrid.8
+debian/tmp/usr/share/man/man8/mkzftree.8
+debian/dirsplit usr/bin/
--- cdrtools-2.01+01a01.orig/debian/po/ja.po
+++ cdrtools-2.01+01a01/debian/po/ja.po
@@ -0,0 +1,93 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools 2.0+a14\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2003-09-21 11:01+0900\n"
+"Last-Translator: Kenshi Muto <kmuto@debian.org>\n"
+"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=EUC-JP\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "cdrecord ¥Ð¥¤¥Ê¥ê¤ò root ¤Ë SUID ¤·¤¿¾õÂ֤ǥ¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¤«?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "cdrecord ¤Ë SUID ¥Ó¥Ã¥È¤ò¥»¥Ã¥È¤·¤¿¾õÂ֤ˤ¹¤ë¤«¤É¤¦¤«ÁªÂò¤·¤Þ¤¹¡£"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"cdrecord ¤Ë SUID ¤òÉÕ¤±¤ë¾ì¹ç¡¢\"cdrom\" ¥°¥ë¡¼¥×¤Ë½ê°¤¹¤ë¥æ¡¼¥¶¡¼¤Ïï¤Ç¤â¡¢"
+"ÄɲäÎÆø¢¤ÎɬÍפʤ·¤Ë CD-ROM ¤ò¾Æ¤¯¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤ì¤Ï¤·¤«"
+"¤·¡¢ÀøºßŪ¤Ë cdrecord ¤Ë¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ø¤Î¥»¥­¥å¥ê¥Æ¥£¹¶·â¤Ë»È¤ï¤ì¤ë²Ä"
+"ǽÀ­¤òµöÍƤ¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤¯¤ï¤«¤é¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢ SUID ¤Ê¤·¤Ç¥¤¥ó¥¹"
+"¥È¡¼¥ë¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£¤¢¤È¤ÇÊѤ¨¤¿¤¯¤Ê¤Ã¤¿¤È¤­¤Ë¤Ï¡¢dpkg-reconfigure "
+"cdrecord ¤ò¼Â¹Ô¤·¤ÆÊѹ¹¤Ç¤­¤Þ¤¹¡£"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "cdrecord ¤ËɬÍפȤʤë¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤òºÆºîÀ®¤·¤Þ¤¹¤«?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"cdrecord ¤ËɬÍפȤʤëÆüì¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤«¤É¤¦¤«¤ÎÁªÂò»è¤Ç"
+"¤¹¡£¤ª¤½¤é¤¯¸Å¤¤¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æºî¤é¤ì¤¿¤È¤ª¤Ü¤·¤­´û¸¥Õ¥¡¥¤¥ë¤Î¤¤"
+"¤¯¤Ä¤«¤¬¡¢¤ª¤«¤·¤Ê¥á¥¸¥ã¡¼ÈÖ¹æ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£"
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "¸«¤Ä¤«¤é¤Ê¤¤¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ò¤¢¤Ê¤¿¼«¿È¤Çºî¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£"
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"¤¢¤Ê¤¿¤Ï cdrecord ¤ËɬÍפȤʤëÆüì¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¡Ö¤·¤Ê¤¤¡×¤³"
+"¤È¤òÁª¤Ó¤Þ¤·¤¿¡£¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤Ë¸«¤Ä¤«¤é¤Ê¤¤¤è¤¦¤Ç¤¹¡£"
+"cdrecord ¤¬Àµ¾ï¤ËÆ°ºî¤¹¤ë¤è¤¦¡¢É¬ÍפȤʤë /dev/sg0 ¤ª¤è¤Ó /dev/scd0 Æüì¥Ç¥Ð"
+"¥¤¥¹¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤¢¤È¤ÇÊѤ¨¤¿¤¯¤Ê¤Ã¤¿¤È¤­¤Ë¤Ï¡¢"
+"dpkg-reconfigure cdrecord ¤ò¼Â¹Ô¤·¤ÆÊѹ¹¤Ç¤­¤Þ¤¹¡£"
--- cdrtools-2.01+01a01.orig/debian/po/de.po
+++ cdrtools-2.01+01a01/debian/po/de.po
@@ -0,0 +1,96 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "Sollen die cdrecord-Programme als SUID-root installiert werden?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Sie können cdrecord mit gesetztem SUID-Bit installieren."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Wenn Sie cdrecord mit SUID-Bit installieren, dann können die Benutzer in der "
+"Gruppe \"cdrom\" CD-ROMs ohne weitere Privilegien brennen. Dies könnte aber "
+"auch dazu führen, dass cdrecord während eines Sicherheitsangriffes benutzt "
+"wird. Im Zweifelsfall installieren Sie cdrecord ohne SUID-Bit. Wenn Sie es "
+"später doch mit SUID-Bit wollen, dann rufen Sie dpkg-reconfigure cdrecord "
+"auf."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "Sollen die benötigten Gerätedateien neuerstellt werden?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Hier haben Sie die Möglichkeit, die von cdrecord benötigten Gerätedateien "
+"neuerstellen zu lassen. Scheinbar haben einige der vorhandenen Dateien "
+"falsche Major-Nummern, vermutlich weil sie für ältere Kernel-Versionen "
+"erstellt wurden."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Sie müssen die fehlenden Gerätedateien selbst erstellen."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Sie haben sich dafür entschieden, die für cdrecord benötigten Gerätedateien "
+"nicht erstellen zu lassen. Es scheint, dass diese Dateien auf Ihrem Rechner "
+"nicht vorhanden sind. Bevor Sie cdrecord verwenden können, müssen Sie die "
+"Geräte /dev/sg0 und /dev/scd0 erstellen. Wenn Sie die Dateien zu einem "
+"späteren Zeitpunkt automatisch erstellen lassen wollen, dann rufen Sie die "
+"Befehlszeile dkpg-reconfigure cdrecord auf."
--- cdrtools-2.01+01a01.orig/debian/po/it.po
+++ cdrtools-2.01+01a01/debian/po/it.po
@@ -0,0 +1,95 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools 2.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2003-12-20 19:36+0100\n"
+"Last-Translator: Renato Gini <rgini@openlabs>\n"
+"Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "Installare i file binari di cdrecord \"SUID root\"?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Si può scegliere di installare cdrecord con il bit SUID attivato."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Se cdrecord viene reso \"SUID\", gli utenti del gruppo \"cdrom\" possono "
+"essere abilitati a scrivere i CD-ROM senza la necessità di ulteriori "
+"privilegi. Questo, tuttavia, potrebbe potenzialmente permettere a cdrecord "
+"di essere usato durante un attacco alla sicurezza del computer. Nel dubbio, "
+"si consiglia di installarlo senza SUID. Se successivamente si dovesse "
+"cambiare idea, sarà possibile eseguire il comando «dpkg-reconfigure "
+"cdrecord»."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "Ricostruire i device file necessari per l'utilizzo di cdrecord?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Questa opzione permette di installare i device file speciali necessari per "
+"l'utilizzo di cdrecord. Sembra che alcuni dei file esistenti possano avere "
+"numero primario errati, probabilmente creati da versioni obsolete del kernel."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Sarà necessario creare manualmente i device file mancanti."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Si è deciso di _non_ installare i device file speciali richiesti da "
+"cdrecord. Sembra che questi file siano mancanti dal sistema. Affinché "
+"cdrecord possa funzionare correttamente, sarà necessario installare i device "
+"file speciali /dev/sg0 e /dev/scd0. Se successivamente si dovesse cambiare "
+"idea e di desiderasse che vengano creati automaticamente, sarà possibile "
+"eseguire il comando «dpkg-reconfigure cdrecord»."
--- cdrtools-2.01+01a01.orig/debian/po/pt_BR.po
+++ cdrtools-2.01+01a01/debian/po/pt_BR.po
@@ -0,0 +1,96 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2004-07-25 15:47-0300\n"
+"Last-Translator: André Luís Lopes <andrelop@ig.com.br>\n"
+"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "Você deseja que os binários do cdrecord sejam instalados SUID root ?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Você tem a opção de instalar o cdrecord com o bit de SUID ativado."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Caso você torne o cdrecord SUID, você pode permitir usuários no grupo \"cdrom"
+"\" queimar CD-ROMs sem que precisem privilégios adicional. Isto pode, porém, "
+"potencialmente permitir ao cdrecord ser utilizado durante um ataque contra "
+"a segurança de seu computador. Em caso de dúvidas, sugiro que você instale-o "
+"sem SUID. Caso você mude de idéia depois, você pode executar : dpkg-"
+"reconfigure cdrecord."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr ""
+"Deseja recriar os arquivos de dispositivos necessários para o cdrecord ?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Você possui a opção de instalar os arquivo de dispositivos especiais "
+"necessários para o cdrecord. Parece que alguns dos arquivos existentes "
+"possuem números major errados, provavelmente criados por versões de kernel "
+"obsoletas."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Você mesmo precisará criar os arquivos de dispositivos faltantes."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Você decidiu _não_ instalar os arquivos de dispositivos especiais "
+"necessários para o cdrecord. Parece que esses arquivos estão faltando em seu "
+"sistema. Para que o cdrecord opere corretamente, você precisará antes "
+"instalar os arquivos de dispositivos especiais /dev/sg0 e /dev/scd0. Caso "
+"você mude de idéia depois e queira que eu os crie para você, execute : dpkg-"
+"reconfigure cdrecord."
--- cdrtools-2.01+01a01.orig/debian/po/templates.pot
+++ cdrtools-2.01+01a01/debian/po/templates.pot
@@ -0,0 +1,80 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
--- cdrtools-2.01+01a01.orig/debian/po/POTFILES.in
+++ cdrtools-2.01+01a01/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] cdrecord.templates
--- cdrtools-2.01+01a01.orig/debian/po/fr.po
+++ cdrtools-2.01+01a01/debian/po/fr.po
@@ -0,0 +1,97 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools_4:2.0+a18-1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2003-09-15 22:00+0200\n"
+"Last-Translator: Michel Grentzinger <mic.grentz@online.fr>\n"
+"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "Faut-il rendre les binaires cdrecord « SUID root » ?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr ""
+"Cette option vous permet d'installer cdrecord avec le bit SUID positionné."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Si vous installez cdrecord avec le bit SUID positionné, vous permettez aux "
+"utilisateurs du groupe « cdrom » de graver des cédéroms sans permissions "
+"supplémentaires. Cependant, cela peut permettre l'utilisation de cdrecord "
+"pour tenter de compromettre la sécurité de votre ordinateur. Dans le doute, "
+"vous devriez l'installer sans le bit SUID. Si vous changez d'avis, vous "
+"pourrez lancer plus tard : « dpkg-reconfigure cdrecord »."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr ""
+"Souhaitez-vous recréer les fichiers de périphériques utilisés par cdrecord ?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Vous pouvez choisir d'installer les fichiers de périphériques spéciaux dont "
+"cdrecord a besoin. Il semble que certains des fichiers existants possèdent "
+"des numéros majeurs incorrects, sans doute créés pour une ancienne version "
+"du noyau."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Vous devrez créer vous-même les fichiers de périphériques manquants"
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Vous avez décidé de ne _pas_ installer les fichiers de périphériques "
+"spéciaux dont cdrecord a besoin. Il semble que ces fichiers manquent sur "
+"votre système. Pour que cdrecord puisse fonctionner correctement, vous aurez "
+"besoin d'installer les fichiers de périphériques spéciaux /dev/sg0 et /dev/"
+"scd0. Si vous changez d'avis et que vous préférez qu'ils soient créés pour "
+"vous, vous pourrez lancer : « dpkg-reconfigure cdrecord »."
--- cdrtools-2.01+01a01.orig/debian/po/da.po
+++ cdrtools-2.01+01a01/debian/po/da.po
@@ -0,0 +1,94 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+#    Developers do not need to manually edit POT or PO files.
+# Claus Hindsgaul <claus_h@image.dk>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools debconf\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2005-02-26 11:03+0100\n"
+"Last-Translator: Claus Hindsgaul <claus_h@image.dk>\n"
+"Language-Team: Danish <dansk@klid.dk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.9.1\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "Vil du have at cdrecord-programmerne bliver installeret SUID-root?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Du har mulighed for at installere cdrecord med SUID-bitten sat."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Hvis du gør cdrecord SUID, kan du tillade brugere i \"cdrom\"-gruppen at "
+"brænde cdrommer uden at have brug for yderligere rettigheder. Det kan dog "
+"potentielt medføre at cdrecord kan benyttes under et sikkerhedsangreb mod "
+"din computer. Hvis du er i tvivl, foreslår jeg at du installerer den uden "
+"SUID. Hvis du senere skifter mening, kan du køre: 'dpkg-reconfigure cdrecord'."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "Vil du genskabe de enhedsfiler, cdrecord har brug for?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Du har mulighed for at installere de specielle enhedsfiler, cdrecord har "
+"brug for. Det lader til at nogle af de eksisterende filer har forkerte "
+"\"major\"-numre, der sikkert er oprettet under en forældet linuxkerne."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Du skal selv oprette de manglende enhedsfiler."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Du har valgt _ikke_ at installere de specielle enhedsfiler, som cdrecord "
+"har brug for. Det lader til at der mangler nogle filer på dit system. Du "
+"er nødt til at installere de krævede enhedsfiler /dev/sg0 and /dev/scd0, "
+"før cdrecord kan fungere ordentligt. Hvis du senere skifter mening, og "
+"vil have mig til at oprette dem for dig, kan du køre: "
+"'dpkg-reconfigure cdrecord'."
+
--- cdrtools-2.01+01a01.orig/debian/po/es.po
+++ cdrtools-2.01+01a01/debian/po/es.po
@@ -0,0 +1,111 @@
+# cdrtools translation to spanish
+# Copyright (C) 2004 Software in the Public Interest
+# This file is distributed under the same license as the cdrtools package.
+#
+# Changes:
+# - Initial translation
+#       javicastelo@ono.com <javicastelo@ono.com>, 2004
+#
+#
+#  Traductores, si no conoce el formato PO, merece la pena leer la
+#  documentación de gettext, especialmente las secciones dedicadas a este
+#  formato, por ejemplo ejecutando:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+# Equipo de traducción al español, por favor lean antes de traducir
+# los siguientes documentos:
+#
+# - El proyecto de traducción de Debian al español
+#   http://www.debian.org/intl/spanish/coordinacion
+#   especialmente las notas de traducción en
+#   http://www.debian.org/intl/spanish/notas
+#
+# - La guía de traducción de po's de debconf:
+#   /usr/share/doc/po-debconf/README-trans
+#   o http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools 2.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2004-06-13 14:30+0100\n"
+"Last-Translator: Javi Castelo <javicastelo@ono.com>\n"
+"Language-Team: Debian Spanish <debian-l10n-spanish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr ""
+"¿Desea que los ejecutables de cdrecord se instalen con permiso de ejecución "
+"para todos los usuarios (SUID root)?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Tiene la opción de instalar cdrecord con el bit SUID."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Si activa el bit SUID a cdrecord, puede permitir a los usuarios que "
+"pertenezcan al grupo «cdrom» grabar CDs sin la necesidad de privilegios "
+"adicionales. Sin embargo, esto permitiría que cdrecord se usara durante un "
+"ataque de seguridad a su ordenador. Si duda, le sugiero que lo instale sin "
+"el bit SUID. Si posteriormente cambia de opinión ejecute: «dpkg-reconfigure "
+"cdrecord»."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "¿Desea reinstalar los ficheros de dispositivo que precisa cdrecord?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Tiene la opción de instalar los ficheros de dispositivo especiales que "
+"necesita cdrecord. Parece que algunos de los ficheros existentes tienen el "
+"número de dispositivo mayor incorrecto, probablemente los crearon versiones "
+"obsoletas del núcleo."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Necesitará crear los ficheros de dispositivo que faltan usted mismo."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Ha decidido _no_ instalar los ficheros de dispositivo especiales que "
+"cdrecord precisa. Parece que esos ficheros no se encuentran en su sistema. "
+"Para que cdrecord funcione correctamente necesitará instalar los ficheros de "
+"dispositivo especiales «/dev/sg0» y «/dev/scd0». Si cambia posteriormente de "
+"opinión y quiere que el sistema los instale por usted, ejecute:«dpkg-"
+"reconfigure cdrecord»."
--- cdrtools-2.01+01a01.orig/debian/po/cs.po
+++ cdrtools-2.01+01a01/debian/po/cs.po
@@ -0,0 +1,94 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2004-06-25 16:52+0200\n"
+"Last-Translator: Jan Outrata <outrataj@upcase.inf.upol.cz>\n"
+"Language-Team: Czech <provoz@debian.cz>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr ""
+"Mají se spustitelné soubory cdrecordu instalovat s nastaveným SUID bitem?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Mù¾ete zvolit instalaci cdrecordu s nastaveným SUID bitem."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Pokud nastavíte cdrecordu SUID bit, mù¾ete povolit u¾ivatelùm ve skupinì "
+"\"cdrom\" vypalovat CD bez nutnosti dal¹ích privilegií. Tímto by ale mohl "
+"být cdrecord potenciálnì zneu¾it bìhem bezpeènostního útoku na vá¹ poèítaè. "
+"Pokud si nejste jisti, navrhuji instalovat jej bez SUID bitu. Pokud se "
+"pozdìji rozhodnete jinak, mù¾ete spustit: dpkg-reconfigure cdrecord."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "Chcete znovu vytvoøit soubory zaøízení potøebné pro cdrecord?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Mù¾ete instalovat speciální soubory zaøízení potøebné pro cdrecord. Zdá se, "
+"¾e nìkteré z existujících souborù mají ¹patná hlavní èísla, pravdìpodobnì "
+"byly vytvoøeny pro zastaralé verze jádra."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Budete muset vytvoøit chybìjící soubory zaøízení sami."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Rozhodli jste se _neinstalovat_ speciální soubory zaøízení potøebné pro "
+"cdrecord. Zdá se, ¾e tyto soubory ve va¹em systému chybí. Døíve ne¾ bude "
+"cdrecord pracovat správnì, budete muset nainstalovat potøebné speciální "
+"soubory zaøízení /dev/sg0 a /dev/scd0. Pokud se pozdìji rozhodnete jinak a "
+"budete chtít, abych je za vás vytvoøil, mù¾ete spustit: dpkg-reconfigure "
+"cdrecord."
--- cdrtools-2.01+01a01.orig/debian/po/nl.po
+++ cdrtools-2.01+01a01/debian/po/nl.po
@@ -0,0 +1,95 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools 4:2.0+a18-1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2003-09-26 01:18+0100\n"
+"Last-Translator: Tim Vandermeersch <qber66@skolelinux.no>\n"
+"Language-Team: dutch <debian-l10n-dutch@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr "Wilt u de cdrecord binaries als SUID root installeren?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr ""
+"U heeft de mogelijkheid cdrecord te installeren met het SUID bit actief."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Als u cdrecord met de SUID-bit aan installeerd, kunt u gebruikers in de "
+"\"cdrom\" groep CD-ROMs toelaten CD-ROMS te branden zonder hun extra rechten "
+"te geven. Merk op dat het hiervoor potentieel mogelijk wordt om cdrecord te "
+"gebruiken bij een aanval op uw computer. In geval van twijfel, raad ik u aan "
+"om de SUID-bit niet aan te zetten. U kunt dit achteraf altijd nog veranderen "
+"met het commando \"dpkg-reconfigure cdrecord\"."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr "Wilt u de nodige apparaatbestanden voor cdrecord opnieuw aanmaken?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"U heeft de mogelijkheid de voor cdrecord nodige apparaatbestanden te "
+"installeren. Het blijkt dat enkele bestaande bestanden de verkeerde major "
+"nummers hebben, waarschijnlijk aangemaakt voor verouderde kernel versies."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "U dient de ontbrekende apparaatbestanden zelf aan te maken."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"U heeft beslist de speciale apparaatbestanden nodig voor cdrecord _niet_ te "
+"installeren. Het blijkt dat deze bestanden ontbreken op uw systeem. Voordat "
+"cdrecord correct zal werken, dient u de nodige apparaatbestanden /dev/sg0 "
+"en /dev/scd0 te installeren. Als u later van idee verandert en u wilt dat ik "
+"ze voor u aanmaak kan dit met volgend commando: dpkg-reconfigure cdrecord"
--- cdrtools-2.01+01a01.orig/debian/po/tr.po
+++ cdrtools-2.01+01a01/debian/po/tr.po
@@ -0,0 +1,88 @@
+# Turkish translation of cdrtools.
+# This file is distributed under the same license as the cdrtools package.
+# Gürkan Aslan <gurkan@iaslan.com>, 2004. 
+# 
+msgid ""
+msgstr ""
+"Project-Id-Version: cdrtools\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-06-13 16:01+0200\n"
+"PO-Revision-Date: 2004-04-25 08:47+0300\n"
+"Last-Translator: Gürkan Aslan <gurkan@iaslan.com>\n"
+"Language-Team: Turkish <debian-l10n-turkish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms:  nplurals=1; plural=0;\n"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "Do you want the cdrecord binaries to be installed SUID root?"
+msgstr ""
+"Cdrecord'a ait ikili dosyaların SUID root olarak kurulmasını ister misiniz?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid "You have the option of installing cdrecord with the SUID bit set."
+msgstr "Cdrecord'u SUID bit'ini etkinleştirerek yükleme seçeneğiniz var."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:4
+msgid ""
+"If you make cdrecord SUID, you can allow users in the \"cdrom\" group to "
+"burn CD-ROMs without needing any additional privileges.  This could, "
+"however, potentially allow cdrecord to be used during a security attack on "
+"your computer.  If in doubt, I suggest you install it without SUID. If you "
+"later change your mind, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Eğer cdrecord'u SUID yaptıysanız, \"cdrom\" grubunda olan kullanıcıların "
+"CDROM'ları ek haklara ihtiyaç duymadan yakmasını sağlayabilirsiniz. Bununla "
+"birlikte bu durum bilgisayarınıza yapılan bir güvenlik atağı sırasında "
+"cdrecord'un kötü amaçlar için kullanılabilmesine müsaade eder.  Şayet emin "
+"değilseniz, benim önerim SUID yapmadan kurmanızdır. Eğer daha sonradan "
+"fikriniz değişirse, dpkg-reconfigure cdrecord komutunu çalıştırabilirsiniz."
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid "Do you want to recreate device files needed by cdrecord?"
+msgstr ""
+"Cdrecord'un ihtiyaç duyduğu aygıt dosyalarını yeniden yaratmak ister misiniz?"
+
+#. Type: boolean
+#. Description
+#: ../cdrecord.templates:16
+msgid ""
+"You have the option of installing the device special files needed by "
+"cdrecord. It seems that some of existing files have wrong major numbers, "
+"probably created for obsolete kernel versions."
+msgstr ""
+"Cdrecord'un ihtiyaç duyduğu özel aygıt dosyalarını kurma seçeneğiniz var. "
+"Öyle görünüyor ki mevcut bazı dosyalar, büyük olasılıkla eski çekirdek "
+"sürümleri tarafından yaratılmış olan yanlış majör numaralarına sahip."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid "You will need to create the missing device files yourself."
+msgstr "Eksik aygıt dosyalarını kendi başınıza yaratmaya ihtiyaç duyacaksınız."
+
+#. Type: note
+#. Description
+#: ../cdrecord.templates:23
+msgid ""
+"You have decided to _not_ installing the device special files needed by "
+"cdrecord.  It appears that these files are missing from your system. Before "
+"cdrecord will operate correctly, you will need to install the the needed /"
+"dev/sg0 and /dev/scd0 device special files. If you later change your mind "
+"and want me to create them for you, you can run: dpkg-reconfigure cdrecord."
+msgstr ""
+"Cdrecord tarafından ihtiyaç duyulan özel aygıt dosyalarının kurulmamasına "
+"karar verdiniz. Bu dosyaların sisteminizde bulunmadığı görünüyor. Cdrecord "
+"düzgün şekilde işlem yapmadan önce, ihtiyaç duyulan /dev/sg0 ve /dev/scd0 "
+"aygıt dosyalarını kurmak zorunda kalacaksınız. Eğer daha sonradan fikriniz "
+"değişir ve onları yaratmamı isterseniz, dpkg-reconfigure cdrecord komutunu "
+"çalıştırabilirsiniz."
--- cdrtools-2.01+01a01.orig/debian/README.ATAPI.setup
+++ cdrtools-2.01+01a01/debian/README.ATAPI.setup
@@ -0,0 +1,84 @@
+Howto setup an ATAPI CD-RW/DVD+-RW recorder on Debian
+=====================================================
+
+Kernel 2.4.* (for 2.5/2.6, see below)
+============
+
+Where we start:
+   Linux: Kernel 2.4.20-bf2.4 (Debian package kernel-image-2.4.20-bf2.4)
+   Distribution: Debian Woody 3.0r2, i386
+   Devices: one CDRW-Writer, one CDROM-drive, both ATAPI
+
+1. Become root, try "grep hd.: /var/log/kern.log" to find out where your
+   ATAPI-devices are connected to (hd?-names).
+2. Edit your boot configuration file, eg. /etc/lilo.conf if you use
+   lilo or the batch-file if you boot via loadlin.
+3. Find a line where you can append additional kernel parameters, eg.
+   "append=" in lilo.conf or the loadlin-line in the batch file.
+4. Append sth. like this: "hdb=ide-scsi hdc=ide-scsi max_scsi_luns=1"
+   The hdX-parameters defines devices that should be mapped to SCSI
+   latter. You may do it with non-writers too, since the emulation layer
+   is almost complete. Or omit some so the devices will use their
+   native drivers (eg. ide-cd).
+5. Save the file, reinstall the bootloader (ie. running "/sbin/lilo")
+6. Call "modconf" in a console or xterm, enter the section 
+   "kernel/drivers/scsi", load "sg" and "ide-scsi"
+7. Reboot Debian, watch while booting, you should see a line like this
+   "Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0".
+   Your old ATAPI devices virtually don't exist any longer, you cannot refer to
+   /dev/hd* as CDROM drives. Use the SCSI equivalents instead, /dev/sr*.
+8. Become root, setup devices:
+      cd /dev
+      MAKEDEV sg scd
+      ln -s scd0 cdrom # NOTE: or cdrw, first check which drive is here
+      ln -s scd1 cdrw  # NOTE: see above, maybe cdrom
+   Check the new SCSI settings:
+      cdrecord -scanbus
+   Setup cdrecord's environment - edit /etc/default/cdrecord:
+      CDR_DEVICE=cdrw
+      cdrw=1,0,0        4       8m
+      cdrom=1,2,0       0       0m
+   Insert the right values, the fields are described in the manpage
+   of cdrecord. Alternatively, you may use this values as
+   cdrecord-parameter or take a frontend with an own configuration
+   scheme, then you don't need to modify /etc/default/cdrecord.
+   The columns must be separated by tabs.
+9. It's done! Insert a CD and try "cdrecord -v -toc". To create your first CD-ROM, try:
+   
+   mkisofs -v -r -J /directory/to/be/written | cdrecord -v -dummy -
+
+   (read cdrecord(1), "man 1 cdrecord", for details)
+
+10. If you wish to allow non-root users to write CDs, you must give them 
+    permissions to do so. Run "dpkg-reconfigure cdrecord" to set suid-root 
+    permissions on the executable, then add your users to the cdrom group 
+    ("adduser user cdrom") and let the user completely logout and re-login.
+
+Kernel 2.6.*
+============
+
+Usually you would not want to use ide-scsi with Kernel 2.6 for
+CD-writing, the new kernel provides a (from a user's point of view)
+superior access method that finally supports DMA access when writing
+Audio-CDs or using -raw.
+
+If you are converting from ide-scsi first undo the steps 2-7 described above.
+
+1. Become root, find out the virtual SCSI ID of your device, running:
+      cdrecord dev=ATA: -scanbus
+
+2. Become root, setup cdrecord's environment - edit /etc/default/cdrecord:
+      CDR_DEVICE=cdrw
+      cdrw=ATA:3,0,0     12       30m
+   Insert the right values, the fields are described in the manpage
+   of cdrecord. Alternatively, you may use this values as
+   cdrecord-parameter or take a frontend with an own configuration
+   scheme, then you don't need to modify /etc/default/cdrecord.
+   The columns must be separated by tabs.
+
+3. That's it, 'cdrecord -prcap' should find your writer.
+
+4. If you wish to allow non-root users to write CDs, you must give them 
+   permissions to do so. Run "dpkg-reconfigure cdrecord" to set suid-root 
+   permissions on the executable, then add your users to the cdrom group 
+   ("adduser user cdrom") and let the user completely logout and re-login.
--- cdrtools-2.01+01a01.orig/debian/cdrecord.NEWS
+++ cdrtools-2.01+01a01/debian/cdrecord.NEWS
@@ -0,0 +1,11 @@
+cdrtools (4:2.0+a26pre27-1) unstable; urgency=low
+
+  * Please note that cdrecord's behavior has changed signigicantly since 1.x
+    versions, please consult the manpage for details:
+    - -xa1 and -xa2 options work differently (but correctly now).
+    - It is strongly suggested to explicitely specify the intended write
+      mode (-tao, -dao/-sao, -raw, ...) on the commandline. Currently
+      cdrecord will issue a warning otherwise and continue to use -tao per
+      default, but this is supposed to change.
+
+ -- Andreas Metzler <ametzler@debian.org>  Wed,  3 Mar 2004 16:40:16 +0100
--- cdrtools-2.01+01a01.orig/debian/README.silo
+++ cdrtools-2.01+01a01/debian/README.silo
@@ -0,0 +1,166 @@
+README.silo
+
+Update from 09 March 2003: Patch is now dropped, it doesnt apply
+anymore. Now you really should improve silo. :)
+
+You dont want un-bootable sparc cd's? Well, the patch for silo boot in
+mkisofs will be dropped in the not-so-far future. Please help to
+improve silo, so it can boot without the patch. (If you want to know
+the patch, you can get it with apt-get source cdrtools and a look into
+debian/patches).
+Patches should be directed to the silo Maintainer, Package silo. I will
+forward everything I may get.
+
+The following is a summary of a collection of mails to different
+locations I got forwarded from cdrtools Upstream.
+If you want to add something mail me. :)
+My annotations/translations are inside []
+
+You can also look at http://bugs.debian.org/153768 for some more text.
+
+/*--------------------------------------------------------------------------*/
+The implementation of SILO is a deaster. If SILO would have been 
+written in a way that I wrote to the SILO maintainer a long time ago, 
+there would be not problem with SILO. After I implemented a Sparc boot compliant
+boot method, SILO came out with a non Sparc comppliant code.
+
+A bootloader like SILO that forces the ISO-9660 filesystem to be patched with 
+blocknumbers is a bad idea. 
+
+The boot methods implemented in mkisofs allow any clever bootloader to be used 
+on sparc (together with mkisofs) without a need to add additional features into 
+mkisofs. 
+
+I already send several ideas hot to make SILO conform to the Sparc boot method
+_and_ make it less braindamaged. Here is the method that I now consider to be
+the best of three possible choices:
+
+Nearly _all_ Sun boot proms _need_ the method that is implemented in mkisofs
+with -sparc-boot. 
+ 
+	The only exception it the Sun-4/110 and friends (from 1987). 
+ 
+	All Machines starting from Sparcstation-I (from 1988) _need_ the way of 
+	booting that is implemented in mkisofs unless you like to force the user 
+	to type magic things to boot off a CD. 
+ 
+	Did you read README.sparcboot? It helps to understand the boot process  
+	and I know of at least two persons who have been able to create  
+	bootable CDs (using Sun's boot images) directly after reading the file.
+ 
+	Any Sun machine _knows_ about Sun disk labels and any machine  
+	starting from SS-I in addition knows which partition to boot from 
+	when typing 'boot cdrom'. For example: a SS-I will boot off 
+	partition #2 after you typed 'boot cdrom' 
+
+Mkisofs implements the method that is enforced by the Sun boot prom. 
+If you create the right boot code (as e.g. Sun did), you don't need to  
+manipulate the ISO-9660 image and thus don't need to change mkisofs. You only 
+need to assemble the boot blocks to the end of a ISO-9660 image and create a 
+Sun disk label that is related to the sizes of these boot blocks. Mkisofs 
+creates this Sun disk label when used with the -sparc-boot option using 
+portable code.
+
+The minimum requirement (which is enforced by the Sun boot prom) is that there  
+is a set of platform specific partitions _after_ the ISO-9660 image which all  
+start with the apropriate boot code at offset 512 relative to the start of  
+the apropriate partition. AFAIK, the amount loaded by the prom is 7680 Bytes. ** 
+
+From what I can tell, SILO does not meet these requirements. 
+
+**) This is an idea for a very simple method that does not need to fiddle with
+patched values and will meet the requirements by the sparc boot:
+ 
+	Simple make each of the platform specific partitions bigger than the  
+	minimum of 8192 bytes, but do _not_ add a ufs filesystem (as Sun does). 
+	Instead make the 7680 bytes only clever enough to load a certain amount 
+	of bytes directly following the primary boot block. This could be the 
+	current unmodified second stage from SILO. You only need to make the  
+	first stage of SILO sparc boot compliant. 
+ 
+	If both, the first and the second stage, of this new and sparc compliant 
+	SILO boot are witten in a way that does not depend on the machine type 
+	(I don't know whether this is possible), then all you need is to 
+	tell mkisofs to use the same file for all of the added boot partitions. 
+ 
+	If you read the mkisofs man page, you know that even for this case,
+	there is support in mkisofs. Mkisofs will make the last boot block the 
+	master for an overlapped boot sector if the next filename is '...' instead 
+	of a real file. This allows you to have only one boot block and a Sun disk  
+	label where slice 2 ... slice 7 refer to the same data as slice 1. 
+
+If the second stage fits in byte offset 8192 ... 32767, you could create a file 
+that looks: 
+ 
+	|< 512 byte nulls >|< 7680 byte first stage >|< 24576 second stage <| 
+ 
+and call "mkisofs -G bootcode -sparc-boot ... -R -o boot.iso ." 
+ 
+If the second boot is bigger, make a file that looks like: 
+ 
+	|< 512 byte nulls >|< 7680 byte first stage >|< any size second stage <| 
+ 
+and call "mkisofs  -sparc-boot bootcode,... -R -o boot.iso ." 
+ 
+This is more or less documented in the mkisofs man page. 
+
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+Klar: Statt 50 Zeilen in einem anderen fehlerhaften Programm (Silo Boot Code) 
+zu ändern machen wir lieber ein heiles Programm kaputt :-(
+
+Wenn das daß ist was Debian als besonders stabil bezeichnet, dann ist Debian keinen
+Deut besser als M$.
+
+Du scheinst vollkommen zu ignorieren daß ich Dir schon _mehrfach_ mitgeteilt habe
+daß dieser "Silo Patch"
+
+        1) Unnötig ist: mkisofs kann seit langer Zeit Sparc Boot CDs bauen,
+                man nuß halt nur Boot code haben wo der Autor nicht nach 2 Stunden
+                die Lust verloren hat.
+
+        2) massive Bugs hat und nicht portabel ist
+                Code der auf Intel Prozessoren fehlerhaft läuft kommt nichtmal
+                rein wenn er nötig wdre.
+
+[Not so good translation from German to English from me]
+
+This "Silo Patch"
+ 1. is not needed: mkisofs is able to create bootable sparc CDs for a long
+    time, you only need working boot code.
+ 2. has massive bugs and is unportable.
+ 	Code that runs with errors isnt compiled even if it is needed.
+
+/*--------------------------------------------------------------------------*/
+>>      2) massive Bugs hat und nicht portabel ist
+>>              Code der auf Intel Prozessoren fehlerhaft läuft kommt nichtmal
+>>              rein wenn er nötig wäre.
+>
+>Komisch, warum hab ich dann bisher von keinen Problemen damit gehört?!
+Vielleicht weil der Code nicht wirklich benutzt wird?
+
+[Asked why there are no problems reported. Answer: Because Code is not
+really used.]
+
+Es ist schon merkwürdig, wenn man sieht das jemand anstatt eine einfache Lösung
+unter Verwendung des offiziellen Sparc Boot Codes in mkisofs zu verwenden
+einen 800 Zeilen Patch baut....
+Ich frage mich wie es sojemand überhaupt schaffen konnte es irgendwie zum Booten
+zu bekommen.
+
+[Simple Translation: He wonders why someone builds an 800lines patch
+instead of going the easy way using official sparc boot code in mkisofs
+and asks how he could get it too boot.]
+
+
+mkisofs -o cd.out ......
+blockno=`isoinfo -i cd.out -l | grep second.d | tr -d ']' | awk  '{print $10}'`
+silopatch $blockno cd.out
+
+'silopatch' ist ein Programm in dem sich die 20 wichtigen Zeilen aus den 
+inoffiziellen mkisofs Modifikationen  bei Debian befinden.
+
+[Thats a suggestion how it can be done without modifying
+mkisofs. silopatch is there a little programm that has the 20 important
+lines out of the silo patch that is used today]
--- cdrtools-2.01+01a01.orig/debian/mkisofs.dirs
+++ cdrtools-2.01+01a01/debian/mkisofs.dirs
@@ -0,0 +1 @@
+usr/share/bug/mkisofs
--- cdrtools-2.01+01a01.orig/debian/cdda2wav.links
+++ cdrtools-2.01+01a01/debian/cdda2wav.links
@@ -0,0 +1,2 @@
+usr/share/man/man1/cdda2ogg.1.gz usr/share/man/man1/cdda2mp3.1.gz
+usr/bin/cdda2wav usr/bin/list_audio_tracks
--- cdrtools-2.01+01a01.orig/debian/cdrecord.templates
+++ cdrtools-2.01+01a01/debian/cdrecord.templates
@@ -0,0 +1,29 @@
+Template: cdrecord/SUID_bit
+Type: boolean
+Default: false
+_Description: Do you want the cdrecord binaries to be installed SUID root?
+ You have the option of installing cdrecord with the SUID bit set.
+ .
+ If you make cdrecord SUID, you can allow users in the "cdrom" group to
+ burn CD-ROMs without needing any additional privileges.  This could,
+ however, potentially allow cdrecord to be used during a security attack on
+ your computer.  If in doubt, I suggest you install it without SUID. If you
+ later change your mind, you can run: dpkg-reconfigure cdrecord.
+
+Template: cdrecord/MAKEDEVNEW
+Type: boolean
+Default: true
+_Description: Do you want to recreate device files needed by cdrecord?
+ You have the option of installing the device special files needed by
+ cdrecord. It seems that some of existing files have wrong major numbers,
+ probably created for obsolete kernel versions.
+
+Template: cdrecord/do_it_yourself
+Type: note
+_Description: You will need to create the missing device files yourself.
+ You have decided to _not_ installing the device special files needed by
+ cdrecord.  It appears that these files are missing from your system.
+ Before cdrecord will operate correctly, you will need to install the the
+ needed /dev/sg0 and /dev/scd0 device special files. If you later change
+ your mind and want me to create them for you, you can run:
+ dpkg-reconfigure cdrecord.
--- cdrtools-2.01+01a01.orig/debian/cdrecord.postrm
+++ cdrtools-2.01+01a01/debian/cdrecord.postrm
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Debian cdrecord package post-remove script
+# Copyright 2000 Erik Andersen.
+# Copyright 2001 Colin Walters <walters@debian.org>
+# Licensed under the GNU GPL.
+
+if [ "$1" = "purge" -a -e /usr/share/debconf/confmodule ]; then
+      . /usr/share/debconf/confmodule
+      db_purge
+fi
+
+#DEBHELPER#
--- cdrtools-2.01+01a01.orig/debian/dirsplit
+++ cdrtools-2.01+01a01/debian/dirsplit
@@ -0,0 +1,567 @@
+#!/usr/bin/perl
+#                              -*- Mode: Perl -*-
+# dirsplit ---
+# Author           : Eduard Bloch ( blade@debian.org )
+# Last Modified On : Sun, 06 Feb 2005 14:59:51 +0100
+# Status           : Working, but use with caution!
+# License: GPLv2
+
+my $version="0.3.1";
+
+require v5.8.1;
+use strict;
+use List::Util 'shuffle';
+use Getopt::Long qw(:config no_ignore_case bundling);
+use File::Basename;
+use Cwd 'abs_path';
+
+my $ret=0;
+my $max="4488M";
+my $prefix="vol_";
+my $acc=500;
+my $emode=1;
+my $bsize=2048;
+my $ofac =50;
+my $opt_help;
+my $opt_longhelp;
+my $opt_sim;
+my $opt_dir;
+my $opt_flat;
+my $opt_cor;
+my $opt_move;
+my $opt_ver;
+my $opt_sln;
+my $opt_ln;
+my $opt_filter;
+
+my $get_ver;
+
+my $msg="
+dirsplit [options] [advanced options] (directory|content-list-file)
+
+ -H|--longhelp Show the long help message with more advanced options
+ -n|--no-act   Only print the commands, no action (implies -v)
+ -s|--size     NUMBER - Size of the medium (default: $max)
+ -e|--expmode  NUMBER - directory exploration mode (recommended, see long help)
+ -m|--move     Move files to target dirs (default: create mkisofs catalogs)
+ -f|--flatdir  Flat dir mode, don't recreate directory structure
+ -p|--prefix   STRING - first part of catalog/directory name (default: vol_)
+ -c|--correct  Remove directory space summaries, eg. from du output
+ -h|--help     Show this option summary
+ -v|--verbose  More verbosity
+                   
+The complete help can be displayed with the --longhelp (-H) option.
+The default mode is creating file catalogs useable with:
+    mkisofs -D -r --joliet-long -graft-points -path-list CATALOG
+
+Example:
+dirsplit -m -s 700M -e4 random_data_to_backup/
+";
+
+my $msglong="
+dirsplit [options] [advanced options] < directory | content-list-file >
+ -n|--no-act   Only print the commands, no action (implies -v)
+ -s|--size     NUMBER - Size of the medium (default: $max)
+ -m|--move     Move files to target dirs (default: create mkisofs catalogs)
+ -l|--symlink  similar to -m but just creates symlinks in the target dirs
+ -L|--hardlink like -l but creates hardlinks
+ -p|--prefix   STRING - first part of catalog/directory name (default: vol_)
+ -f|--filter   EXPR - Filter expression, see examples below and perlre manpage
+ --flat        Flat dir mode, don't recreate subdirectory structure (not recommended)
+ -e|--expmode  NUMBER, special exploration modes, used with directory argument
+
+  0: dumb file search with \"du -a\", file sizes are rounded up by du, every file treated as object. Slightly till very inaccurate, dependending on filesystem types and mkisofs options.
+  1: (default) native exploration of the specified directory, but file sizes are rounded up to 2048 blocks plus estimated overhead for filenames (see -o option)
+  2: like 1, but when single files _and_ directory found in the same directory somewhere, the files are treated as one object
+  3: like 2, but don't coalesc when the size of the virtual object becomes too large for a medium size (currently $max)
+  4: like 2, but the max. size of the virtual object built on files is limited to $max (create another after max. size)
+
+ -b|--blksize  NUMBER, block size of the target filesystem (currently $bsize). Works in exploration mode.
+ -o|--overhead NUMBER, overhead caused by directory entries (as factor for the filename length, default: 50, empiricaly found for Joliet+RR with not-so-deep directory structure). Works in exploration mode.
+ -a|--accuracy NUMBER (1=faster, large number=better efficiency, default: 500)
+ -c|--correct  Fix input data when it comes from du (KiB expansion, dupes/summaries removal)
+ -h|--help     Show this option summary
+ -v|--verbose  More verbosity
+                   
+The content list may be read from a file or from standard input (use -)
+and contain lines with file sizes and file/directory names. File sizes
+are expected to be in KiB, append modifier letters to recalculate them,
+b for bytes, m for megabytes (10^6) or mebibytes (2^10). The default
+mode is creating file catalogs useable with
+    mkisofs -D -r --joliet-long -graft-points -path-list CATALOG
+
+Examples:
+dirsplit -m -s 120M -e4 largedirwithdata/ -p /zipmedia/backup_   #move stuff into splitted backup dirs
+dirsplit -s 700M -e2 music/ # make mkisofs catalogs to burn all music to 700M CDRs, keep single files in each dir together
+dirsplit -s 700M -e2 -f '/other\\/Soundtracks/' music/ # like above, only take files from other/Soundtracks
+dirsplit -s 700M -e2 -f '!/Thumbs.db|Desktop.ini|\\.m3u\$/i' # like above, ignore some junk files and playlists, both letter cases
+
+(old method:)
+du -s mp3/Collections/Rock/* mp3/Singles/Pop/* | dirsplit -s 701M -
+
+You should compare the required size of the created catalogs, as in_
+for x in *list ; do mkisofs -quiet -D -r --joliet-long -graft-points -path-list \$x -print-size; done
+with the media data (cdrecord -v -toc ...). dirsplit calculates very sharp but
+without knowing the result in advance, so unexpected deep directory structures
+may create additional overhead. Make sure you have some reserve capacity when
+specifying the max media size.
+";
+
+my %options = (
+   "h|help"                => \$opt_help,
+   "d|dirhier"            => \$opt_dir,
+   "flat"            => \$opt_flat,
+   "f|filter=s"            => \$opt_filter,
+   "e|expmode=i"            => \$emode,
+   "o|overhead=i"            => \$ofac,
+   "b|blksize=i"            => \$bsize,
+   "n|no-act"            => \$opt_sim,
+   "m|move"            => \$opt_move,
+   "l|symlink"            => \$opt_sln,
+   "L|hardlink"           => \$opt_ln,
+   "v|verbose"            => \$opt_ver,
+   "s|size=s"             => \$max,
+   "p|prefix=s"              => \$prefix,
+   "c|correct"               => \$opt_cor,
+   "a|accuracy=i"            => \$acc,
+   "H|longhelp"            => \$opt_longhelp,
+   "version"                 => \$get_ver
+);
+
+die $msg unless ( GetOptions(%options));
+if($opt_help) {
+   print $msg;
+   exit 0;
+}
+if($opt_longhelp) {
+   print $msglong;
+   exit 0;
+}
+if($get_ver) {
+   print $version;
+   exit 0;
+}
+
+# ignore the old dirhier setting since it is default now and disable the flag when opt_flat is specified
+$opt_dir = !$opt_flat;
+
+$opt_ver = 1 if $opt_sim;
+$opt_move=1 if ($opt_sln || $opt_ln);
+
+sub fixnr {
+   # args: 
+   # Number
+   # optional: default multiplier
+   my $fac;
+   my $nr;
+   if($_[0]=~/(\d+)(\D)/) {
+      $nr=$1;
+      $fac=$2;
+   }
+   elsif(defined($_[1])) {
+      $nr=$_[0];
+      $fac=$_[1];
+   }
+   else {
+      return $_[0];
+   }
+   return $nr*1000000 if($fac eq "m");
+   return $nr*1048576 if($fac eq "M");
+   return $nr*1000 if($fac eq "k");
+   return $nr*1024 if($fac eq "K");
+   return $nr if($fac eq "b");
+   die "$fac is not a valid multiplier!";
+}
+
+sub mkdirhier { 
+   return 1 if($_[0] eq ".");
+   return 1 if(-d $_[0] && -w $_[0]);
+   return 0 if !mkdirhier(dirname($_[0]));
+   return mkdir $_[0];
+}
+
+my $l;
+my @in;
+my %names;
+my %coalesced; # this will contain arrays with coalesced files
+
+# name to size
+my %ntos;
+
+my @indata;
+my $inputdir;
+
+$max=fixnr($max);
+# about 400kB for iso headers
+$max-=420000;
+
+# parse du -s output
+if(-f $ARGV[0] || (-f readlink($ARGV[0])) || $ARGV[0] eq "-") {
+   die "Exploration mode argument is useless with pregenerated data, aborting...\n" if($emode);
+   open($l, "<".$ARGV[0]);
+   @indata=<$l>;
+   &parseduinput;
+}
+elsif(-d $ARGV[0] || (-d readlink($ARGV[0]))) {
+   if($emode) {
+      #die "not implemented yet";
+      $opt_cor=0;
+      $inputdir=Cwd::abs_path($ARGV[0]);
+      &explore($inputdir);
+   }
+   else {
+      $opt_cor=1;
+      @indata=`du -l -a $ARGV[0]/`;
+      &parseduinput;
+   }
+}
+else {
+   die "Directory or contents listing needed!\n";
+}
+
+# recursive function
+# parameter: directory
+# mode 1: descend as far as possible and index all non-directories
+# mode 2++:
+# put all files of a dir into coaleseced-object, then descend into each dir
+sub explore {
+   (my $dir) = @_;
+   my @stuff;
+   my @dirs;
+   my @files;
+
+#   print "D: $dir\n";
+   opendir(DIR, $dir) || die "Could not open $dir\n";
+   while (my $f = readdir(DIR)) {
+      next if ($f eq "." || $f eq "..");
+      #print "\$f=$opt_filter;\n";
+      
+      $f="$dir/$f" if($dir ne ".");
+
+      if(-d $f && !-l $f) {
+         push(@dirs, $f);
+      }
+      else {
+         if ($opt_filter) {
+#            print "D:exp: \$f=$opt_filter;, Wert: ".eval("\$f=~$opt_filter;")."\n";
+            if(eval("\$f=~$opt_filter;")) {
+#            print "D: added $f\n";
+               push(@files, $f);
+            }
+      }
+         else {
+#            print "D: added $f\n";
+            push(@files, $f);
+         }
+      }
+   }
+   closedir(DIR);
+   #print "D: $dir fertig",@dirs;
+
+   if($#dirs < 0 && $#files < 0) {
+      # this one is empty, register for cosmetics reason
+      return if ($opt_filter && !eval("\$dir=~$opt_filter;"));
+      $ntos{$dir}=getsize($dir);
+      return;
+   }
+   explore($_) for(@dirs);
+
+   if($emode==1) {
+      $ntos{$_}=getsize($_) for(@files);
+   }
+   else {
+      my $filesum=0;
+      for(@files) {
+         my $tmp=getsize($_);
+         if($tmp>$max) {
+            # already too large, stop right here
+            die "Too large file ($_) for the given max size $max, aborting...\n";
+         }
+         $filesum += $tmp;
+      };
+      if($filesum>$max) {
+         # too large coal. object...
+         if($emode==3) {
+            # don't coalesc in this mode, leave them alone
+            $ntos{$_}=getsize($_) for(@files);
+            return;
+         }
+         if($emode==4) {
+#            print "D: mode 4!\n";
+            # a bit complicated, split file set into coal.objects
+            my $partsum=0;
+            my @sorted=sort(@files);
+            my @tmpvol;
+            for(my $i=0;$i<=$#sorted;$i++) {
+#            print "D: i: $i, partsum: $partsum, file: $sorted[$i]\n";
+               my $tmp=getsize($sorted[$i]);
+               $partsum+=$tmp;
+               if($partsum>$max) {
+                  # undo the last step then build the coal.object
+                  $partsum-=$tmp;
+                  $i--;
+
+#                  print "D: coal: ".join(",", @tmpvol)."\n";
+                  my $iname = ("### Coalesced file object, placeholder for the directory $dir up to file $sorted[$i] ###"." "x256);
+                  @{$coalesced{$iname}} = @tmpvol;
+                  $ntos{$iname}=$partsum;
+                  # tmps reseten
+                  undef @tmpvol;
+                  undef $partsum;
+               }
+               else {
+                  push(@tmpvol, $sorted[$i]);
+               }
+            }
+            return;
+         }
+      }
+
+      # be an invalid filename
+      if($filesum) {
+         my $iname = ("### Coalesced file object, placeholder for stuff in the directory $dir ###"." "x256);
+         @{$coalesced{$iname}} = @files;
+         $ntos{$iname}=$filesum;
+      }
+   }
+}
+
+sub getsize {
+   (my $file) = @_;
+   my $size = ((stat($file))[7]);
+   my $rest = ($size % $bsize);
+   $size = ($size + $bsize - $rest) if ($rest);
+   return 1+int(200 + $ofac*length(basename($file)) + $size);
+}
+   
+
+sub parseduinput {
+   for(@indata) {
+      chomp;
+      if(/^(\w+)\s+(.+)/ && $2 ne "./") {
+         #print "D: ntos $2 ist ".fixnr($1, "K")."\n";
+         $ntos{$2}=fixnr($1, "K");
+      }
+   }
+}
+
+# sort and kill dupes/summaries
+if($opt_cor) {
+   my @intmp=sort(keys %ntos);
+#   die join("\n", @intmp, "");
+   my @newin;
+
+   for(my $i=0;$i<=$#intmp;$i++) {
+      $_=$intmp[$i];
+      chomp;
+      # weed out directory summaries
+      # print "vgl. ". "$_/ ne substr(".$intmp[$i+1].",0,length($_)+1)) \n";
+      /.*(.)$/;
+      if ($1 ne "/" && "$_/" ne substr($intmp[$i+1],0,length($_)+1)) { 
+         # feed the final data holders
+         push(@in, $ntos{$_});
+         # linked list behind the hash entry
+         my $realname=$_;
+         $realname=~s!^\./!!;
+         push(@{$names{$ntos{$_}}}, $realname);
+      }
+   }
+}
+else {
+   # copy around
+   for(keys %ntos) {
+#      print "wtf, $_, $ntos{$_}\n";
+      push(@in, $ntos{$_});
+      # linked list behind the hash entry
+      push(@{$names{$ntos{$_}}}, $_);
+   }
+}
+
+for(@in) {
+   die "Too large object(s) ($_) for the given max size: ".join(", ",
+   @{$names{$_}})."\n" if($_>$max);
+}
+
+$a=0;
+for(@in) {$a+=$_};
+$acc=1 if ($a <= $max); # just generate a list, more trials are pointless
+print "\nSumm: $a\n" if($opt_ver);
+die "Nothing to do!\n" if($a<4096); # looks like just an empty dir
+
+my $i;
+my @out;
+
+# Parms: bin size (int), input array (arr reference), output array (arr reference)
+# Returns: wasted space (int)
+sub bp_bestfit {
+   my $max=$_[0];
+   my @in = @{$_[1]};
+   my $target = $_[2];
+   my @out;
+   my @bel;
+
+   my @tmp;
+   push(@tmp,$in[0]);
+   push(@out, \@tmp);
+   $bel[0] = $in[0];
+   shift @in;
+
+   for(@in) {
+      my $bestplace=$#out+1;
+      my $bestwert=$max;
+      for($i=0;$i<=$#out;$i++) {
+         my $rest;
+         $rest=$max-$bel[$i]-$_;
+         if($rest>0 && $rest < $bestwert) {
+            $bestplace=$i;
+            $bestwert=$rest;
+         };
+      }
+      if($bestplace>$#out) {
+         my @bin;
+         $bel[$bestplace]=$_;
+         push(@bin, $_);
+         push(@out,\@bin);
+      }
+      else{
+         $bel[$bestplace]+=$_;
+         push(  @{$out[$bestplace]}    , $_);
+      }
+   }
+   my $ret=0;
+   # count all rests but the last one
+   for($i=0;$i<$#out;$i++) {
+      $ret+=($max-$bel[$i]);
+   }
+   @{$target} = @out;
+   return $ret;
+}
+
+# Parms: bin size (int), input array (arr reference), output array (arr reference)
+# Returns: wasted space (int)
+sub bp_firstfit {
+   my $max=$_[0];
+   my @in = @{$_[1]};
+   my $target = $_[2];
+   my @out;
+   my @bel;
+
+   piece: foreach my $obj (@in) {
+      # first fit, use the first bin with enough free space
+      for($i=0;$i<=$#out;$i++) {
+         my $newsize=($bel[$i]+$obj);
+#         print $bel[$i]."\n";
+         if( $newsize <= $max ) {
+#            print "F: bin$i: $bel[$i]+$obj=$newsize\n";
+            #fits here
+            $bel[$i]=$newsize;
+            push(  @{$out[$i]} , $obj);
+            next piece; # break
+         }
+      }
+      # neues Bin
+      my @bin;
+      $bel[$i]=$obj;
+#      print "N: bin$i: $bel[$i]=$obj\n";
+      push(@bin, $obj);
+      push(@out,\@bin);
+   }
+   my $ret=0;
+   # sum up all rests except of the one from the last bin
+   for($i=0;$i<$#out;$i++) {
+#           print "hm, bel $i ist :".$bel[$i]." und res:".($max-$bel[$i])."\n";
+      $ret+=($max-$bel[$i]);
+   }
+   @{$target} = @out;
+#      print "wtf, ".join(",", @{$out[0]})."\n";
+   return $ret;
+}
+
+my @erg;
+my $globwaste=$max*($#in+1);
+my $starttime=time;
+for(1..$acc) {
+   syswrite(STDOUT,".");
+   my @tmp;
+   #my $waste = bp_bestfit($max, \@in, \@tmp);
+   my $waste = bp_firstfit($max, \@in, \@tmp);
+   #print "D: waste - $waste\n";
+   @in=shuffle(@in);
+   if($waste < $globwaste) {
+      $globwaste=$waste;
+      @erg=@tmp;
+   }
+   if($starttime && time > $starttime+10) {
+      syswrite(STDOUT,"\nSpent already over 10s (for $_ iterations)\nHint: reduce accuracy to make it faster!\n");
+      undef $starttime;
+   }
+}
+print "\nCalculated, using ".($#erg+1)." volumes.\n";
+   
+print "Wasted: $globwaste Byte (estimated, check mkisofs -print-size ...)\n";
+
+# and the real work
+$i=1;
+my $inDirLen=length($inputdir);
+for(@erg) {
+   my $o;
+   open($o, ">$prefix$i.list") if(! ($opt_move | $opt_sim));
+   for(@{$_}) {
+      my @stuff;
+      my $object=shift(@{$names{$_}});
+      if(-e $object) {
+         @stuff=($object);
+      }
+      elsif(defined $coalesced{$object}) {
+         @stuff=@{$coalesced{$object}};
+      }
+      else {
+         print "Warning, $object not found, skipping...\n";
+         $ret=1;
+      }
+      my $dirPrefix=dirname($prefix);
+      my $prefixBase=basename($prefix);
+      my $dirPrefixAbs=Cwd::abs_path($dirPrefix);
+      for my $file (@stuff) {
+         my $relFile=substr($file,$inDirLen+1);
+         my $base=basename($relFile);
+         if($opt_move) {
+            my $targetsubdir = $dirPrefixAbs."/$prefixBase$i";
+            $targetsubdir .= "/".dirname($relFile) if($opt_dir);
+            print "$file -> $targetsubdir/$base\n" if($opt_ver);
+            if(!$opt_sim) {
+               mkdirhier $targetsubdir || die "Problems creating $targetsubdir\n";
+               # last check
+               die "Could not create $targetsubdir?\n" if(!(-d $targetsubdir && -w $targetsubdir));
+               if($opt_sln) {
+                  symlink($file, "$targetsubdir/$base");
+               }
+               elsif($opt_ln) {
+                  if(-d $file && !-l $file) {
+                     mkdir "$targetsubdir/$base";
+                  }
+                  else {
+                     link($file, "$targetsubdir/$base");
+                  }
+               }
+               else {
+                  rename($file, "$targetsubdir/$base");
+               }
+            }
+         }
+         else {
+            # escape = in mkisofs catalogs, they are used as separator
+            my $isoname = ($opt_dir?$relFile : $base);
+            $isoname=~s/=/\\=/g;
+            my $sourcefile=$file;
+            $sourcefile=~s/=/\\=/g;
+            print "$i: /$isoname=$sourcefile\n" if $opt_ver;
+            print $o "/$isoname=$sourcefile\n" if(!$opt_sim);
+         }
+      }
+   }
+   $i++;
+   close($o) if($o);
+}
+
+exit $ret;
--- cdrtools-2.01+01a01.orig/debian/README.DVD.Debian
+++ cdrtools-2.01+01a01/debian/README.DVD.Debian
@@ -0,0 +1,46 @@
+Notes about DVD-Recording:
+==========================
+
+cdrecord does not support DVD recording. If you need it you have the
+following options:
+
+* cdrecord-ProDVD: Joerg Schilling is also author of cdrecord-ProDVD. This
+  software is free for personal use but not free software according to the
+  DFSG and therefore not part of Debian GNU/Linux.
+  ftp://ftp.berlios.de/pub/cdrecord/ProDVD
+
+* dvd+rw-tools: http://fy.chalmers.se/~appro/linux/DVD+RW/
+  Although the name suggests otherwise, recent versions support
+  DVD-R(W) and DVD+R(W).
+
+* dvdrtools (Formerly known as dvdrecord): http://www.nongnu.org/dvdrtools/
+  A fork of an older version of cdrecord (1.11a15) with DVD-R(W) support.
+
+* Apply the dvdrecord-patch to cdrecord and compile it yourself:
+    apt-get source cdrtools
+    cd cdrtools-<version>
+    fakeroot debian/rules dvd=yes cdrecord
+
+    Be aware that we will probably ignore bugreports for cdrecord+dvdpatch
+    unless they can be reproduced without the patch.
+
+-------------------
+
+Why is this patch not applied by default?
+
+* We are not the upstream authors of cdrecord and cannot fix most of the bugs
+  ourselves, but will forward them to upstream. The author of cdrtools is
+  not interested in maintaining a forked version of his software.
+  
+* We aren't interested in and cannot play upstream (aka main software author)
+  for the dvd-patch.
+
+* There is no active upstream for the dvdrecord-patch either. 
+
+* It may break cdrecord. And as far as we know its only tested on Pioneer
+  A03 DVD Writer. So there is no guarantee that cdrecord still does its
+  work as it should nor that this patch really works for most of the
+  DVD Writers.
+
+Andreas Metzler <ametzler@debian.org> 2003-11-19
+Eduard Bloch <blade@debian.org> 2003-03-16
--- cdrtools-2.01+01a01.orig/debian/cdda2wav.install
+++ cdrtools-2.01+01a01/debian/cdda2wav.install
@@ -0,0 +1,7 @@
+debian/tmp/usr/bin/cdda2wav
+debian/tmp/usr/bin/cdda2mp3
+debian/tmp/usr/bin/cdda2ogg
+debian/tmp/usr/bin/readmult
+debian/tmp/usr/bin/pitchplay
+debian/tmp/usr/share/man/man1/cdda2wav.1
+debian/tmp/usr/share/man/man1/cdda2ogg.1
--- cdrtools-2.01+01a01.orig/debian/compat
+++ cdrtools-2.01+01a01/debian/compat
@@ -0,0 +1 @@
+4
--- cdrtools-2.01+01a01.orig/debian/dirsplit.1
+++ cdrtools-2.01+01a01/debian/dirsplit.1
@@ -0,0 +1,26 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33.
+.TH DIRSPLIT "1" "March 2004" "dirsplit 0.3" "User Commands"
+.SH NAME
+dirsplit \- splits directory into multiple with equal size
+.SH SYNOPSIS
+dirsplit \fB[options]\fR < directory | content-list-file >
+.SH DESCRIPTION
+displit is designed to for a simple purpose: convert a directory with
+many multiple files (which are all smaller than a certain medium, eg.
+DVD) and "splits" it into "volumes", looking for the optimal order to
+get the best space/medium-number efficiency.
+.P
+The actual action is either adding the files to mkisofs catalogs or real
+moving of files into new directories (or creating links/symlinks).
+The method is not limited to files, whole directories can also be handled this
+way (see various filesystem exploration modes).
+.SH OPTIONS
+.TP
+Run dirsplit \fB\-h\fR to get the basic usage info.
+.TP
+Run dirsplit \fB\-H\fR to get the whole option overview and description.
+.SH EXAMPLES
+Run dirsplit \fB\-H\fR to see the commented examples.
+.SH AUTHOR
+\fBdirsplit\fR is created by Eduard Bloch (blade@debian.org) and is licensed
+under the GPLv2.
--- cdrtools-2.01+01a01.orig/debian/cdda2wav.dirs
+++ cdrtools-2.01+01a01/debian/cdda2wav.dirs
@@ -0,0 +1 @@
+usr/share/bug/cdda2wav
--- cdrtools-2.01+01a01.orig/debian/patches/05_zisofs.dpatch
+++ cdrtools-2.01+01a01/debian/patches/05_zisofs.dpatch
@@ -0,0 +1,4376 @@
+#! /bin/sh -e
+## 05.dpatch by Joerg Jaspert <joerg@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Adds the zisofs_tools to the build tree.
+## DP: The zisofs filesystem is an extension to the ISO9660 filesystem
+## DP: that allows files, on a file-by-file basis, to be stored compressed
+## DP: and decompressed in real time. The zisofs filesystem is supported by
+## DP: recent versions of Linux (2.4.14 or later). Legacy systems can still
+## DP: read uncompressed files. zisofs-tools contains the tools necessary to
+## DP: create such a compressed ISO9660 filesystem and to read compressed
+## DP: files on a legacy system.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+	-patch) patch -f --no-backup-if-mismatch -p0 < $0;;
+	-unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+
+@DPATCH@
+--- TARGETS/55zisofs_tools	1970-01-01 01:00:00.000000000 +0100
++++ TARGETS/55zisofs_tools	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1 @@
++Tools for preparing compressed filesystems
+
+--- zisofs_tools/aclocal.m4	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/aclocal.m4	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,35 @@
++dnl --------------------------------------------------------------------------
++dnl PA_ADD_CFLAGS()
++dnl
++dnl Attempt to add the given option to CFLAGS, if it doesn't break compilation
++dnl --------------------------------------------------------------------------
++AC_DEFUN(PA_ADD_CFLAGS,
++[AC_MSG_CHECKING([if $CC accepts $1])
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS $1"
++ AC_TRY_COMPILE([#include <stdio.h>],
++ [printf("Hello, World!\n");],
++ AC_MSG_RESULT([yes]),
++ AC_MSG_RESULT([no])
++ CFLAGS="$pa_add_cflags__old_cflags")])
++
++dnl ------------------------------------------------------------------------
++dnl  PA_WITH_BOOL
++dnl
++dnl  PA_WITH_BOOL(option, default, help, enable, disable)
++dnl
++dnl  Provides a more convenient way to specify --with-option and
++dnl  --without-option, with a default.  default should be either 0 or 1.
++dnl ------------------------------------------------------------------------
++AC_DEFUN(PA_WITH_BOOL,
++[AC_ARG_WITH([$1], [$3],
++if test ["$withval"] != no; then
++[$4]
++else
++[$5]
++fi,
++if test [$2] -ne 0; then
++[$4]
++else
++[$5]
++fi)])
+
+--- zisofs_tools/CHANGES	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/CHANGES	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,49 @@
++Changes in zisofs-tools-1.0.4:
++
++	Update the documentation.
++
++Changes in zisofs-tools-1.0.3:
++
++	Update cdrtools patch.
++
++Changes in zisofs-tools-1.0.2:
++
++	Add "make install" target :)
++
++Changes in zisofs-tools-1.0.1:
++
++	By default, abort if file modes, times and ownership cannot be
++	set.  Since this isn't always possible, add new option
++	-s/--sloppy to suppress this error.
++
++	Fix man page typo, and add a BUGS section.
++
++	Remove problems with extremely long symlinks.
++
++	Move all command line options into common "opt" structure.
++
++	Fix bug in command line parsing: -z option not recognized.
++
++
++Changes in zisofs-tools-1.0:
++
++	Restructured code; now split into a number of modules.
++
++	Use autoconf for configuration.
++
++	Add support for long options if the platform has
++	getopt_long().
++
++	Support compiling on systems without lchown().
++
++	Support the following new options:
++	  -x	Don't descend into other filesystems
++	  -X	Same as -x, but don't create mount point directories
++	  -l	Don't descend into any subdirectories
++	  -L	Same as -l, but don't create stub directories
++	  -F	Allow compression or decompression of single files.
++	  -V	Explicitly set the verbosity.
++	  -w	Display program version.
++
++	  Update the mkisofs patch to warn if -z is specified without
++	  -r/-R.
+
+--- zisofs_tools/compress.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/compress.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,141 @@
++/* $Id: compress.c,v 1.3 2001/07/31 03:20:52 hpa Exp $ */
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <utime.h>
++#include <unistd.h>
++#include <zlib.h>
++#include "mkzftree.h"
++#include "iso9660.h"
++
++
++int block_compress_file(FILE *input, FILE *output, off_t size)
++{
++  struct compressed_file_header hdr;
++  char inbuf[CBLOCK_SIZE], outbuf[2*CBLOCK_SIZE];
++  size_t bytes, pointer_bytes, nblocks, block;
++  uLong cbytes;			/* uLong is a zlib datatype */
++  char *pointer_block, *curptr;
++  off_t position;
++  int i;
++  int force_compress = opt.force;
++  int zerr;
++  int err = EX_SOFTWARE;
++  
++  if ( (sizeof hdr) & 3 ) {
++    fputs("INTERNAL ERROR: header is not a multiple of 4\n", stderr);
++    abort();
++  }
++
++  memset(&hdr, 0, sizeof hdr);
++  memcpy(&hdr.magic, zisofs_magic, sizeof zisofs_magic);
++  hdr.header_size = (sizeof hdr) >> 2;
++  hdr.block_size = CBLOCK_SIZE_LG2;
++  set_731(&hdr.uncompressed_len, size);
++
++  if ( fwrite(&hdr, sizeof hdr, 1, output) != 1 )
++    return EX_CANTCREAT;
++
++  nblocks = (size+CBLOCK_SIZE-1) >> CBLOCK_SIZE_LG2;
++  pointer_bytes = 4*(nblocks+1);
++  pointer_block = xmalloc(pointer_bytes);
++  memset(pointer_block, 0, pointer_bytes);
++
++  if ( fseek(output, pointer_bytes, SEEK_CUR) == -1 ) {
++    err = EX_CANTCREAT;
++    goto free_ptr_bail;
++  }
++
++  curptr = pointer_block;
++  position = sizeof hdr + pointer_bytes;
++  
++  block = 0;
++  while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ) {
++    if ( bytes < CBLOCK_SIZE && block < nblocks-1 ) {
++      err = EX_IOERR;
++      goto free_ptr_bail;
++    }
++
++    /* HACK: If the file has our magic number, always compress */
++    if ( block == 0 && bytes >= sizeof zisofs_magic ) {
++      if ( !memcmp(inbuf, zisofs_magic, sizeof zisofs_magic) )
++	force_compress = 1;
++    }
++
++    set_731(curptr, position); curptr += 4;
++    
++    /* We have two special cases: a zero-length block is defined as all zero,
++       and a block the length of which is equal to the block size is unencoded. */
++
++    for ( i = 0 ; i < (int)CBLOCK_SIZE ; i++ ) {
++      if ( inbuf[i] ) break;
++    }
++
++    if ( i == CBLOCK_SIZE ) {
++      /* All-zero block.  No output */
++    } else {
++      cbytes = 2*CBLOCK_SIZE;
++      if ( (zerr = compress2(outbuf, &cbytes, inbuf, bytes, opt.level))
++	   != Z_OK ) {
++	err = (zerr == Z_MEM_ERROR) ? EX_OSERR : EX_SOFTWARE;
++	goto free_ptr_bail;	/* Compression failure */
++      }
++      if ( fwrite(outbuf, 1, cbytes, output) != cbytes ) {
++	err = EX_CANTCREAT;
++	goto free_ptr_bail;
++      }
++      position += cbytes;
++    }
++    block++;
++  }
++
++  /* Set pointer to the end of the final block */
++  set_731(curptr, position);
++
++  /* Now write the pointer table */
++  if ( fseek(output, sizeof hdr, SEEK_SET) == -1 ||
++       fwrite(pointer_block, 1, pointer_bytes, output) != pointer_bytes ) {
++    err = EX_CANTCREAT;
++    goto free_ptr_bail;
++  }
++
++  free(pointer_block);
++
++  /* Now make sure that this was actually the right thing to do */
++  if ( !force_compress && position >= size ) {
++    /* Incompressible file, just copy it */
++    rewind(input);
++    rewind(output);
++
++    position = 0;
++    while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ) {
++      if ( fwrite(inbuf, 1, bytes, output) != bytes )
++	return EX_CANTCREAT;
++      position += bytes;
++    }
++
++    /* Truncate the file to the correct size */
++    fflush(output);
++    ftruncate(fileno(output), position);
++  }
++
++  /* If we get here, we're done! */
++  return 0;
++
++  /* Common bailout code */
++ free_ptr_bail:
++  free(pointer_block);
++  return err;
++}
++
+
+--- zisofs_tools/config.h	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/config.h	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,28 @@
++/* config.h.  Generated automatically by configure.  */
++/* -*- c -*- ------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++/* $Id: config.h.in,v 1.1 2001/07/27 14:37:07 hpa Exp $ */
++
++/*
++ * config.h.in
++ *
++ * Pattern file for configurations
++ */
++
++#define HAVE_SYSEXITS_H 1		/* Define if <sysexits.h> exists */
++#define HAVE_GETOPT_H 1		/* Define if <getopt.h> exists */
++#define HAVE_GETOPT_LONG 1		/* Define if we have getopt_long() */
++#define HAVE_LCHOWN 1		/* Define if we have lchown() */
++/* #undef off_t */			/* Define to long if off_t missing */
++/* #undef size_t */			/* Define to unsigned long if size_t missing */
++/* #undef ssize_t */			/* Define to long if ssize_t missing */
++
+
+--- zisofs_tools/config.h.in	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/config.h.in	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,27 @@
++/* -*- c -*- ------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++/* $Id: config.h.in,v 1.1 2001/07/27 14:37:07 hpa Exp $ */
++
++/*
++ * config.h.in
++ *
++ * Pattern file for configurations
++ */
++
++#undef HAVE_SYSEXITS_H		/* Define if <sysexits.h> exists */
++#undef HAVE_GETOPT_H		/* Define if <getopt.h> exists */
++#undef HAVE_GETOPT_LONG		/* Define if we have getopt_long() */
++#undef HAVE_LCHOWN		/* Define if we have lchown() */
++#undef off_t			/* Define to long if off_t missing */
++#undef size_t			/* Define to unsigned long if size_t missing */
++#undef ssize_t			/* Define to long if ssize_t missing */
++
+
+--- zisofs_tools/configure	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/configure	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,2186 @@
++#! /bin/sh
++
++# Guess values for system-dependent variables and create Makefiles.
++# Generated automatically using autoconf version 2.13 
++# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
++#
++# This configure script is free software; the Free Software Foundation
++# gives unlimited permission to copy, distribute and modify it.
++
++# Defaults:
++ac_help=
++ac_default_prefix=/usr/local
++# Any additions from configure.in:
++ac_default_prefix=/usr
++
++# Initialize some variables set by options.
++# The variables have the same names as the options, with
++# dashes changed to underlines.
++build=NONE
++cache_file=./config.cache
++exec_prefix=NONE
++host=NONE
++no_create=
++nonopt=NONE
++no_recursion=
++prefix=NONE
++program_prefix=NONE
++program_suffix=NONE
++program_transform_name=s,x,x,
++silent=
++site=
++srcdir=
++target=NONE
++verbose=
++x_includes=NONE
++x_libraries=NONE
++bindir='${exec_prefix}/bin'
++sbindir='${exec_prefix}/sbin'
++libexecdir='${exec_prefix}/libexec'
++datadir='${prefix}/share'
++sysconfdir='${prefix}/etc'
++sharedstatedir='${prefix}/com'
++localstatedir='${prefix}/var'
++libdir='${exec_prefix}/lib'
++includedir='${prefix}/include'
++oldincludedir='/usr/include'
++infodir='${prefix}/info'
++mandir='${prefix}/man'
++
++# Initialize some other variables.
++subdirs=
++MFLAGS= MAKEFLAGS=
++SHELL=${CONFIG_SHELL-/bin/sh}
++# Maximum number of lines to put in a shell here document.
++ac_max_here_lines=12
++
++ac_prev=
++for ac_option
++do
++
++  # If the previous option needs an argument, assign it.
++  if test -n "$ac_prev"; then
++    eval "$ac_prev=\$ac_option"
++    ac_prev=
++    continue
++  fi
++
++  case "$ac_option" in
++  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
++  *) ac_optarg= ;;
++  esac
++
++  # Accept the important Cygnus configure options, so we can diagnose typos.
++
++  case "$ac_option" in
++
++  -bindir | --bindir | --bindi | --bind | --bin | --bi)
++    ac_prev=bindir ;;
++  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
++    bindir="$ac_optarg" ;;
++
++  -build | --build | --buil | --bui | --bu)
++    ac_prev=build ;;
++  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
++    build="$ac_optarg" ;;
++
++  -cache-file | --cache-file | --cache-fil | --cache-fi \
++  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
++    ac_prev=cache_file ;;
++  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
++  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
++    cache_file="$ac_optarg" ;;
++
++  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
++    ac_prev=datadir ;;
++  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
++  | --da=*)
++    datadir="$ac_optarg" ;;
++
++  -disable-* | --disable-*)
++    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
++    # Reject names that are not valid shell variable names.
++    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
++      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
++    fi
++    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
++    eval "enable_${ac_feature}=no" ;;
++
++  -enable-* | --enable-*)
++    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
++    # Reject names that are not valid shell variable names.
++    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
++      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
++    fi
++    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
++    case "$ac_option" in
++      *=*) ;;
++      *) ac_optarg=yes ;;
++    esac
++    eval "enable_${ac_feature}='$ac_optarg'" ;;
++
++  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
++  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
++  | --exec | --exe | --ex)
++    ac_prev=exec_prefix ;;
++  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
++  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
++  | --exec=* | --exe=* | --ex=*)
++    exec_prefix="$ac_optarg" ;;
++
++  -gas | --gas | --ga | --g)
++    # Obsolete; use --with-gas.
++    with_gas=yes ;;
++
++  -help | --help | --hel | --he)
++    # Omit some internal or obsolete options to make the list less imposing.
++    # This message is too long to be a string in the A/UX 3.1 sh.
++    cat << EOF
++Usage: configure [options] [host]
++Options: [defaults in brackets after descriptions]
++Configuration:
++  --cache-file=FILE       cache test results in FILE
++  --help                  print this message
++  --no-create             do not create output files
++  --quiet, --silent       do not print \`checking...' messages
++  --version               print the version of autoconf that created configure
++Directory and file names:
++  --prefix=PREFIX         install architecture-independent files in PREFIX
++                          [$ac_default_prefix]
++  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
++                          [same as prefix]
++  --bindir=DIR            user executables in DIR [EPREFIX/bin]
++  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
++  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
++  --datadir=DIR           read-only architecture-independent data in DIR
++                          [PREFIX/share]
++  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
++  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
++                          [PREFIX/com]
++  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
++  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
++  --includedir=DIR        C header files in DIR [PREFIX/include]
++  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
++  --infodir=DIR           info documentation in DIR [PREFIX/info]
++  --mandir=DIR            man documentation in DIR [PREFIX/man]
++  --srcdir=DIR            find the sources in DIR [configure dir or ..]
++  --program-prefix=PREFIX prepend PREFIX to installed program names
++  --program-suffix=SUFFIX append SUFFIX to installed program names
++  --program-transform-name=PROGRAM
++                          run sed PROGRAM on installed program names
++EOF
++    cat << EOF
++Host type:
++  --build=BUILD           configure for building on BUILD [BUILD=HOST]
++  --host=HOST             configure for HOST [guessed]
++  --target=TARGET         configure for TARGET [TARGET=HOST]
++Features and packages:
++  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
++  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
++  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
++  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
++  --x-includes=DIR        X include files are in DIR
++  --x-libraries=DIR       X library files are in DIR
++EOF
++    if test -n "$ac_help"; then
++      echo "--enable and --with options recognized:$ac_help"
++    fi
++    exit 0 ;;
++
++  -host | --host | --hos | --ho)
++    ac_prev=host ;;
++  -host=* | --host=* | --hos=* | --ho=*)
++    host="$ac_optarg" ;;
++
++  -includedir | --includedir | --includedi | --included | --include \
++  | --includ | --inclu | --incl | --inc)
++    ac_prev=includedir ;;
++  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
++  | --includ=* | --inclu=* | --incl=* | --inc=*)
++    includedir="$ac_optarg" ;;
++
++  -infodir | --infodir | --infodi | --infod | --info | --inf)
++    ac_prev=infodir ;;
++  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
++    infodir="$ac_optarg" ;;
++
++  -libdir | --libdir | --libdi | --libd)
++    ac_prev=libdir ;;
++  -libdir=* | --libdir=* | --libdi=* | --libd=*)
++    libdir="$ac_optarg" ;;
++
++  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
++  | --libexe | --libex | --libe)
++    ac_prev=libexecdir ;;
++  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
++  | --libexe=* | --libex=* | --libe=*)
++    libexecdir="$ac_optarg" ;;
++
++  -localstatedir | --localstatedir | --localstatedi | --localstated \
++  | --localstate | --localstat | --localsta | --localst \
++  | --locals | --local | --loca | --loc | --lo)
++    ac_prev=localstatedir ;;
++  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
++  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
++  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
++    localstatedir="$ac_optarg" ;;
++
++  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
++    ac_prev=mandir ;;
++  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
++    mandir="$ac_optarg" ;;
++
++  -nfp | --nfp | --nf)
++    # Obsolete; use --without-fp.
++    with_fp=no ;;
++
++  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
++  | --no-cr | --no-c)
++    no_create=yes ;;
++
++  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
++  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
++    no_recursion=yes ;;
++
++  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
++  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
++  | --oldin | --oldi | --old | --ol | --o)
++    ac_prev=oldincludedir ;;
++  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
++  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
++  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
++    oldincludedir="$ac_optarg" ;;
++
++  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
++    ac_prev=prefix ;;
++  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
++    prefix="$ac_optarg" ;;
++
++  -program-prefix | --program-prefix | --program-prefi | --program-pref \
++  | --program-pre | --program-pr | --program-p)
++    ac_prev=program_prefix ;;
++  -program-prefix=* | --program-prefix=* | --program-prefi=* \
++  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
++    program_prefix="$ac_optarg" ;;
++
++  -program-suffix | --program-suffix | --program-suffi | --program-suff \
++  | --program-suf | --program-su | --program-s)
++    ac_prev=program_suffix ;;
++  -program-suffix=* | --program-suffix=* | --program-suffi=* \
++  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
++    program_suffix="$ac_optarg" ;;
++
++  -program-transform-name | --program-transform-name \
++  | --program-transform-nam | --program-transform-na \
++  | --program-transform-n | --program-transform- \
++  | --program-transform | --program-transfor \
++  | --program-transfo | --program-transf \
++  | --program-trans | --program-tran \
++  | --progr-tra | --program-tr | --program-t)
++    ac_prev=program_transform_name ;;
++  -program-transform-name=* | --program-transform-name=* \
++  | --program-transform-nam=* | --program-transform-na=* \
++  | --program-transform-n=* | --program-transform-=* \
++  | --program-transform=* | --program-transfor=* \
++  | --program-transfo=* | --program-transf=* \
++  | --program-trans=* | --program-tran=* \
++  | --progr-tra=* | --program-tr=* | --program-t=*)
++    program_transform_name="$ac_optarg" ;;
++
++  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++  | -silent | --silent | --silen | --sile | --sil)
++    silent=yes ;;
++
++  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
++    ac_prev=sbindir ;;
++  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
++  | --sbi=* | --sb=*)
++    sbindir="$ac_optarg" ;;
++
++  -sharedstatedir | --sharedstatedir | --sharedstatedi \
++  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
++  | --sharedst | --shareds | --shared | --share | --shar \
++  | --sha | --sh)
++    ac_prev=sharedstatedir ;;
++  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
++  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
++  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
++  | --sha=* | --sh=*)
++    sharedstatedir="$ac_optarg" ;;
++
++  -site | --site | --sit)
++    ac_prev=site ;;
++  -site=* | --site=* | --sit=*)
++    site="$ac_optarg" ;;
++
++  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
++    ac_prev=srcdir ;;
++  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
++    srcdir="$ac_optarg" ;;
++
++  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
++  | --syscon | --sysco | --sysc | --sys | --sy)
++    ac_prev=sysconfdir ;;
++  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
++  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
++    sysconfdir="$ac_optarg" ;;
++
++  -target | --target | --targe | --targ | --tar | --ta | --t)
++    ac_prev=target ;;
++  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
++    target="$ac_optarg" ;;
++
++  -v | -verbose | --verbose | --verbos | --verbo | --verb)
++    verbose=yes ;;
++
++  -version | --version | --versio | --versi | --vers)
++    echo "configure generated by autoconf version 2.13"
++    exit 0 ;;
++
++  -with-* | --with-*)
++    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
++    # Reject names that are not valid shell variable names.
++    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
++      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
++    fi
++    ac_package=`echo $ac_package| sed 's/-/_/g'`
++    case "$ac_option" in
++      *=*) ;;
++      *) ac_optarg=yes ;;
++    esac
++    eval "with_${ac_package}='$ac_optarg'" ;;
++
++  -without-* | --without-*)
++    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
++    # Reject names that are not valid shell variable names.
++    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
++      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
++    fi
++    ac_package=`echo $ac_package| sed 's/-/_/g'`
++    eval "with_${ac_package}=no" ;;
++
++  --x)
++    # Obsolete; use --with-x.
++    with_x=yes ;;
++
++  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
++  | --x-incl | --x-inc | --x-in | --x-i)
++    ac_prev=x_includes ;;
++  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
++  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
++    x_includes="$ac_optarg" ;;
++
++  -x-libraries | --x-libraries | --x-librarie | --x-librari \
++  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
++    ac_prev=x_libraries ;;
++  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
++  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
++    x_libraries="$ac_optarg" ;;
++
++  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
++    ;;
++
++  *)
++    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
++      echo "configure: warning: $ac_option: invalid host type" 1>&2
++    fi
++    if test "x$nonopt" != xNONE; then
++      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
++    fi
++    nonopt="$ac_option"
++    ;;
++
++  esac
++done
++
++if test -n "$ac_prev"; then
++  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
++fi
++
++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
++
++# File descriptor usage:
++# 0 standard input
++# 1 file creation
++# 2 errors and warnings
++# 3 some systems may open it to /dev/tty
++# 4 used on the Kubota Titan
++# 6 checking for... messages and results
++# 5 compiler messages saved in config.log
++if test "$silent" = yes; then
++  exec 6>/dev/null
++else
++  exec 6>&1
++fi
++exec 5>./config.log
++
++echo "\
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
++" 1>&5
++
++# Strip out --no-create and --no-recursion so they do not pile up.
++# Also quote any args containing shell metacharacters.
++ac_configure_args=
++for ac_arg
++do
++  case "$ac_arg" in
++  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
++  | --no-cr | --no-c) ;;
++  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
++  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
++  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
++  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
++  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
++  esac
++done
++
++# NLS nuisances.
++# Only set these to C if already set.  These must not be set unconditionally
++# because not all systems understand e.g. LANG=C (notably SCO).
++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
++# Non-C LC_CTYPE values break the ctype check.
++if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
++if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
++
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++echo > confdefs.h
++
++# A filename unique to this package, relative to the directory that
++# configure is in, which we can look for to find out if srcdir is correct.
++ac_unique_file=MCONFIG.in
++
++# Find the source files, if location was not specified.
++if test -z "$srcdir"; then
++  ac_srcdir_defaulted=yes
++  # Try the directory containing this script, then its parent.
++  ac_prog=$0
++  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
++  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
++  srcdir=$ac_confdir
++  if test ! -r $srcdir/$ac_unique_file; then
++    srcdir=..
++  fi
++else
++  ac_srcdir_defaulted=no
++fi
++if test ! -r $srcdir/$ac_unique_file; then
++  if test "$ac_srcdir_defaulted" = yes; then
++    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
++  else
++    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
++  fi
++fi
++srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
++
++# Prefer explicitly selected file to automatically selected ones.
++if test -z "$CONFIG_SITE"; then
++  if test "x$prefix" != xNONE; then
++    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++  else
++    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
++  fi
++fi
++for ac_site_file in $CONFIG_SITE; do
++  if test -r "$ac_site_file"; then
++    echo "loading site script $ac_site_file"
++    . "$ac_site_file"
++  fi
++done
++
++if test -r "$cache_file"; then
++  echo "loading cache $cache_file"
++  . $cache_file
++else
++  echo "creating cache $cache_file"
++  > $cache_file
++fi
++
++ac_ext=c
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++
++ac_exeext=
++ac_objext=o
++if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
++  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
++  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
++    ac_n= ac_c='
++' ac_t='	'
++  else
++    ac_n=-n ac_c= ac_t=
++  fi
++else
++  ac_n= ac_c='\c' ac_t=
++fi
++
++
++
++
++# Extract the first word of "gcc", so it can be a program name with args.
++set dummy gcc; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:531: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
++  ac_dummy="$PATH"
++  for ac_dir in $ac_dummy; do
++    test -z "$ac_dir" && ac_dir=.
++    if test -f $ac_dir/$ac_word; then
++      ac_cv_prog_CC="gcc"
++      break
++    fi
++  done
++  IFS="$ac_save_ifs"
++fi
++fi
++CC="$ac_cv_prog_CC"
++if test -n "$CC"; then
++  echo "$ac_t""$CC" 1>&6
++else
++  echo "$ac_t""no" 1>&6
++fi
++
++if test -z "$CC"; then
++  # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:561: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
++  ac_prog_rejected=no
++  ac_dummy="$PATH"
++  for ac_dir in $ac_dummy; do
++    test -z "$ac_dir" && ac_dir=.
++    if test -f $ac_dir/$ac_word; then
++      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
++        ac_prog_rejected=yes
++	continue
++      fi
++      ac_cv_prog_CC="cc"
++      break
++    fi
++  done
++  IFS="$ac_save_ifs"
++if test $ac_prog_rejected = yes; then
++  # We found a bogon in the path, so make sure we never use it.
++  set dummy $ac_cv_prog_CC
++  shift
++  if test $# -gt 0; then
++    # We chose a different compiler from the bogus one.
++    # However, it has the same basename, so the bogon will be chosen
++    # first if we set CC to just the basename; use the full file name.
++    shift
++    set dummy "$ac_dir/$ac_word" "$@"
++    shift
++    ac_cv_prog_CC="$@"
++  fi
++fi
++fi
++fi
++CC="$ac_cv_prog_CC"
++if test -n "$CC"; then
++  echo "$ac_t""$CC" 1>&6
++else
++  echo "$ac_t""no" 1>&6
++fi
++
++  if test -z "$CC"; then
++    case "`uname -s`" in
++    *win32* | *WIN32*)
++      # Extract the first word of "cl", so it can be a program name with args.
++set dummy cl; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:612: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
++  ac_dummy="$PATH"
++  for ac_dir in $ac_dummy; do
++    test -z "$ac_dir" && ac_dir=.
++    if test -f $ac_dir/$ac_word; then
++      ac_cv_prog_CC="cl"
++      break
++    fi
++  done
++  IFS="$ac_save_ifs"
++fi
++fi
++CC="$ac_cv_prog_CC"
++if test -n "$CC"; then
++  echo "$ac_t""$CC" 1>&6
++else
++  echo "$ac_t""no" 1>&6
++fi
++ ;;
++    esac
++  fi
++  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
++fi
++
++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
++echo "configure:644: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++
++ac_ext=c
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++
++cat > conftest.$ac_ext << EOF
++
++#line 655 "configure"
++#include "confdefs.h"
++
++main(){return(0);}
++EOF
++if { (eval echo configure:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++  ac_cv_prog_cc_works=yes
++  # If we can't run a trivial program, we are probably using a cross compiler.
++  if (./conftest; exit) 2>/dev/null; then
++    ac_cv_prog_cc_cross=no
++  else
++    ac_cv_prog_cc_cross=yes
++  fi
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  ac_cv_prog_cc_works=no
++fi
++rm -fr conftest*
++ac_ext=c
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++
++echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
++if test $ac_cv_prog_cc_works = no; then
++  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
++fi
++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
++echo "configure:686: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
++cross_compiling=$ac_cv_prog_cc_cross
++
++echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
++echo "configure:691: checking whether we are using GNU C" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.c <<EOF
++#ifdef __GNUC__
++  yes;
++#endif
++EOF
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++  ac_cv_prog_gcc=yes
++else
++  ac_cv_prog_gcc=no
++fi
++fi
++
++echo "$ac_t""$ac_cv_prog_gcc" 1>&6
++
++if test $ac_cv_prog_gcc = yes; then
++  GCC=yes
++else
++  GCC=
++fi
++
++ac_test_CFLAGS="${CFLAGS+set}"
++ac_save_CFLAGS="$CFLAGS"
++CFLAGS=
++echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
++echo "configure:719: checking whether ${CC-cc} accepts -g" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  echo 'void f(){}' > conftest.c
++if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
++  ac_cv_prog_cc_g=yes
++else
++  ac_cv_prog_cc_g=no
++fi
++rm -f conftest*
++
++fi
++
++echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
++if test "$ac_test_CFLAGS" = set; then
++  CFLAGS="$ac_save_CFLAGS"
++elif test $ac_cv_prog_cc_g = yes; then
++  if test "$GCC" = yes; then
++    CFLAGS="-g -O2"
++  else
++    CFLAGS="-g"
++  fi
++else
++  if test "$GCC" = yes; then
++    CFLAGS="-O2"
++  else
++    CFLAGS=
++  fi
++fi
++
++echo $ac_n "checking for working const""... $ac_c" 1>&6
++echo "configure:751: checking for working const" >&5
++if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 756 "configure"
++#include "confdefs.h"
++
++int main() {
++
++/* Ultrix mips cc rejects this.  */
++typedef int charset[2]; const charset x;
++/* SunOS 4.1.1 cc rejects this.  */
++char const *const *ccp;
++char **p;
++/* NEC SVR4.0.2 mips cc rejects this.  */
++struct point {int x, y;};
++static struct point const zero = {0,0};
++/* AIX XL C 1.02.0.0 rejects this.
++   It does not let you subtract one const X* pointer from another in an arm
++   of an if-expression whose if-part is not a constant expression */
++const char *g = "string";
++ccp = &g + (g ? g-g : 0);
++/* HPUX 7.0 cc rejects these. */
++++ccp;
++p = (char**) ccp;
++ccp = (char const *const *) p;
++{ /* SCO 3.2v4 cc rejects this.  */
++  char *t;
++  char const *s = 0 ? (char *) 0 : (char const *) 0;
++
++  *t++ = 0;
++}
++{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
++  int x[] = {25, 17};
++  const int *foo = &x[0];
++  ++foo;
++}
++{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
++  typedef const int *iptr;
++  iptr p = 0;
++  ++p;
++}
++{ /* AIX XL C 1.02.0.0 rejects this saying
++     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
++  struct s { int j; const int *ap[3]; };
++  struct s *b; b->j = 5;
++}
++{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
++  const int foo = 10;
++}
++
++; return 0; }
++EOF
++if { (eval echo configure:805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  ac_cv_c_const=yes
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  ac_cv_c_const=no
++fi
++rm -f conftest*
++fi
++
++echo "$ac_t""$ac_cv_c_const" 1>&6
++if test $ac_cv_c_const = no; then
++  cat >> confdefs.h <<\EOF
++#define const 
++EOF
++
++fi
++
++echo $ac_n "checking for inline""... $ac_c" 1>&6
++echo "configure:826: checking for inline" >&5
++if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  ac_cv_c_inline=no
++for ac_kw in inline __inline__ __inline; do
++  cat > conftest.$ac_ext <<EOF
++#line 833 "configure"
++#include "confdefs.h"
++
++int main() {
++} $ac_kw foo() {
++; return 0; }
++EOF
++if { (eval echo configure:840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  ac_cv_c_inline=$ac_kw; break
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++done
++
++fi
++
++echo "$ac_t""$ac_cv_c_inline" 1>&6
++case "$ac_cv_c_inline" in
++  inline | yes) ;;
++  no) cat >> confdefs.h <<\EOF
++#define inline 
++EOF
++ ;;
++  *)  cat >> confdefs.h <<EOF
++#define inline $ac_cv_c_inline
++EOF
++ ;;
++esac
++
++
++echo $ac_n "checking if $CC accepts -Wall""... $ac_c" 1>&6
++echo "configure:867: checking if $CC accepts -Wall" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wall"
++ cat > conftest.$ac_ext <<EOF
++#line 871 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -W""... $ac_c" 1>&6
++echo "configure:890: checking if $CC accepts -W" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -W"
++ cat > conftest.$ac_ext <<EOF
++#line 894 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wpointer-arith""... $ac_c" 1>&6
++echo "configure:913: checking if $CC accepts -Wpointer-arith" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wpointer-arith"
++ cat > conftest.$ac_ext <<EOF
++#line 917 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wbad-function-cast""... $ac_c" 1>&6
++echo "configure:936: checking if $CC accepts -Wbad-function-cast" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wbad-function-cast"
++ cat > conftest.$ac_ext <<EOF
++#line 940 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wcast-equal""... $ac_c" 1>&6
++echo "configure:959: checking if $CC accepts -Wcast-equal" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wcast-equal"
++ cat > conftest.$ac_ext <<EOF
++#line 963 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wstrict-prototypes""... $ac_c" 1>&6
++echo "configure:982: checking if $CC accepts -Wstrict-prototypes" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wstrict-prototypes"
++ cat > conftest.$ac_ext <<EOF
++#line 986 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wmissing-prototypes""... $ac_c" 1>&6
++echo "configure:1005: checking if $CC accepts -Wmissing-prototypes" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wmissing-prototypes"
++ cat > conftest.$ac_ext <<EOF
++#line 1009 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wmissing-declarations""... $ac_c" 1>&6
++echo "configure:1028: checking if $CC accepts -Wmissing-declarations" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wmissing-declarations"
++ cat > conftest.$ac_ext <<EOF
++#line 1032 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wnested-externs""... $ac_c" 1>&6
++echo "configure:1051: checking if $CC accepts -Wnested-externs" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wnested-externs"
++ cat > conftest.$ac_ext <<EOF
++#line 1055 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Winline""... $ac_c" 1>&6
++echo "configure:1074: checking if $CC accepts -Winline" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Winline"
++ cat > conftest.$ac_ext <<EOF
++#line 1078 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wshadow""... $ac_c" 1>&6
++echo "configure:1097: checking if $CC accepts -Wshadow" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wshadow"
++ cat > conftest.$ac_ext <<EOF
++#line 1101 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -Wcast-align""... $ac_c" 1>&6
++echo "configure:1120: checking if $CC accepts -Wcast-align" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -Wcast-align"
++ cat > conftest.$ac_ext <<EOF
++#line 1124 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++echo $ac_n "checking if $CC accepts -pipe""... $ac_c" 1>&6
++echo "configure:1143: checking if $CC accepts -pipe" >&5
++ pa_add_cflags__old_cflags="$CFLAGS"
++ CFLAGS="$CFLAGS -pipe"
++ cat > conftest.$ac_ext <<EOF
++#line 1147 "configure"
++#include "confdefs.h"
++#include <stdio.h>
++int main() {
++printf("Hello, World!\n");
++; return 0; }
++EOF
++if { (eval echo configure:1154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++  rm -rf conftest*
++  echo "$ac_t""yes" 1>&6
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  echo "$ac_t""no" 1>&6
++ CFLAGS="$pa_add_cflags__old_cflags"
++fi
++rm -f conftest*
++
++echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
++echo "configure:1167: checking how to run the C preprocessor" >&5
++# On Suns, sometimes $CPP names a directory.
++if test -n "$CPP" && test -d "$CPP"; then
++  CPP=
++fi
++if test -z "$CPP"; then
++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++    # This must be in double quotes, not single quotes, because CPP may get
++  # substituted into the Makefile and "${CC-cc}" will confuse make.
++  CPP="${CC-cc} -E"
++  # On the NeXT, cc -E runs the code through the compiler's parser,
++  # not just through cpp.
++  cat > conftest.$ac_ext <<EOF
++#line 1182 "configure"
++#include "confdefs.h"
++#include <assert.h>
++Syntax Error
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++  :
++else
++  echo "$ac_err" >&5
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  CPP="${CC-cc} -E -traditional-cpp"
++  cat > conftest.$ac_ext <<EOF
++#line 1199 "configure"
++#include "confdefs.h"
++#include <assert.h>
++Syntax Error
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++  :
++else
++  echo "$ac_err" >&5
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  CPP="${CC-cc} -nologo -E"
++  cat > conftest.$ac_ext <<EOF
++#line 1216 "configure"
++#include "confdefs.h"
++#include <assert.h>
++Syntax Error
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++  :
++else
++  echo "$ac_err" >&5
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  CPP=/lib/cpp
++fi
++rm -f conftest*
++fi
++rm -f conftest*
++fi
++rm -f conftest*
++  ac_cv_prog_CPP="$CPP"
++fi
++  CPP="$ac_cv_prog_CPP"
++else
++  ac_cv_prog_CPP="$CPP"
++fi
++echo "$ac_t""$CPP" 1>&6
++
++for ac_hdr in sysexits.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:1250: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1255 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++  rm -rf conftest*
++  eval "ac_cv_header_$ac_safe=yes"
++else
++  echo "$ac_err" >&5
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++  echo "$ac_t""yes" 1>&6
++    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++  cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++ 
++else
++  echo "$ac_t""no" 1>&6
++fi
++done
++
++for ac_hdr in getopt.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:1290: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1295 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++  rm -rf conftest*
++  eval "ac_cv_header_$ac_safe=yes"
++else
++  echo "$ac_err" >&5
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++  echo "$ac_t""yes" 1>&6
++    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++  cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++ 
++else
++  echo "$ac_t""no" 1>&6
++fi
++done
++
++
++echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
++echo "configure:1328: checking for ANSI C header files" >&5
++if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1333 "configure"
++#include "confdefs.h"
++#include <stdlib.h>
++#include <stdarg.h>
++#include <string.h>
++#include <float.h>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++  rm -rf conftest*
++  ac_cv_header_stdc=yes
++else
++  echo "$ac_err" >&5
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  ac_cv_header_stdc=no
++fi
++rm -f conftest*
++
++if test $ac_cv_header_stdc = yes; then
++  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
++cat > conftest.$ac_ext <<EOF
++#line 1358 "configure"
++#include "confdefs.h"
++#include <string.h>
++EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  egrep "memchr" >/dev/null 2>&1; then
++  :
++else
++  rm -rf conftest*
++  ac_cv_header_stdc=no
++fi
++rm -f conftest*
++
++fi
++
++if test $ac_cv_header_stdc = yes; then
++  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
++cat > conftest.$ac_ext <<EOF
++#line 1376 "configure"
++#include "confdefs.h"
++#include <stdlib.h>
++EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  egrep "free" >/dev/null 2>&1; then
++  :
++else
++  rm -rf conftest*
++  ac_cv_header_stdc=no
++fi
++rm -f conftest*
++
++fi
++
++if test $ac_cv_header_stdc = yes; then
++  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
++if test "$cross_compiling" = yes; then
++  :
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1397 "configure"
++#include "confdefs.h"
++#include <ctype.h>
++#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
++#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
++int main () { int i; for (i = 0; i < 256; i++)
++if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
++exit (0); }
++
++EOF
++if { (eval echo configure:1408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++then
++  :
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -fr conftest*
++  ac_cv_header_stdc=no
++fi
++rm -fr conftest*
++fi
++
++fi
++fi
++
++echo "$ac_t""$ac_cv_header_stdc" 1>&6
++if test $ac_cv_header_stdc = yes; then
++  cat >> confdefs.h <<\EOF
++#define STDC_HEADERS 1
++EOF
++
++fi
++
++echo $ac_n "checking for off_t""... $ac_c" 1>&6
++echo "configure:1432: checking for off_t" >&5
++if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1437 "configure"
++#include "confdefs.h"
++#include <sys/types.h>
++#if STDC_HEADERS
++#include <stdlib.h>
++#include <stddef.h>
++#endif
++EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
++  rm -rf conftest*
++  ac_cv_type_off_t=yes
++else
++  rm -rf conftest*
++  ac_cv_type_off_t=no
++fi
++rm -f conftest*
++
++fi
++echo "$ac_t""$ac_cv_type_off_t" 1>&6
++if test $ac_cv_type_off_t = no; then
++  cat >> confdefs.h <<\EOF
++#define off_t signed long
++EOF
++
++fi
++
++echo $ac_n "checking for size_t""... $ac_c" 1>&6
++echo "configure:1465: checking for size_t" >&5
++if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1470 "configure"
++#include "confdefs.h"
++#include <sys/types.h>
++#if STDC_HEADERS
++#include <stdlib.h>
++#include <stddef.h>
++#endif
++EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
++  rm -rf conftest*
++  ac_cv_type_size_t=yes
++else
++  rm -rf conftest*
++  ac_cv_type_size_t=no
++fi
++rm -f conftest*
++
++fi
++echo "$ac_t""$ac_cv_type_size_t" 1>&6
++if test $ac_cv_type_size_t = no; then
++  cat >> confdefs.h <<\EOF
++#define size_t unsigned long
++EOF
++
++fi
++
++echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
++echo "configure:1498: checking for ssize_t" >&5
++if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1503 "configure"
++#include "confdefs.h"
++#include <sys/types.h>
++#if STDC_HEADERS
++#include <stdlib.h>
++#include <stddef.h>
++#endif
++EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
++  rm -rf conftest*
++  ac_cv_type_ssize_t=yes
++else
++  rm -rf conftest*
++  ac_cv_type_ssize_t=no
++fi
++rm -f conftest*
++
++fi
++echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
++if test $ac_cv_type_ssize_t = no; then
++  cat >> confdefs.h <<\EOF
++#define ssize_t signed long
++EOF
++
++fi
++
++
++for ac_func in lchown
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:1534: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  cat > conftest.$ac_ext <<EOF
++#line 1539 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++    which can conflict with char $ac_func(); below.  */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error.  */
++/* We use char because int might match the return type of a gcc2
++    builtin and then its argument prototype would still apply.  */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++    to always fail with ENOSYS.  Some functions are actually named
++    something starting with __ and the normal name is an alias.  */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++  rm -rf conftest*
++  eval "ac_cv_func_$ac_func=yes"
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++  rm -rf conftest*
++  eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++  echo "$ac_t""yes" 1>&6
++    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++  cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++ 
++else
++  echo "$ac_t""no" 1>&6
++fi
++done
++
++
++
++echo $ac_n "checking for library containing compress2""... $ac_c" 1>&6
++echo "configure:1589: checking for library containing compress2" >&5
++if eval "test \"`echo '$''{'ac_cv_search_compress2'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  ac_func_search_save_LIBS="$LIBS"
++ac_cv_search_compress2="no"
++cat > conftest.$ac_ext <<EOF
++#line 1596 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error.  */
++/* We use char because int might match the return type of a gcc2
++    builtin and then its argument prototype would still apply.  */
++char compress2();
++
++int main() {
++compress2()
++; return 0; }
++EOF
++if { (eval echo configure:1607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++  rm -rf conftest*
++  ac_cv_search_compress2="none required"
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++test "$ac_cv_search_compress2" = "no" && for i in z; do
++LIBS="-l$i  $ac_func_search_save_LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 1618 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error.  */
++/* We use char because int might match the return type of a gcc2
++    builtin and then its argument prototype would still apply.  */
++char compress2();
++
++int main() {
++compress2()
++; return 0; }
++EOF
++if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++  rm -rf conftest*
++  ac_cv_search_compress2="-l$i"
++break
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++done
++LIBS="$ac_func_search_save_LIBS"
++fi
++
++echo "$ac_t""$ac_cv_search_compress2" 1>&6
++if test "$ac_cv_search_compress2" != "no"; then
++  test "$ac_cv_search_compress2" = "none required" || LIBS="$ac_cv_search_compress2 $LIBS"
++  
++else :
++  { echo "configure: error: zlib not found" 1>&2; exit 1; }
++fi
++
++echo $ac_n "checking for library containing getopt_long""... $ac_c" 1>&6
++echo "configure:1651: checking for library containing getopt_long" >&5
++if eval "test \"`echo '$''{'ac_cv_search_getopt_long'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  ac_func_search_save_LIBS="$LIBS"
++ac_cv_search_getopt_long="no"
++cat > conftest.$ac_ext <<EOF
++#line 1658 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error.  */
++/* We use char because int might match the return type of a gcc2
++    builtin and then its argument prototype would still apply.  */
++char getopt_long();
++
++int main() {
++getopt_long()
++; return 0; }
++EOF
++if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++  rm -rf conftest*
++  ac_cv_search_getopt_long="none required"
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++test "$ac_cv_search_getopt_long" = "no" && for i in getopt getopt_long; do
++LIBS="-l$i  $ac_func_search_save_LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 1680 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error.  */
++/* We use char because int might match the return type of a gcc2
++    builtin and then its argument prototype would still apply.  */
++char getopt_long();
++
++int main() {
++getopt_long()
++; return 0; }
++EOF
++if { (eval echo configure:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++  rm -rf conftest*
++  ac_cv_search_getopt_long="-l$i"
++break
++else
++  echo "configure: failed program was:" >&5
++  cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++done
++LIBS="$ac_func_search_save_LIBS"
++fi
++
++echo "$ac_t""$ac_cv_search_getopt_long" 1>&6
++if test "$ac_cv_search_getopt_long" != "no"; then
++  test "$ac_cv_search_getopt_long" = "none required" || LIBS="$ac_cv_search_getopt_long $LIBS"
++  cat >> confdefs.h <<\EOF
++#define HAVE_GETOPT_LONG 1
++EOF
++
++else :
++  
++fi
++
++# Extract the first word of "ranlib", so it can be a program name with args.
++set dummy ranlib; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:1718: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++  if test -n "$RANLIB"; then
++  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++else
++  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
++  ac_dummy="$PATH"
++  for ac_dir in $ac_dummy; do
++    test -z "$ac_dir" && ac_dir=.
++    if test -f $ac_dir/$ac_word; then
++      ac_cv_prog_RANLIB="ranlib"
++      break
++    fi
++  done
++  IFS="$ac_save_ifs"
++  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
++fi
++fi
++RANLIB="$ac_cv_prog_RANLIB"
++if test -n "$RANLIB"; then
++  echo "$ac_t""$RANLIB" 1>&6
++else
++  echo "$ac_t""no" 1>&6
++fi
++
++ac_aux_dir=
++for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
++  if test -f $ac_dir/install-sh; then
++    ac_aux_dir=$ac_dir
++    ac_install_sh="$ac_aux_dir/install-sh -c"
++    break
++  elif test -f $ac_dir/install.sh; then
++    ac_aux_dir=$ac_dir
++    ac_install_sh="$ac_aux_dir/install.sh -c"
++    break
++  fi
++done
++if test -z "$ac_aux_dir"; then
++  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
++fi
++ac_config_guess=$ac_aux_dir/config.guess
++ac_config_sub=$ac_aux_dir/config.sub
++ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
++
++# Find a good install program.  We prefer a C program (faster),
++# so one script is as good as another.  But avoid the broken or
++# incompatible versions:
++# SysV /etc/install, /usr/sbin/install
++# SunOS /usr/etc/install
++# IRIX /sbin/install
++# AIX /bin/install
++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
++# AFS /usr/afsws/bin/install, which mishandles nonexistent args
++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# ./install, which can be erroneously created by make from ./install.sh.
++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
++echo "configure:1776: checking for a BSD compatible install" >&5
++if test -z "$INSTALL"; then
++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
++  echo $ac_n "(cached) $ac_c" 1>&6
++else
++    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
++  for ac_dir in $PATH; do
++    # Account for people who put trailing slashes in PATH elements.
++    case "$ac_dir/" in
++    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
++    *)
++      # OSF1 and SCO ODT 3.0 have their own names for install.
++      # Don't use installbsd from OSF since it installs stuff as root
++      # by default.
++      for ac_prog in ginstall scoinst install; do
++        if test -f $ac_dir/$ac_prog; then
++	  if test $ac_prog = install &&
++            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
++	    # AIX install.  It has an incompatible calling convention.
++	    :
++	  else
++	    ac_cv_path_install="$ac_dir/$ac_prog -c"
++	    break 2
++	  fi
++	fi
++      done
++      ;;
++    esac
++  done
++  IFS="$ac_save_IFS"
++
++fi
++  if test "${ac_cv_path_install+set}" = set; then
++    INSTALL="$ac_cv_path_install"
++  else
++    # As a last resort, use the slow shell script.  We don't cache a
++    # path for INSTALL within a source directory, because that will
++    # break other packages using the cache if that directory is
++    # removed, or if the path is relative.
++    INSTALL="$ac_install_sh"
++  fi
++fi
++echo "$ac_t""$INSTALL" 1>&6
++
++# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
++# It thinks the first close brace ends the variable substitution.
++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
++
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
++
++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
++
++
++
++trap '' 1 2 15
++cat > confcache <<\EOF
++# This file is a shell script that caches the results of configure
++# tests run on this system so they can be shared between configure
++# scripts and configure runs.  It is not useful on other systems.
++# If it contains results you don't want to keep, you may remove or edit it.
++#
++# By default, configure uses ./config.cache as the cache file,
++# creating it if it does not exist already.  You can give configure
++# the --cache-file=FILE option to use a different cache file; that is
++# what configure does when it calls configure scripts in
++# subdirectories, so they share the cache.
++# Giving --cache-file=/dev/null disables caching, for debugging configure.
++# config.status only pays attention to the cache file if you give it the
++# --recheck option to rerun configure.
++#
++EOF
++# The following way of writing the cache mishandles newlines in values,
++# but we know of no workaround that is simple, portable, and efficient.
++# So, don't put newlines in cache variables' values.
++# Ultrix sh set writes to stderr and can't be redirected directly,
++# and sets the high bit in the cache file unless we assign to the vars.
++(set) 2>&1 |
++  case `(ac_space=' '; set | grep ac_space) 2>&1` in
++  *ac_space=\ *)
++    # `set' does not quote correctly, so add quotes (double-quote substitution
++    # turns \\\\ into \\, and sed turns \\ into \).
++    sed -n \
++      -e "s/'/'\\\\''/g" \
++      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
++    ;;
++  *)
++    # `set' quotes correctly as required by POSIX, so do not add quotes.
++    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
++    ;;
++  esac >> confcache
++if cmp -s $cache_file confcache; then
++  :
++else
++  if test -w $cache_file; then
++    echo "updating cache $cache_file"
++    cat confcache > $cache_file
++  else
++    echo "not updating unwritable cache $cache_file"
++  fi
++fi
++rm -f confcache
++
++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
++
++test "x$prefix" = xNONE && prefix=$ac_default_prefix
++# Let make expand exec_prefix.
++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
++
++# Any assignment to VPATH causes Sun make to only execute
++# the first set of double-colon rules, so remove it if not needed.
++# If there is a colon in the path, we need to keep it.
++if test "x$srcdir" = x.; then
++  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
++fi
++
++trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
++
++DEFS=-DHAVE_CONFIG_H
++
++# Without the "./", some shells look in PATH for config.status.
++: ${CONFIG_STATUS=./config.status}
++
++echo creating $CONFIG_STATUS
++rm -f $CONFIG_STATUS
++cat > $CONFIG_STATUS <<EOF
++#! /bin/sh
++# Generated automatically by configure.
++# Run this file to recreate the current configuration.
++# This directory was configured as follows,
++# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++#
++# $0 $ac_configure_args
++#
++# Compiler output produced by configure, useful for debugging
++# configure, is in ./config.log if it exists.
++
++ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
++for ac_option
++do
++  case "\$ac_option" in
++  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
++    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
++  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
++    echo "$CONFIG_STATUS generated by autoconf version 2.13"
++    exit 0 ;;
++  -help | --help | --hel | --he | --h)
++    echo "\$ac_cs_usage"; exit 0 ;;
++  *) echo "\$ac_cs_usage"; exit 1 ;;
++  esac
++done
++
++ac_given_srcdir=$srcdir
++ac_given_INSTALL="$INSTALL"
++
++trap 'rm -fr `echo "MCONFIG config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
++EOF
++cat >> $CONFIG_STATUS <<EOF
++
++# Protect against being on the right side of a sed subst in config.status.
++sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
++ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
++$ac_vpsub
++$extrasub
++s%@SHELL@%$SHELL%g
++s%@CFLAGS@%$CFLAGS%g
++s%@CPPFLAGS@%$CPPFLAGS%g
++s%@CXXFLAGS@%$CXXFLAGS%g
++s%@FFLAGS@%$FFLAGS%g
++s%@DEFS@%$DEFS%g
++s%@LDFLAGS@%$LDFLAGS%g
++s%@LIBS@%$LIBS%g
++s%@exec_prefix@%$exec_prefix%g
++s%@prefix@%$prefix%g
++s%@program_transform_name@%$program_transform_name%g
++s%@bindir@%$bindir%g
++s%@sbindir@%$sbindir%g
++s%@libexecdir@%$libexecdir%g
++s%@datadir@%$datadir%g
++s%@sysconfdir@%$sysconfdir%g
++s%@sharedstatedir@%$sharedstatedir%g
++s%@localstatedir@%$localstatedir%g
++s%@libdir@%$libdir%g
++s%@includedir@%$includedir%g
++s%@oldincludedir@%$oldincludedir%g
++s%@infodir@%$infodir%g
++s%@mandir@%$mandir%g
++s%@CC@%$CC%g
++s%@CPP@%$CPP%g
++s%@RANLIB@%$RANLIB%g
++s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
++s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
++s%@INSTALL_DATA@%$INSTALL_DATA%g
++
++CEOF
++EOF
++
++cat >> $CONFIG_STATUS <<\EOF
++
++# Split the substitutions into bite-sized pieces for seds with
++# small command number limits, like on Digital OSF/1 and HP-UX.
++ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
++ac_file=1 # Number of current file.
++ac_beg=1 # First line for current file.
++ac_end=$ac_max_sed_cmds # Line after last line for current file.
++ac_more_lines=:
++ac_sed_cmds=""
++while $ac_more_lines; do
++  if test $ac_beg -gt 1; then
++    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
++  else
++    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
++  fi
++  if test ! -s conftest.s$ac_file; then
++    ac_more_lines=false
++    rm -f conftest.s$ac_file
++  else
++    if test -z "$ac_sed_cmds"; then
++      ac_sed_cmds="sed -f conftest.s$ac_file"
++    else
++      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
++    fi
++    ac_file=`expr $ac_file + 1`
++    ac_beg=$ac_end
++    ac_end=`expr $ac_end + $ac_max_sed_cmds`
++  fi
++done
++if test -z "$ac_sed_cmds"; then
++  ac_sed_cmds=cat
++fi
++EOF
++
++cat >> $CONFIG_STATUS <<EOF
++
++CONFIG_FILES=\${CONFIG_FILES-"MCONFIG"}
++EOF
++cat >> $CONFIG_STATUS <<\EOF
++for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
++  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++  case "$ac_file" in
++  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
++       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
++  *) ac_file_in="${ac_file}.in" ;;
++  esac
++
++  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
++
++  # Remove last slash and all that follows it.  Not all systems have dirname.
++  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
++  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
++    # The file is in a subdirectory.
++    test ! -d "$ac_dir" && mkdir "$ac_dir"
++    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
++    # A "../" for each directory in $ac_dir_suffix.
++    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
++  else
++    ac_dir_suffix= ac_dots=
++  fi
++
++  case "$ac_given_srcdir" in
++  .)  srcdir=.
++      if test -z "$ac_dots"; then top_srcdir=.
++      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
++  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
++  *) # Relative path.
++    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
++    top_srcdir="$ac_dots$ac_given_srcdir" ;;
++  esac
++
++  case "$ac_given_INSTALL" in
++  [/$]*) INSTALL="$ac_given_INSTALL" ;;
++  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
++  esac
++
++  echo creating "$ac_file"
++  rm -f "$ac_file"
++  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
++  case "$ac_file" in
++  *Makefile*) ac_comsub="1i\\
++# $configure_input" ;;
++  *) ac_comsub= ;;
++  esac
++
++  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
++  sed -e "$ac_comsub
++s%@configure_input@%$configure_input%g
++s%@srcdir@%$srcdir%g
++s%@top_srcdir@%$top_srcdir%g
++s%@INSTALL@%$INSTALL%g
++" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
++fi; done
++rm -f conftest.s*
++
++# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
++# NAME is the cpp macro being defined and VALUE is the value it is being given.
++#
++# ac_d sets the value in "#define NAME VALUE" lines.
++ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
++ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
++ac_dC='\3'
++ac_dD='%g'
++# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
++ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
++ac_uB='\([ 	]\)%\1#\2define\3'
++ac_uC=' '
++ac_uD='\4%g'
++# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
++ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
++ac_eB='$%\1#\2define\3'
++ac_eC=' '
++ac_eD='%g'
++
++if test "${CONFIG_HEADERS+set}" != set; then
++EOF
++cat >> $CONFIG_STATUS <<EOF
++  CONFIG_HEADERS="config.h"
++EOF
++cat >> $CONFIG_STATUS <<\EOF
++fi
++for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
++  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++  case "$ac_file" in
++  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
++       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
++  *) ac_file_in="${ac_file}.in" ;;
++  esac
++
++  echo creating $ac_file
++
++  rm -f conftest.frag conftest.in conftest.out
++  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
++  cat $ac_file_inputs > conftest.in
++
++EOF
++
++# Transform confdefs.h into a sed script conftest.vals that substitutes
++# the proper values into config.h.in to produce config.h.  And first:
++# Protect against being on the right side of a sed subst in config.status.
++# Protect against being in an unquoted here document in config.status.
++rm -f conftest.vals
++cat > conftest.hdr <<\EOF
++s/[\\&%]/\\&/g
++s%[\\$`]%\\&%g
++s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
++s%ac_d%ac_u%gp
++s%ac_u%ac_e%gp
++EOF
++sed -n -f conftest.hdr confdefs.h > conftest.vals
++rm -f conftest.hdr
++
++# This sed command replaces #undef with comments.  This is necessary, for
++# example, in the case of _POSIX_SOURCE, which is predefined and required
++# on some systems where configure will not decide to define it.
++cat >> conftest.vals <<\EOF
++s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
++EOF
++
++# Break up conftest.vals because some shells have a limit on
++# the size of here documents, and old seds have small limits too.
++
++rm -f conftest.tail
++while :
++do
++  ac_lines=`grep -c . conftest.vals`
++  # grep -c gives empty output for an empty file on some AIX systems.
++  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
++  # Write a limited-size here document to conftest.frag.
++  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
++  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
++  echo 'CEOF
++  sed -f conftest.frag conftest.in > conftest.out
++  rm -f conftest.in
++  mv conftest.out conftest.in
++' >> $CONFIG_STATUS
++  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
++  rm -f conftest.vals
++  mv conftest.tail conftest.vals
++done
++rm -f conftest.vals
++
++cat >> $CONFIG_STATUS <<\EOF
++  rm -f conftest.frag conftest.h
++  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
++  cat conftest.in >> conftest.h
++  rm -f conftest.in
++  if cmp -s $ac_file conftest.h 2>/dev/null; then
++    echo "$ac_file is unchanged"
++    rm -f conftest.h
++  else
++    # Remove last slash and all that follows it.  Not all systems have dirname.
++      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
++      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
++      # The file is in a subdirectory.
++      test ! -d "$ac_dir" && mkdir "$ac_dir"
++    fi
++    rm -f $ac_file
++    mv conftest.h $ac_file
++  fi
++fi; done
++
++EOF
++cat >> $CONFIG_STATUS <<EOF
++
++EOF
++cat >> $CONFIG_STATUS <<\EOF
++
++exit 0
++EOF
++chmod +x $CONFIG_STATUS
++rm -fr confdefs* $ac_clean_files
++test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
++
+
+--- zisofs_tools/configure.in	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/configure.in	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,42 @@
++dnl
++dnl autoconf input file to generate MCONFIG
++dnl
++
++AC_INIT(MCONFIG.in)
++AC_PREFIX_DEFAULT(/usr)
++
++AC_PROG_CC
++AC_C_CONST
++AC_C_INLINE
++
++PA_ADD_CFLAGS(-Wall)
++PA_ADD_CFLAGS(-W)
++PA_ADD_CFLAGS(-Wpointer-arith)
++PA_ADD_CFLAGS(-Wbad-function-cast)
++PA_ADD_CFLAGS(-Wcast-equal)
++PA_ADD_CFLAGS(-Wstrict-prototypes)
++PA_ADD_CFLAGS(-Wmissing-prototypes)
++PA_ADD_CFLAGS(-Wmissing-declarations)
++PA_ADD_CFLAGS(-Wnested-externs)
++PA_ADD_CFLAGS(-Winline)
++PA_ADD_CFLAGS(-Wshadow)
++PA_ADD_CFLAGS(-Wcast-align)
++PA_ADD_CFLAGS(-pipe)
++
++AC_CHECK_HEADERS(sysexits.h)
++AC_CHECK_HEADERS(getopt.h)
++
++AC_CHECK_TYPE(off_t, signed long)
++AC_CHECK_TYPE(size_t, unsigned long)
++AC_CHECK_TYPE(ssize_t, signed long)
++
++AC_CHECK_FUNCS(lchown)
++
++AC_SEARCH_LIBS(compress2, z, , [AC_MSG_ERROR(zlib not found, cannot continue)])
++AC_SEARCH_LIBS(getopt_long, [getopt getopt_long], AC_DEFINE(HAVE_GETOPT_LONG))
++
++AC_PROG_RANLIB
++AC_PROG_INSTALL
++
++AC_CONFIG_HEADER(config.h)
++AC_OUTPUT(MCONFIG)
+
+--- zisofs_tools/hash.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/hash.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,68 @@
++#ident "$Id: hash.c,v 1.1 2001/07/27 14:37:07 hpa Exp $"
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++/*
++ * hash.c
++ *
++ * Hash table used to find hard-linked files
++ */
++
++#include <stdlib.h>
++#include "mkzftree.h"
++
++#define HASH_BUCKETS 	  2683
++
++struct file_hash {
++  struct file_hash *next;
++  struct stat st;
++  const char *outfile_name;
++};
++
++static struct file_hash *hashp[HASH_BUCKETS];
++
++const char *hash_find_file(struct stat *st)
++{
++  int bucket = (st->st_ino + st->st_dev) % HASH_BUCKETS;
++  struct file_hash *hp;
++
++  for ( hp = hashp[bucket] ; hp ; hp = hp->next ) {
++    if ( hp->st.st_ino   == st->st_ino &&
++	 hp->st.st_dev   == st->st_dev &&
++	 hp->st.st_mode  == st->st_mode &&
++	 hp->st.st_nlink == st->st_nlink &&
++	 hp->st.st_uid   == st->st_uid &&
++	 hp->st.st_gid   == st->st_gid &&
++	 hp->st.st_size  == st->st_size &&
++	 hp->st.st_mtime == st->st_mtime ) {
++      /* Good enough, it's the same file */
++      return hp->outfile_name;
++    }
++  }
++  return NULL;			/* No match */
++}
++
++/* Note: the stat structure is the input file; the name
++   is the output file to link to */
++void hash_insert_file(struct stat *st, const char *outfile)
++{
++  int bucket = (st->st_ino + st->st_dev) % HASH_BUCKETS;
++  struct file_hash *hp = xmalloc(sizeof(struct file_hash));
++
++  hp->next         = hashp[bucket];
++  memcpy(&hp->st, st, sizeof(struct stat));
++  hp->outfile_name = xstrdup(outfile);
++
++  hashp[bucket]    = hp;
++}
++
++
+
+--- zisofs_tools/install-sh	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/install-sh	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,238 @@
++#! /bin/sh
++#
++# install - install a program, script, or datafile
++# This comes from X11R5.
++#
++# Calling this script install-sh is preferred over install.sh, to prevent
++# `make' implicit rules from creating a file called install from it
++# when there is no Makefile.
++#
++# This script is compatible with the BSD install script, but was written
++# from scratch.
++#
++
++
++# set DOITPROG to echo to test this script
++
++# Don't use :- since 4.3BSD and earlier shells don't like it.
++doit="${DOITPROG-}"
++
++
++# put in absolute paths if you don't have them in your path; or use env. vars.
++
++mvprog="${MVPROG-mv}"
++cpprog="${CPPROG-cp}"
++chmodprog="${CHMODPROG-chmod}"
++chownprog="${CHOWNPROG-chown}"
++chgrpprog="${CHGRPPROG-chgrp}"
++stripprog="${STRIPPROG-strip}"
++rmprog="${RMPROG-rm}"
++mkdirprog="${MKDIRPROG-mkdir}"
++
++tranformbasename=""
++transform_arg=""
++instcmd="$mvprog"
++chmodcmd="$chmodprog 0755"
++chowncmd=""
++chgrpcmd=""
++stripcmd=""
++rmcmd="$rmprog -f"
++mvcmd="$mvprog"
++src=""
++dst=""
++dir_arg=""
++
++while [ x"$1" != x ]; do
++    case $1 in
++	-c) instcmd="$cpprog"
++	    shift
++	    continue;;
++
++	-d) dir_arg=true
++	    shift
++	    continue;;
++
++	-m) chmodcmd="$chmodprog $2"
++	    shift
++	    shift
++	    continue;;
++
++	-o) chowncmd="$chownprog $2"
++	    shift
++	    shift
++	    continue;;
++
++	-g) chgrpcmd="$chgrpprog $2"
++	    shift
++	    shift
++	    continue;;
++
++	-s) stripcmd="$stripprog"
++	    shift
++	    continue;;
++
++	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
++	    shift
++	    continue;;
++
++	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
++	    shift
++	    continue;;
++
++	*)  if [ x"$src" = x ]
++	    then
++		src=$1
++	    else
++		# this colon is to work around a 386BSD /bin/sh bug
++		:
++		dst=$1
++	    fi
++	    shift
++	    continue;;
++    esac
++done
++
++if [ x"$src" = x ]
++then
++	echo "install:	no input file specified"
++	exit 1
++else
++	true
++fi
++
++if [ x"$dir_arg" != x ]; then
++	dst=$src
++	src=""
++	
++	if [ -d $dst ]; then
++		instcmd=:
++	else
++		instcmd=mkdir
++	fi
++else
++
++# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
++# might cause directories to be created, which would be especially bad 
++# if $src (and thus $dsttmp) contains '*'.
++
++	if [ -f $src -o -d $src ]
++	then
++		true
++	else
++		echo "install:  $src does not exist"
++		exit 1
++	fi
++	
++	if [ x"$dst" = x ]
++	then
++		echo "install:	no destination specified"
++		exit 1
++	else
++		true
++	fi
++
++# If destination is a directory, append the input filename; if your system
++# does not like double slashes in filenames, you may need to add some logic
++
++	if [ -d $dst ]
++	then
++		dst="$dst"/`basename $src`
++	else
++		true
++	fi
++fi
++
++## this sed command emulates the dirname command
++dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
++
++# Make sure that the destination directory exists.
++#  this part is taken from Noah Friedman's mkinstalldirs script
++
++# Skip lots of stat calls in the usual case.
++if [ ! -d "$dstdir" ]; then
++defaultIFS='	
++'
++IFS="${IFS-${defaultIFS}}"
++
++oIFS="${IFS}"
++# Some sh's can't handle IFS=/ for some reason.
++IFS='%'
++set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
++IFS="${oIFS}"
++
++pathcomp=''
++
++while [ $# -ne 0 ] ; do
++	pathcomp="${pathcomp}${1}"
++	shift
++
++	if [ ! -d "${pathcomp}" ] ;
++        then
++		$mkdirprog "${pathcomp}"
++	else
++		true
++	fi
++
++	pathcomp="${pathcomp}/"
++done
++fi
++
++if [ x"$dir_arg" != x ]
++then
++	$doit $instcmd $dst &&
++
++	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
++	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
++	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
++	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
++else
++
++# If we're going to rename the final executable, determine the name now.
++
++	if [ x"$transformarg" = x ] 
++	then
++		dstfile=`basename $dst`
++	else
++		dstfile=`basename $dst $transformbasename | 
++			sed $transformarg`$transformbasename
++	fi
++
++# don't allow the sed command to completely eliminate the filename
++
++	if [ x"$dstfile" = x ] 
++	then
++		dstfile=`basename $dst`
++	else
++		true
++	fi
++
++# Make a temp file name in the proper directory.
++
++	dsttmp=$dstdir/#inst.$$#
++
++# Move or copy the file name to the temp name
++
++	$doit $instcmd $src $dsttmp &&
++
++	trap "rm -f ${dsttmp}" 0 &&
++
++# and set any options; do chmod last to preserve setuid bits
++
++# If any of these fail, we abort the whole thing.  If we want to
++# ignore errors from any of these, just make sure not to ignore
++# errors from the above "$doit $instcmd $src $dsttmp" command.
++
++	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
++	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
++	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
++	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
++
++# Now rename the file to the real destination.
++
++	$doit $rmcmd -f $dstdir/$dstfile &&
++	$doit $mvcmd $dsttmp $dstdir/$dstfile 
++
++fi &&
++
++
++exit 0
+
+--- zisofs_tools/iso9660.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/iso9660.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,111 @@
++/* $Id: iso9660.c,v 1.1 2001/07/27 14:37:08 hpa Exp $ */
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++#include "iso9660.h"
++
++/* zisofs magic */
++
++const unsigned char zisofs_magic[8] = {
++  0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07
++};
++
++/* iso9660 integer formats */
++
++void
++set_721(void *pnt, unsigned int i)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  p[0] = i & 0xff;
++  p[1] = (i >> 8) & 0xff;
++}
++
++unsigned int
++get_721(void *pnt)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8);
++}
++
++void
++set_722(void *pnt, unsigned int i)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  p[0] = (i >> 8) & 0xff;
++  p[1] = i & 0xff;
++}
++
++unsigned int
++get_722(void *pnt)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  return ((unsigned int)p[0] << 8) + ((unsigned int)p[1]);
++}
++
++void
++set_723(void *pnt, unsigned int i)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  p[3] = p[0] = i & 0xff;
++  p[2] = p[1] = (i >> 8) & 0xff;
++}
++
++#define get_723(x) get_721(x)
++
++void
++set_731(void *pnt, unsigned int i)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  p[0] = i & 0xff;
++  p[1] = (i >> 8) & 0xff;
++  p[2] = (i >> 16) & 0xff;
++  p[3] = (i >> 24) & 0xff;
++}
++
++unsigned int
++get_731(void *pnt)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8) +
++    ((unsigned int)p[2] << 16) + ((unsigned int)p[3] << 24);
++}
++
++void
++set_732(void *pnt, unsigned int i)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  p[3] = i & 0xff;
++  p[2] = (i >> 8) & 0xff;
++  p[1] = (i >> 16) & 0xff;
++  p[0] = (i >> 24) & 0xff;
++}
++
++unsigned int
++get_732(void *pnt)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  return ((unsigned int)p[0] << 24) + ((unsigned int)p[1] << 16) +
++    ((unsigned int)p[2] << 8) + ((unsigned int)p[3]);
++}
++
++void
++set_733(void *pnt, unsigned int i)
++{
++  unsigned char *p = (unsigned char *)pnt;
++  p[7] = p[0] = i & 0xff;
++  p[6] = p[1] = (i >> 8) & 0xff;
++  p[5] = p[2] = (i >> 16) & 0xff;
++  p[4] = p[3] = (i >> 24) & 0xff;
++}
++
++#define get_733(x) get_731(x)
++
+
+--- zisofs_tools/iso9660.h	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/iso9660.h	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,45 @@
++#ident "$Id: iso9660.h,v 1.3 2001/07/27 19:49:08 hpa Exp $"
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++/* zisofs definitions */
++
++#ifndef CBLOCK_SIZE_LG2
++#define CBLOCK_SIZE_LG2	15	/* Compressed block size */
++#endif
++#define CBLOCK_SIZE	(1 << CBLOCK_SIZE_LG2)
++
++/* Compressed file magic */
++extern const unsigned char zisofs_magic[8];
++
++/* VERY VERY VERY IMPORTANT: Must be a multiple of 4 bytes */
++struct compressed_file_header {
++  char magic[8];
++  char uncompressed_len[4];
++  unsigned char header_size;
++  unsigned char block_size;
++  char reserved[2];		/* Reserved for future use, MBZ */
++};
++
++/* iso9660 integer formats */
++void set_721(void *, unsigned int);
++unsigned int get_721(void *);
++void set_722(void *, unsigned int);
++unsigned int get_722(void *);
++void set_723(void *, unsigned int);
++void set_731(void *, unsigned int);
++unsigned int get_731(void *);
++void set_732(void *, unsigned int);
++unsigned int get_732(void *);
++void set_733(void *, unsigned int);
++#define get_723(x) get_721(x)
++#define get_733(x) get_731(x)
+
+--- zisofs_tools/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/Makefile	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,24 @@
++#ident %W% %E% %Q%
++###########################################################################
++# Makefile for zisofs_tools in cdrtools package for debian
++###########################################################################
++SRCROOT=	../
++RULESDIR=	RULES
++include		$(SRCROOT)/$(RULESDIR)/rules.top
++###########################################################################
++
++INSDIR=		bin
++TARGET=		mkzftree
++CPPOPTS +=	-DUSE_LARGEFILES
++
++CFILES = 	mkzftree.c walk.c workers.c util.c hash.c iso9660.c \
++	   		compress.c uncompress.c
++HFILES =    config.h iso9660.h mkzftree.h version.h
++LIBS=		-lz
++XMK_FILE=	Makefile.man
++
++GNU_CC_WARNINGS = -Wall -W -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wshadow -Wcast-align
++
++###########################################################################
++include		$(SRCROOT)/$(RULESDIR)/rules.cmd
++###########################################################################
+
+--- zisofs_tools/Makefile.man	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/Makefile.man	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,30 @@
++#ident @(#)Makefile.man	1.3 00/11/19 
++###########################################################################
++# 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, 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; see the file COPYING.  If not, write to
++# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
++###########################################################################
++SRCROOT=	..
++RULESDIR=	RULES
++include		$(SRCROOT)/$(RULESDIR)/rules.top
++###########################################################################
++
++MANDIR=		man
++TARGETMAN=	mkzftree
++MANSECT=	$(MANSECT_ADMIN)
++MANSUFFIX=	$(MANSUFF_ADMIN)
++MANFILE=	mkzftree.8
++
++###########################################################################
++include		$(SRCROOT)/$(RULESDIR)/rules.man
++###########################################################################
+
+--- zisofs_tools/MCONFIG.in	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/MCONFIG.in	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,38 @@
++# Prefixes
++prefix      = @prefix@
++exec_prefix = @exec_prefix@
++
++# Directory for user binaries
++bindir  = @bindir@
++
++# Man page tree
++mandir  = @mandir@
++
++# System binaries
++sbindir = @sbindir@
++
++# Install into chroot area
++# Useful when making rpms and similar
++INSTALLROOT = 
++
++# Install program
++INSTALL         = @INSTALL@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_DATA    = @INSTALL_DATA@
++
++# Compiler and compiler flags
++CC      = @CC@
++CFLAGS  = @CFLAGS@
++
++# Link flags
++LDFLAGS = @LDFLAGS@
++
++# Libraries
++LIBS    = @LIBS@
++
++# Additional library we need to build
++LIBOBJS	= @LIBOBJS@
++
++# ar and ranlib (for making libraries)
++AR	= ar cq
++RANLIB	= @RANLIB@
+
+--- zisofs_tools/mkzftree.8	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/mkzftree.8	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,120 @@
++.\" $Id: mkzftree.1,v 1.12 2002/11/07 03:58:18 hpa Exp $
++.\" -----------------------------------------------------------------------
++.\"   
++.\"   Copyright 2001 H. Peter Anvin - All Rights Reserved
++.\"
++.\"   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++.\"   USA; either version 2 of the License, or (at your option) any later
++.\"   version; incorporated herein by reference.
++.\"
++.\" -----------------------------------------------------------------------
++.TH MKZFTREE "1" "30 July 2001" "zisofs-tools" "H. Peter Anvin"
++.SH NAME
++mkzftree \- Create a zisofs/RockRidge compressed file tree
++.SH SYNOPSIS
++.B mkzftree
++[\fIOPTIONS\fR]... \fIINPUT\fR \fIOUTPUT\fR
++.SH DESCRIPTION
++.PP
++Takes an input file tree (\fIINPUT\fR) and create a corresponding
++compressed file tree (\fIOUTPUT\fR) that can be used with an
++appropriately patched
++.BR mkisofs (8)
++to create a transparent-compression ISO 9660/Rock Ridge filesystem using
++the "ZF" compression records.
++.RP
++.TP
++\fB\-f\fP, \fB\-\-force\fP
++Always compress all files, even if they get larger when compressed.
++.TP
++\fB\-z\fP \fIlevel\fP, \fB\-\-level\fP \fIlevel\fP
++Select compression level (1-9, default is 9).  Lower compression
++levels are faster, but typically result in larger output.
++.TP
++\fB\-u\fP, \fB\-\-uncompress\fP
++Uncompress an already compressed tree.  This can be used to read a
++compressed filesystem on a system which cannot read them natively.
++.TP
++\fB\-p\fP \fIparallelism\fP, \fB\-\-parallelism\fP \fIparallelism\fP
++Compress in parallel.  The
++.I parallelism
++value indicates how many compression threads are allowed to run.
++.TP
++\fB\-x\fP, \fB\-\-one-filesystem\fP
++Do not cross filesystem boundaries, but create directory stubs at
++mount points.
++.TP
++\fB\-X\fP, \fB\-\-strict-one-filesystem\fP
++Do not cross filesystem boundaries, and do not create directory stubs
++at mount points.
++.TP
++\fB\-C\fP \fIpath\fP, \fB\-\-crib-path\fP \fIpath\fP
++Steal ("crib") files from another directory if it looks (based on
++name, size, type and modification time) like they match entries in the
++new filesystem.  The "crib tree" is usually the compressed version of
++an older version of the same workload; this thus allows for
++"incremental rebuilds" of a compressed filesystem tree.  The files are
++hardlinked from the crib tree to the output tree, so if it is
++desirable to keep the link count correct the crib path should be
++deleted before running \fBmkisofs\fP.  The crib tree must be on the
++same filesystem as the output tree.
++.TP
++\fB\-l\fP, \fB\-\-local\fP
++Do not recurse into subdirectories, but create the directories
++themselves.
++.TP
++\fB\-L\fP, \fB\-\-strict-local\fP
++Do not recurse into subdirectories, and do not create directories.
++.TP
++\fB\-F\fP, \fB\-\-file\fP
++Indicates that \fIINPUT\fP may not necessarily be a directory; this
++allows operation on a single file.  Note especially that if \fI\-F\fP
++is specified, and \fIINPUT\fP is a symlink, the symlink itself will be
++copied rather than whatever it happens to point to.
++.TP
++\fB\-s\fP, \fB\-\-sloppy\fP
++Treat file modes, times and ownership data as less than precious
++information and don't abort if they cannot be set.  This may be useful
++if running
++.B mkisofs
++on an input tree you do not own.
++.TP
++\fB\-v\fP, \fB\-\-verbose\fP
++Increase the program verbosity.
++.TP
++\fB\-V\fP \fIvalue\fP, \fB\-\-verbosity\fP \fIvalue\fP
++Set the program verbosity to
++.IR value .
++.TP
++\fB\-q\fP, \fB\-\-quiet\fP
++Issue no messages whatsoever, including error messages.  This is the same
++as specifying
++.IR "\-V\ 0" .
++.TP
++\fB\-h\fP, \fB\-\-help\fP
++Display a brief help message.
++.TP
++\fB\-w\fP, \fB\-\-version\fP
++Display the release version.
++.SH BUGS
++Long options (beginning with \fI\-\-\fP) may not work on all systems.
++See the message printed out by \fImkzftree\ \-h\fP to see if this
++applies to your system.
++.PP
++Inode change times (ctimes) are not copied.  This is a system
++limitation and applies to all file copy programs.
++.PP
++If using the parallel option (\fI\-p\fP) the access times (atimes) on
++directories may or may not be copied.  If it is important that the
++atimes on directories are copied exactly, avoid using \fI\-p\fP.
++.SH AUTHOR
++Written by H. Peter Anvin <hpa@zytor.com>.
++.SH COPYRIGHT
++Copyright \(co 2001-2002 H. Peter Anvin.
++.br
++This is free software; see the source for copying conditions.  There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++.SH "SEE ALSO"
++.BR mkisofs (8)
+
+--- zisofs_tools/mkzftree.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/mkzftree.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,284 @@
++/* $Id: mkzftree.c,v 1.16 2002/11/07 04:10:06 hpa Exp $ */
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++/*
++ * mkzffile.c
++ *
++ *	- Generate block-compression of files for use with
++ *	  the "ZF" extension to the iso9660/RockRidge filesystem.
++ *
++ *	  The file compression technique used is the "deflate"
++ *	  algorithm used by the zlib library; each block must have a
++ *	  valid (12-byte) zlib header.  In addition, the file itself
++ *	  has the following structure:
++ *
++ *	  Byte offset	iso9660 type	Contents
++ *	    0		(8 bytes)	Magic number (37 E4 53 96 C9 DB D6 07)
++ *	    8		7.3.1		Uncompressed file size
++ *	   12		7.1.1		header_size >> 2 (currently 4)
++ *	   13		7.1.1		log2(block_size)
++ *	   14		(2 bytes)	Reserved, must be zero
++ *
++ * The header may get expanded in the future, at which point the
++ * header size field will be used to increase the space for the
++ * header.
++ *
++ * All implementations are required to support a block_size of 32K
++ * (byte 13 == 15).
++ *
++ * Note that bytes 12 and 13 and the uncompressed length are also
++ * present in the ZF record; THE TWO MUST BOTH BE CONSISTENT AND
++ * CORRECT.
++ *
++ * Given the uncompressed size, block_size, and header_size:
++ *
++ *     Nblocks := ceil(size/block_size)
++ *
++ * After the header follow (nblock+1) 32-bit pointers, recorded as
++ * iso9660 7.3.1 (littleendian); each indicate the byte offset (from
++ * the start of the file) to one block and the first byte beyond the
++ * end of the previous block; the first pointer thus point to the
++ * start of the data area and the last pointer to the first byte
++ * beyond it:
++ *
++ *     block_no := floor(byte_offset/block_size)
++ *
++ *     block_start := read_pointer_731( (header_size+block_no)*4 )
++ *     block_end   := read_pointer_731( (header_size+block_no+1)*4 )
++ *
++ * The block data is compressed according to "zlib".
++ */
++
++#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <unistd.h>
++#include <limits.h>
++#include <utime.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++
++#include "mkzftree.h"
++#include "version.h"
++
++#ifdef HAVE_GETOPT_H
++#include <getopt.h>
++#endif
++
++/* Command line options */
++struct cmdline_options opt = {
++  0,				/* Force compression */
++  9,				/* Compression level */
++  0,				/* Parallelism (0 = strictly serial) */
++  0,				/* One filesystem only */
++  0,				/* One directory only */
++  1,				/* Create stub directories */
++  0,				/* Root may be a file */
++  0,				/* Be paranoid about metadata */
++  default_verbosity,		/* Default verbosity */
++  block_compress_file		/* Default transformation function */
++};
++
++/* Program name */
++const char *program;
++
++/* Long options */
++#define OPTSTRING "fz:up:xXC:lLFvqV:hw"
++#ifdef HAVE_GETOPT_LONG
++const struct option long_options[] = {
++  { "force",	             0,  0,  'f' },
++  { "level",                 1,  0,  'z' },
++  { "uncompress",            0,  0,  'u' },
++  { "parallelism",           1,  0,  'p' },
++  { "one-filesystem",        0,  0,  'x' },
++  { "strict-one-filesystem", 0,  0,  'X' },
++  { "crib-tree",             1,  0,  'C' },
++  { "local",                 0,  0,  'l' },
++  { "strict-local",          0,  0,  'L' },
++  { "file",                  0,  0,  'F' },
++  { "verbose",               0,  0,  'v' },
++  { "quiet",                 0,  0,  'q' },
++  { "verbosity",             1,  0,  'V' },
++  { "help",                  0,  0,  'h' },
++  { "version",               0,  0,  'w' },
++  { 0, 0, 0, 0 }
++};
++#define LO(X) X
++#else
++#define getopt_long(C,V,O,L,I) getopt(C,V,O)
++#define LO(X)
++#endif
++  
++static void usage(enum verbosity level, int err)
++{
++  message(level,
++	  "zisofs-tools " ZISOFS_TOOLS_VERSION "\n"
++	  "Usage: %s [options] intree outtree\n"
++	  LO("  --force                ")"  -f    Always compress, even if result is larger\n"
++	  LO("  --level #              ")"  -z #  Set compression level (1-9)\n"
++	  LO("  --uncompress           ")"  -u    Uncompress an already compressed tree\n"
++	  LO("  --parallelism #        ")"  -p #  Process up to # files in parallel\n"
++	  LO("  --one-filesystem       ")"  -x    Do not cross filesystem boundaries\n"
++	  LO("  --strict-one-filesystem")"  -X    Same as -x, but don't create stubs dirs\n"
++	  LO("  --crib-tree            ")"  -C    Steal \"crib\" files from an old tree\n"
++	  LO("  --local                ")"  -l    Do not recurse into subdirectoires\n"
++	  LO("  --strict-local         ")"  -L    Same as -l, but don't create stubs dirs\n"
++	  LO("  --file                 ")"  -F    Operate possibly on a single file\n"
++	  LO("  --sloppy               ")"  -s    Don't abort if metadata cannot be set\n"
++	  LO("  --verbose              ")"  -v    Increase message verbosity\n"
++	  LO("  --verbosity #          ")"  -V #  Set message verbosity to # (default = %d)\n"
++	  LO("  --quiet                ")"  -q    No messages, not even errors (-V 0)\n"
++	  LO("  --help                 ")"  -h    Display this message\n"
++	  LO("  --version              ")"  -w    Display the program version\n"
++	  ,program, (int)default_verbosity);
++  exit(err);
++}
++
++static int opt_atoi(const char *str)
++{
++  char *endptr;
++  long out;
++
++  out = strtol(str, &endptr, 10);
++  if ( *endptr )
++    usage(vl_error, EX_USAGE);
++
++  return (int)out;
++}
++
++
++int main(int argc, char *argv[])
++{
++  const char *in, *out, *crib = NULL;
++  struct stat st;
++  struct utimbuf ut;
++  int optch, err;
++
++  program = argv[0];
++
++  while ( (optch = getopt_long(argc, argv, OPTSTRING, long_options, NULL))
++	  != EOF ) {
++    switch(optch) {
++    case 'f':
++      opt.force = 1;		/* Always compress */
++      break;
++    case 'z':
++      opt.level = opt_atoi(optarg);
++      if ( opt.level < 1 || opt.level > 9 ) {
++	message(vl_error, "%s: invalid compression level: %d\n",
++		program, optarg);
++	exit(EX_USAGE);
++      }
++      break;
++    case 'v':
++      opt.verbosity++;
++      break;
++    case 'V':
++      opt.verbosity = opt_atoi(optarg);
++      break;
++    case 'q':
++      opt.verbosity = vl_quiet;
++      break;
++    case 'u':
++      opt.munger = block_uncompress_file;
++      break;
++    case 'C':
++      crib = optarg;
++      break;
++    case 'p':
++      opt.parallel = opt_atoi(optarg);
++      break;
++    case 'x':
++      opt.onefs = 1;  opt.do_mkdir = 1;
++      break;
++    case 'l':
++      opt.onedir = 1; opt.do_mkdir = 1;
++      break;
++    case 'X':
++      opt.onefs = 1;  opt.do_mkdir = 0;
++      break;
++    case 'L':
++      opt.onedir = 1; opt.do_mkdir = 0;
++      break;
++    case 'F':
++      opt.file_root = 1;
++      break;
++    case 's':
++      opt.sloppy = 1;
++      break;
++    case 'h':
++      usage(vl_quiet, 0);
++      break;
++    case 'w':
++      message(vl_quiet, "zisofs-tools " ZISOFS_TOOLS_VERSION "\n");
++      exit(0);
++    default:
++      usage(vl_error, EX_USAGE);
++      break;
++    }
++  }
++
++  if ( (argc-optind) != 2 )
++    usage(vl_error, EX_USAGE);
++
++  in  = argv[optind];		/* Input tree */
++  out = argv[optind+1];		/* Output tree */
++
++  umask(077);
++
++  if ( opt.file_root ) {
++    if ( lstat(in, &st) ) {
++      message(vl_error, "%s: %s: %s\n", program, in, strerror(errno));
++      exit(EX_NOINPUT);
++    }
++
++    err = munge_entry(in, out, crib, NULL);
++  } else {
++    /* Special case: we use stat() for the root, not lstat() */
++    if ( stat(in, &st) ) {
++      message(vl_error, "%s: %s: %s\n", program, in, strerror(errno));
++      exit(EX_NOINPUT);
++    }
++    if ( !S_ISDIR(st.st_mode) ) {
++      message(vl_error, "%s: %s: Not a directory\n", program, in);
++      exit(EX_DATAERR);
++    }
++    
++    err = munge_tree(in, out, crib);
++  }    
++
++  wait_for_all_workers();
++    
++  if ( err )
++    exit(err);
++
++  if ( !opt.file_root ) {
++    if ( chown(out, st.st_uid, st.st_gid) && !opt.sloppy ) {
++      message(vl_error, "%s: %s: %s", program, out, strerror(errno));
++      err = EX_CANTCREAT;
++    }
++    if ( chmod(out, st.st_mode) && !opt.sloppy && !err ) {
++      message(vl_error, "%s: %s: %s", program, out, strerror(errno));
++      err = EX_CANTCREAT;
++    }
++    ut.actime  = st.st_atime;
++    ut.modtime = st.st_mtime;
++    if ( utime(out, &ut) && !opt.sloppy && !err ) {
++      message(vl_error, "%s: %s: %s", program, out, strerror(errno));
++      err = EX_CANTCREAT;
++    }
++  }
++
++  return err;
++}
+
+--- zisofs_tools/mkzftree.h	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/mkzftree.h	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,86 @@
++#ident "$Id: mkzftree.h,v 1.4 2002/11/07 03:58:18 hpa Exp $"
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++#include "config.h"
++#include <stddef.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++
++#ifdef HAVE_SYSEXITS_H
++#include <sysexits.h>
++#else
++#define EX_USAGE	64	/* command line usage error */
++#define EX_DATAERR	65	/* data format error */
++#define EX_NOINPUT	66	/* cannot open input */
++#define EX_NOUSER	67	/* addressee unknown */
++#define EX_NOHOST	68	/* host name unknown */
++#define EX_UNAVAILABLE	69	/* service unavailable */
++#define EX_SOFTWARE	70	/* internal software error */
++#define EX_OSERR	71	/* system error (e.g., can't fork) */
++#define EX_OSFILE	72	/* critical OS file missing */
++#define EX_CANTCREAT	73	/* can't create (user) output file */
++#define EX_IOERR	74	/* input/output error */
++#define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
++#define EX_PROTOCOL	76	/* remote error in protocol */
++#define EX_NOPERM	77	/* permission denied */
++#define EX_CONFIG	78	/* configuration error */
++#endif
++
++/* File transformation functions */  
++typedef int (*munger_func)(FILE *, FILE *, off_t);
++int block_compress_file(FILE *, FILE *, off_t);
++int block_uncompress_file(FILE *, FILE *, off_t);
++
++/* mkzftree.c */
++extern const char *program;	/* Program name */
++enum verbosity {		/* Message verbosity */
++  vl_quiet,			/* No messages */
++  vl_error,			/* Error messages only */
++  vl_filename,			/* Display filenames */
++  vl_crib,			/* Cribbing files */
++};
++#define default_verbosity vl_error
++struct cmdline_options {
++  int force;			/* Always compress */
++  int level;			/* Compression level */
++  int parallel;			/* Parallelism (0 = strictly serial) */
++  int onefs;			/* One filesystem only */
++  int onedir;			/* One directory only */
++  int do_mkdir;			/* Create stub directories */
++  int file_root;		/* The root may be a file */
++  int sloppy;			/* Don't make sure metadata is set correctly */
++  enum verbosity verbosity;	/* Message verbosity */
++  munger_func munger;		/* Default action */
++};
++extern struct cmdline_options opt;
++
++/* walk.c */
++int munge_tree(const char *, const char *, const char *);
++int munge_entry(const char *, const char *, const char *, const struct stat *);
++
++/* workers.c */
++void wait_for_all_workers(void);
++int spawn_worker(void);
++void end_worker(int);
++
++/* util.c */
++void *xmalloc(size_t);
++char *xstrdup(const char *);
++void message(enum verbosity, const char *, ...);
++
++/* hash.c */
++const char *hash_find_file(struct stat *);
++void hash_insert_file(struct stat *, const char *);
++
+
+--- zisofs_tools/MRULES	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/MRULES	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,22 @@
++# Standard compilation rules (don't use make builtins)
++
++.SUFFIXES: .c .cc .o .s .S .i
++
++.c.o:
++	$(CC) $(CFLAGS) -c $<
++
++.c.s:
++	$(CC) $(CFLAGS) -S -o $@ $<
++
++.c.i:
++	$(CC) $(CFLAGS) -E -o $@ $<
++
++.cc.o:
++	$(CXX) $(CXXFLAGS) -c $<
++
++.cc.s:
++	$(CXX) $(CXXFLAGS) -S -o $@ $<
++
++.cc.i:
++	$(CXX) $(CXXFLAGS) -E -o $@ $<
++
+
+--- zisofs_tools/README.zisofs	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/README.zisofs	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,48 @@
++		    H. Peter Anvin <hpa@zytor.com>
++			   October 18, 2002
++
++
++User tools for zisofs:
++
++The user tools for zisofs come in two parts: a utility "mkzftree" and
++a modification to mkisofs, which is part of the cdrtools package.  The
++mkisofs change has been integrated in the cdrtools distribution as of
++cdrtools-1.11a20; a patch for cdrtools-1.11a09 which is also tested
++and working on cdrtools-1.10 is included with this package if you
++insist on running an older version.
++
++
++First create a directory tree containing compressed files:
++
++	mkzftree input_dir compressed_dir
++
++mkzftree will not overwrite an existing directory; you may want to "rm
++-rf" the directory tree if you are doing this from a script:
++
++Second, invoke the patched mkisofs with the -z option:
++
++	mkisofs -z -R [other options] -o compressed.iso compressed_dir
++
++IMPORTANT: you *must* enable RockRidge (-R or -r) since this is an
++extensions to the RockRidge specification.  Without RockRidge, -z will
++have no effect.
++
++Note that if there are files you do not want compressed (for example,
++files involved in booting, or README files you want to be readable
++under all circumstances) you can simply put them in a separate tree
++and not run mkzftree on that tree.
++
++mkzftree will not compress files that end up larger when compressed;
++if you want it to compress the files anyway, you can give the -f
++option to mkzftree.
++
++mkzftree also accepts a -u option (uncompress), which can be used to
++convert a compressed tree back to normal form.  This can be used to
++read a zisofs CD-ROM on a machine without zisofs kernel support.
++
++This version of mkzftree supports a -p option (parallelize.)
++Specifying -p and a parallelism (e.g. -p4) allows files (up to the
++number specified) to compress in parallel.  Depending on your setup
++and your data set size, this might speed things up if you are not
++completely I/O bound.  Use -p0 to completely disable parallel
++execution; this is the default.
+
+--- zisofs_tools/uncompress.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/uncompress.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,133 @@
++/* $Id: uncompress.c,v 1.2 2001/07/27 19:49:08 hpa Exp $ */
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <zlib.h>
++#include "mkzftree.h"
++#include "iso9660.h"
++
++int block_uncompress_file(FILE *input, FILE *output, off_t size)
++{
++  struct compressed_file_header hdr;
++  char *inbuf, *outbuf;
++  int block_shift;
++  char *pointer_block, *pptr;
++  unsigned long nblocks;
++  unsigned long fullsize, block_size, block_size2;
++  size_t ptrblock_bytes;
++  unsigned long cstart, cend, csize;
++  uLong bytes;
++  int zerr;
++  int err = EX_SOFTWARE;
++
++  if ( (bytes = fread(&hdr, 1, sizeof hdr, input)) != sizeof hdr ) {
++    if ( bytes == (size_t)size ) {
++      /* Very short file; not compressed */
++      return ( fwrite(&hdr, 1, bytes, output) != bytes ) ? EX_CANTCREAT : 0;
++    } else {
++      return EX_IOERR;		/* Read error */
++    }
++  }
++
++  if ( memcmp(&hdr.magic, zisofs_magic, sizeof zisofs_magic) ) {
++    inbuf = xmalloc(CBLOCK_SIZE);
++    /* Not compressed */
++    memcpy(inbuf, &hdr, sizeof hdr);
++    bytes = sizeof hdr;
++    do {
++      if ( fwrite(inbuf, 1, bytes, output) != bytes )
++	return EX_CANTCREAT;
++    } while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 );
++    free(inbuf);
++    return ferror(input) ? EX_IOERR : 0;
++  }
++
++  /* Now we know the file must be compressed.  Get the pointer table. */
++  if ( fseek(input, hdr.header_size << 2, SEEK_SET) == -1 )
++    return EX_IOERR;
++
++  fullsize    = get_731(hdr.uncompressed_len);
++  block_shift = hdr.block_size;
++  block_size  = 1UL << block_shift;
++  block_size2 = block_size << 1;
++  inbuf  = xmalloc(block_size2);
++  outbuf = xmalloc(block_size);
++
++  nblocks = (fullsize + block_size - 1) >> block_shift;
++
++  ptrblock_bytes = (nblocks+1) * 4;
++  pointer_block = xmalloc(ptrblock_bytes);
++
++  if ( (bytes = fread(pointer_block, 1, ptrblock_bytes, input)) != ptrblock_bytes ) {
++    err = EX_IOERR;
++    goto free_ptr_bail;
++  }
++  
++  pptr = pointer_block;
++  while ( fullsize ) {
++    cstart = get_731(pptr);
++    pptr += 4;
++    cend   = get_731(pptr);
++
++    csize = cend-cstart;
++
++    if ( csize == 0 ) {
++      memset(outbuf, 0, block_size);
++      bytes = block_size;
++    } else {
++      if ( csize > block_size2 ) {
++	err = EX_DATAERR;
++	goto free_ptr_bail;
++      }
++      
++      if ( fseek(input, cstart, SEEK_SET) == -1 ||
++	   (bytes = fread(inbuf, 1, csize, input)) != csize ) {
++	err = EX_IOERR;
++	goto free_ptr_bail;
++      }
++      
++      bytes = block_size;		/* Max output buffer size */
++      if ( (zerr = uncompress(outbuf, &bytes, inbuf, csize)) != Z_OK ) {
++	err = (zerr = Z_MEM_ERROR) ? EX_OSERR : EX_DATAERR;
++	goto free_ptr_bail;
++      }
++    }
++      
++    if ( ((fullsize > block_size) && (bytes != block_size))
++	 || ((fullsize <= block_size) && (bytes < fullsize)) ) {
++      err = EX_DATAERR;
++      goto free_ptr_bail;
++    }
++    
++    if ( bytes > fullsize )
++      bytes = fullsize;
++    
++    if ( fwrite(outbuf, 1, bytes, output) != bytes ) {
++      err = EX_CANTCREAT;
++      goto free_ptr_bail;
++    }
++
++    fullsize -= bytes;
++  }
++
++  err = 0;
++
++ free_ptr_bail:
++  free(pointer_block);
++  free(inbuf);
++  free(outbuf);
++  return err;
++}
++
++
+
+--- zisofs_tools/util.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/util.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,55 @@
++/* $Id: util.c,v 1.2 2001/07/31 03:20:52 hpa Exp $ */
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++#include <stdio.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <stdarg.h>
++#include <string.h>
++#include "mkzftree.h"
++
++/* Convenience functions */
++void *xmalloc(size_t size)
++{
++  void *p = malloc(size);
++
++  if ( !p ) {
++    perror(program);
++    exit(EX_OSERR);
++  }
++
++  return p;
++}
++
++char *xstrdup(const char *str)
++{
++  char *s = strdup(str);
++
++  if ( !s ) {
++    perror(program);
++    exit(EX_OSERR);
++  }
++  
++  return s;
++}
++
++void message(enum verbosity level, const char *format, ...)
++{
++  va_list ap;
++
++  va_start(ap, format);
++  if ( opt.verbosity >= level )
++    vfprintf(stderr, format, ap);
++  va_end(ap);
++}
++
+
+--- zisofs_tools/version	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/version	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1 @@
++1.0.4
+
+--- zisofs_tools/version.h	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/version.h	2002-12-27 21:00:49.000000000 +0100
+@@ -0,0 +1 @@
++#define ZISOFS_TOOLS_VERSION "1.0.4"
+
+--- zisofs_tools/walk.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/walk.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,321 @@
++#ident "$Id: walk.c,v 1.5 2002/11/07 03:58:18 hpa Exp $"
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001-2002 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++/*
++ * walk.c
++ *
++ * Functions to walk the file tree
++ */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <limits.h>
++#include <utime.h>
++#include <string.h>
++#include <errno.h>
++#include <dirent.h>
++#include <unistd.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include "mkzftree.h"
++#include "iso9660.h"
++
++static int munge_file(const char *inpath, const char *outpath,
++		      const char *cribpath, struct stat *st)
++{
++  FILE *in, *out;
++  int err = 0;
++  struct utimbuf ut;
++
++  if ( cribpath ) {
++    struct stat cst;
++    struct compressed_file_header cfh;
++
++    /* Compare as much as we realistically can */
++    if ( !stat(cribpath, &cst) &&
++	 st->st_mode == cst.st_mode &&
++	 st->st_uid == cst.st_uid &&
++	 st->st_gid == cst.st_gid &&
++	 st->st_mtime == cst.st_mtime ) {
++      if ( (in = fopen(cribpath, "rb")) ) {
++	int e = fread(&cfh, 1, sizeof cfh, in);
++	fclose(in);
++	/* Attempt to restore the atime */
++	ut.actime  = cst.st_atime;
++	ut.modtime = cst.st_mtime;
++	utime(cribpath, &ut);
++
++	if ( (e == sizeof cfh &&
++	      !memcmp(cfh.magic, zisofs_magic, sizeof zisofs_magic) &&
++	      (off_t)get_731(cfh.uncompressed_len) == st->st_size) ||
++	     (st->st_size == cst.st_size &&
++	      (e < (int)(sizeof zisofs_magic) ||
++	       memcmp(cfh.magic, zisofs_magic, sizeof zisofs_magic))) ) {
++	  /* File is cribbable.  Steal it. */
++	  if ( !link(cribpath, outpath) ) {
++	    message(vl_crib, "crib: %s -> %s\n", cribpath, outpath);
++	    ut.actime  = st->st_atime;
++	    ut.modtime = st->st_mtime;
++	    utime(outpath, &ut);	/* Set the the atime */
++	    
++	    return 0;
++	  }
++	}
++      }
++    }
++  }
++
++  in = fopen(inpath, "rb");
++  if ( !in )
++    return EX_NOINPUT;
++  out = fopen(outpath, "wb");
++  if ( !out ) {
++    fclose(in);
++    return EX_CANTCREAT;
++  }
++
++  if ( spawn_worker() ) {
++    err = opt.munger(in, out, st->st_size);
++    fclose(in);
++    fclose(out);
++    
++    chown(outpath, st->st_uid, st->st_gid);
++    chmod(outpath, st->st_mode);
++    ut.actime  = st->st_atime;
++    ut.modtime = st->st_mtime;
++    utime(outpath, &ut);
++    
++    end_worker(err);
++  } else {
++    fclose(in);
++    fclose(out);
++  }
++
++  return err;
++}
++
++int munge_tree(const char *intree, const char *outtree, const char *cribtree)
++{
++  char *in_path, *out_path, *crib_path;
++  char *in_file, *out_file, *crib_file;
++  DIR *thisdir;
++  struct dirent *dirent;
++  struct stat dirst;
++  int err = 0;
++  
++  /* Construct buffers with the common filename prefix, and point to the end */
++
++  in_path = xmalloc(strlen(intree) + NAME_MAX + 2);
++  strcpy(in_path, intree);
++  in_file = strchr(in_path, '\0');
++  *in_file++ = '/';
++
++  out_path = xmalloc(strlen(outtree) + NAME_MAX + 2);
++  strcpy(out_path, outtree);
++  out_file = strchr(out_path, '\0');
++  *out_file++ = '/';
++
++  if ( cribtree ) {
++    crib_path = xmalloc(strlen(cribtree) + NAME_MAX + 2);
++    strcpy(crib_path, cribtree);
++    crib_file = strchr(crib_path, '\0');
++    *crib_file++ = '/';
++  } else {
++    crib_path = crib_file = NULL;
++  }
++
++  /* Get directory information */
++  if ( stat(intree, &dirst) ) {
++    message(vl_error, "%s: Failed to stat directory %s: %s\n",
++	    program, intree, strerror(errno));
++    return EX_NOINPUT;
++  }
++
++  /* Open the directory */
++  thisdir = opendir(intree);
++  if ( !thisdir ) {
++    message(vl_error, "%s: Failed to open directory %s: %s\n",
++	    program, intree, strerror(errno));
++    return EX_NOINPUT;
++  }
++
++  /* Create output directory */
++  if ( mkdir(outtree, 0700) ) {
++    message(vl_error, "%s: Cannot create output directory %s: %s\n",
++	    program, outtree, strerror(errno));
++    return EX_CANTCREAT;
++  }
++
++  while ( (dirent = readdir(thisdir)) != NULL ) {
++    if ( !strcmp(dirent->d_name, ".") ||
++	 !strcmp(dirent->d_name, "..") )
++      continue;			/* Ignore . and .. */
++    
++    strcpy(in_file, dirent->d_name);
++    strcpy(out_file, dirent->d_name);
++    if ( crib_file )
++      strcpy(crib_file, dirent->d_name);
++    
++    err = munge_entry(in_path, out_path, crib_path, &dirst);
++    if ( err )
++      break;
++  }
++  closedir(thisdir);
++  
++  free(in_path);
++  free(out_path);
++  
++  return err;
++}
++
++
++int munge_entry(const char *in_path, const char *out_path,
++		const char *crib_path, const struct stat *dirst)
++{
++  struct stat st;
++  struct utimbuf ut;
++  int err = 0;
++
++  message(vl_filename, "%s -> %s\n", in_path, out_path);
++
++  if ( lstat(in_path, &st) ) {
++    message(vl_error, "%s: Failed to stat file %s: %s\n",
++	    program, in_path, strerror(errno));
++    return EX_NOINPUT;
++  }
++  
++  if ( S_ISREG(st.st_mode) ) {
++    if ( st.st_nlink > 1 ) {
++      /* Hard link. */
++      const char *linkname;
++      
++      if ( (linkname = hash_find_file(&st)) != NULL ) {
++	/* We've seen it before, hard link it */
++	
++	if ( link(linkname, out_path) ) {
++	  message(vl_error, "%s: hard link %s -> %s failed: %s\n",
++		  program, out_path, linkname, strerror(errno));
++	  return EX_CANTCREAT;
++	}
++      } else {
++	/* First encounter, compress and enter into hash */
++	if ( (err = munge_file(in_path, out_path, crib_path, &st)) != 0 ) {
++	  message(vl_error, "%s: %s: %s", program, in_path, strerror(errno));
++	  return err;
++	}
++	hash_insert_file(&st, out_path);
++      }
++    } else {
++      /* Singleton file; no funnies */
++      if ( (err = munge_file(in_path, out_path, crib_path, &st)) != 0 ) {
++	message(vl_error, "%s: %s: %s", program, in_path, strerror(errno));
++	return err;
++      }
++    }
++  } else if ( S_ISDIR(st.st_mode) ) {
++    /* Recursion: see recursion */
++    if ( !opt.onedir &&
++	 (!opt.onefs || (dirst && dirst->st_dev == st.st_dev)) ) {
++      if ( (err = munge_tree(in_path, out_path, crib_path)) != 0 )
++	return err;
++    } else if ( opt.do_mkdir ) {
++      /* Create stub directories */
++      if ( mkdir(out_path, st.st_mode) ) {
++	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	return EX_CANTCREAT;
++      }
++    }
++  } else if ( S_ISLNK(st.st_mode) ) {
++    int chars;
++#ifdef PATH_MAX
++#define BUFFER_SLACK PATH_MAX
++#else
++#define BUFFER_SLACK BUFSIZ
++#endif
++    int buffer_len = st.st_size + BUFFER_SLACK + 1;
++    char *buffer = xmalloc(buffer_len);
++    if ( (chars = readlink(in_path, buffer, buffer_len)) < 0 ) {
++      message(vl_error, "%s: readlink failed for %s: %s\n",
++	      program, in_path, strerror(errno));
++      return EX_NOINPUT;
++    }
++    buffer[chars] = '\0';
++    if ( symlink(buffer, out_path) ) {
++      message(vl_error, "%s: symlink %s -> %s failed: %s\n",
++	      program, out_path, buffer, strerror(errno));
++      return EX_CANTCREAT;
++    }
++    free(buffer);
++  } else {
++    if ( st.st_nlink > 1 ) {
++      /* Hard link. */
++      const char *linkname;
++      
++      if ( (linkname = hash_find_file(&st)) != NULL ) {
++	/* We've seen it before, hard link it */
++	
++	if ( link(linkname, out_path) ) {
++	  message(vl_error, "%s: hard link %s -> %s failed: %s\n",
++		  program, out_path, linkname, strerror(errno));
++	  return EX_CANTCREAT;
++	}
++      } else {
++	/* First encounter, create and enter into hash */
++	if ( mknod(out_path, st.st_mode, st.st_rdev) ) {
++	  message(vl_error, "%s: mknod failed for %s: %s\n",
++		  program, out_path, strerror(errno));
++	  return EX_CANTCREAT;
++	}
++	hash_insert_file(&st, out_path);
++      }
++    } else {
++      /* Singleton node; no funnies */
++      if ( mknod(out_path, st.st_mode, st.st_rdev) ) {
++	message(vl_error, "%s: mknod failed for %s: %s\n",
++		program, out_path, strerror(errno));
++	return EX_CANTCREAT;
++      }
++    }
++  }
++  
++  /* This is done by munge_file() for files */
++  if ( !S_ISREG(st.st_mode) ) {
++#ifdef HAVE_LCHOWN
++    if ( lchown(out_path, st.st_uid, st.st_gid) && opt.sloppy && !err ) {
++      message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++      err = EX_CANTCREAT;
++    }
++#endif
++    if ( !S_ISLNK(st.st_mode) ) {
++#ifndef HAVE_LCHOWN
++      if ( chown(out_path, st.st_uid, st.st_gid) && !opt.sloppy && !err ) {
++	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	err = EX_CANTCREAT;
++      }
++#endif
++      if ( chmod(out_path, st.st_mode) && !opt.sloppy && !err ) {
++	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	err = EX_CANTCREAT;
++      }
++      ut.actime  = st.st_atime;
++      ut.modtime = st.st_mtime;
++      if ( utime(out_path, &ut) && !opt.sloppy && !err ) {
++	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	err = EX_CANTCREAT;
++      }
++    }
++  }
++
++  return err;
++}
++
+
+--- zisofs_tools/workers.c	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/workers.c	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,98 @@
++#ident "$Id: workers.c,v 1.2 2001/07/31 03:20:52 hpa Exp $"
++/* ----------------------------------------------------------------------- *
++ *   
++ *   Copyright 2001 H. Peter Anvin - All Rights Reserved
++ *
++ *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
++ *   USA; either version 2 of the License, or (at your option) any later
++ *   version; incorporated herein by reference.
++ *
++ * ----------------------------------------------------------------------- */
++
++/*
++ * workers.c
++ *
++ * Parallel job maintenance
++ */
++
++#include <stddef.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <signal.h>
++#include <stdio.h>
++#include <sys/wait.h>
++#include "mkzftree.h"
++
++/* Global option */
++extern int parallel;		/* Number of parallel jobs */
++
++/* Functions related to parallel execution */
++static volatile int work_threads = 0;
++static int is_worker = 0;
++
++/* This waits for one worker to finish */
++static void wait_for_one_worker(void)
++{
++  int status;
++
++  if ( wait(&status) > 0 ) {
++    work_threads--;
++    
++    if ( WIFSIGNALED(status) ) {
++      kill(getpid(), WTERMSIG(status));
++      exit(EX_SOFTWARE);
++    } else if ( WEXITSTATUS(status) ) {
++      exit(WEXITSTATUS(status));
++    }
++  }
++}  
++
++/* This waits for *all* workers to finish */
++void wait_for_all_workers(void)
++{
++  while ( work_threads )
++    wait_for_one_worker();
++}
++
++/* This returns 1 if the "job" at hand should be performed */
++int spawn_worker(void)
++{
++  pid_t f;
++  
++  if ( opt.parallel == 0 )
++    return 1;
++
++  fflush(NULL);
++
++  /* Wait for a work slot */
++  while ( work_threads >= opt.parallel )
++    wait_for_one_worker();
++  
++  /* Spawn worker process */
++  work_threads++;		/* Avoids race conditions */
++  f = fork();
++  if ( f == -1 ) {
++    work_threads--;
++    return 1;			/* Do it ourselves */
++  }
++
++  if ( f == 0 ) {
++    /* Worker process */
++    is_worker = 1;
++    return 1;
++  } else {
++    /* Control process */
++    return 0;
++  }
++}
++
++/* Routine to perform at the end of the job */
++void end_worker(int err)
++{
++  if ( is_worker ) {
++    exit(err);
++  }
++}
++
+
+--- zisofs_tools/zisofs.magic	1970-01-01 01:00:00.000000000 +0100
++++ zisofs_tools/zisofs.magic	2002-12-27 14:48:49.000000000 +0100
+@@ -0,0 +1,8 @@
++
++#------------------------------------------------------------------------------
++# zisofs: file(1) magic for zisofs/RockRidge compressed files
++#
++# from H. Peter Anvin <hpa@zytor.com> May 4, 2001
++#
++0	string	\x37\xE4\x53\x96\xC9\xDB\xD6\x07	zisofs/Rockridge compressed file
++>8	lelong		x		- %d bytes
--- cdrtools-2.01+01a01.orig/debian/patches/19_typos.dpatch
+++ cdrtools-2.01+01a01/debian/patches/19_typos.dpatch
@@ -0,0 +1,273 @@
+#! /bin/sh -e
+## 19_typos.dpatch by Eduard Bloch <blade@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a22 cdrtools-2.01/AN-2.01a22
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a22	2003-12-29 15:27:10.000000000 +0100
++++ cdrtools-2.01/AN-2.01a22	2004-04-21 15:26:07.000000000 +0200
+@@ -38,7 +38,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a23 cdrtools-2.01/AN-2.01a23
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a23	2004-01-02 16:17:53.000000000 +0100
++++ cdrtools-2.01/AN-2.01a23	2004-04-21 15:26:07.000000000 +0200
+@@ -38,7 +38,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a24 cdrtools-2.01/AN-2.01a24
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a24	2004-01-07 00:58:42.000000000 +0100
++++ cdrtools-2.01/AN-2.01a24	2004-04-21 15:26:07.000000000 +0200
+@@ -38,7 +38,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a25 cdrtools-2.01/AN-2.01a25
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a25	2004-01-17 17:02:19.000000000 +0100
++++ cdrtools-2.01/AN-2.01a25	2004-04-21 15:26:07.000000000 +0200
+@@ -39,7 +39,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a26 cdrtools-2.01/AN-2.01a26
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a26	2004-02-29 18:22:31.000000000 +0100
++++ cdrtools-2.01/AN-2.01a26	2004-04-21 15:26:07.000000000 +0200
+@@ -39,7 +39,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a27 cdrtools-2.01/AN-2.01a27
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a27	2004-03-08 00:48:02.000000000 +0100
++++ cdrtools-2.01/AN-2.01a27	2004-04-21 15:26:07.000000000 +0200
+@@ -39,7 +39,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/AN-2.01a28 cdrtools-2.01/AN-2.01a28
+--- /home/inet/tmp/cdrtools-2.01/AN-2.01a28	2004-04-21 00:53:00.000000000 +0200
++++ cdrtools-2.01/AN-2.01a28	2004-04-21 15:26:07.000000000 +0200
+@@ -39,7 +39,7 @@
+ 
+ GPL violation hint:
+ 
+-	All recent SuSE distributions contain inofficial and modified versions
++	All recent SuSE distributions contain unofficial and modified versions
+ 	of cdrecord that are known to contain bugs and open new security holes.
+ 
+ 	At least SuSE 8.2 (maybe other SuSE releases too) did contain a modified
+diff -urNad /home/inet/tmp/cdrtools-2.01/cdda2wav/defaults.c cdrtools-2.01/cdda2wav/defaults.c
+--- /home/inet/tmp/cdrtools-2.01/cdda2wav/defaults.c	2004-03-02 02:10:32.000000000 +0100
++++ cdrtools-2.01/cdda2wav/defaults.c	2004-04-21 15:26:07.000000000 +0200
+@@ -47,7 +47,7 @@
+ 	 * change the documentation and add a statement that makes clear
+ 	 * where the official location of the file is why you did choose a
+ 	 * nonstandard location and that the nonstandard location only refers
+-	 * to inofficial cdrecord versions.
++	 * to unofficial cdrecord versions.
+ 	 *
+ 	 * I was forced to add this because some people change cdrecord without
+ 	 * rational reason and then publish the result. As those people
+diff -urNad /home/inet/tmp/cdrtools-2.01/cdrecord/cdrecord.c cdrtools-2.01/cdrecord/cdrecord.c
+--- /home/inet/tmp/cdrtools-2.01/cdrecord/cdrecord.c	2004-04-21 15:26:05.000000000 +0200
++++ cdrtools-2.01/cdrecord/cdrecord.c	2004-04-21 15:26:07.000000000 +0200
+@@ -307,7 +307,7 @@
+ 	 * printing code that:
+ 	 *
+ 	 *	-	Clearly states that the current version is an
+-	 *		inofficial (modified) version and thus may have bugs
++	 *		unofficial (modified) version and thus may have bugs
+ 	 *		that are not present in the original.
+ 	 *
+ 	 *	-	Print your support e-mail address and tell people that
+@@ -327,7 +327,7 @@
+ 	 * GPL Preamble, subsection 6.
+ 	 *
+ 	 * I am sorry for the inconvenience but I am forced to do this because
+-	 * some people create inofficial branches. These branches create
++	 * some people create unofficial branches. These branches create
+ 	 * problems but the initiators do not give support and thus cause the
+ 	 * development of the official cdrecord versions to slow down because
+ 	 * I am loaded with unneeded work.
+@@ -362,7 +362,7 @@
+ #if	defined(SOURCE_MODIFIED) || !defined(IS_SCHILY_XCONFIG)
+ #define	INSERT_YOUR_EMAIL_ADDRESS_HERE "cdrtools@packages.debian.org"
+ #define	NO_SUPPORT	0
+-		printf("NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord\n");
++		printf("NOTE: this version of cdrecord is an unofficial (modified) release of cdrecord\n");
+ 		printf("      and thus may have bugs that are not present in the original version.\n");
+ #if	NO_SUPPORT
+ 		printf("      The author of the modifications decided not to provide a support e-mail\n");
+@@ -503,7 +503,7 @@
+ 		printf("Using libscg version '%s-%s'.\n", auth, vers);
+ 		if (auth == 0 || strcmp("schily", auth) != 0) {
+ 			errmsgno(EX_BAD,
+-			"Warning: using inofficial version of libscg (%s-%s '%s').\n",
++			"Warning: using unofficial version of libscg (%s-%s '%s').\n",
+ 				auth, vers, scg_version(0, SCG_SCCS_ID));
+ 		}
+ 
+@@ -513,7 +513,7 @@
+ 			error("Using libscg transport code version '%s-%s'\n", auth, vers);
+ 		if (auth == 0 || strcmp("schily", auth) != 0) {
+ 			errmsgno(EX_BAD,
+-			"Warning: using inofficial libscg transport code version (%s-%s '%s').\n",
++			"Warning: using unofficial libscg transport code version (%s-%s '%s').\n",
+ 				auth, vers, scg_version(scgp, SCG_SCCS_ID));
+ 		}
+ 
+@@ -523,7 +523,7 @@
+ 			error("Using remote transport code version '%s-%s'\n", auth, vers);
+ 		if (auth != 0 && strcmp("schily", auth) != 0) {
+ 			errmsgno(EX_BAD,
+-			"Warning: using inofficial remote transport code version (%s-%s '%s').\n",
++			"Warning: using unofficial remote transport code version (%s-%s '%s').\n",
+ 				auth, vers, scg_version(scgp, SCG_RSCCS_ID));
+ 		}
+ 	}
+diff -urNad /home/inet/tmp/cdrtools-2.01/cdrecord/defaults.c cdrtools-2.01/cdrecord/defaults.c
+--- /home/inet/tmp/cdrtools-2.01/cdrecord/defaults.c	2004-03-02 02:10:32.000000000 +0100
++++ cdrtools-2.01/cdrecord/defaults.c	2004-04-21 15:26:07.000000000 +0200
+@@ -47,7 +47,7 @@
+ 	 * change the documentation and add a statement that makes clear
+ 	 * where the official location of the file is why you did choose a
+ 	 * nonstandard location and that the nonstandard location only refers
+-	 * to inofficial cdrecord versions.
++	 * to unofficial cdrecord versions.
+ 	 *
+ 	 * I was forced to add this because some people change cdrecord without
+ 	 * rational reason and then publish the result. As those people
+diff -urNad /home/inet/tmp/cdrtools-2.01/debian/copyright cdrtools-2.01/debian/copyright
+--- /home/inet/tmp/cdrtools-2.01/debian/copyright	2004-04-21 15:25:00.000000000 +0200
++++ cdrtools-2.01/debian/copyright	2004-04-21 15:26:07.000000000 +0200
+@@ -37,7 +37,7 @@
+ |   printing code that:
+ |  
+ |  	-	Clearly states that the current version is an
+-|  		inofficial (modified) version and thus may have bugs
++|  		unofficial (modified) version and thus may have bugs
+ |  		that are not present in the original.
+ |  
+ |  	-	Print your support e-mail address and tell people that
+@@ -57,7 +57,7 @@
+ |   GPL Preamble, subsection 6.
+ |  
+ |   I am sorry for the inconvenience but I am forced to do this because
+-|   some people create inofficial branches. These branches create
++|   some people create unofficial branches. These branches create
+ |   problems but the initiators do not give support and thus cause the
+ |   development of the official cdrecord versions to slow down because
+ |   I am loaded with unneeded work.
+diff -urNad /home/inet/tmp/cdrtools-2.01/debian/dvd.reportbug cdrtools-2.01/debian/dvd.reportbug
+--- /home/inet/tmp/cdrtools-2.01/debian/dvd.reportbug	2004-04-21 15:25:00.000000000 +0200
++++ cdrtools-2.01/debian/dvd.reportbug	2004-04-21 15:26:07.000000000 +0200
+@@ -1,3 +1,3 @@
+ #!/bin/sh
+-echo "You are running cdrecord with inofficial DVD patch" >&3
++echo "You are running cdrecord with unofficial DVD patch" >&3
+ echo "Bugreport might be ignored" >&3
+diff -urNad /home/inet/tmp/cdrtools-2.01/debian/patches/16_debian_email.dpatch cdrtools-2.01/debian/patches/16_debian_email.dpatch
+--- /home/inet/tmp/cdrtools-2.01/debian/patches/16_debian_email.dpatch	2004-04-21 15:25:00.000000000 +0200
++++ cdrtools-2.01/debian/patches/16_debian_email.dpatch	2004-04-21 15:26:07.000000000 +0200
+@@ -32,7 +32,7 @@
+ -#define	INSERT_YOUR_EMAIL_ADDRESS_HERE
+ +#define	INSERT_YOUR_EMAIL_ADDRESS_HERE "cdrtools@packages.debian.org"
+  #define	NO_SUPPORT	0
+- 		printf("NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord\n");
++ 		printf("NOTE: this version of cdrecord is an unofficial (modified) release of cdrecord\n");
+  		printf("      and thus may have bugs that are not present in the original version.\n");
+ diff -urNad /home/inet/debian/tmp/cdrtools-2.01/conf/xconfig.h.in cdrtools-2.01/conf/xconfig.h.in
+ --- /home/inet/debian/tmp/cdrtools-2.01/conf/xconfig.h.in	2004-01-16 23:06:46.000000000 +0100
+diff -urNad /home/inet/tmp/cdrtools-2.01/rscsi/rscsi.c cdrtools-2.01/rscsi/rscsi.c
+--- /home/inet/tmp/cdrtools-2.01/rscsi/rscsi.c	2003-11-26 01:28:27.000000000 +0100
++++ cdrtools-2.01/rscsi/rscsi.c	2004-04-21 15:26:07.000000000 +0200
+@@ -136,7 +136,7 @@
+ 	 * filename if you also change the documentation and add a statement
+ 	 * that makes clear where the official location of the file is, why you
+ 	 * did choose a nonstandard location and that the nonstandard location
+-	 * only refers to inofficial rscsi versions.
++	 * only refers to unofficial rscsi versions.
+ 	 *
+ 	 * I was forced to add this because some people change cdrecord without
+ 	 * rational reason and then publish the result. As those people
+diff -urNad /home/inet/tmp/cdrtools-2.01/scgcheck/scgcheck.c cdrtools-2.01/scgcheck/scgcheck.c
+--- /home/inet/tmp/cdrtools-2.01/scgcheck/scgcheck.c	2004-01-15 02:39:33.000000000 +0100
++++ cdrtools-2.01/scgcheck/scgcheck.c	2004-04-21 15:26:07.000000000 +0200
+@@ -414,7 +414,7 @@
+ 	fprintf(logfile, "Using libscg version '%s-%s'\n", auth, vers);
+ 	if (auth == 0 || strcmp("schily", auth) != 0) {
+ 		errmsgno(EX_BAD,
+-		"Warning: using inofficial version of libscg (%s-%s '%s').\n",
++		"Warning: using unofficial version of libscg (%s-%s '%s').\n",
+ 			auth, vers, scg_version(0, SCG_SCCS_ID));
+ 	}
+ 
+@@ -425,7 +425,7 @@
+ 	fprintf(logfile, "Using libscg transport code version '%s-%s'\n", auth, vers);
+ 	if (auth == 0 || strcmp("schily", auth) != 0) {
+ 		errmsgno(EX_BAD,
+-		"Warning: using inofficial libscg transport code version (%s-%s '%s').\n",
++		"Warning: using unofficial libscg transport code version (%s-%s '%s').\n",
+ 			auth, vers, scg_version(scgp, SCG_SCCS_ID));
+ 	}
+ 	vers = scg_version(scgp, SCG_KVERSION);
+@@ -440,7 +440,7 @@
+ 
+ 	if (auth != 0 && strcmp("schily", auth) != 0) {
+ 		errmsgno(EX_BAD,
+-		"Warning: using inofficial remote transport code version (%s-%s '%s').\n",
++		"Warning: using unofficial remote transport code version (%s-%s '%s').\n",
+ 			auth, vers, scg_version(scgp, SCG_RSCCS_ID));
+ 	}
+ 	if (auth == NULL)
--- cdrtools-2.01+01a01.orig/debian/patches/27_default_device.dpatch
+++ cdrtools-2.01+01a01/debian/patches/27_default_device.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 27_default_device.dpatch by  <martin.pitt@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad --exclude=CVS --exclude=.svn ./cdrecord/cdrecord.dfl /tmp/dpep-work.qk7AXL/cdrtools-2.01+01a01/cdrecord/cdrecord.dfl
+--- ./cdrecord/cdrecord.dfl	2002-07-07 23:56:21.000000000 +0200
++++ /tmp/dpep-work.qk7AXL/cdrtools-2.01+01a01/cdrecord/cdrecord.dfl	2005-08-16 18:39:45.000000000 +0200
+@@ -6,7 +6,7 @@
+ # 
+ # The default device, if not specified elswhere
+ #
+-CDR_DEVICE=yamaha
++CDR_DEVICE=/dev/cdrw
+ 
+ # 
+ # The default speed, if not specified elswhere
--- cdrtools-2.01+01a01.orig/debian/patches/20_rsh-bugfix.dpatch
+++ cdrtools-2.01+01a01/debian/patches/20_rsh-bugfix.dpatch
@@ -0,0 +1,41 @@
+#! /bin/sh -e
+## 20_rsh-bugfix.dpatch by Joerg Schilling
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix local root compromise CAN-2004-0806.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- librscg/scsi-remote.c	2004-01-15 01:25:09.000000000 +0100
++++ librscg/scsi-remote.c	2004-08-24 00:11:42.000000000 +0200
+@@ -1078,6 +1078,13 @@
+ 			_exit(EX_BAD);
+ 			/* NOTREACHED */
+ 		}
++		if (getuid() != geteuid() &&
++		    seteuid(pw->pw_uid) == -1) {
++			errmsg("seteuid(%lld) failed.\n",
++							(Llong)pw->pw_uid);
++			_exit(EX_BAD);
++			/* NOTREACHED */
++		}
+ 
+ 		/*
+ 		 * Fork again to completely detach from parent
--- cdrtools-2.01+01a01.orig/debian/patches/14a_mkisofs_iconv.interdiff
+++ cdrtools-2.01+01a01/debian/patches/14a_mkisofs_iconv.interdiff
@@ -0,0 +1,33 @@
+These are the changes of 14_mkisofs_iconv.dpatch compared to the original
+mkisofs-iconv-X patch. If you upgrade 14_mkisofs_iconv with the new
+mkisovs-iconv patch, add the contents of this file to the end of the new
+file or merge this patch during a d-p-e session somehow.
+
+diff -u cdrtools-2.01-debian/mkisofs/mkisofs.c cdrtools-2.01/mkisofs/mkisofs.c
+--- cdrtools-2.01-debian/mkisofs/mkisofs.c	2003-11-20 10:57:40.000000000 +0200
++++ cdrtools-2.01/mkisofs/mkisofs.c	Thu Jan  8 10:37:49 2004
+@@ -67,7 +67,7 @@
+ struct directory *root = NULL;
+ int		path_ind;
+ 
+-char	version_string[] = "mkisofs 2.01a24";
++char	version_string[] = "mkisofs 2.01a24-unofficial-iconv";
+ 
+ char		*outfile;
+ FILE		*discimage;
+@@ -932,6 +932,7 @@
+ 	fprintf(stderr, "Usage: %s [options] file...\n", program_name);
+ 	fprintf(stderr, "\nUse %s -help\n", program_name);
+ 	fprintf(stderr, "to get a list of valid options.\n");
++	fprintf(stderr, "This version of mkisofs includes the unofficial iconv-patch\nfrom http://users.utu.fi/jahhein/mkisofs/\nReport errors to cdrtools@packages.debian.org\n");
+ 
+ 	exit(excode);
+ }
+@@ -1027,6 +1028,7 @@
+ 			fprintf(stderr, "%s\n", ld_options[i].doc);
+ 		}
+ 	}
++	fprintf(stderr, "This version of mkisofs includes the unofficial iconv-patch\nfrom http://users.utu.fi/jahhein/mkisofs/\nReport errors to cdrtools@packages.debian.org\n");
+ 	exit(excode);
+ }
+ 
--- cdrtools-2.01+01a01.orig/debian/patches/26_author_locale.dpatch
+++ cdrtools-2.01+01a01/debian/patches/26_author_locale.dpatch
@@ -0,0 +1,32 @@
+#! /bin/sh -e
+## 21_author_locale.dpatch by Andreas Mueller <amu@canonical.com>
+##
+## DP: Remove cmdline from the isofs header
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -Nru cdrtools-2.0+a38/cdrecord/cdrecord.c.orig cdrtools-2.0+a38/cdrecord/cdrecord.c
+--- cdrtools-2.0+a38/cdrecord/cdrecord.c.orig	2005-01-06 22:21:17.542345936 +0100
++++ cdrtools-2.0+a38/cdrecord/cdrecord.c	2005-01-06 22:22:27.919646960 +0100
+@@ -349,7 +349,7 @@
+ #	define	CLONE_TITLE	""
+ #endif
+ 	if ((flags & F_MSINFO) == 0 || lverbose || flags & F_VERSION) {
+-		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2004 Jörg Schilling\n",
++		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2004 Joerg Schilling\n",
+ 								PRODVD_TITLE,
+ 								CLONE_TITLE,
+ 								cdr_version,
--- cdrtools-2.01+01a01.orig/debian/patches/01_conffiles.dpatch
+++ cdrtools-2.01+01a01/debian/patches/01_conffiles.dpatch
@@ -0,0 +1,45 @@
+#! /bin/sh -e
+## 01_conffiles.dpatch by Joerg Jaspert <joerg@debian.org>
+## (original made by some of the former maintainers)
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Comments USER and ACCESS entries in rscsi file.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- cdrtools-1.11.orig/rscsi/rscsi.dfl
++++ cdrtools-1.11/rscsi/rscsi.dfl
+@@ -24,8 +24,8 @@
+ #
+ # USER= entries are checked with a pattern matcher. USER=* matches all users.
+ #
+-USER=rscsi
+-USER=joerg
++#USER=rscsi
++#USER=joerg
+ 
+ #
+ # Each ACCESS= entry adds a target or group of targets to the list of visible
+@@ -52,6 +52,6 @@
+ #	name	name
+ #
+ #ACCESS=rscsi	sparky	-1	-1	-1	-1
+-ACCESS=rscsi	sparky	0	-1	6	-1
+-ACCESS=rscsi	sparky	1	-1	3	-1
+-ACCESS=rscsi	sparky	1	-1	4	-1
++#ACCESS=rscsi	sparky	0	-1	6	-1
++#ACCESS=rscsi	sparky	1	-1	3	-1
++#ACCESS=rscsi	sparky	1	-1	4	-1
--- cdrtools-2.01+01a01.orig/debian/patches/00list
+++ cdrtools-2.01+01a01/debian/patches/00list
@@ -0,0 +1,23 @@
+01_conffiles
+02_paths
+03_script
+05_zisofs
+06_dautipps
+07_noadvertising
+08_privacy
+12_zisofs
+13_zisofs.191367
+14_mkisofs_iconv
+15_mkisofs_iconv_debianize
+16_debian_email
+17_argv0_beautify
+18_donotopen_hda
+20_rsh-bugfix
+21_makefile_fix_for_kernel
+22_linux_rawio_capability
+23_o_excl
+24_debug_tmpfile
+25_mkisofs_iconv_manpage
+26_author_locale
+27_default_device
+30_mkisofs_JTE-v1.15
--- cdrtools-2.01+01a01.orig/debian/patches/07_noadvertising.dpatch
+++ cdrtools-2.01+01a01/debian/patches/07_noadvertising.dpatch
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+## 07_noadvertising.dpatch by  <ametzler@downhill.univie.ac.at>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Remove advertising for cdrecord-ProDVD.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -urNad /tmp/cdrtools-2.01/cdrecord/cdrecord.c cdrtools-2.01/cdrecord/cdrecord.c
+--- /tmp/cdrtools-2.01/cdrecord/cdrecord.c	Wed Jan  7 16:33:18 2004
++++ cdrtools-2.01/cdrecord/cdrecord.c	Wed Jan  7 16:35:33 2004
+@@ -627,9 +627,7 @@
+ 			errmsgno(EX_BAD,
+ 			"This version of cdrecord does not include DVD-R/DVD-RW support code.\n");
+ 			errmsgno(EX_BAD,
+-			"If you need DVD-R/DVD-RW support, ask the Author for cdrecord-ProDVD.\n");
+-			errmsgno(EX_BAD,
+-			"Free test versions and free keys for personal use are at ftp://ftp.berlios.de/pub/cdrecord/ProDVD/\n");
++ 			"See /usr/share/doc/cdrecord/README.DVD.Debian for details on DVD support.\n");
+ 		}
+ 		/*
+ 		 * Only exit if this is not the ProDVD test binary.
--- cdrtools-2.01+01a01.orig/debian/patches/12_zisofs.dpatch
+++ cdrtools-2.01+01a01/debian/patches/12_zisofs.dpatch
@@ -0,0 +1,102 @@
+#! /bin/sh -e
+## 12_zisofs.dpatch by Andreas Krueger <<andreas.krueger@dv-ratio.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: --sloppy option of mkzftree is not parsed and buggy
+## DP: See http://bugs.debian.org/#188212
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+                exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /tmp/cdrt/cdrtools-2.0+a10/zisofs_tools/mkzftree.c cdrtools-2.0+a10/zisofs_tools/mkzftree.c
+--- /tmp/cdrt/cdrtools-2.0+a10/zisofs_tools/mkzftree.c	2003-04-14 13:45:27.000000000 +0200
++++ cdrtools-2.0+a10/zisofs_tools/mkzftree.c	2003-04-14 13:47:59.000000000 +0200
+@@ -94,7 +94,7 @@
+ const char *program;
+ 
+ /* Long options */
+-#define OPTSTRING "fz:up:xXC:lLFvqV:hw"
++#define OPTSTRING "fz:up:xXC:lLFsvqV:hw"
+ #ifdef HAVE_GETOPT_LONG
+ const struct option long_options[] = {
+   { "force",	             0,  0,  'f' },
+@@ -106,6 +106,7 @@
+   { "crib-tree",             1,  0,  'C' },
+   { "local",                 0,  0,  'l' },
+   { "strict-local",          0,  0,  'L' },
++  { "sloppy",                0,  0,  's' },
+   { "file",                  0,  0,  'F' },
+   { "verbose",               0,  0,  'v' },
+   { "quiet",                 0,  0,  'q' },
+@@ -265,17 +266,17 @@
+ 
+   if ( !opt.file_root ) {
+     if ( chown(out, st.st_uid, st.st_gid) && !opt.sloppy ) {
+-      message(vl_error, "%s: %s: %s", program, out, strerror(errno));
++      message(vl_error, "%s: %s: %s\n", program, out, strerror(errno));
+       err = EX_CANTCREAT;
+     }
+     if ( chmod(out, st.st_mode) && !opt.sloppy && !err ) {
+-      message(vl_error, "%s: %s: %s", program, out, strerror(errno));
++      message(vl_error, "%s: %s: %s\n", program, out, strerror(errno));
+       err = EX_CANTCREAT;
+     }
+     ut.actime  = st.st_atime;
+     ut.modtime = st.st_mtime;
+     if ( utime(out, &ut) && !opt.sloppy && !err ) {
+-      message(vl_error, "%s: %s: %s", program, out, strerror(errno));
++      message(vl_error, "%s: %s: %s\n", program, out, strerror(errno));
+       err = EX_CANTCREAT;
+     }
+   }
+diff -urNad /tmp/cdrt/cdrtools-2.0+a10/zisofs_tools/walk.c cdrtools-2.0+a10/zisofs_tools/walk.c
+--- /tmp/cdrt/cdrtools-2.0+a10/zisofs_tools/walk.c	2003-04-14 13:45:27.000000000 +0200
++++ cdrtools-2.0+a10/zisofs_tools/walk.c	2003-04-14 13:47:59.000000000 +0200
+@@ -291,26 +291,26 @@
+   /* This is done by munge_file() for files */
+   if ( !S_ISREG(st.st_mode) ) {
+ #ifdef HAVE_LCHOWN
+-    if ( lchown(out_path, st.st_uid, st.st_gid) && opt.sloppy && !err ) {
+-      message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++    if ( lchown(out_path, st.st_uid, st.st_gid) && !opt.sloppy && !err ) {
++      message(vl_error, "%s: %s: %s\n", program, out_path, strerror(errno));
+       err = EX_CANTCREAT;
+     }
+ #endif
+     if ( !S_ISLNK(st.st_mode) ) {
+ #ifndef HAVE_LCHOWN
+       if ( chown(out_path, st.st_uid, st.st_gid) && !opt.sloppy && !err ) {
+-	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	message(vl_error, "%s: %s: %s\n", program, out_path, strerror(errno));
+ 	err = EX_CANTCREAT;
+       }
+ #endif
+       if ( chmod(out_path, st.st_mode) && !opt.sloppy && !err ) {
+-	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	message(vl_error, "%s: %s: %s\n", program, out_path, strerror(errno));
+ 	err = EX_CANTCREAT;
+       }
+       ut.actime  = st.st_atime;
+       ut.modtime = st.st_mtime;
+       if ( utime(out_path, &ut) && !opt.sloppy && !err ) {
+-	message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
++	message(vl_error, "%s: %s: %s\n", program, out_path, strerror(errno));
+ 	err = EX_CANTCREAT;
+       }
+     }
--- cdrtools-2.01+01a01.orig/debian/patches/08_privacy.dpatch
+++ cdrtools-2.01+01a01/debian/patches/08_privacy.dpatch
@@ -0,0 +1,36 @@
+#! /bin/sh -e
+## 08_privacy.dpatch by Eduard Bloch <blade@debian.org>
+##
+## DP: Remove cmdline from the isofs header
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -urNad /tmp/cdrtools-2.01/mkisofs/write.c cdrtools-2.01/mkisofs/write.c
+--- /tmp/cdrtools-2.01/mkisofs/write.c	Wed May  7 17:17:45 2003
++++ cdrtools-2.01/mkisofs/write.c	Wed May  7 17:33:10 2003
+@@ -2065,7 +2065,11 @@
+ 	}
+ 
+ 	cp[SECTOR_SIZE - 1] = '\0';
+-	xfwrite(vers, SECTOR_SIZE, 1, outfile, 0, TRUE);
++ 	/* Per default: keep privacy. Blackout the version and arguments. */
++	if(getenv("ISODEBUG"))
++		xfwrite(vers, SECTOR_SIZE, 1, outfile, 0, TRUE);
++	else
++		xfwrite(calloc(SECTOR_SIZE, 1), SECTOR_SIZE, 1, outfile, 0, TRUE);
+ 	last_extent_written += 1;
+ 	return (0);
+ }
--- cdrtools-2.01+01a01.orig/debian/patches/17_argv0_beautify.dpatch
+++ cdrtools-2.01+01a01/debian/patches/17_argv0_beautify.dpatch
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+## 17_argv0_beautify.dpatch by Eduard Bloch <blade@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Remove the Debian specific suffix from the executable filename
+
+if [ $# -lt 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+                exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/inet/debian/tmp/cdrtools-2.0+a25/cdrecord/cdrecord.c cdrtools-2.0+a25/cdrecord/cdrecord.c
+--- /home/inet/debian/tmp/cdrtools-2.0+a25/cdrecord/cdrecord.c	2004-02-05 13:35:05.000000000 +0100
++++ cdrtools-2.0+a25/cdrecord/cdrecord.c	2004-02-05 13:35:37.000000000 +0100
+@@ -269,6 +269,13 @@
+ 	SCSI	*scgp = NULL;
+ 	char	errstr[80];
+ 	BOOL	gracedone = FALSE;
++	char	*suf = '\0';
++
++/* cut the Debian specific suffix from the executable filename */
++	suf = strstr(av[0], ".mmap");
++	if(!suf)
++		suf = strstr(av[0], ".shm");
++	if(suf) *suf = '\0';
+ 
+ #ifdef __EMX__
+ 	/* This gives wildcard expansion with Non-Posix shells with EMX */
--- cdrtools-2.01+01a01.orig/debian/patches/06_dautipps.dpatch
+++ cdrtools-2.01+01a01/debian/patches/06_dautipps.dpatch
@@ -0,0 +1,49 @@
+#! /bin/sh -e
+## 06_dautipps.dpatch by Eduard Bloch <blade@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Little patch to extend error information
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -urNad /tmp/cdrtools-2.0+a25/cdrecord/cdrecord.c cdrtools-2.0+a25/cdrecord/cdrecord.c
+--- /tmp/cdrtools-2.0+a25/cdrecord/cdrecord.c	Thu Jan 15 22:28:20 2004
++++ cdrtools-2.0+a25/cdrecord/cdrecord.c	Wed Mar  3 16:02:16 2004
+@@ -446,6 +446,9 @@
+ 			errmsg("%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":"");
+ 			errmsgno(EX_BAD, "For possible targets try 'cdrecord -scanbus'. Make sure you are root.\n");
+ 			errmsgno(EX_BAD, "For possible transport specifiers try 'cdrecord dev=help'.\n");
++			errmsgno(EX_BAD, "\n");
++			errmsgno(EX_BAD, "For more information, install the cdrtools-doc\n");
++			errmsgno(EX_BAD, "package and read /usr/share/doc/cdrecord/README.ATAPI.setup .\n");
+ 			exit(EX_BAD);
+ 	}
+ 	/*
+diff -urNad /tmp/cdrtools-2.0+a25/mkisofs/mkisofs.c cdrtools-2.0+a25/mkisofs/mkisofs.c
+--- /tmp/cdrtools-2.0+a25/mkisofs/mkisofs.c	Wed Jan  7 00:23:46 2004
++++ cdrtools-2.0+a25/mkisofs/mkisofs.c	Wed Mar  3 16:01:00 2004
+@@ -3010,9 +3010,9 @@
+ 	}
+ 	if (goof) {
+ #ifdef	USE_LIBSCHILY
+-		comerrno(EX_BAD, "Joliet tree sort failed.\n");
++		comerrno(EX_BAD, "Joliet tree sort failed. The -joliet-long switch may help you.\n");
+ #else
+-		fprintf(stderr, "Joliet tree sort failed.\n");
++		fprintf(stderr, "Joliet tree sort failed. The -joliet-long switch may help you.\n");
+ 		exit(1);
+ #endif
+ 	}
--- cdrtools-2.01+01a01.orig/debian/patches/25_mkisofs_iconv_manpage.dpatch
+++ cdrtools-2.01+01a01/debian/patches/25_mkisofs_iconv_manpage.dpatch
@@ -0,0 +1,31 @@
+#! /bin/sh -e
+##
+## DP: mkisofs(8): Clarify that charsets supported by iconv, are
+## DP: not printed with --input-charset help.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+--- ./mkisofs/mkisofs.8~	2004-08-03 20:21:54.000000000 +0200
++++ ./mkisofs/mkisofs.8	2005-03-04 10:55:29.937705920 +0100
+@@ -1700,6 +1700,8 @@
+ .IR mkisofs .
+ To get a listing, use
+ .B "mkisofs \-input\-charset help.
++This list doesn't include the charset derived from the current locale,
++if mkisofs is built with iconv support.
+ .PP
+ Additional character sets can be read from file for any of the character
+ set options by giving a filename as the argument to the options. The given
--- cdrtools-2.01+01a01.orig/debian/patches/21_makefile_fix_for_kernel.dpatch
+++ cdrtools-2.01+01a01/debian/patches/21_makefile_fix_for_kernel.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 21_makefile_fix_for_kernel.dpatch by Joerg Jaspert <joerg@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix problems with kernel include doing wrong things.
+
+@DPATCH@
+diff -urNad cdrtools-2.01+01a01/DEFAULTS/Defaults.linux /home/joerg/tmp/dpep.kr4U5j/cdrtools-2.01+01a01/DEFAULTS/Defaults.linux
+--- cdrtools-2.01+01a01/DEFAULTS/Defaults.linux	2003-02-16 01:01:48.000000000 +0100
++++ /home/joerg/tmp/dpep.kr4U5j/cdrtools-2.01+01a01/DEFAULTS/Defaults.linux	2005-01-09 17:44:24.780540881 +0100
+@@ -18,7 +18,7 @@
+ ###########################################################################
+ CWARNOPTS=
+ 
+-DEFINCDIRS=	$(SRCROOT)/include /usr/src/linux/include
++DEFINCDIRS=	$(SRCROOT)/include
+ LDPATH=		-L/opt/schily/lib
+ RUNPATH=	-R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR)
+ 
--- cdrtools-2.01+01a01.orig/debian/patches/16_debian_email.dpatch
+++ cdrtools-2.01+01a01/debian/patches/16_debian_email.dpatch
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+## 16_debian_email.dpatch by Eduard Bloch <blade@debian.org>
+##
+## DP: Define our contact address for program info
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+                exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/inet/debian/tmp/cdrtools-2.01/cdrecord/cdrecord.c cdrtools-2.01/cdrecord/cdrecord.c
+--- /home/inet/debian/tmp/cdrtools-2.01/cdrecord/cdrecord.c	2004-01-16 23:07:01.000000000 +0100
++++ cdrtools-2.01/cdrecord/cdrecord.c	2004-01-16 23:07:02.000000000 +0100
+@@ -352,7 +352,7 @@
+ 								HOST_CPU, HOST_VENDOR, HOST_OS);
+ 
+ #if	defined(SOURCE_MODIFIED) || !defined(IS_SCHILY_XCONFIG)
+-#define	INSERT_YOUR_EMAIL_ADDRESS_HERE
++#define	INSERT_YOUR_EMAIL_ADDRESS_HERE "cdrtools@packages.debian.org"
+ #define	NO_SUPPORT	0
+ 		printf("NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord\n");
+ 		printf("      and thus may have bugs that are not present in the original version.\n");
+diff -urNad /home/inet/debian/tmp/cdrtools-2.01/conf/xconfig.h.in cdrtools-2.01/conf/xconfig.h.in
+--- /home/inet/debian/tmp/cdrtools-2.01/conf/xconfig.h.in	2004-01-16 23:06:46.000000000 +0100
++++ cdrtools-2.01/conf/xconfig.h.in	2004-01-16 23:07:39.000000000 +0100
+@@ -532,8 +532,9 @@
+  *
+  * This restiction is introduced because this way, I hope that people
+  * contribute to the project instead of creating branches.
+- */
++*/
+ #define	IS_SCHILY_XCONFIG
++#define SOURCE_MODIFIED
+ /*
+  * End restricted code for quality assurance.
+  */
--- cdrtools-2.01+01a01.orig/debian/patches/23_o_excl.dpatch
+++ cdrtools-2.01+01a01/debian/patches/23_o_excl.dpatch
@@ -0,0 +1,149 @@
+#! /bin/sh -e
+## 20_open_excl.dpatch by  <mpitt@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsi-linux-ata.c cdrtools-2.0+a30.pre1/libscg/scsi-linux-ata.c
+--- /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsi-linux-ata.c	2004-10-19 13:19:33.943939128 +0200
++++ cdrtools-2.0+a30.pre1/libscg/scsi-linux-ata.c	2004-10-19 13:22:09.099351920 +0200
+@@ -267,7 +267,7 @@
+ 			starget,
+ 			slun;
+ 
+-		f = open(device, O_RDONLY | O_NONBLOCK);
++		f = sg_open_excl(device, O_RDONLY | O_NONBLOCK);
+ 
+ 		if (f < 0) {
+ 			if (scgp->errstr)
+diff -urNad /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsi-linux-pg.c cdrtools-2.0+a30.pre1/libscg/scsi-linux-pg.c
+--- /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsi-linux-pg.c	2004-10-19 13:19:33.945938824 +0200
++++ cdrtools-2.0+a30.pre1/libscg/scsi-linux-pg.c	2004-10-19 13:20:44.774171296 +0200
+@@ -207,7 +207,7 @@
+ 			return (0);
+ #endif
+ 		js_snprintf(devname, sizeof (devname), "/dev/pg%d", tgt);
+-		f = open(devname, O_RDWR | O_NONBLOCK);
++		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
+ 		if (f < 0) {
+ 			if (scgp->errstr)
+ 				js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
+@@ -220,7 +220,7 @@
+ 		tlun = 0;
+ 		for (tgt = 0; tgt < MAX_TGT; tgt++) {
+ 			js_snprintf(devname, sizeof (devname), "/dev/pg%d", tgt);
+-			f = open(devname, O_RDWR | O_NONBLOCK);
++			f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
+ 			if (f < 0) {
+ 				/*
+ 				 * Set up error string but let us clear it later
+diff -urNad /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsi-linux-sg.c cdrtools-2.0+a30.pre1/libscg/scsi-linux-sg.c
+--- /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsi-linux-sg.c	2004-10-19 13:20:42.774475296 +0200
++++ cdrtools-2.0+a30.pre1/libscg/scsi-linux-sg.c	2004-10-19 13:20:44.777170840 +0200
+@@ -217,6 +217,28 @@
+ #endif
+ LOCAL	void	sg_settimeout	__PR((int f, int timeout));
+ 
++int    sg_open_excl    __PR((char *device, int mode));
++
++int
++sg_open_excl(device, mode)
++       char    *device;
++       int     mode;
++{
++       int f;
++       int i;
++               f = open(device, mode|O_EXCL);
++       for (i = 0; (i < 10) && (f == -1 && (errno == EACCES || errno == EBUSY)); i++) {
++           fprintf(stderr, "Error trying to open %s exclusively (%s)... retrying in 1 second.\n", device, strerror(errno));
++           usleep(1000000 + 100000.0 * rand()/(RAND_MAX+1.0));
++           f = open(device, mode|O_EXCL);
++       }
++       if (f == -1 && errno != EACCES && errno != EBUSY) {
++           f = open(device, mode);
++       }
++       return f;
++}
++
++
+ /*
+  * Return version information for the low level SCSI transport code.
+  * This has been introduced to make it easier to trace down problems
+@@ -375,7 +397,7 @@
+ 	if (use_ata) for (i=2*busno+tgt >= 0 ? 2*busno+tgt:0; i <= 25; i++) {
+ 		js_snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
+ 					/* O_NONBLOCK is dangerous */
+-		f = open(devname, O_RDWR | O_NONBLOCK);
++		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
+ 		if (f < 0) {
+ 			/*
+ 			 * Set up error string but let us clear it later
+@@ -415,7 +437,7 @@
+ 	if (nopen == 0) for (i = 0; i < 32; i++) {
+ 		js_snprintf(devname, sizeof (devname), "/dev/sg%d", i);
+ 					/* O_NONBLOCK is dangerous */
+-		f = open(devname, O_RDWR | O_NONBLOCK);
++		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
+ 		if (f < 0) {
+ 			/*
+ 			 * Set up error string but let us clear it later
+@@ -444,7 +466,7 @@
+ 	if (nopen == 0) for (i = 0; i <= 25; i++) {
+ 		js_snprintf(devname, sizeof (devname), "/dev/sg%c", i+'a');
+ 					/* O_NONBLOCK is dangerous */
+-		f = open(devname, O_RDWR | O_NONBLOCK);
++		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
+ 		if (f < 0) {
+ 			/*
+ 			 * Set up error string but let us clear it later
+@@ -483,7 +505,7 @@
+ 			"Warning: Open by 'devname' is unintentional and not supported.\n");
+ 		}
+ 					/* O_NONBLOCK is dangerous */
+-		f = open(device, O_RDWR | O_NONBLOCK);
++		f = sg_open_excl(device, O_RDWR | O_NONBLOCK);
+ /*		if (f < 0 && errno == ENOENT)*/
+ /*			goto openpg;*/
+ 
+diff -urNad /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsitransp.c cdrtools-2.0+a30.pre1/libscg/scsitransp.c
+--- /home/martin/devel/cdr/cdrtools-2.0+a30.pre1/libscg/scsitransp.c	2004-10-19 13:19:33.951937912 +0200
++++ cdrtools-2.0+a30.pre1/libscg/scsitransp.c	2004-10-19 13:20:44.779170536 +0200
+@@ -52,8 +52,8 @@
+  *	Choose your name instead of "schily" and make clear that the version
+  *	string is related to a modified source.
+  */
+-LOCAL	char	_scg_version[]		= "0.8";	/* The global libscg version	*/
+-LOCAL	char	_scg_auth_schily[]	= "schily";	/* The author for this module	*/
++LOCAL	char	_scg_version[]		= "0.8ubuntu1";	/* The global libscg version	*/
++LOCAL	char	_scg_auth_ubuntu[]	= "ubuntu";	/* The author for this module	*/
+ 
+ #define	DEFTIMEOUT	20	/* Default timeout for SCSI command transport */
+ 
+@@ -137,7 +137,7 @@
+ 		 * return "schily" for the SCG_AUTHOR request.
+ 		 */
+ 		case SCG_AUTHOR:
+-			return (_scg_auth_schily);
++			return (_scg_auth_ubuntu);
+ 		case SCG_SCCS_ID:
+ 			return (sccsid);
+ 		default:
--- cdrtools-2.01+01a01.orig/debian/patches/22_linux_rawio_capability.dpatch
+++ cdrtools-2.01+01a01/debian/patches/22_linux_rawio_capability.dpatch
@@ -0,0 +1,79 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+##
+## DP: Add linux specific rawio capability allocation to work with kernels > 2.6.8
+
+@DPATCH@
+diff -urNad cdrtools-2.01+01a01/cdrecord/cdrecord.c /tmp/dpep.tvvTzK/cdrtools-2.01+01a01/cdrecord/cdrecord.c
+--- cdrtools-2.01+01a01/cdrecord/cdrecord.c	2005-01-15 03:11:06.000000000 +0100
++++ /tmp/dpep.tvvTzK/cdrtools-2.01+01a01/cdrecord/cdrecord.c	2005-01-15 03:11:08.000000000 +0100
+@@ -58,6 +58,7 @@
+ #include "defaults.h"
+ #include "movesect.h"
+ 
++#include <sys/capability.h> 	/* for rawio capability */
+ 
+ char	cdr_version[] = "2.01.01a01";
+ 
+@@ -244,6 +245,8 @@
+ LOCAL	void	set_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
+ LOCAL	void	linuxcheck	__PR((void));
+ 
++LOCAL int get_cap   __PR((cap_value_t cap_array));
++
+ struct exargs {
+ 	SCSI	*scgp;
+ 	cdr_t	*dp;
+@@ -515,6 +518,12 @@
+ #endif
+ 			comerr("Panic cannot set back effective uid.\n");
+ 	}
++
++	/* get the rawio capability */
++	if (get_cap(CAP_SYS_RAWIO))
++		perror("Error: Cannot gain SYS_RAWIO capability."
++			"Is cdrecord installed SUID root?\n");
++
+ 	/*
+ 	 * WARNING: We now are no more able to do any privilleged operation
+ 	 * unless we have been called by root.
+@@ -1040,6 +1049,10 @@
+ 			if (setreuid(-1, getuid()) < 0)
+ 				comerr("Panic cannot set back effective uid.\n");
+ 		}
++		if (get_cap(CAP_SYS_RAWIO))
++			perror("Error: Cannot gain SYS_RAWIO capability."
++				"Is cdrecord installed SUID root?\n");
++
+ #endif
+ 	}
+ 	if ((*dp->cdr_set_speed_dummy)(scgp, dp, &speed) < 0) {
+@@ -4732,3 +4745,17 @@
+ 	}
+ #endif
+ }
++
++LOCAL int
++get_cap(cap_array)
++	cap_value_t cap_array;
++{ 
++    	  int ret;
++	  cap_t capa;
++	  capa = cap_get_proc();
++	  cap_set_flag(capa, CAP_EFFECTIVE,  1, &cap_array, CAP_SET);
++	  ret = cap_set_proc(capa);
++	  cap_free(capa);
++	  return ret; 
++}
++
+diff -urNad cdrtools-2.01+01a01/cdrecord/Makefile /tmp/dpep.tvvTzK/cdrtools-2.01+01a01/cdrecord/Makefile
+--- cdrtools-2.01+01a01/cdrecord/Makefile	2005-01-15 03:09:26.000000000 +0100
++++ /tmp/dpep.tvvTzK/cdrtools-2.01+01a01/cdrecord/Makefile	2005-01-15 03:11:40.000000000 +0100
+@@ -33,7 +33,7 @@
+ 		../include/scg/scgio.h ../include/scg/scsidefs.h \
+ 		../include/scg/scsireg.h ../include/scg/scsitransp.h
+ #LIBS=		-lschily $(LIB_SOCKET)
+-LIBS=		-lrscg -lscg $(LIB_VOLMGT) -ledc_ecc -ldeflt -lschily $(SCSILIB) $(LIB_SOCKET)
++LIBS=		-lcap -lrscg -lscg $(LIB_VOLMGT) -ledc_ecc -ldeflt -lschily $(SCSILIB) $(LIB_SOCKET)
+ XMK_FILE=	Makefile.man
+ 
+ ###########################################################################
--- cdrtools-2.01+01a01.orig/debian/patches/14_mkisofs_iconv.dpatch
+++ cdrtools-2.01+01a01/debian/patches/14_mkisofs_iconv.dpatch
@@ -0,0 +1,641 @@
+#! /bin/sh -e
+## 14_mkisofs_iconv.dpatch by Jungshik Shin, enhanced by Jaakko Heinonen
+##
+## DP: Sane charset conversion support trough iconv
+## DP: http://users.utu.fi/jahhein/mkisofs/
+## DP: Additional changes in 15_mkisofs_iconv_debianize.dpatch
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -urN --exclude-from=- cdrtools-2.01/include/unls.h cdrtools-2.01-jh/include/unls.h
+--- cdrtools-2.01/include/unls.h	2003-06-16 00:41:23.000000000 +0300
++++ cdrtools-2.01-jh/include/unls.h	2004-02-02 18:31:22.000000000 +0200
+@@ -30,6 +30,10 @@
+ #include <prototyp.h>
+ #endif
+ 
++#ifdef USE_ICONV
++#include <iconv.h>
++#endif
++
+ #ifdef	__cplusplus
+ extern "C" {
+ #endif
+@@ -43,6 +47,9 @@
+ 	char *charset;
+ 	unsigned char **page_uni2charset;
+ 	struct nls_unicode *charset2uni;
++#ifdef USE_ICONV
++	iconv_t iconv_d;
++#endif
+ 
+ 	void (*inc_use_count) 	__PR((void));
+ 	void (*dec_use_count) 	__PR((void));
+@@ -58,6 +65,9 @@
+ extern void 		unload_nls		__PR((struct nls_table *));
+ extern struct nls_table *load_nls_default	__PR((void));
+ extern int		init_nls_file		__PR((char * name));
++#ifdef USE_ICONV
++extern int		init_nls_iconv		__PR((char * name));
++#endif
+ 
+ #ifdef	__cplusplus
+ }
+diff -urN --exclude-from=- cdrtools-2.01/libunls/libunls.mk cdrtools-2.01-jh/libunls/libunls.mk
+--- cdrtools-2.01/libunls/libunls.mk	2000-03-25 14:51:56.000000000 +0200
++++ cdrtools-2.01-jh/libunls/libunls.mk	2004-02-02 18:31:22.000000000 +0200
+@@ -8,6 +8,7 @@
+ INSDIR=		lib
+ TARGETLIB=	unls
+ #CPPOPTS +=	-Istdio
++CPPOPTS +=	-DUSE_ICONV
+ include		Targets
+ LIBS=		
+ 
+diff -urN --exclude-from=- cdrtools-2.01/libunls/nls.h cdrtools-2.01-jh/libunls/nls.h
+--- cdrtools-2.01/libunls/nls.h	2002-12-03 02:34:27.000000000 +0200
++++ cdrtools-2.01-jh/libunls/nls.h	2004-02-02 18:31:22.000000000 +0200
+@@ -111,5 +111,8 @@
+ extern int init_nls_cp10079	__PR((void));
+ extern int init_nls_cp10081	__PR((void));
+ extern int init_nls_file	__PR((char * name));
++#ifdef USE_ICONV
++extern int init_nls_iconv	__PR((char * name));
++#endif
+ 
+ #endif	/* _NLS_H */
+diff -urN --exclude-from=- cdrtools-2.01/libunls/nls_iconv.c cdrtools-2.01-jh/libunls/nls_iconv.c
+--- cdrtools-2.01/libunls/nls_iconv.c	1970-01-01 02:00:00.000000000 +0200
++++ cdrtools-2.01-jh/libunls/nls_iconv.c	2004-02-02 18:31:22.000000000 +0200
+@@ -0,0 +1,96 @@
++/* @(#)nls_iconv.c	1.0 02/04/20 2002 J. Schilling  */
++#ifndef lint
++static	char sccsid[] =
++	"@(#)nls_iconv.c	1.0 02/01/20 2002 J. Schilling";
++#endif
++/*
++ * 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, 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; see the file COPYING.  If not, write to
++ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++/*
++ *	Modifications to make the code portable Copyright (c) 2000 J. Schilling
++ *
++ * nls_iconv: create a pseudo-charset table to use iconv() provided by C
++ * library or libiconv by Bruno Haible
++ * The Unicode to charset table has only exact mappings.
++ *
++ *
++ * Jungshik Shin (jshin@mailaps.org) 04-Feb-2002
++ */
++
++#ifdef USE_ICONV
++#include <mconfig.h>
++#include <stdio.h>
++#include <stdxlib.h>
++#include <strdefs.h>
++#include "nls.h"
++#include <iconv.h>
++
++static void	inc_use_count	__PR((void));
++static void	dec_use_count	__PR((void));
++
++
++static void
++inc_use_count()
++{
++	MOD_INC_USE_COUNT;
++}
++
++static void
++dec_use_count()
++{
++	MOD_DEC_USE_COUNT;
++}
++
++int
++init_nls_iconv(charset)
++	char	*charset;
++{
++	iconv_t iconv_d;  /* iconv conversion descriptor */
++	struct nls_table *table;
++
++	/* give up if no charset is given */
++	if (charset == NULL)
++		return -1;
++
++	/* see if we already have a table with this name - built in tables
++	   have precedence over iconv() - i.e. can't have the name of an
++	   existing table. Also, we may have already registered this file
++	   table */
++	if (find_nls(charset) != NULL)
++		return -1;
++
++	if ((iconv_d = iconv_open("UCS-2BE", charset)) == (iconv_t) -1)
++		return -1;
++
++
++	/* set up the table */
++	if ((table = (struct nls_table *)malloc(sizeof (struct nls_table)))
++							== NULL) {
++		return -1;
++	}
++
++	/* give the table the file name, so we can find it again if needed */
++	table->charset = strdup(charset);
++	table->iconv_d = iconv_d;
++	table->page_uni2charset = NULL;
++	table->charset2uni = NULL;
++	table->inc_use_count = inc_use_count;
++	table->dec_use_count = dec_use_count;
++	table->next = NULL;
++
++	/* register the table */
++	return register_nls(table);
++}
++#endif
+diff -urN --exclude-from=- cdrtools-2.01/libunls/Targets cdrtools-2.01-jh/libunls/Targets
+--- cdrtools-2.01/libunls/Targets	2002-12-03 02:34:27.000000000 +0200
++++ cdrtools-2.01-jh/libunls/Targets	2004-02-02 18:31:22.000000000 +0200
+@@ -39,4 +39,5 @@
+ 	nls_cp10029.c \
+ 	nls_cp10079.c \
+ 	nls_cp10081.c \
+-	nls_file.c
++	nls_file.c \
++	nls_iconv.c
+diff -urN --exclude-from=- cdrtools-2.01/mkisofs/joliet.c cdrtools-2.01-jh/mkisofs/joliet.c
+--- cdrtools-2.01/mkisofs/joliet.c	2003-04-28 01:36:08.000000000 +0300
++++ cdrtools-2.01-jh/mkisofs/joliet.c	2004-02-03 14:15:17.000000000 +0200
+@@ -90,6 +90,11 @@
+ #include <unls.h>	/* For UNICODE translation */
+ #include <schily.h>
+ 
++#ifdef USE_ICONV
++#include <iconv.h>
++#include <errno.h>
++#endif
++
+ static Uint	jpath_table_index;
+ static struct directory **jpathlist;
+ static int	next_jpath_index = 1;
+@@ -103,13 +108,23 @@
+ };
+ 
+ #ifdef	UDF
+-	void	convert_to_unicode	__PR((unsigned char *buffer,
++#	ifdef USE_ICONV
++	size_t
++#	else
++	void
++#	endif
++		convert_to_unicode	__PR((unsigned char *buffer,
+ 		int size, char *source, struct nls_table *inls));
+-	int	joliet_strlen		__PR((const char *string));
++	int	joliet_strlen		__PR((const char *string, struct nls_table *inls));
+ #else
+-static void	convert_to_unicode	__PR((unsigned char *buffer,
++#	ifdef USE_ICONV
++	static size_t
++#	else
++	static void
++#endif
++		convert_to_unicode	__PR((unsigned char *buffer,
+ 		int size, char *source, struct nls_table *inls));
+-static int	joliet_strlen		__PR((const char *string));
++static int	joliet_strlen		__PR((const char *string, struct nls_table *inls));
+ #endif
+ static void	get_joliet_vol_desc	__PR((struct iso_primary_descriptor *jvol_desc));
+ static void	assign_joliet_directory_addresses __PR((struct directory *node));
+@@ -161,6 +176,20 @@
+ 	if (inls == onls)
+ 		return (c);
+ 
++#ifdef USE_ICONV
++	if(inls->charset2uni == NULL || onls->page_uni2charset == NULL) {
++		/*
++		 * This shouldn't be reached
++		 */
++		static BOOL iconv_warned = FALSE;
++		if(!iconv_warned) {
++			error("Warning: Iconv conversion not supported in conv_charset.\n");
++			iconv_warned = TRUE;
++		}
++		return (c);
++	}
++#endif
++
+ 	/* get high and low UNICODE bytes */
+ 	uh = inls->charset2uni[c].uni2;
+ 	ul = inls->charset2uni[c].uni1;
+@@ -186,10 +215,18 @@
+  *
+  * Notes:
+  */
+-#ifdef	UDF
+-void
++#ifdef USE_ICONV
++#	if	UDF
++size_t
++#	else
++static size_t
++#	endif
+ #else
++#	if	UDF
++void
++#	else
+ static void
++#	endif
+ #endif
+ convert_to_unicode(buffer, size, source, inls)
+ 	unsigned char	*buffer;
+@@ -216,6 +253,51 @@
+ 		tmpbuf = (Uchar *) source;
+ 	}
+ 
++#ifdef USE_ICONV
++	if (inls->iconv_d && inls->charset2uni==NULL &&
++			inls->page_uni2charset==NULL) {
++		char *inptr = tmpbuf;
++		char *outptr = buffer;
++		size_t inleft = strlen(tmpbuf);
++		size_t inlen = inleft;
++		size_t outleft = size;
++
++		iconv(inls->iconv_d, NULL, NULL, NULL, NULL);
++		if(iconv(inls->iconv_d, &inptr, &inleft, &outptr, &outleft) ==
++				(size_t)-1 && errno == EILSEQ) {
++			fprintf(stderr, "Incorrectly encoded string (%s) "
++				"encountered.\nPossibly creating an invalid "
++				"Joliet extension. Aborting.\n", source);
++			exit(1);
++		}
++
++	  	for (i = 0; (i + 1) < size - outleft; i += 2) {	/* Size may be odd!!!*/
++			if (buffer[i]=='\0') {
++				switch (buffer[i+1]) {   /* Invalid characters for Joliet */
++					case '*':
++					case '/':
++					case ':':
++					case ';':
++					case '?':
++					case '\\':
++						buffer[i+1]='_';
++					default:
++						if (buffer[i+1] == 0x7f ||
++							    buffer[i+1] < 0x20)
++							buffer[i+1]='_';
++				}
++			}
++		}
++		if (size & 1) {	/* beautification */
++	  		buffer[size - 1] = 0;
++		}
++		if (source == NULL) {
++			free(tmpbuf);
++		}
++		return (inlen - inleft);
++	}
++#endif
++
+ 	/*
+ 	 * Now start copying characters.  If the size was specified to be 0,
+ 	 * then assume the input was 0 terminated.
+@@ -271,6 +353,9 @@
+ 	if (source == NULL) {
+ 		free(tmpbuf);
+ 	}
++#ifdef USE_ICONV
++	return j;
++#endif
+ }
+ 
+ /*
+@@ -287,12 +372,50 @@
+ #else
+ static int
+ #endif
+-joliet_strlen(string)
++joliet_strlen(string, inls)
+ 	const char	*string;
++	struct nls_table *inls;
+ {
+ 	int		rtn;
+ 
++#ifdef USE_ICONV
++	if (inls->iconv_d && inls->charset2uni==NULL &&
++			inls->page_uni2charset==NULL) {
++		/*
++		 * we const-cast since we're sure iconv won't change
++		 * the string itself
++		 */
++		char *string_ptr = (char *)string;
++		size_t string_len = strlen(string);
++
++		/*
++		 * iconv has no way of finding out the required size
++		 * in the target
++		 */
++
++		char *tmp, *tmp_ptr;
++		/* we assume that the maximum length is 2 * jlen */
++		size_t tmp_len = (size_t)jlen * 2 + 1;
++		tmp = e_malloc(tmp_len);
++		tmp_ptr = tmp;
++
++		iconv(inls->iconv_d, NULL, NULL, NULL, NULL);
++		iconv(inls->iconv_d, &string_ptr, &string_len, &tmp_ptr,
++			&tmp_len);
++
++		/*
++		 * iconv advanced the tmp pointer with as many chars
++		 * as it has written to it, so we add up the delta
++		 */
++		rtn = (tmp_ptr - tmp);
++
++		free(tmp);
++	} else {
++		rtn = strlen(string) << 1;
++	}
++#else
+ 	rtn = strlen(string) << 1;
++#endif
+ 
+ 	/*
+ 	 * We do clamp the maximum length of a Joliet string to be the
+@@ -480,16 +603,33 @@
+ 	/* compare the Unicode names */
+ 
+ 	while (*rpnt && *lpnt) {
++#ifdef USE_ICONV
++		size_t ri, li;
++
++		ri = convert_to_unicode(rtmp, 2, rpnt, rinls);
++		li = convert_to_unicode(ltmp, 2, lpnt, linls);
++		rpnt += ri;
++		lpnt += li;
++		if(!ri && !li)
++			return (0);
++		else if(ri && !li)
++			return (1);
++		else if(!ri && li)
++			return (-1);
++#else
+ 		convert_to_unicode(rtmp, 2, rpnt, rinls);
+ 		convert_to_unicode(ltmp, 2, lpnt, linls);
++#endif
+ 
+ 		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
+ 			return (-1);
+ 		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
+ 			return (1);
+ 
++#ifndef USE_ICONV
+ 		rpnt++;
+ 		lpnt++;
++#endif
+ 	}
+ 
+ 	if (*rpnt)
+@@ -574,10 +714,10 @@
+ 		}
+ #ifdef APPLE_HYB
+ 		if (USE_MAC_NAME(de))
+-			namelen = joliet_strlen(de->hfs_ent->name);
++			namelen = joliet_strlen(de->hfs_ent->name, hfs_inls);
+ 		else
+ #endif	/* APPLE_HYB */
+-			namelen = joliet_strlen(de->name);
++			namelen = joliet_strlen(de->name, in_nls);
+ 
+ 		if (dpnt == root) {
+ 			jpath_table_l[jpath_table_index] = 1;
+@@ -742,10 +882,10 @@
+ #ifdef APPLE_HYB
+ 		/* Use the HFS name if it exists */
+ 		if (USE_MAC_NAME(s_entry1))
+-			cvt_len = joliet_strlen(s_entry1->hfs_ent->name);
++			cvt_len = joliet_strlen(s_entry1->hfs_ent->name, hfs_inls);
+ 		else
+ #endif	/* APPLE_HYB */
+-			cvt_len = joliet_strlen(s_entry1->name);
++			cvt_len = joliet_strlen(s_entry1->name, in_nls);
+ 
+ 		/*
+ 		 * Fix the record length
+@@ -891,12 +1031,12 @@
+ 				if (USE_MAC_NAME(s_entry))
+ 					/* Use the HFS name if it exists */
+ 					jpath_table_size +=
+-						joliet_strlen(s_entry->hfs_ent->name) +
++						joliet_strlen(s_entry->hfs_ent->name, hfs_inls) +
+ 						offsetof(struct iso_path_table, name[0]);
+ 				else
+ #endif	/* APPLE_HYB */
+ 					jpath_table_size +=
+-						joliet_strlen(s_entry->name) +
++						joliet_strlen(s_entry->name, in_nls) +
+ 						offsetof(struct iso_path_table, name[0]);
+ 				if (jpath_table_size & 1) {
+ 					jpath_table_size++;
+@@ -918,13 +1058,13 @@
+ 				/* Use the HFS name if it exists */
+ 				s_entry->jreclen =
+ 				offsetof(struct iso_directory_record, name[0])
+-					+ joliet_strlen(s_entry->hfs_ent->name)
++					+ joliet_strlen(s_entry->hfs_ent->name, hfs_inls)
+ 					+ 1;
+ 			else
+ #endif	/* APPLE_HYB */
+ 				s_entry->jreclen =
+ 				offsetof(struct iso_directory_record, name[0])
+-					+ joliet_strlen(s_entry->name)
++					+ joliet_strlen(s_entry->name, in_nls)
+ 					+ 1;
+ 		} else {
+ 			/*
+@@ -1072,6 +1212,9 @@
+ #endif
+ 
+ 	while (*rpnt && *lpnt) {
++#ifdef USE_ICONV
++		size_t ri, li;
++#endif
+ 		if (*rpnt == ';' && *lpnt != ';')
+ 			return (-1);
+ 		if (*rpnt != ';' && *lpnt == ';')
+@@ -1092,16 +1235,32 @@
+ 			return (1);
+ #endif
+ 
++#ifdef USE_ICONV
++
++		ri = convert_to_unicode(rtmp, 2, rpnt, rinls);
++		li = convert_to_unicode(ltmp, 2, lpnt, linls);
++		rpnt += ri;
++		lpnt += li;
++		if(!ri && !li)
++			return (0);
++		else if(ri && !li)
++			return (1);
++		else if(!ri && li)
++			return (-1);
++#else
+ 		convert_to_unicode(rtmp, 2, rpnt, rinls);
+ 		convert_to_unicode(ltmp, 2, lpnt, linls);
++#endif
+ 
+ 		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
+ 			return (-1);
+ 		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
+ 			return (1);
+ 
++#ifndef USE_ICONV
+ 		rpnt++;
+ 		lpnt++;
++#endif
+ 	}
+ 	if (*rpnt)
+ 		return (1);
+diff -urN --exclude-from=- cdrtools-2.01/mkisofs/Makefile cdrtools-2.01-jh/mkisofs/Makefile
+--- cdrtools-2.01/mkisofs/Makefile	2004-01-02 17:23:32.000000000 +0200
++++ cdrtools-2.01-jh/mkisofs/Makefile	2004-02-02 18:31:22.000000000 +0200
+@@ -32,6 +32,7 @@
+ CPPOPTS +=	-DUDF
+ CPPOPTS +=	-DDVD_VIDEO
+ CPPOPTS +=	-DSORTING
++CPPOPTS +=	-DUSE_ICONV
+ CPPOPTS +=	-I../libhfs_iso/
+ CPPOPTS	+=	-DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG \
+ 		'-DAPPID_DEFAULT="MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING"' \
+diff -urN --exclude-from=- cdrtools-2.01/mkisofs/mkisofs.c cdrtools-2.01-jh/mkisofs/mkisofs.c
+--- cdrtools-2.01/mkisofs/mkisofs.c	2004-01-07 01:23:46.000000000 +0200
++++ cdrtools-2.01-jh/mkisofs/mkisofs.c	2004-02-02 18:31:22.000000000 +0200
+@@ -59,6 +59,11 @@
+ #endif
+ #endif	/* no_more_needed */
+ 
++#ifdef USE_ICONV
++#include <locale.h>
++#include <langinfo.h>
++#endif
++
+ struct directory *root = NULL;
+ int		path_ind;
+ 
+@@ -223,6 +228,10 @@
+ int	do_sort = 0;		/* sort file data */
+ #endif /* SORTING */
+ 
++#ifdef USE_ICONV
++int	iconv_possible;
++#endif
++
+ struct nls_table *in_nls = NULL;  /* input UNICODE conversion table */
+ struct nls_table *out_nls = NULL; /* output UNICODE conversion table */
+ #ifdef APPLE_HYB
+@@ -2235,6 +2244,37 @@
+ 	init_nls_file(hfs_ocharset);
+ #endif /* APPLE_HYB */
+ 
++#ifdef USE_ICONV
++	iconv_possible = !(iso9660_level >= 4 || ((ocharset &&
++		strcmp(ocharset, icharset ? icharset : "")) &&
++		use_RockRidge) || apple_ext || apple_hyb);
++
++	setlocale(LC_CTYPE, "");
++	
++  	if (icharset == NULL && iconv_possible) {
++		char *charset = nl_langinfo(CODESET);
++		/* set to detected value but only if it is not pure US-ASCII */
++		if(strcmp(charset, "ANSI_X3.4-1968") != 0)
++			icharset = charset;
++
++		if(icharset && verbose > 0)
++			fprintf(stderr, "INFO:\t"
++			"%s character encoding detected by locale settings."
++			"\n\tAssuming %s encoded filenames on source "
++			"filesystem,\n"
++			"\tuse -input-charset to override.\n",
++			icharset, icharset);
++	}
++
++	if(iconv_possible) {
++		/*
++		 * don't care if initialization fails
++		 */
++		init_nls_iconv(icharset);
++		init_nls_iconv(ocharset);
++	}
++#endif
++
+ 	if (icharset == NULL) {
+ #if	(defined(__CYGWIN32__) || defined(__CYGWIN__)) && !defined(IS_CYGWIN_1)
+ 		in_nls = load_nls("cp437");
+@@ -2262,6 +2302,12 @@
+ 	if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */
+ 		fprintf(stderr, "Unknown charset\nKnown charsets are:\n");
+ 		list_nls();	/* List all known charset names */
++#ifdef USE_ICONV
++		if(!iconv_possible)
++			fprintf(stderr, "Iconv charsets cannot be used with "
++				"Apple extension, HFS, ISO9660 version 2 or\n"
++				"Rock Ridge.\n");
++#endif
+ 		exit(1);
+ 	}
+ 
+diff -urN --exclude-from=- cdrtools-2.01/mkisofs/mkisofs.h cdrtools-2.01-jh/mkisofs/mkisofs.h
+--- cdrtools-2.01/mkisofs/mkisofs.h	2003-12-28 15:38:51.000000000 +0200
++++ cdrtools-2.01-jh/mkisofs/mkisofs.h	2004-02-02 18:31:22.000000000 +0200
+@@ -501,9 +501,14 @@
+ 
+ /* joliet.c */
+ #ifdef	UDF
++#	ifdef USE_ICONV
++extern	size_t	convert_to_unicode	__PR((unsigned char *buffer,
++			int size, char *source, struct nls_table *inls));
++#	else
+ extern	void	convert_to_unicode	__PR((unsigned char *buffer,
+ 			int size, char *source, struct nls_table *inls));
+-extern	int	joliet_strlen		__PR((const char *string));
++#	endif
++extern	int	joliet_strlen		__PR((const char *string, struct nls_table *inls));
+ #endif
+ extern unsigned char conv_charset __PR((unsigned char, struct nls_table *,
+ 				struct nls_table *));
+diff -urN --exclude-from=- cdrtools-2.01/mkisofs/udf.c cdrtools-2.01-jh/mkisofs/udf.c
+--- cdrtools-2.01/mkisofs/udf.c	2003-04-28 01:34:52.000000000 +0300
++++ cdrtools-2.01-jh/mkisofs/udf.c	2004-02-02 18:31:22.000000000 +0200
+@@ -442,7 +442,7 @@
+ 	int i;
+ 	int expanded_length;
+ 
+-	expanded_length = joliet_strlen(src);
++	expanded_length = joliet_strlen(src, in_nls);
+ 	if (expanded_length > 1024)
+ 		expanded_length = 1024;
+ 	if (expanded_length > (dst_size-1)*2)
--- cdrtools-2.01+01a01.orig/debian/patches/04_silo.dpatch
+++ cdrtools-2.01+01a01/debian/patches/04_silo.dpatch
@@ -0,0 +1,833 @@
+#! /bin/sh -e
+## 04_silo.dpatch by Joerg Jaspert <joerg@debian.org>
+## (original made by some of the former maintainers)
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch to mkisofs to get silo working.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+	-patch) patch -f --no-backup-if-mismatch -p0 < $0;;
+	-unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+--- mkisofs/Makefile	2002-12-07 21:42:32.000000000 +0100
++++ mkisofs/Makefile	2002-12-27 20:24:53.000000000 +0100
+@@ -41,7 +41,7 @@
+ 		getopt.c getopt1.c \
+ 		scsi.c \
+ 		scsi_cdr.c cd_misc.c \
+-		modes.c \
++		modes.c silo.c \
+ 		apple.c volume.c desktop.c mac_label.c \
+ 		ifo_read.c dvd_file.c dvd_reader.c
+ HFILES=		apple.h bootinfo.h config.h defaults.h diskmbr.h exclude.h \
+--- mkisofs/mkisofs.8	2002-12-24 16:39:31.000000000 +0100
++++ mkisofs/mkisofs.8	2002-12-27 20:24:53.000000000 +0100
+@@ -456,6 +456,13 @@
+ .IR gid . 
+ Specifying this option automatically enables Rock Ridge extensions.
+ .TP
++.BI \-F " root_directory
++Follow symbolic links which point outside specified
++.I root_directory 
++when generating the filesystem.  This allows a symlink farm structure,
++where symlinks inside the base directory stay symlinks, but symlinks
++outside the base directory become real files on the CD.
++.TP
+ .B \-gui
+ Switch the behaviour for a GUI. This currently makes the output more verbose
+ but may have other effects in future.
+@@ -919,6 +926,25 @@
+ with SYSI=system_id.
+ If specified in both places, the command line version is used.
+ .TP
++.BI \-s " silo_conf_file
++Specifies the path and filename of the SILO configuration file to be
++used when making a "SILO" bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs
++and start with a slash.
++The default is
++.I /etc/silo.conf
++See SILO documentation for the syntax of this file.
++.TP
++.BI \-S " silo_bootblock
++Specifies the path and filename of the SILO first stage boot image to be
++used when making a "SILO" bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs.
++The default is
++.I boot/cd.b
++The boot image must come from SILO 0.8.7 and higher.
++.TP
+ .B \-T
+ Generate a file TRANS.TBL in each directory on the CDROM, which can be used
+ on non-Rock Ridge capable systems to help establish the correct file names.
+--- mkisofs/mkisofs.c	2002-12-07 20:59:41.000000000 +0100
++++ mkisofs/mkisofs.c	2002-12-27 20:24:53.000000000 +0100
+@@ -94,12 +94,14 @@
+ int	use_genboot = 0;
+ int	use_RockRidge = 0;
+ int	use_Joliet = 0;
++int	use_silo = 0;
+ int	jlen = JMAX;	/* maximum Joliet file name length */
+ int	verbose = 1;
+ int	debug = 0;
+ int	gui = 0;
+ int	all_files = 1;	/* New default is to include all files */
+ int	follow_links = 0;
++int	follow_links_sensible = 0;
+ #ifdef	IS_CYGWIN
+ int	cache_inodes = 0;/* Do not cache inodes on Cygwin by default */
+ #else
+@@ -133,6 +135,10 @@
+ char	*boot_catalog = BOOT_CATALOG_DEFAULT;
+ char	*boot_image = BOOT_IMAGE_DEFAULT;
+ char	*genboot_image = BOOT_IMAGE_DEFAULT;
++char    *silo_boot_image = SILO_BOOT_IMAGE_DEFAULT;
++char    *silo_bootblock = SILO_BOOTBLOCK_DEFAULT;
++char    *silo_conf_file = SILO_CONF_FILE_DEFAULT;
++char	follow_links_base[PATH_MAX];
+ int	ucs_level = 3;		/* We now have Unicode tables so use level 3 */
+ int	volume_set_size = 1;
+ int	volume_sequence_number = 1;
+@@ -403,6 +409,8 @@
+ 
+ #endif	/* APPLE_HYB */
+ 
++#define OPTION_SILO_BOOT		2200
++
+ static int	save_pname = 0;
+ 
+ static const struct ld_option ld_options[] =
+@@ -435,6 +443,8 @@
+ 	'\0', NULL, "Start specifying alternative El Torito boot parameters", ONE_DASH},
+ 	{{"sparc-boot", required_argument, NULL, 'B'},
+ 	'B', "FILES", "Set sparc boot image names", ONE_DASH},
++	{{"silo-boot", required_argument, NULL, OPTION_SILO_BOOT},
++	'\0', "FILE", "Set SILO second stage boot image name" , ONE_DASH },
+ 	{{"generic-boot", required_argument, NULL, 'G'},
+ 	'G', "FILE", "Set generic boot image name", ONE_DASH},
+ 	{{"sparc-label", required_argument, NULL, OPTION_SPARCLABEL},
+@@ -453,6 +463,8 @@
+ 	 '\0', "mode", "Make the mode of all plain files this mode.", ONE_DASH},
+ 	{{"follow-links", no_argument, NULL, 'f'},
+ 	'f', NULL, "Follow symbolic links", ONE_DASH},
++	{{"follow-outside-links", required_argument, NULL, 'F'},
++	    'F', NULL, "Follow symbolic links which point outside the CD base directory", ONE_DASH },
+ 	{{"gid", required_argument, NULL, OPTION_GID},
+ 	 '\0', "gid", "Make the group owner of all files this gid.",
+ 	 ONE_DASH},
+@@ -544,6 +556,11 @@
+ 	'\0', "FILE", "Sort file content locations according to rules in FILE" , ONE_DASH },
+ #endif /* SORTING */
+ 
++	{ {"silo-conf-file", required_argument, NULL, 's'},
++	's', "FILE", "Set name of SILO configuration file on the CD", ONE_DASH },
++	{ {"silo-bootblock", required_argument, NULL, 'S'},
++	'S', "FILE", "Set SILO first stage bootblock image name", ONE_DASH },
++
+ 	{{"split-output", no_argument, NULL, OPTION_SPLIT_OUTPUT},
+ 	'\0', NULL, "Split output into files of approx. 1GB size", ONE_DASH},
+ 	{{"sysid", required_argument, NULL, OPTION_SYSID},
+@@ -1150,7 +1167,7 @@
+ 	int		hfs_ct = 0;
+ 	char		*root_info = 0;
+ #endif	/* APPLE_HYB */
+-
++	char		old_dir[PATH_MAX];
+ 
+ #ifdef __EMX__
+ 	/* This gives wildcard expansion with Non-Posix shells with EMX */
+@@ -1352,6 +1369,34 @@
+ #endif
+ 			}
+ 			break;
++		case OPTION_SILO_BOOT:
++			use_silo++;
++			silo_boot_image = optarg;  /* pathname of the boot image on cd */
++			if (silo_boot_image == NULL) {
++				fprintf(stderr,"Required boot image pathname missing\n");
++				exit(1);
++			}
++			break;
++		case 'S':
++			use_silo++;
++			silo_bootblock = optarg;  /* pathname of the boot image on cd */
++			if (silo_bootblock == NULL) {
++				fprintf(stderr,"Required bootblock pathname missing\n");
++				exit(1);
++			}
++			break;
++		case 's':
++			use_silo++;
++			silo_conf_file = optarg;  /* pathname of the boot image on cd */
++			if (silo_conf_file == NULL) {
++				fprintf(stderr,"Required SILO config file pathname missing\n");
++				exit(1);
++			}
++			if (*silo_conf_file != '/') {
++				fprintf(stderr,"SILO config file pathname must start with /\n");
++				exit(1);
++			}
++			break;
+ 		case OPTION_ABSTRACT:
+ 			abstract = optarg;
+ 			if (strlen(abstract) > 37) {
+@@ -1446,6 +1491,20 @@
+ 			"Warning: -follow-links does not always work correctly; be careful.\n");
+ #endif
+ 			break;
++		case 'F':
++			follow_links_sensible++;
++			if(getcwd (old_dir, PATH_MAX)) {
++				chdir (optarg);
++				if(!getcwd (follow_links_base, PATH_MAX)) {
++					perror("getcwd");
++					exit(1);
++				}
++				chdir (old_dir);
++			} else {
++				perror("getcwd");
++				exit(1);
++			}
++			break;
+ 		case 'l':
+ 			full_iso9660_filenames++;
+ 			break;
+@@ -2967,7 +3026,10 @@
+ 		outputlist_insert(&sunlabel_desc);
+ 	if (use_genboot)
+ 		outputlist_insert(&genboot_desc);
+-	outputlist_insert(&padblock_desc);
++	if (use_silo)
++		outputlist_insert(&silo_desc);
++	else
++		outputlist_insert(&padblock_desc);
+ 
+ 	/* PVD for disc. */
+ 	outputlist_insert(&voldesc_desc);
+--- mkisofs/mkisofs.h	2002-12-07 20:59:42.000000000 +0100
++++ mkisofs/mkisofs.h	2002-12-27 20:24:53.000000000 +0100
+@@ -169,6 +169,7 @@
+ extern struct output_fragment *out_tail;
+ 
+ extern struct output_fragment padblock_desc;
++extern struct output_fragment silo_desc;
+ extern struct output_fragment voldesc_desc;
+ extern struct output_fragment joliet_desc;
+ extern struct output_fragment torito_desc;
+@@ -265,8 +266,15 @@
+ 	struct directory_entry *s_entry;
+ 	unsigned int    pad;
+ 	off_t		off;
++#ifdef __STDC__
++	int		(*filter)(char *, int, int);
++#else
++	int		(*filter)();
++#endif
+ };
+ 
++extern struct deferred_write * dw_head, * dw_tail;
++
+ struct eltorito_boot_entry_info {
+ 	struct eltorito_boot_entry_info *next; 
+ 	char		*boot_image;
+@@ -323,6 +331,8 @@
+ extern int      dirmode_to_use;
+ extern int      new_dir_mode;
+ extern int      follow_links;
++extern int	follow_links_sensible;
++extern char	follow_links_base[];
+ extern int	cache_inodes;
+ extern int      verbose;
+ extern int      debug;
+@@ -619,6 +629,9 @@
+ extern char    *boot_catalog;
+ extern char    *boot_image;
+ extern char    *genboot_image;
++extern char    *silo_boot_image;
++extern char    *silo_bootblock;
++extern char    *silo_conf_file;
+ extern int	ucs_level;
+ extern int      volume_set_size;
+ extern int      volume_sequence_number;
+--- mkisofs/silo.c	1970-01-01 01:00:00.000000000 +0100
++++ mkisofs/silo.c	2002-12-27 20:24:53.000000000 +0100
+@@ -0,0 +1,255 @@
++/*
++ * Program silo.c - Handle SILO bootable iso9660 CD-ROMs.
++ *
++
++   Copyright (C) 1999 Jakub Jelinek <jakub@redhat.com>.
++
++   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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.   */
++
++
++static char rcsid[] ="$Id:$";
++
++#include <mconfig.h>
++#include <stdio.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdlib.h>
++
++#include "mkisofs.h"
++#include "iso9660.h"
++#include <schily.h>
++
++/* used by Win32 for opening binary file - not used by Unix */
++#ifndef O_BINARY
++#define O_BINARY 0
++#endif /* O_BINARY */
++
++struct sun_disklabel {
++    char       info[128];      /* Informative text string */
++    char       spare0[14];
++    struct sun_info {
++       char    spare1;
++       char    id;
++       char    spare2;
++       char    flags;
++    } infos[8];
++    char       spare1[246];    /* Boot information etc. */
++    char       rspeed[2];      /* 722 - Disk rotational speed */
++    char       pcylcount[2];   /* 722 - Physical cylinder count */
++    char       sparecyl[2];    /* 722 - extra sects per cylinder */
++    char       spare2[4];      /* More magic... */
++    char       ilfact[2];      /* 722 - Interleave factor */
++    char       ncyl[2];        /* 722 - Data cylinder count */
++    char       nacyl[2];       /* 722 - Alt. cylinder count */
++    char       ntrks[2];       /* 722 - Tracks per cylinder */
++    char       nsect[2];       /* 722 - Sectors per track */
++    char       spare3[4];      /* Even more magic... */
++    struct sun_partition {
++        char start_cylinder[4];        /* 732 */
++       char num_sectors[4];    /* 732 */
++    } partitions[8];
++    char       magic[2];       /* 722 - Magic number */
++    char       csum[2];        /* 722 - Label xor'd checksum */
++    struct bootblock_header {
++       char    magic[4];       /* 732 */
++       char    aout[20];
++       char    siloid[8];
++       char    insn[16];
++       char    extent[4];      /* 732 */
++       char    size[4];        /* 732 */
++       char    text[2048-512-56];
++    } bootblock;
++};
++
++static struct {
++    char id;
++    char conf_part;
++    char part;
++    char pad;
++    char conf_file[256];
++} silo_info;
++
++static int silo_size(int starting_extent)
++{
++    last_extent += 16;
++    return 0;
++}
++
++static int silo_filter(char * buffer, int size, int offset)
++{
++    if (offset < 0x808 + sizeof(silo_info)
++       && offset + size > 0x808)
++    {
++       int i;
++       if (offset < 0x808)
++       {
++           offset = 0x808 - offset;
++           size -= offset;
++           buffer += offset;
++           offset = 0;
++       }
++       else
++           offset -= 0x808;
++       i = sizeof(silo_info) - offset;
++       if (i > size) i = size;
++       memcpy (buffer, ((char *)&silo_info) + offset, i);
++    }
++    return 0;
++}
++
++static int silo_write(FILE * outfile)
++{
++    struct directory_entry      * de;
++    struct directory_entry      * de2;
++    struct deferred_write      * dwpnt;
++    int bootblock, i, should_write;
++    struct sun_disklabel       silo_bb;
++   
++    memset (&silo_bb, 0, sizeof (silo_bb));
++   
++    if (*silo_bootblock == '/') silo_bootblock++;
++    if (*silo_boot_image == '/') silo_boot_image++;
++
++    /*
++     * search from root of iso fs to find boot catalog
++     */
++    de2 = search_tree_file(root, silo_bootblock);
++    if (!de2)
++    {
++       fprintf(stderr,"Uh oh, I cant find the SILO bootblock!\n");
++       exit(1);
++    }
++
++    /*
++     * now read it from disk
++     */
++    bootblock = open(de2->whole_name, O_RDWR | O_BINARY);
++    if (bootblock == -1)
++    {
++       fprintf(stderr,"Error opening SILO bootblock for reading.\n");
++       perror("");
++       exit(1);
++    }
++   
++    if (read (bootblock, (char *)&silo_bb.bootblock, 1024) != 1024)
++    {
++       fprintf(stderr,"Error reading SILO bootblock.\n");
++       perror("");
++       exit(1);
++    }
++
++    close (bootblock);
++
++    if (get_732 (silo_bb.bootblock.magic) != 0x01030107
++       || strncmp (silo_bb.bootblock.siloid, "SILO", 4)
++       || silo_bb.bootblock.siloid[5] != '.'
++       || silo_bb.bootblock.siloid[4] < '0'
++       || silo_bb.bootblock.siloid[4] > '9'
++       || silo_bb.bootblock.siloid[6] < '0'
++       || silo_bb.bootblock.siloid[6] > '9'
++       || silo_bb.bootblock.siloid[7] < '0'
++       || silo_bb.bootblock.siloid[7] > '9')
++    {
++       fprintf(stderr,"Error: the file %s is not a valid SILO bootblock.\n", silo_bootblock);
++       perror("");
++       exit(1);
++    }
++   
++    /* Check version number. Only SILO 0.87 and up is valid. */
++    if (silo_bb.bootblock.siloid[4] == '0'
++       && (silo_bb.bootblock.siloid[6] < '8'
++           || (silo_bb.bootblock.siloid[6] == '8'
++               && silo_bb.bootblock.siloid[7] <= '6')))
++    {
++       fprintf(stderr,"Error: SILO bootblock is too old. Must be at least 0.8.7.\n");
++       perror("");
++       exit(1);
++    }
++
++    /*
++     * search from root of iso fs to find boot catalog
++     */
++    de = search_tree_file(root, silo_boot_image);
++    if (!de)
++    {
++       fprintf(stderr,"Uh oh, I cant find the SILO boot image!\n");
++       exit(1);
++    }
++
++    /*
++     * need to filter second.b, so that we can seed
++     * silo.conf location and other stuff.
++     * We could write it into the de->whole_name file,
++     * but I prefer filtering it like this because
++     * then the tree can be e.g. read only NFS mounted.
++     */
++    for (dwpnt = dw_head; dwpnt; dwpnt = dwpnt->next)
++    {
++       if (!dwpnt->name) continue;
++       if (!strcmp (dwpnt->name, de->whole_name))
++           dwpnt->filter = silo_filter;
++    }
++
++    set_732 (silo_bb.bootblock.extent, de->starting_block);
++    set_732 (silo_bb.bootblock.size, de->size);
++
++    strcpy (silo_bb.info, "SPARC bootable CD-ROM: ");
++    strcat (silo_bb.info, volume_id);
++
++    should_write = (last_extent - session_start) << 2;
++
++    /* Now some magic */
++    silo_bb.spare0[3] = 1;
++    silo_bb.spare0[13] = 8;
++    for (i = 0; i < 8; i++) {
++       silo_bb.infos[i].id = 0x83;
++       silo_bb.infos[i].flags = 0x18;
++    }
++    set_732 (silo_bb.spare1 + 14, 0x600ddeee);
++    set_722 (silo_bb.rspeed, 0x15e);
++    set_722 (silo_bb.pcylcount, (should_write + 639) / 640);
++    set_722 (silo_bb.ilfact, 1);
++    set_722 (silo_bb.ncyl, (should_write + 639) / 640);
++    set_722 (silo_bb.ntrks, 1);
++    set_722 (silo_bb.nsect, 640);
++    set_732 (silo_bb.partitions[0].num_sectors, should_write);
++    set_722 (silo_bb.magic, 0xdabe);
++    for (i = 0; i < 510; i+=2) {
++       silo_bb.csum[0] ^= silo_bb.info[i];
++       silo_bb.csum[1] ^= silo_bb.info[i+1];
++    }
++
++    xfwrite(&silo_bb, 1, sizeof(silo_bb), outfile);
++    memset (&silo_bb, 0, sizeof(silo_bb));
++
++    for(i=1; i<16; i++)
++    {
++       xfwrite(&silo_bb, 1, sizeof(silo_bb), outfile);
++    }
++
++    memset (&silo_info, 0, sizeof(silo_info));
++    silo_info.id = 'L';
++    silo_info.conf_part = 1;
++    strncpy (silo_info.conf_file, silo_conf_file, 256);
++    silo_info.conf_file[259] = '\0';
++
++    last_extent_written += 16;
++   
++    return 0;
++}
++
++struct output_fragment silo_desc  = {NULL, silo_size, NULL,     silo_write};
+--- mkisofs/tree.c	2002-12-07 21:40:47.000000000 +0100
++++ mkisofs/tree.c	2002-12-27 20:24:53.000000000 +0100
+@@ -84,6 +84,7 @@
+ 	int	scan_directory_tree	__PR((struct directory *this_dir,
+ 						char *path,
+ 						struct directory_entry *de));
++static	int	check_dirlevel		__PR((char *name));
+ #ifdef APPLE_HYB
+ 	int	insert_file_entry	__PR((struct directory *this_dir,
+ 						char *whole_path,
+@@ -1322,6 +1323,34 @@
+ 	return 1;
+ }
+ 
++/* check_dirlevel: returns 1 if
++ * name is below the tree of follow_links_base */
++static int
++check_dirlevel(name)
++	char *name;
++{
++	char old[256] = {0,}, buf[256] = {0,}, b2[256], *c;
++  
++	strcpy (b2, name);
++	c = strrchr (b2, '/');
++	if (c) {
++		*c = '\0';
++		getcwd (old, 256);
++		chdir (b2);
++		getcwd (buf, 256);
++		chdir (old);
++       
++		if (!strncmp (buf, follow_links_base,
++			      strlen (follow_links_base))) {
++			return 1;
++		} else {
++			return 0;
++		}
++	}
++
++	return 1;
++}
++ 
+ 
+ /*
+  * Function:		insert_file_entry
+@@ -1366,6 +1395,8 @@
+ 	int		htype = TYPE_NONE;
+ 
+ #endif	/* APPLE_HYB */
++	char		link_buf[256];
++	int		do_follow_links = 0;
+ 
+ 	status = stat_filter(whole_path, &statbuf);
+ 
+@@ -1401,7 +1432,35 @@
+ 		 * is in use, it is easy, we let RR describe the file.  If
+ 		 * not, then we punt the file.
+ 		 */
+-		if ((status || !follow_links)) {
++		/* First check for the sensible follow_links option */
++		if (follow_links_sensible) {
++			/* Where does the link point to? */
++			memset (link_buf, 0, 256);
++			readlink (whole_path, link_buf, 255);
++			if (check_dirlevel (link_buf)) {
++				/* Treat it as a symlink */
++				if (!use_RockRidge) {
++					fprintf(stderr, "Ignoring symlink %s (which wouldn't be followed)\n",
++						whole_path);
++				} else {
++					do_follow_links = 0;
++					if (status) {
++						status = 0;
++						statbuf.st_size = 0;
++						STAT_INODE(statbuf) = UNCACHED_INODE;
++						statbuf.st_dev = (dev_t) UNCACHED_DEVICE;
++						statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG;
++					}
++				}
++			} else {
++				/* Follow the link */
++				do_follow_links = 1;
++			}
++		}
++		else if (!follow_links_sensible)
++			do_follow_links = follow_links;
++		
++		if((status || !do_follow_links)) {
+ 			if (use_RockRidge) {
+ 				status = 0;
+ 				statbuf.st_size = (off_t)0;
+@@ -1410,7 +1469,7 @@
+ 				statbuf.st_mode =
+ 					(statbuf.st_mode & ~S_IFMT) | S_IFREG;
+ 			} else {
+-				if (follow_links) {
++				if (do_follow_links) {
+ #ifdef	USE_LIBSCHILY
+ 					/* XXX errno may be wrong! */
+ 					errmsg("Unable to stat file %s - ignoring and continuing.\n",
+@@ -1443,7 +1502,7 @@
+ 		 * time we have seen this, then make this seem as if there was
+ 		 * no symlink there in the first place
+ 		 */
+-		if (follow_links
++		if (do_follow_links
+ 			&& S_ISDIR(statbuf.st_mode)) {
+ 			if (strcmp(short_name, ".")
+ 				&& strcmp(short_name, "..")) {
+@@ -1478,7 +1537,7 @@
+ 		 * For non-directories, we just copy the stat information over
+ 		 * so we correctly include this file.
+ 		 */
+-		if (follow_links
++		if (do_follow_links
+ 			&& !S_ISDIR(statbuf.st_mode)) {
+ 			lstatbuf = statbuf;
+ 		}
+@@ -1487,7 +1546,7 @@
+ 	 * Add directories to the cache so that we don't waste space even if
+ 	 * we are supposed to be following symlinks.
+ 	 */
+-	if (follow_links
++	if (do_follow_links
+ 		&& strcmp(short_name, ".")
+ 		&& strcmp(short_name, "..")
+ 		&& S_ISDIR(statbuf.st_mode)) {
+@@ -1537,7 +1596,7 @@
+ 	 * Add this so that we can detect directory loops with hard links.
+ 	 * If we are set up to follow symlinks, then we skip this checking.
+ 	 */
+-	if (!follow_links
++	if (!do_follow_links
+ 		&& S_ISDIR(lstatbuf.st_mode)
+ 		&& strcmp(short_name, ".")
+ 		&& strcmp(short_name, "..")) {
+--- mkisofs/vms.c	2000-12-05 15:25:10.000000000 +0100
++++ mkisofs/vms.c	2002-12-27 20:24:53.000000000 +0100
+@@ -288,7 +288,7 @@
+ extern unsigned int last_extent_written;
+ 
+ int
+-vms_write_one_file(char *filename, int size, FILE * outfile)
++vms_write_one_file(struct deferred_write * dwpnt, FILE * outfile)
+ {
+ 	int		status,
+ 			i;
+@@ -296,10 +296,11 @@
+ 	int		count;
+ 	int		use;
+ 	int		remain;
++	int		offset = 0;
+ 
+-	open_file(filename);
++	open_file(dwpnt->name);
+ 
+-	remain = size;
++	remain = dwpnt->size;
+ 
+ 	while (remain > 0) {
+ 		use = (remain > SECTOR_SIZE * NSECT - 1 ? NSECT * SECTOR_SIZE : remain);
+@@ -308,11 +309,14 @@
+ 		rab->rab$l_ubf = buffer;
+ 		rab->rab$w_usz = sizeof(buffer);
+ 		status = sys$read(rab);
++		if (dwpnt->filter)
++			(* dwpnt->filter)(buffer, use, offset);
+ 		fwrite(buffer, 1, use, outfile);
+ 		last_extent_written += use / SECTOR_SIZE;
+ 		if ((last_extent_written % 1000) < use / SECTOR_SIZE)
+ 			fprintf(stderr, "%d..", last_extent_written);
+ 		remain -= use;
++		offset += use;
+ 	};
+ 
+ 	close_file(rab);
+--- mkisofs/write.c	2002-12-23 15:16:45.000000000 +0100
++++ mkisofs/write.c	2002-12-27 20:24:53.000000000 +0100
+@@ -86,10 +86,10 @@
+ 						FILE *file));
+ static	int	assign_directory_addresses __PR((struct directory *node));
+ #ifdef APPLE_HYB
+-static	void	write_one_file	__PR((char *filename, unsigned int size,
++static	void	write_one_file	__PR((struct deferred_write *dwpnt,
+ 					FILE *outfile, off_t off));
+ #else
+-static	void	write_one_file	__PR((char *filename, unsigned int size,
++static	void	write_one_file	__PR((struct deferred_write *dwpnt,
+ 					FILE *outfile));
+ #endif
+ static	void	write_files	__PR((FILE *outfile));
+@@ -303,8 +303,8 @@
+ static struct deferred_write mac_boot;
+ 
+ #endif	/* APPLE_HYB */
+-static struct deferred_write	*dw_head = NULL,
+-				*dw_tail = NULL;
++struct deferred_write	*dw_head = NULL,
++			*dw_tail = NULL;
+ 
+ unsigned int	last_extent_written = 0;
+ static Uint	path_table_index;
+@@ -360,16 +360,14 @@
+ 
+ #ifdef APPLE_HYB
+ static void
+-write_one_file(filename, size, outfile, off)
+-	char		*filename;
+-	unsigned int	size;
++write_one_file(dwpnt, outfile, off)
++	struct deferred_write *dwpnt;
+ 	FILE		*outfile;
+ 	off_t		off;
+ #else
+ static void
+-write_one_file(filename, size, outfile)
+-	char		*filename;
+-	unsigned int	size;
++write_one_file(dwpnt, outfile)
++	struct deferred_write *dwpnt;
+ 	FILE		*outfile;
+ #endif	/* APPLE_HYB */
+ {
+@@ -385,18 +383,18 @@
+ 	FILE		*infile;
+ 	int		remain;
+ 	int	use;
++   int offset;
+ 
+-
+-	if ((infile = fopen(filename, "rb")) == NULL) {
++   if ((infile = fopen(dwpnt->name, "rb")) == NULL) {
+ #ifdef	USE_LIBSCHILY
+-		comerr("cannot open '%s'\n", filename);
++		comerr("cannot open '%s'\n", dwpnt->name);
+ #else
+ #ifndef	HAVE_STRERROR
+ 		fprintf(stderr, "cannot open '%s': (%d)\n",
+-				filename, errno);
++				dwpnt->name, errno);
+ #else
+ 		fprintf(stderr, "cannot open '%s': %s\n",
+-				filename, strerror(errno));
++				dwpnt->name, strerror(errno));
+ #endif
+ 		exit(1);
+ #endif
+@@ -404,7 +402,8 @@
+ #ifdef APPLE_HYB
+ 	fseek(infile, off, SEEK_SET);
+ #endif	/* APPLE_HYB */
+-	remain = size;
++	remain = dwpnt->size;
++	offset = 0;
+ 
+ 	while (remain > 0) {
+ 		use = (remain > SECTOR_SIZE * NSECT - 1 ?
+@@ -414,13 +413,16 @@
+ 		memset(buffer, 0, use);
+ 		if (fread(buffer, 1, use, infile) == 0) {
+ #ifdef	USE_LIBSCHILY
+-			comerr("cannot read from '%s'\n", filename);
++			comerr("cannot read from '%s'\n", dwpnt->name);
+ #else
+-			fprintf(stderr, "cannot read from '%s'\n", filename);
++			fprintf(stderr, "cannot read from '%s'\n", dwpnt->name);
+ 			exit(1);
+ #endif
+ 		}
++ 		if (dwpnt->filter)
++         (* dwpnt->filter)(buffer, use, offset);
+ 		xfwrite(buffer, 1, use, outfile);
++      offset += use;
+ 		last_extent_written += use / SECTOR_SIZE;
+ #if 0
+ 		if ((last_extent_written % 1000) < use / SECTOR_SIZE) {
+@@ -480,13 +482,13 @@
+ 		} else {
+ 
+ #ifdef VMS
+-			vms_write_one_file(dwpnt->name, dwpnt->size, outfile);
++			vms_write_one_file(dwpnt, outfile);
+ #else
+ #ifdef APPLE_HYB
+-			write_one_file(dwpnt->name, dwpnt->size, outfile,
++			write_one_file(dwpnt, outfile,
+ 								dwpnt->off);
+ #else
+-			write_one_file(dwpnt->name, dwpnt->size, outfile);
++			write_one_file(dwpnt, outfile);
+ #endif	/* APPLE_HYB */
+ #endif
+ 			free(dwpnt->name);
+@@ -1151,6 +1153,7 @@
+ 				dwpnt->next = NULL;
+ 				dwpnt->size = s_entry->size;
+ 				dwpnt->extent = last_extent;
++				dwpnt->filter = NULL;
+ 				set_733((char *) s_entry->isorec.extent,
+ 								last_extent);
+ 				s_entry->starting_block = last_extent;
+@@ -1722,8 +1725,7 @@
+ 
+ 		/* write out HFS boot block */
+ 		if (mac_boot.name)
+-			write_one_file(mac_boot.name, mac_boot.size, outfile,
+-								mac_boot.off);
++			write_one_file(&mac_boot, outfile, mac_boot.off);
+ 	}
+ #endif	/* APPLE_HYB */
+ 
--- cdrtools-2.01+01a01.orig/debian/patches/02_paths.dpatch
+++ cdrtools-2.01+01a01/debian/patches/02_paths.dpatch
@@ -0,0 +1,47 @@
+#! /bin/sh -e
+## 02_paths.dpatch by Joerg Jaspert <joerg@debian.org>
+## (Original made by some of the former Maintainers)
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Adjusts Path in manpage and adds silo definitions.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+	-patch) patch -f --no-backup-if-mismatch -p0 < $0;;
+	-unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -urNad cdrecord/cdrecord.1 cdrecord/cdrecord.1
+--- cdrecord/cdrecord.1	2004-02-29 18:13:20.000000000 +0100
++++ cdrecord/cdrecord.1	2004-03-04 21:12:56.000000000 +0100
+@@ -157,7 +157,7 @@
+ .I Scsibus 
+ 0 is the default SCSI bus on the machine. Watch the boot messages for more 
+ information or look into 
+-.B /var/adm/messages 
++.B /var/log/messages 
+ for more information about the SCSI configuration of your machine.
+ If you have problems to figure out what values for 
+ .IR scsibus , target , lun
+diff -urNad mkisofs/defaults.h cdrtools-2.0+a26pre27/mkisofs/defaults.h
+--- mkisofs/defaults.h	2004-03-02 00:47:25.000000000 +0100
++++ mkisofs/defaults.h	2004-03-04 21:14:43.000000000 +0100
+@@ -22,6 +22,9 @@
+ #define	VOLUME_ID_DEFAULT	"CDROM"
+ #define	BOOT_CATALOG_DEFAULT	"boot.catalog"
+ #define	BOOT_IMAGE_DEFAULT	NULL
++#define  SILO_BOOT_IMAGE_DEFAULT "boot/second.b"
++#define  SILO_BOOTBLOCK_DEFAULT        "boot/cd.b"
++#define  SILO_CONF_FILE_DEFAULT        "/etc/silo.conf"
+ #ifdef	APPLE_HYB
+ #define	APPLE_TYPE_DEFAULT	"TEXT"
+ #define	APPLE_CREATOR_DEFAULT	"unix"
--- cdrtools-2.01+01a01.orig/debian/patches/30_mkisofs_JTE-v1.15.dpatch
+++ cdrtools-2.01+01a01/debian/patches/30_mkisofs_JTE-v1.15.dpatch
@@ -0,0 +1,3967 @@
+#! /bin/sh -e
+## 30_mkisofs_JTE-v1.15.dpatch by Steve McIntyre
+##
+## DP: Jigdo Template Export support for mkisofs, for much faster .jigdo and
+## DP: .template file generation.
+## DP: http://www.einval.com/~steve/software/JTE/
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/Makefile cdrtools-2.0+a34.debian/mkisofs.steve/Makefile
+--- cdrtools-2.0+a34.debian/mkisofs/Makefile	2004-09-29 23:23:59.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/Makefile	2004-09-29 23:52:20.000000000 +0100
+@@ -34,9 +34,10 @@
+ CPPOPTS +=	-DSORTING
+ CPPOPTS +=	-DUSE_ICONV
+ CPPOPTS +=	-I../libhfs_iso/
+-CPPOPTS	+=	-DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG \
++CPPOPTS	+=	-DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG -DJIGDO_TEMPLATE \
+ 		'-DAPPID_DEFAULT="MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING"' \
+ 		-I../cdrecord
++CFLAGS  +=  -Wall -Wno-unused -g -O2 -fno-strict-aliasing
+ CFILES=		mkisofs.c tree.c write.c hash.c rock.c udf.c multi.c \
+ 		joliet.c match.c name.c fnmatch.c eltorito.c boot.c \
+ 		getopt.c getopt1.c \
+@@ -45,14 +46,16 @@
+ 		modes.c \
+ 		apple.c volume.c desktop.c mac_label.c stream.c \
+ 		ifo_read.c dvd_file.c dvd_reader.c \
+-		defaults.c getnum.c
++		defaults.c getnum.c md5.c jte.c \
++		boot-alpha.c boot-hppa.c boot-mips.c \
++		boot-mipsel.c endian.c rsync.c
+ HFILES=		apple.h bootinfo.h config.h defaults.h diskmbr.h exclude.h \
+ 		fnmatch.h getopt.h iso9660.h mac_label.h mactypes.h match.h \
+ 		mkisofs.h sunlabel.h udf.h udf_fs.h vms.h \
+ 		ifo_read.h dvd_file.h dvd_reader.h bswap.h ifo_types.h \
+-		../cdrecord/defaults.h
++		../cdrecord/defaults.h md5.h jte.h endian.h
+ 
+-LIBS=		-lhfs -lfile -lunls -lrscg -lscg $(LIB_VOLMGT) -ldeflt -lschily $(SCSILIB) $(LIB_SOCKET)
++LIBS=		-lhfs -lfile -lunls -lrscg -lscg $(LIB_VOLMGT) -ldeflt -lschily $(SCSILIB) $(LIB_SOCKET) -lz #-lbz2
+ XMK_FILE=	Makefile.man hybridman.mk
+ 
+ ###########################################################################
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/README.alphaboot cdrtools-2.0+a34.debian/mkisofs.steve/README.alphaboot
+--- cdrtools-2.0+a34.debian/mkisofs/README.alphaboot	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/README.alphaboot	2004-08-19 14:06:16.000000000 +0100
+@@ -0,0 +1,28 @@
++# README.alphaboot    Steve McIntyre <steve@einval.com> 2004/17/19
++
++The alpha boot support allows you to create a bootable CD which will
++work with DEC/Compaq/HP Alpha machines, for example bootable
++installation media.
++
++The method used for this is the same as in aboot, the bootloader for
++Linux on Alpha, and works with SRM firmware. See the SRM Firmware
++HOWTO at http://www.alphalinux.org/faq/SRM-HOWTO/ for more details
++about SRM.
++
++In common with many Unix systems, the SRM code reads the first
++512-byte "sector" off a disk and parses information in that
++sector. The information in question is the location (start "sector")
++and length of the first stage boot loader. On a Linux system, this
++file will normally be called bootlx.
++
++SRM will load and execute the first stage boot loader, and from that
++point the system should be able to find the normal OS kernel and start
++up fully.
++
++To use the Alpha boot support code in mkisofs, simply specify the
++location of the first stage boot loader (relative to the CD root)
++using the -alpha-boot command line switch:
++
++mkisofs ... -alpha-boot boot/bootlx -o alpha.iso files
++
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/README.hppaboot cdrtools-2.0+a34.debian/mkisofs.steve/README.hppaboot
+--- cdrtools-2.0+a34.debian/mkisofs/README.hppaboot	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/README.hppaboot	2004-08-19 14:06:16.000000000 +0100
+@@ -0,0 +1,38 @@
++# README.hppaboot    Steve McIntyre <steve@einval.com> 2004/17/19
++
++The hppa boot support allows you to create a bootable CD which will
++work with HP PA/RISC machines, for example bootable installation
++media.
++
++The method used for this is the same as in palo, the bootloader for
++Linux on hppa. See the palo README for more details about supported
++hardware etc.
++
++The HPPA firmware reads the first 2048-byte sector off a disk and
++parses information in that sector. The information in question is the
++location (start sector) and length of various files:
++
++ * a 32-bit kernel image
++ * a 64-bit kernel image
++ * first stage bootloader (iplboot)
++ * (optional) ramdisk
++
++and also the system command line to use, e.g.
++
++ "5/vmlinux HOME=/ TERM=linux console=tty"
++
++The firmware will load and execute the first stage boot loader, and
++that should be able to find the (32- or 64-bit) kernel and boot
++normally. Whether you need a 32- or 64-bit kernel depends on your
++hardware; some will even support both.
++
++To use the hppa boot support code in mkisofs, simply specify the boot
++command line and file locations (relative to the CD root) as follows:
++
++mkisofs ... -hppa-cmdline    <cmdline, elements separated by spaces or commas> \ 
++            -hppa-kernel-32  <32-bit kernel> \
++            -hppa-kernel-64  <64-bit kernel> \
++            -hppa-bootloader <bootloader> \
++            -hppa-ramdisk    <ramdisk file> \
++            -o hppa.iso hppa-files
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/README.mipsboot cdrtools-2.0+a34.debian/mkisofs.steve/README.mipsboot
+--- cdrtools-2.0+a34.debian/mkisofs/README.mipsboot	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/README.mipsboot	2004-08-19 14:06:16.000000000 +0100
+@@ -0,0 +1,26 @@
++# README.mipsboot    Steve McIntyre <steve@einval.com> 2004/17/19
++
++The mips/SGI boot support allows you to create a bootable CD which
++will work with big-endian mips SGI machines, for example bootable
++installation media.
++
++The method used for this is the same as in genisovh, a tool to make
++CDs bootable for Linux on SGI.
++
++The SGI firmware reads the first 512-byte "sector" off a disk and
++parses information from a volume descriptor header in that sector. The
++information in question is the location (start sector) and length of
++bootable kernel images; up to 15 are supported.
++
++The firmware will load and execute kernels listed. (I'm not sure what
++it will do if more than one kernel is listed - it may display a boot
++menu).
++
++To use the SGI boot support code in mkisofs, simply specify the kernel
++file locations (relative to the CD root) as follows:
++
++mkisofs ... -mips-boot <kernel file #1> \
++            ... 
++            -mips-boot <kernel file #n> \
++            -o mips.iso mips-files
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/README.mipselboot cdrtools-2.0+a34.debian/mkisofs.steve/README.mipselboot
+--- cdrtools-2.0+a34.debian/mkisofs/README.mipselboot	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/README.mipselboot	2004-08-19 14:06:16.000000000 +0100
+@@ -0,0 +1,29 @@
++# README.mipselboot    Steve McIntyre <steve@einval.com> 2004/17/19
++
++The mips/DEC boot support allows you to create a bootable CD which
++will work with little-endian mips DEC machines (e.g. older
++DECstations), for example bootable installation media.
++
++The method used for this is the same as in delo, the Linux-on-mipsel
++bootloader. See the delo README for more information about how to
++configure the DECstation's firmware to find and boot the CDROM.
++
++The DEC firmware reads the first 512-byte "sector" off a disk and
++parses information from that sector. The information in question is
++the location (start sector) and length of the first stage boot
++loader.
++
++(On Linux, this boot loader is in ELF format and the firmware does not
++know how to deal with ELF directly, we have to parse the ELF headers
++and find the raw binary data needed inside it. Pointers to the start
++and length of that raw binary are what is stored in the boot sector.)
++
++The firmware will load and execute the first stage boot loader, and
++from that point the system should be able to find the normal OS kernel
++and start up fully.
++
++To use the DEC boot support code in mkisofs, simply specify the kernel
++file location (relative to the CD root) as follows:
++
++mkisofs ... -mipsel-boot <kernel file> -o mipsel.iso mipsel-files
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/boot-alpha.c cdrtools-2.0+a34.debian/mkisofs.steve/boot-alpha.c
+--- cdrtools-2.0+a34.debian/mkisofs/boot-alpha.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/boot-alpha.c	2004-08-17 14:00:44.000000000 +0100
+@@ -0,0 +1,114 @@
++/*
++ * Program boot-alpha.c - Handle Linux alpha boot extensions to iso9660.
++ *
++ * Written by Steve McIntyre <steve@einval.com> June 2004
++ *
++ * Heavily inspired by isomarkboot by David Mosberger in 1996.
++ *
++ * Copyright 2004 Steve McIntyre
++ *
++ * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++#include <mconfig.h>
++#include "mkisofs.h"
++#include <fctldefs.h>
++#include <utypes.h>
++#include <intcvt.h>
++#include "match.h"
++#include "diskmbr.h"
++#include "bootinfo.h"
++#include <schily.h>
++#include "endian.h"
++
++        int     add_boot_alpha_filename   __PR((char *filename));
++static  int     boot_alpha_write          __PR((FILE *outfile));
++static  char   *boot_file_name = NULL;
++
++#define BOOT_STRING "Linux/Alpha aboot for ISO filesystem."
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_alpha_filename(filename)
++    char *filename;
++{
++    boot_file_name = filename;
++    return 0;
++}
++
++static int boot_alpha_write(outfile)
++    FILE *outfile;
++{
++    unsigned long long boot_sector[256]; /* One (ISO) sector */
++    unsigned long long sum = 0;
++	struct directory_entry	*boot_file;	/* Boot file we need to search for */
++    unsigned long length = 0;
++    unsigned long extent = 0;
++    int i = 0;
++
++    memset(boot_sector, 0, sizeof(boot_sector));    
++
++    /* Write the text header into the boot sector */
++    strcpy((char *)boot_sector, BOOT_STRING);
++
++    /* Find the dir entry for the boot file by walking our file list */
++    boot_file = search_tree_file(root, boot_file_name);
++    if (!boot_file) {
++#ifdef	USE_LIBSCHILY
++		comerrno(EX_BAD, "Uh oh, I cant find the Alpha boot file '%s'!\n",
++							boot_file_name);
++#else
++		fprintf(stderr, "Uh oh, I cant find the Alpha boot file '%s'!\n",
++							boot_file_name);
++		exit(1);
++#endif
++    }
++
++    /* Grab the ISO start sector and length from the dir entry. ISO
++       uses 2048-byte sectors, but we convert to 512-byte sectors here
++       for the sake of the firmware */
++    extent = get_733(boot_file->isorec.extent);
++    extent *= 4;
++    
++    length = get_733(boot_file->isorec.size);
++    length /= 512; /* I'm sure we should take account of any overlap
++                      here, but I'm copying what isomarkboot
++                      does. Maybe the boot files are specified to be
++                      exact multiples of 512 bytes? */
++
++    fprintf(stderr, "Found alpha boot image %s: using extent %lu, #blocks %lu\n",
++            boot_file_name, extent, length);
++
++    /* Now write those values into the appropriate area of the boot
++       sector in LITTLE ENDIAN format. */
++    write_le64(length, (unsigned char *)(unsigned long long *)&boot_sector[60]);
++    write_le64(extent, (unsigned char *)&boot_sector[61]);
++
++    /* Now generate a checksum of the first 504 bytes of the boot
++       sector and place it in boot_sector[63]. Isomarkboot currently
++       gets this wrong and will not work on big-endian systems! */
++    for (i = 0; i < 63; i++)
++        sum += read_le64((unsigned char *)&boot_sector[i]);
++
++    write_le64(sum, (unsigned char *)&boot_sector[63]);
++
++    jtwrite(boot_sector, sizeof(boot_sector), 1, 0, FALSE);
++    xfwrite(boot_sector, sizeof(boot_sector), 1, outfile, 0, FALSE);
++    last_extent_written++;
++
++    return 0;
++}
++
++struct output_fragment alphaboot_desc = {NULL, oneblock_size, NULL, boot_alpha_write, "alpha boot block"};
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/boot-hppa.c cdrtools-2.0+a34.debian/mkisofs.steve/boot-hppa.c
+--- cdrtools-2.0+a34.debian/mkisofs/boot-hppa.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/boot-hppa.c	2004-08-17 14:00:44.000000000 +0100
+@@ -0,0 +1,203 @@
++/*
++ * Program boot-hppa.c - Handle HPPA boot extensions to iso9660.
++ *
++ * Written by Steve McIntyre <steve@einval.com> June 2004.
++ *
++ * Heavily inspired by palo:
++ *
++ ****************************************************************************
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License.  See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) Hewlett-Packard (Paul Bame) paul_bame@hp.com
++ *
++ ****************************************************************************
++ * Copyright 2004 Steve McIntyre
++ *
++ * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++#include <mconfig.h>
++#include "mkisofs.h"
++#include <fctldefs.h>
++#include <utypes.h>
++#include <intcvt.h>
++#include "match.h"
++#include "diskmbr.h"
++#include "bootinfo.h"
++#include <schily.h>
++#include "endian.h"
++
++int     add_boot_hppa_cmdline     __PR((char *cmdline));
++int     add_boot_hppa_kernel_32   __PR((char *filename));
++int     add_boot_hppa_kernel_64   __PR((char *filename));
++int     add_boot_hppa_bootloader  __PR((char *filename));
++int     add_boot_hppa_ramdisk     __PR((char *filename));
++
++static  int     boot_hppa_write   __PR((FILE *outfile));
++
++static  char   *hppa_cmdline = NULL;
++static  char   *hppa_kernel_32 = NULL;
++static  char   *hppa_kernel_64 = NULL;
++static  char   *hppa_bootloader = NULL;
++static  char   *hppa_ramdisk = NULL;
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_hppa_cmdline(cmdline)
++    char *cmdline;
++{
++    char *ptr = NULL;
++    hppa_cmdline = strdup(cmdline);
++    ptr = hppa_cmdline;
++    while (*ptr)
++    {
++        if (',' == *ptr)
++            *ptr = ' ';
++        ptr++;
++    }    
++    return 0;
++}
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_hppa_kernel_32(filename)
++    char *filename;
++{
++    hppa_kernel_32 = filename;
++    return 0;
++}
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_hppa_kernel_64(filename)
++    char *filename;
++{
++    hppa_kernel_64 = filename;
++    return 0;
++}
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_hppa_bootloader(filename)
++    char *filename;
++{
++    hppa_bootloader = filename;
++    return 0;
++}
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_hppa_ramdisk(filename)
++    char *filename;
++{
++    hppa_ramdisk = filename;
++    return 0;
++}
++
++static void exit_fatal(type, filename)
++    char *type;
++    char *filename;
++{
++#ifdef	USE_LIBSCHILY
++    comerrno(EX_BAD, "Uh oh, I can't find the %s '%s'!\n",
++             type, filename);
++#else
++    fprintf(stderr, "Uh oh, I can't find the %s '%s'!\n",
++             type, filename);
++    exit(1);
++#endif
++}
++
++static int boot_hppa_write(outfile)
++    FILE *outfile;
++{
++    unsigned char boot_sector[2048]; /* One (ISO) sector */
++	struct directory_entry	*boot_file;	/* Boot file we need to search for */
++    unsigned long length = 0;
++    unsigned long extent = 0;
++    int i = 0;
++
++    memset(boot_sector, 0, sizeof(boot_sector));    
++
++    boot_sector[0] = 0x80;  /* magic */
++    boot_sector[1] = 0x00;  /* magic */
++    boot_sector[2] = 'P';
++    boot_sector[3] = 'A';
++    boot_sector[4] = 'L';
++    boot_sector[5] = 'O';
++    boot_sector[6] = 0x00;
++    boot_sector[7] = 0x04;  /* version */
++
++    /* Find the dir entry for the 32-bit kernel by walking our file list */
++    boot_file = search_tree_file(root, hppa_kernel_32);
++    if (!boot_file)
++        exit_fatal("HPPA 32-bit kernel", hppa_kernel_32);
++    extent = 2048 * get_733(boot_file->isorec.extent);
++    length = get_733(boot_file->isorec.size);
++    fprintf(stderr, "Found hppa 32-bit kernel %s: using extent %lu (0x%lX), size %lu (0x%lX)\n",
++            hppa_kernel_32, extent, extent, length, length);
++    write_be32(extent, &boot_sector[8]);
++    write_be32(length, &boot_sector[12]);
++
++    /* Find the dir entry for the ramdisk by walking our file list */
++    boot_file = search_tree_file(root, hppa_ramdisk);
++    if (!boot_file)
++        exit_fatal("HPPA ramdisk", hppa_ramdisk);
++    extent = 2048 * get_733(boot_file->isorec.extent);
++    length = get_733(boot_file->isorec.size);
++    fprintf(stderr, "Found hppa ramdisk %s: using extent %lu (0x%lX), size %lu (0x%lX)\n",
++            hppa_ramdisk, extent, extent, length, length);
++    write_be32(extent, &boot_sector[16]);
++    write_be32(length, &boot_sector[20]);
++
++    /* Now the commandline */
++    snprintf(&boot_sector[24], 127, "%s", hppa_cmdline);
++
++    /* Find the dir entry for the 64-bit kernel by walking our file list */
++    boot_file = search_tree_file(root, hppa_kernel_64);
++    if (!boot_file)
++        exit_fatal("HPPA 64-bit kernel", hppa_kernel_64);
++    extent = 2048 * get_733(boot_file->isorec.extent);
++    length = get_733(boot_file->isorec.size);
++    fprintf(stderr, "Found hppa 64-bit kernel %s: using extent %lu (0x%lX), size %lu (0x%lX)\n",
++            hppa_kernel_64, extent, extent, length, length);
++    write_be32(extent, &boot_sector[232]);
++    write_be32(length, &boot_sector[236]);
++
++    /* Find the dir entry for the IPL by walking our file list */
++    boot_file = search_tree_file(root, hppa_bootloader);
++    if (!boot_file)
++        exit_fatal("HPPA bootloader", hppa_bootloader);
++    extent = 2048 * get_733(boot_file->isorec.extent);
++    length = get_733(boot_file->isorec.size);
++    fprintf(stderr, "Found hppa bootloader %s: using extent %lu (0x%lX), size %lu (0x%lX)\n",
++            hppa_bootloader, extent, extent, length, length);
++    write_be32(extent, &boot_sector[240]);
++    write_be32(length, &boot_sector[244]);
++
++    jtwrite(boot_sector, sizeof(boot_sector), 1, 0, FALSE);
++    xfwrite(boot_sector, sizeof(boot_sector), 1, outfile, 0, FALSE);
++    last_extent_written++;
++
++    return 0;
++}
++
++struct output_fragment hppaboot_desc = {NULL, oneblock_size, NULL, boot_hppa_write, "hppa boot block"};
++
++
++
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/boot-mips.c cdrtools-2.0+a34.debian/mkisofs.steve/boot-mips.c
+--- cdrtools-2.0+a34.debian/mkisofs/boot-mips.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/boot-mips.c	2004-08-17 14:00:44.000000000 +0100
+@@ -0,0 +1,328 @@
++/*
++ * Program boot-mips.c - Handle big-endian boot extensions to iso9660.
++ *
++ * Written by Steve McIntyre <steve@einval.com> June 2004
++ *
++ * Heavily inspired by / borrowed from genisovh:
++ *
++ * Copyright: (C) 2002 by Florian Lohoff <flo@rfc822.org>
++ *            (C) 2004 by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
++ *
++ * This program is free software; you can redistribute it and/or modify it under
++ * the terms of the GNU General Public License, Version 2, as published by the
++ * Free Software Foundation.
++ *
++ * Format for volume header information
++ *
++ * The volume header is a block located at the beginning of all disk
++ * media (sector 0).  It contains information pertaining to physical
++ * device parameters and logical partition information.
++ *
++ * The volume header is manipulated by disk formatters/verifiers,
++ * partition builders (e.g. fx, dvhtool, and mkfs), and disk drivers.
++ *
++ * Previous versions of IRIX wrote a copy of the volume header is
++ * located at sector 0 of each track of cylinder 0.  These copies were
++ * never used, and reduced the capacity of the volume header to hold large
++ * files, so this practice was discontinued.
++ * The volume header is constrained to be less than or equal to 512
++ * bytes long.  A particular copy is assumed valid if no drive errors
++ * are detected, the magic number is correct, and the 32 bit 2's complement
++ * of the volume header is correct.  The checksum is calculated by initially
++ * zeroing vh_csum, summing the entire structure and then storing the
++ * 2's complement of the sum.  Thus a checksum to verify the volume header
++ * should be 0.
++ *
++ * The error summary table, bad sector replacement table, and boot blocks are
++ * located by searching the volume directory within the volume header.
++ *
++ * Tables are sized simply by the integral number of table records that
++ * will fit in the space indicated by the directory entry.
++ *
++ * The amount of space allocated to the volume header, replacement blocks,
++ * and other tables is user defined when the device is formatted.
++ */
++
++#include <stdint.h>
++
++/*
++ * device parameters are in the volume header to determine mapping
++ * from logical block numbers to physical device addresses
++ *
++ * Linux doesn't care ...
++ */
++struct device_parameters {
++	uint8_t dp_skew;	/* spiral addressing skew */
++	uint8_t dp_gap1;	/* words of 0 before header */
++	uint8_t dp_gap2;	/* words of 0 between hdr and data */
++	uint8_t dp_spares_cyl;	/* This is for drives (such as SCSI
++		that support zone oriented sparing, where the zone is larger
++		than one track.  It gets subracteded from the cylinder size
++		( dp_trks0 * dp_sec) when doing partition size calculations */
++	uint16_t dp_cyls;	/* number of usable cylinders (i.e.,
++		doesn't include cylinders reserved by the drive for badblocks,
++		etc.). For drives with variable geometry, this number may be
++		decreased so that:
++		dp_cyls * ((dp_heads * dp_trks0) - dp_spares_cyl) <= actualcapacity
++		This happens on SCSI drives such as the Wren IV and Toshiba 156
++		Also see dp_cylshi below */
++	uint16_t dp_shd0;	/* starting head vol 0 */
++	uint16_t dp_trks0;	/* number of tracks / cylinder vol 0*/
++	uint8_t dp_ctq_depth;	/* Depth of CTQ queue */
++	uint8_t dp_cylshi;	/* high byte of 24 bits of cylinder count */
++	uint16_t dp_unused;	/* not used */
++	uint16_t dp_secs;	/* number of sectors/track */
++	uint16_t dp_secbytes;	/* length of sector in bytes */
++	uint16_t dp_interleave;	/* sector interleave */
++	int32_t dp_flags;		/* controller characteristics */
++	int32_t dp_datarate;		/* bytes/sec for kernel stats */
++	int32_t dp_nretries;		/* max num retries on data error */
++	int32_t dp_mspw;		/* ms per word to xfer, for iostat */
++	uint16_t dp_xgap1;	/* Gap 1 for xylogics controllers */
++	uint16_t dp_xsync;    /* sync delay for xylogics controllers */
++	uint16_t dp_xrdly;    /* read delay for xylogics controllers */
++	uint16_t dp_xgap2;    /* gap 2 for xylogics controllers */
++	uint16_t dp_xrgate;   /* read gate for xylogics controllers */
++	uint16_t dp_xwcont;   /* write continuation for xylogics */
++};
++
++/*
++ * Device characterization flags
++ * (dp_flags)
++ */
++#define	DP_SECTSLIP	0x00000001	/* sector slip to spare sector */
++#define	DP_SECTFWD	0x00000002	/* forward to replacement sector */
++#define	DP_TRKFWD	0x00000004	/* forward to replacement track */
++#define	DP_MULTIVOL	0x00000008	/* multiple volumes per spindle */
++#define	DP_IGNOREERRORS	0x00000010	/* transfer data regardless of errors */
++#define DP_RESEEK	0x00000020	/* recalibrate as last resort */
++#define	DP_CTQ_EN	0x00000040	/* enable command tag queueing */
++
++/*
++ * Boot blocks, bad sector tables, and the error summary table, are located
++ * via the volume_directory.
++ */
++#define VDNAMESIZE	8
++
++struct volume_directory {
++	int8_t  vd_name[VDNAMESIZE];	/* name */
++	int32_t vd_lbn;			/* logical block number */
++	int32_t vd_nbytes;		/* file length in bytes */
++};
++
++/*
++ * partition table describes logical device partitions
++ * (device drivers examine this to determine mapping from logical units
++ * to cylinder groups, device formatters/verifiers examine this to determine
++ * location of replacement tracks/sectors, etc)
++ *
++ * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED
++ */
++struct partition_table {		/* one per logical partition */
++	int32_t pt_nblks;		/* # of logical blks in partition */
++	int32_t pt_firstlbn;		/* first lbn of partition */
++	int32_t pt_type;		/* use of partition */
++};
++
++#define	PTYPE_VOLHDR	0		/* partition is volume header */
++#define	PTYPE_TRKREPL	1		/* partition is used for repl trks */
++#define	PTYPE_SECREPL	2		/* partition is used for repl secs */
++#define	PTYPE_RAW	3		/* partition is used for data */
++#define	PTYPE_BSD42	4		/* partition is 4.2BSD file system */
++#define	PTYPE_BSD	4		/* partition is 4.2BSD file system */
++#define	PTYPE_SYSV	5		/* partition is SysV file system */
++#define	PTYPE_VOLUME	6		/* partition is entire volume */
++#define	PTYPE_EFS	7		/* partition is sgi EFS */
++#define	PTYPE_LVOL	8		/* partition is part of a logical vol */
++#define	PTYPE_RLVOL	9		/* part of a "raw" logical vol */
++#define	PTYPE_XFS	10		/* partition is sgi XFS */
++#define	PTYPE_XFSLOG	11		/* partition is sgi XFS log */
++#define	PTYPE_XLV	12		/* partition is part of an XLV vol */
++#define	PTYPE_XVM	13		/* partition is sgi XVM */
++#define	PTYPE_LSWAP	0x82		/* partition is Linux swap */
++#define	PTYPE_LINUX	0x83		/* partition is Linux native */
++#define NPTYPES		16
++
++#define	VHMAGIC		0xbe5a941	/* randomly chosen value */
++#define	NPARTAB		16		/* 16 unix partitions */
++#define	NVDIR		15		/* max of 15 directory entries */
++#define BFNAMESIZE	16		/* max 16 chars in boot file name */
++
++/* Partition types for ARCS */
++#define NOT_USED        0       /* Not used 				*/
++#define FAT_SHORT       1       /* FAT filesystem, 12-bit FAT entries 	*/
++#define FAT_LONG        4       /* FAT filesystem, 16-bit FAT entries 	*/
++#define EXTENDED        5       /* extended partition 			*/
++#define HUGE            6       /* huge partition- MS/DOS 4.0 and later */
++
++/* Active flags for ARCS */
++#define BOOTABLE        0x00;
++#define NOT_BOOTABLE    0x80;
++
++struct volume_header {
++	int32_t vh_magic; /* identifies volume header */
++	int16_t vh_rootpt; /* root partition number */
++	int16_t vh_swappt; /* swap partition number */
++	int8_t vh_bootfile[BFNAMESIZE]; /* name of file to boot */
++	struct device_parameters vh_dp; /* device parameters */
++	struct volume_directory vh_vd[NVDIR]; /* other vol hdr contents */
++	struct partition_table vh_pt[NPARTAB]; /* device partition layout */
++	int32_t vh_csum; /* volume header checksum */
++	int32_t vh_fill; /* fill out to 512 bytes */
++    char pad[1536];  /* pad out to 2048 */
++};
++
++#include <mconfig.h>
++#include "mkisofs.h"
++#include <fctldefs.h>
++#include <utypes.h>
++#include <intcvt.h>
++#include "match.h"
++#include "diskmbr.h"
++#include "bootinfo.h"
++#include <schily.h>
++#include "endian.h"
++
++int     add_boot_mips_filename    __PR((char *filename));
++
++static  int     boot_mips_write   __PR((FILE *outfile));
++
++#define MAX_NAMES 15
++static char *boot_mips_filename[MAX_NAMES] =
++{
++    NULL, NULL, NULL,
++    NULL, NULL, NULL,
++    NULL, NULL, NULL,
++    NULL, NULL, NULL,
++    NULL, NULL, NULL
++};
++
++static int boot_mips_num_files = 0;
++
++#define SECTORS_PER_TRACK	32
++#define BYTES_PER_SECTOR	512
++
++int add_boot_mips_filename(filename)
++    char *filename;
++{
++    if (boot_mips_num_files < MAX_NAMES)
++    {
++        boot_mips_filename[boot_mips_num_files] = filename;
++        boot_mips_num_files++;
++    }
++
++    else
++    {
++#ifdef	USE_LIBSCHILY
++        comerrno(EX_BAD, "Too many MIPS boot files!\n");
++#else
++        fprintf(stderr, "Too many MIPS boot files!\n");
++        exit(1);
++#endif
++    }
++    return 0;
++}
++
++static void vh_calc_checksum(struct volume_header *vh)
++{
++	uint32_t newsum = 0;
++	unsigned char *buffer = (unsigned char *)vh;
++	unsigned int i;
++
++	vh->vh_csum = 0;
++
++	for(i = 0; i < sizeof(struct volume_header); i += 4)
++        newsum -= read_be32(&buffer[i]);
++
++    write_be32(newsum, (unsigned char *)&vh->vh_csum);
++}
++
++static char *file_base_name(char *path)
++{
++    char *endptr = path;
++    char *ptr = path;
++    
++    while (*ptr != '\0')
++    {
++        if ('/' == *ptr)
++            endptr = ++ptr;
++        else
++            ++ptr;
++    }
++    return endptr;
++}
++
++static int boot_mips_write(outfile)
++    FILE *outfile;
++{
++	struct directory_entry	*boot_file;	/* Boot file we need to search for */
++    unsigned long length = 0;
++    unsigned long extent = 0;
++	int i;
++	struct volume_header vh;
++    unsigned long long iso_size = 0;
++    char *filename = NULL;
++
++	memset(&vh, 0, sizeof(vh));
++
++    iso_size = last_extent * 2048;
++
++    write_be32(VHMAGIC, (unsigned char *)&vh.vh_magic);
++
++	/* Values from an IRIX cd */
++    write_be16(BYTES_PER_SECTOR, (unsigned char *)&vh.vh_dp.dp_secbytes);
++    write_be16(SECTORS_PER_TRACK, (unsigned char *)&vh.vh_dp.dp_secs);
++    write_be32(DP_RESEEK|DP_IGNOREERRORS|DP_TRKFWD, (unsigned char *)&vh.vh_dp.dp_flags);
++    write_be16(1, (unsigned char *)&vh.vh_dp.dp_trks0);
++
++    write_be16((iso_size + BYTES_PER_SECTOR - 1) / (SECTORS_PER_TRACK * BYTES_PER_SECTOR),
++               (unsigned char *)&vh.vh_dp.dp_cyls);
++
++	for(i = 0; i < boot_mips_num_files; i++)
++    {
++        boot_file = search_tree_file(root, boot_mips_filename[i]);
++        
++        if (!boot_file) {
++#ifdef	USE_LIBSCHILY
++            comerrno(EX_BAD, "Uh oh, I cant find the MIPS boot file '%s'!\n",
++                     boot_mips_filename[i]);
++#else
++            fprintf(stderr, "Uh oh, I cant find the MIPS boot file '%s'!\n",
++                    boot_mips_filename[i]);
++            exit(1);
++#endif
++        }
++
++        extent = get_733(boot_file->isorec.extent) * 4;
++        length = ((get_733(boot_file->isorec.size) + 2047) / 2048) * 2048;
++        filename = file_base_name(boot_mips_filename[i]);
++
++        strncpy(vh.vh_vd[i].vd_name, filename, MIN(VDNAMESIZE, strlen(filename)));
++        write_be32(extent, (unsigned char *)&vh.vh_vd[i].vd_lbn);
++        write_be32(length, (unsigned char *)&vh.vh_vd[i].vd_nbytes);
++        
++        fprintf(stderr, "Found mips boot image %s, using extent %lu (0x%lX), #blocks %lu (0x%lX)\n",
++                filename, extent, extent, length, length);
++	}
++
++	/* Create volume partition on whole cd iso */
++    write_be32((iso_size + (BYTES_PER_SECTOR - 1))/ BYTES_PER_SECTOR, (unsigned char *)&vh.vh_pt[10].pt_nblks);
++    write_be32(0, (unsigned char *)&vh.vh_pt[10].pt_firstlbn);
++    write_be32(PTYPE_VOLUME, (unsigned char *)&vh.vh_pt[10].pt_type);
++
++	/* Create volume header partition, also on WHOLE cd iso */
++    write_be32((iso_size + (BYTES_PER_SECTOR - 1))/ BYTES_PER_SECTOR, (unsigned char *)&vh.vh_pt[8].pt_nblks);
++    write_be32(0, (unsigned char *)&vh.vh_pt[8].pt_firstlbn);
++    write_be32(PTYPE_VOLHDR, (unsigned char *)&vh.vh_pt[8].pt_type);
++
++	/* Create checksum */
++	vh_calc_checksum(&vh);
++
++    jtwrite(&vh, sizeof(vh), 1, 0, FALSE);
++    xfwrite(&vh, sizeof(vh), 1, outfile, 0, FALSE);
++    last_extent_written++;
++
++	return 0;
++}
++
++struct output_fragment mipsboot_desc = {NULL, oneblock_size, NULL, boot_mips_write, "MIPS boot block"};
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/boot-mipsel.c cdrtools-2.0+a34.debian/mkisofs.steve/boot-mipsel.c
+--- cdrtools-2.0+a34.debian/mkisofs/boot-mipsel.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/boot-mipsel.c	2004-08-17 14:00:44.000000000 +0100
+@@ -0,0 +1,242 @@
++/*
++ * Program boot-mipsel.c - Handle Mipsel boot extensions to iso9660.
++ *
++ *  Written by Steve McIntyre <steve@einval.com> (2004).
++ *
++ * Heavily inspired by / borrowed from delo:
++ *
++ * Copyright: (C) 2002 by Florian Lohoff <flo@rfc822.org>
++ *            (C) 2004 by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
++ *
++ * This program is free software; you can redistribute it and/or modify it under
++ * the terms of the GNU General Public License, Version 2, as published by the
++ * Free Software Foundation.
++ *
++ * Format for volume header information
++ *
++ * The volume header is a block located at the beginning of all disk
++ * media (sector 0).  It contains information pertaining to physical
++ * device parameters and logical partition information.
++ *
++ * The volume header is manipulated by disk formatters/verifiers,
++ * partition builders (e.g. fx, dvhtool, and mkfs), and disk drivers.
++ *
++ * Previous versions of IRIX wrote a copy of the volume header is
++ * located at sector 0 of each track of cylinder 0.  These copies were
++ * never used, and reduced the capacity of the volume header to hold large
++ * files, so this practice was discontinued.
++ * The volume header is constrained to be less than or equal to 512
++ * bytes long.  A particular copy is assumed valid if no drive errors
++ * are detected, the magic number is correct, and the 32 bit 2's complement
++ * of the volume header is correct.  The checksum is calculated by initially
++ * zeroing vh_csum, summing the entire structure and then storing the
++ * 2's complement of the sum.  Thus a checksum to verify the volume header
++ * should be 0.
++ *
++ * The error summary table, bad sector replacement table, and boot blocks are
++ * located by searching the volume directory within the volume header.
++ *
++ * Tables are sized simply by the integral number of table records that
++ * will fit in the space indicated by the directory entry.
++ *
++ * The amount of space allocated to the volume header, replacement blocks,
++ * and other tables is user defined when the device is formatted.
++ */
++
++#include <mconfig.h>
++#include "mkisofs.h"
++#include <fctldefs.h>
++#include <utypes.h>
++#include <intcvt.h>
++#include "match.h"
++#include "diskmbr.h"
++#include "bootinfo.h"
++#include <schily.h>
++#include "endian.h"
++#include <errno.h>
++#include <elf.h>
++
++int             add_boot_mipsel_filename  __PR((char *filename));
++static  int     boot_mipsel_write         __PR((FILE *outfile));
++
++static  char   *boot_file_name = NULL;
++
++#define MAX_MAPS        51
++#define DEC_BOOT_MAGIC  0x02757a
++#define HD_SECTOR_SIZE  512
++
++/* Those were stolen from linux kernel headers. */
++
++struct extent {
++    uint32_t count;
++    uint32_t start;
++} __attribute__((packed));
++
++struct dec_bootblock {
++    int8_t pad[8];
++    int32_t magic;          /* We are a DEC BootBlock */
++    int32_t mode;           /* 0: Single extent, 1: Multi extent boot */
++    int32_t loadAddr;       /* Load below kernel */
++    int32_t execAddr;       /* And exec there */
++    struct extent bootmap[MAX_MAPS];
++} __attribute__((packed));
++
++static void swap_in_elf32_ehdr(Elf32_Ehdr *ehdr)
++{
++    ehdr->e_type = read_le16((unsigned char *)&ehdr->e_type);
++    ehdr->e_machine = read_le16((unsigned char *)&ehdr->e_machine);
++    ehdr->e_version = read_le32((unsigned char *)&ehdr->e_version);
++    ehdr->e_entry = read_le32((unsigned char *)&ehdr->e_entry);
++    ehdr->e_phoff = read_le32((unsigned char *)&ehdr->e_phoff);
++    ehdr->e_shoff = read_le32((unsigned char *)&ehdr->e_shoff);
++    ehdr->e_flags = read_le32((unsigned char *)&ehdr->e_flags);
++    ehdr->e_ehsize = read_le16((unsigned char *)&ehdr->e_ehsize);
++    ehdr->e_phentsize = read_le16((unsigned char *)&ehdr->e_phentsize);
++    ehdr->e_phnum = read_le16((unsigned char *)&ehdr->e_phnum);
++    ehdr->e_shentsize = read_le16((unsigned char *)&ehdr->e_shentsize);
++    ehdr->e_shnum = read_le16((unsigned char *)&ehdr->e_shnum);
++    ehdr->e_shstrndx = read_le16((unsigned char *)&ehdr->e_shstrndx);
++}
++
++static void swap_in_elf32_phdr(Elf32_Phdr *phdr)
++{
++    phdr->p_type = read_le32((unsigned char *)&phdr->p_type);
++    phdr->p_offset = read_le32((unsigned char *)&phdr->p_offset);
++    phdr->p_vaddr = read_le32((unsigned char *)&phdr->p_vaddr);
++    phdr->p_paddr = read_le32((unsigned char *)&phdr->p_paddr);
++    phdr->p_filesz = read_le32((unsigned char *)&phdr->p_filesz);
++    phdr->p_memsz = read_le32((unsigned char *)&phdr->p_memsz);
++    phdr->p_flags = read_le32((unsigned char *)&phdr->p_flags);
++    phdr->p_align = read_le32((unsigned char *)&phdr->p_align);
++}
++
++/* Simple function: store the filename to be used later when we need
++   to find the boot file */
++extern int add_boot_mipsel_filename(filename)
++    char *filename;
++{
++    boot_file_name = filename;
++    return 0;
++}
++
++/* Parse the ELF header of the boot loaded to work out the load
++   address and exec address */
++static int parse_boot_file(char *filename, int32_t *loadaddr, int32_t *execaddr, int32_t *offset, int32_t *count)
++{
++    int error = 0;
++    FILE *loader = NULL;
++    Elf32_Ehdr ehdr;
++    Elf32_Phdr phdr;
++    
++    loader = fopen(filename, "rb");
++    if (!loader)
++        return errno;
++    
++    error = fread(&ehdr, sizeof(ehdr), 1, loader);
++    if (1 != error)
++        return EIO;
++
++    swap_in_elf32_ehdr(&ehdr);
++    if (!(ehdr.e_ident[EI_MAG0] == ELFMAG0
++          && ehdr.e_ident[EI_MAG1] == ELFMAG1
++          && ehdr.e_ident[EI_MAG2] == ELFMAG2
++          && ehdr.e_ident[EI_MAG3] == ELFMAG3
++          && ehdr.e_ident[EI_CLASS] == ELFCLASS32
++          && ehdr.e_ident[EI_DATA] == ELFDATA2LSB
++          && ehdr.e_ident[EI_VERSION] == EV_CURRENT
++          && ehdr.e_type == ET_EXEC
++          && ehdr.e_machine == EM_MIPS
++          && ehdr.e_version == EV_CURRENT))
++    {
++        fprintf(stderr, "Sorry, %s is not a MIPS ELF32 little endian file", filename);        
++        return EINVAL;
++    }
++    if (ehdr.e_phnum != 1)
++    {
++        fprintf(stderr, "Sorry, %s has more than one ELF segment", filename);
++        return EINVAL;
++    }
++    fseek(loader, ehdr.e_phoff, SEEK_SET);
++    error = fread(&phdr, sizeof(phdr), 1, loader);
++    if (1 != error)
++        return EIO;
++
++    *loadaddr = phdr.p_vaddr;
++    *execaddr = ehdr.e_entry;
++	*offset = (phdr.p_offset + HD_SECTOR_SIZE - 1) / HD_SECTOR_SIZE;
++	*count = (phdr.p_filesz + HD_SECTOR_SIZE - 1) / HD_SECTOR_SIZE;
++
++    fprintf(stderr, "Parsed mipsel boot image %s: using loadaddr 0x%X, execaddr 0x%X, offset 0x%X, count 0x%X\n",
++            filename, *loadaddr, *execaddr, *offset, *count);
++
++    fclose(loader);
++    return 0;
++}
++
++static int boot_mipsel_write(outfile)
++    FILE *outfile;
++{
++    char sector[2048];
++    struct dec_bootblock *bb = (struct dec_bootblock *)sector;
++    int error = 0;
++    int offset = 0;
++    int count = 0;
++    struct directory_entry	*boot_file;	/* Boot file we need to search for in the image */
++    unsigned long length = 0;
++    unsigned long extent = 0;
++    int loadaddr = 0;
++    int execaddr = 0;
++
++    memset(sector, 0, sizeof(sector));
++
++    /* Fill in our values we care on */
++    write_le32(DEC_BOOT_MAGIC, (unsigned char *)&bb->magic);
++    write_le32(1, (unsigned char *)&bb->mode);
++
++    /* Find the file entry in the CD image */
++    boot_file = search_tree_file(root, boot_file_name);
++    if (!boot_file)
++    {
++#ifdef	USE_LIBSCHILY
++		comerrno(EX_BAD, "Uh oh, unable to find the mipsel boot file '%s'!\n",
++                 boot_file_name);
++#else
++		fprintf(stderr, "Uh oh, unable to find the mipsel boot file '%s'!\n",
++                boot_file_name);
++		exit(1);
++#endif
++    }
++
++    extent = get_733(boot_file->isorec.extent);
++    length = get_733(boot_file->isorec.size);
++    fprintf(stderr, "Found mipsel boot loader %s: using extent %lu, #blocks %lu\n",
++            boot_file_name, extent, length);
++
++    /* Parse the ELF headers on the boot file */
++    error = parse_boot_file(boot_file->whole_name, &loadaddr, &execaddr, &offset, &count);
++    if (error)
++    {
++#ifdef	USE_LIBSCHILY
++		comerrno(EX_BAD, "Uh oh, unable to parse the mipsel boot file '%s'!\n",
++                 boot_file->whole_name);
++#else
++		fprintf(stderr, "Uh oh, unable to parse the mipsel boot file '%s'!\n",
++                boot_file->whole_name);
++		exit(1);
++#endif
++    }
++
++    write_le32(loadaddr, (unsigned char *)&bb->loadAddr);
++    write_le32(execaddr, (unsigned char *)&bb->execAddr);
++    write_le32((extent * 4) + offset, (unsigned char *)&bb->bootmap[0].start);
++    write_le32(count, (unsigned char *)&bb->bootmap[0].count);
++    
++    jtwrite(sector, sizeof(sector), 1, 0, FALSE);
++    xfwrite(sector, sizeof(sector), 1, outfile, 0, FALSE);
++    last_extent_written++;
++
++    return 0;
++}
++
++struct output_fragment mipselboot_desc = {NULL, oneblock_size, NULL, boot_mipsel_write, "mipsel boot block"};
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/boot.c cdrtools-2.0+a34.debian/mkisofs.steve/boot.c
+--- cdrtools-2.0+a34.debian/mkisofs/boot.c	2004-02-22 15:25:09.000000000 +0000
++++ cdrtools-2.0+a34.debian/mkisofs.steve/boot.c	2004-08-17 14:00:44.000000000 +0100
+@@ -373,6 +373,7 @@
+ 	 */
+ 	amt = roundup(last_extent_written, (CD_CYLSIZE/SECTOR_SIZE)) - last_extent_written;
+ 	for (n = 0; n < amt; n++) {
++        jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 		last_extent_written++;
+ 	}
+@@ -403,6 +404,7 @@
+ 			memset(buffer, 0, sizeof (buffer));
+ 			if (read(f, buffer, SECTOR_SIZE) < 0)
+ 				comerr("Read error on '%s'.\n", boot_files[i]);
++            jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE);
+ 			xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 			last_extent_written++;
+ 		}
+@@ -484,6 +486,7 @@
+ 		memcpy(buffer, &cd_label, 512);
+ 	}
+ 
++    jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 	return (0);
+@@ -523,6 +526,7 @@
+ 			comerr("Read error on '%s'.\n", genboot_image);
+ 
+ 		if (i != 0 || last_extent_written == session_start) {
++			jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE);
+ 			xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 			last_extent_written++;
+ 		}
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/eltorito.c cdrtools-2.0+a34.debian/mkisofs.steve/eltorito.c
+--- cdrtools-2.0+a34.debian/mkisofs/eltorito.c	2004-05-23 21:46:05.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/eltorito.c	2004-08-17 14:00:44.000000000 +0100
+@@ -694,6 +694,7 @@
+ 	}
+ 	/* Next we write out the boot volume descriptor for the disc */
+ 	get_torito_desc(&gboot_desc);
++	jtwrite(&gboot_desc, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(&gboot_desc, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 	return (0);
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/endian.c cdrtools-2.0+a34.debian/mkisofs.steve/endian.c
+--- cdrtools-2.0+a34.debian/mkisofs/endian.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/endian.c	2004-08-17 14:00:44.000000000 +0100
+@@ -0,0 +1,188 @@
++#include <mconfig.h>
++#include "endian.h"
++
++/* Write a 64-bit quantity out into memory in BIG ENDIAN order */
++void write_be64(in, out)
++    unsigned long long in;
++    unsigned char *out;
++{
++    out[0] = (in >> 56) & 0xFF;
++    out[1] = (in >> 48) & 0xFF;
++    out[2] = (in >> 40) & 0xFF;
++    out[3] = (in >> 32) & 0xFF;
++    out[4] = (in >> 24) & 0xFF;
++    out[5] = (in >> 16) & 0xFF;
++    out[6] = (in >> 8) & 0xFF;
++    out[7] = in & 0xFF;
++}
++
++/* Read in a 64-bit BIG ENDIAN quantity */
++unsigned long long read_be64(in)
++    unsigned char *in;
++{
++    unsigned long long result = 0;
++
++    result |= (unsigned long long)in[0] << 56;
++    result |= (unsigned long long)in[1] << 48;
++    result |= (unsigned long long)in[2] << 40;
++    result |= (unsigned long long)in[3] << 32;
++    result |= (unsigned long long)in[4] << 24;
++    result |= (unsigned long long)in[5] << 16;
++    result |= (unsigned long long)in[6] << 8;
++    result |= (unsigned long long)in[7];
++    
++    return result;
++}
++
++/* Write a 64-bit quantity out into memory in LITTLE ENDIAN order */
++void write_le64(in, out)
++    unsigned long long in;
++    unsigned char *out;
++{
++    out[0] = in & 0xFF;
++    out[1] = (in >> 8) & 0xFF;
++    out[2] = (in >> 16) & 0xFF;
++    out[3] = (in >> 24) & 0xFF;
++    out[4] = (in >> 32) & 0xFF;
++    out[5] = (in >> 40) & 0xFF;
++    out[6] = (in >> 48) & 0xFF;
++    out[7] = (in >> 56) & 0xFF;
++}
++
++/* Read in a 64-bit LITTLE ENDIAN quantity */
++unsigned long long read_le64(in)
++    unsigned char *in;
++{
++    unsigned long long result = 0;
++
++    result |= (unsigned long long)in[0];
++    result |= (unsigned long long)in[1] << 8;
++    result |= (unsigned long long)in[2] << 16;
++    result |= (unsigned long long)in[3] << 24;
++    result |= (unsigned long long)in[4] << 32;
++    result |= (unsigned long long)in[5] << 40;
++    result |= (unsigned long long)in[6] << 48;
++    result |= (unsigned long long)in[7] << 56;
++    
++    return result;
++}
++
++/* Write a 48-bit quantity out into memory in LITTLE ENDIAN order */
++void write_le48(in, out)
++    unsigned long long in;
++    unsigned char *out;
++{
++    out[0] = in & 0xFF;
++    out[1] = (in >> 8) & 0xFF;
++    out[2] = (in >> 16) & 0xFF;
++    out[3] = (in >> 24) & 0xFF;
++    out[4] = (in >> 32) & 0xFF;
++    out[5] = (in >> 40) & 0xFF;
++}
++
++/* Read in a 48-bit LITTLE ENDIAN quantity */
++unsigned long long read_le48(in)
++    unsigned char *in;
++{
++    unsigned long long result = 0;
++
++    result |= (unsigned long long)in[0];
++    result |= (unsigned long long)in[1] << 8;
++    result |= (unsigned long long)in[2] << 16;
++    result |= (unsigned long long)in[3] << 24;
++    result |= (unsigned long long)in[4] << 32;
++    result |= (unsigned long long)in[5] << 40;
++    
++    return result;
++}
++
++/* Write a 32-bit quantity out into memory in BIG ENDIAN order */
++void write_be32(in, out)
++    unsigned long in;
++    unsigned char *out;
++{
++    out[0] = (in >> 24) & 0xFF;
++    out[1] = (in >> 16) & 0xFF;
++    out[2] = (in >> 8) & 0xFF;
++    out[3] = in & 0xFF;
++}
++
++/* Read in a 32-bit BIG ENDIAN quantity */
++unsigned long read_be32(in)
++    unsigned char *in;
++{
++    unsigned long result = 0;
++
++    result |= (unsigned long)in[0] << 24;
++    result |= (unsigned long)in[1] << 16;
++    result |= (unsigned long)in[2] << 8;
++    result |= (unsigned long)in[3];
++    
++    return result;
++}
++
++/* Write a 32-bit quantity out into memory in LITTLE ENDIAN order */
++void write_le32(in, out)
++    unsigned long in;
++    unsigned char *out;
++{
++    out[0] = in & 0xFF;
++    out[1] = (in >> 8) & 0xFF;
++    out[2] = (in >> 16) & 0xFF;
++    out[3] = (in >> 24) & 0xFF;
++}
++
++/* Read in a 32-bit LITTLE ENDIAN quantity */
++unsigned long read_le32(in)
++    unsigned char *in;
++{
++    unsigned long result = 0;
++
++    result |= (unsigned long)in[0];
++    result |= (unsigned long)in[1] << 8;
++    result |= (unsigned long)in[2] << 16;
++    result |= (unsigned long)in[3] << 24;
++    
++    return result;
++}
++
++/* Write a 16-bit quantity out into memory in BIG ENDIAN order */
++void write_be16(in, out)
++    unsigned short in;
++    unsigned char *out;
++{
++    out[0] = (in >> 8) & 0xFF;
++    out[1] = in & 0xFF;
++}
++    
++/* Read in a 16-bit BIG ENDIAN quantity */
++unsigned short read_be16(in)
++    unsigned char *in;
++{
++    unsigned short result = 0;
++    
++    result |= (unsigned short)in[0] << 8;
++    result |= (unsigned short)in[1];
++    return result;
++}
++
++/* Write a 16-bit quantity out into memory in LITTLE ENDIAN order */
++void write_le16(in, out)
++    unsigned short in;
++    unsigned char *out;
++{
++    out[0] = in & 0xFF;
++    out[1] = in & 0xFF >> 8;
++}
++    
++/* Read in a 16-bit LITTLE ENDIAN quantity */
++unsigned short read_le16(in)
++    unsigned char *in;
++{
++    unsigned short result = 0;
++    
++    result |= (unsigned short)in[0];
++    result |= (unsigned short)in[1] << 8;
++    return result;
++}
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/endian.h cdrtools-2.0+a34.debian/mkisofs.steve/endian.h
+--- cdrtools-2.0+a34.debian/mkisofs/endian.h	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/endian.h	2004-08-17 14:00:44.000000000 +0100
+@@ -0,0 +1,17 @@
++void                  write_be64  __PR((unsigned long long in, unsigned char *out));
++unsigned long long    read_be64   __PR((unsigned char *in));
++void                  write_le64  __PR((unsigned long long in, unsigned char *out));
++unsigned long long    read_le64   __PR((unsigned char *in));
++
++void                  write_le48  __PR((unsigned long long in, unsigned char *out));
++unsigned long long    read_le48   __PR((unsigned char *in));
++
++void                  write_be32  __PR((unsigned long in, unsigned char *out));
++unsigned long         read_be32   __PR((unsigned char *in));
++void                  write_le32  __PR((unsigned long in, unsigned char *out));
++unsigned long         read_le32   __PR((unsigned char *in));
++
++void                  write_be16  __PR((unsigned short in, unsigned char *out));
++unsigned short        read_be16   __PR((unsigned char *in));
++void                  write_le16  __PR((unsigned short in, unsigned char *out));
++unsigned short        read_le16   __PR((unsigned char *in));
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/joliet.c cdrtools-2.0+a34.debian/mkisofs.steve/joliet.c
+--- cdrtools-2.0+a34.debian/mkisofs/joliet.c	2004-08-17 12:59:57.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/joliet.c	2004-08-17 14:00:44.000000000 +0100
+@@ -989,6 +989,7 @@
+ 			dir_index, dpnt->de_name);
+ #endif
+ 	}
++	jtwrite(directory_buffer, total_size, 1, 0, FALSE);
+ 	xfwrite(directory_buffer, total_size, 1, outfile, 0, FALSE);
+ 	last_extent_written += total_size >> 11;
+ 	free(directory_buffer);
+@@ -1393,9 +1394,12 @@
+ 	FILE	*outfile;
+ {
+ 	/* Next we write the path tables */
++	jtwrite(jpath_table_l, jpath_blocks << 11, 1, 0, FALSE);
+ 	xfwrite(jpath_table_l, jpath_blocks << 11, 1, outfile, 0, FALSE);
++	last_extent_written += jpath_blocks;
++	jtwrite(jpath_table_m, jpath_blocks << 11, 1, 0, FALSE);
+ 	xfwrite(jpath_table_m, jpath_blocks << 11, 1, outfile, 0, FALSE);
+-	last_extent_written += 2 * jpath_blocks;
++	last_extent_written += jpath_blocks;
+ 	free(jpath_table_l);
+ 	free(jpath_table_m);
+ 	jpath_table_l = NULL;
+@@ -1448,6 +1452,7 @@
+ 	/* Next we write out the boot volume descriptor for the disc */
+ 	jvol_desc = vol_desc;
+ 	get_joliet_vol_desc(&jvol_desc);
++	jtwrite(&jvol_desc, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(&jvol_desc, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 	return (0);
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/jte.c cdrtools-2.0+a34.debian/mkisofs.steve/jte.c
+--- cdrtools-2.0+a34.debian/mkisofs/jte.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/jte.c	2004-10-11 22:32:31.000000000 +0100
+@@ -0,0 +1,1004 @@
++#undef BZ2_SUPPORT
++
++#include <mconfig.h>
++#include "mkisofs.h"
++#include <timedefs.h>
++#include <fctldefs.h>
++#include <zlib.h>
++#ifdef BZ2_SUPPORT
++#   include <bzlib.h>
++#endif
++#include <regex.h>
++#ifdef SORTING
++#include "match.h"
++#endif /* SORTING */
++#include <errno.h>
++#include <schily.h>
++#ifdef DVD_VIDEO
++#include "dvd_reader.h"
++#include "dvd_file.h"
++#include "ifo_read.h"
++#include "md5.h"
++#include "endian.h"
++#endif
++#ifdef APPLE_HYB
++#include <ctype.h>
++#endif
++
++#ifdef	VMS
++#include "vms.h"
++#endif
++
++/* Different types used in building our state list below */
++#define JTET_FILE_MATCH 1
++#define JTET_NOMATCH    2
++
++#define JTE_VER_MAJOR     0x0001
++#define JTE_VER_MINOR     0x000F
++#define JTE_NAME          "JTE"
++#define JTE_COMMENT       "JTE at http://www.einval.com/~steve/software/JTE/ ; jigdo at http://atterer.net/jigdo/"
++
++#define JIGDO_TEMPLATE_VERSION "1.1"
++
++#ifdef BZ2_SUPPORT
++int use_bz2 = 0;
++#endif
++
++/*	
++	Simple list to hold the results of -jigdo-exclude and
++	-jigdo-force-match command line options. Seems easiest to do this
++	using regexps.
++*/
++struct path_match
++{
++    regex_t  match_pattern;
++    char    *match_rule;
++    struct path_match *next;
++};
++
++/* List of mappings e.g. Debian=/mirror/debian */
++struct path_mapping
++{
++    char                *from;
++    char                *to;
++    struct path_mapping *next;
++};
++
++FILE	*jtjigdo = NULL;       /* File handle used throughout for the jigdo file */
++FILE	*jttemplate = NULL;    /* File handle used throughout for the template file */
++char    *jjigdo_out = NULL;    /* Output name for jigdo .jigdo file; NULL means don't do it */
++char    *jtemplate_out = NULL; /* Output name for jigdo template file; NULL means don't do it */
++char    *jmd5_list = NULL;     /* Name of file to use for MD5 checking */
++int      jte_min_size = MIN_JIGDO_FILE_SIZE;
++struct  path_match *exclude_list = NULL;
++struct  path_match *include_list = NULL;
++struct  path_mapping  *map_list = NULL;
++unsigned long long template_size = 0;
++unsigned long long image_size = 0;
++
++static struct mk_MD5Context iso_context;
++static struct mk_MD5Context template_context;
++
++/* List of files that we've seen, ready to write into the template and
++   jigdo files */
++typedef struct _file_entry
++{
++    unsigned char       md5[16];
++    off_t               file_length;
++    unsigned long long  rsyncsum;
++    char               *filename;
++} file_entry_t;
++
++typedef struct _unmatched_entry
++{
++    off_t uncompressed_length;
++} unmatched_entry_t;    
++
++typedef struct _entry
++{
++    int entry_type; /* JTET_TYPE as above */
++    struct _entry *next;
++    union
++    {
++        file_entry_t      file;
++        unmatched_entry_t chunk;
++    } data;
++} entry_t;
++
++typedef struct _jigdo_file_entry
++{
++    unsigned char type;
++    unsigned char fileLen[6];
++    unsigned char fileRsync[8];
++    unsigned char fileMD5[16];
++} jigdo_file_entry_t;
++
++typedef struct _jigdo_chunk_entry
++{
++    unsigned char type;
++    unsigned char skipLen[6];
++} jigdo_chunk_entry_t;
++
++typedef struct _jigdo_image_entry
++{
++    unsigned char type;
++    unsigned char imageLen[6];
++    unsigned char imageMD5[16];
++    unsigned char blockLen[4];
++} jigdo_image_entry_t;
++
++typedef struct _md5_list_entry
++{
++    struct _md5_list_entry *next;
++    unsigned char       MD5[16];
++    unsigned long long  size;
++    char               *filename;
++} md5_list_entry_t;
++    
++entry_t *entry_list = NULL;
++entry_t *entry_last = NULL;
++FILE    *t_file = NULL;
++FILE    *j_file = NULL;
++int      num_matches = 0;
++int      num_chunks = 0;
++md5_list_entry_t *md5_list = NULL;
++md5_list_entry_t *md5_last = NULL;
++
++/* Grab the file component from a full path */
++static char *file_base_name(char *path)
++{
++    char *endptr = path;
++    char *ptr = path;
++    
++    while (*ptr != '\0')
++    {
++        if ('/' == *ptr)
++            endptr = ++ptr;
++        else
++            ++ptr;
++    }
++    return endptr;
++}
++
++/* Dump a buffer in hex */
++static char *hex_dump(unsigned char *buf, size_t buf_size)
++{
++    unsigned int i;
++    static char output_buffer[2048];
++    char *p = output_buffer;
++
++    memset(output_buffer, 0, sizeof(output_buffer));
++    if (buf_size >= (sizeof(output_buffer) / 2))
++    {
++        fprintf(stderr, "hex_dump: Buffer too small!\n");
++        exit(1);
++    }
++
++    for (i = 0; i < buf_size ; i++)
++        p += sprintf(p, "%2.2x", buf[i]);
++
++    return output_buffer;
++}
++
++/* Build the list of exclusion regexps */
++extern int jte_add_exclude(char *pattern)
++{
++    struct path_match *new = NULL;
++    
++    new = malloc(sizeof *new);
++    if (!new)
++        return ENOMEM;    
++    
++    regcomp(&new->match_pattern, pattern, REG_NEWLINE);
++	new->match_rule = pattern;
++
++    /* Order on the exclude list doesn't matter! */
++    if (NULL != exclude_list)
++        new->next = exclude_list;
++
++    exclude_list = new;
++    return 0;
++}
++
++/* Check if the file should be excluded because of a filename match. 1
++   means exclude, 0 means not */
++static int check_exclude_by_name(char *filename, char **matched)
++{
++    struct path_match *ptr = exclude_list;
++    regmatch_t pmatch[1];
++    int i = 0;
++
++    while (ptr)
++    {
++        if (!regexec(&ptr->match_pattern, filename, 1, pmatch, 0))
++        {
++            *matched = ptr->match_rule;
++            return 1;
++        }
++        ptr = ptr->next;
++    }
++    
++    /* Not matched, so return 0 */
++    return 0;
++}
++
++/* Build the list of required inclusion regexps */
++extern int jte_add_include(char *pattern)
++{
++    struct path_match *new = NULL;
++    
++    new = malloc(sizeof *new);
++    if (!new)
++        return ENOMEM;    
++    
++    regcomp(&new->match_pattern, pattern, REG_NEWLINE);
++	new->match_rule = pattern;
++
++    /* Order on the include list doesn't matter! */
++    if (NULL != include_list)
++        new->next = include_list;
++
++    include_list = new;
++    return 0;
++}
++
++/* Check if a file has to be MD5-matched to be valid. If we get called
++   here, we've failed to match any of the MD5 entries we were
++   given. If the path to the filename matches one of the paths in our
++   list, clearly it must have been corrupted. Abort with an error. */
++static void check_md5_file_match(char *filename)
++{
++    struct path_match *ptr = include_list;
++    regmatch_t pmatch[1];
++    int i = 0;
++
++    while (ptr)
++    {
++        if (!regexec(&ptr->match_pattern, filename, 1, pmatch, 0))
++        {
++#ifdef	USE_LIBSCHILY
++			comerr("File %s should have matched an MD5 entry, but didn't! (Rule '%s')\n", filename, ptr->match_rule);
++#else
++			fprintf(stderr, "File %s should have matched an MD5 entry, but didn't! (Rule '%s')\n", filename, ptr->match_rule);
++			exit(1);
++#endif
++		}
++        ptr = ptr->next;
++    }
++}    
++
++/* Should we list a file separately in the jigdo output, or should we
++   just dump it into the template file as binary data? Three things
++   cases to look for here:
++
++   1. Small files are better simply folded in, as they take less space that way.
++
++   2. Files in /doc (for example) may change in the archive all the
++      time and it's better to not have to fetch snapshot copies if we
++      can avoid it.      
++
++   3. Files living in specified paths *must* match an entry in the
++      md5-list, or they must have been corrupted. If we find a corrupt
++      file, bail out with an error.
++
++*/
++extern int list_file_in_jigdo(char *filename, off_t size, char **realname, unsigned char md5[16])
++{
++    char *matched_rule;
++    md5_list_entry_t *entry = md5_list;
++    int md5sum_done = 0;
++    
++    if (!jtemplate_out)
++        return 0;
++
++    memset(md5, 0, sizeof(md5));
++
++    /* Cheaper to check file size first */
++    if (size < jte_min_size)
++    {
++        if (verbose > 0)
++            fprintf(stderr, "Jigdo-ignoring file %s; it's too small\n", filename);
++        return 0;
++    }
++    
++    /* Now check the excluded list by name */
++    if (check_exclude_by_name(filename, &matched_rule))
++    {
++        if (verbose > 0)
++            fprintf(stderr, "Jigdo-ignoring file %s; it's covered in the exclude list by \"%s\"\n", filename, matched_rule);
++        return 0;
++    }
++
++    /* Check to see if the file is in our md5 list. Check three things:
++       
++       1. the size
++       2. the filename
++       3. (only if the first 2 match) the md5sum
++
++       If we get a match for all three, include the file and return
++       the full path to the file that we have gleaned from the mirror.
++    */
++
++    while (entry)
++    {
++        if (size == entry->size)
++        {
++            if (!strcmp(file_base_name(filename), file_base_name(entry->filename)))
++            {
++                if (!md5sum_done)
++                {
++                    calculate_md5sum(filename, size, md5);
++                    md5sum_done = 1;
++                }
++                if (!memcmp(md5, entry->MD5, sizeof(entry->MD5)))
++                {
++                    *realname = entry->filename;
++                    return 1;
++                }
++            }
++        }
++        entry = entry->next;
++    }
++
++    /* We haven't found an entry in our MD5 list to match this
++     * file. If we should have done, complain and bail out. */
++    check_md5_file_match(filename);
++    return 0;
++}
++
++/* Add a mapping of pathnames (e.g. Debian=/mirror/debian). We should
++   be passed TO=FROM here */
++extern int jte_add_mapping(char *arg)
++{
++    int error = 0;
++    struct path_mapping *new = NULL;
++    struct path_mapping *entry = NULL;
++    char *p = arg;
++    char *from = NULL;
++    char *to = NULL;
++
++    /* Find the "=" in the string passed. Set it to NULL and we can
++       use the string in-place */
++    while (*p)
++    {
++        if ('=' == *p)
++        {
++            *p = 0;
++            p++;
++            to = arg;
++            from = p;
++        }
++        p++;
++    }
++    if (!from || !strlen(from) || !to || !strlen(to))
++        return EINVAL;
++    
++    new = malloc(sizeof(*new));
++    if (!new)
++        return ENOMEM;
++    
++    new->from = from;
++    new->to = to;
++    new->next = NULL;
++
++    if (verbose > 0)
++        fprintf(stderr, "Adding mapping from %s to %s for the jigdo file\n", from, to);
++    if (!map_list)
++        map_list = new;
++    else
++    {
++        /* Order is important; add to the end of the list */
++        entry = map_list;
++        while (NULL != entry->next)
++            entry = entry->next;
++        entry->next = new;
++    }
++    return 0;
++}
++
++/* Check if the filename should be remapped; if so map it, otherwise
++   return the original name. */
++static char *remap_filename(char *filename)
++{
++    char *new_name = filename;
++    struct path_mapping *entry = map_list;
++    
++    while (entry)
++    {
++        if (!strncmp(filename, entry->from, strlen(entry->from)))
++        {
++            new_name = calloc(1, 2 + strlen(filename) + strlen(entry->to) - strlen(entry->from));
++            if (!new_name)
++            {
++                fprintf(stderr, "Failed to malloc new filename; abort!\n");
++                exit(1);
++            }
++            sprintf(new_name, "%s:%s", entry->to, &filename[strlen(entry->from)]);
++            return new_name;
++        }
++        entry = entry->next;
++    }
++
++    /* No mapping in effect */
++    return strdup(filename);
++}    
++
++/* Write data to the template file and update the MD5 sum */
++static size_t template_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
++{
++    mk_MD5Update(&template_context, ptr, size * nmemb);
++    template_size += (unsigned long long)size * nmemb;
++    return fwrite(ptr, size, nmemb, stream);
++}
++
++/* Create a new template file and initialise it */
++static void write_template_header()
++{
++    char buf[2048];
++    int i = 0;
++    char *p = buf;
++
++    memset(buf, 0, sizeof(buf));
++
++    mk_MD5Init(&template_context);
++    i += sprintf(p, "JigsawDownload template %s %s/%d.%d \r\n",
++                 JIGDO_TEMPLATE_VERSION, JTE_NAME, JTE_VER_MAJOR, JTE_VER_MINOR);
++    p = &buf[i];
++
++    i += sprintf(p, "%s \r\n", JTE_COMMENT);
++    p = &buf[i];
++
++    i += sprintf(p, "\r\n");
++    template_fwrite(buf, i, 1, t_file);
++}
++
++/* Read the MD5 list and build a list in memory for us to use later */
++static void add_md5_entry(unsigned char *md5, unsigned long long size, char *filename)
++{
++    int error = 0;
++    md5_list_entry_t *new = NULL;
++    
++    new = calloc(1, sizeof(md5_list_entry_t));
++    memcpy(new->MD5, md5, sizeof(new->MD5));
++    new->size = size;
++    new->filename = strdup(filename);
++    
++    /* Add to the end of the list */
++    if (NULL == md5_last)
++    {
++        md5_last = new;
++        md5_list = new;
++    }
++    else
++    {
++        md5_last->next = new;
++        md5_last = new;
++    }
++}
++
++/* Parse a 12-digit decimal number */
++static unsigned long long parse_number(unsigned char in[12])
++{
++    unsigned long long size = 0;
++    int i = 0;
++    
++    for (i = 0; i < 12; i++)
++    {
++        size *= 10;
++        if (isdigit(in[i]))
++            size += (in[i] - '0');
++    }
++
++    return size;
++}
++    
++/* Read the MD5 list and build a list in memory for us to use later
++   MD5 list format:
++
++   <---MD5--->  <--Size-->  <--Filename-->
++       32          12          remaining
++*/
++static void parse_md5_list(void)
++{
++    FILE *md5_file = NULL;
++    unsigned char buf[1024];
++    unsigned char md5[16];
++    char *filename = NULL;
++    unsigned char *numbuf = NULL;
++    int num_files = 0;
++    unsigned long long size = 0;
++
++    md5_file = fopen(jmd5_list, "rb");
++    if (!md5_file)
++    {
++#ifdef	USE_LIBSCHILY
++        comerr("cannot read from MD5 list file '%s'\n", jmd5_list);
++#else
++        fprintf(stderr, "cannot read from MD5 list file '%s'\n", jmd5_list);
++        exit(1);
++#endif
++    }
++
++    memset(buf, 0, sizeof(buf));
++    while (fgets(buf, sizeof(buf), md5_file))
++    {
++        numbuf = &buf[34];
++        filename = &buf[48];
++        /* Lose the trailing \n from the fgets() call */
++        if (buf[strlen(buf)-1] == '\n')
++            buf[strlen(buf)-1] = 0;
++
++        if (mk_MD5Parse(buf, md5))
++        {
++#ifdef	USE_LIBSCHILY
++            comerr("cannot parse MD5 file '%s'\n", jmd5_list);
++#else
++            fprintf(stderr, "cannot parse MD5 file '%s'\n", jmd5_list);
++            exit(1);
++#endif
++        }
++        size = parse_number(numbuf);
++        add_md5_entry(md5, size, filename);
++        memset(buf, 0, sizeof(buf));
++        num_files++;
++    }
++    if (verbose > 0)
++        fprintf(stderr, "parse_md5_list: added MD5 checksums for %d files\n", num_files);
++    fclose(md5_file);
++}
++
++/* Initialise state and start the jigdo template file */
++void write_jt_header(FILE *template_file, FILE *jigdo_file)
++{
++    t_file = template_file;
++    j_file = jigdo_file;
++
++    /* Start MD5 work for the image */
++    mk_MD5Init(&iso_context);
++
++    /* Start the template file */
++    write_template_header();
++
++    /* Load up the MD5 list if we've been given one */
++    if (jmd5_list)
++        parse_md5_list();
++}
++
++/* Compress and flush out a buffer full of template data */
++static void flush_gzip_chunk(void *buffer, off_t size)
++{
++    z_stream c_stream; /* compression stream */
++    unsigned char comp_size_out[6];
++    unsigned char uncomp_size_out[6];
++    off_t compressed_size_out = 0;
++    int err = 0;
++    unsigned char *comp_buf = NULL;
++
++    c_stream.zalloc = NULL;
++    c_stream.zfree = NULL;
++    c_stream.opaque = NULL;
++
++    err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
++    comp_buf = malloc(2 * size); /* Worst case */
++    c_stream.next_out = comp_buf;
++    c_stream.avail_out = 2 * size;
++    c_stream.next_in = buffer;
++    c_stream.avail_in = size;
++    
++    err = deflate(&c_stream, Z_NO_FLUSH);
++    err = deflate(&c_stream, Z_FINISH);
++    
++    compressed_size_out = c_stream.total_out + 16;
++    err = deflateEnd(&c_stream);
++
++    template_fwrite("DATA", 4, 1, t_file);
++
++    write_le48(compressed_size_out, &comp_size_out[0]);
++    template_fwrite(comp_size_out, sizeof(comp_size_out), 1, t_file);
++
++    write_le48(size, &uncomp_size_out[0]);
++    template_fwrite(uncomp_size_out, sizeof(uncomp_size_out), 1, t_file);
++    
++    template_fwrite(comp_buf, c_stream.total_out, 1, t_file);
++    free(comp_buf);
++}
++
++#ifdef BZ2_SUPPORT
++/* Compress and flush out a buffer full of template data */
++static void flush_bz2_chunk(void *buffer, off_t size)
++{
++    bz_stream c_stream; /* compression stream */
++    unsigned char comp_size_out[6];
++    unsigned char uncomp_size_out[6];
++    off_t compressed_size_out = 0;
++    int err = 0;
++    unsigned char *comp_buf = NULL;
++
++    c_stream.bzalloc = NULL;
++    c_stream.bzfree = NULL;
++    c_stream.opaque = NULL;
++
++    err = BZ2_bzCompressInit(&c_stream, 9, 0, 0);
++    comp_buf = malloc(2 * size); /* Worst case */
++    c_stream.next_out = comp_buf;
++    c_stream.avail_out = 2 * size;
++    c_stream.next_in = buffer;
++    c_stream.avail_in = size;
++    
++    err = BZ2_bzCompress(&c_stream, BZ_FINISH);
++    
++    compressed_size_out = c_stream.total_out_lo32 + 16;
++    err = BZ2_bzCompressEnd(&c_stream);
++
++    template_fwrite("DATA", 4, 1, t_file);
++
++    write_le48(compressed_size_out, &comp_size_out[0]);
++    template_fwrite(comp_size_out, sizeof(comp_size_out), 1, t_file);
++
++    write_le48(size, &uncomp_size_out[0]);
++    template_fwrite(uncomp_size_out, sizeof(uncomp_size_out), 1, t_file);
++    
++    template_fwrite(comp_buf, c_stream.total_out_lo32, 1, t_file);
++    free(comp_buf);
++}
++#endif
++
++static void flush_compressed_chunk(void *buffer, off_t size)
++{
++#ifdef BZ2_SUPPORT
++    if (use_bz2)
++        flush_bz2_chunk(buffer, size);
++    else
++#endif
++        flush_gzip_chunk(buffer, size);
++}
++
++/* Append to an existing data buffer, and compress/flush it if
++   necessary */
++static void write_compressed_chunk(unsigned char *buffer, size_t size)
++{
++    static unsigned char uncomp_buf[1024 * 1024];
++    static size_t uncomp_buf_used = 0;
++
++    if ((uncomp_buf_used + size) > sizeof(uncomp_buf))
++    {
++        flush_compressed_chunk(uncomp_buf, uncomp_buf_used);
++        uncomp_buf_used = 0;
++    }
++
++    if (!size) /* Signal a flush before we start writing the DESC entry */
++    {
++        flush_compressed_chunk(uncomp_buf, uncomp_buf_used);
++        return;
++    }
++    
++    if (!uncomp_buf_used)
++        memset(uncomp_buf, 0, sizeof(uncomp_buf));
++
++    while (size > sizeof(uncomp_buf))
++    {
++        flush_compressed_chunk(buffer, sizeof(uncomp_buf));
++        buffer += sizeof(uncomp_buf);
++        size -= sizeof(uncomp_buf);
++    }
++    memcpy(&uncomp_buf[uncomp_buf_used], buffer, size);
++    uncomp_buf_used += size;
++}
++
++/* Loop through the list of DESC entries that we've built up and
++   append them to the template file */
++static void write_template_desc_entries(off_t image_len, char *image_md5)
++{
++    entry_t *entry = entry_list;
++    off_t desc_len = 0;
++    unsigned char out_len[6];
++    jigdo_image_entry_t jimage;
++
++    desc_len = 16 /* DESC + length twice */
++        + (sizeof(jigdo_file_entry_t) * num_matches)
++        + (sizeof(jigdo_chunk_entry_t) * num_chunks)
++        + sizeof(jigdo_image_entry_t);
++
++    write_le48(desc_len, &out_len[0]);
++    write_compressed_chunk(NULL, 0);
++    template_fwrite("DESC", 4, 1, t_file);
++    template_fwrite(out_len, sizeof(out_len), 1, t_file);
++    
++    while (entry)
++    {
++        switch (entry->entry_type)
++        {
++            case JTET_FILE_MATCH:
++            {
++                jigdo_file_entry_t jfile;
++                jfile.type = 6; /* Matched file */
++                write_le48(entry->data.file.file_length, &jfile.fileLen[0]);
++                write_le64(entry->data.file.rsyncsum, &jfile.fileRsync[0]);
++                memcpy(jfile.fileMD5, entry->data.file.md5, sizeof(jfile.fileMD5));
++                template_fwrite(&jfile, sizeof(jfile), 1, t_file);
++                break;
++            }
++            case JTET_NOMATCH:
++            {
++                jigdo_chunk_entry_t jchunk;
++#ifdef BZ2_SUPPORT
++                if (use_bz2)
++                    jchunk.type = 8; /* Raw data, bzipped */
++                else
++#endif
++                    jchunk.type = 2; /* Raw data, gzipped */
++                write_le48(entry->data.chunk.uncompressed_length, &jchunk.skipLen[0]);
++                template_fwrite(&jchunk, sizeof(jchunk), 1, t_file);
++                break;
++            }
++        }
++        entry = entry->next;
++    }
++
++    jimage.type = 5;
++    write_le48(image_len, &jimage.imageLen[0]);
++    memcpy(jimage.imageMD5, image_md5, sizeof(jimage.imageMD5));
++    write_le32(MIN_JIGDO_FILE_SIZE, &jimage.blockLen[0]);
++    template_fwrite(&jimage, sizeof(jimage), 1, t_file);    
++    template_fwrite(out_len, sizeof(out_len), 1, t_file);
++}
++
++/* Dump a buffer in jigdo-style "base64" */
++static char *base64_dump(unsigned char *buf, size_t buf_size)
++{
++    const char *b64_enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
++    int value = 0;
++    unsigned int i;
++    int bits = 0;
++    static char output_buffer[2048];
++    char *p = output_buffer;
++
++    memset(output_buffer, 0, sizeof(output_buffer));
++    if (buf_size >= (sizeof(output_buffer) * 6/8))
++    {
++        fprintf(stderr, "base64_dump: Buffer too small!\n");
++        exit(1);
++    }
++
++    for (i = 0; i < buf_size ; i++)
++    {
++        value = (value << 8) | buf[i];
++        bits += 2;
++        p += sprintf(p, "%c", b64_enc[(value >> bits) & 63U]);
++        if (bits >= 6) {
++            bits -= 6;
++            p += sprintf(p, "%c", b64_enc[(value >> bits) & 63U]);
++        }
++    }
++    if (bits > 0)
++    {
++        value <<= 6 - bits;
++        p += sprintf(p, "%c", b64_enc[value & 63U]);
++    }
++    return output_buffer;
++}
++
++/* Write the .jigdo file to match the .template we've just finished. */
++static void write_jigdo_file(void)
++{
++    unsigned char template_md5sum[16];
++    entry_t *entry = entry_list;
++    struct path_mapping *map = map_list;
++
++    mk_MD5Final(&template_md5sum[0], &template_context);
++
++    fprintf(j_file, "# JigsawDownload\n");
++    fprintf(j_file, "# See <http://atterer.net/jigdo/> for details about jigdo\n");
++    fprintf(j_file, "# See <http://www.einval.com/~steve/software/CD/JTE/> for details about JTE\n\n");
++    
++    fprintf(j_file, "[Jigdo]\n");
++    fprintf(j_file, "Version=%s\n", JIGDO_TEMPLATE_VERSION);
++    fprintf(j_file, "Generator=%s/%d.%d\n\n", JTE_NAME, JTE_VER_MAJOR, JTE_VER_MINOR);
++
++    fprintf(j_file, "[Image]\n");
++    fprintf(j_file, "Filename=%s\n", file_base_name(outfile));
++    fprintf(j_file, "Template=http://localhost/%s\n", jtemplate_out);
++    fprintf(j_file, "Template-MD5Sum=%s \n",
++            base64_dump(&template_md5sum[0], sizeof(template_md5sum)));
++    fprintf(j_file, "# Template Hex MD5sum %s\n",
++            hex_dump(&template_md5sum[0], sizeof(template_md5sum)));
++    fprintf(j_file, "# Template size %lld bytes\n", template_size);
++    fprintf(j_file, "# Image size %lld bytes\n\n", image_size);
++
++    fprintf(j_file, "[Parts]\n");
++    while (entry)
++    {
++        if (JTET_FILE_MATCH == entry->entry_type)
++        {
++            char *new_name = remap_filename(entry->data.file.filename);
++            fprintf(j_file, "%s=%s\n",
++                    base64_dump(&entry->data.file.md5[0], sizeof(entry->data.file.md5)),
++                    new_name);
++            free(new_name);
++        }
++        entry = entry->next;
++    }
++
++    fprintf(j_file, "\n[Servers]\n");
++    fflush(j_file);
++}
++
++/* Finish and flush state; for now:
++   
++   1. Dump the DESC blocks and the footer information in the jigdo template file
++   2. Write the jigdo .jigdo file containing file pointers
++*/
++void write_jt_footer(void)
++{
++    unsigned char md5[16]; /* MD5SUM of the entire image */
++
++    /* Finish calculating the image's checksum */
++    mk_MD5Final(&md5[0], &iso_context);
++
++    /* And calculate the image size */
++    image_size = (unsigned long long)SECTOR_SIZE * last_extent_written;
++
++    write_template_desc_entries(image_size, md5);
++
++    write_jigdo_file();
++}
++
++/* Add a raw data entry to the list of extents; no file to match */
++static void add_unmatched_entry(int uncompressed_length)
++{
++    entry_t *new_entry = NULL;
++
++    /* Can we extend a previous non-match entry? */
++    if (entry_last && (JTET_NOMATCH == entry_last->entry_type))
++    {
++        entry_last->data.chunk.uncompressed_length += uncompressed_length;
++        return;
++    }
++
++    new_entry = calloc(1, sizeof(entry_t));
++    new_entry->entry_type = JTET_NOMATCH;
++    new_entry->next = NULL;
++    new_entry->data.chunk.uncompressed_length = uncompressed_length;
++
++    /* Add to the end of the list */
++    if (NULL == entry_last)
++    {
++        entry_last = new_entry;
++        entry_list = new_entry;
++    }
++    else
++    {
++        entry_last->next = new_entry;
++        entry_last = new_entry;
++    }
++    num_chunks++;
++}
++
++/* Add a file match entry to the list of extents */
++static void add_file_entry(char *filename, off_t size, unsigned char *md5,
++                           unsigned long long rsyncsum)
++{
++    entry_t *new_entry = NULL;
++
++    new_entry = calloc(1, sizeof(entry_t));
++    new_entry->entry_type = JTET_FILE_MATCH;
++    new_entry->next = NULL;
++    memcpy(new_entry->data.file.md5, md5, sizeof(new_entry->data.file.md5));
++    new_entry->data.file.file_length = size;
++    new_entry->data.file.rsyncsum = rsyncsum;
++    new_entry->data.file.filename = strdup(filename);
++
++    /* Add to the end of the list */
++    if (NULL == entry_last)
++    {
++        entry_last = new_entry;
++        entry_list = new_entry;
++    }
++    else
++    {
++        entry_last->next = new_entry;
++        entry_last = new_entry;
++    }
++    num_matches++;
++}    
++
++/* Cope with an unmatched block in the .iso file:
++
++   1. Write a compressed data chunk in the jigdo template file
++   2. Add an entry in our list of unmatched chunks for later */
++void jtwrite(buffer, size, count, submode, islast)
++	void	*buffer;
++	int	size;
++	int	count;
++	int	submode;
++	BOOL	islast;
++{
++#ifdef	JTWRITE_DEBUG
++	if (count != 1 || (size % 2048) != 0)
++		error("Count: %d, size: %d\n", count, size);
++#endif
++
++    if (!jtemplate_out)
++        return;
++
++    /* Update the global image checksum */
++    mk_MD5Update(&iso_context, buffer, size*count);
++
++    /* Write a compressed version of the data to the template file,
++       and add a reference on the state list so we can write that
++       later. */
++    write_compressed_chunk(buffer, size*count);
++    add_unmatched_entry(size*count);
++}
++
++/* Cope with a file entry in the .iso file:
++
++   1. Read the file for the image's md5 checksum
++   2. Add an entry in our list of files to be written into the .jigdo later
++*/
++void write_jt_match_record(char *filename, char *mirror_name, int sector_size, off_t size, unsigned char md5[16])
++{
++    unsigned long long  tmp_size = 0;
++    char                buf[32768];
++    off_t               remain = size;
++	FILE               *infile = NULL;
++	int	                use = 0;
++    unsigned long long  rsync64_sum = 0;
++    int first_block = 1;
++
++    memset(buf, 0, sizeof(buf));
++
++    if ((infile = fopen(filename, "rb")) == NULL) {
++#ifdef	USE_LIBSCHILY
++		comerr("cannot open '%s'\n", filename);
++#else
++#ifndef	HAVE_STRERROR
++		fprintf(stderr, "cannot open '%s': (%d)\n",
++				filename, errno);
++#else
++		fprintf(stderr, "cannot open '%s': %s\n",
++				filename, strerror(errno));
++#endif
++		exit(1);
++#endif
++	}
++
++    while (remain > 0)
++    {
++        use = remain;
++        if (remain > sizeof(buf))
++            use = sizeof(buf);
++		if (fread(buf, 1, use, infile) == 0)
++        {
++#ifdef	USE_LIBSCHILY
++			comerr("cannot read from '%s'\n", filename);
++#else
++			fprintf(stderr, "cannot read from '%s'\n", filename);
++			exit(1);
++#endif
++		}
++        if (first_block)
++            rsync64_sum = rsync64(buf, MIN_JIGDO_FILE_SIZE);
++        mk_MD5Update(&iso_context, buf, use);
++        remain -= use;
++        first_block = 0;
++    }
++
++    fclose(infile);
++    
++    /* Update the image checksum with any necessary padding data */
++    if (size % sector_size)
++    {
++        int pad_size = sector_size - (size % sector_size);
++        memset(buf, 0, pad_size);
++        mk_MD5Update(&iso_context, buf, pad_size);
++    }
++
++    add_file_entry(mirror_name, size, &md5[0], rsync64_sum);
++    if (size % sector_size)
++    {
++        int pad_size = sector_size - (size % sector_size);
++        write_compressed_chunk(buf, pad_size);
++        add_unmatched_entry(pad_size);
++    }        
++}
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/jte.h cdrtools-2.0+a34.debian/mkisofs.steve/jte.h
+--- cdrtools-2.0+a34.debian/mkisofs/jte.h	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/jte.h	2004-09-02 14:17:41.000000000 +0100
+@@ -0,0 +1,18 @@
++extern char *jtemplate_out;
++extern char *jjigdo_out;
++extern char *jmd5_list;
++extern FILE	*jthelper;
++extern FILE *jtjigdo;
++extern FILE *jttemplate;
++extern int  jte_min_size;
++
++extern void write_jt_header(FILE *template_file, FILE *jigdo_file);
++extern void write_jt_footer(void);
++extern void jtwrite(void *buffer, int size, int count, int submode, BOOL islast);
++extern void write_jt_match_record(char *filename, char *mirror_name, int sector_size, off_t size, unsigned char md5[16]);
++extern int  list_file_in_jigdo(char *filename, off_t size, char **realname, unsigned char md5[16]);
++extern int  jte_add_exclude(char *pattern);
++extern int  jte_add_include(char *pattern);
++extern int  jte_add_mapping(char *arg);
++
++#define MIN_JIGDO_FILE_SIZE 1024
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/md5.c cdrtools-2.0+a34.debian/mkisofs.steve/md5.c
+--- cdrtools-2.0+a34.debian/mkisofs/md5.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/md5.c	2004-08-27 14:50:03.000000000 +0100
+@@ -0,0 +1,403 @@
++/*
++ * This code implements the MD5 message-digest algorithm.
++ * The algorithm is due to Ron Rivest.  This code was
++ * written by Colin Plumb in 1993, no copyright is claimed.
++ * This code is in the public domain; do with it what you wish.
++ *
++ * Equivalent code is available from RSA Data Security, Inc.
++ * This code has been tested against that, and is equivalent,
++ * except that you don't need to include two pages of legalese
++ * with every copy.
++ *
++ * To compute the message digest of a chunk of bytes, declare an
++ * MD5Context structure, pass it to MD5Init, call MD5Update as
++ * needed on buffers full of bytes, and then call MD5Final, which
++ * will fill a supplied 16-byte array with the digest.
++ */
++
++/* This code was modified in 1997 by Jim Kingdon of Cyclic Software to
++   not require an integer type which is exactly 32 bits.  This work
++   draws on the changes for the same purpose by Tatu Ylonen
++   <ylo@cs.hut.fi> as part of SSH, but since I didn't actually use
++   that code, there is no copyright issue.  I hereby disclaim
++   copyright in any changes I have made; this code remains in the
++   public domain.  */
++
++/* Note regarding cvs_* namespace: this avoids potential conflicts
++   with libraries such as some versions of Kerberos.  No particular
++   need to worry about whether the system supplies an MD5 library, as
++   this file is only about 3k of object code.  */
++
++/* Steve McIntyre, 2004/05/31: borrowed this code from the CVS
++   library. s/cvs_/mk_/ across the source */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <string.h>	/* for memcpy() and memset() */
++#include <stdio.h>
++#include <errno.h>
++#include <stdlib.h>
++
++#include "md5.h"
++
++/* Little-endian byte-swapping routines.  Note that these do not
++   depend on the size of datatypes such as mk_uint32, nor do they require
++   us to detect the endianness of the machine we are running on.  It
++   is possible they should be macros for speed, but I would be
++   surprised if they were a performance bottleneck for MD5.  */
++
++static mk_uint32
++getu32 (addr)
++     const unsigned char *addr;
++{
++	return (((((unsigned long)addr[3] << 8) | addr[2]) << 8)
++		| addr[1]) << 8 | addr[0];
++}
++
++static void
++putu32 (data, addr)
++     mk_uint32 data;
++     unsigned char *addr;
++{
++	addr[0] = (unsigned char)data;
++	addr[1] = (unsigned char)(data >> 8);
++	addr[2] = (unsigned char)(data >> 16);
++	addr[3] = (unsigned char)(data >> 24);
++}
++
++/*
++ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
++ * initialization constants.
++ */
++void
++mk_MD5Init (ctx)
++     struct mk_MD5Context *ctx;
++{
++	ctx->buf[0] = 0x67452301;
++	ctx->buf[1] = 0xefcdab89;
++	ctx->buf[2] = 0x98badcfe;
++	ctx->buf[3] = 0x10325476;
++
++	ctx->bits[0] = 0;
++	ctx->bits[1] = 0;
++}
++
++/*
++ * Update context to reflect the concatenation of another buffer full
++ * of bytes.
++ */
++void
++mk_MD5Update (ctx, buf, len)
++     struct mk_MD5Context *ctx;
++     unsigned char const *buf;
++     unsigned len;
++{
++	mk_uint32 t;
++
++	/* Update bitcount */
++
++	t = ctx->bits[0];
++	if ((ctx->bits[0] = (t + ((mk_uint32)len << 3)) & 0xffffffff) < t)
++		ctx->bits[1]++;	/* Carry from low to high */
++	ctx->bits[1] += len >> 29;
++
++	t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */
++
++	/* Handle any leading odd-sized chunks */
++
++	if ( t ) {
++		unsigned char *p = ctx->in + t;
++
++		t = 64-t;
++		if (len < t) {
++			memcpy(p, buf, len);
++			return;
++		}
++		memcpy(p, buf, t);
++		mk_MD5Transform (ctx->buf, ctx->in);
++		buf += t;
++		len -= t;
++	}
++
++	/* Process data in 64-byte chunks */
++
++	while (len >= 64) {
++		memcpy(ctx->in, buf, 64);
++		mk_MD5Transform (ctx->buf, ctx->in);
++		buf += 64;
++		len -= 64;
++	}
++
++	/* Handle any remaining bytes of data. */
++
++	memcpy(ctx->in, buf, len);
++}
++
++/*
++ * Final wrapup - pad to 64-byte boundary with the bit pattern 
++ * 1 0* (64-bit count of bits processed, MSB-first)
++ */
++void
++mk_MD5Final (digest, ctx)
++     unsigned char digest[16];
++     struct mk_MD5Context *ctx;
++{
++	unsigned count;
++	unsigned char *p;
++
++	/* Compute number of bytes mod 64 */
++	count = (ctx->bits[0] >> 3) & 0x3F;
++
++	/* Set the first char of padding to 0x80.  This is safe since there is
++	   always at least one byte free */
++	p = ctx->in + count;
++	*p++ = 0x80;
++
++	/* Bytes of padding needed to make 64 bytes */
++	count = 64 - 1 - count;
++
++	/* Pad out to 56 mod 64 */
++	if (count < 8) {
++		/* Two lots of padding:  Pad the first block to 64 bytes */
++		memset(p, 0, count);
++		mk_MD5Transform (ctx->buf, ctx->in);
++
++		/* Now fill the next block with 56 bytes */
++		memset(ctx->in, 0, 56);
++	} else {
++		/* Pad block to 56 bytes */
++		memset(p, 0, count-8);
++	}
++
++	/* Append length in bits and transform */
++	putu32(ctx->bits[0], ctx->in + 56);
++	putu32(ctx->bits[1], ctx->in + 60);
++
++	mk_MD5Transform (ctx->buf, ctx->in);
++	putu32(ctx->buf[0], digest);
++	putu32(ctx->buf[1], digest + 4);
++	putu32(ctx->buf[2], digest + 8);
++	putu32(ctx->buf[3], digest + 12);
++	memset(ctx, 0, sizeof(ctx));	/* In case it's sensitive */
++}
++
++#ifndef ASM_MD5
++
++/* The four core functions - F1 is optimized somewhat */
++
++/* #define F1(x, y, z) (x & y | ~x & z) */
++#define F1(x, y, z) (z ^ (x & (y ^ z)))
++#define F2(x, y, z) F1(z, x, y)
++#define F3(x, y, z) (x ^ y ^ z)
++#define F4(x, y, z) (y ^ (x | ~z))
++
++/* This is the central step in the MD5 algorithm. */
++#define MD5STEP(f, w, x, y, z, data, s) \
++	( w += f(x, y, z) + data, w &= 0xffffffff, w = w<<s | w>>(32-s), w += x )
++
++/*
++ * The core of the MD5 algorithm, this alters an existing MD5 hash to
++ * reflect the addition of 16 longwords of new data.  MD5Update blocks
++ * the data and converts bytes into longwords for this routine.
++ */
++void
++mk_MD5Transform (buf, inraw)
++     mk_uint32 buf[4];
++     const unsigned char inraw[64];
++{
++	register mk_uint32 a, b, c, d;
++	mk_uint32 in[16];
++	int i;
++
++	for (i = 0; i < 16; ++i)
++		in[i] = getu32 (inraw + 4 * i);
++
++	a = buf[0];
++	b = buf[1];
++	c = buf[2];
++	d = buf[3];
++
++	MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478,  7);
++	MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12);
++	MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17);
++	MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22);
++	MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf,  7);
++	MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12);
++	MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17);
++	MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22);
++	MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8,  7);
++	MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12);
++	MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17);
++	MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22);
++	MD5STEP(F1, a, b, c, d, in[12]+0x6b901122,  7);
++	MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12);
++	MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17);
++	MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22);
++
++	MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562,  5);
++	MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340,  9);
++	MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14);
++	MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20);
++	MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d,  5);
++	MD5STEP(F2, d, a, b, c, in[10]+0x02441453,  9);
++	MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14);
++	MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20);
++	MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6,  5);
++	MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6,  9);
++	MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14);
++	MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20);
++	MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905,  5);
++	MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8,  9);
++	MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14);
++	MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20);
++
++	MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942,  4);
++	MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11);
++	MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16);
++	MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23);
++	MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44,  4);
++	MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11);
++	MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16);
++	MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23);
++	MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6,  4);
++	MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11);
++	MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16);
++	MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23);
++	MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039,  4);
++	MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11);
++	MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16);
++	MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23);
++
++	MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244,  6);
++	MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10);
++	MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15);
++	MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21);
++	MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3,  6);
++	MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10);
++	MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15);
++	MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21);
++	MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f,  6);
++	MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10);
++	MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15);
++	MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21);
++	MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82,  6);
++	MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10);
++	MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15);
++	MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21);
++
++	buf[0] += a;
++	buf[1] += b;
++	buf[2] += c;
++	buf[3] += d;
++}
++#endif
++
++/* Read in a hex-dumped MD5 sum and parse it */
++int mk_MD5Parse(unsigned char in[33], unsigned char out[16])
++{
++    int i = 0;
++
++    for (i = 0; i < 16; i++)
++    {
++        if (in[2*i] >= '0' && in[2*i] <= '9')
++            in[2*i] -= '0';
++        else if (in[2*i] >= 'A' && in[2*i] <= 'F')
++            in[2*i] += 10 - 'A';
++        else if (in[2*i] >= 'a' && in[2*i] <= 'f')
++            in[2*i] += 10 - 'a';
++        else
++            return 1;
++        if (in[1+(2*i)] >= '0' && in[1+(2*i)] <= '9')
++            in[1+(2*i)] -= '0';
++        else if (in[1+(2*i)] >= 'A' && in[1+(2*i)] <= 'F')
++            in[1+(2*i)] += 10 - 'A';
++        else if (in[1+(2*i)] >= 'a' && in[1+(2*i)] <= 'f')
++            in[1+(2*i)] += 10 - 'a';
++        else
++            return 1;
++        out[i] = in[2*i] << 4 | in[1+(2*i)];
++    }
++    return 0;
++}
++
++/* Calculate the MD5sum of the specified file */
++int calculate_md5sum(char *filename, unsigned long long size, unsigned char out[16])
++{
++	char		buffer[32768];
++    int i = 0;
++    FILE *infile = NULL;
++    unsigned long long remain = 0;
++    int	        use;
++    struct mk_MD5Context file_context;
++
++    /* Start MD5 work for the file */
++    mk_MD5Init(&file_context);
++
++    infile = fopen(filename, "rb");
++    if (!infile)
++    {
++#ifndef	HAVE_STRERROR
++		fprintf(stderr, "cannot open '%s': (%d)\n",
++				filename, errno);
++#else
++		fprintf(stderr, "cannot open '%s': %s\n",
++				filename, strerror(errno));
++#endif
++		exit(1);
++	}
++
++    remain = size;
++    while (remain > 0)
++    {
++        use = (remain > sizeof(buffer) ? sizeof(buffer) : remain);
++		if (fread(buffer, 1, use, infile) == 0)
++        {
++			fprintf(stderr, "cannot read from '%s'\n", filename);
++			exit(1);
++		}
++        /* Update the checksum */
++        mk_MD5Update(&file_context, buffer, use);
++        remain -= use;
++    }
++    fclose(infile);
++    mk_MD5Final(&out[0], &file_context);
++
++    return 0;
++}
++
++
++#ifdef TEST
++/* Simple test program.  Can use it to manually run the tests from
++   RFC1321 for example.  */
++#include <stdio.h>
++
++int
++main (int argc, char **argv)
++{
++	struct mk_MD5Context context;
++	unsigned char checksum[16];
++	int i;
++	int j;
++
++	if (argc < 2)
++	{
++		fprintf (stderr, "usage: %s string-to-hash\n", argv[0]);
++		exit (1);
++	}
++	for (j = 1; j < argc; ++j)
++	{
++		printf ("MD5 (\"%s\") = ", argv[j]);
++		mk_MD5Init (&context);
++		mk_MD5Update (&context, argv[j], strlen (argv[j]));
++		mk_MD5Final (checksum, &context);
++		for (i = 0; i < 16; i++)
++		{
++			printf ("%02x", (unsigned int) checksum[i]);
++		}
++		printf ("\n");
++	}
++	return 0;
++}
++#endif /* TEST */
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/md5.h cdrtools-2.0+a34.debian/mkisofs.steve/md5.h
+--- cdrtools-2.0+a34.debian/mkisofs/md5.h	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/md5.h	2004-08-27 14:48:23.000000000 +0100
+@@ -0,0 +1,29 @@
++/* See md5.c for explanation and copyright information.  */
++
++#ifndef MD5_H
++#define MD5_H
++
++/* Unlike previous versions of this code, uint32 need not be exactly
++   32 bits, merely 32 bits or more.  Choosing a data type which is 32
++   bits instead of 64 is not important; speed is considerably more
++   important.  ANSI guarantees that "unsigned long" will be big enough,
++   and always using it seems to have few disadvantages.  */
++typedef unsigned long mk_uint32;
++
++struct mk_MD5Context {
++	mk_uint32 buf[4];
++	mk_uint32 bits[2];
++	unsigned char in[64];
++};
++
++void mk_MD5Init (struct mk_MD5Context *context);
++void mk_MD5Update (struct mk_MD5Context *context,
++			   unsigned char const *buf, unsigned len);
++void mk_MD5Final (unsigned char digest[16],
++			  struct mk_MD5Context *context);
++void mk_MD5Transform (mk_uint32 buf[4], const unsigned char in[64]);
++int mk_MD5Parse(unsigned char in[33], unsigned char out[16]);
++int calculate_md5sum(char *filename, unsigned long long size, unsigned char out[16]);
++
++
++#endif /* !MD5_H */
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/mkisofs.8 cdrtools-2.0+a34.debian/mkisofs.steve/mkisofs.8
+--- cdrtools-2.0+a34.debian/mkisofs/mkisofs.8	2004-07-17 21:42:14.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/mkisofs.8	2004-09-05 18:06:58.000000000 +0100
+@@ -254,6 +254,120 @@
+ cannot detect hardlinks anymore and the resulting CD image may be larger
+ than expected.
+ .TP
++.BI \-alpha\-boot " alpha_boot_image
++Specifies the path and filename of the boot image to be used when
++making an Alpha/SRM bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs.
++.TP
++.BI \-hppa\-bootloader " hppa_bootloader_image
++Specifies the path and filename of the boot image to be used when
++making an HPPA bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs.
++Other options are required, at the very least a kernel file name and
++the boot command line. See the
++.B HPPA NOTES
++section below for more information.
++.TP
++.BI \-hppa\-cmdline " hppa_boot_command_line
++Specifies the command line to be passed to the hppa boot loader when
++making a bootable CD. Separate the parameters with spaces or
++commas. More options must be passed to
++.B mkisofs,
++at the very least a kernel file name and the boot loader file
++name. See the
++.B HPPA NOTES
++section below for more information.
++.TP
++.BI \-hppa\-kernel\-32 " hppa_kernel_32
++Specifies the path and filename of the 32-bit kernel image to be used
++when making an HPPA bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs.
++Other options are required, at the very least the boot loader file
++name and the boot command line. See the
++.B HPPA NOTES
++section below for more information.
++.TP
++.BI \-hppa\-kernel\-64 " hppa_kernel_64
++Specifies the path and filename of the 64-bit kernel image to be used
++when making an HPPA bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs.
++Other options are required, at the very least the boot loader file
++name and the boot command line. See the
++.B HPPA NOTES
++section below for more information.
++.TP
++.BI \-hppa\-ramdisk " hppa_ramdisk_image
++Specifies the path and filename of the ramdisk image to be used when
++making an HPPA bootable CD. The pathname must be relative to the
++source path specified to
++.B mkisofs.
++This parameter is
++.B optional.
++Other options are required, at the very
++least a kernel file name and the boot command line. See the
++.B HPPA NOTES
++section below for more information.
++.TP
++.BI \-mips\-boot " mips_boot_image
++Specifies the path and filename of the boot image to be used when
++making an SGI/big-endian MIPS bootable CD. The pathname must be
++relative to the source path specified to
++.B mkisofs.
++This option may be specified several times to allow the addition of
++multiple boot images, up to a maximum of 15.
++.TP
++.BI \-mipsel\-boot " mipsel_boot_image
++Specifies the path and filename of the boot image to be used when
++making an DEC/little-endian MIPS bootable CD. The pathname must be
++relative to the source path specified to
++.B mkisofs.
++.TP
++.BI \-sparc\-boot " img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e
++Specifies a comma separated list of boot images that are needed to make
++a bootable CD for sparc systems.
++Partition 0 is used for the ISO-9660 image, the first image file is mapped
++to partition 1.
++There may be empty fields in the comma separated list.
++The maximum number of possible partitions is 8 so it is impossible to specify
++more than 7 partition images.
++This option is required to make a bootable CD for Sun sparc systems.
++If the
++.B \-B
++or
++.B \-sparc\-boot
++option has been specified, the first sector of the resulting image will
++contain a Sun disk label. This disk label specifies slice 0 for the
++iso9660 image and slice 1 .\|.\|. slice 7 for the boot images that
++have been specified with this option. Byte offset 512 .\|.\|. 8191
++within each of the additional boot images must contain a primary boot
++that works for the appropriate sparc architecture. The rest of each
++of the images usually contains an ufs filesystem that is used primary
++kernel boot stage.
++.sp
++The implemented boot method is the boot method found with SunOS 4.x and SunOS 5.x.
++However, it does not depend on SunOS internals but only on properties of
++the Open Boot prom. For this reason, it should be usable for any OS
++that boots off a sparc system.
++.sp
++For more information also see the 
++.B NOTES
++section below.
++.sp
++If the special filename
++.B "..."
++is used, the actual and all following boot partitions are mapped to the
++previous partition. If
++.B mkisofs
++is called with
++.BI "\-G " image " \-B " ...
++all boot partitions are mapped to the partition that contains the iso9660
++filesystem image and the generic boot image that is located in the first
++16 sectors of the disk is used for all architectures.
++.TP
+ .BI \-b " eltorito_boot_image
+ Specifies the path and filename of the boot image to be used when making
+ an "El Torito" bootable CD. The pathname must be relative to the source
+@@ -702,6 +816,46 @@
+ instead.
+ This option will get POSIX.1-2001 semantics with mkisofs-2.02.
+ .TP
++.BI \-jigdo\-jigdo " jigdo_file
++Produce a jigdo .jigdo file as well as the .iso. See the
++.B JIGDO NOTES
++section below for more information.
++.TP
++.BI \-jigdo\-template " template_file
++Produce a jigdo .template file as well as the .iso. See the
++.B JIGDO NOTES
++section below for more information.
++.TP
++.BI \-jigdo\-min\-file\-size " size
++Specify the minimum size for a file to be listed in the .jigdo
++file. Default (and minimum allowed) is 1KB. See the
++.B JIGDO NOTES
++section below for more information.
++.TP
++.BI \-jigdo\-force\-md5 " path
++Specify a file pattern where files MUST be contained in the
++externally-suplied MD5 list as supplied by \-md5\-list. See the
++.B JIGDO NOTES
++section below for more information.
++.TP
++.BI \-jigdo\-exclude " path
++Specify a file pattern where files will not be listed in the .jigdo
++file. See the
++.B JIGDO NOTES
++section below for more information.
++.TP
++.BI \-jigdo\-map " path
++Specify a pattern mapping for the jigdo file
++(e.g. Debian=/mirror/debian). See the
++.B JIGDO NOTES
++section below for more information.
++.TP
++.BI \-md5\-list " md5_file
++Specify a file containing the MD5sums, sizes and pathnames of the
++files to be included in the .jigdo file. See the
++.B JIGDO NOTES
++section below for more information.
++.TP
+ .BI \-log\-file " log_file
+ Redirect all error, warning and informational messages to
+ .I log_file
+@@ -2302,6 +2456,57 @@
+ The 32-bit checksum is the sum of all the 32-bit words in the boot
+ file starting at byte offset 64.  All linear block addresses (LBAs)
+ are given in CD sectors (normally 2048 bytes).
++.SH "HPPA NOTES"
++To make a bootable CD for HPPA, at the very least a boot loader file (
++.B \-hppa\-bootloader
++), a kernel image file (32- or 64-bit or both, depending on hardware)
++and a boot command line (
++.B \-hppa\-cmdline
++) must be specified. Some systems can boot either a 32- or a 64-bit
++kernel, and the choice of which one to use will be made by the
++firmware. Optionally, a ramdisk can be used for the root filesystem
++using
++.B \-hppa\-cmdline.
++.SH "JIGDO NOTES"
++Jigdo is a useful tool to help in the distribution of large files like CD and
++DVD images. See Richard Atterer's site for more details. Debian CDs and DVD ISO
++images are published on the web in jigdo format to allow end users to download
++them more efficiently.
++.PP
++To create jigdo and template files alongside the ISO image from
++mkisofs, you must first generate a list of the files that will be
++used, in the following format:
++.sp
++.RS +.2i
++.ta 2.0i 2.0i 5.0i
++.nf
++MD5sum   File size  Path
++32 chars 12 chars   to end of line
++.fi
++.RE
++.sp
++The MD5sum should be written in jigdo's pseudo-base64 format. The file
++size should be in decimal, and the path to the file must be absolute.
++.PP
++Once you have this file, call mkisofs with all of your normal command
++line parameters. Specify the output filenames for the jigdo and
++template files using \-jigdo\-jigdo and \-jigdo\-template, and pass in
++the location of your MD5 list with the \-md5\-list option.
++.PP
++If there are files that you do NOT want to be added into the jigdo
++file (e.g. if they are likely to change often), specify them using
++\-jigdo\-ignore. If you want to verify some of the files as they are
++written into the image, specify them using \-jigdo\-force\-md5. If any
++files don't match, mkisofs will then abort. Both of these options take
++regular expressions as input. It is possible to restrict the set of
++files that will be used further based on size - use the
++\-jigdo\-min\-file\-size option.
++.PP
++Finally, the jigdo code needs to know how to map the files it is given
++onto a mirror-style configuration. Specify how to map paths using the
++\-jigdo\-map option. Using "Debian=/mirror/debian" will cause all
++paths starting with "/mirror/debian" to be mapped to "Debian:<file>"
++in the output jigdo file.
+ .SH CONFIGURATION
+ .B mkisofs
+ looks for the
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/mkisofs.c cdrtools-2.0+a34.debian/mkisofs.steve/mkisofs.c
+--- cdrtools-2.0+a34.debian/mkisofs/mkisofs.c	2004-09-29 23:54:31.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/mkisofs.c	2004-09-30 00:05:40.000000000 +0100
+@@ -100,7 +100,11 @@
+ int	load_addr = 0;
+ int	load_size = 0;
+ int	boot_info_table = 0;
++int use_alphaboot = 0;
+ int	use_sparcboot = 0;
++int use_hppaboot = 0;
++int use_mipsboot = 0;
++int use_mipselboot = 0;
+ int	use_sunx86boot = 0;
+ int	use_genboot = 0;
+ int	use_RockRidge = 0;
+@@ -376,6 +380,28 @@
+ #define	OPTION_ALLOW_LEADING_DOTS	1070
+ #define	OPTION_PUBLISHER		1071
+ 
++#ifdef JIGDO_TEMPLATE
++#define OPTION_JTT_OUTPUT       1101
++#define OPTION_JTJ_OUTPUT       1102
++#define OPTION_JT_MIN_SIZE      1103
++#define OPTION_JT_PATH_MAP      1104
++#define OPTION_JT_MD5_LIST      1105
++#define OPTION_JT_INCLUDE       1106
++#define OPTION_JT_EXCLUDE       1107
++#endif
++
++#define	OPTION_BOOTALPHA	    1200
++
++#define	OPTION_HPPA_CMDLINE 	1210
++#define OPTION_HPPA_KERNEL_32   1211
++#define OPTION_HPPA_KERNEL_64   1212
++#define OPTION_HPPA_BOOTLOADER  1213
++#define OPTION_HPPA_RAMDISK     1214
++
++#define	OPTION_BOOTMIPS     	1220
++
++#define	OPTION_BOOTMIPSEL   	1230
++
+ #ifdef UDF
+ #define	OPTION_UDF			1500
+ #endif
+@@ -602,6 +628,43 @@
+ 	{{"sectype", required_argument, NULL, 's'},
+ 	's', "TYPE", "Set output sector type to e.g. data/xa1/raw", ONE_DASH},
+ 
++	{{"alpha-boot", required_argument, NULL, OPTION_BOOTALPHA},
++	'\0', "FILE", "Set alpha boot image name (relative to image root)", ONE_DASH},
++
++	{{"hppa-cmdline", required_argument, NULL, OPTION_HPPA_CMDLINE},
++	'\0', "CMDLINE", "Set hppa boot command line (relative to image root)", ONE_DASH},
++	{{"hppa-kernel-32", required_argument, NULL, OPTION_HPPA_KERNEL_32},
++	'\0', "FILE", "Set hppa 32-bit image name (relative to image root)", ONE_DASH},
++	{{"hppa-kernel-64", required_argument, NULL, OPTION_HPPA_KERNEL_64},
++	'\0', "FILE", "Set hppa 64-bit image name (relative to image root)", ONE_DASH},
++	{{"hppa-bootloader", required_argument, NULL, OPTION_HPPA_BOOTLOADER},
++	'\0', "FILE", "Set hppa boot loader file name (relative to image root)", ONE_DASH},
++	{{"hppa-ramdisk", required_argument, NULL, OPTION_HPPA_RAMDISK},
++	'\0', "FILE", "Set hppa ramdisk file name (relative to image root)", ONE_DASH},
++
++	{{"mips-boot", required_argument, NULL, OPTION_BOOTMIPS},
++	'\0', "FILE", "Set mips boot image name (relative to image root)", ONE_DASH},
++
++	{{"mipsel-boot", required_argument, NULL, OPTION_BOOTMIPSEL},
++	'\0', "FILE", "Set mipsel boot image name (relative to image root)", ONE_DASH},
++
++#ifdef JIGDO_TEMPLATE
++    {{"jigdo-jigdo", required_argument, NULL, OPTION_JTJ_OUTPUT},
++     '\0', "FILE", "Produce a jigdo .jigdo file as well as the .iso", ONE_DASH },
++    {{"jigdo-template", required_argument, NULL, OPTION_JTT_OUTPUT},
++     '\0', "FILE", "Produce a jigdo .template file as well as the .iso", ONE_DASH },
++    {{"jigdo-min-file-size", required_argument, NULL, OPTION_JT_MIN_SIZE},
++     '\0', "SIZE", "Minimum size for a file to be listed in the jigdo file", ONE_DASH },
++    {{"jigdo-force-md5", required_argument, NULL, OPTION_JT_INCLUDE},
++     '\0', "PATTERN", "Pattern(s) where files MUST match an externally-supplied MD5sum", ONE_DASH },
++    {{"jigdo-exclude", required_argument, NULL, OPTION_JT_EXCLUDE},
++     '\0', "PATTERN", "Pattern(s) to exclude from the jigdo file", ONE_DASH },
++    {{"jigdo-map", required_argument, NULL, OPTION_JT_PATH_MAP},
++     '\0', "PATTERN1=PATTERN2", "Pattern(s) to map paths (e.g. Debian=/mirror/debian)", ONE_DASH },
++    {{"md5-list", required_argument, NULL, OPTION_JT_MD5_LIST},
++     '\0', "FILE", "File containing MD5 sums of the files that should be checked", ONE_DASH },
++#endif
++
+ #ifdef SORTING
+ 	{ {"sort", required_argument, NULL, OPTION_SORT},
+ 	'\0', "FILE", "Sort file content locations according to rules in FILE", ONE_DASH },
+@@ -970,6 +1033,7 @@
+ 	fprintf(stderr, "\nUse %s -help\n", program_name);
+ 	fprintf(stderr, "to get a list of valid options.\n");
+ 	fprintf(stderr, "This version of mkisofs includes the unofficial iconv-patch\nfrom http://users.utu.fi/jahhein/mkisofs/\nReport errors to cdrtools@packages.debian.org\n");
++	fprintf(stderr, "This version of mkisofs includes the unofficial JTE patch\nfrom http://www.einval.com/~steve/software/JTE/\nReport errors to steve-jte@einval.com\n");
+ 
+ 	exit(excode);
+ }
+@@ -1066,6 +1130,7 @@
+ 		}
+ 	}
+ 	fprintf(stderr, "This version of mkisofs includes the unofficial iconv-patch\nfrom http://users.utu.fi/jahhein/mkisofs/\nReport errors to cdrtools@packages.debian.org\n");
++	fprintf(stderr, "This version of mkisofs includes the unofficial JTE patch\nfrom http://www.einval.com/~steve/software/JTE/\nReport errors to steve-jte@einval.com\n");
+ 	exit(excode);
+ }
+ 
+@@ -1370,6 +1435,61 @@
+ 		case OPTION_OUTPUT_CHARSET:
+ 			ocharset = optarg;
+ 			break;
++#ifdef JIGDO_TEMPLATE
++        case OPTION_JTT_OUTPUT:
++            jtemplate_out = optarg;
++            break;
++        case OPTION_JTJ_OUTPUT:
++            jjigdo_out = optarg;
++            break;
++        case OPTION_JT_MD5_LIST:
++            jmd5_list = optarg;
++            break;
++        case OPTION_JT_MIN_SIZE:
++            jte_min_size = atoi(optarg);
++            if (jte_min_size < MIN_JIGDO_FILE_SIZE)
++            {
++                fprintf(stderr, "Jigdo min size %d too small; using default %d instead\n", jte_min_size, MIN_JIGDO_FILE_SIZE);
++                jte_min_size = MIN_JIGDO_FILE_SIZE;
++            }
++            break;
++        case OPTION_JT_INCLUDE:
++            if (jte_add_include(optarg)) {
++#ifdef	USE_LIBSCHILY
++				comerrno(EX_BAD,
++                         "Failed to build jigdo-include list\n");
++#else
++				fprintf(stderr,
++                        "Failed to build jigdo-include list\n");
++				exit(1);
++#endif
++			}    
++            break;
++        case OPTION_JT_EXCLUDE:
++            if (jte_add_exclude(optarg)) {
++#ifdef	USE_LIBSCHILY
++				comerrno(EX_BAD,
++                         "Failed to build jigdo-exclude list\n");
++#else
++				fprintf(stderr,
++                        "Failed to build jigdo-exclude list\n");
++				exit(1);
++#endif
++			}    
++            break;
++        case OPTION_JT_PATH_MAP:
++            if (jte_add_mapping(optarg)) {
++#ifdef	USE_LIBSCHILY
++				comerrno(EX_BAD,
++                         "Failed to build jigdo mapping list\n");
++#else
++				fprintf(stderr,
++                        "Failed to build jigdo mapping list\n");
++				exit(1);
++#endif
++			}    
++            break;
++#endif /* JIGDO_TEMPLATE */
+ 		case OPTION_NOBAK:
+ 			all_files = 0;
+ 			break;
+@@ -1397,6 +1517,41 @@
+ 			 */
+ 			new_boot_entry();
+ 			break;
++		case OPTION_BOOTALPHA:
++			use_alphaboot++;
++			/* list of pathnames of boot images */
++			add_boot_alpha_filename(optarg);
++			break;
++		case OPTION_HPPA_CMDLINE:
++			use_hppaboot++;
++			add_boot_hppa_cmdline(optarg);
++			break;
++		case OPTION_HPPA_KERNEL_32:
++			use_hppaboot++;
++			add_boot_hppa_kernel_32(optarg);
++			break;
++		case OPTION_HPPA_KERNEL_64:
++			use_hppaboot++;
++			add_boot_hppa_kernel_64(optarg);
++			break;
++		case OPTION_HPPA_BOOTLOADER:
++			use_hppaboot++;
++			add_boot_hppa_bootloader(optarg);
++			break;
++		case OPTION_HPPA_RAMDISK:
++			use_hppaboot++;
++			/* list of pathnames of boot images */
++			add_boot_hppa_ramdisk(optarg);
++			break;
++		case OPTION_BOOTMIPS:
++			use_mipsboot++;
++			/* list of pathnames of boot images */
++			add_boot_mips_filename(optarg);
++			break;
++		case OPTION_BOOTMIPSEL:
++			use_mipselboot++;
++			add_boot_mipsel_filename(optarg);
++			break;
+ 		case 'B':
+ 			if (use_sunx86boot)
+ 				comerrno(EX_BAD,
+@@ -3215,6 +3370,27 @@
+ 			exit(1);
+ #endif
+ 		}
++        if (jtemplate_out || jjigdo_out) {
++            if (!jtemplate_out || !jjigdo_out || !jmd5_list) {
++#ifdef        USE_LIBSCHILY
++                comerr("Bad options - need to specify output names for jigdo and template file, and also the md5-list input file!\n");
++#else
++                fprintf(stderr, "Bad options - need to specify output names for jigdo and template file, and also the md5-list input file!\n");
++                exit(1);
++#endif
++            }
++            jtjigdo = fopen(jjigdo_out, "wb");
++            jttemplate = fopen(jtemplate_out, "wb");
++            if (!jtjigdo || !jttemplate) {
++#ifdef        USE_LIBSCHILY
++                comerr("Unable to open jigdo template image file\n");
++#else
++                fprintf(stderr, "Unable to open jigdo template image file\n");
++                exit(1);
++#endif
++            }
++            write_jt_header(jttemplate, jtjigdo);
++        }
+ 	} else {
+ 		discimage = stdout;
+ 
+@@ -3247,6 +3423,14 @@
+ #endif	/* APPLE_HYB */
+ 	if (use_sparcboot || use_sunx86boot)
+ 		outputlist_insert(&sunlabel_desc);
++    if (use_alphaboot)
++        outputlist_insert(&alphaboot_desc);
++    if (use_hppaboot)
++        outputlist_insert(&hppaboot_desc);
++    if (use_mipsboot)
++        outputlist_insert(&mipsboot_desc);
++    if (use_mipselboot)
++        outputlist_insert(&mipselboot_desc);
+ 	if (use_genboot)
+ 		outputlist_insert(&genboot_desc);
+ 	outputlist_insert(&startpad_desc);
+@@ -3470,6 +3654,14 @@
+ 				last_extent, last_extent_written);
+ 	}
+ 
++    if (jttemplate)
++    {
++        write_jt_footer();
++        fclose(jttemplate);
++    }
++    if (jtjigdo)
++        fclose(jtjigdo);
++    
+ 	if (verbose > 0) {
+ #ifdef HAVE_SBRK
+ 		fprintf(stderr, "Max brk space used %x\n",
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/mkisofs.h cdrtools-2.0+a34.debian/mkisofs.steve/mkisofs.h
+--- cdrtools-2.0+a34.debian/mkisofs/mkisofs.h	2004-08-17 12:59:57.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/mkisofs.h	2004-09-02 13:26:31.000000000 +0100
+@@ -35,6 +35,9 @@
+ #include <standard.h>
+ #include <libport.h>
+ #include "scsi.h"
++#ifdef JIGDO_TEMPLATE
++#include "jte.h"
++#endif
+ 
+ #ifdef	DVD_VIDEO
+ #ifndef	UDF
+@@ -190,6 +193,10 @@
+ extern struct output_fragment strfile_desc;
+ extern struct output_fragment strdir_desc;
+ extern struct output_fragment strpath_desc;
++extern struct output_fragment alphaboot_desc;
++extern struct output_fragment hppaboot_desc;
++extern struct output_fragment mipsboot_desc;
++extern struct output_fragment mipselboot_desc;
+ 
+ #ifdef APPLE_HYB
+ extern struct output_fragment hfs_desc;
+@@ -358,6 +365,7 @@
+ extern int	split_SL_component;
+ extern int	split_SL_field;
+ extern char	*trans_tbl;
++char		*outfile;
+ 
+ #define	JMAX		64	/* maximum Joliet file name length (spec) */
+ #define	JLONGMAX	103	/* out of spec Joliet file name length */
+@@ -455,6 +463,25 @@
+ extern int make_sun_label __PR((void));
+ extern int make_sunx86_label __PR((void));
+ 
++/* boot-alpha.c */
++extern int add_boot_alpha_filename __PR((char *filename));
++
++/* boot-hppa.c */
++extern int add_boot_hppa_cmdline    __PR((char *cmdline));
++extern int add_boot_hppa_kernel_32  __PR((char *filename));
++extern int add_boot_hppa_kernel_64  __PR((char *filename));
++extern int add_boot_hppa_bootloader __PR((char *filename));
++extern int add_boot_hppa_ramdisk    __PR((char *filename));
++
++/* boot-mips.c */
++extern int add_boot_mips_filename __PR((char *filename));
++
++/* boot-mipsel.c */
++extern int add_boot_mipsel_filename  __PR((char *filename));
++
++/* rsync.c */
++extern unsigned long long rsync64   __PR((unsigned char *mem, size_t size));
++
+ /* write.c */
+ extern int get_731 __PR((char *));
+ extern int get_732 __PR((char *));
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/name.c cdrtools-2.0+a34.debian/mkisofs.steve/name.c
+--- cdrtools-2.0+a34.debian/mkisofs/name.c	2004-09-30 00:10:43.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/name.c	2004-09-30 00:11:36.000000000 +0100
+@@ -356,8 +356,7 @@
+ 						c = '_';
+ 					}
+ 				} else if (!allow_lowercase) {
+-					c = islower((unsigned char)c) ?
+-						toupper((unsigned char)c) : c;
++					c = toupper((unsigned char)c);
+ 				}
+ 				if (relaxed_filenames) {
+ 					/*
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/rsync.c cdrtools-2.0+a34.debian/mkisofs.steve/rsync.c
+--- cdrtools-2.0+a34.debian/mkisofs/rsync.c	1970-01-01 01:00:00.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/rsync.c	2004-10-12 01:12:08.000000000 +0100
+@@ -0,0 +1,100 @@
++#include "mkisofs.h"
++#include "utypes.h"
++#include <ctype.h>
++#include <mconfig.h>
++
++/* Borrowed from jigdo; original notice:
++
++   These are purely random, no patterns or anything... (I hope)
++
++   I do not claim copyright for the actual numbers below, you may use them
++   for a re-implementation of the algorithm under a license of your choice.
++   -- Richard Atterer. */
++static UInt32_t charTable[256] = {
++  0x51d65c0f, 0x083cd94b, 0x77f73dd8, 0xa0187d36,
++  0x29803d07, 0x7ea8ac0e, 0xea4c16c9, 0xfc576443,
++  0x6213df29, 0x1c012392, 0xb38946ae, 0x2e20ca31,
++  0xe4dc532f, 0xcb281c47, 0x8508b6a5, 0xb93c210d,
++  0xef02b5f3, 0x66548c74, 0x9ae2deab, 0x3b59f472,
++  0x4e546447, 0x45232d1f, 0x0ac0a4b1, 0x6c4c264b,
++  0x5d24ce84, 0x0f2752cc, 0xa35c7ac7, 0x3e31af51,
++  0x79675a59, 0x581f0e81, 0x49053122, 0x7339c9d8,
++  0xf9833565, 0xa3dbe5b3, 0xcc06eeb9, 0x92d0671c,
++  0x3eb220a7, 0x64864eae, 0xca100872, 0xc50977a1,
++  0xd90378e1, 0x7a36cab9, 0x15c15f4b, 0x8b9ef749,
++  0xcc1432dc, 0x1ec578ed, 0x27e6e092, 0xbb06db8f,
++  0x67f661ac, 0x8dd1a3db, 0x2a0ca16b, 0xb229ab84,
++  0x127a3337, 0x347d846f, 0xe1ea4b50, 0x008dbb91,
++  0x414c1426, 0xd2be76f0, 0x08789a39, 0xb4d93e30,
++  0x61667760, 0x8871bee9, 0xab7da12d, 0xe3c58620,
++  0xe9fdfbbe, 0x64fb04f7, 0x8cc5bbf0, 0xf5272d30,
++  0x8f161b50, 0x11122b05, 0x7695e72e, 0xa1c5d169,
++  0x1bfd0e20, 0xef7e6169, 0xf652d08e, 0xa9d0f139,
++  0x2f70aa04, 0xae2c7d6d, 0xa3cb9241, 0x3ae7d364,
++  0x348788f8, 0xf483b8f1, 0x55a011da, 0x189719dc,
++  0xb0c5d723, 0x8b344e33, 0x300d46eb, 0xd44fe34f,
++  0x1a2016c1, 0x66ce4cd7, 0xa45ea5e3, 0x55cb708a,
++  0xbce430df, 0xb01ae6e0, 0x3551163b, 0x2c5b157a,
++  0x574c4209, 0x430fd0e4, 0x3387e4a5, 0xee1d7451,
++  0xa9635623, 0x873ab89b, 0xb96bc6aa, 0x59898937,
++  0xe646c6e7, 0xb79f8792, 0x3f3235d8, 0xef1b5acf,
++  0xd975b22b, 0x427acce6, 0xe47a2411, 0x75f8c1e8,
++  0xa63f799d, 0x53886ad8, 0x9b2d6d32, 0xea822016,
++  0xcdee2254, 0xd98bcd98, 0x2933a544, 0x961f379f,
++  0x49219792, 0xc61c360f, 0x77cc0c64, 0x7b872046,
++  0xb91c7c12, 0x7577154b, 0x196573be, 0xf788813f,
++  0x41e2e56a, 0xec3cd244, 0x8c7401f1, 0xc2e805fe,
++  0xe8872fbe, 0x9e2faf7d, 0x6766456b, 0x888e2197,
++  0x28535c6d, 0x2ce45f3f, 0x24261d2a, 0xd6faab8b,
++  0x7a7b42b8, 0x15f0f6fa, 0xfe1711df, 0x7e5685a6,
++  0x00930268, 0x74755331, 0x1998912c, 0x7b60498b,
++  0x501a5786, 0x92ace0f6, 0x1d9752fe, 0x5a731add,
++  0x5b3b44fc, 0x473673f9, 0xa42c0321, 0xd82f9f18,
++  0xb4b225da, 0xfc89ece2, 0x072e1130, 0x5772aae3,
++  0x29010857, 0x542c970c, 0x94f67fe5, 0x71209e9b,
++  0xdb97ea39, 0x2689b41b, 0xae815804, 0xfc5e2651,
++  0xd4521674, 0x48ed979a, 0x2f617da3, 0xc350353d,
++  0xc3accd94, 0xbd8d313a, 0xc61a8e77, 0xf34940a4,
++  0x8d2c6b0f, 0x0f0e7225, 0x39e183db, 0xd19ebba9,
++  0x6a0f37b9, 0xd18922f3, 0x106420c5, 0xaa5a640b,
++  0x7cf0d273, 0xcf3238a7, 0x3b33204f, 0x476be7bb,
++  0x09d23bca, 0xbe84b2f7, 0xb7a3bace, 0x2528cee1,
++  0x3dcaa1dd, 0x900ad31a, 0xf21dea6d, 0x9ce51463,
++  0xf1540bba, 0x0fab1bdd, 0x89cfb79a, 0x01a2a6e6,
++  0x6f85d67c, 0xd1669ec4, 0x355db722, 0x00ebd5c4,
++  0x926eb385, 0x69ead869, 0x0da2b122, 0x402779fe,
++  0xdaed92d0, 0x57e9aabb, 0x3df64854, 0xfcc774b5,
++  0x2e1740ed, 0xa615e024, 0xf7bac938, 0x377dfd1a,
++  0xd0559d66, 0x25499be8, 0x2d8f2006, 0xfaa9e486,
++  0x95e980e7, 0x82aeba67, 0x5a7f2561, 0xbc60dff6,
++  0x6c8739a2, 0x7ec59a8b, 0x9998f265, 0xdfe37e5e,
++  0xb47cee1e, 0x4dd8bc9e, 0x35c57e09, 0x07850b63,
++  0x06eadbcb, 0x6c1f2956, 0x01685c2c, 0xf5725eef,
++  0xf13b98b5, 0xaab739c2, 0x200b1da2, 0xa716b98b,
++  0xd9ee3058, 0x76acf20b, 0x2f259e04, 0xed11658b,
++  0x1532b331, 0x0ab43204, 0xf0beb023, 0xb1685483,
++  0x58cbdc4f, 0x079384d3, 0x049b141c, 0xc38184b9,
++  0xaf551d9a, 0x66222560, 0x059deeca, 0x535f99e2
++};
++
++unsigned long long rsync64(unsigned char *mem, size_t size)
++{
++    UInt32_t a = 0;
++    UInt32_t b = 0;
++    unsigned char *limit = mem + size;
++    unsigned long long result = 0;
++
++    while (mem < limit)
++    {
++        a += charTable[*mem++];
++        b += a;
++    }
++
++    a = a & 0xffffffff; // Just in case uint32 can be 64 bits
++    b = b & 0xffffffff;
++
++    result = ((unsigned long long)b << 32) | a;
++
++    return result;
++}
++
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/stream.c cdrtools-2.0+a34.debian/mkisofs.steve/stream.c
+--- cdrtools-2.0+a34.debian/mkisofs/stream.c	2004-03-04 22:56:57.000000000 +0000
++++ cdrtools-2.0+a34.debian/mkisofs.steve/stream.c	2004-08-29 18:53:32.000000000 +0100
+@@ -157,6 +157,7 @@
+ 			break;
+ 		}
+ 		idx += count;
++		jtwrite(buf, count, 1, 0, FALSE);
+ 		xfwrite(buf, count, 1, outfile, 0, FALSE);
+ 	}
+ 
+@@ -164,15 +165,23 @@
+ 	iso_blocks = ISO_BLOCKS(idx);
+ 	memset(buf, 0, SECTOR_SIZE);
+ 	if (SECTOR_SIZE * iso_blocks - idx)
++    {
++		jtwrite(buf, SECTOR_SIZE * iso_blocks - idx, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE * iso_blocks - idx, 1, outfile, 0, FALSE);
++    }
+ 	/*
+ 	 * If we didn't fill the available area, pad to directory block
+ 	 */
+ 	for (count = 0; count < (avail_extent - iso_blocks); count++)
++    {
++		jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE);
+-
++    }
+ 	for (count = 0; count < stream_pad; count++)
++    {
++		jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE);
++    }
+ 
+ 	last_extent_written += avail_extent + stream_pad;
+ 	return (0);
+@@ -201,7 +210,9 @@
+ 	set_723((char *)s_dir.volume_sequence_number, volume_sequence_number);
+ 	s_dir.name_len[0] = 1;
+ 	s_dir.name[0] = 0;
++	jtwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, 0, FALSE);
+ 	xfwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, outfile, 0, FALSE);
++	jtwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, 0, FALSE);
+ 	xfwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, outfile, 0, FALSE);
+ 	memset(&s_dir, 0, sizeof (struct iso_directory_record));
+ 	s_dir.length[0] = 34 + strlen(stream_filename);
+@@ -214,6 +225,8 @@
+ 	set_723((char *)s_dir.volume_sequence_number, volume_sequence_number);
+ 	s_dir.name_len[0] = strlen(stream_filename);
+ 	memcpy(s_dir.name, stream_filename, s_dir.name_len[0]);
++	jtwrite(&s_dir, offsetof(struct iso_directory_record, name[0])
++		+ s_dir.name_len[0], 1, 0, FALSE);
+ 	xfwrite(&s_dir, offsetof(struct iso_directory_record, name[0])
+ 		+ s_dir.name_len[0], 1, outfile, 0, FALSE);
+ 
+@@ -222,6 +235,8 @@
+ 	 * with filename length stream_filename + round up for even lenght count
+ 	 */
+ 	to_write = (s_dir.name_len[0] % 2) ? 0 : 1;
++	jtwrite(buf, SECTOR_SIZE - ((3 * 34) + s_dir.name_len[0]) +
++		to_write, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE - ((3 * 34) + s_dir.name_len[0]) +
+ 		to_write, 1, outfile, 0, FALSE);
+ 	free(buf);
+@@ -236,9 +251,12 @@
+ write_str_path(outfile)
+ 	FILE	*outfile;
+ {
++	jtwrite(l_path, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(l_path, SECTOR_SIZE, 1, outfile, 0, FALSE);
++	last_extent_written++;
++	jtwrite(m_path, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(m_path, SECTOR_SIZE, 1, outfile, 0, FALSE);
+-	last_extent_written += 2;
++	last_extent_written++;
+ 	free(l_path);
+ 	free(m_path);
+ 	path_table_l = NULL;
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/udf.c cdrtools-2.0+a34.debian/mkisofs.steve/udf.c
+--- cdrtools-2.0+a34.debian/mkisofs/udf.c	2004-08-17 12:59:57.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/udf.c	2004-08-17 14:00:45.000000000 +0100
+@@ -1045,6 +1045,7 @@
+ 		1,	/* is_directory */
+ 		directory_link_count(dpnt),
+ 		(dpnt == root) ? 0 : dpnt->self->udf_file_entry_sector);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 
+@@ -1062,6 +1063,7 @@
+ 		1,
+ 		parent->self->udf_file_entry_sector - lba_udf_partition_start,
+ 		(parent == root) ? 0 : parent->self->udf_file_entry_sector);
++	jtwrite(buf, ident_size, 1, 0, FALSE);
+ 	xfwrite(buf, ident_size, 1, outfile, 0, FALSE);
+ 	size_in_bytes = ident_size;
+ 
+@@ -1107,6 +1109,7 @@
+ 			!!(de1->isorec.flags[0] & ISO_DIRECTORY),
+ 			de1->udf_file_entry_sector - lba_udf_partition_start,
+ 			de1->udf_file_entry_sector);
++		jtwrite(buf, ident_size, 1, 0, FALSE);
+ 		xfwrite(buf, ident_size, 1, outfile, 0, FALSE);
+ 		size_in_bytes += ident_size;
+ 	}
+@@ -1114,6 +1117,7 @@
+ 	padded_size_in_bytes = PAD(size_in_bytes, SECTOR_SIZE);
+ 	if (size_in_bytes < padded_size_in_bytes) {
+ 		memset(buf, 0, padded_size_in_bytes - size_in_bytes);
++		jtwrite(buf, padded_size_in_bytes - size_in_bytes, 1, 0, FALSE);
+ 		xfwrite(buf, padded_size_in_bytes - size_in_bytes, 1, outfile, 0, FALSE);
+ 	}
+ 
+@@ -1168,6 +1172,7 @@
+ 					0,	/* is_directory */
+ 					1,	/* link_count */
+ 					de->udf_file_entry_sector);
++				jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 				xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 			}
+ 		}
+@@ -1199,6 +1204,7 @@
+ 	set8(&vsd->structure_version, 1);
+ 	for (i = 0; i < 3; ++i) {
+ 		memcpy(vsd->standard_identifier, identifiers[i], 5);
++		jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 	}
+ 	last_extent_written += 3;
+@@ -1225,30 +1231,37 @@
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_primary_vol_desc(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_impl_use_vol_desc(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_partition_desc(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_logical_vol_desc(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_unallocated_space_desc(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_terminating_desc(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	for (i = 6; i < UDF_MAIN_SEQ_LENGTH; ++i) {
++        jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 		last_extent_written++;
+ 	}
+@@ -1272,6 +1285,7 @@
+ 						last_extent_written++);
+ 	set_terminating_desc(buf+1*SECTOR_SIZE, last_extent_written++);
+ 
++	jtwrite(buf, SECTOR_SIZE, UDF_INTEG_SEQ_LENGTH, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, UDF_INTEG_SEQ_LENGTH, out, 0, FALSE);
+ 	return (0);
+ }
+@@ -1288,6 +1302,7 @@
+ 
+ 	memset(buf, 0, sizeof (buf));
+ 	set_anchor_volume_desc_pointer(buf, last_extent_written++);
++	jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 	return (0);
+ }
+@@ -1309,6 +1324,7 @@
+ 	set_terminating_desc(buf+1*SECTOR_SIZE,
+ 			(last_extent_written++) - lba_udf_partition_start);
+ 
++	jtwrite(buf, SECTOR_SIZE, 2, 0, FALSE);
+ 	xfwrite(buf, SECTOR_SIZE, 2, out, 0, FALSE);
+ 
+ 	return (0);
+@@ -1350,6 +1366,7 @@
+ 	char buf[SECTOR_SIZE];
+ 	memset(buf, 0, sizeof (buf));
+ 	while (last_extent_written < last_extent_to_write) {
++		jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 		++last_extent_written;
+ 	}
+@@ -1395,6 +1412,7 @@
+ 	memset(buf, 0, sizeof (buf));
+ 	while (last_extent_written < last_extent_to_write) {
+ 		set_anchor_volume_desc_pointer(buf, last_extent_written++);
++		jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE);
+ 		xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE);
+ 	}
+ 	return (0);
+diff -uNrBb cdrtools-2.0+a34.debian/mkisofs/write.c cdrtools-2.0+a34.debian/mkisofs.steve/write.c
+--- cdrtools-2.0+a34.debian/mkisofs/write.c	2004-08-17 12:59:56.000000000 +0100
++++ cdrtools-2.0+a34.debian/mkisofs.steve/write.c	2004-08-31 23:58:11.000000000 +0100
+@@ -459,7 +460,9 @@
+ 	FILE		*infile;
+ 	off_t		remain;
+ 	int	use;
+-
++    char *mirror_name;
++    unsigned char md5[16];
++    int include_in_jigdo = list_file_in_jigdo(filename, size, &mirror_name, md5);
+ 
+ 	if ((infile = fopen(filename, "rb")) == NULL) {
+ #ifdef	USE_LIBSCHILY
+@@ -480,6 +483,9 @@
+ #endif	/* APPLE_HYB */
+ 	remain = size;
+ 
++    if (include_in_jigdo)
++        write_jt_match_record(filename, mirror_name, SECTOR_SIZE, size, md5);
++
+ 	while (remain > 0) {
+ 		use = (remain > SECTOR_SIZE * NSECT - 1 ?
+ 				NSECT * SECTOR_SIZE : remain);
+@@ -494,6 +500,9 @@
+ 			exit(1);
+ #endif
+ 		}
++        if (!include_in_jigdo)
++            jtwrite(buffer, use, 1,
++                    XA_SUBH_DATA, remain <= (SECTOR_SIZE * NSECT));
+ 		xfwrite(buffer, use, 1, outfile,
+ 				XA_SUBH_DATA, remain <= (SECTOR_SIZE * NSECT));
+ 		last_extent_written += use / SECTOR_SIZE;
+@@ -546,6 +556,7 @@
+ 				(Llong)dwpnt->size, dwpnt->extent);
+ #endif
+ 		if (dwpnt->table) {
++			jtwrite(dwpnt->table, ISO_ROUND_UP(dwpnt->size), 1, XA_SUBH_DATA, TRUE);
+ 			xfwrite(dwpnt->table, ISO_ROUND_UP(dwpnt->size), 1,
+ 							outfile,
+ 							XA_SUBH_DATA, TRUE);
+@@ -590,9 +601,11 @@
+ 			Uint	i;
+ 
+ 			for (i = 0; i < dwpnt->pad; i++)
++            {
++				jtwrite(blk, SECTOR_SIZE, 1, 0, FALSE);
+ 				xfwrite(blk, SECTOR_SIZE, 1, outfile, 0, FALSE);
+-
+-			last_extent_written += dwpnt->pad;
++                last_extent_written++;
++            }
+ 		}
+ #endif	/* APPLE_HYB || DVD_VIDEO */
+ 
+@@ -804,10 +817,10 @@
+ 	if (dcount < 2) {
+ #ifdef	USE_LIBSCHILY
+ 		errmsgno(EX_BAD,
+-			"Directory size too small (. or .. missing ???)\n");
++			"Directory size too small (. or .. missing !)\n");
+ #else
+ 		fprintf(stderr,
+-			"Directory size too small (. or .. missing ???)\n");
++			"Directory size too small (. or .. missing !)\n");
+ #endif
+ 		sort_goof = 1;
+ 
+@@ -1516,6 +1529,7 @@
+ 			dir_index, dpnt->de_name);
+ #endif
+ 	}
++	jtwrite(directory_buffer, total_size, 1, 0, FALSE);
+ 	xfwrite(directory_buffer, total_size, 1, outfile, 0, FALSE);
+ 	last_extent_written += total_size >> 11;
+ 	free(directory_buffer);
+@@ -1533,6 +1547,7 @@
+ 				ce_index, dpnt->ce_bytes);
+ #endif
+ 		}
++		jtwrite(ce_buffer, ce_size, 1, 0, FALSE);
+ 		xfwrite(ce_buffer, ce_size, 1, outfile, 0, FALSE);
+ 		last_extent_written += ce_size >> 11;
+ 		free(ce_buffer);
+@@ -1767,9 +1782,11 @@
+ 		 * write out padding to round up to HFS allocation block
+ 		 */
+ 		for (i = 0; i < hfs_pad; i++)
++        {
++			jtwrite(buffer, sizeof (buffer), 1, 0, FALSE);
+ 			xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE);
+-
+-		last_extent_written += hfs_pad;
++            last_extent_written++;
++        }
+ 	}
+ #endif	/* APPLE_HYB */
+ 
+@@ -1806,11 +1823,15 @@
+ 	/* write out extents/catalog/dt file */
+ 	if (apple_hyb) {
+ 
++		jtwrite(hce->hfs_ce, HFS_BLOCKSZ, hce->hfs_tot_size, 0, FALSE);
+ 		xfwrite(hce->hfs_ce, HFS_BLOCKSZ, hce->hfs_tot_size, outfile, 0, FALSE);
+ 
+ 		/* round up to a whole CD block */
+ 		if (HFS_ROUND_UP(hce->hfs_tot_size) -
+ 					hce->hfs_tot_size * HFS_BLOCKSZ) {
++			jtwrite(buffer,
++				HFS_ROUND_UP(hce->hfs_tot_size) -
++				hce->hfs_tot_size * HFS_BLOCKSZ, 1, 0, FALSE);
+ 			xfwrite(buffer,
+ 				HFS_ROUND_UP(hce->hfs_tot_size) -
+ 				hce->hfs_tot_size * HFS_BLOCKSZ, 1, outfile, 0, FALSE);
+@@ -1988,6 +2009,7 @@
+ 	}
+ 
+ 	/* if not a bootable cd do it the old way */
++	jtwrite(&vol_desc, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(&vol_desc, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 	return (0);
+@@ -2005,6 +2027,7 @@
+ 	vol_desc.file_structure_version[0] = 2;
+ 
+ 	/* if not a bootable cd do it the old way */
++	jtwrite(&vol_desc, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(&vol_desc, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 	return (0);
+@@ -2027,6 +2050,7 @@
+ 	evol_desc.type[0] = (unsigned char) ISO_VD_END;
+ 	memcpy(evol_desc.id, ISO_STANDARD_ID, sizeof (ISO_STANDARD_ID));
+ 	evol_desc.version[0] = 1;
++	jtwrite(&evol_desc, SECTOR_SIZE, 1, 0, TRUE);
+ 	xfwrite(&evol_desc, SECTOR_SIZE, 1, outfile, 0, TRUE);
+ 	last_extent_written += 1;
+ 	return (0);
+@@ -2082,10 +2106,16 @@
+ 	cp[SECTOR_SIZE - 1] = '\0';
+  	/* Per default: keep privacy. Blackout the version and arguments. */
+ 	if(getenv("ISODEBUG"))
++    {
++        jtwrite(vers, SECTOR_SIZE, 1, 0, TRUE);
+ 		xfwrite(vers, SECTOR_SIZE, 1, outfile, 0, TRUE);
++    }
+ 	else
++    {
++		jtwrite(calloc(SECTOR_SIZE, 1), SECTOR_SIZE, 1, 0, TRUE);
+ 		xfwrite(calloc(SECTOR_SIZE, 1), SECTOR_SIZE, 1, outfile, 0, TRUE);
+-	last_extent_written += 1;
++    }
++	last_extent_written ++;
+ 	return (0);
+ }
+ 
+@@ -2159,9 +2189,12 @@
+ 	FILE	*outfile;
+ {
+ 	/* Next we write the path tables */
++	jtwrite(path_table_l, path_blocks << 11, 1, 0, FALSE);
+ 	xfwrite(path_table_l, path_blocks << 11, 1, outfile, 0, FALSE);
++	last_extent_written += path_blocks;
++	jtwrite(path_table_m, path_blocks << 11, 1, 0, FALSE);
+ 	xfwrite(path_table_m, path_blocks << 11, 1, outfile, 0, FALSE);
+-	last_extent_written += 2 * path_blocks;
++	last_extent_written += path_blocks;
+ 	free(path_table_l);
+ 	free(path_table_m);
+ 	path_table_l = NULL;
+@@ -2173,6 +2206,7 @@
+ exten_write(outfile)
+ 	FILE	*outfile;
+ {
++	jtwrite(extension_record, SECTOR_SIZE, 1, 0, FALSE);
+ 	xfwrite(extension_record, SECTOR_SIZE, 1, outfile, 0, FALSE);
+ 	last_extent_written++;
+ 	return (0);
+@@ -2365,10 +2399,11 @@
+ 	npad = session_start + 16 - last_extent_written;
+ 
+ 	for (i = 0; i < npad; i++) {
++		jtwrite(buffer, sizeof (buffer), 1, 0, FALSE);
+ 		xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE);
++        last_extent_written++;
+ 	}
+ 
+-	last_extent_written += npad;
+ 	return (0);
+ }
+ 
+@@ -2389,10 +2424,11 @@
+ 		npad += 16 - i;
+ 
+ 	for (i = 0; i < npad; i++) {
++		jtwrite(buffer, sizeof (buffer), 1, 0, FALSE);
+ 		xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE);
++        last_extent_written++;
+ 	}
+ 
+-	last_extent_written += npad;
+ 	return (0);
+ }
+ 
+@@ -2406,10 +2442,11 @@
+ 	memset(buffer, 0, sizeof (buffer));
+ 
+ 	for (i = 0; i < 150; i++) {
++		jtwrite(buffer, sizeof (buffer), 1, 0, FALSE);
+ 		xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE);
++        last_extent_written++;
+ 	}
+ 
+-	last_extent_written += 150;
+ 	return (0);
+ }
+ 
+@@ -2765,10 +2802,12 @@
+ 	r = tot_size % HFS_BLK_CONV;
+ 
+ 	/* write out HFS volume header info */
++	jtwrite(hce->hfs_map, HFS_BLOCKSZ, tot_size, 0, FALSE);
+ 	xfwrite(hce->hfs_map, HFS_BLOCKSZ, tot_size, outfile, 0, FALSE);
+ 
+ 	/* fill up to a complete CD block */
+ 	if (r) {
++		jtwrite(buffer, HFS_BLOCKSZ, HFS_BLK_CONV - r, 0, FALSE);
+ 		xfwrite(buffer, HFS_BLOCKSZ, HFS_BLK_CONV - r, outfile, 0, FALSE);
+ 		n++;
+ 	}
--- cdrtools-2.01+01a01.orig/debian/patches/03_script.dpatch
+++ cdrtools-2.01+01a01/debian/patches/03_script.dpatch
@@ -0,0 +1,109 @@
+#! /bin/sh -e
+## 03_script.dpatch by Joerg Jaspert <joerg@debian.org>
+## Original made by Eduard Bloch <blade@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Small patch to the cdda2mp3 script to read a default config.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2mp3 cdrtools-2.0+a14/cdda2wav/cdda2mp3
+--- /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2mp3	2000-06-24 07:47:48.000000000 +0200
++++ cdrtools-2.0+a14/cdda2wav/cdda2mp3	2003-06-04 00:02:36.000000000 +0200
+@@ -14,19 +14,35 @@
+ 
+ # specify the sampling program and its options
+ # do not specify the track option here!
+-CDDA2WAV=cdda2wav
+-CDDA2WAV_OPTS='-H -P0 -q'
++MP_CODER=${MP_CODER:-oggenc}
++MP_OPTIONS=${MP_OPTIONS:-''}
+ 
+ # for normal use, comment out the next line
+ #DEBUG='-d1'
+ 
+ # the post processor is fed through a pipe to avoid space waste
+ # specify the post processing program and its options
+-MP_CODER=lame
+-#MP_OPTIONS=''
++MP_CODER=${MP_CODER:-lame}
++MP_OPTIONS=${MP_OPTIONS:-''}
+ 
+ FILEPREFIX=${1:-audiotrack}
+ 
++if [ "$CDDADEVICE" = "" ]
++then
++  CDDA_DEVICE=/dev/cdrom
++  export CDDA_DEVICE
++fi
++
++$MP_CODER -h >/dev/null 2>&1
++if [ $? != 0 ] ; then
++   echo "Encoder not found. Install one first!"
++   exit 1
++fi
++
++if [ -e /etc/default/cdda2mp3 ]; then
++	. /etc/default/cdda2mp3
++fi
++
+ TRACK=1
+ while :
+ do
+diff -urNad /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2ogg cdrtools-2.0+a14/cdda2wav/cdda2ogg
+--- /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2ogg	2002-04-09 13:18:15.000000000 +0200
++++ cdrtools-2.0+a14/cdda2wav/cdda2ogg	2003-06-04 00:02:33.000000000 +0200
+@@ -14,26 +14,34 @@
+ 
+ # specify the sampling program and its options
+ # do not specify the track option here!
+-CDDA2WAV=cdda2wav
+-CDDA2WAV_OPTS='-H -P0 -q'
++CDDA2WAV=${CDDA2WAV:-cdda2wav}
++CDDA2WAV_OPTS=${CDDA2WAV_OPTS:-'-H -P0 -q'}
+ 
+ # for normal use, comment out the next line
+ #DEBUG='-d1'
+ 
+ # the post processor is fed through a pipe to avoid space waste
+ # specify the post processing program and its options
+-MP_CODER=oggenc
+-MP_OPTIONS=''
++MP_CODER=${MP_CODER:-oggenc}
++MP_OPTIONS=${MP_OPTIONS:-''}
+ 
+-$MP_CODER -h > /dev/null 2> /dev/null
++$MP_CODER -h >/dev/null 2>&1
+ if [ $? != 0 ] ; then
+    echo "Oggenc not found. Install vorbis-tools first!"
+    exit 1
+ fi
+ 
++if [ "$CDDADEVICE" = "" ]
++then
++  CDDA_DEVICE=/dev/cdrom
++  export CDDA_DEVICE
++fi
+ FILEPREFIX=${1:-audiotrack}
+ 
+-. /etc/default/cdda2ogg 2>/dev/null || true
++if [ -e /etc/default/cdda2ogg ]; then
++	. /etc/default/cdda2ogg
++fi
++
+ 
+ TRACK=1
+ while :
--- cdrtools-2.01+01a01.orig/debian/patches/24_debug_tmpfile.dpatch
+++ cdrtools-2.01+01a01/debian/patches/24_debug_tmpfile.dpatch
@@ -0,0 +1,50 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 23_debug_tmpfile.dpatch by  <martin.pitt@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad cdrtools-2.0+a38/rscsi/rscsi.c /tmp/dpep.l2wivh/cdrtools-2.0+a38/rscsi/rscsi.c
+--- cdrtools-2.0+a38/rscsi/rscsi.c	2005-03-24 10:17:28.576747584 +0100
++++ /tmp/dpep.l2wivh/cdrtools-2.0+a38/rscsi/rscsi.c	2005-03-24 10:17:38.950170584 +0100
+@@ -163,8 +163,19 @@
+ 		debug_name = *argv;
+ #endif
+ 
+-	if (debug_name != NULL)
+-		debug_file = fopen(debug_name, "w");
++	if (debug_name != NULL) {
++		/* Try to be careful when opening debug files, might be
++		 * created in an unsafe location 
++		 * */
++		int fd = open(debug_name, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0600);
++		if (fd > -1) 
++			debug_file = fdopen(fd, "w");
++		else {
++			rscsirespond(-1, geterrno());
++			exit(EX_BAD);
++		}
++	}
++
+ 		
+ 	if (argc > 0) {
+ 		if (debug_file == 0) {
+diff -urNad cdrtools-2.0+a38/rscsi/rscsi.dfl /tmp/dpep.l2wivh/cdrtools-2.0+a38/rscsi/rscsi.dfl
+--- cdrtools-2.0+a38/rscsi/rscsi.dfl	2005-03-24 10:17:27.853857480 +0100
++++ /tmp/dpep.l2wivh/cdrtools-2.0+a38/rscsi/rscsi.dfl	2005-03-24 10:17:38.952170280 +0100
+@@ -9,10 +9,11 @@
+ 
+ # 
+ # The file where debug info should go to.
+-# If you don't like debugging (e.g. for speed) comment out
+-# the this line.
++# This is commented out by default to speed up the program.
++# If you enable it make sure you substitute SAFE_DIR to a safe directory
++# to debug to.
+ #
+-#DEBUG=/tmp/RSCSI
++#DEBUG=SAFE_DIR/rscsi.dbg
+ 
+ #
+ # Each USER= entry adds the listed user to the users who may run rscsi
--- cdrtools-2.01+01a01.orig/debian/patches/15_mkisofs_iconv_debianize.dpatch
+++ cdrtools-2.01+01a01/debian/patches/15_mkisofs_iconv_debianize.dpatch
@@ -0,0 +1,65 @@
+#! /bin/sh -e
+##
+## DP: These are the changes to the 14_mkisofs_iconv.dpatch compared to the original
+## DP: mkisofs-iconv-X patch. If you upgrade 14_mkisofs_iconv with the new
+## DP: mkisovs-iconv patch, make sure that this post-patch still works.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -urNad cdrtools-2.01+01a01/mkisofs/mkisofs.c /home/joerg/tmp/dpep.3BFEmc/cdrtools-2.01+01a01/mkisofs/mkisofs.c
+--- cdrtools-2.01+01a01/mkisofs/mkisofs.c	2005-01-08 20:07:40.516001670 +0100
++++ /home/joerg/tmp/dpep.3BFEmc/cdrtools-2.01+01a01/mkisofs/mkisofs.c	2005-01-08 20:09:38.318779363 +0100
+@@ -67,7 +67,7 @@
+ struct directory *root = NULL;
+ int		path_ind;
+ 
+-char	version_string[] = "mkisofs 2.01";
++char	version_string[] = "mkisofs 2.01-unofficial-iconv";
+ 
+ char		*outfile;
+ FILE		*discimage;
+@@ -970,6 +970,7 @@
+ 	fprintf(stderr, "Usage: %s [options] file...\n", program_name);
+ 	fprintf(stderr, "\nUse %s -help\n", program_name);
+ 	fprintf(stderr, "to get a list of valid options.\n");
++	fprintf(stderr, "This version of mkisofs includes the unofficial iconv-patch\nfrom http://users.utu.fi/jahhein/mkisofs/\nReport errors to cdrtools@packages.debian.org\n");
+ 
+ 	exit(excode);
+ }
+@@ -1065,6 +1066,7 @@
+ 			fprintf(stderr, "%s\n", ld_options[i].doc);
+ 		}
+ 	}
++	fprintf(stderr, "This version of mkisofs includes the unofficial iconv-patch\nfrom http://users.utu.fi/jahhein/mkisofs/\nReport errors to cdrtools@packages.debian.org\n");
+ 	exit(excode);
+ }
+ 
+@@ -2407,10 +2409,11 @@
+ 		fprintf(stderr, "Unknown charset\nKnown charsets are:\n");
+ 		list_nls();	/* List all known charset names */
+ #ifdef USE_ICONV
+-		if(!iconv_possible)
+-			fprintf(stderr, "Iconv charsets cannot be used with "
+-				"Apple extension, HFS, ISO9660 version 2 or\n"
+-				"Rock Ridge.\n");
++		fprintf(stderr, "\nAdditional input charsets are available for Joliet through the iconv support."
++				"\nRun \"iconv -l\" to display them. Iconv charsets cannot be used with HFS, Apple"
++				"\nextension, ISO9660 version 2 or Rock Ridge.\n"
++				"\nIMPORTANT: never report problems with charset support directly"
++				"\nto Joerg Schilling! Report them to cdrtools@packages.debian.org first.\n");
+ #endif
+ 		exit(1);
+ 	}
--- cdrtools-2.01+01a01.orig/debian/patches/13_zisofs.191367.dpatch
+++ cdrtools-2.01+01a01/debian/patches/13_zisofs.191367.dpatch
@@ -0,0 +1,38 @@
+#!/bin/sh -e
+## 13_zisofs.191367.dpatch by Andreas Metzler <ametzler@logic.univie.ac.at>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: mkzftree(8) is incorrect - the option s called "--crib-tree" and not
+## DP: --crib-path. Bug #191367
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+                exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /tmp/cdrtools-2.01/zisofs_tools/mkzftree.8 cdrtools-2.01/zisofs_tools/mkzftree.8
+--- /tmp/cdrtools-2.01/zisofs_tools/mkzftree.8	Fri May  9 15:01:45 2003
++++ cdrtools-2.01/zisofs_tools/mkzftree.8	Fri May  9 15:03:02 2003
+@@ -50,7 +50,7 @@
+ Do not cross filesystem boundaries, and do not create directory stubs
+ at mount points.
+ .TP
+-\fB\-C\fP \fIpath\fP, \fB\-\-crib-path\fP \fIpath\fP
++\fB\-C\fP \fIpath\fP, \fB\-\-crib-tree\fP \fIpath\fP
+ Steal ("crib") files from another directory if it looks (based on
+ name, size, type and modification time) like they match entries in the
+ new filesystem.  The "crib tree" is usually the compressed version of
--- cdrtools-2.01+01a01.orig/debian/patches/18_donotopen_hda.dpatch
+++ cdrtools-2.01+01a01/debian/patches/18_donotopen_hda.dpatch
@@ -0,0 +1,41 @@
+#!/bin/sh -e
+## 18_donotopen_hda.dpatch.dpatch by Andreas Metzler <ametzler@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: dev=ATA:1,0,0 uselessly opens /dev/hda, breaking non-root access.
+## DP: See #228215
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+                exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /tmp/cdrtools-2.01/libscg/scsi-linux-sg.c cdrtools-2.01/libscg/scsi-linux-sg.c
+--- /tmp/cdrtools-2.01/libscg/scsi-linux-sg.c	2004-05-20 15:42:12.000000000 +0200
++++ cdrtools-2.01/libscg/scsi-linux-sg.c	2004-06-12 22:08:56.000000000 +0200
+@@ -391,7 +391,10 @@
+ 	 * look silly but there may be users that did boot from a SCSI hdd
+ 	 * and connected 4 CD/DVD writers to both IDE cables in the PC.
+ 	 */
+-	if (use_ata) for (i = 0; i <= 25; i++) {
++/*	if (use_ata) for (i = 0; i <= 25; i++) { */
++/* If a device was specified with ATA:x,y,z try to open this device instead of
++ * uselessly opening all of them until we reach the specified one */
++	if (use_ata) for (i=2*busno+tgt >= 0 ? 2*busno+tgt:0; i <= 25; i++) {
+ 		js_snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
+ 					/* O_NONBLOCK is dangerous */
+ 		f = open(devname, O_RDWR | O_NONBLOCK);
--- cdrtools-2.01+01a01.orig/debian/patches/07_dvdsup.dpatch
+++ cdrtools-2.01+01a01/debian/patches/07_dvdsup.dpatch
@@ -0,0 +1,1643 @@
+#! /bin/sh -e
+## 07_dvdsup.dpatch by warly@mandrakesoft.com
+##
+## DP: DVD Writing support ported from dvdrecord to cdrecord.
+## DP: Author unknown (reverse engineering?)
+## DP: Maintained by warly@mandrakesoft.com
+## DP: http://people.mandrakesoft.com/~warly/files/cdrtools/archives/
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+	*)
+		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+		exit 1;;
+esac
+
+exit 0
+				    
+@DPATCH@
+diff -Nur cdrtools-2.01.foo/cdrecord/cdr_drv.c cdrtools-2.01.foo2/cdrecord/cdr_drv.c
+--- cdrtools-2.01.foo/cdrecord/cdr_drv.c	2004-03-02 02:06:26.000000000 +0100
++++ cdrtools-2.01.foo2/cdrecord/cdr_drv.c	2004-07-21 09:23:00.000000000 +0200
+@@ -42,6 +42,7 @@
+ extern	cdr_t	cdr_oldcd;
+ extern	cdr_t	cdr_cd;
+ extern	cdr_t	cdr_mmc;
++extern  cdr_t   cdr_mdvd;
+ extern	cdr_t	cdr_mmc_sony;
+ extern	cdr_t	cdr_cd_dvd;
+ extern	cdr_t	cdr_philips_cdd521O;
+@@ -80,6 +81,7 @@
+ cdr_t	*drivers[] = {
+ 	&cdr_cd_dvd,
+ 	&cdr_mmc,
++        &cdr_mdvd,
+ 	&cdr_mmc_sony,
+ 	&cdr_cd,
+ 	&cdr_oldcd,
+diff -Nur cdrtools-2.01.foo/cdrecord/cdrecord.c cdrtools-2.01.foo2/cdrecord/cdrecord.c
+--- cdrtools-2.01.foo/cdrecord/cdrecord.c	2004-07-18 00:26:09.000000000 +0200
++++ cdrtools-2.01.foo2/cdrecord/cdrecord.c	2004-07-21 09:23:29.000000000 +0200
+@@ -175,17 +175,18 @@
+ static	long	fs = -1L;	/* fifo (ring buffer) size */
+ 
+ EXPORT	int 	main		__PR((int ac, char **av));
+-LOCAL	int	gracewait	__PR((cdr_t *dp, BOOL *didgracep));
+-LOCAL	void	cdrstats	__PR((cdr_t *dp));
++LOCAL	int	gracewait	__PR((cdr_t *dp, BOOL *didgracep, BOOL is_dvdwr));
++LOCAL	void	cdrstats	__PR((cdr_t *dp, BOOL is_dvdwr));
+ LOCAL	void	susage		__PR((int));
+ LOCAL	void	usage		__PR((int));
+ LOCAL	void	blusage		__PR((int));
++LOCAL	void	formattypeusage	__PR((int));
+ LOCAL	void	intr		__PR((int sig));
+ LOCAL	void	catchsig	__PR((int sig));
+ LOCAL	int	scsi_cb		__PR((void *arg));
+ LOCAL	void	intfifo		__PR((int sig));
+ LOCAL	void	exscsi		__PR((int excode, void *arg));
+-LOCAL	void	excdr		__PR((int excode, void *arg));
++LOCAL	void	excdr		__PR((int excode, void *arg, BOOL is_dvdwr));
+ EXPORT	int	read_buf	__PR((int f, char *bp, int size));
+ EXPORT	int	fill_buf	__PR((int f, track_t *trackp, long secno,
+ 							char *bp, int size));
+@@ -194,7 +195,7 @@
+ EXPORT	int	write_secs	__PR((SCSI *scgp, cdr_t *dp, char *bp,
+ 						long startsec, int bytespt,
+ 						int secspt, BOOL islast));
+-LOCAL	int	write_track_data __PR((SCSI *scgp, cdr_t *, track_t *));
++LOCAL	int	write_track_data __PR((SCSI *scgp, cdr_t *, track_t *, BOOL is_dvdwr));
+ EXPORT	int	pad_track	__PR((SCSI *scgp, cdr_t *dp,
+ 					track_t *trackp,
+ 					long startsec, Llong amt,
+@@ -216,9 +217,9 @@
+ LOCAL	BOOL	checkdsize	__PR((SCSI *scgp, cdr_t *dp,
+ 					long tsize, int flags));
+ LOCAL	void	raise_fdlim	__PR((void));
+-LOCAL	void	gargs		__PR((int, char **, int *, track_t *, char **,
++LOCAL	int	gargs		__PR((int, char **, int *, track_t *, char **,
+ 					int *, cdr_t **,
+-					int *, long *, int *));
++					int *, long *, int *, int *));
+ LOCAL	void	set_trsizes	__PR((cdr_t *, int, track_t *));
+ EXPORT	void	load_media	__PR((SCSI *scgp, cdr_t *, BOOL));
+ EXPORT	void	unload_media	__PR((SCSI *scgp, cdr_t *, int));
+@@ -238,6 +239,7 @@
+ LOCAL	void	wait_input	__PR((void));
+ LOCAL	void	checkgui	__PR((void));
+ LOCAL	int	getbltype	__PR((char *optstr, long *typep));
++LOCAL	int	getformattype	__PR((char *optstr, long *typep));
+ LOCAL	void	print_drflags	__PR((cdr_t *dp));
+ LOCAL	void	print_wrmodes	__PR((cdr_t *dp));
+ LOCAL	BOOL	check_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
+@@ -261,6 +263,7 @@
+ 	int	speed = -1;
+ 	long	flags = 0L;
+ 	int	blanktype = 0;
++	int	formattype = 0;
+ 	int	i;
+ 	int	tracks = 0;
+ 	int	trackno;
+@@ -272,6 +275,9 @@
+ 	SCSI	*scgp = NULL;
+ 	char	errstr[80];
+ 	BOOL	gracedone = FALSE;
++	int     ispacket;
++	BOOL	is_cdwr = FALSE;
++	BOOL	is_dvdwr = FALSE;
+ 
+ #ifdef __EMX__
+ 	/* This gives wildcard expansion with Non-Posix shells with EMX */
+@@ -286,8 +292,8 @@
+ 		track[i].track = track[i].trackno = i;
+ 	track[0].tracktype = TOC_MASK;
+ 	raise_fdlim();
+-	gargs(ac, av, &tracks, track, &dev, &timeout, &dp, &speed, &flags,
+-							&blanktype);
++	ispacket = gargs(ac, av, &tracks, track, &dev, &timeout, &dp, &speed, &flags,
++							&blanktype, &formattype);
+ 	if ((track[0].tracktype & TOC_MASK) == TOC_MASK)
+ 		comerrno(EX_BAD, "Internal error: Bad TOC type.\n");
+ 
+@@ -348,11 +354,15 @@
+ #	define	CLONE_TITLE	""
+ #endif
+ 	if ((flags & F_MSINFO) == 0 || lverbose || flags & F_VERSION) {
+-		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2004 Jörg Schilling\n",
++		printf("Cdrecord%s%s %s-dvd (%s-%s-%s) Copyright (C) 1995-2004 Jörg Schilling\n",
+ 								PRODVD_TITLE,
+ 								CLONE_TITLE,
+ 								cdr_version,
+ 								HOST_CPU, HOST_VENDOR, HOST_OS);
++  		printf("Note: This version is an unofficial (modified) version with DVD support\n");
++                printf("Note: and therefore may have bugs that are not present in the original.\n");
++                printf("Note: Please send bug reports or support requests to <warly@mandrakesoft.com>.\n");           
++                printf("Note: The author of cdrecord should not be bothered with problems in this version.\n");
+ 
+ #if	defined(SOURCE_MODIFIED) || !defined(IS_SCHILY_XCONFIG)
+ #define	INSERT_YOUR_EMAIL_ADDRESS_HERE
+@@ -457,11 +467,17 @@
+ 	 */
+ 	if ((scgp = scg_open(dev, errstr, sizeof (errstr),
+ 				debug, (flags & F_MSINFO) == 0 || lverbose)) == (SCSI *)0) {
++		if (dev != NULL || (flags & F_SCANBUS) == 0 || (scgp = scg_open(
++"ATA", errstr, sizeof (errstr),debug, (flags & F_MSINFO) == 0 || lverbose)) ==
++ (SCSI *)0) {
+ 			errmsg("%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":"");
+ 			errmsgno(EX_BAD, "For possible targets try 'cdrecord -scanbus'.%s\n",
+ 						geteuid() ? " Make sure you are root.":"");
+ 			errmsgno(EX_BAD, "For possible transport specifiers try 'cdrecord dev=help'.\n");
+ 			exit(EX_BAD);
++		} else {
++				dev = "ATA";
++		       }
+ 	}
+ 	/*
+ 	 * XXX Below this point we do not need root privilleges anymore.
+@@ -593,6 +609,17 @@
+ 	} else if (!is_unknown_dev(scgp) && dp != get_cdrcmds(scgp)) {
+ 		errmsgno(EX_BAD, "WARNING: Trying to use other driver on known device.\n");
+ 	}
++        is_mmc(scgp, &is_cdwr, &is_dvdwr);
++        if (ispacket) {
++	    if (is_dvdwr) {
++		track[0].flags |= TI_PACKET; 
++		/*XXX put here to only affect DVD writing, should be in gargs.
++		 * however if set in args for all mode, packet writing is then
++		 * broken for all disc as cdrecord assume that PACKET imply TAO which  
++		 * is not true at all???? */ 
++		track[0].flags &= ~TI_TAO;
++	    }
++	}
+ 
+ 	if (!is_cddrive(scgp))
+ 		comerrno(EX_BAD, "Sorry, no CD/DVD-Drive found on this target.\n");
+@@ -623,8 +650,6 @@
+ 	    tracks > 0 ||
+ 	    cuefilename != NULL) {
+ 
+-		BOOL	is_cdwr = FALSE;
+-		BOOL	is_dvdwr = FALSE;
+ 
+ 		if ((dp->cdr_flags & CDR_ISREADER) != 0) {
+ 			errmsgno(EX_BAD,
+@@ -634,7 +659,7 @@
+ 		if (!is_mmc(scgp, &is_cdwr, &is_dvdwr))
+ 			is_cdwr = TRUE;			/* If it is not MMC, it must be a CD writer */
+ 
+-		if (is_dvdwr && !set_cdrcmds("mmc_dvd", (cdr_t **)NULL)) {
++		if (is_dvdwr && !set_cdrcmds("mmc_mdvd", (cdr_t **)NULL)) {
+ 			errmsgno(EX_BAD,
+ 			"This version of cdrecord does not include DVD-R/DVD-RW support code.\n");
+ 			errmsgno(EX_BAD,
+@@ -937,11 +962,6 @@
+ 		print_toc(scgp, dp);
+ 		comexit(0);
+ 	}
+-	if ((flags & F_FORMAT) != 0) {
+-		errmsgno(EX_BAD, "Format option not implemented in this version.\n");
+-		comexit(EX_BAD);
+-	}
+-
+ #ifdef	XXX
+ 	if ((*dp->cdr_check_session)() < 0) {
+ 		comexit(EX_BAD);
+@@ -1111,7 +1131,7 @@
+ 	if ((flags & (F_BLANK|F_FORCE)) == (F_BLANK|F_FORCE)) {
+ 		printf("Waiting for drive to calm down.\n");
+ 		wait_unit_ready(scgp, 120);
+-		if (gracewait(dp, &gracedone) < 0) {
++		if (gracewait(dp, &gracedone, is_dvdwr) < 0) {
+ 			/*
+ 			 * In case kill() did not work ;-)
+ 			 */
+@@ -1124,7 +1144,7 @@
+ 	/*
+ 	 * Last chance to quit!
+ 	 */
+-	if (gracewait(dp, &gracedone) < 0) {
++	if (gracewait(dp, &gracedone, is_dvdwr) < 0) {
+ 		/*
+ 		 * In case kill() did not work ;-)
+ 		 */
+@@ -1152,7 +1172,39 @@
+ 	if (gettimeofday(&starttime, (struct timezone *)0) < 0)
+ 		errmsg("Cannot get start time\n");
+ 
+-	/*
++	if (flags & F_FORMAT) {
++	    	printf("cdrecord: media format asked\n");
++		/*
++		 * Do not abort if OPC failes. Just give it a chance
++		 * for better laser power calibration than without OPC.
++		 *
++		 * Ricoh drives return with a vendor unique sense code.
++		 * This is most likely because they refuse to do OPC
++		 * on a non blank media.
++		 */
++		scgp->silent++;
++		do_opc(scgp, dp, flags);
++		scgp->silent--;
++		wait_unit_ready(scgp, 120);
++		if (gettimeofday(&starttime, (struct timezone *)0) < 0)
++			errmsg("Cannot get start time\n");
++
++		if ((*dp->cdr_format)(scgp, dp, formattype) < 0) {
++			errmsgno(EX_BAD, "Cannot format disk, aborting.\n");
++			comexit(EX_BAD);
++		}
++		if (gettimeofday(&fixtime, (struct timezone *)0) < 0)
++			errmsg("Cannot get format time\n");
++		if (lverbose)
++			prtimediff("Formatting time: ", &starttime, &fixtime);
++
++		if (!wait_unit_ready(scgp, 240) || tracks == 0) {
++			comexit(0);
++		}
++		if (gettimeofday(&starttime, (struct timezone *)0) < 0)
++			errmsg("Cannot get start time\n");
++	}	
++        /*
+ 	 * Blank the media if we were requested to do so
+ 	 */
+ 	if (flags & F_BLANK) {
+@@ -1209,6 +1261,14 @@
+ 		trackno = 0;
+ 	}
+ 	scgp->silent--;
++	
++	/* If it is DVD, the information in TOC is fabricated :)
++	 The real information is from read disk info command*/
++	if((dp->cdr_dstat->ds_disktype&DT_DVD) && (dp->cdr_dstat->ds_trlast>0)){
++	    trackno=dp->cdr_dstat->ds_trlast-1;
++	    printf("trackno=%d\n",trackno);
++	}
++
+ 	if ((tracks + trackno) > MAX_TRACK) {
+ 		/*
+ 		 * XXX How many tracks are allowed on a DVD?
+@@ -1282,7 +1342,7 @@
+ 						track[i].trackstart);
+ 			flush();
+ 		}
+-		if (write_track_data(scgp, dp, &track[i]) < 0) {
++		if (write_track_data(scgp, dp, &track[i], is_dvdwr) < 0) {
+ 			if (cdr_underrun(scgp)) {
+ 				errmsgno(EX_BAD,
+ 				"The current problem looks like a buffer underrun.\n");
+@@ -1322,7 +1382,7 @@
+ fix_it:
+ 	if (gettimeofday(&stoptime, (struct timezone *)0) < 0)
+ 		errmsg("Cannot get stop time\n");
+-	cdrstats(dp);
++	cdrstats(dp, is_dvdwr);
+ 
+ 	if (flags & F_RAW) {
+ 		if (lverbose) {
+@@ -1378,9 +1438,10 @@
+ }
+ 
+ LOCAL int
+-gracewait(dp, didgracep)
++gracewait(dp, didgracep, is_dvdwr)
+ 	cdr_t	*dp;
+ 	BOOL	*didgracep;
++	BOOL 	is_dvdwr;
+ {
+ 	int	i;
+ 	BOOL	didgrace = FALSE;
+@@ -1393,8 +1454,8 @@
+ 	if (gracetime > 999)
+ 		gracetime = 999;
+ 
+-	printf("Starting to write CD/DVD at speed %d in %s%s %s mode for %s session.\n",
+-		(int)dp->cdr_dstat->ds_wspeed,
++	printf("Starting to write CD/DVD at speed %5.1f in %s%s %s mode for %s session.\n",
++		(float)dp->cdr_dstat->ds_wspeed,
+ 		(dp->cdr_cmdflags & F_DUMMY) ? "dummy" : "real",
+ 		(dp->cdr_cmdflags & F_FORCE) ? " force" : "",
+ 		wm2name[dp->cdr_dstat->ds_wrmode],
+@@ -1421,7 +1482,7 @@
+ 		sleep(1);
+ 		if (didintr) {
+ 			printf("\n");
+-			excdr(SIGINT, &exargs);
++			excdr(SIGINT, &exargs, is_dvdwr);
+ 			signal(SIGINT, SIG_DFL);
+ 			kill(getpid(), SIGINT);
+ 			/*
+@@ -1451,8 +1512,9 @@
+ }
+ 
+ LOCAL void
+-cdrstats(dp)
++cdrstats(dp, is_dvdwr)
+ 	cdr_t	*dp;
++	BOOL 	is_dvdwr;
+ {
+ 	float	secsps = 75.0;
+ 	int	nsecs;
+@@ -1510,6 +1572,7 @@
+ 			(tlast.tv_sec * 1.0 + tlast.tv_usec * 0.000001);
+ 		if (fspeed > 999.0)
+ 			fspeed = 999.0;
++		if (is_dvdwr) fspeed /= 9;
+ 		printf("Average write speed %5.1fx.\n", fspeed);
+ 	}
+ 
+@@ -1564,7 +1627,7 @@
+ 	error("\t-checkdrive	check if a driver for the drive is present\n");
+ 	error("\t-prcap		print drive capabilities for MMC compliant drives\n");
+ 	error("\t-inq		do an inquiry for the drive and exit\n");
+-	error("\t-scanbus	scan the SCSI bus and exit\n");
++	error("\t-scanbus	scan the SCSI and IDE buses and exit\n");
+ 	error("\t-reset		reset the SCSI bus with the cdrecorder (if possible)\n");
+ 	error("\t-abort		send an abort sequence to the drive (may help if hung)\n");
+ 	error("\t-overburn	allow to write more than the official size of a medium\n");
+@@ -1572,7 +1635,8 @@
+ 	error("\t-useinfo	use *.inf files to overwrite audio options.\n");
+ 	error("\tspeed=#		set speed of drive\n");
+ 	error("\tblank=type	blank a CD-RW disc (see blank=help)\n");
+-	error("\t-format		format a CD-RW/DVD-RW/DVD+RW disc\n");
++	error("\tformat		format a CD-RW/DVD-RW/DVD+RW disc\n");
++	error("\tformattype=#	select the format method for DVD+RW disc\n");
+ #ifdef	FIFO
+ 	error("\tfs=#		Set fifo size to # (0 to disable, default is %ld MB)\n",
+ 							DEFAULT_FIFOSIZE/(1024L*1024L));
+@@ -1658,6 +1722,18 @@
+ 	/* NOTREACHED */
+ }
+ 
++LOCAL void
++formattypeusage(ret)
++	int	ret;
++{
++	error("Formating options:\n");
++	error("\tfull\t\tstandard formating\n");
++	error("\tbackground\t\tbackground formating\n");
++	error("\tforce\t\tforce reformat\n");
++
++	exit(ret);
++	/* NOTREACHED */
++}
+ /* ARGSUSED */
+ LOCAL void
+ intr(sig)
+@@ -1737,15 +1813,16 @@
+ }
+ 
+ LOCAL void
+-excdr(excode, arg)
++excdr(excode, arg, is_dvdwr)
+ 	int	excode;
+ 	void	*arg;
++	BOOL 	is_dvdwr;
+ {
+ 	struct exargs	*exp = (struct exargs *)arg;
+ 
+ 	exscsi(excode, arg);
+ 
+-	cdrstats(exp->dp);
++	cdrstats(exp->dp, is_dvdwr);
+ 	if ((exp->dp->cdr_dstat->ds_cdrflags & RF_DID_CDRSTAT) == 0) {
+ 		exp->dp->cdr_dstat->ds_cdrflags |= RF_DID_CDRSTAT;
+ 		(*exp->dp->cdr_stats)(exp->scgp, exp->dp);
+@@ -1906,10 +1983,11 @@
+ }
+ 
+ LOCAL int
+-write_track_data(scgp, dp, trackp)
++write_track_data(scgp, dp, trackp, is_dvdwr)
+ 	SCSI	*scgp;
+ 	cdr_t	*dp;
+ 	track_t	*trackp;
++	BOOL    is_dvdwr;
+ {
+ 	int	track = trackp->trackno;
+ 	int	f = -1;
+@@ -2127,6 +2205,7 @@
+ 					usleep(wt*1000);
+ 			}
+ #endif
++			if (is_dvdwr) fspeed /= 9;
+ 			printf(" %5.1fx", fspeed);
+ 			printf(".");
+ 			savbytes = (bytes >> 20) << 20;
+@@ -2940,10 +3019,13 @@
+ 		/*
+ 		 * dsp->ds_maxblocks == 0 (disk capacity is unknown).
+ 		 */
+-		if (endsec >= (405000-300)) {			/*<90 min disk*/
+-			errmsgno(EX_BAD,
+-				"Data will not fit on any disk.\n");
+-			goto toolarge;
++	        if (endsec >= (2300000)) {
++		        errmsgno(EX_BAD,
++			"ERROR: Could not manage to find medium size, and more than 4.3 GB of data.\n");
++  		        goto toolarge;  
++	        } else if (endsec >= (405000-300)) {            /*<90 min disk or DVD*/
++		        errmsgno(EX_BAD,
++			"WARNING: Could not manage to find medium size, and more than 90 mins of data.\n");
+ 		} else if (endsec >= (333000-150)) {		/* 74 min disk*/
+ 			errmsgno(EX_BAD,
+ 			"WARNING: Data may not fit on standard 74min disk.\n");
+@@ -3017,7 +3099,7 @@
+ }
+ 
+ char	*opts =
+-"help,version,checkdrive,prcap,inq,scanbus,reset,abort,overburn,ignsize,useinfo,dev*,timeout#,driver*,driveropts*,setdropts,tsize&,padsize&,pregap&,defpregap&,speed#,load,lock,eject,dummy,msinfo,toc,atip,multi,fix,nofix,waiti,immed,debug#,d+,kdebug#,kd#,verbose+,v+,Verbose+,V+,x+,xd#,silent,s,audio,data,mode2,xa,xa1,xa2,xamix,cdi,isosize,nopreemp,preemp,nocopy,copy,nopad,pad,swab,fs&,ts&,blank&,format,pktsize#,packet,noclose,force,tao,dao,sao,raw,raw96r,raw96p,raw16,clone,scms,isrc*,mcn*,index*,cuefile*,textfile*,text,shorttrack,noshorttrack,gracetime#,minbuf#";
++"help,version,checkdrive,prcap,inq,scanbus,reset,abort,overburn,ignsize,useinfo,dev*,timeout#,driver*,driveropts*,setdropts,tsize&,padsize&,pregap&,defpregap&,speed#,load,lock,eject,dummy,msinfo,toc,atip,multi,fix,nofix,waiti,immed,debug#,d+,kdebug#,kd#,verbose+,v+,Verbose+,V+,x+,xd#,silent,s,audio,data,mode2,xa,xa1,xa2,xamix,cdi,isosize,nopreemp,preemp,nocopy,copy,nopad,pad,swab,fs&,ts&,blank&,format,formattype&,pktsize#,packet,noclose,force,tao,dao,sao,raw,raw96r,raw96p,raw16,clone,scms,isrc*,mcn*,index*,cuefile*,textfile*,text,shorttrack,noshorttrack,gracetime#,minbuf#";
+ 
+ /*
+  * Defines used to find whether a write mode has been specified.
+@@ -3027,8 +3109,8 @@
+ #define	M_RAW		4	/* Raw mode */
+ #define	M_PACKET	8	/* Packed mode */
+ 
+-LOCAL void
+-gargs(ac, av, tracksp, trackp, devp, timeoutp, dpp, speedp, flagsp, blankp)
++LOCAL int
++gargs(ac, av, tracksp, trackp, devp, timeoutp, dpp, speedp, flagsp, blankp, formatp)
+ 	int	ac;
+ 	char	**av;
+ 	int	*tracksp;
+@@ -3039,6 +3121,7 @@
+ 	int	*speedp;
+ 	long	*flagsp;
+ 	int	*blankp;
++	int	*formatp;
+ {
+ 	int	cac;
+ 	char	* const*cav;
+@@ -3051,6 +3134,7 @@
+ 	char	*textfile = NULL;
+ 	long	bltype = -1;
+ 	int	doformat = 0;
++	int	formattype = -1;
+ 	Llong	tracksize;
+ 	Llong	padsize;
+ 	long	pregapsize;
+@@ -3166,7 +3250,7 @@
+ 				&nopreemp, &preemp,
+ 				&nocopy, &copy,
+ 				&nopad, &pad, &bswab, getnum, &fs, getnum, &bufsize,
+-				getbltype, &bltype, &doformat, &pktsize,
++				getbltype, &bltype, &doformat, getformattype, &formattype, &pktsize,
+ 				&ispacket, &noclose, &force,
+ 				&tao, &dao, &dao, &raw, &raw96r, &raw96p, &raw16,
+ 				&clone,
+@@ -3247,8 +3331,14 @@
+ 				*flagsp |= F_BLANK;
+ 				*blankp = bltype;
+ 			}
+-			if (doformat)
+-				*flagsp |= F_FORMAT;
++ 			if (doformat > 0) {
++ 				*flagsp |= F_FORMAT;
++ 				*formatp |= FULL_FORMAT;
++ 			}
++ 			if (formattype >= 0) {
++ 				*flagsp |= F_FORMAT;
++ 				*formatp |= formattype;
++ 			}
+ 			if (ispacket)
+ 				wm |= M_PACKET;
+ 			if (tao)
+@@ -3695,14 +3785,14 @@
+ 	    ((strncmp(*devp, "HELP", 4) == 0) ||
+ 	    (strncmp(*devp, "help", 4) == 0))) {
+ 		*flagsp |= F_CHECKDRIVE; /* Set this for not calling mlockall() */
+-		return;
++		return ispacket;
+ 	}
+ 	if (*flagsp & (F_LOAD|F_DLCK|F_SETDROPTS|F_MSINFO|F_TOC|F_PRATIP|F_FIX|F_VERSION|F_CHECKDRIVE|F_PRCAP|F_INQUIRY|F_SCANBUS|F_RESET|F_ABORT)) {
+ 		if (tracks != 0) {
+ 			errmsgno(EX_BAD, "No tracks allowed with this option\n");
+ 			susage(EX_BAD);
+ 		}
+-		return;
++		return ispacket;
+ 	}
+ 	*tracksp = tracks;
+ 	if (*flagsp & F_SAO) {
+@@ -3731,12 +3821,13 @@
+ 			susage(EX_BAD);
+ 		}
+ 		cuefilename = cuefile;
+-		return;
++		return ispacket;
+ 	}
+ 	if (tracks == 0 && (*flagsp & (F_LOAD|F_DLCK|F_EJECT|F_BLANK|F_FORMAT)) == 0) {
+ 		errmsgno(EX_BAD, "No tracks specified. Need at least one.\n");
+ 		susage(EX_BAD);
+ 	}
++	return ispacket;
+ }
+ 
+ LOCAL void
+@@ -4405,6 +4496,26 @@
+ 	return (TRUE);
+ }
+ 
++LOCAL int
++getformattype(optstr, typep)
++	char	*optstr;
++	long	*typep;
++{
++	if (streql(optstr, "full")) {
++		*typep = FULL_FORMAT;
++	} else if (streql(optstr, "background")) {
++		*typep = BACKGROUND_FORMAT;
++	} else if (streql(optstr, "force")) {
++		*typep = FORCE_FORMAT;
++	} else if (streql(optstr, "help")) {
++		formattypeusage(0);
++	} else {
++		error("Illegal blanking type '%s'.\n", optstr);
++		formattypeusage(EX_BAD);
++		return (-1);
++	}
++	return (TRUE);
++}
+ LOCAL void
+ print_drflags(dp)
+ 	cdr_t	*dp;
+diff -Nur cdrtools-2.01.foo/cdrecord/cdrecord.h cdrtools-2.01.foo2/cdrecord/cdrecord.h
+--- cdrtools-2.01.foo/cdrecord/cdrecord.h	2004-05-25 00:36:01.000000000 +0200
++++ cdrtools-2.01.foo2/cdrecord/cdrecord.h	2004-07-21 09:23:00.000000000 +0200
+@@ -96,7 +96,7 @@
+ #define	CDR_MAX_BUF_SIZE	(256*1024)
+ 
+ #ifndef	MIN_GRACE_TIME
+-#define	MIN_GRACE_TIME	2		/* 2 seconds */
++#define	MIN_GRACE_TIME	0		/* 2 seconds */
+ #endif
+ #ifndef	GRACE_TIME
+ #define	GRACE_TIME	9		/* 9 seconds */
+@@ -460,6 +460,13 @@
+ #define	BLANK_SESSION	0x06	/* Erase the last session		  */
+ 
+ /*
++ * Defines for formating DVD (custom values)
++ */
++#define	FULL_FORMAT       0x00    /* Interactive format  */
++#define	BACKGROUND_FORMAT 0x01    /* Background format   */
++#define	FORCE_FORMAT      0x02    /* Force reformat      */
++
++/*
+  * Useful definitions for audio tracks
+  */
+ #define	msample		(44100 * 2)		/* one 16bit audio sample */
+@@ -570,6 +577,12 @@
+ #define	DSF_NEED_FORMAT	0x0800	/* Disk needs to be formatted		*/
+ 
+ /*
++ * Definitions for disktype flags
++ */
++#define DT_CD           0x001  /*is a CD                                */
++#define DT_DVD          0x002  /*is a DVD                               */
++
++/*
+  * Definitions for disk_status disk type
+  * used in "ds_type".
+  */
+diff -Nur cdrtools-2.01.foo/cdrecord/drv_mmc.c cdrtools-2.01.foo2/cdrecord/drv_mmc.c
+--- cdrtools-2.01.foo/cdrecord/drv_mmc.c	2004-05-25 00:36:01.000000000 +0200
++++ cdrtools-2.01.foo2/cdrecord/drv_mmc.c	2004-07-21 09:23:00.000000000 +0200
+@@ -84,8 +84,11 @@
+ EXPORT	char	*hasdrvopt		__PR((char *optstr, char *optname));
+ LOCAL	cdr_t	*identify_mmc		__PR((SCSI *scgp, cdr_t *, struct scsi_inquiry *));
+ LOCAL	int	attach_mmc		__PR((SCSI *scgp, cdr_t *));
++LOCAL   int     attach_mdvd             __PR((SCSI *scgp, cdr_t *));
+ EXPORT	int	check_writemodes_mmc	__PR((SCSI *scgp, cdr_t *dp));
++EXPORT  int     check_writemodes_mdvd   __PR((SCSI *scgp, cdr_t *dp));
+ LOCAL	int	deflt_writemodes_mmc	__PR((SCSI *scgp, BOOL reset_dummy));
++LOCAL   int     deflt_writemodes_mdvd   __PR((SCSI *scgp, BOOL reset_dummy));
+ LOCAL	int	get_diskinfo		__PR((SCSI *scgp, struct disk_info *dip));
+ LOCAL	void	di_to_dstat		__PR((struct disk_info *dip, dstat_t *dsp));
+ LOCAL	int	get_atip		__PR((SCSI *scgp, struct atipinfo *atp));
+@@ -94,18 +97,27 @@
+ #endif
+ LOCAL	int	init_mmc		__PR((SCSI *scgp, cdr_t *dp));
+ LOCAL	int	getdisktype_mmc		__PR((SCSI *scgp, cdr_t *dp));
++LOCAL   int     getdisktype_mdvd        __PR((SCSI *scgp, cdr_t *dp));
+ LOCAL	int	speed_select_mmc	__PR((SCSI *scgp, cdr_t *dp, int *speedp));
++LOCAL   int     speed_select_mdvd       __PR((SCSI *scgp, cdr_t *dp, int *speedp));
+ LOCAL	int	mmc_set_speed		__PR((SCSI *scgp, int readspeed, int writespeed, int rotctl));
+ LOCAL	int	next_wr_addr_mmc	__PR((SCSI *scgp, track_t *trackp, long *ap));
++LOCAL   int     next_wr_addr_mdvd       __PR((SCSI *scgp, track_t *trackp, long *ap));
+ LOCAL	int	write_leadin_mmc	__PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
+ LOCAL	int	open_track_mmc		__PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
++LOCAL   int     open_track_mdvd         __PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
+ LOCAL	int	close_track_mmc		__PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
++LOCAL   int     close_track_mdvd        __PR((SCSI *scgp, cdr_t *dp, track_t *trackp)); 
+ LOCAL	int	open_session_mmc	__PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
++LOCAL   int     open_session_mdvd       __PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
+ LOCAL	int	waitfix_mmc		__PR((SCSI *scgp, int secs));
+ LOCAL	int	fixate_mmc		__PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
++LOCAL   int     fixate_mdvd             __PR((SCSI *scgp, cdr_t *dp, track_t *trackp));
+ LOCAL	int	blank_mmc		__PR((SCSI *scgp, cdr_t *dp, long addr, int blanktype));
++LOCAL	int	format_mdvd		__PR((SCSI *scgp, cdr_t *dp, int formattype));
+ LOCAL	int	send_opc_mmc		__PR((SCSI *scgp, caddr_t, int cnt, int doopc));
+ LOCAL	int	opt1_mmc		__PR((SCSI *scgp, cdr_t *dp));
++LOCAL	int	opt1_mdvd		__PR((SCSI *scgp, cdr_t *dp));
+ LOCAL	int	opt2_mmc		__PR((SCSI *scgp, cdr_t *dp));
+ LOCAL	int	scsi_sony_write		__PR((SCSI *scgp, caddr_t bp, long sectaddr, long size, int blocks, BOOL islast));
+ LOCAL	int	gen_cue_mmc		__PR((track_t *trackp, void *vcuep, BOOL needgap));
+@@ -197,6 +209,46 @@
+ 	opt2_mmc,
+ };
+ 
++cdr_t   cdr_mdvd = {
++         0, 0,
++         CDR_SWABAUDIO,
++ 	 370,370,
++         "mmc_mdvd",
++         "generic SCSI-3/mmc DVD-R(W) driver",
++         0,
++ 	 (dstat_t *)0,
++         identify_mmc,
++         attach_mdvd,
++	 init_mmc,
++         getdisktype_mdvd,
++         scsi_load,
++         scsi_unload,
++         read_buff_cap,
++         cmd_dummy,                              /* recovery_needed      */
++         (int(*)__PR((SCSI *, int)))cmd_dummy,   /* recover              */
++         speed_select_mdvd,
++         select_secsize,
++         next_wr_addr_mdvd,
++         (int(*)__PR((SCSI *, Ulong)))cmd_ill,   /* reserve_track        */
++         scsi_cdr_write,
++         (int(*)__PR((SCSI *scgp, int, track_t *)))cmd_dummy, /* gen_cue */
++	 (int(*)__PR((SCSI *scgp, cdr_t *, track_t *)))cmd_dummy, /* send_cue */
++ 	 write_leadin_mmc,
++         open_track_mdvd,
++         close_track_mdvd,
++         open_session_mdvd,
++         cmd_dummy,
++	 cmd_dummy,					/* abort	*/
++         read_session_offset,
++         fixate_mdvd,
++ 	 stats_mmc,
++         blank_mmc,
++	 format_mdvd,
++         send_opc_mmc,
++ 	 opt1_mdvd,
++ 	 opt2_mmc,
++};
++
+ /*
+  * Sony MMC CD-writer
+  */
+@@ -556,7 +608,21 @@
+ 	if (profile >= 0) {
+ 		if (lverbose)
+ 			print_profiles(scgp);
+-		if (profile == 0 || profile == 0x12 || profile > 0x19) {
++		if (profile == 0 || profile >= 0x10 && profile <= 0x15 || profile > 0x19) {
++		    /*
++		     * 10h DVD-ROM
++		     * 11h DVD-R
++		     * 12h DVD-RAM
++		     * 13h DVD-RW (Restricted overwrite)
++		     * 14h DVD-RW (Sequential recording)
++		     * 1Ah DVD+RW
++		     * 1Bh DVD+R
++		     * 
++		     */
++		    if (profile == 0x11 || profile == 0x13 || profile == 0x14 || profile == 0x1A || profile == 0x1B) {
++			is_dvd = TRUE;
++			dp = &cdr_mdvd;
++		    } else {
+ 			is_dvd = FALSE;
+ 			dp = &cdr_cd;
+ 
+@@ -578,23 +644,8 @@
+ 				errmsgno(EX_BAD,
+ 				"Found unsupported DVD-RAM media.\n");
+ 				return (dp);
+-			} else {			/* DVD+RW DVD+R */
+-				errmsgno(EX_BAD,
+-				"Found DVD+ media but DVD+R/DVD+RW support code is missing.\n");
+-				errmsgno(EX_BAD,
+-				"If you need DVD+R/DVD+RW support, ask the Author for cdrecord-ProDVD.\n");
+-				errmsgno(EX_BAD,
+-				"Free test versions and free keys for personal use are at ftp://ftp.berlios.de/pub/cdrecord/ProDVD/\n");
+-				return (dp);
+ 			}
+-		} else if (profile >= 0x10 && profile < 0x18) {
+-			errmsgno(EX_BAD,
+-			"Found DVD media but DVD-R/DVD-RW support code is missing.\n");
+-			errmsgno(EX_BAD,
+-			"If you need DVD-R/DVD-RW support, ask the Author for cdrecord-ProDVD.\n");
+-			errmsgno(EX_BAD,
+-			"Free test versions and free keys for personal use are at ftp://ftp.berlios.de/pub/cdrecord/ProDVD/\n");
+-			return (dp);
++		    }
+ 		}
+ 	} else {
+ 		if (xdebug)
+@@ -661,12 +712,9 @@
+ #endif
+ 	}
+ 	if (is_dvd) {
+-		errmsgno(EX_BAD,
+-		"Found DVD media but DVD-R/DVD-RW support code is missing.\n");
+-		errmsgno(EX_BAD,
+-		"If you need DVD-R/DVD-RW support, ask the Author for cdrecord-ProDVD.\n");
+-		errmsgno(EX_BAD,
+-		"Free test versions and free keys for personal use are at ftp://ftp.berlios.de/pub/cdrecord/ProDVD/\n");
++ 	        errmsgno(EX_BAD, 
++                 "Found DVD media: using cdr_mdvd.\n");  
++                 dp = &cdr_mdvd; 
+ 	}
+ 	return (dp);
+ }
+@@ -856,6 +904,42 @@
+ 	return (0);
+ }
+ 
++LOCAL int
++attach_mdvd(scgp, dp)
++        SCSI    *scgp;
++        cdr_t                   *dp;
++{
++        struct  cd_mode_page_2A *mp;
++	
++
++        allow_atapi(scgp, TRUE);/* Try to switch to 10 byte mode cmds */
++
++        scgp->silent++;
++        mp = mmc_cap(scgp, NULL);/* Get MMC capabilities in allocated mp */
++        scgp->silent--;
++        if (mp == NULL)
++                return (-1);    /* Pre SCSI-3/mmc drive         */
++
++        dp->cdr_cdcap = mp;     /* Store MMC cap pointer        */
++
++        if (mp->loading_type == LT_TRAY)
++                dp->cdr_flags |= CDR_TRAYLOAD;
++        else if (mp->loading_type == LT_CADDY)
++                dp->cdr_flags |= CDR_CADDYLOAD;
++
++        if (mp->BUF != 0)
++                dp->cdr_flags |= CDR_BURNFREE;
++
++        check_writemodes_mdvd(scgp, dp);
++
++        if (driveropts != NULL) {
++                if (strcmp(driveropts, "help") == 0) {
++                        mmc_opthelp(dp, 0);
++                }
++        }
++
++        return (0);
++}
+ 
+ EXPORT int
+ check_writemodes_mmc(scgp, dp)
+@@ -1007,6 +1091,77 @@
+ }
+ 
+ LOCAL int
++check_writemodes_mdvd(scgp, dp)
++	SCSI	*scgp;
++	cdr_t	*dp;
++{
++	Uchar	mode[0x100];
++	int	len;
++	struct	cd_mode_page_05 *mp;
++
++	if (xdebug)
++		printf("Checking possible write modes: ");
++
++	deflt_writemodes_mdvd(scgp, FALSE);
++
++	fillbytes((caddr_t)mode, sizeof(mode), '\0');
++
++	scgp->silent++;
++	if (!get_mode_params(scgp, 0x05, "CD write parameter",
++			mode, (Uchar *)0, (Uchar *)0, (Uchar *)0, &len)) {
++		scgp->silent--;
++		return (-1);
++	}
++	if (len == 0) {
++		scgp->silent--;
++		return (-1);
++	}
++
++	mp = (struct cd_mode_page_05 *)
++		(mode + sizeof(struct scsi_mode_header) +
++		((struct scsi_mode_header *)mode)->blockdesc_len);
++
++	mp->test_write = 0;
++
++	/*We only check for PACKET and SAO since these are the only supported modes for DVD */
++	/*XXX these checks are irrelevant because they are not medium sensitive. ie the device returns 
++	  error only when it does not support a given mode for ALL mediums. It should check using 
++	  GET CONFIGURATION command.*/
++
++	mp->write_type = WT_PACKET;
++	mp->fp = 0;
++	i_to_4_byte(mp->packet_size, 0);
++
++	if (set_mode_params(scgp, "CD write parameter", mode, len, 0, -1)) {
++		dp->cdr_flags |= CDR_PACKET;
++		if (xdebug)
++		  printf("PACKET ");
++	} else
++	  dp->cdr_flags &= ~CDR_PACKET;
++	mp->fp = 0;
++	i_to_4_byte(mp->packet_size, 0);
++	mp->track_mode = TM_DATA; 
++
++
++	mp->write_type = WT_SAO;
++
++	if (set_mode_params(scgp, "CD write parameter", mode, len, 0, -1)) {
++		dp->cdr_flags |= CDR_SAO;
++		if (xdebug)
++			printf("SAO ");
++	} else
++		dp->cdr_flags &= ~CDR_SAO;
++
++
++	if (xdebug)
++		printf("\n");
++
++	deflt_writemodes_mdvd(scgp, TRUE);
++	scgp->silent--;
++	return (0);
++}
++
++LOCAL int
+ deflt_writemodes_mmc(scgp, reset_dummy)
+ 	SCSI	*scgp;
+ 	BOOL	reset_dummy;
+@@ -1080,6 +1235,61 @@
+ 	return (0);
+ }
+ 
++LOCAL int
++deflt_writemodes_mdvd(scgp, reset_dummy)
++	SCSI	*scgp;
++	BOOL	reset_dummy;
++{
++	Uchar	mode[0x100];
++	int	len;
++	struct	cd_mode_page_05 *mp;
++
++	fillbytes((caddr_t)mode, sizeof(mode), '\0');
++
++	scgp->silent++;
++	if (!get_mode_params(scgp, 0x05, "DVD write parameter",
++			mode, (Uchar *)0, (Uchar *)0, (Uchar *)0, &len)) {
++		scgp->silent--;
++		return (-1);
++	}
++	if (len == 0) {
++		scgp->silent--;
++		return (-1);
++	}
++
++	mp = (struct cd_mode_page_05 *)
++		(mode + sizeof(struct scsi_mode_header) +
++		((struct scsi_mode_header *)mode)->blockdesc_len);
++
++	mp->test_write = 0;
++	/*
++	 * This is the only place where we reset mp->test_write (-dummy)
++	 */
++	if (reset_dummy)
++		mp->test_write = 0;
++
++
++	/*
++	 * Set default values:
++	 * Write type = 02 (session at once)
++	 *
++	 * XXX Note:	the same code appears in check_writemodes_mmc() and
++	 * XXX		in speed_select_mmc().
++	 */
++	mp->write_type = WT_SAO;
++	mp->track_mode = TM_DATA; 
++	mp->dbtype = DB_ROM_MODE1;
++	mp->session_format = SES_DA_ROM;
++
++
++	if (set_mode_params(scgp, "DVD write parameter", mode, len, 0, -1) < 0) {
++		scgp->silent--;
++		return (-1);
++	}
++	scgp->silent--;
++	return (0);
++}
++
+ #ifdef	PRINT_ATIP
+ LOCAL	void	print_di		__PR((struct disk_info *dip));
+ LOCAL	void	atip_printspeed		__PR((char *fmt, int speedindex, char speedtab[]));
+@@ -1149,6 +1359,9 @@
+ 
+ 	if (dsp->ds_last_leadout == 0 && dsp->ds_maxblocks >= 0)
+ 		dsp->ds_last_leadout = dsp->ds_maxblocks;
++	dsp->ds_trfirst=dip->first_track; 
++	dsp->ds_trlast=dip->last_track_ls;
++	dsp->ds_trfirst_ls=dip->first_track_ls;
+ }
+ 
+ LOCAL int
+@@ -1259,6 +1472,30 @@
+ }
+ 
+ LOCAL int
++getdisktype_mdvd(scgp, dp)
++	SCSI	*scgp;
++	cdr_t	*dp;
++{
++       int ret;
++       dstat_t	*dsp = dp->cdr_dstat;
++
++       struct track_info track_info;
++       if(getdisktype_mmc(scgp, dp)<0)
++	 return -1;
++
++       /* read rzone info to get the space left on disk */
++       /*ds_trlast is the last rzone on disk, can be invisible */
++       if(read_rzone_info(scgp, (caddr_t)&track_info, sizeof(track_info))>=0)
++	  dsp->ds_maxblocks=a_to_u_4_byte(track_info.free_blocks)+a_to_4_byte(track_info.next_writable_addr);
++       
++       dsp->ds_disktype&= ~DT_CD;
++       dsp->ds_disktype|= DT_DVD;
++	
++       return (ret);
++  
++}
++
++LOCAL int
+ getdisktype_mmc(scgp, dp)
+ 	SCSI	*scgp;
+ 	cdr_t	*dp;
+@@ -1688,6 +1925,7 @@
+ 	 * But the standard is rounding the wrong way.
+ 	 * Furtunately rounding down is guaranteed.
+ 	 */
++	//val = curspeed*177;
+ 	val = curspeed*177;
+ 	if (val > 0xFFFF)
+ 		val = 0xFFFF;
+@@ -1700,6 +1938,7 @@
+ 
+ 	if (scsi_get_speed(scgp, 0, &val) >= 0) {
+ 		if (val > 0) {
++		        printf("Speed set to %d KB/s\n", val); 
+ 			curspeed = val / 176;
+ 			*speedp = curspeed;
+ 		}
+@@ -1762,6 +2001,68 @@
+ }
+ 
+ LOCAL int
++speed_select_mdvd(scgp, dp, speedp)
++	SCSI	*scgp;
++	cdr_t   *dp;
++	int	*speedp;
++{
++  int retcode;
++  unsigned char perf_desc[28];
++  int write_speed = *speedp * 1385;
++  int val = 0, val2 = 0;
++  int i;
++   
++  /* For the moment we just divide the CD speed by 7*/
++
++  if(speedp!=NULL)
++     (*speedp)=(*speedp)*8;
++  
++  memset(perf_desc, 0, sizeof(perf_desc));
++
++  /* Write Rotation Control = ROTCTL_CLV 
++   * | Restore Logical Unit Defaults = 0 
++   * | Exact = 0 
++   * | Random Access = 0) 
++   */
++  perf_desc[0]= ROTCTL_CLV << 3 | 0 << 2 | 0 << 1 | 0; 
++  /* Start LBA to 0 */
++  perf_desc[4] = 0;
++  perf_desc[5] = 0;
++  perf_desc[6] = 0;
++  perf_desc[7] = 0;
++  /* End LBA set to 0 (setting to 0xffffffff failed on my LG burner
++   */
++  perf_desc[8] = 0;
++  perf_desc[9] = 0;
++  perf_desc[10] = 0;
++  perf_desc[11] = 0;
++  /* Read Speed = 0xFFFF */
++  perf_desc[12] = 0;
++  perf_desc[13] = 0;
++  perf_desc[14] = 0xFF;
++  perf_desc[15] = 0xFF;
++  /* Read Time = 1s */
++  perf_desc[18] = 1000 >> 8;
++  perf_desc[19] = 1000 & 0xFF;   
++  /* Write Speed */
++  perf_desc[20] = write_speed >> 24;
++  perf_desc[21] = write_speed >> 16 & 0xFF;
++  perf_desc[22] = write_speed >> 8 & 0xFF;
++  perf_desc[23] = write_speed & 0xFF;
++  /* Write Time = 1s */
++  perf_desc[26] = 1000 >> 8;
++  perf_desc[27] = 1000 & 0xFF;  
++  
++  //retcode = scsi_set_streaming(scgp, NULL, 0);
++  retcode = scsi_set_streaming(scgp, &perf_desc, sizeof(perf_desc));
++  if (retcode == -1) return retcode;
++  retcode = speed_select_mmc(scgp, dp, speedp);
++  if(speedp!=NULL)
++     (*speedp)=(*speedp)/7;
++   return retcode;
++}
++
++LOCAL int
+ next_wr_addr_mmc(scgp, trackp, ap)
+ 	SCSI	*scgp;
+ 	track_t	*trackp;
+@@ -1898,6 +2199,48 @@
+ };
+ 
+ LOCAL int
++next_wr_addr_mdvd(scgp, trackp, ap)
++	SCSI	*scgp;
++	track_t	*trackp;
++	long	*ap;
++{
++	int     track;
++	struct	track_info	track_info;
++	long	next_addr;
++	int	result = -1;
++	struct  disk_info disk_info;
++	if (trackp){
++	    track = trackp->trackno;
++	}
++
++	if (trackp != 0 && track > 0 && is_packet(trackp)) {
++		scgp->silent++;
++		result = read_rzone_info(scgp, (caddr_t)&track_info, sizeof(track_info));
++		scgp->silent--;
++		if (scsi_in_progress(scgp)){
++		  return -1;
++		}
++		
++	}
++
++	if (result < 0) {
++	  /* Get the last rzone*/
++	        if(read_disk_info(scgp,(caddr_t)&disk_info,8)<0)
++		  return (-1);
++	     
++		if (read_rzone_info(scgp, (caddr_t)&track_info, sizeof(track_info)) < 0)
++		return (-1);
++	}
++	if (scgp->verbose)
++		scg_prbytes("track info:", (Uchar *)&track_info,
++				sizeof(track_info)-scg_getresid(scgp));
++	next_addr = a_to_4_byte(track_info.next_writable_addr);
++	if (ap)
++		*ap = next_addr;
++	return (0);
++}
++
++LOCAL int
+ open_track_mmc(scgp, dp, trackp)
+ 	SCSI	*scgp;
+ 	cdr_t	*dp;
+@@ -1978,6 +2321,45 @@
+ }
+ 
+ LOCAL int
++open_track_mdvd(scgp, dp, trackp)
++	SCSI	*scgp;
++	cdr_t	*dp;
++	track_t *trackp;
++{
++	Uchar	mode[0x100];
++	int	len;
++	struct	cd_mode_page_05 *mp;
++
++	if (is_packet(trackp)) {
++	       fillbytes((caddr_t)mode, sizeof(mode), '\0');
++	  
++	       if (!get_mode_params(scgp, 0x05, "DVD write parameter",
++			mode, (Uchar *)0, (Uchar *)0, (Uchar *)0, &len))
++	              return (-1);
++	       if (len == 0)
++		      return (-1);
++
++	        mp = (struct cd_mode_page_05 *)
++	              (mode + sizeof(struct scsi_mode_header) +
++		      ((struct scsi_mode_header *)mode)->blockdesc_len);
++
++		mp->write_type = WT_PACKET;
++		mp->LS_V = 1;
++		/*For now we set the link size to 0x10(32k) because Pioneer-A03 only support this */
++		mp->link_size=0x10;
++		mp->fp = 1;
++		i_to_4_byte(mp->packet_size, trackp->pktsize);
++	} else {
++	     return 0;
++	}
++ 
++	if (!set_mode_params(scgp, "CD write parameter", mode, len, 0, trackp->secsize))
++		return (-1);
++
++	return (0);
++}
++
++LOCAL int
+ close_track_mmc(scgp, dp, trackp)
+ 	SCSI	*scgp;
+ 	cdr_t	*dp;
+@@ -2003,6 +2385,30 @@
+ 	return (0);
+ }
+ 
++LOCAL int
++close_track_mdvd(scgp, dp, trackp)
++	SCSI	*scgp;
++	cdr_t	*dp;
++	track_t	*trackp;
++{
++	int	ret;
++	if (!is_packet(trackp))
++	     return (0);
++
++	if (scsi_flush_cache(scgp, (dp->cdr_cmdflags&F_IMMED) != 0) < 0) {
++		printf("Trouble flushing the cache\n");
++		return -1;
++	}
++	wait_unit_ready(scgp, 300);		/* XXX Wait for ATAPI */
++	if (is_packet(trackp) && !is_noclose(trackp)) {
++			/* close the incomplete track */
++		ret = scsi_close_tr_session(scgp, 1, 0xFF, (dp->cdr_cmdflags&F_IMMED) != 0);
++		wait_unit_ready(scgp, 300);	/* XXX Wait for ATAPI */
++		return (ret);
++	}
++	return (0);
++}
++
+ int	toc2sess[] = {
+ 	SES_DA_ROM,	/* CD-DA		 */
+ 	SES_DA_ROM,	/* CD-ROM		 */
+@@ -2086,6 +2492,82 @@
+ }
+ 
+ LOCAL int
++open_session_mdvd(scgp, dp, trackp)
++	SCSI	*scgp;
++	cdr_t	*dp;
++	track_t	*trackp;
++{
++	Uchar	mode[0x100];
++	int	tracks = trackp->tracks;
++
++	int	len;
++	struct	cd_mode_page_05 *mp;
++	Ulong totalsize;
++	int i;
++	struct	track_info	track_info;
++	int profile;
++
++	fillbytes((caddr_t)mode, sizeof(mode), '\0');
++
++	if (!get_mode_params(scgp, 0x05, "DVD write parameter",
++			mode, (Uchar *)0, (Uchar *)0, (Uchar *)0, &len))
++		return (-1);
++	if (len == 0)
++		return (-1);
++
++	mp = (struct cd_mode_page_05 *)
++		(mode + sizeof(struct scsi_mode_header) +
++		((struct scsi_mode_header *)mode)->blockdesc_len);
++	if(is_packet(trackp)){
++	  mp->write_type=WT_PACKET;
++	  mp->multi_session = (track_base(trackp)->tracktype & TOCF_MULTI) ? MS_MULTI : MS_NONE;
++	  mp->fp=0;
++	  mp->BUFE=1;
++	  mp->track_mode=1;
++	}else{
++	  mp->write_type = WT_SAO; 
++	}
++
++	
++	if (lverbose && dp->cdr_cdcap->BUF != 0)
++		printf("BURN-Free is %s.\n", mp->BUFE?"ON":"OFF");
++	if (driveropts != NULL) {
++		if ((strcmp(driveropts, "burnproof") == 0 ||
++		    strcmp(driveropts, "burnfree") == 0) && dp->cdr_cdcap->BUF != 0) {
++			errmsgno(EX_BAD, "Turning BURN-Free on\n");
++			mp->BUFE = 1;
++		} else if ((strcmp(driveropts, "noburnproof") == 0 ||
++			   strcmp(driveropts, "noburnfree") == 0)) {
++			errmsgno(EX_BAD, "Turning BURN-Free off\n");
++			mp->BUFE = 0;
++		} else if (strcmp(driveropts, "help") == 0) {
++			mmc_opthelp(dp, 0);
++		} else {
++			errmsgno(EX_BAD, "Bad driver opts '%s'.\n", driveropts);
++			mmc_opthelp(dp, EX_BAD);
++		}
++	}
++
++
++	if (!set_mode_params(scgp, "DVD write parameter", mode, len, 0, -1))
++		return (-1);
++
++		
++	totalsize=0;
++	for(i=1;i<=tracks;i++) {
++	  totalsize+=trackp[i].tracksecs;
++	}
++       
++	profile = get_curprofile(scgp);
++	if(!is_packet(trackp) && profile != 0x1A){
++	  /* in DAO mode we need to reserve space for the track*/
++	  if(reserve_track(scgp, totalsize)<0)
++	    return (-1);
++	  }
++	return (0);
++}
++
++LOCAL int
+ waitfix_mmc(scgp, secs)
+ 	SCSI	*scgp;
+ 	int	secs;
+@@ -2215,6 +2697,25 @@
+ 	return (ret);
+ }
+ 
++LOCAL int
++fixate_mdvd(scgp, dp, trackp)
++	SCSI	*scgp;
++	cdr_t   *dp;
++	track_t	*trackp;
++{
++      /*set a really BIG timeout and call fixate_mmc
++	 The BIG timeout is needed in case there was a very short rzone to write at the 
++	 beginning of the disk, because lead-out needs to be at some distance.
++      */
++      scg_settimeout(scgp, 1000);
++      if(is_packet(trackp)){
++	  scsi_close_tr_session(scgp, 2, 0, FALSE);
++      }
++      fixate_mmc(scgp, dp, trackp);
++      scg_settimeout(scgp, 200);
++      
++}
++
+ char	*blank_types[] = {
+ 	"entire disk",
+ 	"PMA, TOC, pregap",
+@@ -2226,6 +2727,12 @@
+ 	"reserved blanking type",
+ };
+ 
++char	*format_types[] = {
++	"full format",
++	"background format",
++	"forced format",
++};
++
+ LOCAL int
+ blank_mmc(scgp, dp, addr, blanktype)
+ 	SCSI	*scgp;
+@@ -2238,11 +2745,17 @@
+ 	BOOL	cdrrw	 = FALSE;	/* Read CD-RW	*/
+ 	BOOL	cdwrw	 = FALSE;	/* Write CD-RW	*/
+ 	int	ret;
++	int 	profile;
+ 
+ 	mmc_check(scgp, &cdrr, &cdwr, &cdrrw, &cdwrw, NULL, NULL);
+ 	if (!cdwrw)
+ 		return (blank_dummy(scgp, dp, addr, blanktype));
+ 
++	profile = get_curprofile(scgp);
++	if (profile == 0x1A) {
++		printf("Error: this media does not support blanking, ignoring.\n");
++		return (blank_dummy(scgp, dp, addr, blanktype));
++	}
+ 	if (lverbose) {
+ 		printf("Blanking %s\n", blank_types[blanktype & 0x07]);
+ 		flush();
+@@ -2258,6 +2771,80 @@
+ }
+ 
+ LOCAL int
++format_mdvd(scgp, dp, formattype)
++	SCSI	*scgp;
++	cdr_t	*dp;
++	int	formattype;
++{
++extern	char	*buf;
++	BOOL	dvdwr	 = FALSE;	/* Write DVD	*/
++	int	ret;
++	int 	profile;
++	char	addr[12];
++	struct disk_info *dip;
++
++	printf("format_mdvd\n");
++	mmc_check(scgp, NULL, NULL, NULL, NULL, NULL, &dvdwr);
++	if (!dvdwr)
++		return (format_dummy(scgp, dp, formattype));
++
++	printf("format_mdvd: drive is a dvd burner.\n");
++	profile = get_curprofile(scgp);
++	if (profile != 0x1A) {
++		printf("Error: only support DVD+RW formating, ignoring.\n");
++	        return (format_dummy(scgp, dp, formattype));
++	}
++	printf("format_mdvd: media is a DVD+RW.\n");
++	dip = (struct disk_info *)buf;
++	if (get_diskinfo(scgp, dip) < 0)
++		return ret;
++	
++	if (dip->disk_status & 3 && formattype != FORCE_FORMAT) {
++		printf("Error: disk already formated, ignoring.\n");
++	        return ret;
++        }
++	addr[0] = 0;           // "Reserved"
++	addr[1] = 2;           // "IMMED" flag
++	addr[2] = 0;           // "Descriptor Length" (MSB)
++	addr[3] = 8;           // "Descriptor Length" (LSB)
++	addr[4+0] = 0xff;
++	addr[4+1] = 0xff;
++	addr[4+2] = 0xff;
++	addr[4+3] = 0xff;
++	addr[4+4] = 0x26<<2;
++	addr[4+5] = 0;
++	addr[4+6] = 0;
++	addr[4+7] = 0;
++	if (formattype == FORCE_FORMAT) {
++	    printf("format_mdvd: forcing reformat.\n"); 
++	    formattype = FULL_FORMAT;
++	    addr[4+0] = 0;
++	    addr[4+1] = 0;
++	    addr[4+2] = 0;
++	    addr[4+3] = 0;
++	    addr[4+7] = 1;
++	} else {
++	    printf("format_mdvd: media is unformated.\n"); 
++	}
++
++	if (lverbose) {
++		printf("Formating %s\n", format_types[formattype & 0x07]);
++		flush();
++	}
++	if (formattype == FULL_FORMAT) {
++	    ret = scsi_format(scgp, &addr, sizeof(addr), FALSE);
++	} else {
++	    ret = scsi_format(scgp, &addr, sizeof(addr), TRUE);
++	}
++	if (ret < 0)
++		return (ret);
++
++	wait_unit_ready(scgp, 90*60/curspeed);	/* XXX Wait for ATAPI */
++	waitfix_mmc(scgp, 90*60/curspeed);	/* XXX Wait for ATAPI */
++	return (ret);
++}
++
++LOCAL int
+ send_opc_mmc(scgp, bp, cnt, doopc)
+ 	SCSI	*scgp;
+ 	caddr_t	bp;
+@@ -2453,6 +3040,42 @@
+ }
+ 
+ LOCAL int
++opt1_mdvd(scgp, dp)
++	SCSI	*scgp;
++	cdr_t	*dp;
++{
++	int	oflags = dp->cdr_dstat->ds_cdrflags;
++
++	if ((dp->cdr_dstat->ds_cdrflags & RF_AUDIOMASTER) != 0) {
++		printf("Turning Audio Master Q. R. on\n");
++		if (set_audiomaster_yamaha(scgp, dp, TRUE) < 0)
++			return (-1);
++		if (!debug && lverbose <= 1)
++			dp->cdr_dstat->ds_cdrflags &= ~RF_PRATIP;
++		if (getdisktype_mdvd(scgp, dp) < 0) {
++			dp->cdr_dstat->ds_cdrflags = oflags;
++			return (-1);
++		}
++		dp->cdr_dstat->ds_cdrflags = oflags;
++		if (oflags & RF_PRATIP) {
++			msf_t   msf;
++			lba_to_msf(dp->cdr_dstat->ds_first_leadin, &msf);
++			printf("New start of lead in: %ld (%02d:%02d/%02d)\n",
++				(long)dp->cdr_dstat->ds_first_leadin,
++		                msf.msf_min,
++        		        msf.msf_sec,
++                		msf.msf_frame);
++			lba_to_msf(dp->cdr_dstat->ds_maxblocks, &msf);
++			printf("New start of lead out: %ld (%02d:%02d/%02d)\n",
++				(long)dp->cdr_dstat->ds_maxblocks,
++		                msf.msf_min,
++        		        msf.msf_sec,
++                		msf.msf_frame);
++		}
++	}
++	return (0);
++}
++LOCAL int
+ scsi_sony_write(scgp, bp, sectaddr, size, blocks, islast)
+ 	SCSI	*scgp;
+ 	caddr_t	bp;		/* address of buffer */
+diff -Nur cdrtools-2.01.foo/cdrecord/scsi_cdr.c cdrtools-2.01.foo2/cdrecord/scsi_cdr.c
+--- cdrtools-2.01.foo/cdrecord/scsi_cdr.c	2004-05-25 00:36:01.000000000 +0200
++++ cdrtools-2.01.foo2/cdrecord/scsi_cdr.c	2004-07-21 09:23:00.000000000 +0200
+@@ -107,6 +107,8 @@
+ EXPORT	int	send_cue_sheet	__PR((SCSI *scgp, caddr_t bp, long size));
+ EXPORT	int	read_buff_cap	__PR((SCSI *scgp, long *, long *));
+ EXPORT	int	scsi_blank	__PR((SCSI *scgp, long addr, int blanktype, BOOL immed));
++EXPORT	int	scsi_format	__PR((SCSI *scgp, caddr_t addr, int size, BOOL background));
++EXPORT	int	scsi_set_streaming	__PR((SCSI *scgp, caddr_t addr, int size));
+ EXPORT	BOOL	allow_atapi	__PR((SCSI *scgp, BOOL new));
+ EXPORT	int	mode_select	__PR((SCSI *scgp, Uchar *, int, int, int));
+ EXPORT	int	mode_sense	__PR((SCSI *scgp, Uchar *dp, int cnt, int page, int pcf));
+@@ -519,6 +521,32 @@
+ }
+ 
+ EXPORT int
++scsi_set_streaming(scgp, perf_desc, size)
++	SCSI	*scgp;
++	caddr_t	perf_desc;
++	int	size;
++{
++	register struct	scg_cmd	*scmd = scgp->scmd;
++
++	fillbytes((caddr_t)scmd, sizeof (*scmd), '\0');
++	scmd->addr = perf_desc;
++	scmd->size = size;
++	scmd->flags = SCG_DISRE_ENA;
++	scmd->cdb_len = SC_G5_CDBLEN;
++	scmd->sense_len = CCS_SENSE_LEN;
++	scmd->cdb.g5_cdb.cmd = 0xB6;
++	scmd->cdb.cmd_cdb[11] = 0;
++	scmd->cdb.cmd_cdb[10] = size;
++
++	scgp->cmdname = "set streaming";
++
++	printf("scsi_set_streaming\n");
++	if (scg_cmd(scgp) < 0)
++		return (-1);
++	return (0);
++}
++    
++EXPORT int
+ scsi_set_speed(scgp, readspeed, writespeed, rotctl)
+ 	SCSI	*scgp;
+ 	int	readspeed;
+@@ -1042,6 +1070,32 @@
+ 	return (0);
+ }
+ 
++
++EXPORT int
++reserve_track(scgp, size)
++	SCSI	*scgp;
++	Ulong	size;
++
++{
++	register struct	scg_cmd	*scmd = scgp->scmd;
++
++	fillbytes((caddr_t)scmd, sizeof(*scmd), '\0');
++	scmd->flags = SCG_DISRE_ENA;
++	scmd->cdb_len = SC_G1_CDBLEN;
++	scmd->sense_len = CCS_SENSE_LEN;
++	scmd->cdb.g1_cdb.cmd = 0x53;
++	scmd->cdb.g1_cdb.lun = scg_lun(scgp);
++	i_to_4_byte(&scmd->cdb.g1_cdb.addr[3], size);
++
++	scgp->cmdname = "reserve track";
++
++	if (scg_cmd(scgp) < 0) 
++		return (-1);
++
++	return (0);
++
++}
++
+ EXPORT int
+ read_rzone_info(scgp, bp, cnt)
+ 	SCSI	*scgp;
+@@ -1323,6 +1377,69 @@
+ 	return (scg_cmd(scgp));
+ }
+ 
++EXPORT int
++scsi_format(scgp, addr, size, background)
++	SCSI	*scgp;
++	caddr_t	addr;
++	int 	size;
++	BOOL 	background;
++{
++	register struct	scg_cmd	*scmd = scgp->scmd;
++	int progress=0, ret=-1, pid=-1;
++	unsigned char sense_table[18];
++	int i;
++	
++	printf("scsi_format: preparing\n");
++
++	fillbytes((caddr_t)scmd, sizeof(*scmd), '\0');
++	scmd->addr = addr;
++	scmd->size = size;
++	scmd->flags = SCG_DISRE_ENA;
++	scmd->cdb_len = SC_G5_CDBLEN;
++	scmd->sense_len = CCS_SENSE_LEN;
++	scmd->timeout = 160 * 60;     /* Do not know what to set */
++	scmd->cdb.g5_cdb.cmd = 0x04;   /* Format Unit */
++	scmd->cdb.cmd_cdb[1] = 0x11;  /* "FmtData" and "Format Code" */
++	scmd->cdb.cmd_cdb[5] = 0;
++
++	scgp->cmdname = "format unit";
++
++	printf("scsi_format: running\n");
++	ret = (scg_cmd(scgp));
++	printf("scsi_format: post processing %d\n", ret);
++	if (ret == -1) return ret;
++	if (background) {
++		if ((pid=fork()) == (pid_t)-1)
++			perror ("- [unable to fork()]");
++		else {
++			if (!pid) {
++			    while (1) {
++				if (test_unit_ready(scgp) >= 0)
++				    break;
++				sleep(1);
++			    }
++			    return ret;
++			}
++		}
++	}
++	printf("Formating in progress: 0.00 %% done.");
++	sleep(20);
++	while (progress < 0xfff0) {
++		test_unit_ready(scgp);
++		request_sense_b(scgp, (caddr_t)sense_table, 18);
++		progress = sense_table[16]<<8|sense_table[17];
++		printf("\rFormating in progress: %.2f %% done [%d].                           ", (float)(progress*100)/0x10000,progress);
++		usleep(10000);
++		/*for (i=0; i < 18; i++) {
++		    printf("%d ", sense_table[i]);
++		}*/
++	}
++	sleep(10);
++	printf("\rFormating in progress: 100.00 %% done.        \n");
++	if (pid) exit (0);
++	return ret;
++}
++
+ /*
+  * XXX First try to handle ATAPI:
+  * XXX ATAPI cannot handle SCSI 6 byte commands.
+diff -Nur cdrtools-2.01.foo/libscg/scsitransp.c cdrtools-2.01.foo2/libscg/scsitransp.c
+--- cdrtools-2.01.foo/libscg/scsitransp.c	2004-06-17 22:20:27.000000000 +0200
++++ cdrtools-2.01.foo2/libscg/scsitransp.c	2004-07-21 09:23:00.000000000 +0200
+@@ -108,6 +108,7 @@
+ EXPORT	int	scg_sense_key	__PR((SCSI *scgp));
+ EXPORT	int	scg_sense_code	__PR((SCSI *scgp));
+ EXPORT	int	scg_sense_qual	__PR((SCSI *scgp));
++EXPORT	unsigned char *scg_sense_table	__PR((SCSI *scgp));
+ EXPORT	void	scg_fprintdev	__PR((FILE *, struct scsi_inquiry *));
+ EXPORT	void	scg_printdev	__PR((struct scsi_inquiry *));
+ EXPORT	int	scg_printf	__PR((SCSI *scgp, const char *form, ...));
+@@ -1240,6 +1241,23 @@
+ }
+ 
+ /*
++ * Return all the SCSI sense table last command.
++ */
++EXPORT unsigned char *
++scg_sense_table(scgp)
++	SCSI	*scgp;
++{
++	register struct scg_cmd *cp = scgp->scmd;
++
++	if(!scg_cmd_err(scgp))
++		return (0);
++
++	if (cp->sense.code >= 0x70)
++	return &(cp->sense);
++}
++
++
++/*
+  * Return the SCSI sense code for last command.
+  */
+ EXPORT int
--- cdrtools-2.01+01a01.orig/debian/mkisofs.links
+++ cdrtools-2.01+01a01/debian/mkisofs.links
@@ -0,0 +1,5 @@
+usr/bin/mkisofs usr/bin/mkhybrid
+usr/share/man/man8/isoinfo.8 usr/share/man/man8/isodump.8
+usr/share/man/man8/isoinfo.8 usr/share/man/man8/isovfy.8
+usr/share/man/man8/isoinfo.8 usr/share/man/man8/devdump.8
+usr/share/man/man8/mkisofs.8 usr/share/man/man8/mkhybrid.8
--- cdrtools-2.01+01a01.orig/debian/dvd.reportbug
+++ cdrtools-2.01+01a01/debian/dvd.reportbug
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "You are running cdrecord with inofficial DVD patch" >&3
+echo "Bugreport might be ignored" >&3