1 |
dpavlin |
8 |
dir=`pwd` |
2 |
|
|
code=pgswish |
3 |
|
|
|
4 |
|
|
all: pgswish install |
5 |
|
|
psql test < pgswish.sql |
6 |
|
|
psql -c "select * from pgswish('/foo/bar','a*','','','');" test |
7 |
|
|
# psql -c "begin ; select plperlswish('foo','"${dir}"/index/test', 'a* or b* or c*', '', '') ; select * from foo ; drop table foo" test |
8 |
|
|
# cat test.sql | sed "s,##dir##,${dir}," | psql test |
9 |
|
|
|
10 |
|
|
pgswish: |
11 |
|
|
cc -I`pg_config --includedir-server` -fpic -c ${code}.c |
12 |
|
|
cc -shared -lswish-e -o ${code}.so ${code}.o |
13 |
|
|
|
14 |
|
|
clean: |
15 |
|
|
rm -Rf index |
16 |
|
|
|
17 |
|
|
index: |
18 |
|
|
mkdir index |
19 |
|
|
swish-e -S fs -i . -f index/test |
20 |
|
|
|
21 |
|
|
install: ${code}.so |
22 |
|
|
sudo cp ${code}.so `pg_config --pkglibdir` |