Blame SPECS/libvpx.spec

44b363
%global somajor 5
44b363
%global sominor 0
44b363
%global sotiny  0
44b363
%global soversion %{somajor}.%{sominor}.%{sotiny}
44b363
44b363
Name:			libvpx
44b363
Summary:		VP8/VP9 Video Codec SDK
44b363
Version:		1.7.0
44b363
Release:		8%{?dist}
44b363
License:		BSD
44b363
Group:			System Environment/Libraries
44b363
#Source0:		http://downloads.webmproject.org/releases/webm/%{name}-%{version}.tar.bz2
44b363
Source0:		https://github.com/webmproject/libvpx/archive/v%{version}.tar.gz
44b363
Source1:		vpx_config.h
44b363
# Thanks to debian.
44b363
Source2:		libvpx.ver
44b363
URL:			http://www.webmproject.org/code/
44b363
%ifarch %{ix86} x86_64
44b363
BuildRequires:		yasm
44b363
%endif
44b363
BuildRequires:		doxygen, perl(Getopt::Long)
44b363
# Do not disable FORTIFY_SOURCE=2
44b363
Patch0:			libvpx-1.7.0-leave-fortify-source-on.patch
44b363
Patch1:			0001-CVE-2019-9232-Fix-OOB-memory-access-on-fuzzed-data.patch
44b363
Patch2:			0002-CVE-2019-9433-VP8-Fix-use-after-free-in-postproc.patch
44b363
Patch3:			0003-CVE-2019-9371-update-libwebm.patch
44b363
Patch4:			0004-CVE-2019-2126-update-libwebm-to-libwebm-1.0.0.27-361.patch
44b363
44b363
%description
44b363
libvpx provides the VP8/VP9 SDK, which allows you to integrate your applications 
44b363
with the VP8 and VP9 video codecs, high quality, royalty free, open source codecs 
44b363
deployed on millions of computers and devices worldwide. 
44b363
44b363
%package devel
44b363
Summary:		Development files for libvpx
44b363
Group:			Development/Libraries
44b363
Requires:		%{name}%{?_isa} = %{version}-%{release}
44b363
44b363
%description devel
44b363
Development libraries and headers for developing software against 
44b363
libvpx.
44b363
44b363
%package utils
44b363
Summary:		VP8 utilities and tools
44b363
Group:			Development/Tools
44b363
Requires:		%{name}%{?_isa} = %{version}-%{release}
44b363
44b363
%description utils
44b363
A selection of utilities and tools for VP8, including a sample encoder
44b363
and decoder.
44b363
44b363
%prep
44b363
%setup -q -n libvpx-%{version}
44b363
%patch0 -p1 -b .leave-fs-on
44b363
%patch1 -p1 -b .0001
44b363
%patch2 -p1 -b .0002
44b363
%patch3 -p1 -b .0003
44b363
%patch4 -p1 -b .0004
44b363
44b363
%build
44b363
%ifarch %{ix86}
44b363
%global vpxtarget x86-linux-gcc
44b363
%else
44b363
%ifarch	x86_64
44b363
%global	vpxtarget x86_64-linux-gcc
44b363
%else
44b363
%ifarch armv7hl
44b363
%global vpxtarget armv7-linux-gcc
44b363
%else
44b363
%ifarch aarch64
44b363
%global vpxtarget arm64-linux-gcc
44b363
%else
44b363
%global vpxtarget generic-gnu
44b363
%endif
44b363
%endif
44b363
%endif
44b363
%endif
44b363
44b363
# History: The configure script used to reject the shared flag on the generic target.
44b363
# This meant that we needed to fall back to manual shared lib creation.
44b363
# However, the modern configure script permits the shared flag and assumes ELF.
44b363
# Additionally, the libvpx.ver would need to be updated to work properly.
44b363
# As a result, we disable this universally, but keep it around in case we ever need to support
44b363
# something "special".
44b363
%if "%{vpxtarget}" == "generic-gnu"
44b363
%global generic_target 0
44b363
%else
44b363
%global	generic_target 0
44b363
%endif
44b363
44b363
%set_build_flags
44b363
44b363
%ifarch armv7hl
44b363
CROSS=armv7hl-redhat-linux-gnueabi- CHOST=armv7hl-redhat-linux-gnueabi-hardfloat ./configure \
44b363
%else
44b363
./configure --target=%{vpxtarget} \
44b363
%endif
44b363
%ifarch %{arm}
44b363
--disable-neon --disable-neon_asm \
44b363
%endif
44b363
--enable-pic --disable-install-srcs \
44b363
--enable-vp9-decoder --enable-vp9-encoder \
44b363
--enable-experimental --enable-spatial-svc \
44b363
--enable-vp9-highbitdepth --enable-webm-io \
44b363
%if ! %{generic_target}
44b363
--enable-shared \
44b363
%endif
44b363
--enable-install-srcs \
44b363
--prefix=%{_prefix} --libdir=%{_libdir} --size-limit=16384x16384
44b363
44b363
# Hack our optflags in.
44b363
sed -i "s|-O3|%{optflags}|g" libs-%{vpxtarget}.mk
44b363
sed -i "s|-O3|%{optflags}|g" examples-%{vpxtarget}.mk
44b363
sed -i "s|-O3|%{optflags}|g" docs-%{vpxtarget}.mk
44b363
44b363
%ifarch armv7hl
44b363
#hackety hack hack
44b363
sed -i "s|AR=armv7hl-redhat-linux-gnueabi-ar|AR=ar|g" libs-%{vpxtarget}.mk
44b363
sed -i "s|AR=armv7hl-redhat-linux-gnueabi-ar|AR=ar|g" examples-%{vpxtarget}.mk
44b363
sed -i "s|AR=armv7hl-redhat-linux-gnueabi-ar|AR=ar|g" docs-%{vpxtarget}.mk
44b363
44b363
sed -i "s|AS=armv7hl-redhat-linux-gnueabi-as|AS=as|g" libs-%{vpxtarget}.mk
44b363
sed -i "s|AS=armv7hl-redhat-linux-gnueabi-as|AS=as|g" examples-%{vpxtarget}.mk
44b363
sed -i "s|AS=armv7hl-redhat-linux-gnueabi-as|AS=as|g" docs-%{vpxtarget}.mk
44b363
44b363
sed -i "s|NM=armv7hl-redhat-linux-gnueabi-nm|NM=nm|g" libs-%{vpxtarget}.mk
44b363
sed -i "s|NM=armv7hl-redhat-linux-gnueabi-nm|NM=nm|g" examples-%{vpxtarget}.mk
44b363
sed -i "s|NM=armv7hl-redhat-linux-gnueabi-nm|NM=nm|g" docs-%{vpxtarget}.mk
44b363
%endif
44b363
44b363
make %{?_smp_mflags} verbose=true
44b363
44b363
# Manual shared library creation
44b363
# We should never need to do this anymore, and if we do, we need to fix the version-script.
44b363
%if %{generic_target}
44b363
mkdir tmp
44b363
cd tmp
44b363
ar x ../libvpx_g.a
44b363
cd ..
44b363
gcc -fPIC -shared -pthread -lm -Wl,--no-undefined -Wl,-soname,libvpx.so.%{somajor} -Wl,--version-script,%{SOURCE2} -Wl,-z,noexecstack -o libvpx.so.%{soversion} tmp/*.o
44b363
rm -rf tmp
44b363
%endif
44b363
44b363
# Temporarily dance the static libs out of the way
44b363
# mv libvpx.a libNOTvpx.a
44b363
# mv libvpx_g.a libNOTvpx_g.a
44b363
44b363
# We need to do this so the examples can link against it.
44b363
# ln -sf libvpx.so.%{soversion} libvpx.so
44b363
44b363
# make %{?_smp_mflags} verbose=true target=examples CONFIG_SHARED=1
44b363
# make %{?_smp_mflags} verbose=true target=docs
44b363
44b363
# Put them back so the install doesn't fail
44b363
# mv libNOTvpx.a libvpx.a
44b363
# mv libNOTvpx_g.a libvpx_g.a
44b363
44b363
%install
44b363
%ifarch armv7hl
44b363
export CROSS=armv7hl-redhat-linux-gnueabi-
44b363
export CHOST=armv7hl-redhat-linux-gnueabi-hardfloat
44b363
%endif
44b363
make DIST_DIR=%{buildroot}%{_prefix} dist
44b363
44b363
# Simpler to label the dir as %%doc.
44b363
if [ -d %{buildroot}/usr/docs ]; then
44b363
   mv %{buildroot}/usr/docs doc/
44b363
fi
44b363
44b363
# Again, we should never need to do this anymore.
44b363
%if %{generic_target}
44b363
install -p libvpx.so.%{soversion} %{buildroot}%{_libdir}
44b363
pushd %{buildroot}%{_libdir}
44b363
ln -sf libvpx.so.%{soversion} libvpx.so
44b363
ln -sf libvpx.so.%{soversion} libvpx.so.%{somajor}
44b363
ln -sf libvpx.so.%{soversion} libvpx.so.%{somajor}.%{sominor}
44b363
popd
44b363
%endif
44b363
44b363
pushd %{buildroot}
44b363
# Stuff we don't need.
44b363
rm -rf usr/build/ usr/md5sums.txt usr/lib*/*.a usr/CHANGELOG usr/README
44b363
# No, bad google. No treat.
44b363
mv usr/bin/examples/* usr/bin/
44b363
rm -rf usr/bin/examples
44b363
44b363
# Rename a few examples
44b363
mv usr/bin/postproc usr/bin/vp8_postproc
44b363
mv usr/bin/simple_decoder usr/bin/vp8_simple_decoder
44b363
mv usr/bin/simple_encoder usr/bin/vp8_simple_encoder
44b363
mv usr/bin/twopass_encoder usr/bin/vp8_twopass_encoder
44b363
# Fix the binary permissions
44b363
chmod 755 usr/bin/*
44b363
popd
44b363
44b363
# Get the vpx_config.h file
44b363
%ifarch %{arm}
44b363
cp -a vpx_config.h %{buildroot}%{_includedir}/vpx/vpx_config-arm.h
44b363
%else
44b363
# Does ppc64le need its own?
44b363
%ifarch ppc64 ppc64le
44b363
cp -a vpx_config.h %{buildroot}%{_includedir}/vpx/vpx_config-ppc64.h
44b363
%else
44b363
%ifarch s390 s390x
44b363
cp -a vpx_config.h %{buildroot}%{_includedir}/vpx/vpx_config-s390.h
44b363
%else
44b363
%ifarch %{ix86}
44b363
cp -a vpx_config.h %{buildroot}%{_includedir}/vpx/vpx_config-x86.h
44b363
%else
44b363
cp -a vpx_config.h %{buildroot}%{_includedir}/vpx/vpx_config-%{_arch}.h
44b363
%endif
44b363
%endif
44b363
%endif
44b363
%endif
44b363
cp %{SOURCE1} %{buildroot}%{_includedir}/vpx/vpx_config.h
44b363
# for timestamp sync
44b363
touch -r AUTHORS %{buildroot}%{_includedir}/vpx/vpx_config.h
44b363
44b363
mv %{buildroot}%{_prefix}/src/vpx_dsp %{buildroot}%{_includedir}/
44b363
mv %{buildroot}%{_prefix}/src/vpx_mem %{buildroot}%{_includedir}/
44b363
mv %{buildroot}%{_prefix}/src/vpx_ports %{buildroot}%{_includedir}/
44b363
mv %{buildroot}%{_prefix}/src/vpx_scale %{buildroot}%{_includedir}/
44b363
44b363
rm -rf %{buildroot}%{_prefix}/src
44b363
44b363
%ldconfig_scriptlets
44b363
44b363
%files
44b363
%license LICENSE
44b363
%doc AUTHORS CHANGELOG README
44b363
%{_libdir}/libvpx.so.*
44b363
44b363
%files devel
44b363
# These are SDK docs, not really useful to an end-user.
44b363
%doc docs/html/
44b363
%{_includedir}/vpx/
44b363
%{_includedir}/vpx_dsp/
44b363
%{_includedir}/vpx_mem/
44b363
%{_includedir}/vpx_ports/
44b363
%{_includedir}/vpx_scale/
44b363
%{_libdir}/pkgconfig/vpx.pc
44b363
%{_libdir}/libvpx.so
44b363
44b363
%files utils
44b363
%{_bindir}/*
44b363
44b363
%changelog
44b363
* Wed Apr 1 2020 Wim Taymans <wtaymans@redhat.com> - 1.7.0-8
44b363
- Resolves: rhbz#1796086, rhbz#1796100, rhbz#1796448, rhbz#1796454
44b363
- Enable webm-io explicitly
44b363
44b363
* Wed Mar 25 2020 Wim Taymans <wtaymans@redhat.com> - 1.7.0-7
44b363
- Fix for CVE-2019-9232, CVE-2019-9433, CVE-2019-9371, CVE-2019-2126
44b363
- Resolves: rhbz#1796086, rhbz#1796100, rhbz#1796448, rhbz#1796454
44b363
- Remove php-cli BR
44b363
44b363
* Tue Oct 09 2018 Wim Taymans <wtaymans@redhat.com> - 1.7.0-6
44b363
- Set build flags in all cases
44b363
- Resolves: #1630588
44b363
44b363
* Mon Feb 12 2018 Tom Callaway <spot@fedoraproject.org> - 1.7.0-5
44b363
- properly set build flags in rawhide (bz1543819)
44b363
44b363
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-4
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
44b363
44b363
* Sat Feb  3 2018 Tom Callaway <spot@fedoraproject.org> - 1.7.0-3
44b363
- package more files (for firefox)
44b363
- setup vpx_config.h for multilib
44b363
44b363
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.7.0-2
44b363
- Switch to %%ldconfig_scriptlets
44b363
44b363
* Fri Jan 26 2018 Tom Callaway <spot@fedoraproject.org> - 1.7.0-1
44b363
- update to 1.7.0 (ABI change)
44b363
44b363
* Wed Jan 17 2018 Wim Taymans <wtaymans@wredhat.com> - 1.6.1-5
44b363
- fix for CVE-2017-13194
44b363
44b363
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-4
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
44b363
44b363
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-3
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
44b363
44b363
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-2
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
44b363
44b363
* Mon Jan 16 2017 Tom Callaway <spot@fedoraproject.org> - 1.6.1-1
44b363
- update to 1.6.1
44b363
44b363
* Thu Jan 12 2017 Tom Callaway <spot@fedoraproject.org> - 1.6.0-2
44b363
- enable vp9-highbitdepth (thanks to mike@cchtml.com)
44b363
44b363
* Fri Jul 22 2016 Tom Callaway <spot@fedoraproject.org> - 1.6.0-1
44b363
- update to 1.6.0
44b363
44b363
* Wed Mar 16 2016 Tom Callaway <spot@fedoraproject.org> - 1.5.0-4
44b363
- disable generic_target conditional universally (bz1311125)
44b363
44b363
* Tue Mar  8 2016 Tom Callaway <spot@fedoraproject.org> - 1.5.0-3
44b363
- enable-experimental and enable-spatial-svc
44b363
44b363
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
44b363
44b363
* Tue Dec  1 2015 Tom Callaway <spot@fedoraproject.org> - 1.5.0-1
44b363
- update to 1.5.0
44b363
44b363
* Mon Sep 21 2015 Tom Callaway <spot@fedoraproject.org> - 1.4.0-6
44b363
- remove exit 0
44b363
44b363
* Tue Sep 15 2015 Tom Callaway <spot@fedoraproject.org> - 1.4.0-5
44b363
- set --size-limit=16384x16384 to avoid CVE-2015-1258
44b363
44b363
* Mon Jul 27 2015 Kalev Lember <klember@redhat.com> - 1.4.0-4
44b363
- Package review fixes (#1225648)
44b363
- Update URL
44b363
- Use license macro
44b363
- Escape a commented out macro
44b363
44b363
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-3
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
44b363
44b363
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.4.0-2
44b363
- Rebuilt for GCC 5 C++11 ABI change
44b363
44b363
* Mon Apr  6 2015 Tom Callaway <spot@fedoraproject.org> - 1.4.0-1
44b363
- update to 1.4.0
44b363
44b363
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-6
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
44b363
44b363
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-5
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
44b363
44b363
* Thu Mar 20 2014 Wim Taymans <wtaymans@redhat.com> - 1.3.0-4
44b363
- fix Illegal Instruction abort
44b363
44b363
* Thu Feb 13 2014 Dan Horák <dan[at]danny.cz> - 1.3.0-3
44b363
- update library symbol list for 1.3.0 from Debian
44b363
44b363
* Tue Feb 11 2014 Tom Callaway <spot@fedoraproject.org> - 1.3.0-2
44b363
- armv7hl specific target
44b363
44b363
* Tue Feb 11 2014 Tom Callaway <spot@fedoraproject.org> - 1.3.0-1
44b363
- update to 1.3.0
44b363
44b363
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-2
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
44b363
44b363
* Thu Feb 28 2013 Tom Callaway <spot@fedoraproject.org> - 1.2.0-1
44b363
- update to 1.2.0
44b363
44b363
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-3
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
44b363
44b363
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
44b363
44b363
* Tue May 29 2012 Tom Callaway <spot@fedoraproject.org> - 1.1.0-1
44b363
- update to 1.1.0
44b363
44b363
* Tue May 29 2012 Tom Callaway <spot@fedoraproject.org> - 1.0.0-3
44b363
- fix vpx.pc file to include -lm (bz825754)
44b363
44b363
* Fri May 11 2012 Tom Callaway <spot@fedoraproject.org> - 1.0.0-2
44b363
- use included vpx.pc file (drop local libvpx.pc)
44b363
- apply upstream fix to vpx.pc file (bz 814177)
44b363
44b363
* Mon Jan 30 2012 Tom Callaway <spot@fedoraproject.org> - 1.0.0-1
44b363
- update to 1.0.0
44b363
44b363
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7.1-4
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
44b363
44b363
* Mon Oct 10 2011 Dan Horák <dan[at]danny.cz> - 0.9.7.1-3
44b363
- use macro instead of hard-coded version
44b363
44b363
* Mon Sep 12 2011 Dan Horák <dan[at]danny.cz> - 0.9.7.1-2
44b363
- fix build on generic targets
44b363
44b363
* Tue Aug 16 2011 Adam Jackson <ajax@redhat.com> 0.9.7.1-1
44b363
- libvpx 0.9.7-p1
44b363
44b363
* Tue Aug 09 2011 Adam Jackson <ajax@redhat.com> 0.9.7-1
44b363
- libvpx 0.9.7
44b363
44b363
* Mon Mar 21 2011 Dan Horák <dan[at]danny.cz> - 0.9.6-2
44b363
- add 2 symbols to the shared library for generic targets
44b363
44b363
* Thu Mar 10 2011 Tom Callaway <spot@fedoraproject.org> - 0.9.6-1
44b363
- update to 0.9.6
44b363
44b363
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-3
44b363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
44b363
44b363
* Wed Nov 17 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.5-2
44b363
- apply patch from upstream git (Change I6266aba7), should resolve CVE-2010-4203
44b363
44b363
* Mon Nov  1 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.5-1
44b363
- update to 0.9.5
44b363
44b363
* Wed Sep  1 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.1-3
44b363
- only package html docs to avoid multilib conflict (bz 613185)
44b363
44b363
* Thu Jun 24 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.1-2
44b363
- build shared library the old way for generic arches
44b363
44b363
* Thu Jun 24 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.1-1
44b363
- update to 0.9.1
44b363
44b363
* Fri Jun 11 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-7
44b363
- update to git revision 8389f1967c5f8b3819cca80705b1b4ba04132b93
44b363
- upstream fix for bz 599147
44b363
- proper shared library support
44b363
44b363
* Wed Jun  2 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-6
44b363
- add hackish fix for bz 599147 
44b363
  (upstream will hopefully fix properly in future release)
44b363
44b363
* Fri May 21 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-5
44b363
- fix noexecstack flag
44b363
44b363
* Thu May 20 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-4
44b363
- BuildRequires: yasm (we're optimized again)
44b363
44b363
* Thu May 20 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-3
44b363
- add pkg-config file
44b363
- move headers into include/vpx/
44b363
- enable optimization
44b363
44b363
* Thu May 20 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-2
44b363
- fix permissions on binaries
44b363
- rename generic binaries to v8_*
44b363
- link shared library to -lm, -lpthread to resolve missing weak symbols
44b363
44b363
* Wed May 19 2010 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.0-1
44b363
- Initial package for Fedora