rpms/python-igraph/devel python-igraph-authors.diff, NONE, 1.1 python-igraph-memory.diff, NONE, 1.1 python-igraph-parse.diff, NONE, 1.1 python-igraph.diffs, NONE, 1.1 python-igraph.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Neal Becker (nbecker) fedora-extras-commits at redhat.com
Fri Feb 15 18:15:56 UTC 2008


Author: nbecker

Update of /cvs/pkgs/rpms/python-igraph/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9839/devel

Modified Files:
	.cvsignore sources 
Added Files:
	python-igraph-authors.diff python-igraph-memory.diff 
	python-igraph-parse.diff python-igraph.diffs 
	python-igraph.spec 
Log Message:
initial import


python-igraph-authors.diff:

--- NEW FILE python-igraph-authors.diff ---
--- /dev/null	2008-01-24 16:15:45.571010753 -0500
+++ AUTHORS	2008-01-24 19:26:55.000000000 -0500
@@ -0,0 +1,2 @@
+Author: Tamas Nepusz
+Author-email: ntamas at rmki.kfki.hu

python-igraph-memory.diff:

--- NEW FILE python-igraph-memory.diff ---
--- /dev/null	2008-01-24 05:55:04.569465027 -0500
+++ src/memory.h	2008-01-24 10:40:36.000000000 -0500
@@ -0,0 +1,49 @@
+/* -*- mode: C -*-  */
+/* 
+   IGraph library.
+   Copyright (C) 2003, 2004, 2005  Gabor Csardi <csardi at rmki.kfki.hu>
+   MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA 
+   02110-1301 USA
+
+*/
+
+#ifndef REST_MEMORY_H
+#define REST_MEMORY_H
+
+#include <stdlib.h>
+
+#undef __BEGIN_DECLS
+#undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */
+#endif
+
+__BEGIN_DECLS
+
+#define Calloc(n,t)    (t*) calloc( (size_t)(n), sizeof(t) )
+#define Realloc(p,n,t) (t*) realloc((void*)(p), (size_t)((n)*sizeof(t)))
+#define Free(p)        (free( (void *)(p) ), (p) = NULL)
+
+int igraph_free(void *p);
+
+__END_DECLS
+
+#endif

python-igraph-parse.diff:

--- NEW FILE python-igraph-parse.diff ---
--- src/graphobject.c.orig	2008-01-01 13:12:18.000000000 -0500
+++ src/graphobject.c	2008-01-24 16:22:49.000000000 -0500
@@ -210,11 +210,11 @@
                             PyObject * args, PyObject * kwds)
 {
   char *kwlist[] = { "n", "edges", "directed", NULL };
-  int n = 1;
+  long n = 1;
   PyObject *edges = NULL, *dir = Py_False;
   igraph_vector_t edges_vector;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO!O!", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|lO!O!", kwlist,
                                    &n, &PyList_Type, &edges,
                                    &PyBool_Type, &dir))
     return -1;
@@ -704,13 +704,13 @@
   long v1, v2;
   igraph_integer_t result;
   PyObject *directed = Py_False;
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ii|O", kwlist, &v1, &v2,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ll|O", kwlist, &v1, &v2,
                                    &directed))
     return NULL;
   if (igraph_get_eid(&self->g, &result, v1, v2, PyObject_IsTrue(directed)))
     return igraphmodule_handle_igraph_error();
 
