3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname facedetect
7 Summary: PHP Facedetect Extension
8 Name: %{php_name}-%{modname}
12 Group: Development/Languages/PHP
13 Source0: https://github.com/infusion/PHP-Facedetect/archive/v%{version}/%{modname}-%{version}.tar.gz
14 # Source0-md5: 4ce5e01bf0933957b37f0d0c5735393a
16 URL: http://www.xarg.org/project/php-facedetect/
17 BuildRequires: %{php_name}-devel
18 BuildRequires: opencv-devel
19 BuildRequires: rpmbuild(macros) >= 1.650
20 %{?requires_php_extension}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 This extension provides a PHP implementation of the OpenCV library.
25 The extension offers two new functions. In princible, they differ only
26 by their return value. The first returns only the number of faces
27 found on the given image and the other an associative array of their
31 %setup -q -n PHP-Facedetect-%{version}
35 export LIBS=%{_libdir}/libopencv_*.so.*
41 rm -rf $RPM_BUILD_ROOT
42 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
44 EXTENSION_DIR=%{php_extensiondir} \
45 INSTALL_ROOT=$RPM_BUILD_ROOT
47 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
48 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
49 ; Enable %{modname} extension module
50 extension=%{modname}.so
54 rm -rf $RPM_BUILD_ROOT
57 %php_webserver_restart
61 %php_webserver_restart
65 %defattr(644,root,root,755)
67 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
68 %attr(755,root,root) %{php_extensiondir}/%{modname}.so