%define sorev 0 Name: libvpx Summary: VP8 Video Codec SDK Version: 0.9.7.1 Release: 1 License: BSD Group: System/Libraries Source0: http://webm.googlecode.com/files/%{name}-v0.9.7-p1.tar.bz2 Source1: %{name}.pc Patch0: %{name}-%{version}-aix.patch URL: http://www.webmproject.org/tools/vp8-sdk/ BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: make BuildRequires: doxygen BuildRequires: php-cli BuildRequires: gcc >= 4.2.3-2 Requires: libgcc >= 4.2.3-2 %define _libdir64 %{_prefix}/lib64 %description %{name} provides the VP8 SDK, which allows you to integrate your applications with the VP8 video codec, a high quality, royalty free, open source codec deployed on millions of computers and devices worldwide. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/C Requires: %{name} = %{version}-%{release} %description devel Development libraries and headers for developing software against %{name}. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "gcc -maix64". %package utils Summary: VP8 utilities and tools Group: Video Requires: %{name} = %{version}-%{release} %description utils A selection of utilities and tools for VP8, including a sample encoder and decoder. %prep %setup -q -n %{name}-v0.9.7-p1 %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export CC="gcc -maix64 -mcpu=power3" export LD=${CC} export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --target=generic-gnu \ --enable-pic \ --enable-install-docs \ --disable-install-srcs \ --enable-vp8 \ --disable-debug \ --disable-debug-libs gmake target=libs # build the shared library out of the static library CreateExportList -X64 %{name}.exp %{name}.a ${CC} -shared %{name}.a -o %{name}.so.%{sorev} -Wl,-bE:%{name}.exp -lpthread -lm rm -f %{name}.exp rm -f %{name}.a # now create the AIX-style shared library /usr/bin/ar -X64 -rv %{name}.a %{name}.so.%{sorev} # finish the compile step gmake target=examples gmake target=docs cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export CC="gcc -maix32 -mcpu=power3" export LD=${CC} export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --target=generic-gnu \ --enable-pic \ --enable-install-docs \ --disable-install-srcs \ --enable-vp8 \ --disable-debug \ --disable-debug-libs gmake target=libs # build the shared library out of the static library CreateExportList -X32 %{name}.exp %{name}.a ${CC} -shared %{name}.a -o %{name}.so.%{sorev} -Wl,-bE:%{name}.exp -lpthread -lm rm -f %{name}.exp rm -f %{name}.a # now create the AIX-style shared library /usr/bin/ar -X32 -q ../64bit/%{name}.a %{name}.so.%{sorev} ln -s ../64bit/%{name}.a . # finish the compile step gmake target=examples gmake target=docs %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 gmake DIST_DIR=${RPM_BUILD_ROOT}%{_prefix} install for f in simple_decoder simple_encoder twopass_encoder ; do cp ${f} ${RPM_BUILD_ROOT}%{_bindir}/vp8_${f} done ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 gmake DIST_DIR=${RPM_BUILD_ROOT}%{_prefix} install for f in simple_decoder simple_encoder twopass_encoder ; do cp ${f} ${RPM_BUILD_ROOT}%{_bindir}/vp8_${f} done /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/* ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # install the pkg-config file mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig mkdir -p ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig cat %{SOURCE1} | \ sed "s|@PREFIX@|%{_prefix}|g" | \ sed "s|@LIBDIR@|%{_libdir}|g" | \ sed "s|@INCLUDEDIR@|%{_includedir}|g" | \ sed "s|Version: 0.9.0|Version: %{version}|g" \ > ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/%{name}.pc cat %{SOURCE1} | \ sed "s|@PREFIX@|%{_prefix}|g" | \ sed "s|@LIBDIR@|%{_libdir64}|g" | \ sed "s|@INCLUDEDIR@|%{_includedir}|g" | \ sed "s|Version: 0.9.0|Version: %{version}|g" \ > ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig/%{name}.pc ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/AUTHORS 32bit/CHANGELOG 32bit/LICENSE 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/docs/html %{_includedir}/* %{_libdir}/pkgconfig/%{name}.pc %{_libdir64}/pkgconfig/%{name}.pc /usr/include/* %files utils %doc 32bit/AUTHORS 32bit/CHANGELOG 32bit/LICENSE 32bit/README %defattr(-,root,system,-) %{_bindir}/* /usr/bin/* %changelog * Sun Aug 21 2011 Michael Perzl - 0.9.7.1-1 - updated to version 0.9.7.1 * Mon May 02 2011 Michael Perzl - 0.9.6-1 - updated to version 0.9.6 * Thu Feb 03 2011 Michael Perzl - 0.9.5-1 - first version for AIX V5.1 and higher