summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-06-10 07:14:25 +0200
committerRemi Collet <fedora@famillecollet.com>2012-06-10 07:14:25 +0200
commitdcc31699efbe130a9a33f4a19631dce1fa158624 (patch)
treef2701fbd07d871b64c867fd6bed27828ddfb8a83
repo reorgHEADmaster
-rw-r--r--Makefile4
-rw-r--r--facedetect-1.0.1-opencv-2.2.0.patch35
-rw-r--r--facedetect-1.0.1.tar.gzbin0 -> 2791 bytes
-rw-r--r--facedetect-dso-link-workaround.patch47
-rw-r--r--facedetect-php54.patch12
-rw-r--r--php-facedetect.spec103
6 files changed, 201 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1e65467
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../common/Makefile
+
diff --git a/facedetect-1.0.1-opencv-2.2.0.patch b/facedetect-1.0.1-opencv-2.2.0.patch
new file mode 100644
index 0000000..44b279b
--- /dev/null
+++ b/facedetect-1.0.1-opencv-2.2.0.patch
@@ -0,0 +1,35 @@
+diff -up facedetect/config.m4.BAD facedetect/config.m4
+--- facedetect/config.m4.BAD 2011-05-10 15:20:16.295313177 -0400
++++ facedetect/config.m4 2011-05-10 15:20:36.292054317 -0400
+@@ -27,10 +27,7 @@ if test "$PHP_FACEDETECT" != "no"; then
+ AC_CHECK_HEADER([$FACEDETECT_DIR/include/opencv/cv.h], [], AC_MSG_ERROR('opencv/cv.h' header not found))
+ AC_CHECK_HEADER([$FACEDETECT_DIR/include/opencv/highgui.h], [], AC_MSG_ERROR('opencv/highgui.h' header not found))
+
+- PHP_ADD_LIBRARY_WITH_PATH(cv, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(cvaux, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(highgui, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(cxcore, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(opencv_objdetect, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+
+ PHP_SUBST(FACEDETECT_SHARED_LIBADD)
+ AC_DEFINE(HAVE_FACEDETECT, 1, [ ])
+diff -up facedetect/facedetect.c.BAD facedetect/facedetect.c
+--- facedetect/facedetect.c.BAD 2011-05-10 15:15:04.603349547 -0400
++++ facedetect/facedetect.c 2011-05-10 15:19:31.982886849 -0400
+@@ -18,6 +18,7 @@
+ #include "config.h"
+ #endif
+ #include "php.h"
++#include <standard/info.h>
+ #include "php_facedetect.h"
+
+ #include <opencv/cv.h>
+@@ -102,7 +103,7 @@ static void php_facedetect(INTERNAL_FUNC
+
+ storage = cvCreateMemStorage(0);
+
+- faces = cvHaarDetectObjects(gray, cascade, storage, 1.1, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize(0, 0));
++ faces = cvHaarDetectObjects(gray, cascade, storage, 1.1, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize(0, 0), cvSize(0, 0));
+
+ if(return_type) {
+
diff --git a/facedetect-1.0.1.tar.gz b/facedetect-1.0.1.tar.gz
new file mode 100644
index 0000000..e95f452
--- /dev/null
+++ b/facedetect-1.0.1.tar.gz
Binary files differ
diff --git a/facedetect-dso-link-workaround.patch b/facedetect-dso-link-workaround.patch
new file mode 100644
index 0000000..715c5ae
--- /dev/null
+++ b/facedetect-dso-link-workaround.patch
@@ -0,0 +1,47 @@
+diff -ruN facedetect.orig/config.m4 facedetect/config.m4
+--- facedetect.orig/config.m4 2010-03-15 02:07:12.000000000 +0200
++++ facedetect/config.m4 2011-01-11 13:03:47.794020008 +0200
+@@ -25,20 +25,12 @@
+ PHP_ADD_INCLUDE($FACEDETECT_DIR/include)
+
+ AC_CHECK_HEADER([$FACEDETECT_DIR/include/opencv/cv.h], [], AC_MSG_ERROR('opencv/cv.h' header not found))
+- AC_CHECK_HEADER([$FACEDETECT_DIR/include/opencv/cvver.h], [], AC_MSG_ERROR('opencv/cvver.h' header not found))
+ AC_CHECK_HEADER([$FACEDETECT_DIR/include/opencv/highgui.h], [], AC_MSG_ERROR('opencv/highgui.h' header not found))
+
+- PHP_CHECK_LIBRARY(cv, cvLoad,
+- [
+- PHP_ADD_LIBRARY_WITH_PATH(cv, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(cvaux, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(highgui, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(cxcore, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+- AC_DEFINE(HAVE_FACEDETECT, 1, [ ])
+- ],[
+- AC_MSG_ERROR([wrong OpenCV version or OpenCV not found])
+- ],[
+- ])
++ PHP_ADD_LIBRARY_WITH_PATH(cv, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(cvaux, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(highgui, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(cxcore, $FACEDETECT_DIR/lib, FACEDETECT_SHARED_LIBADD)
+
+ PHP_SUBST(FACEDETECT_SHARED_LIBADD)
+ AC_DEFINE(HAVE_FACEDETECT, 1, [ ])
+diff -ruN facedetect.orig/facedetect.c facedetect/facedetect.c
+--- facedetect.orig/facedetect.c 2010-03-15 02:07:12.000000000 +0200
++++ facedetect/facedetect.c 2011-01-11 13:03:09.466030640 +0200
+@@ -21,7 +21,6 @@
+ #include "php_facedetect.h"
+
+ #include <opencv/cv.h>
+-#include <opencv/cvver.h>
+ #include <opencv/highgui.h>
+
+ /* {{{ facedetect_functions[]
+@@ -66,7 +65,6 @@
+ php_info_print_table_start();
+ php_info_print_table_row(2, "facedetect support", "enabled");
+ php_info_print_table_row(2, "facedetect version", PHP_FACEDETECT_VERSION);
+- php_info_print_table_row(2, "OpenCV version", CV_VERSION);
+ php_info_print_table_end();
+ }
+ /* }}} */
diff --git a/facedetect-php54.patch b/facedetect-php54.patch
new file mode 100644
index 0000000..62730ed
--- /dev/null
+++ b/facedetect-php54.patch
@@ -0,0 +1,12 @@
+diff -up facedetect/facedetect.c.php54 facedetect/facedetect.c
+--- facedetect/facedetect.c.php54 2011-12-28 16:07:45.167341320 +0100
++++ facedetect/facedetect.c 2011-12-28 16:08:01.979341725 +0100
+@@ -28,7 +28,7 @@
+ *
+ * Every user visible function must have an entry in facedetect_functions[].
+ */
+-static function_entry facedetect_functions[] = {
++static zend_function_entry facedetect_functions[] = {
+ PHP_FE(face_detect, NULL)
+ PHP_FE(face_count, NULL)
+ {NULL, NULL, NULL}
diff --git a/php-facedetect.spec b/php-facedetect.spec
new file mode 100644
index 0000000..d235a17
--- /dev/null
+++ b/php-facedetect.spec
@@ -0,0 +1,103 @@
+%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.1
+Release: 4%{?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-%{version}.tar.gz
+# patch to work around DSOlinkage issues introduced in F-13
+Patch1: facedetect-dso-link-workaround.patch
+# Fix code to work with opencv 2.2.0
+Patch2: facedetect-1.0.1-opencv-2.2.0.patch
+# https://github.com/infusion/PHP-Facedetect/pull/5
+Patch3: facedetect-php54.patch
+
+
+BuildRequires: php-devel opencv-devel >= 2.2.0
+Requires: opencv
+Requires: php(zend-abi) = %{php_zend_api}
+Requires: php(api) = %{php_core_api}
+
+%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
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1 -b .php54
+
+%{__cat} <<'EOF' >facedetect.ini
+extension=facedetect.so
+EOF
+sed -i 's/\r//' CREDITS
+
+%build
+phpize
+%configure
+make %{?_smp_mflags}
+
+%install
+make install INSTALL_ROOT=$RPM_BUILD_ROOT INSTALL="install -p"
+install -p -D -m0644 facedetect.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.d/facedetect.ini
+
+%check
+# No test provided by upstream, so
+# minimal load test for the PHP extension
+php -n \
+ -d extension_dir=modules \
+ -d extension=facedetect.so -m \
+ | grep facedetect
+
+%files
+%doc CREDITS
+%config(noreplace) %{_sysconfdir}/php.d/facedetect.ini
+%{php_extdir}/facedetect.so
+
+%changelog
+* Wed Dec 28 2011 Remi Collet <remi@fedoraproject.org> - 1.0.1-4
+- build against php 5.4
+- add patch for php 5.4
+- add minimal load test
+
+* Wed Aug 31 2011 Rex Dieter <rdieter@fedoraproject.org> 1.0.1-4
+- rebuild (opencv)
+
+* Tue May 10 2011 Tom Callaway <spot@fedoraproject.org> - 1.0.1-3
+- Clean up spec
+- Fix code to work with OpenCV 2.2.0
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Mon Jan 10 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.1-1
+- Bump up to latest upstream
+- Rebuild with new opencv
+
+* Wed Jun 30 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.0-6
+- Rebuild with new opencv
+
+* Mon Mar 04 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.0-5
+- Explicit requires opencv
+
+* Mon Mar 01 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.0-4
+- Patch to build with new DSO linkage Change
+- Rebuild with new opencv
+
+* Sun Nov 29 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 1.0.0-3
+- Rebuild with new opencv
+
+* 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