Package-Name: dvdauthor
Gentoo-Package: media-video/dvdauthor
Requires: libdvdread libxml2 libpng|ImageMagick
Rebuild-For: freetype
Homepage: http://dvdauthor.sourceforge.net/
Source: sourceforge:///dvdauthor/dvdauthor-(\d+(.\d+)+).tar.gz $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	rm -rf "$(PREFIX)"/doc
	cp -af AUTHORS COPYING Change* NEWS README TODO doc "$(PREFIX)/"
	$(MAKE) -f ../Makefile configure
	$(MAKE)
	$(MAKE) install
	for i in `cd "$(PREFIX)"/man/man1;echo *.1` ; do rm -f "$(PREFIX)"/doc/"$$i" ; done
Install:
	$(MAKE) instbin BIN="dvdauthor dvddirdel dvdunauthor mpeg2desc spumux spuunmux"
	$(MAKE) instman SECTION=1 MAN="dvdauthor spumux"
Patch: <<EOT
######## begin until-next-sub.diff
--- ../dvdauthor-0.6.14-orig/src/subgen.c	2007-01-26 10:06:09 +0900
+++ src/subgen.c	2007-02-27 10:49:56 +0900
@@ -418,7 +418,7 @@
             }
         }
         
-        if( (cursti->sd == -1) && newsti && ( (!svcd) || until_next_sub) )
+        if( 0 && (cursti->sd == -1) && newsti && ( (!svcd) || until_next_sub) )
         {
             if(newsti->spts > cursti->spts + tbs) cursti->sd = newsti->spts - cursti->spts - tbs;
             else
######## end until-next-sub.diff
######## begin subgen-debug-info.diff
--- ../dvdauthor-0.6.14-orig/src/subgen.c	2007-01-26 10:06:09 +0900
+++ src/subgen.c	2007-02-27 10:49:56 +0900
@@ -691,7 +691,7 @@
 
         if (debug > 0)
         {
-            fprintf(stderr,"INFO: Subtitle inserted at: %f sd=%d\n", (double)cursti->spts / 90000, cursti->sd / 90000);
+            fprintf(stderr,"INFO: Subtitle inserted at: %f sd=%f\n", (double)cursti->spts / 90000, (double)cursti->sd / 90000);
         }
         freestinfo(cursti);
     }
######## end subgen-debug-info.diff
######## begin dvdread configure/Makefile patch
--- ../dvdauthor-0.6.14-orig/configure	2007-02-25 03:46:27 +0900
+++ configure	2007-02-27 10:49:56 +0900
@@ -3749,7 +3749,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldvdread  $LIBS"
+LIBS="-ldvdread -ldl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
--- ../dvdauthor-0.6.14-orig/src/Makefile.in	2007-02-25 03:46:27 +0900
+++ src/Makefile.in	2007-02-27 10:57:19 +0900
@@ -220,7 +220,7 @@
 
 dvdauthor_LDADD = $(LIBICONV) $(XML_LIBS)
 dvdunauthor_SOURCES = dvdunauthor.c dvduncompile.c dvduncompile.h compat.c compat.h
-dvdunauthor_LDADD = $(XML_LIBS) -ldvdread
+dvdunauthor_LDADD = $(XML_LIBS) -ldvdread -ldl
 spumux_SOURCES = subgen.c subgen.h rgb.h \
 	subgen-parse-xml.c readxml.c readxml.h \
 	subgen-encode.c subgen-image.c \
######## end dvdread configure/Makefile patch
######## begin invalid-aspect-ratio-warning.diff
--- ../dvdauthor-0.6.14-orig/src/dvdvob.c	2007-01-13 08:52:20 +0900
+++ src/dvdvob.c	2007-02-27 10:49:56 +0900
@@ -408,25 +408,33 @@
             vobgroup_set_video_attr(va,VIDEO_RESOLUTION,sizestring);
 
             if( va->vd.vmpeg==VM_MPEG1) {
+                static int warned=0;
                 switch( aspect ) {
                 case 3:
                     vobgroup_set_video_attr(va,VIDEO_ASPECT,"16:9");
                     vobgroup_set_video_attr(va,VIDEO_FORMAT,"pal");
+                    warned=0;
                     break;
                 case 6:
                     vobgroup_set_video_attr(va,VIDEO_ASPECT,"16:9");
                     vobgroup_set_video_attr(va,VIDEO_FORMAT,"ntsc");
+                    warned=0;
                     break;
                 case 8:
                     vobgroup_set_video_attr(va,VIDEO_ASPECT,"4:3");
                     vobgroup_set_video_attr(va,VIDEO_FORMAT,"pal");
+                    warned=0;
                     break;
                 case 12:
                     vobgroup_set_video_attr(va,VIDEO_ASPECT,"4:3");
                     vobgroup_set_video_attr(va,VIDEO_FORMAT,"ntsc");
+                    warned=0;
                     break;
                 default:
-                    fprintf(stderr,"WARN: unknown mpeg1 aspect ratio %d\n",aspect);
+                    if( !warned ) {
+                        fprintf(stderr,"WARN: unknown mpeg1 aspect ratio %d\n",aspect);
+                        warned++;
+                    }
                     break;
                 }
                 newaspect=3+
@@ -435,12 +443,19 @@
                 if( newaspect==11 ) newaspect++;
                 buf[7]=(buf[7]&0xf)|(newaspect<<4); // reset the aspect ratio
             } else if( va->vd.vmpeg==VM_MPEG2 ) {
-                if( aspect==2 )
+                static int warned=0;
+                if( aspect==2 ) {
                     vobgroup_set_video_attr(va,VIDEO_ASPECT,"4:3");
-                else if( aspect==3 )
+                    warned=0;
+                } else if( aspect==3 ) {
                     vobgroup_set_video_attr(va,VIDEO_ASPECT,"16:9");
-                else
-                    fprintf(stderr,"WARN: unknown mpeg2 aspect ratio %d\n",aspect);
+                    warned=0;
+                } else {
+                    if( !warned ) {
+                        fprintf(stderr,"WARN: unknown mpeg2 aspect ratio %d\n",aspect);
+                        warned++;
+                    }
+                }
                 buf[7]=(buf[7]&0xf)|(va->vd.vaspect==VA_4x3?2:3)<<4; // reset the aspect ratio
             }
             break;
######## end invalid-aspect-ratio-warning.diff
EOT

/pkg/dvdauthor/
/usr/bin/dvdauthor
/usr/bin/dvddirdel
/usr/bin/dvdunauthor
/usr/bin/mpeg2desc
/usr/bin/spumux
/usr/bin/spuunmux
/usr/man/man1/dvdauthor.1.gz
/usr/man/man1/spumux.1.gz
