View | Details | Raw Unified | Return to bug 150452 | Differences between
and this patch

Collapse All | Expand All

(-)dvdbackup/Makefile (-16 / +32 lines)
Lines 6-34 Link Here
6
#
6
#
7
7
8
PORTNAME=	dvdbackup
8
PORTNAME=	dvdbackup
9
PORTVERSION=	0.1.1
9
PORTVERSION=	0.4.1
10
PORTREVISION=	6
11
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
12
MASTER_SITES=	http://dvd-create.sourceforge.net/ GENTOO/distfiles
11
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
13
12
14
MAINTAINER=	ehaupt@FreeBSD.org
13
MAINTAINER=	ehaupt@FreeBSD.org
15
COMMENT=	Backup content from DVD to hard disk
14
COMMENT=	Backup content from DVD to hard disk
16
15
17
LIB_DEPENDS=	dvdread.4:${PORTSDIR}/multimedia/libdvdread
16
LIB_DEPENDS=	dvdread.4:${PORTSDIR}/multimedia/libdvdread
18
17
19
WRKSRC=		${WRKDIR}/${PORTNAME}
18
GNU_CONFIGURE=	yes
20
PLIST_FILES=	bin/dvdbackup
19
USE_GMAKE=	yes
21
PORTDOCS=	README
20
22
21
CPPFLAGS+=	-I${LOCALBASE}/include
23
do-build:
22
LDFLAGS+=	-L${LOCALBASE}/lib
24
	${CC} -o ${WRKSRC}/dvdbackup ${CFLAGS} -I${LOCALBASE}/include \
23
CONFIGURE_ENV+=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
25
		-L${LOCALBASE}/lib -ldvdread ${WRKSRC}/src/dvdbackup.c
24
26
25
PORTDOCS=	NEWS README
27
do-install:
26
28
	@${INSTALL_PROGRAM} ${WRKSRC}/dvdbackup ${PREFIX}/bin
27
.if !defined(WITHOUT_NLS)
29
.if !defined(NOPORTDOCS)
28
USE_GETTEXT=	yes
30
	@${MKDIR} ${DOCSDIR}
29
CONFIGURE_ARGS+=	--enable-nls
31
	@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
30
PLIST_SUB+=	NLS=""
31
.else
32
CONFIGURE_ARGS+=	--disable-nls
33
PLIST_SUB+=	NLS="@comment "
34
.endif
35
36
DEFAULT_DVD_DEVICE?=	/dev/acd0
37
38
MAN1=	dvdbackup.1
39
40
post-patch:
41
	@${REINPLACE_CMD} "s|/dev/dvd|${DEFAULT_DVD_DEVICE}|g" \
42
		${WRKSRC}/src/main.c ${WRKSRC}/po/*.po ${WRKSRC}/po/*.pot \
43
		${WRKSRC}/README ${WRKSRC}/man/dvdbackup.1
44
45
pre-configure:
46
.if defined(NOPORTDOCS)
47
	@${REINPLACE_CMD} 's|^install-data-am: .*|install-data-am: |' ${WRKSRC}/Makefile.in
32
.endif
48
.endif
33
49
34
.include <bsd.port.mk>
50
.include <bsd.port.mk>
(-)dvdbackup/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (dvdbackup-0.1.1.tar.gz) = 53a071d1def5ee49d702a4dd080d25ac
1
MD5 (dvdbackup-0.4.1.tar.gz) = e23ed1a0d5ab97a81eebc93682c0bfeb
2
SHA256 (dvdbackup-0.1.1.tar.gz) = 39b0ec9c00a6425a18edab52999932e87e3249e38a03da1d7a8e820232819db7
2
SHA256 (dvdbackup-0.4.1.tar.gz) = ac9138b3265ef7f113d139e68130663937ce25322ae00922f74bab55aa63347b
3
SIZE (dvdbackup-0.1.1.tar.gz) = 24806
3
SIZE (dvdbackup-0.4.1.tar.gz) = 232885
(-)dvdbackup/files/patch-src-dvdbackup.c (+42 lines)
Line 0 Link Here
1
--- src/dvdbackup.c.orig	2010-09-16 22:10:04.307951355 +0200
2
+++ src/dvdbackup.c	2010-09-16 22:19:49.112413564 +0200
3
@@ -99,7 +99,8 @@
4
 
5
 
6
 static int CheckSizeArray(const int size_array[], int reference, int target) {
7
-	if ( (size_array[reference]/size_array[target] == 1) &&
8
+	if ( size_array[target] &&
9
+			(size_array[reference]/size_array[target] == 1) &&
10
 			((size_array[reference] * 2 - size_array[target])/ size_array[target] == 1) &&
11
 			((size_array[reference]%size_array[target] * 3) < size_array[reference]) ) {
12
 		/* We have a dual DVD with two feature films - now let's see if they have the same amount of chapters*/
