[packages/php-clamav] new, version 0.13

glen glen at pld-linux.org
Wed May 28 18:48:51 CEST 2014


commit f14dbe6f3f5132f243be7820078ed3a21c5df12a
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed May 28 19:47:38 2014 +0300

    new, version 0.13
    
    based on src.rpm from mandriva
    ftp://ftp.pl.freebsd.org/vol/rzm2/linux-mandriva/official/2009.1/SRPMS/contrib/release/php-clamav-0.13-11mdv2009.1.src.rpm

 php-clamav.spec                          | 80 ++++++++++++++++++++++++++++++++
 php-clamavlib-clamav-0.93_build_fix.diff | 62 +++++++++++++++++++++++++
 php-clamavlib-clamav-0.94_build_fix.diff | 21 +++++++++
 3 files changed, 163 insertions(+)
---
diff --git a/php-clamav.spec b/php-clamav.spec
new file mode 100644
index 0000000..28456c4
--- /dev/null
+++ b/php-clamav.spec
@@ -0,0 +1,80 @@
+%define		php_name	php%{?php_suffix}
+%define		modname		clamav
+Summary:	Provides a interface to ClamAV for PHP
+Name:		%{php_name}-%{modname}
+Version:	0.13
+Release:	0.1
+License:	PHP License
+Group:		Development/Languages/PHP
+Source0:	php-clamavlib-%{version}.tar.gz
+# Source0-md5:	5ccb9daa8ed4181a9fafae5dd9297395
+Patch0:		php-clamavlib-clamav-0.93_build_fix.diff
+Patch1:		php-clamavlib-clamav-0.94_build_fix.diff
+URL:		http://phpclamavlib.org/
+BuildRequires:	clamav-devel
+BuildRequires:	%{php_name}-devel
+BuildRequires:	rpmbuild(macros) >= 1.666
+%{?requires_php_extension}
+Provides:	php(MODULE_NAME) = %{version}
+Requires:	clamav
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+PHP ClamaAV Lib is a PHP extension that allows to incorporate virus
+scanning features in your PHP scripts. It uses the Clam Antivirus API
+(libclamav) for virus scanning.
+
+%prep
+%setup -q -n php-clamavlib-%{version}
+%patch0 -p0
+%patch1 -p0
+
+%build
+phpize
+%configure
+%{__make}
+
+%if %{with tests}
+# simple module load test
+%{__php} -n -q \
+	-d extension_dir=modules \
+	-d extension=%{modname}.so \
+	-m > modules.log
+grep %{modname} modules.log
+
+export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+%{__make} test \
+	PHP_EXECUTABLE=%{__php}
+%endif
+
+%install
+%{__make} install \
+	EXTENSION_DIR=%{php_extensiondir} \
+	INSTALL_ROOT=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
+; Enable %{modname} extension module
+extension=%{modname}.so
+
+[clamav]
+clamav.dbpath="/var/lib/clamav"
+clamav.maxreclevel=0
+clamav.maxfiles=0
+clamav.archivememlim=0
+clamav.maxfilesize=0
+EOF
+
+%post
+%php_webserver_restart
+
+%postun
+if [ "$1" = 0 ]; then
+	%php_webserver_restart
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES CREDITS EXPERIMENTAL INSTALL clamav.php
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{modname}.so
diff --git a/php-clamavlib-clamav-0.93_build_fix.diff b/php-clamavlib-clamav-0.93_build_fix.diff
new file mode 100644
index 0000000..ccb7193
--- /dev/null
+++ b/php-clamavlib-clamav-0.93_build_fix.diff
@@ -0,0 +1,62 @@
+--- clamav.c	2007-09-25 17:50:25.000000000 +0200
++++ clamav.c.oden	2008-04-18 09:55:26.000000000 +0200
+@@ -112,9 +112,6 @@ PHP_INI_BEGIN()
+     STD_PHP_INI_ENTRY("clamav.maxfilesize", "0", PHP_INI_ALL, OnUpdateLong, 
+ 					  maxfilesize, zend_clamav_globals, clamav_globals)
+ 
+-    STD_PHP_INI_ENTRY("clamav.maxratio", "200", PHP_INI_ALL, OnUpdateLong, 
+-					  maxratio, zend_clamav_globals, clamav_globals)
+-
+ PHP_INI_END()
+ /* }}} */
+ 
+@@ -127,7 +124,6 @@ static void php_clamav_init_globals(zend
+ 	clamav_globals->maxfiles      = 0;
+ 	clamav_globals->archivememlim = 0;
+ 	clamav_globals->maxfilesize   = 0;
+-	clamav_globals->maxratio      = 0;
+ }
+ /* }}} */
+ 
+@@ -161,7 +157,6 @@ PHP_MINIT_FUNCTION(clamav)
+ 	limits.maxfiles      = CLAMAV_G(maxfiles); 		/* max files */	
+ 	limits.maxfilesize   = CLAMAV_G(maxfilesize);	/* maximal archived file size */
+ 	limits.maxreclevel   = CLAMAV_G(maxreclevel);	/* maximal recursion level */
+-	limits.maxratio      = CLAMAV_G(maxratio);		/* maximal compression ratio */
+ 	limits.archivememlim = CLAMAV_G(archivememlim);	/* disable memory limit for bzip2 scanner */
+ 
+ 	/*  Register ClamAV scan options, they're also availible inside
+@@ -406,12 +401,11 @@ PHP_FUNCTION(cl_scanfile)
+ PHP_FUNCTION(cl_setlimits)
+ {
+ 	/* number of arguments */
+-	const int NUM_ARGS	= 5;
++	const int NUM_ARGS	= 4;
+ 	
+ 	int maxfiles;
+ 	int maxfilesize;
+ 	int maxreclevel;
+-	int maxratio;
+ 	int archivememlim;
+ 
+ 	/* argument checking */
+@@ -421,9 +415,9 @@ PHP_FUNCTION(cl_setlimits)
+ 	}
+ 
+ 	/* argument parsing */
+-	if (zend_parse_parameters(NUM_ARGS TSRMLS_CC, "lllll", 
++	if (zend_parse_parameters(NUM_ARGS TSRMLS_CC, "llll", 
+ 							  &maxfiles, &maxfilesize,
+-							  &maxreclevel, &maxratio, 
++							  &maxreclevel, 
+ 							  &archivememlim ) == FAILURE) 
+ 		return FAILURE;
+ 	
+@@ -432,7 +426,6 @@ PHP_FUNCTION(cl_setlimits)
+ 	limits.maxfiles      = maxfiles; 		/* max files */	
+ 	limits.maxfilesize   = maxfilesize;		/* maximal archived file size */
+ 	limits.maxreclevel   = maxreclevel;		/* maximal recursion level */
+-	limits.maxratio      = maxratio;		/* maximal compression ratio */
+ 	limits.archivememlim = archivememlim;	/* disable memory limit for bzip2 scanner */
+ 
+ 	RETURN_TRUE;	
diff --git a/php-clamavlib-clamav-0.94_build_fix.diff b/php-clamavlib-clamav-0.94_build_fix.diff
new file mode 100644
index 0000000..81ca87a
--- /dev/null
+++ b/php-clamavlib-clamav-0.94_build_fix.diff
@@ -0,0 +1,21 @@
+--- clamav.c	2008-09-04 15:07:25.000000000 +0200
++++ clamav.c.oden	2008-09-04 15:06:49.000000000 +0200
+@@ -219,8 +219,6 @@ PHP_MINIT_FUNCTION(clamav)
+                             CONST_CS | CONST_PERSISTENT);
+     REGISTER_LONG_CONSTANT("CL_ETMPFILE", CL_ETMPFILE,
+                             CONST_CS | CONST_PERSISTENT);
+-    REGISTER_LONG_CONSTANT("CL_EFSYNC", CL_EFSYNC,
+-                            CONST_CS | CONST_PERSISTENT);
+     REGISTER_LONG_CONSTANT("CL_EMEM", CL_EMEM,
+                             CONST_CS | CONST_PERSISTENT);
+     REGISTER_LONG_CONSTANT("CL_EOPEN", CL_EOPEN,
+@@ -547,9 +545,6 @@ PHP_FUNCTION(cl_pretcode)
+ 		case CL_ETMPFILE:
+ 			RETURN_STRING("tmpfile() failed", 1);
+ 			break;
+-		case CL_EFSYNC:
+-			RETURN_STRING("fsync() failed", 1);
+-			break;
+ 		case CL_EMEM:
+ 			RETURN_STRING("memory allocation error", 1);
+ 			break;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-clamav.git/commitdiff/f14dbe6f3f5132f243be7820078ed3a21c5df12a



More information about the pld-cvs-commit mailing list