Package-Name: dvd9to5
Requires: mjpegtools|mjpegtools-cvs transcode|transcode-cvs
Homepage: http://lakedaemon.netmindz.net/dvd9to5/
Source: http://lakedaemon.netmindz.net/dvd9to5//(dvd9to5-(\d+(\.\d+)+)\.tar\.bz2)/[\0-\377]*dvd9to5-(\d+(.\d+)+).tar.bz2 $1
Zap-Before-Install: 1
Repack:
	tar xjvfp "$(SOURCE)"
Compile:
	cp -p CHANGE* COPYING README TODO "$(PREFIX)/"
	mkdir -p "$(PREFIX)"/bin "$(PREFIX)"/etc
	cp -pf dvd9to5.pl "$(PREFIX)"/bin/dvd9to5
	cp -pf dvd9to5.conf.example "$(PREFIX)"/etc/
	if test ! -r "$(PREFIX)"/etc/dvd9to5.conf ; then \
		rm -f "$(PREFIX)"/etc/dvd9to5.conf ; \
		cp -p "$(PREFIX)"/etc/dvd9to5.conf{.example,} ; \
	fi
Install:
	$(MAKE) instbin BIN=dvd9to5
	$(MAKE) instetc ETC=dvd9to5.conf
Patch: <<EOT
######## begin -A (audiospec) patch
--- dvd9to5.pl.old	2004-09-15 17:01:15 +0900
+++ dvd9to5.pl	2004-11-01 01:35:18 +0900
@@ -26,6 +26,7 @@
 my $BurnSpd;
 my $TitleNum;
 my @AudioCH;
+my $AudioSpec;
 my @SubCH;
 my $RequantFactor;
 my $MaxISOSize;
@@ -47,25 +48,27 @@
 my $dflt_TitleNum      = 1;
 my @dflt_AudioCH;
    $dflt_AudioCH[0]    = '0';
+my $dflt_AudioSpec     = 'ac3+en';
 my @dflt_SubCH;
 my $dflt_RequantFactor = 1.0;
 my $dflt_MaxISOSize    = 4706074624; #bytes, according to growisofs
 
 # Grab the Command Line Options
-my $CL_Opts = getopts("i:o:w:t:a:s:S:DIh", \%Options);
+my $CL_Opts = getopts("i:o:w:t:a:A:s:S:DIh", \%Options);
 
 if(!$CL_Opts || $Options{h}) {
-   print("dvd9to5.pl $VERSION                         \n");
-   print("Usage: dvd9to5.pl <options>                 \n");
-   print("  -i <dev>     Source device.               \n");
-   print("  -o <dev>     Destination device.          \n");
-   print("  -w <dir>     Working directory.           \n");
-   print("  -t <num>     Title # to use.              \n");
-   print("  -a <0,1...n> Audio channel #'s to use.    \n");
-   print("  -s <0,1...n> Subtitle channel #'s to use. \n");
-   print("  -S <num>     Burn Speed.                  \n");
-   print("  -D           Delete unneeded files.       \n");
-#   print("  -I          Show DVD info and guesses. \n");
+   print("dvd9to5.pl $VERSION                              \n");
+   print("Usage: dvd9to5.pl <options>                      \n");
+   print("  -i <dev>     Source device.                    \n");
+   print("  -o <dev>     Destination device.               \n");
+   print("  -w <dir>     Working directory.                \n");
+   print("  -t <num>     Title # to use.                   \n");
+   print("  -a <0,1...n> Audio channel #'s to use.         \n");
+   print("  -A <string>  Audio specification for dvdauthor.\n");
+   print("  -s <0,1...n> Subtitle channel #'s to use.      \n");
+   print("  -S <num>     Burn Speed.                       \n");
+   print("  -D           Delete unneeded files.            \n");
+#   print("  -I          Show DVD info and guesses.         \n");
 #   print("");
 #   print("");
 #   print("");
@@ -87,6 +90,7 @@
    $BurnSpd    = $dflt_BurnSpd;
    $TitleNum   = $dflt_TitleNum;
    @AudioCH    = @dflt_AudioCH;
+   $AudioSpec  = $dflt_AudioSpec;
    @SubCH      = @dflt_SubCH;
    $MaxISOSize = $dflt_MaxISOSize;
    $DVDDir     = $dflt_DVDDir;
@@ -151,6 +155,7 @@
    $BurnSpd   = $Options{S} if($Options{S});
    $TitleNum  = $Options{t} if($Options{t});
    @AudioCH   = split /\,/, $Options{a} if($Options{a});
+   $AudioSpec = $Options{A} if($Options{A});
    @SubCH     = split /\,/, $Options{s} if($Options{s});
 
    $WorkDir =~ s/\n$//;
@@ -329,7 +334,7 @@
 }
 
 sub AuthorDVD {
-   my $AuthorChapCmd = 'dvdauthor -t -a ac3+en -c ' . $ChapList . 
+   my $AuthorChapCmd = 'dvdauthor -t -a ' . $AudioSpec . ' -c ' . $ChapList . 
                        ' -o dvd movie.mpeg';
    my $AuthorTOCCmd  = 'dvdauthor -T -o dvd';
    my $MkDirCmd      = 'mkdir -p ' . $DVDDir;
######## end -A (audiospec) patch
EOT

-/etc/dvd9to5.conf
/etc/dvd9to5.conf
/pkg/dvd9to5/
/usr/bin/dvd9to5
