Date: Thu, 4 Oct 2001 04:40:04 -0700 (PDT) From: Oyvind Moll <oyvindmo@initio.no> To: freebsd-ports@FreeBSD.org Subject: Re: ports/30761: Fix/upgrade port: audio/ripit [MAINTAINER] Message-ID: <200110041140.f94Be4E50822@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/30761; it has been noted by GNATS. From: Oyvind Moll <oyvindmo@initio.no> To: Jun Kuriyama <kuriyama@imgsrc.co.jp> Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: ports/30761: Fix/upgrade port: audio/ripit [MAINTAINER] Date: Thu, 4 Oct 2001 13:39:40 +0200 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit On Tue, Oct 02, 2001 at 09:33:25AM +0900, Jun Kuriyama wrote: | | It seems submitted version depends on lame to retrieve genre list. | Should this port depends on lame although users can choose another | encoder? | | # And latest lame port seems not to have --genre-list option... Attached is a revised patch which fixes (or avoids, rather) this problem. It also tries to fix a problem occuring when using cdda2wav and a SCSI CD-ROM device, but this has not been tested. It's certainly not worse than before. The attached patch works for me. -- Øyvind Møll oyvindmo@initio.no --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ripit.diff" diff -uNr ripit.orig/Makefile ripit/Makefile --- ripit.orig/Makefile Thu Aug 2 11:14:27 2001 +++ ripit/Makefile Wed Oct 3 20:29:26 2001 @@ -6,24 +6,23 @@ # PORTNAME= ripit -PORTVERSION= 1.8 -PORTREVISION= 1 +PORTVERSION= 2.0 CATEGORIES= audio MASTER_SITES= http://www.initio.no/~oyvindmo/distfiles/ MAINTAINER= oyvindmo@initio.no -RUN_DEPENDS= bladeenc:${PORTSDIR}/audio/bladeenc \ - lame:${PORTSDIR}/audio/lame \ - gogo:${PORTSDIR}/audio/gogo \ - tosha:${PORTSDIR}/audio/tosha \ - cdda2wav:${PORTSDIR}/sysutils/cdrtools \ - cda:${PORTSDIR}/audio/xmcd +# See pkg-message about other dependencies. +RUN_DEPENDS= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/CDDB_get.pm:${PORTSDIR}/audio/p5-CDDB_get \ + mp3info:${PORTSDIR}/audio/mp3info NO_BUILD= yes USE_PERL5= yes do-install: @ ${INSTALL_SCRIPT} ${WRKSRC}/ripit.pl ${PREFIX}/bin + +post-install: + @ ${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff -uNr ripit.orig/distinfo ripit/distinfo --- ripit.orig/distinfo Mon Jun 5 00:37:22 2000 +++ ripit/distinfo Sun Sep 23 14:13:38 2001 @@ -1 +1 @@ -MD5 (ripit-1.8.tar.gz) = f2cf29b275525e1c91fe726479e71172 +MD5 (ripit-2.0.tar.gz) = b1d8cdff1346849ea47e766e40e14111 diff -uNr ripit.orig/files/patch-aa ripit/files/patch-aa --- ripit.orig/files/patch-aa Sun Oct 1 12:22:27 2000 +++ ripit/files/patch-aa Wed Oct 3 21:50:49 2001 @@ -1,84 +1,135 @@ ---- ripit.pl.orig Mon May 22 15:27:36 2000 -+++ ripit.pl Sun Sep 24 03:38:07 2000 -@@ -15,25 +15,32 @@ - # --bitrate [rate] - Encode MP3 at this bitrate +--- ripit.pl.orig Sat Aug 25 18:20:06 2001 ++++ ripit.pl Wed Oct 3 21:50:36 2001 +@@ -9,41 +9,49 @@ + # Create an M3U file + # + # Options: +-# [start_track] - rips from this track to last track +-# --halt - powers off the machine when finished +-# if your configuration supports it +-# --bitrate [rate] - Encode MP3 at this bitrate ++# [start_track] - rips from this track to last track ++# --halt - powers off the machine when finished ++# if your configuration supports it ++# --bitrate [rate] - Encode MP3 at this bitrate # --year [year] - Tag MP3 with this year (included as CDDB # does not store this information) --# --device - CDROM device to rip from -+# --device - CDROM device to rip from -+# --numcpu - Number of parrallel encoders to run -+# --outputdir - Directory in which to place MP3s -+# --cdripper - Which cdripper to use -+# --encoder - Which encoder to use - # - # Version 1.8 22/05/00 - Simon Quinn - # - # Usage: ripit.pl [--halt] [--bitrate rate] --# [--year year] [--device cddevice] [start_track] -+# [--year year] [--device cddevice] [--numcpu cpus] -+# [--outputdir dir] [--cdripper ripper] [--encoder encoder] -+# [start_track] +-# --genre [genre] - Overrides CDDB genre, e.g. rock,funk +-# --device [device] - CDROM device to rip from ++# --genre [genre] - Overrides CDDB genre, e.g. rock,funk ++# --device [device] - CDROM device to rip from + # --encopt [options] - Parameters to pass to encoder + # --encoder [encoder] - Encoder to use, see below + # --cdripper [ripper] - Cdripper to use, see below + # --cdopt [options] - Parameters to pass to cdripper + # --outputdir [dir] - Where MP3s should go ++# --numcpu [cpus] - Number of parallel encoders to run ++# --auxdev [device] - Auxiliary CD-ROM device name. When using ++# cdda2wav with a SCSI device, use ++# <bus>,<id>,<lun> for --device and e.g. ++# /dev/sr0 for --auxdev. The --auxdev value ++# is given to CDDB_get.pm for CDDB lookup. + # + # Version 2.0 20/08/01 - Simon Quinn + # + # Usage: ripit.pl [--halt] [--bitrate rate] [--year year] [--genre genre] +-# [--device cddevice] [--encopt options] [--encoder encoder] ++# [--device cddevice] [--encopt options] [--encoder encoder] + # [--cdripper cdripper] [--cdopt options] [--outputdir dir] +-# [start_track] ++# [--numcpu cpus] [start_track] #################################################################### # # User configurable variables # $cddev = "/dev/cdrom"; # CD Audio device --$outputdir = "/dosc/cdrip/"; # Where the MP3s should go -+$outputdir = "/dosc/cdrip"; # Where the MP3s should go +-$outputdir = "/tmp/cdrip/"; # Where the MP3s should go, +- # must have trailing / ++$cdauxdev = "/dev/sr0"; # Auxiliary CD-ROM device, when using ++ # cdda2wav and SCSI devices ++$outputdir = "/tmp/cdrip/"; # Where the MP3s should go $bitrate = 160; # Bitrate for MP3s - $encoder = 1; # 0 - Bladeenc, 1 - Lame, 2 - Gogo +-$encoder = 0; # 0 - Lame, 1 - OggVorbis ++$encoder = 0; # 0 - Lame, 1 - Gogo, 2 - OggVorbis $encopt = ""; # options for mp3 encoder - $cdripper = 0; # 0 - cdparanoia, 1 - cdda2wav, -- # 2 - tosha, 3 - cdd -+ # 2 - tosha, 3 - cdd, 4 - dagrab + $cdripper = 0; # 0 - dagrab, + # 1 - cdparanoia, 2 - cdda2wav, + # 3 - tosha, 4 - cdd $cdopt = ""; # options for cdaudio ripper +$numcpu = 1; # Number of parallel encoders to run - $use_underscore = 0; # Use _ instead of spaces in filenames (1 yes, 0 no) - -@@ -53,6 +60,9 @@ - require "flush.pl"; - use Getopt::Long; + $CDDB_HOST = "freedb.freedb.org"; # set cddb host + $CDDB_PORT = 8880; # set cddb port +@@ -77,6 +85,9 @@ + $nocddbinfo = 1; # Assume no CDDB info exists + $trackselection = ""; # Passed from command line +$ripper_died = 0; -+$SIG{HUP} = \&catch_hup; ++$SIG{HUP} = \$catch_hup; + - # Initialise global variables - # - $year = ""; # Year of Audio CD - written to MP3 tag -@@ -75,9 +85,19 @@ + #################################################### + # Do the following: + # 1. Get command line parameters +@@ -90,19 +101,25 @@ + + # Get the parameters from the command line if ( ! &GetOptions("halt" => \$haltonfinish, - "bitrate=i" => \$bitrate, - "year=i" => \$year, -- "device=s" => \$cddev) ) { -+ "device=s" => \$cddev, -+ "numcpu=i" => \$numcpu, -+ "outputdir=s" => \$outputdir, -+ "cdripper=i" => \$cdripper, -+ "cdopt=s" => \$cdopt, -+ "encoder=i" => \$encoder, -+ "encopt=s" => \$encopt) ) { - print "Usage: ripit.pl [--halt] [--bitrate rate] [--year year] -- [--device cddevice] [start_track]\n"; -+ [--device cddevice] [--numcpu cpus] [--outputdir dir] -+ [--cdripper cdripper] [--encoder encoder] [start_track] -+ CD Rippers: 0 - cdparanoia, 1 - cdda2wav, 2 - tosha, 3 - cdd, 4 - dagrab -+ Encoders: 0 - Bladeenc, 1 - Lame, 2 - Gogo\n"; -+ +- "bitrate=i" => \$bitrate, +- "year=i" => \$year, +- "genre=s" => \$genre, +- "device=s" => \$cddev, +- "encopt=s" => \$encopt, +- "encoder=i" => \$encoder, +- "cdripper=i" => \$cdripper, +- "cdopt=s" => \$cdopt, +- "outputdir=s" => \$outputdir ) ) { +- print "Usage: ripit.pl [--halt] [--bitrate rate] [--year year] ++ "bitrate=i" => \$bitrate, ++ "year=i" => \$year, ++ "genre=s" => \$genre, ++ "device=s" => \$cddev, ++ "encopt=s" => \$encopt, ++ "encoder=i" => \$encoder, ++ "cdripper=i" => \$cdripper, ++ "cdopt=s" => \$cdopt, ++ "outputdir=s" => \$outputdir, ++ "numcpu=i" => \$numcpu, ++ "auxdev=s" => \$cdauxdev) ) { ++ print " ++Usage: ripit.pl [--halt] [--bitrate rate] [--year year] [--genre genre] + [--device cddevice] [--encopt options] [--encoder encoder] + [--cdripper cdripper] [--cdopt options] [--outputdir dir] +- [start_track]\n"; ++ [--numcpu cpus] [--auxdev cddevice] [start_track] ++Rippers: 0 - dagrab, 1 - cdparanoia, 2 - cdda2wav, 3 - tosha, 4 - cdd ++Encoders: 0 - Lame, 1 - Gogo, 2 - OggVorbis ++"; exit 1; } -@@ -113,7 +133,7 @@ +@@ -112,6 +129,9 @@ + + if ($haltonfinish == 1) {print "Will halt machine when finished.\n";} + ++# Robustify outputdir by adding trailing slash if not already there ++$outputdir .= "/" unless $outputdir =~ /\/$/; ++ + # Get starting track parameter if it has been given + if ($ARGV[0] ne '') { + $trackselection = $ARGV[0]; +@@ -132,8 +152,8 @@ + &create_dirs(); # Create directories MP3 files &rip_cd(); # Rip, Encode & Tag - print "Waiting for MP3 Encoder to finish...\n"; +-print "Waiting for MP3 Encoder to finish...\n"; -wait; -+while (wait != -1) {}; ++print "Waiting for MP3 Encoder(s) to finish...\n"; ++while (wait != -1) {}; &create_m3u(); # Create the M3U file for the MP3 files -@@ -137,6 +157,10 @@ +@@ -157,6 +177,10 @@ exit; @@ -89,16 +140,40 @@ # # Create the track selection from the parameters passed # on the command line -@@ -286,7 +310,7 @@ - # Directory created will be: /outputdir/Artist - Album/ - # The value must end in / +@@ -208,7 +232,13 @@ + $config{CDDB_HOST} = $CDDB_HOST; + $config{CDDB_PORT} = $CDDB_PORT; + $config{CDDB_MODE} = $CDDB_MODE; +- $config{CD_DEVICE} = $cddev; ++ # CD device for CDDB lookup needs special care when using cdda2wav with ++ # a SCSI device. See the usage comment in the top of the file. ++ if ($cdripper == 2 && $cddev =~ /^[0-9]+,[0-9]+,[0-9]+$/) { ++ $config{CD_DEVICE} = $cdauxdev; ++ } else { ++ $config{CD_DEVICE} = $cddev; ++ } + $config{input} = $CDDB_INPUT; -- $mp3dir = $outputdir.$artist." - ".$album."/"; -+ $mp3dir = $outputdir."/".$artist." - ".$album."/"; + my %cd=get_cddb(\%config); # Get CD TOC from CDDB_get +@@ -241,9 +271,14 @@ + } - if ($use_underscore == 1) { $mp3dir =~ s/ /_/g; } + if($genre ne "") { +- if(system("lame --genre-list | grep -i \"$genre\" >/dev/null 2>&1")) { +- die "Genre $genre is invalid!"; +- } ++ if(system("mp3info -G | grep -i \"[0-9] $genre [^a-z0-9&+/-]\" >/dev/null 2>&1")) { ++ print "Genre $genre is invalid! Using 'Unknown' as genre."; ++ $genre = 'Unknown'; ++ # We do the above instead of dying, since the genre validity ++ # check is a bit fragile. It works with mp3info-0.8.4, but breaks ++ # with at least some earlier versions and possibly with future ++ # ones. <oyvindmo@initio.no> ++ } + } -@@ -340,24 +364,29 @@ + print "\nCD TOC\n"; +@@ -336,31 +371,37 @@ $riptrackname = &get_trackname($_, $tracklist[$_ - 1]); $riptrackno = $_; @@ -108,66 +183,66 @@ # Choose the cdaudio ripper to use if ($cdripper == 0) { + if (system("dagrab -d $cddev -v $cdopt -f \"$riptrackname.rip\" $riptrackno")) { +- &printflush(RIPLOG,"cdparanoia failed on $tracklist[$_ - 1]\n"); ++ &printflush(RIPLOG,"dagrab failed on $tracklist[$_ - 1]\n"); ++ kill 1, @encoders; + die "dagrab failed on $tracklist[$_ - 1]"; + } + } + elsif ($cdripper == 1) { if (system("cdparanoia -d $cddev $cdopt $riptrackno \"$riptrackname.rip\"")) { &printflush(RIPLOG,"cdparanoia failed on $tracklist[$_ - 1]\n"); + kill 1, @encoders; die "cdparanoia failed on $tracklist[$_ - 1]"; } } - elsif ($cdripper == 1) { + elsif ($cdripper == 2) { - if (system("cdda2wav -D $cddev -Q -H $cdopt -t $riptrackno \"$riptrackname.rip\"")) { -+ if (system("cdda2wav -D $cddev -q -Q -H $cdopt -t $riptrackno - > \"$riptrackname.rip\"")) { ++ if (system("cdda2wav -D $cddev -q -Q -H $cdopt -t $riptrackno \"$riptrackname.rip\"")) { &printflush(RIPLOG,"cdda2wav failed on $tracklist[$_ - 1]\n"); + kill 1, @encoders; die "cdda2wav failed on $tracklist[$_ - 1]"; } } - elsif ($cdripper == 2) { + elsif ($cdripper == 3) { if (system("tosha -d $cddev -f wav -t $riptrackno -o \"$riptrackname.rip\"")) { - &printflush(RIPLOG,"tosha failed on $tracklist[$_ - 1]\n"); -+ kill 1, @encoders; - die "tosha failed on $tracklist[$_ - 1]"; +- &printflush(RIPLOG,"tosha failed on $tracklist[$_ - 1]\n"); +- die "tosha failed on $tracklist[$_ - 1]"; ++ &printflush(RIPLOG,"tosha failed on $tracklist[$_ - 1]\n"); ++ kill 1, @encoders; ++ die "tosha failed on $tracklist[$_ - 1]"; } } -@@ -370,6 +399,13 @@ + elsif ($cdripper == 4) { +@@ -369,6 +410,7 @@ + $cdd_dev =~ s/c$//; + if (system("cdd -t $riptrackno -q -f $cdd_dev - 2>/dev/null | sox -t cdr -x - \"$riptrackname.rip\"")) { + &printflush(RIPLOG,"cdd failed on $tracklist[$_ - 1]\n"); ++ kill 1, @encoders; die "cdd failed on $tracklist[$_ - 1]"; } } -+ elsif ($cdripper == 4) { -+ if (system("dagrab -d $cddev -f \"$riptrackname.rip\" $riptrackno")) { -+ &printflush(RIPLOG,"dagrab failed on $tracklist[$_ - 1]\n"); -+ kill 1, @encoders; -+ die "dagrab failed on $tracklist[$_ - 1]"; -+ } -+ } - else { - die "No CD Ripper defined"; - } -@@ -379,11 +415,13 @@ +@@ -381,11 +423,13 @@ rename "$riptrackname.rip","$riptrackname.wav"; &printflush(RIPLOG,"Rip complete $tracklist[$_ - 1]\n"); + } - # Start the Encoder in the background. but only once +- # Start the Encoder in the background. but only once - if ($startenc == 0) { - $startenc = 1; - unless (fork) { &enc_cd(); } ++ # Start the Encoder in the background. but only once per CPU + if ($startenc < $numcpu) { -+ sleep $startenc*5; ++ sleep $startenc * 5; + $startenc = $startenc + 1; + unless ($encoders[$startenc]=fork) { &enc_cd(); } } } -@@ -399,24 +437,25 @@ - sub enc_cd { - my($i,$x,$ncount,$enc); - -- - foreach (@seltrack) { - - $riptrackname = &get_trackname($_, $tracklist[$_ - 1]); +@@ -407,25 +451,33 @@ + $riptrackno = $_; $ncount++; - print "\nMP3 Encoding track ".$ncount." of ".($#seltrack + 1)."\n"; @@ -180,7 +255,7 @@ + while( ! -r "$riptrackname.wav" && ! -r "$riptrackname.mp3" ){ $x++; if ($x > 179) { die "MP3 encoder waited 30 minutes before giving up"; } -+ if ($ripper_died) { die "CD Ripper seems to have died - exiting"; } ++ if ($ripper_died) { die "CD Ripper seems to have died - exiting"; } sleep 10; } @@ -190,31 +265,49 @@ + # Set the encoder we are going to use if ($encoder == 0) { - $enc = "bladeenc $encopt -QUIT -$bitrate \"$riptrackname.wav\" "; -@@ -427,6 +466,9 @@ - elsif ($encoder == 2) { - $enc = "gogo \"$riptrackname.wav\" \"$riptrackname.mp3\" $encopt -b $bitrate"; + $enc = "lame $encopt -S -b $bitrate --tt \"$tracklist[$_ - 1]\" --ta \"$artist\" --tl \"$album\" --ty \"$year\" --tg \"$genre\" --tn $riptrackno --add-id3v2 \"$riptrackname.wav\" \"$riptrackname.mp3\""; + } + elsif ($encoder == 1) { ++ $enc = "gogo \"$riptrackname.wav\" \"$riptrackname.mp3\" $encopt -b $bitrate"; ++ } ++ elsif ($encoder == 2) { + $enc = "oggenc $encopt -b $bitrate -t \"$tracklist[$_ - 1]\" -a \"$artist\" -l \"$album\" -d \"$year\" -N $riptrackno -o \"$riptrackname.ogg\" \"$riptrackname.wav\""; } + else { -+ die "No Encoder defined"; ++ die "No encoder defined"; + } if ( ! system("$enc >$enclog 2>&1 </dev/null")) { -@@ -443,6 +485,7 @@ +@@ -438,7 +490,8 @@ &printflush(RIPLOG,"MP3 Encoder Failed on $tracklist[$_ - 1]\n"); die "MP3 Encoder Failed on $tracklist[$_ - 1]"; } +- + } - ++ } exit ; -@@ -457,7 +500,7 @@ + } +@@ -452,10 +505,18 @@ $file="$artist.m3u"; if ($use_underscore == 1) { $file =~ s/ /_/g; } -- system("cd \"$mp3dir\" ; ls -rt *.mp3 >\"$file\""); -+ system("cd \"$mp3dir\" ; ls *.mp3 | sort >\"$file\""); +- if($encoder == 1) { +- system("cd \"$mp3dir\" ; ls -rt *.ogg >\"$file\""); ++ if ($encoder == 2) { ++ if ($numcpu == 1) { ++ system("cd \"$mp3dir\" ; ls -rt *.ogg >\"$file\""); ++ } else { ++ system("cd \"$mp3dir\" ; ls *.ogg | sort >\"$file\""); ++ } + } + else { +- system("cd \"$mp3dir\" ; ls -rt *.mp3 >\"$file\""); ++ if ($numcpu == 1) { ++ system("cd \"$mp3dir\" ; ls -rt *.mp3 >\"$file\""); ++ } else { ++ system("cd \"$mp3dir\" ; ls *.mp3 | sort >\"$file\""); ++ } + } } - - # Writes the MP3 tag to the file. The standard is to use the diff -uNr ripit.orig/pkg-descr ripit/pkg-descr --- ripit.orig/pkg-descr Sun Apr 16 15:38:59 2000 +++ ripit/pkg-descr Wed Oct 3 20:58:36 2001 @@ -2,8 +2,11 @@ ----- ripit is a small front-end program written in perl for ripping, -encoding & tagging MP3s. It is a console program that needs no user -intervention. It requires tosha, bladeenc and xmcd (for CDDB access). +encoding and tagging MP3s or Ogg/Vorbis files from audio CDs. It +is a console program that needs no user intervention. It requires +p5-CDDB for CDDB access and mp3info for genre checking. A track +ripper program and an encoder are also needed, but are not installed +automatically by this port, since users' preferences vary. WWW: http://www.bigfoot.com/~simon.quinn/ripit.html diff -uNr ripit.orig/pkg-message ripit/pkg-message --- ripit.orig/pkg-message Thu Jan 1 01:00:00 1970 +++ ripit/pkg-message Sun Sep 23 14:29:30 2001 @@ -0,0 +1,7 @@ +ripit can use a number of different programs to do the actual track +extraction and audio encoding. For ripit to be useful you need to +have at least one extract program and one encoder program installed. +However, since the choices are many and the users' needs and wants +are varied, none of these are automatically installed as part of +the ripit install. Remember to make sure you install the extractor(s) +and encoder(s) you want. --82I3+IH0IqGh5yIs-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110041140.f94Be4E50822>