summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzyp <zyp@localhost>2006-05-08 15:23:20 +0200
committerzyp <zyp@localhost>2006-05-08 15:23:20 +0200
commitdf9c15d40a50ed17baa7bdbb11ef6cca9d410cf3 (patch)
tree4ceb64d5c29e6bf487f8a6e7dde655a2c0b5f26a
parent3a5b32f44a95b989e39273527fc924ad3d32465e (diff)
[project @ zyp-20060508132320-2c118d1a7e2505db]
[project @ 24] Converted from make to distutils.
-rw-r--r--Makefile27
-rw-r--r--multihash/__init__.py (renamed from __init__.py)4
-rw-r--r--setup.py15
-rw-r--r--src/crc32.cpp (renamed from crc32.cpp)0
-rw-r--r--src/crc32.h (renamed from crc32.h)0
-rw-r--r--src/ed2k.cpp (renamed from ed2k.cpp)0
-rw-r--r--src/ed2k.h (renamed from ed2k.h)0
-rw-r--r--src/hash.cpp (renamed from hash.cpp)0
-rw-r--r--src/hash.h (renamed from hash.h)0
-rw-r--r--src/hash_wrapper.cpp (renamed from hash_wrapper.cpp)0
10 files changed, 17 insertions, 29 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 0d897d0..0000000
--- a/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-CC=gcc
-CFLAGS=
-CPP=g++
-CPPFLAGS=
-LD=gcc
-LDFLAGS=-shared
-
-OBJECTS=hash_wrapper.o hash.o crc32.o ed2k.o
-TARGET=_hash.so
-INCLUDE=-I /usr/include/python2.4/
-LIB=-l boost_python -l ssl
-
-all: $(TARGET)
-
-clean:
- -rm $(TARGET) $(OBJECTS)
-
-# Mål-regel
-$(TARGET): $(OBJECTS) Makefile
- $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIB)
-
-# Pseudoregler
-%.o: %.c Makefile
- $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE)
-
-%.o: %.cpp Makefile
- $(CPP) $(CPPFLAGS) -o $@ -c $< $(INCLUDE) \ No newline at end of file
diff --git a/__init__.py b/multihash/__init__.py
index 0333819..5bcf4d5 100644
--- a/__init__.py
+++ b/multihash/__init__.py
@@ -1,7 +1,7 @@
-from _hash import *
+from _multihash import *
def file_hash(name):
- h = Hash()
+ h = Multihash()
f = open(name)
data = f.read(32768)
while data:
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..cea2803
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+import os
+from distutils.core import setup, Extension
+
+setup(
+ name='multihash',
+ packages = ['multihash'],
+ ext_modules=[
+ Extension('multihash._multihash',
+ ['src/' + x for x in os.listdir('src') if x.endswith('.cpp')],
+ include_dirs = [],
+ library_dirs = [],
+ libraries = ["boost_python", "ssl"],
+ extra_compile_args = [])])
diff --git a/crc32.cpp b/src/crc32.cpp
index 55d6dd2..55d6dd2 100644
--- a/crc32.cpp
+++ b/src/crc32.cpp
diff --git a/crc32.h b/src/crc32.h
index 646ccce..646ccce 100644
--- a/crc32.h
+++ b/src/crc32.h
diff --git a/ed2k.cpp b/src/ed2k.cpp
index 92e7b15..92e7b15 100644
--- a/ed2k.cpp
+++ b/src/ed2k.cpp
diff --git a/ed2k.h b/src/ed2k.h
index 1be7302..1be7302 100644
--- a/ed2k.h
+++ b/src/ed2k.h
diff --git a/hash.cpp b/src/hash.cpp
index d844c46..d844c46 100644
--- a/hash.cpp
+++ b/src/hash.cpp
diff --git a/hash.h b/src/hash.h
index 3c7b9c9..3c7b9c9 100644
--- a/hash.h
+++ b/src/hash.h
diff --git a/hash_wrapper.cpp b/src/hash_wrapper.cpp
index a4173b9..a4173b9 100644
--- a/hash_wrapper.cpp
+++ b/src/hash_wrapper.cpp