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