-  return Py_BuildValue("i", (long)result);
+  return Py_BuildValue("l", (long)result);
 }
 
 /** \ingroup python_interface_graph
@@ -1756,7 +1756,7 @@
 
   char *kwlist[] = { "n", "class", "directed", NULL };
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ii|O", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ll|O", kwlist,
                                    &n, &isoclass, &directed))
     return NULL;
 
@@ -3523,7 +3523,6 @@
   Py_RETURN_NONE;
 }
 
-
 /** \ingroup python_interface_graph
  * \function igraphmodule_Graph_to_directed
  * \brief Converts an undirected graph to a directed one.
@@ -3837,7 +3836,7 @@
 
   char *kwlist[] = { "f", "index", NULL };
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", kwlist, &fname, &index))
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|l", kwlist, &fname, &index))
     return NULL;
 
   f = fopen(fname, "r");
@@ -4640,12 +4639,12 @@
   char *kwlist[] = { "vid", "mode", NULL };
   long vid;
   PyObject *l1, *l2, *l3, *result;
-  igraph_neimode_t mode = IGRAPH_OUT;
+  int mode = IGRAPH_OUT;
   igraph_vector_t vids;
   igraph_vector_t layers;
   igraph_vector_t parents;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwlist, &vid, &mode))
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "l|i", kwlist, &vid, &mode))
     return NULL;
   if (vid < 0 || vid > igraph_vcount(&self->g)) {
     PyErr_SetString(PyExc_ValueError, "invalid vertex id");
@@ -4662,7 +4661,7 @@
     PyErr_SetString(PyExc_MemoryError, "not enough memory");
   }
   if (igraph_bfs
-      (&self->g, (igraph_integer_t) vid, mode, &vids, &layers, &parents)) {
+      (&self->g, (igraph_integer_t) vid, (igraph_neimode_t) mode, &vids, &layers, &parents)) {
     igraphmodule_handle_igraph_error();
     return NULL;
   }
@@ -4709,7 +4708,7 @@
   long vid1 = -1, vid2 = -1;
   igraph_integer_t v1, v2;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ii|O", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ll|O", kwlist,
                                    &vid1, &vid2, &capacity_object))
     return NULL;
 
@@ -4744,7 +4743,7 @@
   long vid1 = -1, vid2 = -1;
   long n;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iiO", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|llO", kwlist,
                                    &vid1, &vid2, &capacity_object))
     return NULL;
 
@@ -4819,7 +4818,7 @@
   long int i, j, n;
   igraph_vector_ptr_t result;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ll", kwlist,
                                    &min_size, &max_size))
     return NULL;
 
@@ -4974,7 +4973,7 @@
   long int i, j, n;
   igraph_vector_ptr_t result;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ll", kwlist,
                                    &min_size, &max_size))
     return NULL;
 
@@ -5137,7 +5136,7 @@
   igraph_vector_t result;
   PyObject *o;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i", kwlist, &mode))
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|l", kwlist, &mode))
     return NULL;
 
   if (igraph_vector_init(&result, igraph_vcount(&self->g)))
@@ -5222,7 +5221,7 @@
   igraph_matrix_t *mptr = 0;
   igraph_matrix_t m;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|lO", kwlist,
 	  &n, &return_merges)) {
     return NULL;
   }
@@ -5277,7 +5276,7 @@
   igraph_matrix_t *mptr = 0;
   igraph_matrix_t m;
 
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist,
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|lO", kwlist,
 	  &n, &return_merges)) {
     return NULL;
   }


--- NEW FILE python-igraph.diffs ---
diff --git a/config.h b/config.h
new file mode 100644
--- /dev/null
+++ b/config.h
@@ -0,0 +1,1 @@
+#define VERSION "0.4.5"
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -76,22 +76,22 @@ def igraph_version():
     except:
 	raise Exception, "igraph source code not found"
     
-try:
-    detect_igraph_source()
-except:
-    print "An error happened while trying to find igraph source!"
-    print "Consider downloading the C source code of the igraph library and "
-    print "put the contents of the src subdirectory and config.h in "
-    print "subdirectory called igraph."
-    exit(1)
+## try:
+##     detect_igraph_source()
+## except:
+##     print "An error happened while trying to find igraph source!"
+##     print "Consider downloading the C source code of the igraph library and "
+##     print "put the contents of the src subdirectory and config.h in "
+##     print "subdirectory called igraph."
+##     exit(1)
 
 module_sources=glob.glob(os.path.join('src', '*.c'))
 sources=glob.glob(os.path.join('igraph', '*.c'))
 sources.extend(module_sources)
 
-include_dirs=['igraph', '.']
+include_dirs=['/usr/include/igraph', '.']
 library_dirs=[]
-libraries=[]
+libraries=['igraph']
 
 line, exit_code = get_output("xml2-config --version")
 if exit_code>0:
@@ -117,7 +117,7 @@ pure Python-based graph packages around.
 pure Python-based graph packages around."""
 
 setup(name = 'igraph',
-      version = igraph_version(),
+      version = '0.4.5',
       description = 'High performance graph data structures and algorithms',
       long_description = description,
       license = 'GNU General Public License (GPL)',


--- NEW FILE python-igraph.spec ---
%{!?python_archlib: %define python_archlib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:		python-igraph
Version:	0.4.5
Release:	7%{?dist}
Summary:	Python bindings for igraph

Group:		Development/Languages
License:	GPLv2+
URL:		http://pypi.python.org/pypi/igraph/0.4.5
Source0:	python-igraph-0.4.5.tar.gz
Patch0:		python-igraph.diffs
Patch1:		python-igraph-parse.diff
Patch2:		python-igraph-memory.diff
Patch3:		python-igraph-authors.diff
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	python-devel python-setuptools igraph-devel gcc libxml2-devel
Requires:	python igraph libxml2

%description
This module extends Python with a Graph class which is capable of
handling arbitrary directed and undirected graphs with thousands of
nodes and millions of edges. Since the module makes use of the open
source igraph library written in almost 100% pure C, it is blazing
fast and outperforms most other pure Python-based graph packages
around.

%prep
%setup -q -a0 -c
echo $PWD
cd igraph-%{version}
rm -rf igraph
%patch0 -p1
%patch1 -p0
%patch2 -p0
%patch3 -p0


%build
cd igraph-%{version}
%{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
cd igraph-%{version}
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

 
%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc igraph-%{version}/LICENSE igraph-%{version}/AUTHORS
%{python_archlib}/igraph
%{python_archlib}/igraph-%{version}-py*.egg-info
%{_bindir}/igraph

%changelog
* Thu Jan 24 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-7
- Add AUTHORS

* Thu Jan 24 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-6
- More patches from upstream

* Thu Jan 24 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-5
- try memory patch

* Thu Jan 24 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-4
- patch2

* Thu Jan 24 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-3
- Got patch from upstream

* Thu Jan 24 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-2
- Add BR gcc
- BR libxml2-devel, Req libxml2

* Wed Jan 23 2008 Neal Becker <ndbecker2 at gmail.com> - 0.4.5-1
- Initial package



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/python-igraph/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	15 Feb 2008 17:11:42 -0000	1.1
+++ .cvsignore	15 Feb 2008 18:15:00 -0000	1.2
@@ -0,0 +1 @@
+python-igraph-0.4.5.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/python-igraph/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	15 Feb 2008 17:11:42 -0000	1.1
+++ sources	15 Feb 2008 18:15:00 -0000	1.2
@@ -0,0 +1 @@
+0cac31e94e0d44cb2ffd5dea5d9ac695  python-igraph-0.4.5.tar.gz




More information about the fedora-extras-commits mailing list