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