2 # - doesn't pass all tests
3 # - merge few bits from upstream svn:
4 # http://ffmpeg-php.svn.sourceforge.net/viewvc/ffmpeg-php?view=revision&sortby=date&revision=678
5 # - seems abandoned, ffmpeg.org suggests to use ffmpeg/ffprobe tools
6 # http://ffmpeg.org/trac/ffmpeg/wiki/Using%20FFmpeg%20from%20PHP%20scripts#Conclusion
9 %bcond_with tests # build without tests
11 %define modname ffmpeg
12 Summary: Extension to manipulate movie in PHP
13 Summary(pl.UTF-8): Rozszerzenie do obróbki filmów w PHP
18 Group: Development/Languages/PHP
19 Source0: http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
20 # Source0-md5: f779c0dbffda9dac54729d60c0e04c05
22 Patch1: avcodec_find_decoder-warn.patch
23 Patch4: ffmpeg-0.6.patch
24 Patch6: allow_persistent_on_persistentMovie.phpt.patch
25 Patch7: test_fixes.patch
26 Patch8: tests-frame_md5.patch
27 Patch9: tests-metadata-api.patch
28 Patch10: %{name}-ffmpeg08.patch
29 URL: http://ffmpeg-php.sourceforge.net/
31 BuildRequires: /usr/bin/php
32 BuildRequires: php-devel >= 4:5.3.2-5
33 BuildRequires: php-pcre
35 BuildRequires: php-devel >= 3:5.0.0
37 BuildRequires: ffmpeg-devel >= 0.7.1
39 BuildRequires: rpm >= 4.4.9-56
40 BuildRequires: rpmbuild(macros) >= 1.344
41 Requires: php(core) >= 5.0.4
43 %{?requires_php_extension}
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 php-ffmpeg is an extension for PHP that adds an easy to use,
48 object-oriented API for accessing and retrieving information from
49 video and audio files. It has methods for returning frames from movie
50 files as images that can be manipulated using PHP's image functions.
51 This works well for automatically creating thumbnail images from
52 movies. ffmpeg-php is also useful for reporting the duration and
53 bitrate of audio files (mp3, wma...). ffmpeg-php can access many of
54 the video formats supported by ffmpeg (mov, avi, mpg, wmv...).
56 %description -l pl.UTF-8
57 php-ffmpeg to rozszerzenie PHP dodające łatwe w użyciu, zorientowane
58 obiektowo API pozwalające na odtwarzanie informacji z plików filmów i
59 dźwiękowych. Zawiera metody zwracające ramki filmów jako obrazy, które
60 można obrabiać funkcjami PHP. Pozwala to automatycznie tworzyć
61 miniaturki obrazów z filmów. ffmpeg-php jest przydatne także do
62 uzyskiwania informacji o czasie trwania i paśmie plików dźwiękowych
63 (mp3, wma...). ffmpeg-php pozwala na dostęp do wielu formatów filmów
64 obsługiwanych przez ffmpeg (mov, avi, mpg, wmv...).
67 %setup -q -n ffmpeg-php-0.6.0
70 %if "%{pld_release}" != "ac"
80 rm tests/getFramesBackwards.phpt
84 CPPFLAGS="%{rpmcppflags}"
89 cat <<'EOF' > run-tests.sh
92 PHP_TEST_SHARED_SYSTEM_EXTENSIONS+="gd" \
93 RUN_TESTS_SETTINGS="-q $*"
96 ./run-tests.sh -w failed.log
97 test -f failed.log -a ! -s failed.log
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
104 INSTALL_ROOT=$RPM_BUILD_ROOT \
105 EXTENSION_DIR=%{php_extensiondir}
107 # install config file
108 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
109 ; Enable %{modname} extension module
110 extension=%{modname}.so
112 ; --- options for %{modname}
113 ;ffmpeg.allow_persistent = 0
114 ;ffmpeg.show_warnings = 0
118 rm -rf $RPM_BUILD_ROOT
121 %php_webserver_restart
124 if [ "$1" = 0 ]; then
125 %php_webserver_restart
129 %defattr(644,root,root,755)
130 %doc ChangeLog CREDITS EXPERIMENTAL LICENSE TODO test_ffmpeg.php
131 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
132 %attr(755,root,root) %{php_extensiondir}/%{modname}.so