libavcodec1-shlibs stable port information

# Do NOT transfer to 10.7. Very old ABI.
# Any package that depends on this should be updated to depend
# on at least ffmpeg-0.7.

Package: libavcodec1-shlibs
Version: 0.4.9-pre1
Revision: 1016
Architecture: i386, powerpc
###
# No C++ symbols used
BuildDepends: a52dec-dev, fink (>= 0.24.12), imlib2, lame-dev, libfaad1-dev, libmp4v21-dev, libogg, libpostproc1, libvorbis0, sdl (>= 1.2.9-1001)
Depends: a52dec-shlibs, lame-shlibs, libpostproc1-shlibs, libvorbis0-shlibs
Conflicts: ffmpeg (<< 0.4.6-1)
Replaces: ffmpeg (<< 0.4.6-1)
###
Source: mirror:sourceforge:ffmpeg/ffmpeg-%v.tar.gz
Source-MD5: ea5587e3c66d50b1503b82ac4179c303
###
PatchScript: <<
%{default_script}
### WTF and YUCK
perl -pi -e 's,LDFLAGS=\"-Wl\,-d\",LDFLAGS=\"\",g' configure
perl -pi -e 's,\#define printf please_use_av_log,\/\/\#define printf please_use_av_log,g' libavcodec/common.h
perl -pi -e 's,\#define fprintf please_use_av_log,\/\/\#define fprintf please_use_av_log,g' libavcodec/common.h
perl -pi -e 's,\#define fprintf please_use_av_log,\/\/\#define fprintf please_use_av_log,g' libavcodec/utils.c
perl -pi -e 's,\#undef fprintf,\/\/\#undef fprintf,g' libavcodec/utils.c
perl -pi -e 's,\#define time time_is_forbidden_due_to_security_issues,\/\/\#define time time_is_forbidden_due_to_security_issues,g' libavcodec/common.h
### Fix ffserver conf file location
perl -pi -e 's,/etc,%p/etc,g' ffserver.c
### Enable ffserver on darwin
perl -pi -e 's,ffserver="no",ffserver="yes",g' configure
### Fix for Imlib2
perl -pi -e 's,-lImlib2,-I%p/include -L%p/lib -lImlib2,g' configure
### Lib version fix & so -> dylib
perl -pi -e 's,dynamiclib\",dynamiclib -undefined dynamic_lookup -compatibility_version 1 -current_version 1.4.8 -install_name %p/lib/\\\$(SLIB_INSTALL)\"\nSLIBSUF=\".dylib\",g' configure
### Fix dlopen filenames
perl -pi -e 's,liba52.so.0,%p/lib/liba52.0.dylib,g' libavcodec/a52dec.c
perl -pi -e 's,libfaad.so.0,%p/lib/libfaad.0.dylib,g' libavcodec/faad.c
### More fixes for dylib
perl -pi -e 's,\$\(SLIBSUF\),.0.4.8\$\(SLIBSUF\),g' Makefile
perl -pi -e 's,\$\(SLIBSUF\),.0.4.8\$\(SLIBSUF\),g' libavcodec/Makefile
perl -pi -e 's,\$\(SLIBSUF\),.0.4.8\$\(SLIBSUF\),g' libavformat/Makefile
perl -pi -e 's,SLIB=,SLIB_INSTALL=\$(SLIBPREF)avcodec.0\$(SLIBSUF)\nSLIB=,g' libavcodec/Makefile
perl -pi -e 's,SLIB=,SLIB_INSTALL=\$(SLIBPREF)avformat.0\$(SLIBSUF)\nSLIB=,g' libavformat/Makefile
perl -pi -e 's,\$\(CC\) \$\(SHFLAGS\) -o (.*),\$\(CC\) \$\(SHFLAGS\) -o $1\n\tln -sf \$\(SLIB\) \$\(SLIBPREF\)avcodec.0\$\(SLIBSUF\)\n\tln -sf \$(SLIB\) \$\(SLIBPREF\)avcodec\$\(SLIBSUF\),g' libavcodec/Makefile
perl -pi -e 's,\$\(CC\) \$\(SHFLAGS\) -o (.*),\$\(CC\) \$\(SHFLAGS\) -o $1\n\tln -sf \$\(SLIB\) \$\(SLIBPREF\)avformat.0\$\(SLIBSUF\)\n\tln -sf \$(SLIB\) \$\(SLIBPREF\)avformat\$\(SLIBSUF\),g' libavformat/Makefile
### libsvformat shared lib linking
perl -pi -e 's,PPOBJS=,PPOBJS=\nLIBS+=-L../libavcodec -lavcodec\nEXTRALIBS+=-lmp3lame -lvorbis -lvorbisenc -logg,g' libavformat/Makefile
perl -pi -e 's,\$\(EXTRALIBS\),\$\(LIBS\) \$\(EXTRALIBS\),g' libavformat/Makefile
### Not sure why this is needed, but it is for now
### looks like the first endif, ends at the wrong place...should be before
### the second if.
perl -pi -e 's,-logg -lvorbis -lvorbisenc,-lmp3lame -logg -lvorbis -lvorbisenc,g' Makefile
### Fix vhook
perl -pi -e 's,\+=-flat_namespace -undefined suppress,=-bundle -avoid-version,g' vhook/Makefile
perl -pi -e 's,\$<,\$< -L../libavcodec -lavcodec -L../libavformat -lavformat -L%p/lib,g' vhook/Makefile
### Can't strip libs with ref to dylibs
perl -pi -e 's,install -s,install,g' vhook/Makefile
perl -pi -e 's,install -s -m 755 \$\(SLIB\) \$\(prefix\)/lib/libavcodec-\$\(VERSION\)\.so,install -m 755 \$\(SLIB\) \$\(prefix\)/lib/\$\(SLIB\),g' libavcodec/Makefile
perl -pi -e 's,ln -sf libavcodec-\$\(VERSION\)\.so \$\(prefix\)/lib/libavcodec\.so, ,g' libavcodec/Makefile
perl -pi -e 's,ldconfig \|\| true, ,g' libavcodec/Makefile
perl -pi -e 's,install -s -m 755 \$\(SLIB\) \$\(prefix\)/lib/libavformat-\$\(VERSION\).so,install -m 755 \$\(SLIB\) \$\(prefix\)/lib/\$\(SLIB\),g' libavformat/Makefile
perl -pi -e 's,ln -sf libavformat-\$\(VERSION\)\.so \$\(prefix\)/lib/libavformat\.so, ,g' libavformat/Makefile
perl -pi -e 's,ldconfig \|\| true, ,g' libavformat/Makefile
### Fix bin install
perl -pi -e 's,"\$\(bindir\)",\$\(prefix\)/bin,g' Makefile
### Fixes for fink's ft2, I need to manually add the fink includes
perl -pi -e 's,\$\@ \$\<,\$\@ \$\< -I%p/include,g' Makefile
perl -pi -e 's,\$\@ \$\<,\$\@ \$\< -I%p/include,g' libavcodec/Makefile
perl -pi -e 's,\$\@ \$\<,\$\@ \$\< -I%p/include,g' libavformat/Makefile
perl -pi -e 's,\$\< (.*)?,\$\< $1 -I%p/include,g' vhook/Makefile
### Fix for ffplay
perl -pi -e 's,-o \$\@ ffplay.o,-bind_at_load -o \$\@ ffplay.o,g' Makefile
### Fix for 10.4
perl -pi -e 's,APPLE,NOTAPPLE,g' libavformat/tcp.c
<<
PatchFile: %n.patch
PatchFile-MD5: cc5d1c986bed953ba78ae3597ace5069
###
DocFiles: COPYING
###
ConfigureParams: --extra-libs="-L%p/lib -la52" (%m = powerpc) --extra-cflags="-force_cpusubtype_ALL -Wno-sign-compare -maltivec -fno-common" (%m = i386) --extra-cflags="-force_cpusubtype_ALL -Wno-sign-compare -fno-common -DPIC" --enable-gpl --enable-mp3lame --enable-vorbis --enable-pp --enable-shared-pp (%m = powerpc) --powerpc-perf-enable --disable-faac --enable-faad --enable-faadbin --enable-a52 --enable-a52bin --enable-shared --mandir=%p/share/man --disable-mmx --disable-audio-beos --disable-v4l --disable-dv1394
###
InstallScript: <<
make install prefix=%i mandir=%i/share/man
install -d %i/etc
install -m 664 doc/ffserver.conf %i/etc
ln -sf libavcodec.0.4.8.dylib %i/lib/libavcodec.0.dylib
ln -sf libavcodec.0.4.8.dylib %i/lib/libavcodec.dylib
ln -sf libavformat.0.4.8.dylib %i/lib/libavformat.0.dylib
ln -sf libavformat.0.4.8.dylib %i/lib/libavformat.dylib

