%define date 20120320 %define sorev 1 Summary: Library for encoding and decoding H264/AVC video streams Name: x264 Version: 0.%{date} Release: 1 License: GPL Group: System Environment/Libraries URL: http://developers.videolan.org/x264.html Source0: http://downloads.videolan.org/pub/videolan/x264/snapshots/%{name}-snapshot-%{date}-2245.tar.bz2 Patch0: %{name}-snapshot-%{date}-2245-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: make, coreutils BuildRequires: AIX-rpm >= 5.2.0.0 BuildRequires: gcc >= 4.2.3-2 Requires: AIX-rpm >= 5.2.0.0 Requires: libgcc >= 4.2.3-2 %define _libdir64 %{_prefix}/lib64 %description Utility and library for encoding H264/AVC video streams. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for the x264 library Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel This package contains the files required to develop programs that will encode H264/AVC video streams using the x264 library. 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". %prep %setup -q -n %{name}-snapshot-%{date}-2245 %patch0 ln -s extras/getopt.h . 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_AIX52 -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 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}" \ --bindir="%{_bindir}" \ --includedir="%{_includedir}" \ --libdir="%{_libdir64}" \ --disable-asm \ --enable-visualize \ --enable-pic \ --extra-cflags="-I." gmake %{?_smp_mflags} lib%{name}.a CreateExportList -X64 lib%{name}.exp lib%{name}.a ${CC} -shared lib%{name}.a -o lib%{name}.so.%{sorev} -Wl,-bE:lib%{name}.exp -lpthread -lm -lX11 #cc -q64 -qmkshrobj lib%{name}.a -o lib%{name}.so.%{sorev} -bE:lib%{name}.exp -lpthread -lm -lX11 -L/opt/freeware/lib -lgcc_s rm -f lib%{name}.exp rm -f lib%{name}.a # now create the AIX-style shared library /usr/bin/ar -X64 -rv lib%{name}.a lib%{name}.so.%{sorev} # finish the compile step gmake %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export CC="gcc -maix32 -mcpu=power3" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix="%{_prefix}" \ --bindir="%{_bindir}" \ --includedir="%{_includedir}" \ --libdir="%{_libdir}" \ --disable-asm \ --enable-visualize \ --enable-pic \ --extra-cflags="-I." gmake %{?_smp_mflags} lib%{name}.a CreateExportList -X32 lib%{name}.exp lib%{name}.a ${CC} -shared lib%{name}.a -o lib%{name}.so.%{sorev} -Wl,-bE:lib%{name}.exp -lpthread -lm -lX11 #cc -q32 -qmkshrobj lib%{name}.a -o lib%{name}.so.%{sorev} -bE:lib%{name}.exp -lpthread -lm -lX11 -L/opt/freeware/lib -lgcc_s rm -f lib%{name}.exp rm -f lib%{name}.a # now create the AIX-style shared library /usr/bin/ar -X32 -q ../64bit/lib%{name}.a lib%{name}.so.%{sorev} ln -s ../64bit/lib%{name}.a . # finish the compile step gmake %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 64bit export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install install-lib-static ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install install-lib-static /usr/bin/strip -X32_64 ${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 ) ( 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/COPYING %{_bindir}/* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/bin/* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/doc/*.txt %{_includedir}/* %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* /usr/include/* %changelog * Wed Mar 21 2012 Michael Perzl - 0.20120320-1 - updated to version 0.20120320 * Sat Dec 17 2011 Michael Perzl - 0.20111216-1 - updated to version 0.20111216 * Tue Oct 04 2011 Michael Perzl - 0.20111004-1 - updated to version 0.20111004 * Wed Aug 24 2011 Michael Perzl - 0.20110823-1 - updated to version 0.20110823 * Fri Jun 24 2011 Michael Perzl - 0.20110622-1 - updated to version 0.20110622 * Thu Apr 08 2011 Michael Perzl - 0.20110406-1 - updated to version 0.20110406 * Thu Feb 03 2011 Michael Perzl - 0.20101111-1 - first version for AIX V5.1 and higher