Blob Blame History Raw
%global php_apiver	%((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
%{!?php_extdir:		%{expand: %%global php_extdir %(php-config --extension-dir)}}

Name:		php-facedetect
Version:	1.0.0
Release:	2%{?dist}
Summary:	PHP extension to access the OpenCV library
Group:		Development/Languages
License:	PHP
URL:		http://www.xarg.org/project/php-facedetect/
Source0:	http://www.xarg.org/download/facedetect-1.0.0.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	php-devel opencv-devel

%if %{?php_zend_api}0
Requires:	php(zend-abi) = %{php_zend_api}
Requires:	php(api) = %{php_core_api}
%else
Requires:	php-api = %{php_apiver}
%endif


%description
This extension provides a PHP implementation of the OpenCV library.
The extension offers two new functions. In principle, they differ
only by their return value. The first returns only the number of
faces found on the given image and the other an associative array
of their coordinates.


%prep
%setup -q -n facedetect-%{version}
%{__cat} <<'EOF' >facedetect.ini
extension=facedetect.so
EOF
sed -i 's/\r//' CREDITS

%build
phpize
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install INSTALL_ROOT=$RPM_BUILD_ROOT INSTALL="install -p"
install -p -D -m0644 facedetect.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.d/facedetect.ini


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc CREDITS
%config(noreplace) %{_sysconfdir}/php.d/facedetect.ini
%{php_extdir}/facedetect.so

%changelog
* Thu Jul 30 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.0-2
- Fix macros

* Wed Jul 22 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.0-1
- Initial package