diff options
-rw-r--r-- | Makefile | 27 | ||||
-rw-r--r-- | multihash/__init__.py (renamed from __init__.py) | 4 | ||||
-rw-r--r-- | setup.py | 15 | ||||
-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/hash_wrapper.cpp b/src/hash_wrapper.cpp index a4173b9..a4173b9 100644 --- a/hash_wrapper.cpp +++ b/src/hash_wrapper.cpp |