Skip to content

Commit

Permalink
Changed from Hg to Git in the Makefile. Fixed install rule for Makefi…
Browse files Browse the repository at this point in the history
…le. Added .gitignore. Updated README.org with correct text for installing.
  • Loading branch information
Jeffrey Massung committed Sep 19, 2011
1 parent 7041710 commit a0f1adb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
.eunit/
ebin/
embedded_innodb-*/
c_src/innodb/lib/
c_src/innostore_drv.o
priv/innostore_drv.so
21 changes: 17 additions & 4 deletions Makefile
@@ -1,4 +1,14 @@
INNOSTORE_TAG = $(shell hg identify -t)
# make sure there's a target location to install to
ifeq ($(RIAK),)
RIAK = "$(OTPROOT)"
endif

# get the latest tag from git
INNOSTORE_TAG = $(shell git describe --tags | head -n 1)
INSTALL_ERR = "$(RIAK) doesn't exist or isn't writable."
TARGET_ERR = "Error: no target location defined - set RIAK or OTPROOT"
INSTALL_MSG = "Installing to $(RIAK)/lib..."


all: # Innostore only works with the SMP runtime, force it on uniprocessors all: # Innostore only works with the SMP runtime, force it on uniprocessors
ERL_FLAGS="-smp enable" ./rebar compile eunit verbose=1 ERL_FLAGS="-smp enable" ./rebar compile eunit verbose=1
Expand All @@ -7,14 +17,17 @@ clean: distclean
./rebar clean ./rebar clean


install: install:
./rebar install @[ "$(RIAK)" == "" ] && echo "$(TARGET_ERR)" && exit 2 || echo "$(INSTALL_MSG)"
@[ -w "$(RIAK)" ] && cp -r `pwd` "$(RIAK)/lib" || echo "$(INSTALL_ERR)"
@:


distdir: distdir:
$(if $(findstring tip,$(INNOSTORE_TAG)),$(error "You can't generate a release tarball from tip")) $(if $(findstring tip,$(INNOSTORE_TAG)),$(error "You can't generate a release tarball from tip"))
mkdir distdir mkdir distdir
hg clone -u $(INNOSTORE_TAG) . distdir/innostore-clone git clone "git://github.com/basho/innostore" distdir/innostore-clone
cd distdir/innostore-clone; \ cd distdir/innostore-clone; \
hg archive ../$(INNOSTORE_TAG) git checkout $(INNOSTORE_TAG); \
git archive --format=tar -o ../$(INNOSTORE_TAG) $(INNOSTORE_TAG)


dist $(INNOSTORE_TAG).tar.gz: distdir dist $(INNOSTORE_TAG).tar.gz: distdir
cd distdir; \ cd distdir; \
Expand Down
10 changes: 7 additions & 3 deletions README.org
Expand Up @@ -18,14 +18,18 @@ innostore for storage.
2. In the =innostore= directory, build it: 2. In the =innostore= directory, build it:
: $ make : $ make


3. Install innostore ... 3. Install innostore (may need root privs)...
1. Option 1: ... into your Erlang distribution: 1. Option 1: ... into your Erlang distribution:
: $ make install : $ make install

This will install innostore to $OTPROOT/lib, so be sure you have
it set in your environment.


2. Option 2: ... into an existing Riak build: 2. Option 2: ... into an existing Riak build:
: $ RIAK=/usr/lib/riak make install


: ** Use rebar to install into your Riak lib directory This will allow you to custom install innostore into the lib
: $ ./rebar install target=$RIAK/lib folder that Riak is using.


4. Finally, configure riak to use innostore in =app.config= by setting 4. Finally, configure riak to use innostore in =app.config= by setting
the =storage_backend=. Change =riak/etc/app.config=: the =storage_backend=. Change =riak/etc/app.config=:
Expand Down

0 comments on commit a0f1adb

Please sign in to comment.