%define major 8 %define libname %mklibname vpx %{major} %define develname %mklibname vpx -d # disable to build without php and doxygen %define build_doc 1 Name: libvpx Summary: VP8 Video Codec SDK Version: 1.13.1 Release: %mkrel 1 License: BSD Group: System/Libraries URL: https://www.webmproject.org/tools/#libvpx-sdk Source0: https://github.com/webmproject/libvpx/archive/v%{version}/%{name}-%{version}.tar.gz %ifarch %{ix86} x86_64 BuildRequires: yasm %endif %if %{build_doc} BuildRequires: doxygen %endif %description libvpx 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. %package -n %{libname} Summary: VP8 Video Codec SDK Group: System/Libraries %description -n %{libname} libvpx 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. %package -n %{develname} Summary: Development files for libvpx Group: Development/C Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %description -n %{develname} Development libraries and headers for developing software against libvpx. %package utils Summary: VP8 utilities and tools Group: Video/Utilities Requires: %{libname} = %{version}-%{release} %description utils A selection of utilities and tools for VP8, including a sample encoder and decoder. %prep %autosetup -p1 # fix permissions chmod 644 AUTHORS CHANGELOG LICENSE README %build %ifarch %{ix86} %global vpxtarget x86-linux-gcc %else %ifarch x86_64 %global vpxtarget x86_64-linux-gcc %else %global vpxtarget generic-gnu %endif %endif %set_build_flags # The configure script will reject the shared flag on the generic target # This means we need to fall back to the manual creation we did before. :P %if "%{vpxtarget}" == "generic-gnu" %global generic_target 1 %else %global generic_target 0 %endif sh ./configure \ --target=%{vpxtarget} \ --enable-pic \ --disable-install-srcs \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --enable-shared \ --size-limit=16384x16384 \ --enable-postproc \ --enable-experimental \ --enable-vp9-postproc \ --enable-vp8 \ --enable-vp9 %make_build verbose=true target=libs # Temporarily dance the static libs out of the way mv libvpx.a libNOTvpx.a mv libvpx_g.a libNOTvpx_g.a # We need to do this so the examples can link against it. #ln -sf libvpx.so.%%{version} libvpx.so %make_build verbose=true target=examples %make_build verbose=true target=docs # Put them back so the install doesn't fail mv libNOTvpx.a libvpx.a mv libNOTvpx_g.a libvpx_g.a %install make DIST_DIR=%{buildroot}%{_prefix} dist # Install the pkg-config file mkdir -p %{buildroot}%{_libdir}/pkgconfig/ ln -s vpx.pc %{buildroot}%{_libdir}/pkgconfig/libvpx.pc %if %{build_doc} # Simpler to label the dir as %doc. mv %{buildroot}/usr/docs doc/ %endif pushd %{buildroot} # Stuff we don't need. rm -rf usr/build/ usr/md5sums.txt usr/lib*/*.a usr/CHANGELOG usr/README # Rename a few examples, move all to bindir mv usr/bin/examples/postproc usr/bin/vp8_postproc mv usr/bin/examples/simple_decoder usr/bin/vp8_simple_decoder mv usr/bin/examples/simple_encoder usr/bin/vp8_simple_encoder mv usr/bin/examples/twopass_encoder usr/bin/vp8_twopass_encoder mv usr/bin/examples/decode_to_md5 usr/bin/vpx_decode_to_md5 mv usr/bin/examples/decode_with_drops usr/bin/vpx_decode_with_drops mv usr/bin/examples/set_maps usr/bin/vpx_set_maps mv usr/bin/examples/vp9_spatial_svc_encoder usr/bin/ mv usr/bin/examples/{vp8cx_set_ref,vp9cx_set_ref,vp9_lossless_encoder,vpx_temporal_svc_encoder} usr/bin/ rmdir usr/bin/examples # Fix the binary permissions chmod 755 usr/bin/* popd %files -n %{libname} %doc AUTHORS CHANGELOG LICENSE README %{_libdir}/libvpx.so.%{major}{,.*} %files -n %{develname} %if %{build_doc} # These are SDK docs, not really useful to an end-user. %doc docs/html %endif %{_libdir}/pkgconfig/*.pc %{_libdir}/libvpx.so # to fix weird header files permissions %defattr(644,root,root,755) %{_includedir}/vpx/ %files utils %{_bindir}/*