From 4cefd35e9beabf52dedc8e74dd5d632eff990c8e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 30 Nov 2015 18:43:56 +0100 Subject: [PATCH] Initial import https://bugzilla.redhat.com/show_bug.cgi?id=1285338 --- .gitignore | 2 + openh264.spec | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 2 + 3 files changed, 122 insertions(+) create mode 100644 openh264.spec diff --git a/.gitignore b/.gitignore index e69de29..55f767f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/gmp-api-c5f1d0f.tar.gz +/openh264-21e44bd.tar.gz diff --git a/openh264.spec b/openh264.spec new file mode 100644 index 0000000..cc83eea --- /dev/null +++ b/openh264.spec @@ -0,0 +1,118 @@ +# v1.5.2-Firefox39 branch +%global commit0 21e44bda8b45ac85f6ba78e85b3bd37a1beb2a04 +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) + +# To get the gmp-api commit to use, run: +# rm -rf gmp-api;make gmp-bootstrap;cd gmp-api;git rev-parse HEAD +%global commit1 c5f1d0f3213178818cbfb3e16f31d07328980560 +%global shortcommit1 %(c=%{commit1}; echo ${c:0:7}) + +Name: openh264 +Version: 1.5.2 +Release: 0.2.git%{shortcommit0}%{?dist} +Summary: H.264 codec library + +License: BSD +URL: http://www.openh264.org/ +Source0: https://github.com/cisco/openh264/archive/%{commit0}/openh264-%{shortcommit0}.tar.gz +Source1: https://github.com/mozilla/gmp-api/archive/%{commit1}/gmp-api-%{shortcommit1}.tar.gz + +BuildRequires: nasm + +%description +OpenH264 is a codec library which supports H.264 encoding and decoding. It is +suitable for use in real time applications such as WebRTC. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package -n mozilla-openh264 +Summary: H.264 codec support for Mozilla browsers +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: mozilla-filesystem%{?_isa} + +%description -n mozilla-openh264 +The mozilla-openh264 package contains a H.264 codec plugin for Mozilla +browsers. + + +%prep +%setup -qn openh264-%{commit0} + +# Extract gmp-api archive +tar -xf %{S:1} +mv gmp-api-%{commit1} gmp-api + +# Update the makefile with our build options +sed -i -e 's|^CFLAGS_OPT=.*$|CFLAGS_OPT=%{optflags}|' Makefile +sed -i -e 's|^PREFIX=.*$|PREFIX=%{_prefix}|' Makefile +sed -i -e 's|^LIBDIR_NAME=.*$|LIBDIR_NAME=%{_lib}|' Makefile +sed -i -e 's|^SHAREDLIB_DIR=.*$|SHAREDLIB_DIR=%{_libdir}|' Makefile +sed -i -e '/^CFLAGS_OPT=/i LDFLAGS=%{__global_ldflags}' Makefile + + +%build +make %{?_smp_mflags} +make plugin %{?_smp_mflags} + + +%install +%make_install + +# Install mozilla plugin +mkdir -p $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed +cp -a libgmpopenh264.so* gmpopenh264.info $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed/ + +mkdir -p $RPM_BUILD_ROOT%{_libdir}/firefox/defaults/pref +cat > $RPM_BUILD_ROOT%{_libdir}/firefox/defaults/pref/gmpopenh264.js << EOF +pref("media.gmp-gmpopenh264.autoupdate", false); +pref("media.gmp-gmpopenh264.version", "system-installed"); +EOF + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d +cat > $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/gmpopenh264.sh << EOF +MOZ_GMP_PATH="%{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed" +export MOZ_GMP_PATH +EOF + +# Remove static libraries +rm $RPM_BUILD_ROOT%{_libdir}/*.a + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + +%files +%license LICENSE +%doc README.md +%{_libdir}/libopenh264.so.1 + +%files devel +%{_includedir}/wels/ +%{_libdir}/libopenh264.so +%{_libdir}/pkgconfig/openh264.pc + +%files -n mozilla-openh264 +%{_sysconfdir}/profile.d/gmpopenh264.sh +%dir %{_libdir}/firefox +%dir %{_libdir}/firefox/defaults +%dir %{_libdir}/firefox/defaults/pref +%{_libdir}/firefox/defaults/pref/gmpopenh264.js +%{_libdir}/mozilla/plugins/gmp-gmpopenh264/ + + +%changelog +* Thu Nov 26 2015 Kalev Lember - 1.5.2-0.2.git21e44bd +- Pass Fedora LDFLAGS to the build to get full relro (#1285338) + +* Tue Nov 24 2015 Kalev Lember - 1.5.2-0.1.git21e44bd +- Initial Fedora packaging diff --git a/sources b/sources index e69de29..1c53465 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +961eb0256e27a12dd0a19421b56f3309 gmp-api-c5f1d0f.tar.gz +0821a30af77607e17bdf956faf5c64f2 openh264-21e44bd.tar.gz