]>
Commit | Line | Data |
---|---|---|
81ba7f00 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
5 | %define php_name php%{?php_suffix} | |
6 | %define modname facedetect | |
7 | Summary: PHP Facedetect Extension | |
8 | Name: %{php_name}-%{modname} | |
06f83433 | 9 | Version: 1.1.0 |
9cf4f6bb | 10 | Release: 5 |
81ba7f00 ER |
11 | License: PHP 3.0 |
12 | Group: Development/Languages/PHP | |
06f83433 ER |
13 | Source0: https://github.com/infusion/PHP-Facedetect/archive/v%{version}/%{modname}-%{version}.tar.gz |
14 | # Source0-md5: 4ce5e01bf0933957b37f0d0c5735393a | |
dca761a2 | 15 | Patch0: opencv3.patch |
81ba7f00 ER |
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) | |
22 | ||
23 | %description | |
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 | |
28 | coordinates. | |
29 | ||
30 | %prep | |
06f83433 | 31 | %setup -q -n PHP-Facedetect-%{version} |
dca761a2 | 32 | %patch0 -p1 |
81ba7f00 ER |
33 | |
34 | %build | |
8e046895 | 35 | export LIBS=%{_libdir}/libopencv_*.so.* |
81ba7f00 ER |
36 | phpize |
37 | %configure | |
38 | %{__make} | |
39 | ||
40 | %install | |
41 | rm -rf $RPM_BUILD_ROOT | |
42 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} | |
43 | %{__make} install \ | |
44 | EXTENSION_DIR=%{php_extensiondir} \ | |
45 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
46 | ||
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 | |
51 | EOF | |
52 | ||
81ba7f00 ER |
53 | %clean |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | ||
56 | %post | |
57 | %php_webserver_restart | |
58 | ||
59 | %postun | |
60 | if [ "$1" = 0 ]; then | |
61 | %php_webserver_restart | |
62 | fi | |
63 | ||
64 | %files | |
65 | %defattr(644,root,root,755) | |
fe1f1449 | 66 | %doc CREDITS |
81ba7f00 ER |
67 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini |
68 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |