From 44c60a4b24f8a5d82231240c3474748c0b390f21 Mon Sep 17 00:00:00 2001 From: Masatoshi Teruya Date: Sat, 4 Feb 2012 11:51:38 +0900 Subject: [PATCH] change: install process --- lib/ossp_uuid.js => index.js | 4 +-- install.sh | 49 +++++++++++++++++++++++++++++++++++- package.json | 7 ++---- wscript | 25 ++---------------- 4 files changed, 54 insertions(+), 31 deletions(-) rename lib/ossp_uuid.js => index.js (88%) diff --git a/lib/ossp_uuid.js b/index.js similarity index 88% rename from lib/ossp_uuid.js rename to index.js index fffe123..d27d908 100644 --- a/lib/ossp_uuid.js +++ b/index.js @@ -2,9 +2,9 @@ binding to oosp-uuid author: masatoshi teruya email: mah0x211@gmail.com - copyright (C) 2011, masatoshi teruya. all rights reserved. + (C) Masatoshi Teruya */ -module.exports = require( __dirname + '/../build/default/uuid_binding'); +module.exports = require( __dirname + '/build/default/uuid_binding'); module.exports.BIN = 0; /* binary representation (import/export) */ module.exports.STR = 1; /* string representation (import/export) */ module.exports.SIV = 2; /* single integer value (import/export) */ diff --git a/install.sh b/install.sh index 272e04e..c5b65e4 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,51 @@ #!/bin/sh -node-waf configure $@ +set -e + +CWD=`pwd` +MOD_LIBS="${CWD}/libs" +MOD_DEPEND="${CWD}/depend" +LIB_UUID='uuid-1.6.2' + +if [ ! -d ${MOD_LIBS} ]; then + echo "mkdir ${MOD_LIBS}" + mkdir ${MOD_LIBS} +fi + +echo "cd ${MOD_LIBS}" +cd ${MOD_LIBS} + +if [ ! -d "${LIB_UUID}" -a ! -f "${LIB_UUID}.tar.gz" ]; then + echo "wget ftp://ftp.ossp.org/pkg/lib/uuid/${LIB_UUID}.tar.gz" + wget ftp://ftp.ossp.org/pkg/lib/uuid/${LIB_UUID}.tar.gz + if [ ! -f "${LIB_UUID}.tar.gz" ]; then + exit -1; + fi +fi + +if [ -f "${LIB_UUID}.tar.gz" ]; then + echo "tar xvzf ./${LIB_UUID}.tar.gz" + tar xvzf "${LIB_UUID}.tar.gz" + rm ${LIB_UUID}.tar.gz +fi + +echo "cd ${LIB_UUID}" +cd ${LIB_UUID} + +# configure +CONFIGURE="--prefix=${MOD_DEPEND}" +echo "./configure ${CONFIGURE}" +./configure ${CONFIGURE} + +echo "make" +make +echo "make check" +make check +echo "make install" +make install +echo "cd ${CWD}"; +cd ${CWD} +echo "rm -rf ${MOD_LIBS}"; + +node-waf configure node-waf build diff --git a/package.json b/package.json index bb7c511..e08222f 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,8 @@ ], "description": "OSSP uuid bindings for node.js", "homepage": "http://github.com/mah0x211/node-ossp-uuid", - "version" : "0.0.6", - "main" : "./lib/ossp_uuid", - "directories" : { - "lib" : "./lib" - }, + "version" : "0.0.7", + "main" : "./index.js", "scripts" : { "install" : "./install.sh" }, diff --git a/wscript b/wscript index 288197c..29d6143 100644 --- a/wscript +++ b/wscript @@ -12,22 +12,6 @@ def set_options(opt): opt.tool_options('compiler_cxx') opt.tool_options('compiler_cc') opt.tool_options('misc') - - opt.add_option( '--ossp-uuid-includes' - , action='store' - , type='string' - , default=False - , help='Directory containing libev header files' - , dest='uuid_includes' - ) - - opt.add_option( '--ossp-uuid' - , action='store' - , type='string' - , default=False - , help='Link to a shared uuid libraries' - , dest='uuid' - ) def configure(conf): conf.check_tool('compiler_cxx') @@ -37,13 +21,8 @@ def configure(conf): conf.check_tool('node_addon') o = Options.options - - if o.uuid_includes: - conf.env.append_value("CPPFLAGS", '-I%s' % o.uuid_includes) - - if o.uuid: - conf.env.append_value("LDFLAGS", '-L%s' % o.uuid) - # conf.env.append_value("LINKFLAGS", '-L%s' % o.uuid) + conf.env.append_value("CPPFLAGS", '-I./depend/include') + conf.env.append_value("LDFLAGS", '-L./depend/lib') # print conf.env