In order to keep python-clamav in squeeze, I've agreed to take over maintainership (in the DPMT). I'm attaching the proposed diff for my upload to unstable for approval. The reason to convert to a patch system is so that the package will work with the DPMT svn layout. Please approve/let me know what else needs doing. Scott K P.S. Please cc me on any replies as I am not subscribed.
diff -Nru python-clamav-0.4.1/debian/changelog python-clamav-0.4.1/debian/changelog
--- python-clamav-0.4.1/debian/changelog 2010-09-22 16:25:24.000000000 -0400
+++ python-clamav-0.4.1/debian/changelog 2010-09-22 16:15:24.000000000 -0400
@@ -1,3 +1,19 @@
+python-clamav (0.4.1-2) unstable; urgency=low
+
+ * Agreed maintainer change to Debian Python Modules Team
+ - Add myself to uploaders
+ - Thanks to Cédric Delfosse for his work maintaining python-clamav
+ * Acknowledge NMU (Closes: #524645)
+ - Thanks to Imre Gergely
+ * Convert to source format 3.0 (Quilt) to add patch system
+ - Convert existing inline change to debian/patches/clamav-095-compat.patch
+ * Improve debian/copyright
+ * Add Homepage to debian/control and bump standards version to 3.9.1.0
+ without further change
+ * Remove obsolete debian/pycompat file
+
+ -- Scott Kitterman <scott@kitterman.com> Wed, 22 Sep 2010 12:30:43 -0400
+
python-clamav (0.4.1-1.1) unstable; urgency=low
* Non-maintainer upload.
diff -Nru python-clamav-0.4.1/debian/control python-clamav-0.4.1/debian/control
--- python-clamav-0.4.1/debian/control 2010-09-22 16:25:24.000000000 -0400
+++ python-clamav-0.4.1/debian/control 2010-09-21 12:52:43.000000000 -0400
@@ -1,9 +1,11 @@
Source: python-clamav
Section: python
Priority: optional
-Maintainer: Cédric Delfosse <cedric@debian.org>
+Maintainer: Debian Python Modules Team <debian-python@lists.debian.org>
+Uploaders: Scott Kitterman <scott@kitterman.com>
Build-Depends: debhelper (>= 5.0.37.2), libclamav-dev (>= 0.95), python (>= 2.3.5-11), python-support (>= 0.3), python-all-dev
-Standards-Version: 3.7.3
+Standards-Version: 3.9.1.0
+Homepage: http://xael.org/norman/python/pyclamav/index.html
Package: python-clamav
Architecture: any
diff -Nru python-clamav-0.4.1/debian/copyright python-clamav-0.4.1/debian/copyright
--- python-clamav-0.4.1/debian/copyright 2010-09-22 16:25:24.000000000 -0400
+++ python-clamav-0.4.1/debian/copyright 2010-09-22 16:09:24.000000000 -0400
@@ -3,7 +3,7 @@
It was downloaded from http://xael.org/norman/python/pyclamav/index.html
-Copyright Holder: Alexandre Norman <norman@freesurf.fr>
+Copyright Holder: © 2005 Alexandre Norman <norman@freesurf.fr>
License:
diff -Nru python-clamav-0.4.1/debian/patches/clamav-095-compat.patch python-clamav-0.4.1/debian/patches/clamav-095-compat.patch
--- python-clamav-0.4.1/debian/patches/clamav-095-compat.patch 1969-12-31 19:00:00.000000000 -0500
+++ python-clamav-0.4.1/debian/patches/clamav-095-compat.patch 2010-09-22 16:13:55.000000000 -0400
@@ -0,0 +1,128 @@
+Bug-Debian: http://bugs.debian.org/524645
+Reviewed-By: Michael Casadevall <mcasadevall@buildd.net>
+Last-Update: <2009-04-20>
+
+--- python-clamav-0.4.1.orig/pyclamav.c
++++ python-clamav-0.4.1/pyclamav.c
+@@ -33,25 +33,6 @@
+
+ /* ********************************************************* */
+
+-/* To be able to compile with
+- releases 0.75 of libclamav
+-
+- Where cl_free was cl_freetrie
+- and cl_build was cl_buildtrie
+- CL_SCAN_STDOPT did not exist
+-*/
+-#ifndef CL_SCAN_STDOPT
+-#define CL_SCAN_STDOPT CL_RAW | CL_ARCHIVE | CL_MAIL | CL_DISABLERAR | CL_OLE2 | CL_ENCRYPTED
+-void cl_free(struct cl_node *rootnode) {
+- cl_freetrie(rootnode);
+- return;
+-}
+-
+-int cl_build(struct cl_node *rootnode) {
+- return cl_buildtrie(rootnode);
+-}
+-#endif
+-
+ /* For python prior to 2.3 */
+ #ifndef PyMODINIT_FUNC
+ #define PyMODINIT_FUNC void
+@@ -68,11 +49,9 @@ static PyObject *PyclamavError;
+ unsigned int signumber = 0;
+
+ /* Structures for clamav */
+-struct cl_node *root = NULL;
+-struct cl_limits limits;
++struct cl_engine *engine = NULL;
+ struct cl_stat dbstat;
+
+-
+ /*
+ * If the virus database has been changed, then
+ * free the current tree and reload the new one
+@@ -85,22 +64,22 @@ int if_database_have_changed_then_reload
+ /* If yes : reload DB */
+ if (cl_statchkdir(&dbstat) == 1)
+ {
+- /* free the tree */
+- cl_free(root);
++ /* free the engine */
++ cl_engine_free(engine);
+ signumber=0;
+- root=NULL;
++ engine=NULL;
+
+ /* Load DB */
+- if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) {
++ if((ret = cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOPT)) != CL_SUCCESS) {
+ /* Raise exception with error message */
+ PyErr_SetString(PyclamavError, cl_strerror(ret));
+ return -2;
+ }
+
+- /* build the final tree */
+- if((ret = cl_build(root))) {
+- /* free the partial tree */
+- cl_free(root);
++ /* prepare the engine */
++ if((ret = cl_engine_compile(engine))) {
++ /* free the engine */
++ cl_engine_free(engine);
+ /* Raise exception with error message */
+ PyErr_SetString(PyclamavError, cl_strerror(ret));
+ return -2;
+@@ -231,7 +210,7 @@ static PyObject *pyclamav_scanfile(PyObj
+ return NULL;
+ }
+
+- ret = cl_scanfile(file_to_scan, &virname, &size, root, &limits, CL_SCAN_STDOPT);
++ ret = cl_scanfile(file_to_scan, &virname, &size, engine, CL_SCAN_STDOPT);
+
+ /* Test return code */
+ switch (ret) {
+@@ -278,17 +257,21 @@ PyMODINIT_FUNC initpyclamav(void)
+ /* Set documentation string for the module */
+ PyDict_SetItemString(dict, "__doc__", PyString_FromString("pyclamav :\n\n This is a python binding to the C libclamav library\n (from the Clamav project - http://www.clamav.net).\n It can be used to easily allow a Python script to scan\n a file or a buffer against known viruses.\n\nAuthor : Alexandre Norman [norman@xael.org]\n\nFunctions :\n - scanfile(string filename) : Scan a file for virus.\n - get_numsig() : Return the number of known signatures.\n - get_version() : Return the version of Clamav.\n - version() : Return the version of pyclamav.\n"));
+
++ /* initialize libclamav */
++ cl_init(CL_INIT_DEFAULT);
++ engine = cl_engine_new();
+
+- if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) {
++ if((ret = cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOPT))) {
+ /* Raise exception with error message */
+ PyErr_SetString(PyclamavError, cl_strerror(ret));
++ cl_engine_free(engine);
+ return;
+ }
+
+- /* build the final tree */
+- if((ret = cl_build(root))) {
+- /* free the partial tree */
+- cl_free(root);
++ /* prepare the engine */
++ if((ret = cl_engine_compile(engine)) != CL_SUCCESS) {
++ /* free up the engine resources */
++ cl_engine_free(engine);
+ /* Raise exception with error message */
+ PyErr_SetString(PyclamavError, cl_strerror(ret));
+ return;
+@@ -299,15 +282,6 @@ PyMODINIT_FUNC initpyclamav(void)
+ memset(&dbstat, 0, sizeof(struct cl_stat));
+ cl_statinidir(cl_retdbdir(), &dbstat);
+
+-
+-
+- /* set up archive limits */
+- memset(&limits, 0, sizeof(struct cl_limits));
+- limits.maxfiles = 1000; /* max files */
+- limits.maxfilesize = 10 * 1048576; /* maximal archived file size == 10 Mb */
+- limits.maxreclevel = 5; /* maximal recursion level */
+- limits.archivememlim = 0; /* disable memory limit for bzip2 scanner */
+-
+ return ;
+ }
+
diff -Nru python-clamav-0.4.1/debian/patches/series python-clamav-0.4.1/debian/patches/series
--- python-clamav-0.4.1/debian/patches/series 1969-12-31 19:00:00.000000000 -0500
+++ python-clamav-0.4.1/debian/patches/series 2010-09-22 16:10:16.000000000 -0400
@@ -0,0 +1 @@
+clamav-095-compat.patch
diff -Nru python-clamav-0.4.1/debian/pycompat python-clamav-0.4.1/debian/pycompat
--- python-clamav-0.4.1/debian/pycompat 2010-09-22 16:25:24.000000000 -0400
+++ python-clamav-0.4.1/debian/pycompat 1969-12-31 19:00:00.000000000 -0500
@@ -1 +0,0 @@
-2
diff -Nru python-clamav-0.4.1/debian/source/format python-clamav-0.4.1/debian/source/format
--- python-clamav-0.4.1/debian/source/format 1969-12-31 19:00:00.000000000 -0500
+++ python-clamav-0.4.1/debian/source/format 2010-09-22 16:25:24.000000000 -0400
@@ -0,0 +1 @@
+3.0 (quilt)
diff -Nru python-clamav-0.4.1/pyclamav.c python-clamav-0.4.1/pyclamav.c
--- python-clamav-0.4.1/pyclamav.c 2010-09-22 16:25:24.000000000 -0400
+++ python-clamav-0.4.1/pyclamav.c 2008-04-16 09:51:47.000000000 -0400
@@ -33,6 +33,25 @@
/* ********************************************************* */
+/* To be able to compile with
+ releases 0.75 of libclamav
+
+ Where cl_free was cl_freetrie
+ and cl_build was cl_buildtrie
+ CL_SCAN_STDOPT did not exist
+*/
+#ifndef CL_SCAN_STDOPT
+#define CL_SCAN_STDOPT CL_RAW | CL_ARCHIVE | CL_MAIL | CL_DISABLERAR | CL_OLE2 | CL_ENCRYPTED
+void cl_free(struct cl_node *rootnode) {
+ cl_freetrie(rootnode);
+ return;
+}
+
+int cl_build(struct cl_node *rootnode) {
+ return cl_buildtrie(rootnode);
+}
+#endif
+
/* For python prior to 2.3 */
#ifndef PyMODINIT_FUNC
#define PyMODINIT_FUNC void
@@ -49,9 +68,11 @@
unsigned int signumber = 0;
/* Structures for clamav */
-struct cl_engine *engine = NULL;
+struct cl_node *root = NULL;
+struct cl_limits limits;
struct cl_stat dbstat;
+
/*
* If the virus database has been changed, then
* free the current tree and reload the new one
@@ -64,22 +85,22 @@
/* If yes : reload DB */
if (cl_statchkdir(&dbstat) == 1)
{
- /* free the engine */
- cl_engine_free(engine);
+ /* free the tree */
+ cl_free(root);
signumber=0;
- engine=NULL;
+ root=NULL;
/* Load DB */
- if((ret = cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOPT)) != CL_SUCCESS) {
+ if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) {
/* Raise exception with error message */
PyErr_SetString(PyclamavError, cl_strerror(ret));
return -2;
}
- /* prepare the engine */
- if((ret = cl_engine_compile(engine))) {
- /* free the engine */
- cl_engine_free(engine);
+ /* build the final tree */
+ if((ret = cl_build(root))) {
+ /* free the partial tree */
+ cl_free(root);
/* Raise exception with error message */
PyErr_SetString(PyclamavError, cl_strerror(ret));
return -2;
@@ -210,7 +231,7 @@
return NULL;
}
- ret = cl_scanfile(file_to_scan, &virname, &size, engine, CL_SCAN_STDOPT);
+ ret = cl_scanfile(file_to_scan, &virname, &size, root, &limits, CL_SCAN_STDOPT);
/* Test return code */
switch (ret) {
@@ -257,21 +278,17 @@
/* Set documentation string for the module */
PyDict_SetItemString(dict, "__doc__", PyString_FromString("pyclamav :\n\n This is a python binding to the C libclamav library\n (from the Clamav project - http://www.clamav.net).\n It can be used to easily allow a Python script to scan\n a file or a buffer against known viruses.\n\nAuthor : Alexandre Norman [norman@xael.org]\n\nFunctions :\n - scanfile(string filename) : Scan a file for virus.\n - get_numsig() : Return the number of known signatures.\n - get_version() : Return the version of Clamav.\n - version() : Return the version of pyclamav.\n"));
- /* initialize libclamav */
- cl_init(CL_INIT_DEFAULT);
- engine = cl_engine_new();
- if((ret = cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOPT))) {
+ if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) {
/* Raise exception with error message */
PyErr_SetString(PyclamavError, cl_strerror(ret));
- cl_engine_free(engine);
return;
}
- /* prepare the engine */
- if((ret = cl_engine_compile(engine)) != CL_SUCCESS) {
- /* free up the engine resources */
- cl_engine_free(engine);
+ /* build the final tree */
+ if((ret = cl_build(root))) {
+ /* free the partial tree */
+ cl_free(root);
/* Raise exception with error message */
PyErr_SetString(PyclamavError, cl_strerror(ret));
return;
@@ -282,6 +299,15 @@
memset(&dbstat, 0, sizeof(struct cl_stat));
cl_statinidir(cl_retdbdir(), &dbstat);
+
+
+ /* set up archive limits */
+ memset(&limits, 0, sizeof(struct cl_limits));
+ limits.maxfiles = 1000; /* max files */
+ limits.maxfilesize = 10 * 1048576; /* maximal archived file size == 10 Mb */
+ limits.maxreclevel = 5; /* maximal recursion level */
+ limits.archivememlim = 0; /* disable memory limit for bzip2 scanner */
+
return ;
}
Attachment:
signature.asc
Description: This is a digitally signed message part.