summaryrefslogtreecommitdiffstats
path: root/php-ffmpeg.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-ffmpeg.spec')
-rw-r--r--php-ffmpeg.spec136
1 files changed, 86 insertions, 50 deletions
diff --git a/php-ffmpeg.spec b/php-ffmpeg.spec
index 8e770ff..73d8bb0 100644
--- a/php-ffmpeg.spec
+++ b/php-ffmpeg.spec
@@ -1,12 +1,8 @@
-%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
-
+%global ext_name ffmpeg
+%global svn 678
Name: php-ffmpeg
-Version: 0.6.3
+Version: 0.7.0
%if 0%{?svn}
Release: 0.1.svn%{svn}%{?dist}
%else
@@ -18,29 +14,31 @@ 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
+# svn export -r 678 https://ffmpeg-php.svn.sourceforge.net/svnroot/ffmpeg-php/trunk/ffmpeg-php ffmpeg-php-svn678
+# tar cjf ffmpeg-php-svn678.tbz2 ffmpeg-php-svn678
Source0: ffmpeg-php-svn%{svn}.tbz2
%else
Source0: http://downloads.sourceforge.net/%{name}/ffmpeg-php-%{version}.tbz2
%endif
-Patch0: php-ffmpeg.patch
+# Fix include path
+Patch0: php-ffmpeg-incl.patch
+# Fix PHP 5.4 build
+Patch1: php-ffmpeg-php54.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}
+BuildRequires: ffmpeg-devel >= 0.10, php-devel, php-gd
+Obsoletes: ffmpeg-php < %{version}
Provides: ffmpeg-php = %{version}-%{release}
-%if %{?php_zend_api}0
-# for fedora >= 6
+Requires: php-gd%{?_isa}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
-%else
-# for fedora <= 5
-Requires: php-api = %{php_apiver}
-%endif
+
+# Filter private shared object
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
+%{?filter_setup}
%description
@@ -54,66 +52,104 @@ 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
+%setup -q -c
+mv ffmpeg* %{ext_name}-nts
+
+cd %{ext_name}-nts
+%patch0 -p1 -b .incl
+%patch1 -p1 -b .php54
-%patch0 -p1 -b .orig
+# Sanity check, really often broken
+extver=$(sed -n '/#define FFMPEG_PHP_VERSION/{s/.* "//;s/".*$//;p}' ffmpeg-php.c)
+if test "x${extver}" != "x%{version}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}.
+ exit 1
+fi
# we will use include from php-devel
rm gd.h gd_io.h
+cd ..
+cat > %{ext_name}.ini << 'EOF'
+; --- Enable %{name} extension module
+extension=%{ext_name}.so
+
+; --- options for %{name}
+;ffmpeg.allow_persistent = 0
+;ffmpeg.show_warnings = 0
+EOF
+
+# duplicate for ZTS build
+cp -r %{ext_name}-nts %{ext_name}-zts
+
%build
+cd %{ext_name}-nts
phpize
%configure \
--with-libdir=%{_lib} \
--with-ffmpeg=%{_includedir}/ffmpeg \
- CFLAGS=-I%{_includedir}/php/ext/gd/libgd
+ --with-php-config=%{_bindir}/php-config
+make %{?_smp_mflags}
+
+cd ../%{ext_name}-zts
+zts-phpize
+%configure \
+ --with-libdir=%{_lib} \
+ --with-ffmpeg=%{_includedir}/ffmpeg \
+ --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
%install
-rm -rf $RPM_BUILD_ROOT
-make install INSTALL_ROOT=$RPM_BUILD_ROOT
+rm -rf %{buildroot}
+# Install the NTS stuff
+make -C %{ext_name}-nts install INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{ext_name}.ini %{buildroot}%{php_inidir}/%{ext_name}.ini
-# 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
+# Install the ZTS stuff
+make -C %{ext_name}-zts install INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{ext_name}.ini %{buildroot}%{php_ztsinidir}/%{ext_name}.ini
%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
+# simple module load test
+%{__php} --no-php-ini \
+ --define extension_dir=%{ext_name}-nts/modules \
+ --define extension=%{ext_name}.so \
+ --modules | grep %{ext_name}
+
+%{__ztsphp} --no-php-ini \
+ --define extension_dir=%{ext_name}-zts/modules \
+ --define extension=%{ext_name}.so \
+ --modules | grep %{ext_name}
+
%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc ChangeLog CREDITS EXPERIMENTAL LICENSE TODO test_ffmpeg.php
-%config(noreplace) %{_sysconfdir}/php.d/%{name}.ini
-%{php_extdir}/ffmpeg.so
+%doc %{ext_name}-nts/{ChangeLog,CREDITS,EXPERIMENTAL,LICENSE,TODO,test_ffmpeg.php}
+
+%config(noreplace) %{php_inidir}/%{ext_name}.ini
+%{php_extdir}/%{ext_name}.so
+
+%config(noreplace) %{php_ztsinidir}/%{ext_name}.ini
+%{php_ztsextdir}/%{ext_name}.so
%changelog
-* Sun Mar 21 2010 Remi Collet <rpms@famillecollet.com> 0.6.3-1.svn676
+* Mon Sep 17 2010 Remi Collet <rpms@famillecollet.com> 0.7.0-0.1.svn678
+- update to 0.7.0 svn snapshot revision 678
+- add patch for php 5.4
+- add ZTS extension
+- cleanup spec
+- build with ffmpeg 0.10
+
+* Sun Mar 21 2010 Remi Collet <rpms@famillecollet.com> 0.6.3-0.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