diff options
author | Remi Collet <fedora@famillecollet.com> | 2012-06-10 07:14:25 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2012-06-10 07:14:25 +0200 |
commit | 05cda3059ea0aad765966895e625dba15082e06f (patch) | |
tree | 94829192826fee05601efc725704506472df056e |
repo reorg
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | php-ffmpeg.patch | 23 | ||||
-rw-r--r-- | php-ffmpeg.spec | 131 |
3 files changed, 162 insertions, 0 deletions
@@ -0,0 +1,8 @@ +php-ffmpeg +---------- + +Package in progress +Not yet available in rpmfusion. + +ffmpeg is probably not enough ABI stable. + diff --git a/php-ffmpeg.patch b/php-ffmpeg.patch new file mode 100644 index 0000000..0d2761b --- /dev/null +++ b/php-ffmpeg.patch @@ -0,0 +1,23 @@ +diff -up ffmpeg-php-0.6.0/config.m4.orig ffmpeg-php-0.6.0/config.m4 +--- ffmpeg-php-0.6.0/config.m4.orig 2010-03-21 09:05:15.000000000 +0100 ++++ ffmpeg-php-0.6.0/config.m4 2010-03-21 09:12:32.000000000 +0100 +@@ -41,6 +41,18 @@ if test "$PHP_FFMPEG" != "no"; then + PHP_ADD_INCLUDE($i/include/libavdevice/) + FFMPEG_INC_FOUND=$i/include/libavcodec + break ++ elif test -f $i/libavcodec/avcodec.h; then ++ dnl ffmpeg svn revision 12194 and newer put each header in its own dir ++ dnl ffmpeg-devel RPM install in /usr/include/ffmpeg/* ++ PHP_ADD_INCLUDE($i) ++ PHP_ADD_INCLUDE($i/libavcodec/) ++ PHP_ADD_INCLUDE($i/libavformat/) ++ PHP_ADD_INCLUDE($i/libavutil/) ++ PHP_ADD_INCLUDE($i/libswscale/) ++ PHP_ADD_INCLUDE($i/libavfilter/) ++ PHP_ADD_INCLUDE($i/libavdevice/) ++ FFMPEG_INC_FOUND=$i ++ break + fi + done + + diff --git a/php-ffmpeg.spec b/php-ffmpeg.spec new file mode 100644 index 0000000..8e770ff --- /dev/null +++ b/php-ffmpeg.spec @@ -0,0 +1,131 @@ +%global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) +%global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined") + +# 677 have undefined symbol: php_gd_gdImageSetPixel +%global svn 676 + + +Name: php-ffmpeg +Version: 0.6.3 +%if 0%{?svn} +Release: 0.1.svn%{svn}%{?dist} +%else +Release: 1%{?dist} +%endif +Summary: Extension to manipulate movie in PHP + +Group: Development/Languages +License: GPLv2 +URL: http://ffmpeg-php.sourceforge.net/ +%if 0%{?svn} +# svn export -r 676 https://ffmpeg-php.svn.sourceforge.net/svnroot/ffmpeg-php/trunk/ffmpeg-php ffmpeg-php-svn676 +# tar cjf /home/rpmbuild/SOURCES/ffmpeg-php-svn676.tbz2 ffmpeg-php-svn676 +Source0: ffmpeg-php-svn%{svn}.tbz2 +%else +Source0: http://downloads.sourceforge.net/%{name}/ffmpeg-php-%{version}.tbz2 +%endif + +Patch0: php-ffmpeg.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: ffmpeg-devel >= 0.5, php-devel, php-gd +Requires: php-gd +Obsoletes: ffmpeg-php <= %{version} +Provides: ffmpeg-php = %{version}-%{release} + +%if %{?php_zend_api}0 +# for fedora >= 6 +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +%else +# for fedora <= 5 +Requires: php-api = %{php_apiver} +%endif + + +%description +ffmpeg-php is an extension for PHP that adds an easy to use, object-oriented +API for accessing and retrieving information from video and audio files. +It has methods for returning frames from movie files as images that can be +manipulated using PHP's image functions. This works well for automatically +creating thumbnail images from movies. ffmpeg-php is also useful for reporting +the duration and bitrate of audio files (mp3, wma...). ffmpeg-php can access +many of the video formats supported by ffmpeg (mov, avi, mpg, wmv...). + + +%prep +%if 0%{?svn} +%setup -q -n ffmpeg-php-svn%{svn} +%else +%setup -q -n ffmpeg-php-%{version} +%endif + +%patch0 -p1 -b .orig + +# we will use include from php-devel +rm gd.h gd_io.h + + +%build +phpize +%configure \ + --with-libdir=%{_lib} \ + --with-ffmpeg=%{_includedir}/ffmpeg \ + CFLAGS=-I%{_includedir}/php/ext/gd/libgd +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install INSTALL_ROOT=$RPM_BUILD_ROOT + +# install config file +install -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d +cat > $RPM_BUILD_ROOT%{_sysconfdir}/php.d/%{name}.ini << 'EOF' +; --- Enable %{name} extension module +extension=ffmpeg.so + +; --- options for %{name} +;ffmpeg.allow_persistent = 0 +;ffmpeg.show_warnings = 0 +EOF + + +%check +# should be run after install +#ldd modules/ffmpeg.so +#TEST_PHP_EXECUTABLE=$(which php) NO_INTERACTION=1 php -q -n \ +# -dextension_dir=$PWD/modules -dextension=gd.so -dextension=ffmpeg.so \ +# run-tests.php +# I know some tests fails +true + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc ChangeLog CREDITS EXPERIMENTAL LICENSE TODO test_ffmpeg.php +%config(noreplace) %{_sysconfdir}/php.d/%{name}.ini +%{php_extdir}/ffmpeg.so + + +%changelog +* Sun Mar 21 2010 Remi Collet <rpms@famillecollet.com> 0.6.3-1.svn676 +- update to 0.6.3 svn snapshot revision 676 + +* Wed Apr 23 2008 Remi Collet <rpms@famillecollet.com> 0.5.2.1-1 +- update to 0.5.1.1 + +* Thu Nov 15 2007 Remi Collet <rpms@famillecollet.com> 0.5.1-2 +- F8 rebuild + +* Mon Aug 27 2007 Remi Collet <rpms@famillecollet.com> 0.5.1-2 +- rename from ffmpeg-php to php-ffmpeg +- fix License + +* Sat Jul 07 2007 Remi Collet <rpms@famillecollet.com> 0.5.1-1 +- initial SPEC + |