]> git.pld-linux.org Git - packages/php-ffmpeg.git/blob - php-ffmpeg.spec
d301a98a5ff7faf7d4c22741fd7e0a21431ebe1a
[packages/php-ffmpeg.git] / php-ffmpeg.spec
1 #
2 # TODO: doesn't pass all tests
3 #
4 # Conditional build:
5 %bcond_with     tests           # build without tests
6
7 %define         modname ffmpeg
8 Summary:        Extension to manipulate movie in PHP
9 Summary(pl.UTF-8):      Rozszerzenie do obróbki filmów w PHP
10 Name:           php-%{modname}
11 Version:        0.6.3
12 Release:        6
13 License:        GPL
14 Group:          Development/Languages/PHP
15 Source0:        http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
16 # Source0-md5:  f779c0dbffda9dac54729d60c0e04c05
17 Patch100:       branch.diff
18 Patch1:         avcodec_find_decoder-warn.patch
19 Patch4:         ffmpeg-0.6.patch
20 Patch6:         allow_persistent_on_persistentMovie.phpt.patch
21 Patch7:         test_fixes.patch
22 Patch8:         tests-frame_md5.patch
23 Patch9:         tests-metadata-api.patch
24 Patch10:        %{name}-ffmpeg08.patch
25 URL:            http://ffmpeg-php.sourceforge.net/
26 %if %{with tests}
27 BuildRequires:  /usr/bin/php
28 BuildRequires:  php-devel >= 4:5.3.2-5
29 BuildRequires:  php-pcre
30 %else
31 BuildRequires:  php-devel >= 3:5.0.0
32 %endif
33 BuildRequires:  ffmpeg-devel >= 0.7.1
34 BuildRequires:  php-gd
35 BuildRequires:  rpm >= 4.4.9-56
36 BuildRequires:  rpmbuild(macros) >= 1.344
37 Requires:       php(core) >= 5.0.4
38 Requires:       php-gd
39 %{?requires_php_extension}
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 php-ffmpeg is an extension for PHP that adds an easy to use,
44 object-oriented API for accessing and retrieving information from
45 video and audio files. It has methods for returning frames from movie
46 files as images that can be manipulated using PHP's image functions.
47 This works well for automatically creating thumbnail images from
48 movies. ffmpeg-php is also useful for reporting the duration and
49 bitrate of audio files (mp3, wma...). ffmpeg-php can access many of
50 the video formats supported by ffmpeg (mov, avi, mpg, wmv...).
51
52 %description -l pl.UTF-8
53 php-ffmpeg to rozszerzenie PHP dodające łatwe w użyciu, zorientowane
54 obiektowo API pozwalające na odtwarzanie informacji z plików filmów i
55 dźwiękowych. Zawiera metody zwracające ramki filmów jako obrazy, które
56 można obrabiać funkcjami PHP. Pozwala to automatycznie tworzyć
57 miniaturki obrazów z filmów. ffmpeg-php jest przydatne także do
58 uzyskiwania informacji o czasie trwania i paśmie plików dźwiękowych
59 (mp3, wma...). ffmpeg-php pozwala na dostęp do wielu formatów filmów
60 obsługiwanych przez ffmpeg (mov, avi, mpg, wmv...).
61
62 %prep
63 %setup -q -n ffmpeg-php-0.6.0
64 %patch100 -p0
65 %patch1 -p1
66 %if "%{pld_release}" != "ac"
67 %patch4 -p1
68 %endif
69 %patch6 -p1
70 %patch7 -p1
71 %patch8 -p1
72 %patch9 -p1
73 %patch10 -p1
74
75 # empty file
76 rm tests/getFramesBackwards.phpt
77
78 %build
79 phpize
80 CPPFLAGS="%{rpmcppflags}"
81 %configure
82 %{__make}
83
84 %if %{with tests}
85 cat <<'EOF' > run-tests.sh
86 #!/bin/sh
87 %{__make} test \
88         PHP_TEST_SHARED_SYSTEM_EXTENSIONS+="gd" \
89         RUN_TESTS_SETTINGS="-q $*"
90 EOF
91 chmod +x run-tests.sh
92 ./run-tests.sh -w failed.log
93 test -f failed.log -a ! -s failed.log
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
99 %{__make} install \
100         INSTALL_ROOT=$RPM_BUILD_ROOT \
101         EXTENSION_DIR=%{php_extensiondir}
102
103 # install config file
104 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
105 ; Enable %{modname} extension module
106 extension=%{modname}.so
107
108 ; --- options for %{modname}
109 ;ffmpeg.allow_persistent = 0
110 ;ffmpeg.show_warnings = 0
111 EOF
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %post
117 %php_webserver_restart
118
119 %postun
120 if [ "$1" = 0 ]; then
121         %php_webserver_restart
122 fi
123
124 %files
125 %defattr(644,root,root,755)
126 %doc ChangeLog CREDITS EXPERIMENTAL LICENSE TODO test_ffmpeg.php
127 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
128 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.081076 seconds and 2 git commands to generate.