]>
Commit | Line | Data |
---|---|---|
af7d046d JB |
1 | # TODO: handle GMP plugins better in browser-plugins architecture (only firefox33+ based browsers supported) |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without xulrunner # GMP plugin | |
5 | # | |
9d5b9eed JB |
6 | Summary: H.264 codec library |
7 | Summary(pl.UTF-8): Biblioteka kodeka H.264 | |
8 | Name: openh264 | |
9 | Version: 1.1 | |
10 | Release: 1 | |
11 | License: BSD | |
12 | Group: Libraries | |
13 | Source0: https://github.com/cisco/openh264/archive/v%{version}/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: 2dccd64e0359acbaec54f442792bba67 | |
af7d046d | 15 | Patch0: %{name}-firefox33.patch |
9d5b9eed JB |
16 | URL: http://www.openh264.org/ |
17 | BuildRequires: libstdc++-devel | |
af7d046d JB |
18 | BuildRequires: rpmbuild(macros) >= 1.357 |
19 | %{?with_xulrunner:BuildRequires: xulrunner-devel >= 2:33} | |
9d5b9eed JB |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
21 | ||
af7d046d JB |
22 | %define gmp_plugindir %{_browserpluginsdir} |
23 | ||
9d5b9eed JB |
24 | %description |
25 | OpenH264 is a codec library which supports H.264 encoding and | |
26 | decoding. It is suitable for use in real time applications such as | |
27 | WebRTC. | |
28 | ||
29 | %description -l pl.UTF-8 | |
30 | OpenH264 to biblioteka kodeka obsługująca kodowanie i dekodowanie | |
31 | H.264. Nadaje się do użycia w aplikacjach czasu rzeczywistego, takich | |
32 | jak WebRTC. | |
33 | ||
34 | %package devel | |
35 | Summary: Header files for OpenH264 library | |
36 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenH264 | |
37 | Group: Development/Libraries | |
38 | Requires: %{name} = %{version}-%{release} | |
09372493 | 39 | Requires: libstdc++-devel |
9d5b9eed JB |
40 | |
41 | %description devel | |
42 | Header files for OpenH264 library. | |
43 | ||
44 | %description devel -l pl.UTF-8 | |
45 | Pliki nagłówkowe biblioteki OpenH264. | |
46 | ||
47 | %package static | |
48 | Summary: Static OpenH264 library | |
49 | Summary(pl.UTF-8): Statyczna biblioteka OpenH264 | |
50 | Group: Development/Libraries | |
51 | Requires: %{name}-devel = %{version}-%{release} | |
52 | ||
53 | %description static | |
54 | Static OpenH264 library. | |
55 | ||
56 | %description static -l pl.UTF-8 | |
57 | Statyczna biblioteka OpenH264. | |
58 | ||
af7d046d JB |
59 | %package -n browser-gmp-openh264 |
60 | Summary: OpenH264 plugin for Gecko based browsers | |
61 | Summary(pl.UTF-8): Wtyczka OpenH264 dla przeglądarek opartych na Gecko | |
62 | License: BSD and MPL v2.0 | |
63 | Group: Libraries | |
64 | Requires: browser-plugins >= 2.0 | |
65 | ||
66 | %description -n browser-gmp-openh264 | |
67 | OpenH264 Gecko Media Plugin for modern Gecko based browsers (like | |
68 | Firefox/Iceweasel 33+). | |
69 | ||
70 | %description -n browser-gmp-openh264 -l pl.UTF-8 | |
71 | Wtyczka GMP (Gecko Media Plugin) OpenH264 dla nowych przeglądarek | |
72 | opartych na Gecko (takich jak Firefox/Iceweasel 33+). | |
73 | ||
9d5b9eed JB |
74 | %prep |
75 | %setup -q | |
af7d046d JB |
76 | %patch0 -p1 |
77 | ||
78 | %if %{with xulrunner} | |
79 | ln -s /usr/include/xulrunner gmp-api | |
80 | %endif | |
9d5b9eed JB |
81 | |
82 | %build | |
af7d046d | 83 | %{__make} libraries binaries %{?with_xulrunner:plugin} \ |
9d5b9eed JB |
84 | CXX="%{__cxx}" \ |
85 | CFLAGS_OPT="%{rpmcxxflags}" | |
86 | ||
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}} | |
90 | ||
91 | %{__make} install-headers \ | |
92 | PREFIX=$RPM_BUILD_ROOT%{_prefix} | |
93 | ||
94 | install libopenh264.so libopenh264.a $RPM_BUILD_ROOT%{_libdir} | |
95 | install h264dec h264enc $RPM_BUILD_ROOT%{_bindir} | |
96 | ||
af7d046d JB |
97 | %if %{with xulrunner} |
98 | # see https://wiki.mozilla.org/GeckoMediaPlugins | |
99 | install -d $RPM_BUILD_ROOT%{gmp_plugindir}/gmp-openh264 | |
100 | install libgmpopenh264.so $RPM_BUILD_ROOT%{gmp_plugindir}/gmp-openh264 | |
101 | cp -p gmpopenh264.info $RPM_BUILD_ROOT%{gmp_plugindir}/gmp-openh264 | |
102 | %endif | |
103 | ||
9d5b9eed JB |
104 | %clean |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %post -p /sbin/ldconfig | |
108 | %postun -p /sbin/ldconfig | |
109 | ||
af7d046d JB |
110 | %post -n browser-gmp-openh264 |
111 | %update_browser_plugins | |
112 | ||
113 | %postun -n browser-gmp-openh264 | |
114 | if [ "$1" = 0 ]; then | |
115 | %update_browser_plugins | |
116 | fi | |
117 | ||
9d5b9eed JB |
118 | %files |
119 | %defattr(644,root,root,755) | |
120 | %doc CONTRIBUTORS LICENSE README.md RELEASES | |
121 | %attr(755,root,root) %{_bindir}/h264dec | |
122 | %attr(755,root,root) %{_bindir}/h264enc | |
123 | %attr(755,root,root) %{_libdir}/libopenh264.so | |
124 | ||
125 | %files devel | |
126 | %defattr(644,root,root,755) | |
127 | %{_includedir}/wels | |
128 | ||
129 | %files static | |
130 | %defattr(644,root,root,755) | |
131 | %{_libdir}/libopenh264.a | |
af7d046d JB |
132 | |
133 | %if %{with xulrunner} | |
134 | %files -n browser-gmp-openh264 | |
135 | %defattr(644,root,root,755) | |
136 | %dir %{gmp_plugindir}/gmp-openh264 | |
137 | %attr(755,root,root) %{gmp_plugindir}/gmp-openh264/libgmpopenh264.so | |
138 | %{gmp_plugindir}/gmp-openh264/gmpopenh264.info | |
139 | %endif |