]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - libnut enabled no (http://www.nut-container.org/) | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_with nonfree # non free options of package | |
6 | %bcond_without autoreqdep # don't care about package name deps generated by rpm | |
7 | %bcond_without imlib2 # don't build imlib2 vhook module | |
8 | %bcond_without va # VAAPI (Video Acceleration API) | |
9 | %bcond_without vpx # VP8, a high-quality video codec | |
10 | %bcond_without doc # don't build docs | |
11 | ||
12 | Summary: FFmpeg is a very fast video and audio converter | |
13 | Summary(pl.UTF-8): Koder audio/wideo czasu rzeczywistego oraz serwer strumieni | |
14 | Name: ffmpeg | |
15 | Version: 0.6.1 | |
16 | Release: 1 | |
17 | # LGPL or GPL, chosen at configure time (GPL version is more featured) | |
18 | # (postprocessing, ac3, xvid, x264, faad) | |
19 | License: GPL v3+ with LGPL v3+ parts | |
20 | Group: Applications/Multimedia | |
21 | Source0: http://ffmpeg.mplayerhq.hu/releases/%{name}-%{version}.tar.bz2 | |
22 | # Source0-md5: 4f5d732d25eedfb072251b5314ba2093 | |
23 | Source1: ffserver.init | |
24 | Source2: ffserver.sysconfig | |
25 | Source3: ffserver.conf | |
26 | Patch0: %{name}-bug-803.patch | |
27 | Patch1: %{name}-gsm.patch | |
28 | Patch2: faadbin-libfaadname.patch | |
29 | # vhook is gone. this patch needs different approach | |
30 | #PatchX: imagewidth.patch | |
31 | # http://webm.googlecode.com/files/ffmpeg-0.6_libvpx-0.9.1.diff.gz | |
32 | Patch3: ffmpeg-0.6_libvpx-0.9.1.diff | |
33 | URL: http://www.ffmpeg.org/ | |
34 | BuildRequires: SDL-devel | |
35 | BuildRequires: dirac-devel >= 1.0.0 | |
36 | BuildRequires: faac-devel | |
37 | BuildRequires: faad2-devel | |
38 | BuildRequires: freetype-devel | |
39 | %ifarch ppc | |
40 | # require version with altivec support fixed | |
41 | BuildRequires: gcc >= 5:3.3.2-3 | |
42 | %endif | |
43 | %{?with_imlib2:BuildRequires: imlib2-devel >= 1.3.0} | |
44 | BuildRequires: lame-libs-devel | |
45 | BuildRequires: libdc1394-devel | |
46 | BuildRequires: libgsm-devel | |
47 | BuildRequires: libraw1394-devel | |
48 | BuildRequires: libtheora-devel >= 1.0-0.beta3 | |
49 | BuildRequires: libtool >= 2:1.4d-3 | |
50 | %{?with_va:BuildRequires: libva-devel >= 1.0.3} | |
51 | BuildRequires: libvdpau-devel | |
52 | BuildRequires: libvorbis-devel | |
53 | %{?with_vpx:BuildRequires: libvpx-devel >= 0.9.1} | |
54 | # X264_BUILD >= 83 | |
55 | BuildRequires: libx264-devel >= 0.1.3-1.20100424_2245.1 | |
56 | BuildRequires: opencore-amr-devel | |
57 | BuildRequires: openjpeg-devel >= 1.3-2 | |
58 | BuildRequires: speex-devel >= 1:1.2-rc1 | |
59 | %ifarch %{ix86} | |
60 | %ifnarch i386 i486 | |
61 | BuildRequires: nasm | |
62 | %endif | |
63 | %endif | |
64 | BuildRequires: perl-Encode | |
65 | BuildRequires: perl-tools-pod | |
66 | BuildRequires: pkgconfig | |
67 | BuildRequires: rpmbuild(macros) >= 1.470 | |
68 | BuildRequires: schroedinger-devel | |
69 | %{?with_doc:BuildRequires: tetex} | |
70 | %{?with_doc:BuildRequires: texi2html} | |
71 | %{?with_doc:BuildRequires: texinfo} | |
72 | BuildRequires: xvid-devel >= 1:1.1.0 | |
73 | BuildRequires: zlib-devel | |
74 | %{?with_autoreqdep:BuildConflicts: libpostproc} | |
75 | Requires: %{name}-libs = %{version}-%{release} | |
76 | Requires: xvid >= 1:1.1.0 | |
77 | Obsoletes: libpostproc | |
78 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
79 | ||
80 | %define _noautoreqdep libGL.so.1 libGLU.so.1 | |
81 | ||
82 | %define specflags -fno-strict-aliasing | |
83 | ||
84 | # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one) | |
85 | %define specflags_ia32 -fomit-frame-pointer | |
86 | # -mmmx is needed to enable <mmintrin.h> code. | |
87 | %define specflags_i586 -mmmx | |
88 | %define specflags_i686 -mmmx | |
89 | %define specflags_ppc -fPIC | |
90 | ||
91 | %description | |
92 | FFmpeg is a complete solution to record, convert and stream audio and | |
93 | video. It is a command line tool to convert one video file format to | |
94 | another. It also supports grabbing and encoding in real time from a TV | |
95 | card. | |
96 | ||
97 | %description -l pl.UTF-8 | |
98 | ffmpeg jest bardzo szybkim koderem audio/wideo w czasie rzeczywistym | |
99 | oraz serwerem strumieni multimedialnych. ffmpeg potrafi zrzucać dane | |
100 | ze standardowego urządzenia Video4Linux i przekonwertować je w kilka | |
101 | formatów plików bazujących na kodowaniu DCT/kompensacji ruchu. Dźwięk | |
102 | jest kompresowany do strumienia MPEG audio layer 2 lub używając | |
103 | strumienia kompatybilnego z AC3. | |
104 | ||
105 | %package libs | |
106 | Summary: ffmpeg libraries | |
107 | Summary(pl.UTF-8): Biblioteki ffmpeg | |
108 | Group: Libraries | |
109 | Suggests: faad2-libs | |
110 | ||
111 | %description libs | |
112 | This package contains: | |
113 | - the codec library from the ffmpeg project. It supports most existing | |
114 | encoding formats (MPEG, DivX, MPEG4, AC3, DV...), | |
115 | - demuxer library from the ffmpeg project. It supports most existing | |
116 | file formats (AVI, MPEG, OGG, Matroska, ASF...), | |
117 | - video postprocessing library from the ffmpeg project. | |
118 | ||
119 | %description libs -l pl.UTF-8 | |
120 | Ten pakiet zawiera biblioteki współdzielone ffmpeg. | |
121 | ||
122 | %package devel | |
123 | Summary: ffmpeg header files | |
124 | Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg | |
125 | Group: Development/Libraries | |
126 | Requires: %{name}-libs = %{version}-%{release} | |
127 | # for libavcodec: | |
128 | Requires: dirac-devel | |
129 | Requires: faac-devel | |
130 | Requires: faad2-devel | |
131 | Requires: lame-libs-devel | |
132 | Requires: libgsm-devel | |
133 | Requires: libraw1394-devel | |
134 | Requires: libtheora-devel >= 1.0-0.alpha7 | |
135 | Requires: libvorbis-devel | |
136 | Requires: libx264-devel >= 0.1.2-1.20060828_2245.1 | |
137 | Requires: xvid-devel >= 1:1.1.0 | |
138 | Requires: zlib-devel | |
139 | Obsoletes: libpostproc-devel | |
140 | ||
141 | %description devel | |
142 | ffmpeg header files. | |
143 | ||
144 | %description devel -l pl.UTF-8 | |
145 | Pliki nagłówkowe ffmpeg. | |
146 | ||
147 | %package static | |
148 | Summary: ffmpeg static libraries | |
149 | Summary(pl.UTF-8): Statyczne biblioteki ffmpeg | |
150 | Group: Development/Libraries | |
151 | Requires: %{name}-devel = %{version}-%{release} | |
152 | ||
153 | %description static | |
154 | ffmpeg static libraries (libavcodec and libavformat). | |
155 | ||
156 | %description static -l pl.UTF-8 | |
157 | Statyczne biblioteki ffmpeg (libavcodec i libavformat). | |
158 | ||
159 | %package ffplay | |
160 | Summary: FFplay - SDL-based media player | |
161 | Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL | |
162 | Group: Applications/Multimedia | |
163 | Requires: %{name}-libs = %{version}-%{release} | |
164 | ||
165 | %description ffplay | |
166 | FFplay is a very simple and portable media player using the FFmpeg | |
167 | libraries and the SDL library. It is mostly used as a test bench for | |
168 | the various APIs of FFmpeg. | |
169 | ||
170 | %description ffplay -l pl.UTF-8 | |
171 | FFplay to bardzo prosty i przenośny odtwarzacz mediów używający | |
172 | bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do | |
173 | testowania różnych API FFmpeg. | |
174 | ||
175 | %package ffserver | |
176 | Summary: FFserver video server | |
177 | Summary(pl.UTF-8): FFserver - serwer strumieni obrazu | |
178 | Group: Daemons | |
179 | Requires(post,preun): /sbin/chkconfig | |
180 | Requires: %{name}-libs = %{version}-%{release} | |
181 | Requires: rc-scripts >= 0.4.0.10 | |
182 | ||
183 | %description ffserver | |
184 | FFserver is a streaming server for both audio and video. It supports | |
185 | several live feeds, streaming from files and time shifting on live | |
186 | feeds (you can seek to positions in the past on each live feed, | |
187 | provided you specify a big enough feed storage in ffserver.conf). | |
188 | ||
189 | %description ffserver -l pl.UTF-8 | |
190 | FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka | |
191 | źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w | |
192 | czasie dla źródeł na żywo (można przeskakiwać na położenia w | |
193 | przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio | |
194 | dużej przestrzeni na dane skonfigurowanej w ffserver.conf). | |
195 | ||
196 | %prep | |
197 | %setup -q | |
198 | %patch0 -p1 | |
199 | %patch1 -p0 | |
200 | %patch2 -p1 | |
201 | %patch3 -p0 | |
202 | ||
203 | # package the grep result for mplayer, the result formatted as ./mplayer/configure | |
204 | cat <<EOF > ffmpeg-avconfig | |
205 | #! /bin/sh | |
206 | _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`" | |
207 | _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`" | |
208 | _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`" | |
209 | _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`" | |
210 | _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`" | |
211 | _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`" | |
212 | _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`" | |
213 | EOF | |
214 | cat <<'EOF' >> ffmpeg-avconfig | |
215 | ||
216 | case "$1" in | |
217 | --decoders) | |
218 | echo $_libavdecoders_all | |
219 | ;; | |
220 | --encoders) | |
221 | echo $_libavencoders_all | |
222 | ;; | |
223 | --parsers) | |
224 | echo $_libavparsers_all | |
225 | ;; | |
226 | --bsfs) | |
227 | echo $_libavbsfs_all | |
228 | ;; | |
229 | --demuxers) | |
230 | echo $_libavdemuxers_all | |
231 | ;; | |
232 | --muxers) | |
233 | echo $_libavmuxers_all | |
234 | ;; | |
235 | --protocols) | |
236 | echo $_libavprotocols_all | |
237 | ;; | |
238 | *) | |
239 | cat <<USAGE | |
240 | Usage: $0 [OPTION] | |
241 | Options: | |
242 | --decoders | |
243 | --encoders | |
244 | --parsers | |
245 | --bsfs | |
246 | --demuxers | |
247 | --muxers | |
248 | --protocols | |
249 | USAGE | |
250 | exit 1;; | |
251 | esac | |
252 | ||
253 | exit 0 | |
254 | EOF | |
255 | ||
256 | %build | |
257 | # notes: | |
258 | # - it's not autoconf configure | |
259 | # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags | |
260 | ./configure \ | |
261 | --arch=%{_target_base_arch} \ | |
262 | --prefix=%{_prefix} \ | |
263 | --libdir=%{_libdir} \ | |
264 | --shlibdir=%{_libdir} \ | |
265 | --mandir=%{_mandir} \ | |
266 | --cc="%{__cc}" \ | |
267 | --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \ | |
268 | --extra-ldflags="%{rpmcflags} %{rpmldflags}" \ | |
269 | --disable-debug \ | |
270 | --disable-optimizations \ | |
271 | --disable-stripping \ | |
272 | --enable-avfilter \ | |
273 | --enable-gpl \ | |
274 | --enable-version3 \ | |
275 | --enable-libdc1394 \ | |
276 | --enable-libdirac \ | |
277 | --enable-libfaad \ | |
278 | --enable-libfaadbin \ | |
279 | --enable-libgsm \ | |
280 | --enable-libmp3lame \ | |
281 | --enable-libschroedinger \ | |
282 | --enable-libspeex \ | |
283 | --enable-libtheora \ | |
284 | --enable-libvorbis \ | |
285 | %{?with_vpx:--enable-libvpx} \ | |
286 | --enable-libx264 \ | |
287 | --enable-libxvid \ | |
288 | --enable-libopencore-amrnb \ | |
289 | --enable-libopencore-amrwb \ | |
290 | --enable-libopenjpeg \ | |
291 | --enable-postproc \ | |
292 | --enable-pthreads \ | |
293 | --enable-shared \ | |
294 | --enable-swscale \ | |
295 | --enable-vdpau \ | |
296 | --enable-x11grab \ | |
297 | %ifnarch %{ix86} %{x8664} | |
298 | --disable-mmx \ | |
299 | %endif | |
300 | %ifarch i386 i486 | |
301 | --disable-mmx \ | |
302 | %endif | |
303 | %if %{with nonfree} | |
304 | --enable-nonfree \ | |
305 | --enable-libfaac \ | |
306 | %endif | |
307 | --enable-runtime-cpudetect | |
308 | ||
309 | # force oldscaler build | |
310 | sed -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h | |
311 | ||
312 | %{__make} | |
313 | ||
314 | %install | |
315 | rm -rf $RPM_BUILD_ROOT | |
316 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \ | |
317 | $RPM_BUILD_ROOT%{_includedir}/ffmpeg \ | |
318 | $RPM_BUILD_ROOT/var/{cache,log}/ffserver | |
319 | ||
320 | %{__make} install \ | |
321 | DESTDIR=$RPM_BUILD_ROOT | |
322 | ||
323 | cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg | |
324 | cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil | |
325 | cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil | |
326 | cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil | |
327 | cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil | |
328 | for a in libavutil/*/bswap.h; do | |
329 | install -D $a $RPM_BUILD_ROOT%{_includedir}/$a | |
330 | done | |
331 | cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat | |
332 | cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat | |
333 | ||
334 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver | |
335 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver | |
336 | install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf | |
337 | mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver | |
338 | ||
339 | # install as ffmpeg-avconfig to avoid with possible programs looking for | |
340 | # ffmpeg-config and expecting --libs output from it which is not implemented | |
341 | # simple to do (by querying pkgconfig), but why? | |
342 | install ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig | |
343 | ||
344 | %clean | |
345 | rm -rf $RPM_BUILD_ROOT | |
346 | ||
347 | %post libs -p /sbin/ldconfig | |
348 | %postun libs -p /sbin/ldconfig | |
349 | ||
350 | %pre ffserver | |
351 | %groupadd -g 167 ffserver | |
352 | %useradd -g ffserver -u 167 ffserver | |
353 | ||
354 | %post ffserver | |
355 | /sbin/chkconfig --add ffserver | |
356 | %service ffserver restart | |
357 | ||
358 | %preun ffserver | |
359 | if [ "$1" = 0 ]; then | |
360 | %service ffserver stop | |
361 | /sbin/chkconfig --del ffserver | |
362 | fi | |
363 | ||
364 | %postun ffserver | |
365 | if [ "$1" = 0 ]; then | |
366 | %userremove ffserver | |
367 | %groupremove ffserver | |
368 | fi | |
369 | ||
370 | %files | |
371 | %defattr(644,root,root,755) | |
372 | %doc Changelog README %{?with_doc:doc/*.html} doc/TODO | |
373 | %attr(755,root,root) %{_bindir}/ffmpeg | |
374 | %attr(755,root,root) %{_bindir}/ffprobe | |
375 | %dir %{_datadir}/ffmpeg | |
376 | %{_datadir}/ffmpeg/*.ffpreset | |
377 | %{?with_doc:%{_mandir}/man1/ffmpeg.1*} | |
378 | %{?with_doc:%{_mandir}/man1/ffprobe.1*} | |
379 | ||
380 | %files libs | |
381 | %defattr(644,root,root,755) | |
382 | %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.* | |
383 | %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.52 | |
384 | %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.* | |
385 | %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.52 | |
386 | %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.* | |
387 | %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.1 | |
388 | %attr(755,root,root) %{_libdir}/libavformat.so.*.*.* | |
389 | %attr(755,root,root) %ghost %{_libdir}/libavformat.so.52 | |
390 | %attr(755,root,root) %{_libdir}/libavutil.so.*.*.* | |
391 | %attr(755,root,root) %ghost %{_libdir}/libavutil.so.50 | |
392 | %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.* | |
393 | %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.51 | |
394 | %attr(755,root,root) %{_libdir}/libswscale.so.*.*.* | |
395 | %attr(755,root,root) %ghost %{_libdir}/libswscale.so.0 | |
396 | ||
397 | %files devel | |
398 | %defattr(644,root,root,755) | |
399 | %doc doc/optimization.txt | |
400 | %attr(755,root,root) %{_libdir}/libavcodec.so | |
401 | %attr(755,root,root) %{_libdir}/libavdevice.so | |
402 | %attr(755,root,root) %{_libdir}/libavfilter.so | |
403 | %attr(755,root,root) %{_libdir}/libavformat.so | |
404 | %attr(755,root,root) %{_libdir}/libavutil.so | |
405 | %attr(755,root,root) %{_libdir}/libpostproc.so | |
406 | %attr(755,root,root) %{_libdir}/libswscale.so | |
407 | %attr(755,root,root) %{_bindir}/ffmpeg-avconfig | |
408 | %{_includedir}/ffmpeg | |
409 | %{_includedir}/libavcodec | |
410 | %{_includedir}/libavdevice | |
411 | %{_includedir}/libavfilter | |
412 | %{_includedir}/libavformat | |
413 | %{_includedir}/libavutil | |
414 | %{_includedir}/libpostproc | |
415 | %{_includedir}/libswscale | |
416 | %{_pkgconfigdir}/*.pc | |
417 | ||
418 | %files static | |
419 | %defattr(644,root,root,755) | |
420 | %{_libdir}/lib*.a | |
421 | ||
422 | %files ffplay | |
423 | %defattr(644,root,root,755) | |
424 | %attr(755,root,root) %{_bindir}/ffplay | |
425 | %{?with_doc:%{_mandir}/man1/ffplay.1*} | |
426 | ||
427 | %files ffserver | |
428 | %defattr(644,root,root,755) | |
429 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf | |
430 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver | |
431 | %attr(755,root,root) %{_sbindir}/ffserver | |
432 | %attr(754,root,root) /etc/rc.d/init.d/ffserver | |
433 | %{?with_doc:%{_mandir}/man1/ffserver.1*} | |
434 | %dir %attr(770,root,ffserver) /var/cache/ffserver | |
435 | %dir %attr(770,root,ffserver) /var/log/ffserver |