diff --git a/sysutils/vobcopy/Makefile b/sysutils/vobcopy/Makefile index 3f774eb2c967..772df319fa5f 100644 --- a/sysutils/vobcopy/Makefile +++ b/sysutils/vobcopy/Makefile @@ -1,62 +1,44 @@ PORTNAME= vobcopy -PORTVERSION= 1.2.0 -PORTREVISION= 9 +PORTVERSION= 1.2.1 +PORTREVISION= 0 CATEGORIES= sysutils -MASTER_SITES= http://vobcopy.org/download/ \ - LOCAL/ehaupt MAINTAINER= dinoex@FreeBSD.org COMMENT= Decrypts and copies DVD .vob files -WWW= http://vobcopy.org/projects/c/c.shtml +WWW= https://github.com/barak/vobcopy LICENSE= GPLv2+ LIB_DEPENDS= libdvdread.so:multimedia/libdvdread -HAS_CONFIGURE= yes -CONFIGURE_SCRIPT= configure.sh -CONFIGURE_ARGS= --with-lfs --with-dvdread-libs=${LOCALBASE} +USES= autoreconf localbase iconv +USE_GITHUB= yes +GH_ACCOUNT= barak +GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share +CFLAGS+= -DUSE_STATFS_FOR_DEV=1 +MAKE_ARGS= CCLD="${CC}" -ALL_TARGET= ${PORTNAME} +PLIST_FILES= bin/vobcopy \ + share/man/de/man1/vobcopy.1.gz \ + share/man/man1/vobcopy.1.gz -PLIST_FILES= bin/vobcopy share/man/man1/vobcopy.1.gz -PORTDOCS= COPYING Changelog README TODO \ +PORTDOCS= COPYING ChangeLog Changelog README Release-Notes TODO \ alternative_programs.txt -OPTIONS_DEFINE= DOCS - -post-patch: - @${REINPLACE_CMD} -E -e 's|(fopen\( *"/etc/)mtab|\1fstab|; \ - s|iso9660|cd9660|' ${WRKSRC}/dvd.c - @${REINPLACE_CMD} -E -e 's|declare -i i=0||' \ - ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} -# -CURRENT after 500041 has getopt_long -# do not use libgnugetopt - @${REINPLACE_CMD} -E \ - -e 's|-lgnugetopt||' \ - ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} -# fix typo - @${REINPLACE_CMD} -E \ - -e 's|FreeBSD_Version|FreeBSD_version|' \ - ${WRKSRC}/dvd.c -# no such flag under FreeBSD -# fdatasync(2) -> fsync(2) - @${REINPLACE_CMD} -E \ - -e 's|O_LARGEFILE|0|' \ - -e 's|fdatasync|fsync|g' \ - ${WRKSRC}/vobcopy.c + +OPTIONS_DEFINE= NLS DOCS +OPTIONS_DEFAULT= NLS + +NLS_USES= gettext +NLS_CONFIGURE_ENABLE= nls +NLS_LIBS= -lintl post-configure: - @${REINPLACE_CMD} -E -e 's|^CC.+||; s|^PREFIX.+||; \ - s|/usr/local/|${LOCALBASE}/|' \ - ${WRKSRC}/Makefile - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/vobcopy ${STAGEDIR}${PREFIX}/bin/vobcopy - ${INSTALL_MAN} ${WRKSRC}/vobcopy.1${MAN1_SUFX} \ - ${STAGEDIR}${PREFIX}/share/man/man1/vobcopy.1 + ${REINPLACE_CMD} -e 's|/usr/local/share/|${PREFIX}/share/|' \ + ${WRKSRC}/vobcopy.c do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} .include diff --git a/sysutils/vobcopy/distinfo b/sysutils/vobcopy/distinfo index 52c09eecb36a..c2fe319bace0 100644 --- a/sysutils/vobcopy/distinfo +++ b/sysutils/vobcopy/distinfo @@ -1,2 +1,3 @@ -SHA256 (vobcopy-1.2.0.tar.gz) = 511f3550c1dda3fd4dfb748ed7abb9cd6f1e46f8490faad406a19cbb947c1df9 -SIZE (vobcopy-1.2.0.tar.gz) = 68214 +TIMESTAMP = 1705270645 +SHA256 (barak-vobcopy-1.2.1_GH0.tar.gz) = f4737efaf5ad4f84b5c94ca82cda04dbb20c59cebc23588e3662e0c2813d6fde +SIZE (barak-vobcopy-1.2.1_GH0.tar.gz) = 67342 diff --git a/sysutils/vobcopy/files/patch-Makefile.am b/sysutils/vobcopy/files/patch-Makefile.am new file mode 100644 index 000000000000..ce1dea8e8cc5 --- /dev/null +++ b/sysutils/vobcopy/files/patch-Makefile.am @@ -0,0 +1,11 @@ +--- Makefile.am.orig 2022-05-03 19:55:34 UTC ++++ Makefile.am +@@ -15,7 +15,7 @@ dist_doc_DATA = alternative_programs.txt Changelog REA + + intl/de/vobcopy.1: vobcopy.1.de + $(MKDIR_P) intl/de +- ln $< $@ ++ ln ${.ALLSRC} $@ + + MOSTLYCLEANFILES = intl/de/vobcopy.1 + diff --git a/sysutils/vobcopy/files/patch-dvd.c b/sysutils/vobcopy/files/patch-dvd.c index 6ba35b812e29..d928dd05e168 100644 --- a/sysutils/vobcopy/files/patch-dvd.c +++ b/sysutils/vobcopy/files/patch-dvd.c @@ -1,41 +1,116 @@ ---- dvd.c.orig 2008-02-19 00:27:04.000000000 -0500 -+++ dvd.c 2008-08-08 19:02:43.000000000 -0400 -@@ -510,7 +510,15 @@ +--- dvd.c.orig 2022-05-03 19:55:34 UTC ++++ dvd.c +@@ -176,7 +176,7 @@ int get_device( char *path, char *device ) + if( !strcmp( path, buf.f_mntonname ) ) + { + mounted = TRUE; +-#if defined(__FreeBSD__) && (__FreeBSD_Version > 500000) ++#if defined(__FreeBSD__) && (__FreeBSD_version > 500000) + strcpy(device, buf.f_mntfromname); + #else + strcpy(device, "/dev/r"); +@@ -294,7 +294,7 @@ this is the code for the other-OSs, not solaris*/ + #endif + + +- if( ( tmp_streamin = fopen( "/etc/mtab", "r" ) ) ) ++ if( ( tmp_streamin = fopen( "/etc/fstab", "r" ) ) ) + { + strcpy( tmp_path, path ); + strcat( tmp_path, " " ); /* otherwise it would detect that e.g. +@@ -346,7 +346,7 @@ this is the code for the other-OSs, not solaris*/ + + if( ( k = strstr( tmp_bufferin, "/dev/" ) ) == NULL ) + { +- fprintf( stderr, _("[Error] Weird, no /dev/ entry found in the line where iso9660 or udf gets mentioned in /etc/fstab\n") ); ++ fprintf( stderr, _("[Error] Weird, no /dev/ entry found in the line where cd9660 or udf gets mentioned in /etc/fstab\n") ); + return -1; + } + l=0; +@@ -404,7 +404,8 @@ int get_device_on_your_own( char *path, char *device ) + struct statvfs *mntbuf; + #endif + +- if( ( n = getmntinfo( &mntbuf, 0 ) ) > 0 ) ++ path[0] = '\0'; ++ if( ( n = getmntinfo( &mntbuf, MNT_NOWAIT ) ) > 0 ) + { + for( i = 0; i < n; i++ ) + { +@@ -412,7 +413,7 @@ int get_device_on_your_own( char *path, char *device ) + { + dvd_count++; + strcpy( path, mntbuf[i].f_mntonname ); +-#if defined(__FreeBSD__) && (__FreeBSD_Version > 500000) ++#if defined(__FreeBSD__) && (__FreeBSD_version > 500000) + strcat(device, mntbuf[i].f_mntfromname); + #else + strcpy(device, "/dev/r"); +@@ -495,14 +496,14 @@ int get_device_on_your_own( char *path, char *device ) + *read the device out of /etc/mtab + */ + +- if( ( tmp_streamin = fopen( "/etc/mtab", "r" ) ) ) ++ if( ( tmp_streamin = fopen( "/etc/fstab", "r" ) ) ) + { +-/* strcpy(tmp_path, "iso9660"); */ ++/* strcpy(tmp_path, "cd9660"); */ + memset( tmp_bufferin, 0, MAX_STRING * sizeof( char ) ); + while( fgets( tmp_bufferin, MAX_STRING, tmp_streamin ) ) + { + /* if(strstr( tmp_bufferin, tmp_path)) */ +- if (strstr( tmp_bufferin, "iso9660" ) || ++ if (strstr( tmp_bufferin, "cd9660" ) || + strstr( tmp_bufferin, "udf" ) || + strstr( tmp_bufferin, "cdrom" ) || + strstr( tmp_bufferin, "dvd" ) ) +@@ -514,7 +515,7 @@ int get_device_on_your_own( char *path, char *device ) + + if( ( k = strstr( tmp_bufferin, "/dev/" ) ) == NULL ) + { +- fprintf( stderr, _("[Error] Weird, no /dev/ entry found in the line where iso9660, udf or cdrom gets mentioned in /etc/mtab\n") ); ++ fprintf( stderr, _("[Error] Weird, no /dev/ entry found in the line where cd9660, udf or cdrom gets mentioned in /etc/mtab\n") ); + dvd_count--; + continue; + } +@@ -544,8 +545,17 @@ int get_device_on_your_own( char *path, char *device ) */ - k = strstr( tmp_bufferin, " " ); + k = strpbrk( tmp_bufferin, " \t" ); -+ + + /* Avoid a core dump by checking that the break token + was found */ + if ( k == NULL ) + { + fprintf(stderr, "[Error] Unable to parse the /etc/fstab file\n"); ++ path[0] = '\0'; + return -1; + } - ++ /*traverse the gap*/ -@@ -646,21 +654,6 @@ + if( isgraph( (int) *(k) )) +@@ -680,21 +690,6 @@ off_t get_vob_size( int title, char *provided_input_di return ( off_t ) vob_size; } - sprintf( stat_path, "%s_1.vob", path_to_vobs3 ); - if( ( tmp_streamin1 = fopen( stat_path, "r" ) ) != NULL ) /*check if this path is correct */ - { - fclose ( tmp_streamin1 ); - subvob = 1; - while( !stat( stat_path, &buf ) ) - { - /* adjust path for next subvob */ - subvob++; -- sprintf( stat_path, "%s_%d.vob", path_to_vobs3, subvob ); +- snprintf( stat_path, sizeof(stat_path), "%s_%d.vob", path_to_vobs3, subvob ); - vob_size += buf.st_size; - } - return ( off_t ) vob_size; - } - /*none of the above seemed to have caught it, so this is the error return */ return ( off_t ) 0; /* think that (off_t) is not really needed here? as it is defined as off_t and the function is diff --git a/sysutils/vobcopy/files/patch-vobcopy.c b/sysutils/vobcopy/files/patch-vobcopy.c index 9ea3d00e2229..d1b89451b22a 100644 --- a/sysutils/vobcopy/files/patch-vobcopy.c +++ b/sysutils/vobcopy/files/patch-vobcopy.c @@ -1,11 +1,65 @@ ---- vobcopy.c.orig Sun Jun 24 08:26:07 2007 -+++ vobcopy.c Wed Oct 10 20:56:58 2007 -@@ -149,6 +149,8 @@ +--- vobcopy.c.orig 2022-05-03 19:55:34 UTC ++++ vobcopy.c +@@ -25,7 +25,7 @@ + * rosenauer@users.sf.net - helped me a lot! + * Billy Biggs - took some of his play_title.c code + * and implemeted it here +- * Håkan Hjort and Billy Biggs - libdvdread ++ * HÃ¥kan Hjort and Billy Biggs - libdvdread + * Stephen Birch - debian packaging + */ + +@@ -160,7 +160,7 @@ and potentially fatal." - Thanks Leigh!*/ + #if defined( __gettext__ ) + setlocale(LC_ALL, ""); + textdomain("vobcopy"); +- bindtextdomain("vobcopy", "/usr/share/locale"); ++ bindtextdomain("vobcopy", "/usr/local/share/locale"); #endif + /* initialize string */ +@@ -1205,7 +1205,7 @@ next: /*for the goto - ugly, I know... */ + fprintf( stderr, _("\n")); + if( !stdout_flag ) + { +- if( fdatasync( streamout ) < 0 ) ++ if( fsync( streamout ) < 0 ) + { + fprintf( stderr, _("\n[Error] error writing to %s \n"), output_file ); + fprintf( stderr, _("[Error] error: %s\n"), strerror( errno ) ); +@@ -1241,7 +1241,7 @@ next: /*for the goto - ugly, I know... */ + fprintf( stderr, _("\n")); + if( !stdout_flag ) + { +- if( fdatasync( streamout ) < 0 ) ++ if( fsync( streamout ) < 0 ) + { + fprintf( stderr, _("\n[Error] error writing to %s \n"), output_file ); + fprintf( stderr, _("[Error] error: %s\n"), strerror( errno ) ); +@@ -1389,7 +1389,7 @@ next: /*for the goto - ugly, I know... */ + fprintf( stderr, _("\n") ); + if( !stdout_flag ) + { +- if( fdatasync( streamout ) < 0 ) ++ if( fsync( streamout ) < 0 ) + { + fprintf( stderr, _("\n[Error] error writing to %s \n"), output_file ); + fprintf( stderr, _("[Error] error: %s\n"), strerror( errno ) ); +@@ -1421,6 +1421,8 @@ next: /*for the goto - ugly, I know... */ + + + /* initialize string */ + dvd_path[0] = '\0'; /* - * the getopt part (getting the options from command line) + * Open now up the actual files for reading +@@ -1847,7 +1849,7 @@ The man replies, "I was talking to the sheep." + } + if( !stdout_flag ) + { +- if( fdatasync( streamout ) < 0 ) ++ if( fsync( streamout ) < 0 ) + { + fprintf( stderr, _("\n[Error] error writing to %s \n"), name ); + fprintf( stderr, _("[Error] error: %s\n"), strerror( errno ) ); diff --git a/sysutils/vobcopy/files/patch-vobcopy.h b/sysutils/vobcopy/files/patch-vobcopy.h deleted file mode 100644 index c70a19da6b12..000000000000 --- a/sysutils/vobcopy/files/patch-vobcopy.h +++ /dev/null @@ -1,11 +0,0 @@ ---- vobcopy.h.old 2009-06-12 10:46:16.000000000 +0000 -+++ vobcopy.h 2009-06-12 10:47:20.000000000 +0000 -@@ -69,7 +69,7 @@ - /* ////////// *BSD ////////// */ - #if ( defined( BSD ) && ( BSD >= 199306 ) ) - --#if !defined( __NetBSD__ ) || \ -+#if ! ( defined( __NetBSD__ ) ) || \ - ( defined( __NetBSD__) && ( __NetBSD_Version__ < 200040000 ) ) - #include - #define USE_STATFS 1