Package-Name: lame
Gentoo-Package: media-sound/lame
Rebuild-For: gtk+
Compile-Requires: nasm
Homepage: http://www.mp3dev.org/mp3/
Source: sourceforge:///lame/lame-(\d+.\d+(.\d+)?).tar.gz $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	$(MAKE) -f ../Makefile configure CONFIGURE_OPTS=--enable-nasm
	$(MAKE)
# Avoid problems with overwriting shared libraries
	rm -f "$(PREFIX)"/lib/*.so*
	$(MAKE) install
Install:
	$(MAKE) instbin BIN=lame
	$(MAKE) instlib LIB=mp3lame
	$(MAKE) addldso
	$(MAKE) instinc INC=lame
	$(MAKE) instman SECTION=1 MAN=lame
Clean:
	@set -e ; cd "$(PREFIX)"/lib ; \
	for lib in *.so.[0-9] ; do \
		reallib=`/bin/ls -l "$$lib" | sed 's/.* -> //'` ; \
		for file in $$lib.[0-9]*.[0-9]* ; do \
			if test "$$file" != "$$reallib" ; then \
				rm -fv "$$file" ; \
			fi ; \
		done ; \
	done
NoPatch: <<EOT
######## begin track>=100 crash patch (from CVS)
diff -urN ../lame-3.96.1-orig/libmp3lame/id3tag.c libmp3lame/id3tag.c
--- ../lame-3.96.1-orig/libmp3lame/id3tag.c	2004-02-02 21:38:30 +0900
+++ libmp3lame/id3tag.c	2006-03-06 13:13:51 +0900
@@ -392,7 +392,7 @@
             size_t encoder_length;
             char year[5];
             size_t year_length;
-            char track[3];
+            char track[8];
             size_t track_length;
             char genre[6];
             size_t genre_length;
######## end track>=100 crash patch
EOT
NoPatch: <<EOT
--- libmp3lame/gain_analysis.h.old	2004-03-19 22:35:55 +0900
+++ libmp3lame/gain_analysis.h	2004-04-19 13:49:14 +0900
@@ -58,13 +58,13 @@
 #define YULE_FILTER     filterYule
 #define BUTTER_FILTER   filterButter
 #define RMS_PERCENTILE      0.95        /* percentile which is louder than the proposed level */
-#define MAX_SAMP_FREQ   48000.          /* maximum allowed sample frequency [Hz] */
-#define RMS_WINDOW_TIME     0.050       /* Time slice size [s] */
+#define MAX_SAMP_FREQ   48000           /* maximum allowed sample frequency [Hz] */
+#define RMS_WINDOW_TIME_DIV 20          /* 1 / time slice size [s] */
 #define STEPS_per_dB      100.          /* Table entries per dB */
 #define MAX_dB            120.          /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */
 
 #define MAX_ORDER               (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER)
-#define MAX_SAMPLES_PER_WINDOW  (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME +1)      /* max. Samples per Time slice */
+#define MAX_SAMPLES_PER_WINDOW  (size_t) (MAX_SAMP_FREQ / RMS_WINDOW_TIME_DIV + 1)      /* max. Samples per Time slice */
 
 
 
--- libmp3lame/gain_analysis.c.old	2004-03-27 23:21:57 +0900
+++ libmp3lame/gain_analysis.c	2004-04-19 13:49:14 +0900
@@ -215,13 +215,7 @@
         default:    return INIT_GAIN_ANALYSIS_ERROR;
     }
 
-#if defined (__GNUC__) && defined (__OPTIMIZE__) && defined (__i386__)
-    /* workaround for the floating-point trouble with x86's extended 
-       precision when compiled by GCC with optimizations */
-    rgData->sampleWindow = (long) ceil ((float)((double)samplefreq * (double)RMS_WINDOW_TIME));
-#else
-    rgData->sampleWindow = (long) ceil (samplefreq * RMS_WINDOW_TIME);
-#endif
+    rgData->sampleWindow = (samplefreq + RMS_WINDOW_TIME_DIV-1) / RMS_WINDOW_TIME_DIV;
 
     rgData->lsum         = 0.;
     rgData->rsum         = 0.;
EOT

/pkg/lame/
/usr/bin/lame
/usr/include/lame
/usr/lib/libmp3lame.*
/usr/man/man1/lame.1.gz
