Subject: sysutils/dvd+rw-tools and sysutils/bacula
To: None <pkgsrc-users@netbsd.org>
From: Rumko <rumcic@gmail.com>
List: pkgsrc-users
Date: 02/11/2007 23:38:16
--nextPart2816537.NNf9W0W9Ei
Content-Type: multipart/mixed;
  boundary="Boundary-01=_Zr5zFQEhIhCNmjD"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--Boundary-01=_Zr5zFQEhIhCNmjD
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Bacula needs a patched dvd+rw-tools so that you can use DVDs with it. I mad=
e a=20
patch that lets you get that patched dvd+rw-tools. It uses PKG_OPTIONS so=20
that only people who actually want to use DVDs with bacula will have the=20
necessary patch applied.

The dvd+rw-tools-6.1.bacula.patch was copied straight from bacula's tarball=
=20
and changed so that it applies cleanly.

Hopefully the attached patch is good enough to be commited.

To apply, just do the following:
cd /usr/pkgsrc/sysutils/dvd+rw-tools
patch -p0 < /path/to/dvd+rw-tools.patch

--Boundary-01=_Zr5zFQEhIhCNmjD
Content-Type: text/x-diff;
  charset="utf-8";
  name="dvd+rw-tools.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="dvd+rw-tools.patch"

=2D-- Makefile.orig	2007-02-11 22:47:52.000000000 +0100
+++ Makefile	2007-02-11 23:04:53.000000000 +0100
@@ -24,6 +24,8 @@
=20
 LDFLAGS.NetBSD+=3D	-lrt # sem_* functions
=20
+.include "options.mk"
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/growisofs ${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/growisofs.1 ${PREFIX}/${PKGMANDIR}/man1
=2D-- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ files/dvd+rw-tools-6.1.bacula.patch	2007-02-11 23:05:30.000000000 +0100
@@ -0,0 +1,85 @@
+--- growisofs.c.orig	2006-01-26 22:16:54.000000000 +0100
++++ growisofs.c	2006-02-15 00:00:44.000000000 +0100
+@@ -355,12 +355,17 @@
+  * - Treat only x73xx OPC errors as fatal;
+  * - Fix typo in -speed scaling code;
+  * - permit tracksize to be not divisible by 32KB in DAO mode;
++ * 6.1.1: (by Nicolas Boichat, Bacula project)
++ * - Allow session to cross 4GB boundary regardless of medium type
++ *   (don't need to have a DL media)
++ * - Add a -F option (used instead of -M or -Z), which displays next_sess=
ion
++ *   offset and capacity (free space =3D next_session - capacity).
+  */
+ #define PRINT_VERSION(cmd)	do {			\
+     char *s=3Dstrrchr((cmd),'/');				\
+     s ? s++ : (s=3D(cmd));				\
+     printf ("* %.*sgrowisofs by <appro@fy.chalmers.se>,"\
+-	    " version 6.1,\n",(int)(s-(cmd)),(cmd));	\
++	    " version 6.1.1,\n",(int)(s-(cmd)),(cmd));	\
+ } while (0)
+ =0C
+ #define _LARGEFILE_SOURCE=20
+@@ -2329,6 +2334,18 @@
+ 		else          in_device =3D argv[++i];
+ 		dev_found =3D 'Z';
+ 	    }
++	    else if (argv[i][1] =3D=3D 'F')
++	    {	if (len > 2) in_device =3D argv[i]+2;
++		else	     in_device =3D argv[++i];
++		dev_found =3D 'F';
++		dry_run =3D 1; /* NEVER write anything with -F */
++	    }
++	    else if (!strncmp(opt,"-free-space",11))
++	    {	if (len > 11) in_device =3D opt+11;
++		else          in_device =3D argv[++i];
++		dev_found =3D 'F';
++		dry_run =3D 1; /* NEVER write anything with -F */
++	    }
+ 	    else if (!strcmp(opt,"-poor-man"))
+ 	    {	if (poor_man<0) poor_man =3D 1;
+ 		continue;
+@@ -2542,7 +2559,9 @@
+ 		fprintf (stderr,"    you most likely want to use -Z option.\n"),=20
+ 		exit (FATAL_START(errno));
+=20
+-	    if (dev_found =3D=3D 'M')
++		if ((dev_found =3D=3D 'M') ||=20
++			((dev_found =3D=3D 'F') && !(mmc_profile&0x10000)) && (saved_descripto=
rs[0].type[0] || saved_descriptors[0].type[1] || saved_descriptors[0].type[=
2]))
++				/* -F : The medium is not blank, there is a fs on it (the_buffer[0,1 =
or 2] !=3D 0), so compute next_session. */
+ 	    {	if (memcmp (saved_descriptors[0].type,"\1CD001",6))
+ 	            fprintf (stderr,":-( %s doesn't look like isofs...\n",
+ 		    		in_device), exit(FATAL_START(EMEDIUMTYPE));
+@@ -2565,7 +2584,7 @@
+ 			exit(FATAL_START(EINVAL));
+ 		}
+ 		else if (next_session > (0x200000-0x5000)) /* 4GB/2K-40MB/2K */
+-		    if ((mmc_profile&0xFFFF)!=3D0x2B || !no_4gb_check)
++		    if (!no_4gb_check)
+ 			fprintf (stderr,":-( next session would cross 4GB "
+ 					"boundary, aborting...\n"),
+ 			exit (FATAL_START(ENOSPC));
+@@ -2608,7 +2627,7 @@
+ 	exit (FATAL_START(EINVAL));
+=20
+     if (imgfd<0)
+-    {	if (mkisofs_argc=3D=3D1)
++    {	if ((mkisofs_argc=3D=3D1) && (dev_found !=3D 'F'))
+ 	    fprintf (stderr,"%s: no mkisofs options specified, "
+ 			    "aborting...\n",argv[0]),
+ 	    exit (FATAL_START(EINVAL));
+@@ -2880,6 +2899,15 @@
+ 	}
+     }
+=20
++	if (dev_found =3D=3D 'F') {
++		off64_t capacity =3D 0;
++		printf("next_session=3D%lld\n", next_session*CD_BLOCK);
++		if (ioctl_handle!=3DINVALID_HANDLE)
++			capacity =3D get_capacity (ioctl_handle);
++		printf("capacity=3D%lld\n", capacity);
++		exit(0);
++	}
++
+     if (imgfd>=3D0)
+     {	quiet--;
+ 	if (builtin_dd (imgfd,out_fd,next_session*CD_BLOCK) < 0)
=2D-- options.mk.orig	1970-01-01 01:00:00.000000000 +0100
+++ options.mk	2007-02-11 23:27:44.000000000 +0100
@@ -0,0 +1,11 @@
+PKG_OPTIONS_VAR=3D	PKG_OPTIONS.dvd+rw-tools
+PKG_SUPPORTED_OPTIONS=3D	bacula-patch
+
+#PKG_DEBUG_LEVEL=3D1
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mbacula-patch)
+post-patch:
+	cd ${WRKSRC}; patch -p0 < ${PKGSRCDIR}/${PKGPATH}/files/dvd+rw-tools-6.1.=
bacula.patch
+.endif

--Boundary-01=_Zr5zFQEhIhCNmjD--

--nextPart2816537.NNf9W0W9Ei
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (DragonFly)

iD8DBQBFz5raxV3ce2RZW70RAjS5AJ4ukL4xi6pelZHZd/EG8IK1lvWMfQCfSiLj
g71fyaWNtiKEXB+EcQMWles=
=ADrx
-----END PGP SIGNATURE-----

--nextPart2816537.NNf9W0W9Ei--