Permalink
Browse files

Changed from Hg to Git in the Makefile. Fixed install rule for Makefi…

…le. Added .gitignore. Updated README.org with correct text for installing.
  • Loading branch information...
1 parent 7041710 commit a0f1adb037eba1caba29b2fd36638943c3d06b5b @massung massung committed Sep 19, 2011
Showing with 30 additions and 7 deletions.
  1. +6 −0 .gitignore
  2. +17 −4 Makefile
  3. +7 −3 README.org
View
@@ -0,0 +1,6 @@
+.eunit/
+ebin/
+embedded_innodb-*/
+c_src/innodb/lib/
+c_src/innostore_drv.o
+priv/innostore_drv.so
View
@@ -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
@@ -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; \
View
@@ -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=:

0 comments on commit a0f1adb

Please sign in to comment.