]> git.pld-linux.org Git - packages/openh264.git/blobdiff - openh264.spec
- added firefox33 patch, build GMP plugin
[packages/openh264.git] / openh264.spec
index 5325a7823311ac7b0bc0890f13b9b5e1eb84228d..2d71278d3a5133ec2858b58947e3fcf9c51500df 100644 (file)
@@ -1,4 +1,8 @@
-# TODO: GMP plugin
+# TODO: handle GMP plugins better in browser-plugins architecture (only firefox33+ based browsers supported)
+#
+# Conditional build:
+%bcond_without xulrunner       # GMP plugin
+#
 Summary:       H.264 codec library
 Summary(pl.UTF-8):     Biblioteka kodeka H.264
 Name:          openh264
@@ -8,10 +12,15 @@ License:     BSD
 Group:         Libraries
 Source0:       https://github.com/cisco/openh264/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: 2dccd64e0359acbaec54f442792bba67
+Patch0:                %{name}-firefox33.patch
 URL:           http://www.openh264.org/
 BuildRequires: libstdc++-devel
+BuildRequires: rpmbuild(macros) >= 1.357
+%{?with_xulrunner:BuildRequires:       xulrunner-devel >= 2:33}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                gmp_plugindir   %{_browserpluginsdir}
+
 %description
 OpenH264 is a codec library which supports H.264 encoding and
 decoding. It is suitable for use in real time applications such as
@@ -47,11 +56,31 @@ Static OpenH264 library.
 %description static -l pl.UTF-8
 Statyczna biblioteka OpenH264.
 
+%package -n browser-gmp-openh264
+Summary:       OpenH264 plugin for Gecko based browsers
+Summary(pl.UTF-8):     Wtyczka OpenH264 dla przeglÄ…darek opartych na Gecko
+License:       BSD and MPL v2.0
+Group:         Libraries
+Requires:      browser-plugins >= 2.0
+
+%description -n browser-gmp-openh264
+OpenH264 Gecko Media Plugin for modern Gecko based browsers (like
+Firefox/Iceweasel 33+).
+
+%description -n browser-gmp-openh264 -l pl.UTF-8
+Wtyczka GMP (Gecko Media Plugin) OpenH264 dla nowych przeglÄ…darek
+opartych na Gecko (takich jak Firefox/Iceweasel 33+).
+
 %prep
 %setup -q
+%patch0 -p1
+
+%if %{with xulrunner}
+ln -s /usr/include/xulrunner gmp-api
+%endif
 
 %build
-%{__make} \
+%{__make} libraries binaries %{?with_xulrunner:plugin} \
        CXX="%{__cxx}" \
        CFLAGS_OPT="%{rpmcxxflags}"
 
@@ -65,12 +94,27 @@ install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}}
 install libopenh264.so libopenh264.a $RPM_BUILD_ROOT%{_libdir}
 install h264dec h264enc $RPM_BUILD_ROOT%{_bindir}
 
+%if %{with xulrunner}
+# see https://wiki.mozilla.org/GeckoMediaPlugins
+install -d $RPM_BUILD_ROOT%{gmp_plugindir}/gmp-openh264
+install libgmpopenh264.so $RPM_BUILD_ROOT%{gmp_plugindir}/gmp-openh264
+cp -p gmpopenh264.info $RPM_BUILD_ROOT%{gmp_plugindir}/gmp-openh264
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post  -p /sbin/ldconfig
 %postun        -p /sbin/ldconfig
 
+%post -n browser-gmp-openh264
+%update_browser_plugins
+
+%postun -n browser-gmp-openh264
+if [ "$1" = 0 ]; then
+       %update_browser_plugins
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc CONTRIBUTORS LICENSE README.md RELEASES
@@ -85,3 +129,11 @@ rm -rf $RPM_BUILD_ROOT
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libopenh264.a
+
+%if %{with xulrunner}
+%files -n browser-gmp-openh264
+%defattr(644,root,root,755)
+%dir %{gmp_plugindir}/gmp-openh264
+%attr(755,root,root) %{gmp_plugindir}/gmp-openh264/libgmpopenh264.so
+%{gmp_plugindir}/gmp-openh264/gmpopenh264.info
+%endif
This page took 0.101243 seconds and 4 git commands to generate.