2 #build universal binary of ffmpeg2theora and package it
6 tmp_dir
=/tmp
/ffmpeg2theora
7 build_dir
=$tmp_dir/$arch
8 dist_dir
=$tmp_dir/dist
/$arch
13 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
=0
14 export PKG_CONFIG_ALLOW_SYSTEM_LIBS
=0
15 export PKG_CONFIG_LIBDIR
=$dist_dir/lib
/pkgconfig
17 ffmpeg_extra
="--enable-pp --enable-gpl --enable-swscaler --disable-encoders --enable-libogg --enable-libvorbis"
18 ffmpeg_extra
="$ffmpeg_extra --enable-liba52"
19 test -e $dist_dir/lib
/libfaad.a
&& ffmpeg_extra
="$ffmpeg_extra --enable-faad" && echo "building with faad"
21 if [ $arch == 'ppc' ]; then
23 ffmpeg_extra
="$ffmpeg_extra --cpu=G4"
26 ffmpeg_extra
="$ffmpeg_extra --cpu=pentium-m"
28 export CFLAGS
="-arch $arch"
29 export LDFLAGS
="-arch $arch"
33 echo "using existing $arch/libogg"
35 echo "building $arch/libogg"
36 svn co https
://svn.xiph.org
/trunk
/ogg
38 .
/autogen.sh
--disable-shared --prefix=$dist_dir && make && make install
40 export PKG_CONFIG_PATH
=$build_dir/ogg
:$PKG_CONFIG_PATH
43 package
="vorbis-aotuv"
44 if [ -e $package ]; then
45 echo "using existing $arch/$package"
47 echo "building $package"
48 svn co https
://svn.xiph.org
/branches
/vorbis-aotuv
/
50 .
/autogen.sh
--disable-shared --prefix=$dist_dir && make && make install
52 export PKG_CONFIG_PATH
=$build_dir/$package:$PKG_CONFIG_PATH
56 if [ -e $package ]; then
57 echo "using existing $arch/$package"
59 echo "building $package"
60 svn co https
://svn.xiph.org
/trunk
/theora
62 .
/autogen.sh
--disable-shared --prefix=$dist_dir --host=$arch && make && make install
64 export PKG_CONFIG_PATH
=$build_dir/$package:$PKG_CONFIG_PATH
67 package
="a52dec-0.7.4"
68 if [ -e $package ]; then
69 echo "using existing $arch/$package"
71 echo "building $arch/$package"
72 tarball
="http://liba52.sourceforge.net/files/$package.tar.gz"
73 test -e $package || curl
$tarball > $package.
tar.gz
&& tar xzf
$package.
tar.gz
74 cd $package && .
/configure
--disable-shared --prefix=$dist_dir && make && make install
79 if [ -e $package ]; then
80 echo "using existing $arch/$package"
82 echo "building $arch/$package"
83 test -e ffmpeg || svn co svn
://svn.mplayerhq.hu
/ffmpeg
/trunk ffmpeg
87 .
/configure
--cross-compile $ffmpeg_extra --arch=$ffmpeg_arch \
88 --extra-ldflags="-L$dist_dir/lib -arch $arch" \
89 --extra-cflags="-I$dist_dir/include -arch $arch"
92 export PKG_CONFIG_PATH
=$build_dir/ffmpeg
:$PKG_CONFIG_PATH
94 echo "build $arch/ffmpeg2theora"
95 export CFLAGS
="-arch $arch"
96 export LDFLAGS
="-arch $arch"
98 test -e ffmpeg2theora || svn co https
://svn.xiph.org
/trunk
/ffmpeg2theora
101 .
/autogen.sh
--prefix=$dist_dir --with-static-linking
106 echo "building ffmpeg2theora"
109 arch
=ppc build_all_osx
110 arch
=i386 build_all_osx
112 echo "building universal/ffmpeg2theora"
113 tmp_dir
=/tmp
/ffmpeg2theora
114 build_dir
=$tmp_dir/build
115 dist_dir
=$tmp_dir/dist
116 mkdir
-p $dist_dir/universal
/usr
/local
/bin
117 mkdir
-p $dist_dir/universal
/usr
/local
/share
/man
/man
1/
118 cp $dist_dir/i386
/share
/man
/man
1/ffmpeg2theora
.1 $dist_dir/universal
/usr
/local
/share
/man
/man
1/
119 strip
$dist_dir/ppc
/bin
/ffmpeg2theora
120 strip
$dist_dir/i386
/bin
/ffmpeg2theora
121 lipo
-create -arch ppc
$dist_dir/ppc
/bin
/ffmpeg2theora \
122 -arch i386
$dist_dir/i386
/bin
/ffmpeg2theora \
123 -output $dist_dir/universal
/usr
/local
/bin
/ffmpeg2theora
125 version
=`grep AC_INIT $dist_dir/../i386/ffmpeg2theora/configure.ac | cut -f 2 -d"," | cut -f 1 -d")"`
126 sudo
/Developer
/Applications
/Utilities
/PackageMaker.app
/Contents
/MacOS
/PackageMaker \
127 -build -proj /tmp
/ffmpeg2theora
/i386
/ffmpeg2theora
/ffmpeg2theora.pmproj \
128 -p $dist_dir/ffmpeg2theora-
$version.pkg
131 zip -r ffmpeg2theora-
$version.pkg.
zip ffmpeg2theora-
$version.pkg