%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") Name: ffmpeg-php Version: 0.5.1 Release: 1%{?dist} Summary: Extension to manipulate movie in PHP Group: Development/Languages License: GPL URL: http://ffmpeg-php.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tbz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ffmpeg-devel >= 0.4.9, php-devel, php-gd Requires: php-gd %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 %setup -q sed -i -e 's@/lib@/%{_lib}@' config.m4 %build phpize %configure --with-libdir=%{_lib} 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 EOF %check TEST_PHP_EXECUTABLE=$(which php) NO_INTERACTION=1 php 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 * Sat Jul 07 2007 Remi Collet 0.5.1-1 - initial SPEC