]> git.pld-linux.org Git - packages/php-ffmpeg.git/blob - php-ffmpeg.spec
add todo and notes
[packages/php-ffmpeg.git] / php-ffmpeg.spec
1 # TODO
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
7 #
8 # Conditional build:
9 %bcond_with     tests           # build without tests
10
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
14 Name:           php-%{modname}
15 Version:        0.6.3
16 Release:        6
17 License:        GPL
18 Group:          Development/Languages/PHP
19 Source0:        http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
20 # Source0-md5:  f779c0dbffda9dac54729d60c0e04c05
21 Patch100:       branch.diff
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/
30 %if %{with tests}
31 BuildRequires:  /usr/bin/php
32 BuildRequires:  php-devel >= 4:5.3.2-5
33 BuildRequires:  php-pcre
34 %else
35 BuildRequires:  php-devel >= 3:5.0.0
36 %endif
37 BuildRequires:  ffmpeg-devel >= 0.7.1
38 BuildRequires:  php-gd
39 BuildRequires:  rpm >= 4.4.9-56
40 BuildRequires:  rpmbuild(macros) >= 1.344
41 Requires:       php(core) >= 5.0.4
42 Requires:       php-gd
43 %{?requires_php_extension}
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description
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...).
55
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...).
65
66 %prep
67 %setup -q -n ffmpeg-php-0.6.0
68 %patch100 -p0
69 %patch1 -p1
70 %if "%{pld_release}" != "ac"
71 %patch4 -p1
72 %endif
73 %patch6 -p1
74 %patch7 -p1
75 %patch8 -p1
76 %patch9 -p1
77 %patch10 -p1
78
79 # empty file
80 rm tests/getFramesBackwards.phpt
81
82 %build
83 phpize
84 CPPFLAGS="%{rpmcppflags}"
85 %configure
86 %{__make}
87
88 %if %{with tests}
89 cat <<'EOF' > run-tests.sh
90 #!/bin/sh
91 %{__make} test \
92         PHP_TEST_SHARED_SYSTEM_EXTENSIONS+="gd" \
93         RUN_TESTS_SETTINGS="-q $*"
94 EOF
95 chmod +x run-tests.sh
96 ./run-tests.sh -w failed.log
97 test -f failed.log -a ! -s failed.log
98 %endif
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
103 %{__make} install \
104         INSTALL_ROOT=$RPM_BUILD_ROOT \
105         EXTENSION_DIR=%{php_extensiondir}
106
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
111
112 ; --- options for %{modname}
113 ;ffmpeg.allow_persistent = 0
114 ;ffmpeg.show_warnings = 0
115 EOF
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %post
121 %php_webserver_restart
122
123 %postun
124 if [ "$1" = 0 ]; then
125         %php_webserver_restart
126 fi
127
128 %files
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
This page took 0.087429 seconds and 3 git commands to generate.