### Remove ffmpeg and ffmpegserver files, this PKG is LEGACY only now
rm -rf %i/bin
rm -rf %i/etc
rm -rf %i/share
rm -rf %i/lib/vhook
rm -rf %i/include/ffmpeg/avio.h
rm -rf %i/include/ffmpeg/common.h
rm -rf %i/include/ffmpeg/rational.h
rm -rf %i/include/ffmpeg/rtp.h
rm -rf %i/include/ffmpeg/rtsp.h
rm -rf %i/include/ffmpeg/rtspcodes.h
<<
Shlibs: %p/lib/libavcodec.0.dylib 1.0.0 %n (>= 0.4.6-1)
###
SplitOff2: <<
Package: libavcodec1-dev
Depends: libavcodec1-shlibs (= %v-%r)
Conflicts: ffmpeg (<< 0.4.6-1), libavcodec-dev, libavcodec1-dev, libavcodec52-dev, libavcodec53-dev
Replaces: ffmpeg (<< 0.4.6-1), libavcodec-dev, libavcodec1-dev, libavcodec52-dev, libavcodec53-dev
BuildDependsOnly: true
Files: <<
include/ffmpeg/avcodec.h
lib/libavcodec.dylib
<<
DocFiles: COPYING
Description: Audio/video encoders and decoders dev files
<<
SplitOff3: <<
Package: libavformat1-shlibs
Depends: a52dec-shlibs, lame-shlibs, libavcodec1-shlibs, libogg-shlibs, libvorbis0-shlibs
Files: <<
lib/libavformat.*.dylib
<<
Shlibs: <<
%p/lib/libavformat.0.dylib 1.0.0 %n (>= 0.4.8-1)
<<
DocFiles: COPYING
Description: Parsers and generators for all common audio/video formats libs
<<
SplitOff4: <<
Package: libavformat1-dev
Depends: libavformat1-shlibs (= %v-%r)
Conflicts: libavformat-dev, libavformat1-dev, libavformat52-dev, libavformat53-dev
Replaces: libavformat-dev, libavformat1-dev, libavformat52-dev, libavformat53-dev
BuildDependsOnly: true
Files: <<
include/ffmpeg/avformat.h
lib/libavformat.dylib
<<
DocFiles: COPYING
Description: Parsers and generators for all common audio/video formats dev
<<
###
Description: Audio/video encoders and decoders libs
DescDetail: <<
FFMpeg is a complete and free Internet live audio and video broadcasting
solution for Linux/Unix. It also includes a digital VCR. It can encode in
real time in many formats including MPEG1 audio and video, MPEG4, h263,
ac3, asf, avi, real, mjpeg, and flash.

