summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorwiz <wiz>2006-01-05 23:27:59 +0000
committerwiz <wiz>2006-01-05 23:27:59 +0000
commit6af896600cb2895e8dedf5655295d35c8286cedd (patch)
tree3ddbabd12cc3eaf886fb83a3b50a66e3626cd5ca /sysutils
parenta2a97b71ed0f5f04de924bd7b399ed353adcf412 (diff)
downloadpkgsrc-6af896600cb2895e8dedf5655295d35c8286cedd.tar.gz
Initial import of cdrtools-2.01, replacing sysutils/cdrecord.
Cdrecord allows you to burn CDs with a CD-R/CD-RW recorder. It works as a burn engine for several applications. Cdrecord supports CD recorders from many different vendors; all SCSI-3/mmc and ATAPI/mmc compliant drives should also work. Supported features include: IDE/ATAPI, parallel-port, and SCSI drives; audio CDs, data CDs, and mixed CDs; full multi-session support, CD-RWs (rewritable), TAO, DAO, and human-readable error messages. This package also provides tools for retrieving audio tracks, reading and writing CDs, creating ISO9660/JOLIET/HFS filesystems, and verifying ISO9660 images.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/cdrtools/DESCR11
-rw-r--r--sysutils/cdrtools/MESSAGE.SunOS9
-rw-r--r--sysutils/cdrtools/MESSAGE.cdrecord.conf14
-rw-r--r--sysutils/cdrtools/Makefile90
-rw-r--r--sysutils/cdrtools/PLIST17
-rw-r--r--sysutils/cdrtools/distinfo19
-rw-r--r--sysutils/cdrtools/patches/patch-ac23
-rw-r--r--sysutils/cdrtools/patches/patch-ah40
-rw-r--r--sysutils/cdrtools/patches/patch-ai107
-rw-r--r--sysutils/cdrtools/patches/patch-aj25
-rw-r--r--sysutils/cdrtools/patches/patch-ba20
-rw-r--r--sysutils/cdrtools/patches/patch-bb20
-rw-r--r--sysutils/cdrtools/patches/patch-ca13
-rw-r--r--sysutils/cdrtools/patches/patch-cb24
-rw-r--r--sysutils/cdrtools/patches/patch-cc13
-rw-r--r--sysutils/cdrtools/patches/patch-cd13
-rw-r--r--sysutils/cdrtools/patches/patch-ce20
-rw-r--r--sysutils/cdrtools/patches/patch-cf13
-rw-r--r--sysutils/cdrtools/patches/patch-cg25
-rw-r--r--sysutils/cdrtools/patches/patch-ch22
20 files changed, 538 insertions, 0 deletions
diff --git a/sysutils/cdrtools/DESCR b/sysutils/cdrtools/DESCR
new file mode 100644
index 00000000000..1adfb2be1b0
--- /dev/null
+++ b/sysutils/cdrtools/DESCR
@@ -0,0 +1,11 @@
+Cdrecord allows you to burn CDs with a CD-R/CD-RW recorder. It
+works as a burn engine for several applications. Cdrecord supports
+CD recorders from many different vendors; all SCSI-3/mmc and
+ATAPI/mmc compliant drives should also work. Supported features
+include: IDE/ATAPI, parallel-port, and SCSI drives; audio CDs, data
+CDs, and mixed CDs; full multi-session support, CD-RWs (rewritable),
+TAO, DAO, and human-readable error messages.
+
+This package also provides tools for retrieving audio tracks,
+reading and writing CDs, creating ISO9660/JOLIET/HFS filesystems,
+and verifying ISO9660 images.
diff --git a/sysutils/cdrtools/MESSAGE.SunOS b/sysutils/cdrtools/MESSAGE.SunOS
new file mode 100644
index 00000000000..d940a2aa70b
--- /dev/null
+++ b/sysutils/cdrtools/MESSAGE.SunOS
@@ -0,0 +1,9 @@
+===========================================================================
+$NetBSD: MESSAGE.SunOS,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+You will need to stop Solaris volume management before using
+${PKGNAME_NOREV}:
+
+ /etc/init.d/volmgt stop
+
+===========================================================================
diff --git a/sysutils/cdrtools/MESSAGE.cdrecord.conf b/sysutils/cdrtools/MESSAGE.cdrecord.conf
new file mode 100644
index 00000000000..d5c31965dcb
--- /dev/null
+++ b/sysutils/cdrtools/MESSAGE.cdrecord.conf
@@ -0,0 +1,14 @@
+===========================================================================
+$NetBSD: MESSAGE.cdrecord.conf,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+Note: The location of the ${PKGNAME_NOREV} `defaults' file has been set to
+
+ ${CDRECORD_CONF}
+
+This is the pkgsrc standard config file location, NOT the ${PKGNAME_NOREV}
+standard location, which is /etc/default/cdrecord.
+
+The reason for this is that pkgsrc packages should not use configuration
+files outside ${LOCALBASE} unless they are explicitly set by the user.
+
+===========================================================================
diff --git a/sysutils/cdrtools/Makefile b/sysutils/cdrtools/Makefile
new file mode 100644
index 00000000000..a8e91e1895d
--- /dev/null
+++ b/sysutils/cdrtools/Makefile
@@ -0,0 +1,90 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+DISTNAME= cdrtools-2.01
+CATEGORIES= sysutils
+MASTER_SITES= ftp://ftp.berlios.de/pub/cdrecord/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= tech-pkg@NetBSD.org
+HOMEPAGE= http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
+COMMENT= Software for creating ISO9660 images and writing CDs/CD-RWs
+
+CONFLICTS= mkisofs-[0-9]* cdrtools-ossdvd-[0-9]* cdrecord-[0-9]*
+
+PKG_INSTALLATION_TYPES= overwrite pkgviews
+
+.include "../../mk/bsd.prefs.mk"
+
+USE_TOOLS+= gmake tbl
+
+# avoid picking up a bad ${ARCH} during the build
+MAKE_ENV+= ARCH=""
+MAKE_ENV+= MAKEPROG="gmake"
+MAKE_ENV+= COPTX=${CFLAGS:M*:Q}
+MAKE_ENV+= LDOPTX=${LDFLAGS:M*:Q}
+
+# if we're using a gcc which is named gcc, we need to set CCOM=gcc
+# in MAKE_ENV so the make infrastructure picks the right options.
+.if !empty(CC:M*gcc*)
+MAKE_ENV+= CCOM="gcc"
+.endif
+
+# allow us to override the default /etc/default/cdrecord by patching
+# the documentation appropriately. Additionally, we also provide a
+# MESSAGE stating the reasons we do this, as required by the license.
+CDRECORD_CONF?= ${PKG_SYSCONFDIR}/cdrecord.conf
+
+.if ${CDRECORD_CONF} != "/etc/default/cdrecord"
+MESSAGE_SRC+= MESSAGE.cdrecord.conf
+MESSAGE_SUBST+= PKGNAME_NOREV=${PKGNAME_NOREV}
+MESSAGE_SUBST+= CDRECORD_CONF=${CDRECORD_CONF}
+.endif
+
+INSTALLATION_DIRS= bin man/man1 man/man8
+
+SUBST_CLASSES+= fix
+SUBST_STAGE.fix= post-patch
+SUBST_FILES.fix= cdrecord/defaults.c cdrecord/cdrecord.1 \
+ readcd/readcd.1
+SUBST_SED.fix= -e "s,@CDRECORD_CONF@,${CDRECORD_CONF},g"
+SUBST_MESSAGE.fix= "Fixing paths."
+
+post-extract:
+ ${CP} ${WRKSRC}/RULES/os-freebsd.id ${WRKSRC}/RULES/os-dragonfly.id
+
+do-configure:
+ cd ${WRKSRC}/RULES; \
+ for suffix in netbsd-cc.rul netbsd-gcc.rul; do \
+ if [ ! -f ${MACHINE}-$$suffix ]; then \
+ ${LN} -sf i386-$$suffix ${MACHINE}-$$suffix; \
+ fi; \
+ done
+
+post-build:
+ cd ${WRKSRC}; \
+ for file in cdda2wav/cdda2wav.1 mkisofs/mkisofs.8; do \
+ ${TBL} $${file} > $${file}.tmp; \
+ ${MV} -f $${file}.tmp $${file}; \
+ done
+
+do-install:
+ cd ${WRKSRC}/cdda2wav; \
+ ${INSTALL_PROGRAM} OBJ/*/cdda2wav ${PREFIX}/bin; \
+ ${INSTALL_MAN} cdda2wav.1 ${PREFIX}/man/man1
+ cd ${WRKSRC}/cdrecord; \
+ ${INSTALL_PROGRAM} OBJ/*/cdrecord ${PREFIX}/bin; \
+ ${INSTALL_MAN} cdrecord.1 ${PREFIX}/man/man1
+ cd ${WRKSRC}/mkisofs; \
+ ${INSTALL_PROGRAM} OBJ/*/mkisofs ${PREFIX}/bin; \
+ ${INSTALL_MAN} mkisofs.8 ${PREFIX}/man/man8
+ cd ${WRKSRC}/mkisofs/diag; \
+ for f in devdump isodump isoinfo isovfy; do \
+ ${INSTALL_PROGRAM} OBJ/*/$$f ${PREFIX}/bin; \
+ ${INSTALL_MAN} isoinfo.8 ${PREFIX}/man/man8/$$f.8; \
+ done
+ cd ${WRKSRC}/readcd; \
+ ${INSTALL_PROGRAM} OBJ/*/readcd ${PREFIX}/bin; \
+ ${INSTALL_MAN} readcd.1 ${PREFIX}/man/man1
+
+.include "../../mk/ossaudio.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/cdrtools/PLIST b/sysutils/cdrtools/PLIST
new file mode 100644
index 00000000000..f53cce8d274
--- /dev/null
+++ b/sysutils/cdrtools/PLIST
@@ -0,0 +1,17 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+bin/cdda2wav
+bin/cdrecord
+bin/devdump
+bin/isodump
+bin/isoinfo
+bin/isovfy
+bin/mkisofs
+bin/readcd
+man/man1/cdda2wav.1
+man/man1/cdrecord.1
+man/man1/readcd.1
+man/man8/devdump.8
+man/man8/isodump.8
+man/man8/isoinfo.8
+man/man8/isovfy.8
+man/man8/mkisofs.8
diff --git a/sysutils/cdrtools/distinfo b/sysutils/cdrtools/distinfo
new file mode 100644
index 00000000000..8917d06793c
--- /dev/null
+++ b/sysutils/cdrtools/distinfo
@@ -0,0 +1,19 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+SHA1 (cdrtools-2.01.tar.bz2) = f94cfe51dd512d4e0b9106b986bde12d4f7967ce
+RMD160 (cdrtools-2.01.tar.bz2) = b34a8b81b21cc8ed1927f34e44130513d2ee0407
+Size (cdrtools-2.01.tar.bz2) = 1400389 bytes
+SHA1 (patch-ac) = 45c660e3d9f55e161614f29b0e94e177012213aa
+SHA1 (patch-ah) = 8dc829b923493f1d0f47926fc11af30ceeb4b0db
+SHA1 (patch-ai) = df338ebfc23b8016fd839a41f279e1e31835ee05
+SHA1 (patch-aj) = ef92e08cd85ee9ade5c99ea52481f5887365f726
+SHA1 (patch-ba) = 3eb8a53bba94e3226d32e39fe0a7f18086c5797b
+SHA1 (patch-bb) = d78453246a81d82c71e8d1d831acccff4b2b40fd
+SHA1 (patch-ca) = 12111a160a9e968d71c73f84685d998d4330ade6
+SHA1 (patch-cb) = 1819e8e0ee38549c276ef8eb46a3b0a62661a083
+SHA1 (patch-cc) = a14098dd14e0b58d3fed1167341a22167eea7c19
+SHA1 (patch-cd) = 5bedbdd8b7535948f0497680b0561abb98c80864
+SHA1 (patch-ce) = eb12b12d26f8451654124abcd0424ff29e89bcf8
+SHA1 (patch-cf) = 021b7979320dbc2fdd7a40e9cef0a3db6844d874
+SHA1 (patch-cg) = 945db00ff13460dce1f9ce38e8ff29ab7cbd1f85
+SHA1 (patch-ch) = 1060be9a0c7371ad52b23b22f3b5dcf09cb99f7f
diff --git a/sysutils/cdrtools/patches/patch-ac b/sysutils/cdrtools/patches/patch-ac
new file mode 100644
index 00000000000..bccb725a438
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ac
@@ -0,0 +1,23 @@
+$NetBSD: patch-ac,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- include/btorder.h.orig 2003-06-15 23:41:22.000000000 +0200
++++ include/btorder.h
+@@ -28,6 +28,9 @@
+ #include <sys/types.h> /* try to load isa_defs.h on Solaris */
+ #define _INCL_SYS_TYPES_H
+ #endif
++#ifdef __NetBSD__
++#include <machine/endian.h>
++#endif
+
+ #ifndef _MCONFIG_H
+ #include <mconfig.h> /* load bit/byte-oder from xmconfig.h*/
+@@ -108,7 +111,7 @@ error Only one of _BIT_FIELDS_LTOH or _
+ # if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
+ defined(__PPC) || defined(powerpc) || defined(__powerpc__)
+
+-# if defined(__BIG_ENDIAN__)
++# if defined(__BIG_ENDIAN__) || BYTE_ORDER == BIG_ENDIAN
+ # define _BIT_FIELDS_HTOL
+ # else
+ # define _BIT_FIELDS_LTOH
diff --git a/sysutils/cdrtools/patches/patch-ah b/sysutils/cdrtools/patches/patch-ah
new file mode 100644
index 00000000000..de345a01b04
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ah
@@ -0,0 +1,40 @@
+$NetBSD: patch-ah,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- cdda2wav/setuid.c.orig 2004-08-19 12:54:34.000000000 +0200
++++ cdda2wav/setuid.c
+@@ -94,7 +94,7 @@ void needroot(necessary)
+
+ if (geteuid() == 0) return; /* nothing to do */
+
+-#if defined _POSIX_SAVED_IDS && defined (HAVE_SETEUID)
++#if defined (HAVE_SETEUID)
+ if (seteuid(effective_uid)) {
+ perror("seteuid in needroot()");
+ exit(PERM_ERROR);
+@@ -133,7 +133,7 @@ void dontneedroot()
+ return;
+ if (geteuid() != 0) return; /* nothing to do */
+
+-#if defined _POSIX_SAVED_IDS && defined (HAVE_SETEUID)
++#if defined (HAVE_SETEUID)
+ if (seteuid(real_uid)) {
+ perror("seteuid in dontneedroot()");
+ exit(PERM_ERROR);
+@@ -217,7 +217,7 @@ void needgroup(necessary)
+
+ if (getegid() == effective_gid) return; /* nothing to do */
+
+-#if defined _POSIX_SAVED_IDS && defined (HAVE_SETEGID)
++#if defined (HAVE_SETEGID)
+ if (setegid(effective_gid)) {
+ perror("setegid in needgroup()");
+ exit(PERM_ERROR);
+@@ -249,7 +249,7 @@ void dontneedgroup()
+ exit(INTERNAL_ERROR);
+ }
+ if (getegid() != effective_gid) return; /* nothing to do */
+-#if defined _POSIX_SAVED_IDS && defined (HAVE_SETEGID)
++#if defined (HAVE_SETEGID)
+ if (setegid(real_gid)) {
+ perror("setegid in dontneedgroup()");
+ exit(PERM_ERROR);
diff --git a/sysutils/cdrtools/patches/patch-ai b/sysutils/cdrtools/patches/patch-ai
new file mode 100644
index 00000000000..203e79b86bd
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ai
@@ -0,0 +1,107 @@
+$NetBSD: patch-ai,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- libscg/scsi-bsd.c.orig 2004-01-15 00:13:05.000000000 +0100
++++ libscg/scsi-bsd.c
+@@ -48,7 +48,7 @@ static char __sccsid[] =
+ * Choose your name instead of "schily" and make clear that the version
+ * string is related to a modified source.
+ */
+-LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.42"; /* The version for this transport*/
++LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.42nb1"; /* The version for this transport*/
+
+ #define MAX_SCG 16 /* Max # of SCSI controllers */
+ #define MAX_TGT 16
+@@ -108,7 +108,7 @@ scgo_version(scgp, what)
+ * return "schily" for the SCG_AUTHOR request.
+ */
+ case SCG_AUTHOR:
+- return (_scg_auth_schily);
++ return ("frueauf");
+ case SCG_SCCS_ID:
+ return (__sccsid);
+ }
+@@ -140,6 +140,15 @@ scgo_open(scgp, device)
+ register int l;
+ register int nopen = 0;
+ char devname[64];
++#if defined(__NetBSD__)
++ struct scsi_addr mysaddr;
++#if defined(__i386__) || defined(__amd64__)
++ char slicename[] = "d"; /* i386 is special */
++#else
++ char slicename[] = "c"; /* this is what the rest uses */
++#endif
++ char *myslicename = slicename;
++#endif
+
+ if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
+ errno = EINVAL;
+@@ -166,6 +175,60 @@ scgo_open(scgp, device)
+ if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2))
+ goto openbydev;
+
++
++/*
++ * I know of no method in NetBSD to probe the scsibus and get the mapping
++ * busnumber,target,lun --> devicename.
++ *
++ * Because of this implement a true bruteforce hack to find
++ * out what cdroms there are.
++ *
++ * Note that this method only finds cd0-cd7. Anything higher
++ * than this needs additional tweaks.
++ *
++ * Feel free to implement this cleanly if you have better knowledge.
++ * Until then this helps to get -scanbus und thus xcdroast working :-)
++ *
++ */
++#if defined(__NetBSD__)
++ if (busno >= 0 && tgt >= 0 && tlun >= 0) {
++ for (l=0; l < MAX_LUN ; l++) {
++ sprintf(devname, "/dev/rcd%d%s", l, myslicename);
++ f = open(devname, O_RDWR);
++ if (f >= 0) {
++ if (ioctl(f, SCIOCIDENTIFY, &mysaddr) < 0) {
++ close(f);
++ errno = EINVAL;
++ return (0);
++ }
++ if (busno == SADDR_BUS(mysaddr) && tgt == SADDR_TARGET(mysaddr) && tlun == SADDR_LUN(mysaddr)) {
++ scglocal(scgp)->scgfiles[busno][tgt][tlun] = f;
++ return(1);
++ }
++ } else goto openbydev;
++ }
++ } else for (l=0; l < MAX_LUN ; l++) {
++ sprintf(devname, "/dev/rcd%d%s", l, myslicename);
++ f = open(devname, O_RDWR);
++ if (f >= 0) {
++ if (ioctl(f, SCIOCIDENTIFY, &mysaddr) < 0) {
++ close(f);
++ errno = EINVAL;
++ return (0);
++ }
++ scg_scsibus(scgp) = busno = SADDR_BUS(mysaddr);
++ scg_target(scgp) = tgt = SADDR_TARGET(mysaddr);
++ if ((tlun >= 0) && (tlun != SADDR_LUN(mysaddr))) {
++ close(f);
++ errno = EINVAL;
++ return (0);
++ }
++ scg_lun(scgp) = tlun = SADDR_LUN(mysaddr);
++ if (scg_setup(scgp, f, busno, tgt, tlun))
++ nopen++;
++ }
++ }
++#else /* not __NetBSD__ */
+ if (busno >= 0 && tgt >= 0 && tlun >= 0) {
+
+ js_snprintf(devname, sizeof (devname),
+@@ -202,6 +265,7 @@ scgo_open(scgp, device)
+ }
+ }
+ }
++#endif /* end of not __NetBSD__ */
+ /*
+ * Could not open /dev/su-* or got dev=devname:b,l,l / dev=devname:@,l
+ * We do the apropriate tests and try our best.
diff --git a/sysutils/cdrtools/patches/patch-aj b/sysutils/cdrtools/patches/patch-aj
new file mode 100644
index 00000000000..2f9f576e8e8
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-aj
@@ -0,0 +1,25 @@
+$NetBSD: patch-aj,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- cdrecord/scsi_cdr.c.orig 2004-05-25 00:36:01.000000000 +0200
++++ cdrecord/scsi_cdr.c
+@@ -319,7 +319,11 @@ request_sense(scgp)
+ char sensebuf[CCS_SENSE_LEN];
+ register struct scg_cmd *scmd = scgp->scmd;
+
+-
++#ifdef __NetBSD__
++ /* request sense already done by kernel */
++ scg_prsense((Uchar *)scgp->scmd->u_sense.cmd_sense,
++ scgp->scmd->sense_count);
++#else
+ fillbytes((caddr_t)scmd, sizeof (*scmd), '\0');
+ scmd->addr = sensebuf;
+ scmd->size = sizeof (sensebuf);
+@@ -335,6 +339,7 @@ request_sense(scgp)
+ if (scg_cmd(scgp) < 0)
+ return (-1);
+ scg_prsense((Uchar *)sensebuf, CCS_SENSE_LEN - scg_getresid(scgp));
++#endif
+ return (0);
+ }
+
diff --git a/sysutils/cdrtools/patches/patch-ba b/sysutils/cdrtools/patches/patch-ba
new file mode 100644
index 00000000000..5d5f38c1f6c
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ba
@@ -0,0 +1,20 @@
+$NetBSD: patch-ba,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- readcd/readcd.c.orig 2004-09-08 19:24:14.000000000 +0200
++++ readcd/readcd.c
+@@ -398,12 +398,12 @@ main(ac, av)
+ /*
+ * We don't need root privilleges anymore.
+ */
+-#ifdef HAVE_SETREUID
+- if (setreuid(-1, getuid()) < 0)
+-#else
+ #ifdef HAVE_SETEUID
+ if (seteuid(getuid()) < 0)
+ #else
++#ifdef HAVE_SETREUID
++ if (setreuid(-1, getuid()) < 0)
++#else
+ if (setuid(getuid()) < 0)
+ #endif
+ #endif
diff --git a/sysutils/cdrtools/patches/patch-bb b/sysutils/cdrtools/patches/patch-bb
new file mode 100644
index 00000000000..4fd68513a3e
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-bb
@@ -0,0 +1,20 @@
+$NetBSD: patch-bb,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- mkisofs/mkisofs.c.orig 2004-09-08 19:27:36.000000000 +0200
++++ mkisofs/mkisofs.c
+@@ -2407,12 +2407,12 @@ parse_input_files:
+ }
+ }
+ /* We don't need root privilleges anymore. */
+-#ifdef HAVE_SETREUID
+- if (setreuid(-1, getuid()) < 0)
+-#else
+ #ifdef HAVE_SETEUID
+ if (seteuid(getuid()) < 0)
+ #else
++#ifdef HAVE_SETREUID
++ if (setreuid(-1, getuid()) < 0)
++#else
+ if (setuid(getuid()) < 0)
+ #endif
+ #endif
diff --git a/sysutils/cdrtools/patches/patch-ca b/sysutils/cdrtools/patches/patch-ca
new file mode 100644
index 00000000000..0e580db804e
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ca
@@ -0,0 +1,13 @@
+$NetBSD: patch-ca,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- cdrecord/defaults.c.orig 2004-03-02 02:10:32.000000000 +0100
++++ cdrecord/defaults.c
+@@ -54,7 +54,7 @@ open_cdrdefaults()
+ * don't contribute work and don't give support, they are causing extra
+ * work for me and this way slow down the cdrecord development.
+ */
+- return (defltopen("/etc/default/cdrecord"));
++ return (defltopen("@CDRECORD_CONF@"));
+ }
+
+ EXPORT void
diff --git a/sysutils/cdrtools/patches/patch-cb b/sysutils/cdrtools/patches/patch-cb
new file mode 100644
index 00000000000..851a7a841c7
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-cb
@@ -0,0 +1,24 @@
+$NetBSD: patch-cb,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- cdrecord/cdrecord.1.orig 2004-07-11 01:28:23.000000000 +0200
++++ cdrecord/cdrecord.1
+@@ -2016,8 +2016,8 @@ login shell.
+
+ .SH FILES
+ .TP
+-/etc/default/cdrecord
+-Default values can be set for the following options in /etc/default/cdrecord.
++@CDRECORD_CONF@
++Default values can be set for the following options in @CDRECORD_CONF@.
+ For example:
+ .SM CDR_FIFOSIZE=8m
+ or
+@@ -2026,7 +2026,7 @@ or
+ .TP
+ CDR_DEVICE
+ This may either hold a device identifier that is suitable to the open
+-call of the SCSI transport library or a label in the file /etc/default/cdrecord
++call of the SCSI transport library or a label in the file @CDRECORD_CONF@
+ that allows to identify a specific drive on the system.
+ .TP
+ CDR_SPEED
diff --git a/sysutils/cdrtools/patches/patch-cc b/sysutils/cdrtools/patches/patch-cc
new file mode 100644
index 00000000000..5129efbb81b
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-cc,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- readcd/readcd.1.orig Wed Dec 25 02:28:41 2002
++++ readcd/readcd.1
+@@ -186,7 +186,7 @@ If the argument to the
+ .B dev=
+ option does not contain the characters ',', '/', '@' or ':',
+ it is interpreted as an label name that may be found in the file
+-/etc/default/cdrecord (see FILES section).
++@CDRECORD_CONF@ (see FILES section).
+ .TP
+ .BI timeout= #
+ Set the default SCSI command timeout value to
diff --git a/sysutils/cdrtools/patches/patch-cd b/sysutils/cdrtools/patches/patch-cd
new file mode 100644
index 00000000000..8002adc295d
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-cd
@@ -0,0 +1,13 @@
+$NetBSD: patch-cd,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- include/schily.h.orig 2004-03-05 01:30:40.000000000 +0100
++++ include/schily.h
+@@ -116,7 +116,7 @@ extern int fspawnl __PR((FILE *, FILE *,
+ extern int fspawnv_nowait __PR((FILE *, FILE *, FILE *,
+ const char *, int, char *const*));
+ extern int fgetline __PR((FILE *, char *, int));
+-extern int fgetstr __PR((FILE *, char *, int));
++extern int schily_fgetstr __PR((FILE *, char *, int));
+ extern void file_raise __PR((FILE *, int));
+ extern int fileclose __PR((FILE *));
+ extern FILE *fileluopen __PR((int, const char *));
diff --git a/sysutils/cdrtools/patches/patch-ce b/sysutils/cdrtools/patches/patch-ce
new file mode 100644
index 00000000000..a85d748a570
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ce
@@ -0,0 +1,20 @@
+$NetBSD: patch-ce,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- libschily/stdio/fgetstr.c 2004/04/26 07:42:03 1.1
++++ libschily/stdio/fgetstr.c 2004/04/26 07:42:22
+@@ -26,7 +26,7 @@
+ */
+
+ EXPORT int
+-fgetstr(f, buf, len)
++schily_fgetstr(f, buf, len)
+ register FILE *f;
+ char *buf;
+ register int len;
+@@ -60,5 +60,5 @@
+ char *buf;
+ int len;
+ {
+- return (fgetstr(stdin, buf, len));
++ return (schily_fgetstr(stdin, buf, len));
+ }
diff --git a/sysutils/cdrtools/patches/patch-cf b/sysutils/cdrtools/patches/patch-cf
new file mode 100644
index 00000000000..008d494a167
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-cf
@@ -0,0 +1,13 @@
+$NetBSD: patch-cf,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- mkisofs/tree.c.orig 2004-06-12 15:16:37.000000000 +0200
++++ mkisofs/tree.c
+@@ -1577,7 +1577,7 @@ insert_file_entry(this_dir, whole_path,
+ /*
+ * >= is required by the large file summit standard.
+ */
+- if (S_ISREG(lstatbuf.st_mode) && (lstatbuf.st_size >= (off_t)0x7FFFFFFF)) {
++ if (S_ISREG(lstatbuf.st_mode) && (lstatbuf.st_size >= (off_t)0x0FFFFFFFF)) {
+ #endif
+ #ifdef EOVERFLOW
+ errno = EOVERFLOW;
diff --git a/sysutils/cdrtools/patches/patch-cg b/sysutils/cdrtools/patches/patch-cg
new file mode 100644
index 00000000000..707046ce8d2
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-cg
@@ -0,0 +1,25 @@
+$NetBSD: patch-cg,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- mkisofs/write.c.orig 2004-08-24 18:21:55.000000000 +0200
++++ mkisofs/write.c
+@@ -463,7 +463,7 @@ write_one_file(filename, size, outfile)
+ static char buffer[SECTOR_SIZE * NSECT];
+ FILE *infile;
+ off_t remain;
+- int use;
++ off_t use;
+
+
+ if ((infile = fopen(filename, "rb")) == NULL) {
+@@ -529,7 +529,10 @@ static char buffer[SECTOR_SIZE * NSECT]
+ fflush(stderr);
+ }
+ #endif
+- remain -= use;
++ if (use > remain)
++ remain = 0;
++ else
++ remain -= use;
+ }
+ fclose(infile);
+ }/* write_one_file(... */
diff --git a/sysutils/cdrtools/patches/patch-ch b/sysutils/cdrtools/patches/patch-ch
new file mode 100644
index 00000000000..addad165bfc
--- /dev/null
+++ b/sysutils/cdrtools/patches/patch-ch
@@ -0,0 +1,22 @@
+$NetBSD: patch-ch,v 1.1.1.1 2006/01/05 23:27:59 wiz Exp $
+
+--- cdda2wav/cdda2wav.c.orig 2004-08-24 17:06:14.000000000 +0200
++++ cdda2wav/cdda2wav.c
+@@ -970,7 +970,7 @@ prio_done:
+ dontneedroot();
+ }
+ #else
+-#if defined _POSIX_PRIORITY_SCHEDULING
++#if defined _POSIX_PRIORITY_SCHEDULING && (_POSIX_PRIORITY_SCHEDULING != -1)
+ #include <sched.h>
+
+ static void
+@@ -2616,7 +2616,7 @@ Rate Divider Rate Divider
+ if ( global.verbose != 0 ) {
+ fputs( "#Cdda2wav version ", stderr );
+ fputs( VERSION, stderr );
+-#if defined _POSIX_PRIORITY_SCHEDULING || defined HAVE_SYS_PRIOCNTL_H
++#if (defined _POSIX_PRIORITY_SCHEDULING && (_POSIX_PRIORITY_SCHEDULING != -1)) || defined HAVE_SYS_PRIOCNTL_H
+ fputs( ", real time sched.", stderr );
+ #endif
+ #if defined ECHO_TO_SOUNDCARD