From 7573f1c6eae056f13f140835c0ad79e06aa71166 Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 29 Aug 2005 15:58:28 +0000 Subject: [PATCH] separate REST gateway now compiles ... installation is untested git-svn-id: svn://svn.open-ils.org/ILS/trunk@1757 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/Makefile | 12 ++++- Open-ILS/src/apachemods/Makefile | 50 +++++++++++++++++-- .../src/apachemods/fieldmapper_lookup-gen.pl | 13 ++--- Open-ILS/src/apachemods/fieldmapper_lookup.h | 9 +--- Open-ILS/src/apachemods/mod_rest_gateway.c | 2 +- Open-ILS/src/apachemods/mod_rest_gateway.h | 2 +- OpenSRF/src/Makefile | 5 +- install.sh | 7 +-- 8 files changed, 71 insertions(+), 29 deletions(-) diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 7effd12f8e..59ed4c4a13 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -3,17 +3,25 @@ export LD_OPTS = -L $(TMPDIR) -L . export CC_OPTS = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \ -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(TMPDIR) -all: mod_xmltools +all: mod_xmltools mod_ils_rest_gateway install: perl-install web-install string-templates-install storage-bootstrap xsl-install -web-install: webcore-install autojs-install mod_xmltools-install +web-install: webcore-install autojs-install mod_xmltools-install mod_ils_rest_gateway-install # ----------------------------------------------------------------------------------- # Web stuff # ----------------------------------------------------------------------------------- +mod_ils_rest_gateway: + echo $@ + make -C apachemods mod_ils_rest_gateway.so + +mod_ils_rest_gateway-install: + echo $@ + make -C apachemods mod_ils_rest_gateway-install + mod_xmltools: echo $@ make -C apachemods mod_xmltools.so diff --git a/Open-ILS/src/apachemods/Makefile b/Open-ILS/src/apachemods/Makefile index da90b63a89..f634481266 100644 --- a/Open-ILS/src/apachemods/Makefile +++ b/Open-ILS/src/apachemods/Makefile @@ -5,9 +5,9 @@ LD_OPTS += -lxml2 -lc_utils -lxslt -all: mod_xmltools.so +all: mod_xmltools.so mod_ils_rest_gateway.so -install: mod_xmltools-install +install: mod_xmltools-install mod_ils_rest_gateway-install libfieldmapper-install mod_xmltools.so: apachetools.o xmltools.o mod_xmltools.c mod_xmltools.h echo $@ @@ -22,6 +22,49 @@ xmltools.o: xmltools.c xmltools.h echo $@ $(CC) -c $(CC_OPTS) xmltools.c -o $@ +fieldmapper_lookup.c: fieldmapper_lookup.h + ./fieldmapper_lookup-gen.pl fieldmapper_lookup.c + +json_xml.o: json_xml.c json_xml.h + echo $@ + $(CC) -c $(CC_OPTS) json_xml.c -o $@ + +fieldmapper_lookup.o: fieldmapper_lookup.c fieldmapper_lookup.h + echo $@ + $(CC) -c $(CC_OPTS) fieldmapper_lookup.c -o $@ + +libfieldmapper.so: fieldmapper_lookup.o + echo $@ + $(CC) $(LD_OPTS) -shared -W1 fieldmapper_lookup.o -o $@ + +libfieldmapper-install: libfieldmapper.so + echo installing libfieldmapper.so + mkdir -p $(INCLUDEDIR)/ + cp fieldmapper_lookup.h $(INCLUDEDIR)/ + cp libfieldmapper.so $(LIBDIR)/libfieldmapper.so + +ils_rest_gateway.o: mod_rest_gateway.c mod_rest_gateway.h fieldmapper_lookup.h + echo $@ + $(CC) -c $(CC_OPTS) mod_rest_gateway.c -o $@ + +mod_ils_rest_gateway.so: libfieldmapper.so ils_rest_gateway.o + echo $@ + $(CC) $(LD_OPTS) -shared -W1 ils_rest_gateway.o -lfieldmapper -o $@ + + +mod_ils_rest_gateway-install: + echo $@ + $(APXS2) -i -a -n mod_ils_rest_gateway mod_ils_rest_gateway.so + echo "-----------------------------------------------"; + echo -e "* Important * : Change httpd.conf from this: \n \ + LoadModule mod_ils_rest_gateway_module modules/mod_ils_rest_gateway.so \n \ + to this: \n \ + LoadModule mod_ils_rest_gateway modules/mod_ils_rest_gateway.so" + echo -e "Supported configuration options:\ + \nILSRestGatewayConfig \ + echo "-----------------------------------------------"; + echo "" + mod_xmltools-install: echo $@ $(APXS2) -i -a -n mod_xmltools mod_xmltools.so @@ -40,4 +83,5 @@ mod_xmltools-install: clean: echo $@ - /bin/rm -f *.o xmltools mod_xmltools.so + /bin/rm -f *.o xmltools mod_xmltools.so libfieldmapper.so mod_ils_rest_gateway.so + /bin/rm -f fieldmapper_lookup.c diff --git a/Open-ILS/src/apachemods/fieldmapper_lookup-gen.pl b/Open-ILS/src/apachemods/fieldmapper_lookup-gen.pl index 04a8480b7f..06ae767ea9 100755 --- a/Open-ILS/src/apachemods/fieldmapper_lookup-gen.pl +++ b/Open-ILS/src/apachemods/fieldmapper_lookup-gen.pl @@ -5,6 +5,7 @@ use lib '../perlmods/'; my $map = {}; eval " use lib '../perlmods/'; + use lib '../../../OpenSRF/src/perlmods/'; use OpenILS::Utils::Fieldmapper; "; $map = $Fieldmapper::fieldmap unless ($@); @@ -55,19 +56,19 @@ print SOURCE <{$object}->{hint}; - print SOURCE " else if (!strcmp(class, \"$short_name\")) return 1;"; + print SOURCE " else if (!strcmp(class, \"$short_name\")) return 1;\n"; } print SOURCE < #include -/* the JSON parser, so we can read the response we're XMLizing */ -#include "objson/object.h" -#include "objson/json_parser.h" -#include "utils.h" - int isFieldmapper(char*); -int fm_ntop(char*,char*); -char* fm_pton(char*,int); +char * fm_pton(char *, int); +int fm_ntop(char *, char *); diff --git a/Open-ILS/src/apachemods/mod_rest_gateway.c b/Open-ILS/src/apachemods/mod_rest_gateway.c index ec4a547143..e04de6b24e 100644 --- a/Open-ILS/src/apachemods/mod_rest_gateway.c +++ b/Open-ILS/src/apachemods/mod_rest_gateway.c @@ -1,4 +1,4 @@ -#include "mod_ils_gateway.h" +#include "mod_rest_gateway.h" char* ils_rest_gateway_config_file; diff --git a/Open-ILS/src/apachemods/mod_rest_gateway.h b/Open-ILS/src/apachemods/mod_rest_gateway.h index a60f4311aa..45fe84b21f 100644 --- a/Open-ILS/src/apachemods/mod_rest_gateway.h +++ b/Open-ILS/src/apachemods/mod_rest_gateway.h @@ -14,7 +14,7 @@ #include "objson/object.h" #include "objson/json_parser.h" -#include "rest_xml.h" +#include "json_xml.h" #define GATEWAY_CONFIG "ILSRestGatewayConfig" #define MODULE_NAME "ils_rest_gateway_module" #define CONFIG_CONTEXT "rest_gateway" diff --git a/OpenSRF/src/Makefile b/OpenSRF/src/Makefile index e5beefff2c..60ce608bb2 100644 --- a/OpenSRF/src/Makefile +++ b/OpenSRF/src/Makefile @@ -21,7 +21,7 @@ export CC_OPTS = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(TMPDIR) -all: prep router srfsh jserver gateway rest_gateway +all: prep router srfsh jserver gateway install: install-prep transport-install stack-install gateway-install \ router-install srfsh-install jserver-install perl-install \ @@ -58,9 +58,6 @@ srfsh: stack gateway: stack make -C gateway -rest_gateway: stack - make -e -C gateway rest_gateway - jserver: c_utils make -C jserver diff --git a/install.sh b/install.sh index 6633bf5772..ee4016f5f4 100755 --- a/install.sh +++ b/install.sh @@ -150,11 +150,7 @@ function runInstall { ;; "opensrf_gateway" ) - if building; then - $MAKE -C "$OPENSRFDIR" "gateway"; - $MAKE -C "$OPENSRFDIR" "rest_gateway"; - fi; - + if building; then $MAKE -C "$OPENSRFDIR" "gateway"; fi; if installing; then $MAKE -C "$OPENSRFDIR" "gateway-install"; fi; ;; @@ -185,6 +181,7 @@ function runInstall { "openils_web" ) if building; then $MAKE -C "$OPENILSDIR" "mod_xmltools"; fi; + if building; then $MAKE -C "$OPENILSDIR" "mod_ils_rest_gateway"; fi; if installing; then $MAKE -C "$OPENILSDIR" "web-install"; fi; ;; -- 2.43.2