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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
ERL_FLAGS="-smp enable" ./rebar compile eunit verbose=1
Expand All @@ -7,14 +17,17 @@ clean: distclean
./rebar clean

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

distdir:
$(if $(findstring tip,$(INNOSTORE_TAG)),$(error "You can't generate a release tarball from tip"))
mkdir distdir
hg clone -u $(INNOSTORE_TAG) . distdir/innostore-clone
git clone "git://github.com/basho/innostore" 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
cd distdir; \
Expand Down
10 changes: 7 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ innostore for storage.
2. In the =innostore= directory, build it:
: $ make

3. Install innostore ...
3. Install innostore (may need root privs)...
1. Option 1: ... into your Erlang distribution:
: $ 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:
: $ RIAK=/usr/lib/riak make install

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

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

0 comments on commit a0f1adb

Please sign in to comment.