]> git.pld-linux.org Git - packages/ffmpeg.git/blob - ffmpeg.spec
- rel 3; fix -devel subpackage
[packages/ffmpeg.git] / ffmpeg.spec
1 # TODO
2 # - libnut enabled   no (http://www.nut-container.org/)
3 #
4 # Conditional build:
5 %bcond_with     amr             # 3GPP Adaptive Multi Rate (AMR) codec support; makes package non-distributable
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 #
9 %define         _snap   2008-08-22
10 %define         snap    %(echo %{_snap} | tr -d -)
11 %define         _rel 3
12 Summary:        Realtime audio/video encoder and streaming server
13 Summary(pl.UTF-8):      Koder audio/wideo czasu rzeczywistego oraz serwer strumieni
14 Name:           ffmpeg
15 Version:        0.4.9
16 Release:        4.%{snap}.%{_rel}
17 # LGPL or GPL, chosen at configure time (GPL version is more featured)
18 # (postprocessing, ac3, xvid, x264, faad)
19 License:        GPL v2+ with LGPL v2.1+ parts
20 Group:          Applications/Multimedia
21 #Source0:       http://dl.sourceforge.net/ffmpeg/%{name}-%{version}-pre1.tar.gz
22 Source0:        http://ffmpeg.mplayerhq.hu/%{name}-export-snapshot.tar.bz2
23 # Source0-md5:  573ff56bb619391fbc13ecde23389b45
24 Source1:        ffserver.init
25 Source2:        ffserver.sysconfig
26 Source3:        ffserver.conf
27 URL:            http://ffmpeg.mplayerhq.hu/
28 BuildRequires:  SDL-devel
29 %if %{with amr}
30 BuildRequires:  amrnb-devel >= 6.1.0.4
31 BuildRequires:  amrwb-devel >= 7.0.0.1
32 %endif
33 BuildRequires:  dirac-devel
34 BuildRequires:  faac-devel
35 BuildRequires:  faad2-devel
36 BuildRequires:  freetype-devel
37 %ifarch ppc
38 # require version with altivec support fixed
39 BuildRequires:  gcc >= 5:3.3.2-3
40 %endif
41 %{?with_imlib2:BuildRequires:   imlib2-devel >= 1.3.0}
42 BuildRequires:  lame-libs-devel
43 BuildRequires:  a52dec-libs-devel
44 BuildRequires:  libgsm-devel
45 BuildRequires:  libdc1394-devel
46 BuildRequires:  libraw1394-devel
47 BuildRequires:  libtheora-devel >= 1.0-0.alpha7
48 BuildRequires:  libtool >= 2:1.4d-3
49 BuildRequires:  libvorbis-devel
50 BuildRequires:  libx264-devel >= 0.1.2-1.20080801
51 %ifarch %{ix86}
52 %ifnarch i386 i486
53 BuildRequires:  nasm
54 %endif
55 %endif
56 BuildRequires:  perl-tools-pod
57 BuildRequires:  rpmbuild(macros) >= 1.268
58 BuildRequires:  tetex
59 BuildRequires:  texinfo
60 %{?with_amr:BuildRequires:      unzip}
61 BuildRequires:  xvid-devel >= 1:1.1.0
62 BuildRequires:  zlib-devel
63 %{?with_autoreqdep:BuildConflicts:      libpostproc}
64 Requires:       %{name}-libs = %{version}-%{release}
65 Requires:       xvid >= 1:1.1.0
66 Obsoletes:      libpostproc
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %define         _noautoreqdep   libGL.so.1 libGLU.so.1
70
71 %define         specflags       -fno-strict-aliasing
72
73 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
74 %define         specflags_ia32  -fomit-frame-pointer
75 # -mmmx is needed to enable <mmintrin.h> code.
76 %define         specflags_i586  -mmmx
77 %define         specflags_i686  -mmmx
78
79 %description
80 ffmpeg is a hyper fast realtime audio/video encoder and streaming
81 server. It can grab from a standard Video4Linux video source and
82 convert it into several file formats based on DCT/motion compensation
83 encoding. Sound is compressed in MPEG audio layer 2 or using an AC3
84 compatible stream.
85
86 %description -l pl.UTF-8
87 ffmpeg jest bardzo szybkim koderem audio/wideo w czasie rzeczywistym
88 oraz serwerem strumieni multimedialnych. ffmpeg potrafi zrzucać dane
89 ze standardowego urządzenia Video4Linux i przekonwertować je w kilka
90 formatów plików bazujących na kodowaniu DCT/kompensacji ruchu. Dźwięk
91 jest kompresowany do strumienia MPEG audio layer 2 lub używając
92 strumienia kompatybilnego z AC3.
93
94 %package libs
95 Summary:        ffmpeg libraries
96 Summary(pl.UTF-8):      Biblioteki ffmpeg
97 Group:          Libraries
98
99 %description libs
100 This package contains ffmpeg shared libraries.
101
102 %description libs -l pl.UTF-8
103 Ten pakiet zawiera biblioteki współdzielone ffmpeg.
104
105 %package devel
106 Summary:        ffmpeg header files
107 Summary(pl.UTF-8):      Pliki nagłówkowe ffmpeg
108 Group:          Development/Libraries
109 Requires:       %{name}-libs = %{version}-%{release}
110 # for libavcodec:
111 %if %{with amr}
112 Requires:       amrnb-devel
113 Requires:       amrwb-devel >= 5.3.0
114 %endif
115 Requires:       faac-devel
116 Requires:       faad2-devel
117 Requires:       lame-libs-devel
118 Requires:       libgsm-devel
119 Requires:       libtheora-devel >= 1.0-0.alpha7
120 Requires:       libvorbis-devel
121 Requires:       libx264-devel >= 0.1.2-1.20060828_2245.1
122 Requires:       xvid-devel >= 1:1.1.0
123 Requires:       zlib-devel
124 Obsoletes:      libpostproc-devel
125
126 %description devel
127 ffmpeg header files.
128
129 %description devel -l pl.UTF-8
130 Pliki nagłówkowe ffmpeg.
131
132 %package static
133 Summary:        ffmpeg static libraries
134 Summary(pl.UTF-8):      Statyczne biblioteki ffmpeg
135 Group:          Development/Libraries
136 Requires:       %{name}-devel = %{version}-%{release}
137
138 %description static
139 ffmpeg static libraries (libavcodec and libavformat).
140
141 %description static -l pl.UTF-8
142 Statyczne biblioteki ffmpeg (libavcodec i libavformat).
143
144 %package ffplay
145 Summary:        FFplay - SDL-based media player
146 Summary(pl.UTF-8):      FFplay - odtwarzacz mediów oparty na SDL
147 Group:          Applications/Multimedia
148 Requires:       %{name}-libs = %{version}-%{release}
149
150 %description ffplay
151 FFplay is a very simple and portable media player using the FFmpeg
152 libraries and the SDL library. It is mostly used as a test bench for
153 the various APIs of FFmpeg.
154
155 %description ffplay -l pl.UTF-8
156 FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
157 bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
158 testowania różnych API FFmpeg.
159
160 %package vhook-imlib2
161 Summary:        imlib2 based hook
162 Summary(pl.UTF-8):      Moduł przejściowy oparty o imlib2
163 Group:          Libraries
164 Requires:       %{name}-libs = %{version}-%{release}
165
166 %description vhook-imlib2
167 This module implements a text overlay for a video image. Currently it
168 supports a fixed overlay or reading the text from a file. The string
169 is passed through strftime so that it is easy to imprint the date and
170 time onto the image.
171
172 %description vhook-imlib2 -l pl.UTF-8
173 Ten moduł implementuje tekstową nakładkę dla obrazu. Aktualnie
174 obsługuje stałą nakładkę lub wczytywanie tekstu z pliku. Łańcuch jest
175 przepuszczany przez strftime, więc łatwo umieścić datę i czas na
176 obrazie.
177
178 %package ffserver
179 Summary:        FFserver video server
180 Summary(pl.UTF-8):      FFserver - serwer strumieni obrazu
181 Group:          Daemons
182 Requires(post,preun):   /sbin/chkconfig
183 Requires:       %{name}-libs = %{version}-%{release}
184 Requires:       rc-scripts >= 0.4.0.10
185
186 %description ffserver
187 FFserver is a streaming server for both audio and video. It supports
188 several live feeds, streaming from files and time shifting on live
189 feeds (you can seek to positions in the past on each live feed,
190 provided you specify a big enough feed storage in ffserver.conf).
191
192 %description ffserver -l pl.UTF-8
193 FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
194 źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
195 czasie dla źródeł na żywo (można przeskakiwać na położenia w
196 przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
197 dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
198
199 %prep
200 %setup -q -n %{name}-export-%{_snap}
201
202 # package the grep result for mplayer, the result formatted as mplayer/configure
203 cat <<EOF > ffmpeg-config
204 #! /bin/sh
205 _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
206 _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
207 _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
208 _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
209 _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
210 _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
211 _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
212 EOF
213 cat <<'EOF' >> ffmpeg-config
214
215 case "$1" in
216 --decoders)
217         echo $_libavdecoders_all
218         ;;
219 --encoders)
220         echo $_libavencoders_all
221         ;;
222 --parsers)
223         echo $_libavparsers_all
224         ;;
225 --bsfs)
226         echo $_libavbsfs_all
227         ;;
228 --demuxers)
229         echo $_libavdemuxers_all
230         ;;
231 --muxers)
232         echo $_libavmuxers_all
233         ;;
234 --protocols)
235         echo $_libavprotocols_all
236         ;;
237 *)
238         cat <<USAGE
239 Usage: $0 [OPTION]
240 Options:
241   --decoders
242   --encoders
243   --parsers
244   --bsfs
245   --demuxers
246   --muxers
247   --protocols
248 USAGE
249         exit 1;;
250 esac
251
252 exit 0
253 EOF
254
255 %build
256 # notes:
257 # - it's not autoconf configure
258 # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
259 ./configure \
260         --arch=%{_target_base_arch} \
261         --prefix=%{_prefix} \
262         --libdir=%{_libdir} \
263         --shlibdir=%{_libdir} \
264         --mandir=%{_mandir} \
265         --disable-stripping \
266         --enable-liba52 \
267         --enable-liba52bin \
268         --enable-libfaac \
269         --enable-libfaad \
270         --enable-libfaadbin \
271         --enable-libdc1394 \
272         --enable-libdirac \
273         --enable-gpl \
274         --enable-libgsm \
275         --enable-libtheora \
276         --enable-libmp3lame \
277         --enable-postproc \
278         --enable-pthreads \
279         --enable-shared \
280         --enable-swscale \
281         --enable-libvorbis \
282         --enable-libx264 \
283         --enable-libxvid \
284 %ifnarch %{ix86} %{x8664}
285         --disable-mmx \
286 %endif
287 %ifarch i386 i486
288         --disable-mmx \
289 %endif
290 %if %{with amr}
291         --enable-nonfree \
292         --enable-libamr-nb \
293         --enable-libamr-wb \
294 %endif
295         --cc="%{__cc}" \
296         --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
297         --extra-ldflags="%{rpmldflags}" \
298         --disable-debug \
299         --disable-optimizations \
300
301 %{__make}
302
303 %install
304 rm -rf $RPM_BUILD_ROOT
305 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
306         $RPM_BUILD_ROOT/%{_includedir}/ffmpeg \
307         $RPM_BUILD_ROOT/var/{cache,log}/ffserver
308
309 %{__make} install \
310         DESTDIR=$RPM_BUILD_ROOT
311
312 install config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
313 install libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
314 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
315 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
316 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
317 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
318
319 # install as ffmpeg-avconfig to avoid with possible programs looking for
320 # ffmpeg-config and expecting --libs output from it which is not implemented
321 # simple to do (by querying pkgconfig), but why?
322 install ffmpeg-config $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
323
324 %clean
325 rm -rf $RPM_BUILD_ROOT
326
327 %post libs      -p /sbin/ldconfig
328 %postun libs    -p /sbin/ldconfig
329
330 %pre ffserver
331 %groupadd -g 167 ffserver
332 %useradd -g ffserver -u 167 ffserver
333
334 %post ffserver
335 /sbin/chkconfig --add ffserver
336 %service ffserver restart
337
338 %preun ffserver
339 if [ "$1" = 0 ]; then
340         %service ffserver stop
341         /sbin/chkconfig --del ffserver
342 fi
343
344 %postun ffserver
345 if [ "$1" = 0 ]; then
346         %userremove ffserver
347         %groupremove ffserver
348 fi
349
350 %files
351 %defattr(644,root,root,755)
352 %doc Changelog README doc/*.html doc/TODO
353 %attr(755,root,root) %{_bindir}/ffmpeg
354 %{_mandir}/man1/ffmpeg.1*
355
356 %files libs
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
359 %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
360 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
361 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
362 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
363 %attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
364 %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.51
365 %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.52
366 %attr(755,root,root) %ghost %{_libdir}/libavformat.so.52
367 %attr(755,root,root) %ghost %{_libdir}/libavutil.so.49
368 %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.51
369 %attr(755,root,root) %ghost %{_libdir}/libswscale.so.0
370 %dir %{_libdir}/vhook
371 %attr(755,root,root) %{_libdir}/vhook/drawtext.so
372 %attr(755,root,root) %{_libdir}/vhook/fish.so
373 %attr(755,root,root) %{_libdir}/vhook/null.so
374 %attr(755,root,root) %{_libdir}/vhook/ppm.so
375 %attr(755,root,root) %{_libdir}/vhook/watermark.so
376
377 %files devel
378 %defattr(644,root,root,755)
379 %doc doc/optimization.txt
380 %attr(755,root,root) %{_libdir}/libavcodec.so
381 %attr(755,root,root) %{_libdir}/libavdevice.so
382 %attr(755,root,root) %{_libdir}/libavformat.so
383 %attr(755,root,root) %{_libdir}/libavutil.so
384 %attr(755,root,root) %{_libdir}/libpostproc.so
385 %attr(755,root,root) %{_libdir}/libswscale.so
386 %attr(755,root,root) %{_bindir}/ffmpeg-avconfig
387 %{_includedir}/ffmpeg
388 %{_includedir}/libavcodec
389 %{_includedir}/libavdevice
390 %{_includedir}/libavformat
391 %{_includedir}/libavutil
392 %{_includedir}/libpostproc
393 %{_includedir}/libswscale
394 %{_pkgconfigdir}/*.pc
395
396 %files static
397 %defattr(644,root,root,755)
398 %{_libdir}/lib*.a
399
400 %files ffplay
401 %defattr(644,root,root,755)
402 %attr(755,root,root) %{_bindir}/ffplay
403 %{_mandir}/man1/ffplay.1*
404
405 %if %{with imlib2}
406 %files vhook-imlib2
407 %defattr(644,root,root,755)
408 %attr(755,root,root) %{_libdir}/vhook/imlib2.so
409 %endif
410
411 %files ffserver
412 %defattr(644,root,root,755)
413 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
414 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
415 %attr(755,root,root) %{_sbindir}/ffserver
416 %attr(754,root,root) /etc/rc.d/init.d/ffserver
417 %{_mandir}/man1/ffserver.1*
418 %dir %attr(770,root,ffserver) /var/cache/ffserver
419 %dir %attr(770,root,ffserver) /var/log/ffserver
This page took 0.054727 seconds and 4 git commands to generate.