sudo daemonic enable ffserver

ffplay, currently broken, SDL crash
<<
###
License: GPL
Maintainer: Justin F. Hallett
Homepage: http://ffmpeg.sourceforge.net/

libavcodec1-shlibs stable port .patch

diff -ru ffmpeg-0.4.9-pre1.orig/libavcodec/ac3tab.h ffmpeg-0.4.9-pre1/libavcodec/ac3tab.h
--- ffmpeg-0.4.9-pre1.orig/libavcodec/ac3tab.h 2004-06-26 06:08:49.000000000 -0400
+++ ffmpeg-0.4.9-pre1/libavcodec/ac3tab.h 2006-03-23 22:39:30.000000000 -0500
@@ -4,10 +4,10 @@
*/

/* possible frequencies */
-static const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
+const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };

/* possible bitrates */
-static const uint16_t ac3_bitratetab[19] = {
+const uint16_t ac3_bitratetab[19] = {
32, 40, 48, 56, 64, 80, 96, 112, 128,
160, 192, 224, 256, 320, 384, 448, 512, 576, 640
};
@@ -15,7 +15,7 @@
/* AC3 MDCT window */

/* MDCT window */
-static const int16_t ac3_window[256] = {
+const int16_t ac3_window[256] = {
4, 7, 12, 16, 21, 28, 34, 42,
51, 61, 72, 84, 97, 111, 127, 145,
164, 184, 207, 231, 257, 285, 315, 347,
@@ -144,27 +144,27 @@
15, 15, 15, 15,
};

-static const uint8_t sdecaytab[4]={
+const uint8_t sdecaytab[4]={
0x0f, 0x11, 0x13, 0x15,
};

-static const uint8_t fdecaytab[4]={
+const uint8_t fdecaytab[4]={
0x3f, 0x53, 0x67, 0x7b,
};

-static const uint16_t sgaintab[4]= {
+const uint16_t sgaintab[4]= {
0x540, 0x4d8, 0x478, 0x410,
};

-static const uint16_t dbkneetab[4]= {
+const uint16_t dbkneetab[4]= {
0x000, 0x700, 0x900, 0xb00,
};

-static const uint16_t floortab[8]= {
+const uint16_t floortab[8]= {
0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
};

-static const uint16_t fgaintab[8]= {
+const uint16_t fgaintab[8]= {
0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
};

diff -ru ffmpeg-0.4.9-pre1.orig/libavcodec/avcodec.h ffmpeg-0.4.9-pre1/libavcodec/avcodec.h
--- ffmpeg-0.4.9-pre1.orig/libavcodec/avcodec.h 2004-07-09 08:49:55.000000000 -0400
+++ ffmpeg-0.4.9-pre1/libavcodec/avcodec.h 2006-03-23 22:35:39.000000000 -0500
@@ -1657,6 +1657,13 @@
#define FF_OPT_MAX_DEPTH 10
} AVOption;

+#ifdef HAVE_MMX
+extern const struct AVOption avoptions_common[3 + 5];
+#else
+extern const struct AVOption avoptions_common[3];
+#endif
+extern const struct AVOption avoptions_workaround_bug[11];
+
/**
* Parse option(s) and sets fields in passed structure
* @param strct structure where the parsed results will be written
diff -ru ffmpeg-0.4.9-pre1.orig/libavcodec/common.h ffmpeg-0.4.9-pre1/libavcodec/common.h
--- ffmpeg-0.4.9-pre1.orig/libavcodec/common.h 2004-07-01 08:33:07.000000000 -0400
+++ ffmpeg-0.4.9-pre1/libavcodec/common.h 2006-03-23 22:35:21.000000000 -0500
@@ -63,12 +63,6 @@
#define AVOPTION_END() AVOPTION_SUB(NULL)

struct AVOption;
-#ifdef HAVE_MMX
-extern const struct AVOption avoptions_common[3 + 5];
-#else
-extern const struct AVOption avoptions_common[3];
-#endif
-extern const struct AVOption avoptions_workaround_bug[11];

#endif /* HAVE_AV_CONFIG_H */

libavcodec1-shlibs _unstable_ port .patch