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
15 URL: http://www.xarg.org/project/php-facedetect/
16 BuildRequires: %{php_name}-devel
17 BuildRequires: opencv-devel
18 BuildRequires: rpmbuild(macros) >= 1.650
19 %{?requires_php_extension}
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 This extension provides a PHP implementation of the OpenCV library.
24 The extension offers two new functions. In princible, they differ only
25 by their return value. The first returns only the number of faces
26 found on the given image and the other an associative array of their
30 %setup -q -n PHP-Facedetect-%{version}
33 export LIBS=%{_libdir}/libopencv_*.so.*
39 rm -rf $RPM_BUILD_ROOT
40 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
42 EXTENSION_DIR=%{php_extensiondir} \
43 INSTALL_ROOT=$RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
46 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
47 ; Enable %{modname} extension module
48 extension=%{modname}.so
52 rm -rf $RPM_BUILD_ROOT
55 %php_webserver_restart
59 %php_webserver_restart
63 %defattr(644,root,root,755)
65 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
66 %attr(755,root,root) %{php_extensiondir}/%{modname}.so