13
@@ -1264,7 +1265,7 @@
14
 
15
 	/* Seek to title of first track, which is at (track_no * 32768) + 40 */
16
 
17
-	if ( 32808 != lseek(filehandle, 32808, SEEK_SET) ) {
18
+	if ( 32768 != lseek(filehandle, 32768, SEEK_SET) ) {
19
 		close(filehandle);
20
 		fprintf(stderr, _("Cannot seek DVD device %s - check your DVD device\n"), device);
21
 		return(1);
22
@@ -1272,10 +1273,16 @@
23
 
24
 	/* Read the DVD-Video title */
25
 
26
-	if ( 32 != read(filehandle, title, 32)) {
27
-		close(filehandle);
28
-		fprintf(stderr, _("Cannot read title from DVD device %s\n"), device);
29
-		return(1);
30
+#define DVD_SEC_SIZ 2048
31
+	{
32
+		char tempBuf[ DVD_SEC_SIZ ];
33
+
34
+		if (DVD_SEC_SIZ != read(filehandle, tempBuf, DVD_SEC_SIZ)) {
35
+			close(filehandle);
36
+			fprintf(stderr, _("Cannot read title from DVD device %s\n"), device);
37
+			return(1);
38
+		}
39
+      	snprintf( title, 32, "%s", tempBuf + 40 );
40
 	}
41
 
42
 	/* Terminate the title string */
(-)dvdbackup/files/patch-src::dvdbackup.c (-78 lines)
Lines 1-78 Link Here
1
--- src/dvdbackup.c.orig	Mon Aug  5 02:08:39 2002
2
+++ src/dvdbackup.c	Tue Mar  1 05:01:19 2005
3
@@ -210,6 +210,7 @@
4
 	fprintf(stderr,"\t-v X\t\twhere X is the amount of verbosity\n");
5
 	fprintf(stderr,"\t-I\t\tfor information about the DVD\n");
6
 	fprintf(stderr,"\t-o directory\twhere directory is your backup target\n");
7
+	fprintf(stderr,"\t-n\t\tuse this as DVD name (if we can't get it)\n");
8
 	fprintf(stderr,"\t-M\t\tbackup the whole DVD\n");
9
 	fprintf(stderr,"\t-F\t\tbackup the main feature of the DVD\n");
10
 	fprintf(stderr,"\t-T X\t\tbackup title set X\n");
11
@@ -219,8 +220,8 @@
12
 	fprintf(stderr,"\t-a 0\t\tto get aspect ratio 4:3 instead of 16:9 if both are present\n");
13
 	fprintf(stderr,"\t-h\t\tprint a brief usage message\n");
14
 	fprintf(stderr,"\t-?\t\tprint a brief usage message\n\n");
15
-	fprintf(stderr,"\t-i is manditory\n");
16
-	fprintf(stderr,"\t-o is manditory except if you use -I\n");
17
+	fprintf(stderr,"\t-i is mandatory\n");
18
+	fprintf(stderr,"\t-o is mandatory except if you use -I\n");
19
 	fprintf(stderr,"\t-a is option to the -F switch and has no effect on other options\n");
20
 	fprintf(stderr,"\t-s and -e should prefereibly be used together with -t \n\n");
21
 	exit(1);
22
@@ -228,7 +228,8 @@
23
 }
24
 
25
 int CheckSizeArray(const int size_array[], int reference, int target) {
26
-	if ( (size_array[reference]/size_array[target] == 1) &&
27
+	if ( size_array[target] &&
28
+	     (size_array[reference]/size_array[target] == 1) &&
29
 	     ((size_array[reference] * 2 - size_array[target])/ size_array[target] == 1) &&
30
 	     ((size_array[reference]%size_array[target] * 3) < size_array[reference]) ) {
31
 		/* We have a dual DVD with two feature films - now lets see if they have the same amount of chapters*/
32
@@ -782,7 +783,7 @@
33
 	 to consider the second one a feature title we are doing two checks (biggest  + biggest - second) /second == 1
34
 	 and biggest%second * 3 < biggest */
35
 
36
-	if ( CheckSizeArray(size_size_array, 0, 1)  == 1 ) {
37
+	if ( CheckSizeArray(size_size_array, 0, 1)  == 1 && title_sets >1 ) {
38
 		/* We have a dual DVD with two feature films - now lets see if they have the same amount of chapters*/
39
 
40
 		chapters_1 = 0;
41
@@ -1530,7 +1531,7 @@
42
 
43
 	/* Seek to title of first track, which is at (track_no * 32768) + 40 */
44
 
45
-	if ( 32808 != lseek(filehandle, 32808, SEEK_SET) ) {
46
+	if ( 32768 != lseek(filehandle, 32768, SEEK_SET) ) {
47
 		close(filehandle);
48
 		fprintf(stderr, "Can't seek DVD device %s - check your DVD device\n", device);
49
 		return(1);
50
@@ -1538,12 +1539,18 @@
51
 
52
 	/* Read the DVD-Video title */
53
 
54
-	if ( 32 != read(filehandle, title, 32)) {
55
+#define	DVD_SEC_SIZ	2048
56
+	{
57
+	 char tempBuf[ DVD_SEC_SIZ ];
58
+
59
+	if ( DVD_SEC_SIZ != read(filehandle, tempBuf, DVD_SEC_SIZ)) {
60
 		close(filehandle);
61
 		fprintf(stderr, "Can't read title from DVD device %s\n", device);
62
 		return(1);
63
 	}
64
 
65
+	snprintf( title, 32, "%s", tempBuf + 40 );
66
+	}
67
 	/* Terminate the title string */
68
 
69
 	title[32] = '\0';
70
@@ -2164,7 +2171,7 @@
71
 	DVDGetTitleName(dvd,title_name);
72
 
73
 
74
-	fprintf(stdout,"\n\n\nDVD-Video information of the DVD with tile %s\n\n", title_name);
75
+	fprintf(stdout,"\n\n\nDVD-Video information of the DVD with title %s\n\n", title_name);
76
 
77
 	/* Print file structure */
78
 
(-)dvdbackup/pkg-descr (-1 / +1 lines)
Lines 1-3 Link Here
1
Backup content from DVD to hard disk
1
Backup content from DVD to hard disk
2
2
3
WWW:	http://dvd-create.sourceforge.net/
3
WWW:	http://dvdbackup.sourceforge.net/
(-)dvdbackup/pkg-plist (+14 lines)
Line 0 Link Here
1
bin/dvdbackup
2
%%NLS%%share/locale/de/LC_MESSAGES/dvdbackup.mo
3
%%NLS%%share/locale/en@quot/LC_MESSAGES/dvdbackup.mo
4
%%NLS%%@dirrmtry share/locale/en@quot/LC_MESSAGES
5
%%NLS%%@dirrmtry share/locale/en@quot
6
%%NLS%%share/locale/en@boldquot/LC_MESSAGES/dvdbackup.mo
7
%%NLS%%@dirrmtry share/locale/en@boldquot/LC_MESSAGES
8
%%NLS%%@dirrmtry share/locale/en@boldquot
9
%%NLS%%share/locale/es/LC_MESSAGES/dvdbackup.mo
10
%%NLS%%share/locale/fr/LC_MESSAGES/dvdbackup.mo
11
%%NLS%%share/locale/gl/LC_MESSAGES/dvdbackup.mo
12
%%NLS%%share/locale/it/LC_MESSAGES/dvdbackup.mo
13
%%NLS%%share/locale/nb/LC_MESSAGES/dvdbackup.mo
14
%%NLS%%share/locale/ru/LC_MESSAGES/dvdbackup.mo

Return to bug 150452