makefile and supporting stuff
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 19 Sep 2013 21:30:37 +0000 (17:30 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 19 Sep 2013 21:30:37 +0000 (17:30 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
create-func.sql [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..9d22eb4
--- /dev/null
@@ -0,0 +1,2 @@
+*.o
+*.so
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..a8e3766
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+all:
+       gcc -fpic -I '/usr/include/postgresql/9.1/server/' -c tsrank.c
+       gcc -shared -o tsrank.so tsrank.o
+install:
+       cp tsrank.so /usr/local/lib
+       su postgres -c 'psql evergreen -f create-func.sql'
diff --git a/create-func.sql b/create-func.sql
new file mode 100644 (file)
index 0000000..247368a
--- /dev/null
@@ -0,0 +1 @@
+CREATE OR REPLACE FUNCTION ts_rank_eg(tsvector, tsquery) RETURNS real AS '/usr/local/lib/tsrank', 'ts_rankeg_tt' LANGUAGE C STRICT;