diff options
author | heinz <heinz> | 2007-06-08 20:19:13 +0000 |
---|---|---|
committer | heinz <heinz> | 2007-06-08 20:19:13 +0000 |
commit | e7824bb4a3406a00e69699b298c876003a5829d1 (patch) | |
tree | 6e21a824558fe9e6c325221fe0bc911f53117eaa | |
parent | 43c0b2f036af75b01e7679433ad472de9d2ef81c (diff) | |
download | pkgsrc-e7824bb4a3406a00e69699b298c876003a5829d1.tar.gz |
Initial import of dvdisaster 0.70.4. from pkgsrc-wip.
The package was created by Sergey Svishchev, some changes done by me.
CD and DVD media keep their data only for a finite time (typically for
many years). After that time, data loss develops slowly with read errors
growing from the outer media region towards the inside.
Dvdisaster stores data on CD/DVD in a way that it is fully recoverable
even after some read errors have developed. This enables you to rescue
the complete data to a new medium.
Data loss is prevented by using error correcting codes. Error correction
data is either added to the medium or kept in separate error correction
files. dvdisaster works at the image level so that the recovery does not
depend on the file system of the medium. The maximum error correction
capacity is user-selectable.
-rw-r--r-- | sysutils/dvdisaster/DESCR | 13 | ||||
-rw-r--r-- | sysutils/dvdisaster/Makefile | 41 | ||||
-rw-r--r-- | sysutils/dvdisaster/PLIST | 251 | ||||
-rw-r--r-- | sysutils/dvdisaster/distinfo | 12 | ||||
-rw-r--r-- | sysutils/dvdisaster/files/scsi-netbsd.c | 185 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-aa | 15 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-ab | 24 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-ac | 136 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-ad | 49 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-ae | 51 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-af | 15 | ||||
-rw-r--r-- | sysutils/dvdisaster/patches/patch-ag | 36 |
12 files changed, 828 insertions, 0 deletions
diff --git a/sysutils/dvdisaster/DESCR b/sysutils/dvdisaster/DESCR new file mode 100644 index 00000000000..9e1e02e7297 --- /dev/null +++ b/sysutils/dvdisaster/DESCR @@ -0,0 +1,13 @@ +CD and DVD media keep their data only for a finite time (typically for +many years). After that time, data loss develops slowly with read errors +growing from the outer media region towards the inside. + +Dvdisaster stores data on CD/DVD in a way that it is fully recoverable +even after some read errors have developed. This enables you to rescue +the complete data to a new medium. + +Data loss is prevented by using error correcting codes. Error correction +data is either added to the medium or kept in separate error correction +files. dvdisaster works at the image level so that the recovery does not +depend on the file system of the medium. The maximum error correction +capacity is user-selectable. diff --git a/sysutils/dvdisaster/Makefile b/sysutils/dvdisaster/Makefile new file mode 100644 index 00000000000..0aab50819a4 --- /dev/null +++ b/sysutils/dvdisaster/Makefile @@ -0,0 +1,41 @@ +# $NetBSD: Makefile,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ +# + +DISTNAME= dvdisaster-0.70.4 +CATEGORIES= sysutils +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dvdisaster/} +EXTRACT_SUFX= .tar.bz2 + +MAINTAINER= shattered@users.sourceforge.net +HOMEPAGE= http://www.dvdisaster.com/ +COMMENT= Protects data on optical media with error correcting codes + +PKG_DESTDIR_SUPPORT= user-destdir + +BUILD_DEPENDS+= gettext-tools>=0.14:../../devel/gettext-tools + +USE_LANGUAGES= c +USE_PKGLOCALEDIR= yes +USE_TOOLS+= bash gmake pkg-config + +HAS_CONFIGURE= yes +CONFIGURE_ARGS+= --prefix=${PREFIX:Q} +CONFIGURE_ARGS+= --docdir=${PREFIX:Q}/share/doc +CONFIGURE_ARGS+= --localedir=${PREFIX:Q}/${PKGLOCALEDIR}/locale +CONFIGURE_ARGS+= --mandir=${PREFIX:Q}/${PKGMANDIR} +CONFIGURE_ARGS+= --buildroot=${DESTDIR:Q} +CONFIGURE_ARGS+= --with-embedded-src-path=no +CONFIG_SHELL= ${TOOLS_PATH.bash} +MAKE_FILE= GNUmakefile + +pre-configure: + cp ${FILESDIR:Q}/scsi-netbsd.c ${WRKSRC:Q} + +post-install: + rm -f ${DESTDIR:Q}${PREFIX:Q}/bin/dvdisaster-uninstall.sh + +.include "../../converters/libiconv/buildlink3.mk" +.include "../../devel/gettext-lib/buildlink3.mk" +.include "../../devel/libgetopt/buildlink3.mk" +.include "../../x11/gtk2/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/dvdisaster/PLIST b/sysutils/dvdisaster/PLIST new file mode 100644 index 00000000000..792841e021f --- /dev/null +++ b/sysutils/dvdisaster/PLIST @@ -0,0 +1,251 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ +bin/dvdisaster +share/doc/${PKGNAME}/CHANGELOG +share/doc/${PKGNAME}/COPYING +share/doc/${PKGNAME}/CREDITS.cs +share/doc/${PKGNAME}/CREDITS.de +share/doc/${PKGNAME}/CREDITS.en +share/doc/${PKGNAME}/README.MODIFYING +share/doc/${PKGNAME}/TODO +share/doc/${PKGNAME}/cs/background.html +share/doc/${PKGNAME}/cs/background10.html +share/doc/${PKGNAME}/cs/background20.html +share/doc/${PKGNAME}/cs/background30.html +share/doc/${PKGNAME}/cs/background40.html +share/doc/${PKGNAME}/cs/background50.html +share/doc/${PKGNAME}/cs/background60.html +share/doc/${PKGNAME}/cs/background70.html +share/doc/${PKGNAME}/cs/download.html +share/doc/${PKGNAME}/cs/download10.html +share/doc/${PKGNAME}/cs/download20.html +share/doc/${PKGNAME}/cs/example.html +share/doc/${PKGNAME}/cs/example1.html +share/doc/${PKGNAME}/cs/example10.html +share/doc/${PKGNAME}/cs/example2.html +share/doc/${PKGNAME}/cs/example20.html +share/doc/${PKGNAME}/cs/example21.html +share/doc/${PKGNAME}/cs/example22.html +share/doc/${PKGNAME}/cs/example3.html +share/doc/${PKGNAME}/cs/example30.html +share/doc/${PKGNAME}/cs/example4.html +share/doc/${PKGNAME}/cs/example40.html +share/doc/${PKGNAME}/cs/example5.html +share/doc/${PKGNAME}/cs/example50.html +share/doc/${PKGNAME}/cs/example6.html +share/doc/${PKGNAME}/cs/example80.html +share/doc/${PKGNAME}/cs/example81.html +share/doc/${PKGNAME}/cs/example82.html +share/doc/${PKGNAME}/cs/example83.html +share/doc/${PKGNAME}/cs/example90.html +share/doc/${PKGNAME}/cs/images/bg-adaptive.png +share/doc/${PKGNAME}/cs/images/bg-linear.png +share/doc/${PKGNAME}/cs/images/btn-compare.png +share/doc/${PKGNAME}/cs/images/btn-create.png +share/doc/${PKGNAME}/cs/images/btn-drive.png +share/doc/${PKGNAME}/cs/images/btn-eccfile.png +share/doc/${PKGNAME}/cs/images/btn-fix.png +share/doc/${PKGNAME}/cs/images/btn-image.png +share/doc/${PKGNAME}/cs/images/btn-protocol.png +share/doc/${PKGNAME}/cs/images/btn-read.png +share/doc/${PKGNAME}/cs/images/btn-scan.png +share/doc/${PKGNAME}/cs/images/ex-compare.png +share/doc/${PKGNAME}/cs/images/ex-create.png +share/doc/${PKGNAME}/cs/images/ex-fix.png +share/doc/${PKGNAME}/cs/images/ex-read-a.png +share/doc/${PKGNAME}/cs/images/ex-read.png +share/doc/${PKGNAME}/cs/images/ex-scan.png +share/doc/${PKGNAME}/cs/images/prefs-ecc-1.png +share/doc/${PKGNAME}/cs/images/prefs-ecc-2.png +share/doc/${PKGNAME}/cs/images/prefs-ecc.png +share/doc/${PKGNAME}/cs/images/prefs-general-1.png +share/doc/${PKGNAME}/cs/images/prefs-general-2.png +share/doc/${PKGNAME}/cs/images/prefs-general-3.png +share/doc/${PKGNAME}/cs/images/prefs-general.png +share/doc/${PKGNAME}/cs/images/prefs-read-1.png +share/doc/${PKGNAME}/cs/images/prefs-read-2.png +share/doc/${PKGNAME}/cs/images/prefs-read-3.png +share/doc/${PKGNAME}/cs/images/prefs-read.png +share/doc/${PKGNAME}/cs/images/scratch-corr.png +share/doc/${PKGNAME}/cs/images/scratch-scan.png +share/doc/${PKGNAME}/cs/index.html +share/doc/${PKGNAME}/cs/index10.html +share/doc/${PKGNAME}/cs/index20.html +share/doc/${PKGNAME}/cs/index30.html +share/doc/${PKGNAME}/cs/inline1.html +share/doc/${PKGNAME}/cs/inline2.html +share/doc/${PKGNAME}/cs/qa.html +share/doc/${PKGNAME}/cs/qa10.html +share/doc/${PKGNAME}/cs/qa20.html +share/doc/${PKGNAME}/de/background.html +share/doc/${PKGNAME}/de/background10.html +share/doc/${PKGNAME}/de/background20.html +share/doc/${PKGNAME}/de/background30.html +share/doc/${PKGNAME}/de/background40.html +share/doc/${PKGNAME}/de/background50.html +share/doc/${PKGNAME}/de/background60.html +share/doc/${PKGNAME}/de/background70.html +share/doc/${PKGNAME}/de/download.html +share/doc/${PKGNAME}/de/download10.html +share/doc/${PKGNAME}/de/download20.html +share/doc/${PKGNAME}/de/example.html +share/doc/${PKGNAME}/de/example1.html +share/doc/${PKGNAME}/de/example10.html +share/doc/${PKGNAME}/de/example2.html +share/doc/${PKGNAME}/de/example20.html +share/doc/${PKGNAME}/de/example21.html +share/doc/${PKGNAME}/de/example22.html +share/doc/${PKGNAME}/de/example3.html +share/doc/${PKGNAME}/de/example30.html +share/doc/${PKGNAME}/de/example4.html +share/doc/${PKGNAME}/de/example40.html +share/doc/${PKGNAME}/de/example5.html +share/doc/${PKGNAME}/de/example50.html +share/doc/${PKGNAME}/de/example6.html +share/doc/${PKGNAME}/de/example7.html +share/doc/${PKGNAME}/de/example80.html +share/doc/${PKGNAME}/de/example81.html +share/doc/${PKGNAME}/de/example82.html +share/doc/${PKGNAME}/de/example83.html +share/doc/${PKGNAME}/de/example84.html +share/doc/${PKGNAME}/de/example90.html +share/doc/${PKGNAME}/de/images/bg-adaptive.png +share/doc/${PKGNAME}/de/images/bg-linear.png +share/doc/${PKGNAME}/de/images/btn-compare.png +share/doc/${PKGNAME}/de/images/btn-create.png +share/doc/${PKGNAME}/de/images/btn-fix.png +share/doc/${PKGNAME}/de/images/btn-new-image.png +share/doc/${PKGNAME}/de/images/btn-protocol.png +share/doc/${PKGNAME}/de/images/btn-read.png +share/doc/${PKGNAME}/de/images/btn-scan.png +share/doc/${PKGNAME}/de/images/ex-compare-rs02.png +share/doc/${PKGNAME}/de/images/ex-compare.png +share/doc/${PKGNAME}/de/images/ex-create-rs02.png +share/doc/${PKGNAME}/de/images/ex-create.png +share/doc/${PKGNAME}/de/images/ex-fix.png +share/doc/${PKGNAME}/de/images/ex-read-a.png +share/doc/${PKGNAME}/de/images/ex-read.png +share/doc/${PKGNAME}/de/images/ex-scan.png +share/doc/${PKGNAME}/de/images/prefs-ecc-0.png +share/doc/${PKGNAME}/de/images/prefs-ecc-1.png +share/doc/${PKGNAME}/de/images/prefs-ecc-2.png +share/doc/${PKGNAME}/de/images/prefs-ecc.png +share/doc/${PKGNAME}/de/images/prefs-general-1.png +share/doc/${PKGNAME}/de/images/prefs-general-2.png +share/doc/${PKGNAME}/de/images/prefs-general-3.png +share/doc/${PKGNAME}/de/images/prefs-general.png +share/doc/${PKGNAME}/de/images/prefs-read-1.png +share/doc/${PKGNAME}/de/images/prefs-read-2.png +share/doc/${PKGNAME}/de/images/prefs-read-3.png +share/doc/${PKGNAME}/de/images/prefs-read.png +share/doc/${PKGNAME}/de/images/prefs-rs02-0.png +share/doc/${PKGNAME}/de/images/prefs-rs02-1.png +share/doc/${PKGNAME}/de/images/prefs-rs02.png +share/doc/${PKGNAME}/de/images/scratch-corr.png +share/doc/${PKGNAME}/de/images/scratch-scan.png +share/doc/${PKGNAME}/de/index.html +share/doc/${PKGNAME}/de/index10.html +share/doc/${PKGNAME}/de/index20.html +share/doc/${PKGNAME}/de/index30.html +share/doc/${PKGNAME}/de/inline1.html +share/doc/${PKGNAME}/de/inline2.html +share/doc/${PKGNAME}/de/qa.html +share/doc/${PKGNAME}/de/qa10.html +share/doc/${PKGNAME}/de/qa20.html +share/doc/${PKGNAME}/en/background.html +share/doc/${PKGNAME}/en/background10.html +share/doc/${PKGNAME}/en/background20.html +share/doc/${PKGNAME}/en/background30.html +share/doc/${PKGNAME}/en/background40.html +share/doc/${PKGNAME}/en/background50.html +share/doc/${PKGNAME}/en/background60.html +share/doc/${PKGNAME}/en/background70.html +share/doc/${PKGNAME}/en/download.html +share/doc/${PKGNAME}/en/download10.html +share/doc/${PKGNAME}/en/download20.html +share/doc/${PKGNAME}/en/example.html +share/doc/${PKGNAME}/en/example1.html +share/doc/${PKGNAME}/en/example10.html +share/doc/${PKGNAME}/en/example2.html +share/doc/${PKGNAME}/en/example20.html +share/doc/${PKGNAME}/en/example21.html +share/doc/${PKGNAME}/en/example22.html +share/doc/${PKGNAME}/en/example3.html +share/doc/${PKGNAME}/en/example30.html +share/doc/${PKGNAME}/en/example4.html +share/doc/${PKGNAME}/en/example40.html +share/doc/${PKGNAME}/en/example5.html +share/doc/${PKGNAME}/en/example50.html +share/doc/${PKGNAME}/en/example6.html +share/doc/${PKGNAME}/en/example7.html +share/doc/${PKGNAME}/en/example80.html +share/doc/${PKGNAME}/en/example81.html +share/doc/${PKGNAME}/en/example82.html +share/doc/${PKGNAME}/en/example83.html +share/doc/${PKGNAME}/en/example84.html +share/doc/${PKGNAME}/en/example90.html +share/doc/${PKGNAME}/en/images/bg-adaptive.png +share/doc/${PKGNAME}/en/images/bg-linear.png +share/doc/${PKGNAME}/en/images/btn-compare.png +share/doc/${PKGNAME}/en/images/btn-create.png +share/doc/${PKGNAME}/en/images/btn-fix.png +share/doc/${PKGNAME}/en/images/btn-new-image.png +share/doc/${PKGNAME}/en/images/btn-protocol.png +share/doc/${PKGNAME}/en/images/btn-read.png +share/doc/${PKGNAME}/en/images/btn-scan.png +share/doc/${PKGNAME}/en/images/ex-compare-rs02.png +share/doc/${PKGNAME}/en/images/ex-compare.png +share/doc/${PKGNAME}/en/images/ex-create-rs02.png +share/doc/${PKGNAME}/en/images/ex-create.png +share/doc/${PKGNAME}/en/images/ex-fix.png +share/doc/${PKGNAME}/en/images/ex-read-a.png +share/doc/${PKGNAME}/en/images/ex-read.png +share/doc/${PKGNAME}/en/images/ex-scan.png +share/doc/${PKGNAME}/en/images/prefs-ecc-0.png +share/doc/${PKGNAME}/en/images/prefs-ecc-1.png +share/doc/${PKGNAME}/en/images/prefs-ecc-2.png +share/doc/${PKGNAME}/en/images/prefs-ecc.png +share/doc/${PKGNAME}/en/images/prefs-general-1.png +share/doc/${PKGNAME}/en/images/prefs-general-2.png +share/doc/${PKGNAME}/en/images/prefs-general-3.png +share/doc/${PKGNAME}/en/images/prefs-general.png +share/doc/${PKGNAME}/en/images/prefs-read-1.png +share/doc/${PKGNAME}/en/images/prefs-read-2.png +share/doc/${PKGNAME}/en/images/prefs-read-3.png +share/doc/${PKGNAME}/en/images/prefs-read.png +share/doc/${PKGNAME}/en/images/prefs-rs02-0.png +share/doc/${PKGNAME}/en/images/prefs-rs02-1.png +share/doc/${PKGNAME}/en/images/prefs-rs02.png +share/doc/${PKGNAME}/en/images/scratch-corr.png +share/doc/${PKGNAME}/en/images/scratch-scan.png +share/doc/${PKGNAME}/en/index.html +share/doc/${PKGNAME}/en/index10.html +share/doc/${PKGNAME}/en/index20.html +share/doc/${PKGNAME}/en/index30.html +share/doc/${PKGNAME}/en/inline1.html +share/doc/${PKGNAME}/en/inline2.html +share/doc/${PKGNAME}/en/qa.html +share/doc/${PKGNAME}/en/qa10.html +share/doc/${PKGNAME}/en/qa20.html +share/doc/${PKGNAME}/images/btn-drive.png +share/doc/${PKGNAME}/images/btn-eccfile.png +share/doc/${PKGNAME}/images/btn-image.png +share/doc/${PKGNAME}/images/open-ecc.png +share/doc/${PKGNAME}/images/open-img.png +share/doc/${PKGNAME}/images/open-preferences.png +share/doc/${PKGNAME}/images/scratch-img.jpg +${PKGLOCALEDIR}/locale/cs/LC_MESSAGES/dvdisaster.mo +${PKGLOCALEDIR}/locale/de/LC_MESSAGES/dvdisaster.mo +${PKGLOCALEDIR}/locale/it/LC_MESSAGES/dvdisaster.mo +${PKGLOCALEDIR}/locale/sv/LC_MESSAGES/dvdisaster.mo +${PKGMANDIR}/cs/man1/dvdisaster.1 +${PKGMANDIR}/de/man1/dvdisaster.1 +${PKGMANDIR}/it/man1/dvdisaster.1 +${PKGMANDIR}/man1/dvdisaster.1 +@dirrm share/doc/${PKGNAME}/images +@dirrm share/doc/${PKGNAME}/en/images +@dirrm share/doc/${PKGNAME}/en +@dirrm share/doc/${PKGNAME}/de/images +@dirrm share/doc/${PKGNAME}/de +@dirrm share/doc/${PKGNAME}/cs/images +@dirrm share/doc/${PKGNAME}/cs +@dirrm share/doc/${PKGNAME} diff --git a/sysutils/dvdisaster/distinfo b/sysutils/dvdisaster/distinfo new file mode 100644 index 00000000000..824e3325f0f --- /dev/null +++ b/sysutils/dvdisaster/distinfo @@ -0,0 +1,12 @@ +$NetBSD: distinfo,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + +SHA1 (dvdisaster-0.70.4.tar.bz2) = 0ab5fe59d4c91e77c2f73b389485d0f5443d8873 +RMD160 (dvdisaster-0.70.4.tar.bz2) = 917457581309db33aef5ceddc7dddbd2ef084497 +Size (dvdisaster-0.70.4.tar.bz2) = 1148733 bytes +SHA1 (patch-aa) = 97fe33bdc514925041718992b28d75b672b4be0c +SHA1 (patch-ab) = 837785ee7f012dfcb63e1cd1bab454c8015a0c90 +SHA1 (patch-ac) = b33ae1b4142f20c16219725bb6aa03bdb2365d13 +SHA1 (patch-ad) = 3cf91a78105fac99e176fa261b10989a9c9956b6 +SHA1 (patch-ae) = 9386da56b3668141eed764714a1d07a7bb1700c4 +SHA1 (patch-af) = 33069cda271d85634189b712a1361ed2232dc804 +SHA1 (patch-ag) = 3dad3065b93817f091dea422787192e02e0e52d8 diff --git a/sysutils/dvdisaster/files/scsi-netbsd.c b/sysutils/dvdisaster/files/scsi-netbsd.c new file mode 100644 index 00000000000..4f702e543d5 --- /dev/null +++ b/sysutils/dvdisaster/files/scsi-netbsd.c @@ -0,0 +1,185 @@ +/* dvdisaster: Additional error correction for optical media. + * Copyright (C) 2004-2007 Carsten Gnoerlich. + * Project home page: http://www.dvdisaster.com + * Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, + * or direct your browser at http://www.gnu.org. + */ + +/* NetBSD support by Sergey Svishchev <svs@ropnet.ru>. + */ + +#include "dvdisaster.h" + +#include "scsi-layer.h" +#include "udf.h" + +#ifdef SYS_NETBSD + +#include <sys/device.h> +#include <sys/param.h> +#include <sys/sysctl.h> +#include <sys/scsiio.h> +#include <util.h> + + +char* DefaultDevice() +{ DeviceHandle *dh; + char *disknames, *p, raw; + int dev_type, sysctl_mib[2]; + size_t sysctl_len; + + raw = 'a' + getrawpartition(); + + sysctl_mib[0] = CTL_HW; + sysctl_mib[1] = HW_DISKNAMES; + if (-1 == sysctl(sysctl_mib, 2, NULL, &sysctl_len, NULL, 0)) { + PrintLog("Failed to get value of sysctl `hw.disknames'\n"); + return g_strdup("no_drives"); + } + if (!(disknames = g_malloc(sysctl_len))) { + PrintLog("Out of memory constructing scan device list\n"); + return g_strdup("no_drives"); + } + if (-1 == sysctl(sysctl_mib, 2, disknames, &sysctl_len, NULL, 0)) { + PrintLog("Failed to get value of sysctl `hw.disknames'\n"); + g_free(disknames); + return g_strdup("no_drives"); + } + + dh = g_malloc(sizeof(DeviceHandle)); + + for (p = strtok(disknames, " "); p; p = strtok(NULL, " ")) + { + if(!strncmp(p,"cd",2)) + { char buf[80]; + + sprintf(buf,"/dev/r%s%c", p, raw); + + memset(dh, 0, sizeof(DeviceHandle)); + dh->fd = open(buf, O_RDONLY | O_NONBLOCK); + dh->device = buf; + + if(dh->fd < 0) /* device not even present */ + continue; + + dev_type = InquireDevice(dh, 1); + close(dh->fd); + + if(dev_type != 5) /* not a CD/DVD ROM */ + continue; + + g_ptr_array_add(Closure->deviceNodes, g_strdup(buf)); + sprintf(buf, "%s (/dev/r%s%c)", dh->devinfo, p, raw); + g_ptr_array_add(Closure->deviceNames, g_strdup(buf)); + } + } + + g_free(dh); + + if(Closure->deviceNodes->len) + return g_strdup(g_ptr_array_index(Closure->deviceNodes, 0)); + else + { PrintLog(_("No CD/DVD drives found.\n" + "No drives will be pre-selected.\n")); + + return g_strdup("no_drives"); + } +} + +DeviceHandle* OpenDevice(char *device) +{ DeviceHandle *dh; + + dh = g_malloc0(sizeof(DeviceHandle)); + dh->fd = open(device, O_RDONLY | O_NONBLOCK); + + if(dh->fd < 0) + { g_free(dh); + Stop(_("Could not open %s: %s"),device, strerror(errno)); + return NULL; + } + + dh->device = g_strdup(device); + + return dh; +} + +void CloseDevice(DeviceHandle *dh) +{ + if(dh->fd) + close(dh->fd); + if(dh->device) + g_free(dh->device); + if(dh->rs02Header) + g_free(dh->rs02Header); + if(dh->mediumDescr) + g_free(dh->mediumDescr); + if(dh->isoInfo) + FreeIsoInfo(dh->isoInfo); + if(dh->defects) + FreeBitmap(dh->defects); + g_free(dh); +} + +int SendPacket(DeviceHandle *dh, unsigned char *cmd, int cdb_size, unsigned char *buf, int size, Sense *sense, int data_mode) +{ struct scsireq sc; + int rc; + + /* prepare the scsi request */ + + memset(&sc, 0, sizeof(sc)); + memcpy(sc.cmd, cmd, cdb_size); + sc.cmdlen = cdb_size; + sc.databuf = (char *)buf; + sc.datalen = size; + sc.senselen = 24; /* Maybe SENSEBUFLEN would be better? -cg */ + sc.timeout = 60000; /* linux uses 5000 = 5 * HZ */ + + switch(data_mode) + { case DATA_READ: + sc.flags = SCCMD_READ; + break; + default: + Stop(_("illegal data_mode: %d"),data_mode); + } + + /* Send the request and save the sense data. */ + + rc = ioctl(dh->fd, SCIOCCOMMAND, &sc); + memcpy(sense, sc.sense, sc.senselen_used); + + /* See what we've got back */ + + if(rc<0) return rc; /* does not happen on SCSI errors */ + + switch(sc.retsts) + { case SCCMD_OK: /* everything went fine */ + return 0; + case SCCMD_TIMEOUT: /* we don't know how to handle that yet */ + PrintLog("SendPacket() - SCSI timeout\n"); + return -1; + case SCCMD_BUSY: /* same here */ + PrintLog("SendPacket() - target busy\n"); + return -1; + case SCCMD_SENSE: /* SCSI error occurred, sense data available */ + return -1; + default: /* something other went wrong */ + return -1; + } + + return -1; /* unreachable */ +} +#endif /* SYS_NETBSD */ diff --git a/sysutils/dvdisaster/patches/patch-aa b/sysutils/dvdisaster/patches/patch-aa new file mode 100644 index 00000000000..47573c0e968 --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-aa @@ -0,0 +1,15 @@ +$NetBSD: patch-aa,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + +--- help-dialogs.c.orig 2007-01-20 16:47:21.000000000 +0100 ++++ help-dialogs.c +@@ -494,7 +494,9 @@ void AboutDialog() + AboutTextWithLink(vbox, _("\nThis program is <b>not the original</b>. It is based on the\n" + "source code of dvdisaster, but contains third-party changes.\n\n" + "Please do not bother the original authors of dvdisaster\n" +- "([www.dvdisaster.org]) about issues with this version.\n"), ++ "([www.dvdisaster.org]) about issues with this version.\n\n" ++ "The pkgsrc patches applied to this version will hopefully\n" ++ "be integrated into the next official version.\n"), + "http://www.dvdisaster.org"); + + #else diff --git a/sysutils/dvdisaster/patches/patch-ab b/sysutils/dvdisaster/patches/patch-ab new file mode 100644 index 00000000000..ebba75fe7ac --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-ab @@ -0,0 +1,24 @@ +$NetBSD: patch-ab,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + + make it work with NetBSD's SCSI layer + +--- scsi-layer.h.orig 2007-01-20 15:44:49.000000000 +0000 ++++ scsi-layer.h 2007-01-27 17:36:15.000000000 +0000 +@@ -117,7 +117,7 @@ + } Sense; + #endif + +-#ifdef SYS_UNKNOWN ++#if defined(SYS_UNKNOWN) || defined(SYS_NETBSD) + #define MAX_CDB_SIZE 16 /* longest possible SCSI command */ + + /* This is actually the little endian version of the +@@ -177,7 +177,7 @@ + + typedef struct _DeviceHandle + { +-#ifdef SYS_LINUX ++#if defined(SYS_LINUX) || defined(SYS_NETBSD) + int fd; /* device file descriptor */ + #endif + #ifdef SYS_FREEBSD diff --git a/sysutils/dvdisaster/patches/patch-ac b/sysutils/dvdisaster/patches/patch-ac new file mode 100644 index 00000000000..098a8261563 --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-ac @@ -0,0 +1,136 @@ +$NetBSD: patch-ac,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + + - Add system type SYS_NETBSD + + - Process "--with*" options before "--*dir=*". Since the latter is a more + general expression it catches "--with-*dir" when it should not. + + - Allow several "-" characters in options (provided by upstream author) + +--- scripts/bash-based-configure.orig 2006-04-18 20:14:45.000000000 +0200 ++++ scripts/bash-based-configure +@@ -60,7 +60,7 @@ + # WITH_OPTION name default adds -DWITH_OPTION_VALUE for -with-option=value args + # to CFG_WITH_OPTIONS, + +-CONFIGURE_VERSION="0.51" ++CONFIGURE_VERSION="0.51nb2" + + echo "Bash based configure V$CONFIGURE_VERSION" + echo +@@ -129,6 +129,15 @@ case "$cfg_uname" in + } + ;; + ++ NetBSD*) cfg_system=netbsd ++ CFG_SYS_OPTIONS="-DSYS_NETBSD" ++ CFG_EXE_SUFFIX="" ++ CFG_SYS_LDFLAGS="-lutil" ++ function add_linker_flags() ++ { lflags_return="-L$1 -Wl,-rpath,$1 $2" ++ } ++ ;; ++ + *) cfg_system=unknown-system + CFG_SYS_OPTIONS="-DSYS_UNKNOWN" + CFG_EXE_SUFFIX="" +@@ -188,6 +197,18 @@ do + -buildroot=* | --buildroot=*) + cfg_buildroot=$cfg_optarg ;; + ++ # process the -with-foo=bar into $cfg_with_foo=bar ++ ++ -with-*=* | --with-*=*) ++ eval `echo "$cfg_opt" | sed -e 's/[-]*with-/cfg_with_/' -e 'y/-/_/'` ;; ++ ++ # process -with-foo into $cfg_with_foo=yes ++ ++ -with-* | --with-*) ++ cfg_eval=`echo "$cfg_opt" | sed -e 's/[-]*with-/cfg_with_/' -e 'y/-/_/'` ++ cfg_eval="$cfg_eval=yes" ++ eval "$cfg_eval" ;; ++ + -*dir=* | --*dir=*) + eval `echo "$cfg_opt" | sed -e 's/[-]*/cfg_/' ` ;; + +@@ -201,18 +222,6 @@ do + -*-libraries=*) + eval `echo "$cfg_opt" | sed -e 's/[-]*/cfg_/' -e 's/-libraries/_lib/'` ;; + +- # process the -with-foo=bar into $cfg_with_foo=bar +- +- -with-*=* | --with-*=*) +- eval `echo "$cfg_opt" | sed -e 's/[-]*with-/cfg_with_/' -e 's/-/_/'` ;; +- +- # process -with-foo into $cfg_with_foo=yes +- +- -with-* | --with-*) +- cfg_eval=`echo "$cfg_opt" | sed -e 's/[-]*with-/cfg_with_/' -e 's/-/_/'` +- cfg_eval="$cfg_eval=yes" +- eval "$cfg_eval" ;; +- + -version | --version) + exit 0 ;; + +@@ -342,15 +351,16 @@ function REQUIRE_GCC() + # in one sweep at the Makefile.config generation. + + function WITH_OPTION() +-{ local option_name=`echo $1 | sed -e 's/-/_/'` ++{ local option_name=$1 ++ local cooked_name=`echo $1 | sed -e 'y/-/_/'` + local default="$2" + local description="$3" + + # first check number of arguments and deal with help mode + +- if test -z "$option_name" || test -z "$default"; then ++ if test -z "$cooked_name" || test -z "$default"; then + echo "WITH_OPTION needs at last two arguments" +- return option_name ++ return cooked_name + fi + + if test -n "$cfg_help_mode"; then +@@ -362,31 +372,31 @@ function WITH_OPTION() + + echo -n " with $option_name: " + +- eval "cfg_forced_arg=\$cfg_force_with_$option_name" ++ eval "cfg_forced_arg=\$cfg_force_with_$cooked_name" + if test -n "$cfg_forced_arg"; then + echo "$cfg_forced_arg (forced by previous tests)" +- CFG_WITH_OPTIONS="$CFG_WITH_OPTIONS -Dwith_${option_name}_$cfg_forced_arg" +- eval "cfg_with_$option_name=\$cfg_forced_arg" +- export "cfg_with_$option_name" ++ CFG_WITH_OPTIONS="$CFG_WITH_OPTIONS -Dwith_${cooked_name}_$cfg_forced_arg" ++ eval "cfg_with_$cooked_name=\$cfg_forced_arg" ++ export "cfg_with_$cooked_name" + return 0 + fi + + # now start the real processing +- # if $cfg_with_$option_name is unset, we set it to the default value ++ # if $cfg_with_$cooked_name is unset, we set it to the default value + # so that the programmer can write custom shell functions depending on it. + +- eval "cfg_user_arg=\$cfg_with_$option_name" ++ eval "cfg_user_arg=\$cfg_with_$cooked_name" + + if test -z "$cfg_user_arg"; then + echo "$default" +- CFG_WITH_OPTIONS="$CFG_WITH_OPTIONS -Dwith_${option_name}_$default" +- eval "cfg_with_$option_name=\$default" ++ CFG_WITH_OPTIONS="$CFG_WITH_OPTIONS -Dwith_${cooked_name}_$default" ++ eval "cfg_with_$cooked_name=\$default" + else + echo "$cfg_user_arg (user supplied)" +- CFG_WITH_OPTIONS="$CFG_WITH_OPTIONS -Dwith_${option_name}_$cfg_user_arg" ++ CFG_WITH_OPTIONS="$CFG_WITH_OPTIONS -Dwith_${cooked_name}_$cfg_user_arg" + fi + +- export "cfg_with_$option_name" ++ export "cfg_with_$cooked_name" + return 0 + } + diff --git a/sysutils/dvdisaster/patches/patch-ad b/sysutils/dvdisaster/patches/patch-ad new file mode 100644 index 00000000000..a3c54c5f7d3 --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-ad @@ -0,0 +1,49 @@ +$NetBSD: patch-ad,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + + - Honor configure option --with-embedded-src-path + + - Unification of SYS_(LINUX|FREEBSD|DARWIN|UNKNOWN) to "ifndef SYS_MINGW" + taken from upstream CVS sources. + +--- closure.c.orig 2007-01-20 16:44:59.000000000 +0100 ++++ closure.c +@@ -174,10 +174,13 @@ static void get_base_dirs() + char *appdata; + #endif + +- /*** The source directory is supposed to hold the most recent files, ++ /*** Unless completely disabled through a configure option, the ++ source directory is supposed to hold the most recent files, + so try this first. Not necessary under Windows as it will always + use the directory the binary has been called from. */ + ++#ifdef WITH_EMBEDDED_SRC_PATH_YES ++ + #ifndef SYS_MINGW + if(!stat(SRCDIR, &mystat)) + { Closure->binDir = g_strdup(SRCDIR); +@@ -187,12 +190,14 @@ static void get_base_dirs() + } + #endif + ++#endif /* WITH_EMBEDDED_SRC_PATH_YES */ ++ + /*** Otherwise try the installation directory. + On Linux this is a hardcoded directory. + Windows has binary distributions with no prior known installation place, + but luckily it provides a way for figuring out that location. */ + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) || defined(SYS_UNKNOWN) ++#ifndef SYS_MINGW + if(!stat(BINDIR, &mystat)) + Closure->binDir = g_strdup(BINDIR); + +@@ -212,7 +217,7 @@ static void get_base_dirs() + /*** The location of the dotfile depends on the operating system. + Under Unix the users home directory is used. */ + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) || defined(SYS_UNKNOWN) ++#ifndef SYS_MINGW + find_dotfile: + + Closure->dotFile = g_strdup_printf("%s/.dvdisaster", g_getenv("HOME")); diff --git a/sysutils/dvdisaster/patches/patch-ae b/sysutils/dvdisaster/patches/patch-ae new file mode 100644 index 00000000000..b6093793f52 --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-ae @@ -0,0 +1,51 @@ +$NetBSD: patch-ae,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + + On NetBSD behave similar to other UN*X variants regarding the browser. + +--- show-manual.c.orig 2007-01-20 16:44:59.000000000 +0100 ++++ show-manual.c +@@ -21,7 +21,7 @@ + + #include "dvdisaster.h" + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_DARWIN) + #include <sys/wait.h> + #endif + +@@ -34,7 +34,7 @@ + *** Ask user to specify his browser + ***/ + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_DARWIN) + #define SEARCH_BUTTON 1 + + typedef struct +@@ -172,7 +172,7 @@ static void msg_destroy_cb(GtkWidget *wi + bi->msg = NULL; + } + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_DARWIN) + + /* + * The following list of browsers and html wrappers +@@ -270,7 +270,7 @@ static gboolean browser_timeout_func(gpo + * Invoke the browser + */ + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_DARWIN) + static void try_browser(browser_info *bi) + { pid_t pid; + +@@ -390,7 +390,7 @@ void ShowHTML(char *target) + g_timeout_add(1000, browser_timeout_func, (gpointer)bi); + #endif + +-#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_DARWIN) + /* Try the first browser */ + + browser_index = 0; diff --git a/sysutils/dvdisaster/patches/patch-af b/sysutils/dvdisaster/patches/patch-af new file mode 100644 index 00000000000..bdfb7615a52 --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-af @@ -0,0 +1,15 @@ +$NetBSD: patch-af,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + + - Add option "--with-embedded-src-path", default value is "yes" to keep + the current behaviour. + +--- configure.orig 2007-01-20 13:30:22.000000000 +0100 ++++ configure +@@ -128,6 +128,7 @@ WITH_OPTION nls yes "[yes | no]" + WITH_OPTION memdebug no "[no | yes]" + WITH_OPTION efence no "[no | yes]" + WITH_OPTION logfile no "[no | yes]" ++WITH_OPTION embedded-src-path yes "[yes | no]" + + if test "$cfg_with_efence" == "yes"; then + if ! CHECK_LIBRARY efence malloc efence; then diff --git a/sysutils/dvdisaster/patches/patch-ag b/sysutils/dvdisaster/patches/patch-ag new file mode 100644 index 00000000000..fa683b88e4a --- /dev/null +++ b/sysutils/dvdisaster/patches/patch-ag @@ -0,0 +1,36 @@ +$NetBSD: patch-ag,v 1.1.1.1 2007/06/08 20:19:13 heinz Exp $ + + - Use SRCDIR only when configure option --with-embedded-src-path is set + to yes. + +--- dvdisaster.c.orig 2007-01-20 16:44:59.000000000 +0100 ++++ dvdisaster.c +@@ -159,10 +159,12 @@ int main(int argc, char *argv[]) + char *read_range = NULL; + #ifdef WITH_NLS_YES + char *locale_test; +- #ifndef SYS_MINGW ++ #ifdef WITH_EMBEDDED_SRC_PATH_YES ++ #ifndef SYS_MINGW + char src_locale_path[strlen(SRCDIR)+10]; +- #else ++ #else + char *bin_locale_path = NULL; ++ #endif + #endif + #endif + +@@ -245,9 +247,13 @@ int main(int argc, char *argv[]) + #ifndef SYS_MINGW + /* Try local source directory first */ + ++#ifdef WITH_EMBEDDED_SRC_PATH_YES + g_sprintf(src_locale_path,"%s/locale",SRCDIR); + bindtextdomain("dvdisaster", src_locale_path); + //printf("testing src %s\n", src_locale_path); ++ ++#endif /* WITH_EMBEDDED_SRC_PATH_YES */ ++ + /* TRANSLATORS: + This is a dummy entry which is supposed to translate into "ok". + Please do not return anything else here. */ |