Skip to content

Commit

Permalink
change: install process
Browse files Browse the repository at this point in the history
  • Loading branch information
mah0x211 committed Feb 4, 2012
1 parent cdfd4ec commit 44c60a4
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 31 deletions.
4 changes: 2 additions & 2 deletions lib/ossp_uuid.js → index.js
Expand Up @@ -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) */
Expand Down
49 changes: 48 additions & 1 deletion 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
7 changes: 2 additions & 5 deletions package.json
Expand Up @@ -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"
},
Expand Down
25 changes: 2 additions & 23 deletions wscript
Expand Up @@ -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')
Expand All @@ -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

Expand Down

0 comments on commit 44c60a4

Please sign in to comment.