diff --git a/Makefile b/Makefile index ce91e69..613a8a6 100755 --- a/Makefile +++ b/Makefile @@ -1,15 +1,12 @@ all: zipfile.node install: - cd deps/libzip-0.9.3; make; cd ../../ node-waf -v build install zipfile.node: - cd deps/libzip-0.9.3; make; cd ../../ node-waf -v build clean: - cd deps/libzip-0.9.3; make clean distclean; cd ../../ node-waf -v clean distclean uninstall: diff --git a/configure b/configure index 19a0b93..d153015 100755 --- a/configure +++ b/configure @@ -1,11 +1,3 @@ #!/bin/sh -cd deps/ -# internal libzip -if ! test -e libzip-0.9.3; then - tar xvf libzip-0.9.3.tar.bz2 -fi -cd libzip-0.9.3 -CFLAGS='-fPIC' ./configure --disable-dependency-tracking --enable-static --disable-shared -cd ../../ node-waf configure $@ \ No newline at end of file diff --git a/package.json b/package.json index 39727a1..de5020a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "zipfile", - "version" : "0.1.4", + "version" : "0.1.5", "main" : "./lib/index.js", "description" : "C++ library for handling zipfiles in node", "keywords" : ["zipfile", "uncompress", "unzip", "zlib"], diff --git a/src/_zipfile.cc b/src/_zipfile.cc index 48c2dfb..27b0092 100644 --- a/src/_zipfile.cc +++ b/src/_zipfile.cc @@ -19,7 +19,7 @@ extern "C" { ZipFile::Initialize(target); // node-zipfile version - target->Set(String::NewSymbol("version"), String::New("0.1.4")); + target->Set(String::NewSymbol("version"), String::New("0.1.5")); // versions of deps Local versions = Object::New(); diff --git a/wscript b/wscript index 1d7fda7..bd2f879 100644 --- a/wscript +++ b/wscript @@ -34,9 +34,20 @@ def set_options(opt): , dest='shared_libzip' ) +def configure_libzip(): + if not Options.options.shared_libzip: + Utils.pprint('GREEN','configuring internal libzip dep') + os.chdir('deps') + if not os.path.exists('libzip-0.9.3'): + os.system('tar xvf libzip-0.9.3.tar.bz2') + os.chdir('libzip-0.9.3') + os.system("CFLAGS='-fPIC' ./configure --disable-dependency-tracking --enable-static --disable-shared") + os.chdir('../../') + def configure(conf): conf.check_tool("compiler_cxx") conf.check_tool("node_addon") + configure_libzip() libzip_includes = [] libzip_libpath = [] @@ -119,8 +130,15 @@ def configure(conf): #ldflags = [] #conf.env.append_value("LDFLAGS", ldflags) +def build_libzip(): + if not Options.options.shared_libzip: + os.chdir('deps/libzip-0.9.3') + os.system('make') + os.chdir('../../') + def build(bld): obj = bld.new_task_gen("cxx", "shlib", "node_addon", install_path=None) + build_libzip() obj.cxxflags = ["-DNDEBUG", "-O3", "-g", "-Wall", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"] obj.target = TARGET obj.source = "src/_zipfile.cc" @@ -133,9 +151,16 @@ def build(bld): bin_dir = bld.path.find_dir('./bin') bld.install_files('${PREFIX}/bin', bin_dir.ant_glob('*'), cwd=bin_dir, relative_trick=True, chmod=0755) +def clean_libzip(): + if not Options.options.shared_libzip: + os.chdir('deps/libzip-0.9.3') + os.system('make clean distclean') + os.chdir('../../') + def shutdown(): if Options.commands['clean']: if exists(TARGET): unlink(TARGET) + clean_libzip() if Options.commands['clean']: if exists(dest): unlink(dest)