Merge the following patches from Kevin Beswick:
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 17 Jul 2008 18:15:09 +0000 (18:15 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 17 Jul 2008 18:15:09 +0000 (18:15 +0000)
  * fixed location to copy apachetools.h from ...
  * another typo...
  * fixed directory error in copying of header file.
  * move one more copy instruction for a header file.
  * create the perldir and jsdir
  * changed the place where headers are copied... fixed an error which caused them to be copied wrong.
  * fixed a capitalization typo issue in src/Makefile.am
  * updated opensrf.xml.example to use C math and dbmath implementation rather than Perl
  * fixed make distcheck problems -- builddir needed to be changed to srcdir
  * fixed directory replacement in .c file problem stopped the command added in the previous revision from running multiple times, fixed the location of the file to execute the command on.
  * changed where the directory replacement happens for osrf_json_gateway.c (it was after it was compiled rather than before)
  * corrected another error with installing header files ( can't install directories recursively through the 'prefix_PRIMARY = files' apparently)
  * went back to old way of copying perlmods and javascript. it will still be included in dist due to EXTRA_DIST in root makefile
  * fix install of src/javascript and src/perlmods
  * nobase_dist_lib_DATA defined twice... oops!
  * fixed problem with order of execution of targets (install-data-local was being executed before files were copied. resulted in an error)
  * fixed make dist, and changed ways that files are copied to their installed locations
  * fixed path substitution for the rest of the files with hardcoded paths to ensure correct default functionality of opensrf

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1367 9efc2488-bf62-4759-914b-345cdb29e865

15 files changed:
Makefile.am
bin/osrf_config.in
configure.ac
doc/dokuwiki-doc-stubber.pl
examples/math_bench.pl
examples/multisession-test.pl
examples/opensrf.xml.example
src/Makefile.am
src/c-apps/Makefile.am
src/gateway/osrf_json_gateway.c
src/java/Makefile.am [moved from src/java/Makefile.in with 95% similarity]
src/libopensrf/Makefile.am
src/perlmods/OpenSRF/Utils/Config.pm
src/python/Makefile.am [new file with mode: 0644]
src/python/Makefile.in [deleted file]

index 17da835..6cea90a 100644 (file)
@@ -23,15 +23,93 @@ export APR_HEADERS              = @APR_HEADERS@
 export ETCDIR                   = @sysconfdir@
 export APXS2                    = @APXS2@
 export APACHE2_HEADERS          = @APACHE2_HEADERS@
-export DEF_CFLAGS              = -D_LARGEFILE64_SOURCE $(MAYBE_DEBUG) -pipe -g -Wall -O2 -fPIC -I@abs_top_builddir@/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) @INCLUDES@
+export DEF_CFLAGS              = -D_LARGEFILE64_SOURCE $(MAYBE_DEBUG) -pipe -g -Wall -O2 -fPIC -I@abs_top_srcdir@/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) @INCLUDES@
 export DEF_LDLIBS              = -lobjson -lopensrf
 export VAR                     = @localstatedir@
 export PID                     = @localstatedir@/run/opensrf
 export SOCK                    = @localstatedir@/lock/opensrf
 export LOG                     = @localstatedir@/log/opensrf
+export srcdir                  = @srcdir@
 
 AM_CFLAGS = $(DEF_CFLAGS)
 
+DOC_FILES = doc/Application-HOWTO.txt \
+           doc/dokuwiki-doc-stubber.pl \
+           doc/OpenSRF-Messaging-Protocol.html \
+           doc/Persist-API.html \
+           doc/Roadmap.txt
+
+EXAMPLES_FILES = examples/fieldmapper2cdbi.xsl \
+                examples/fieldmapper2javascript.xsl \
+                examples/fieldmapper2perl.xsl \
+                examples/gen-fieldmapper.xml \
+                examples/math_bench.pl \
+                examples/multisession-test.pl \
+                examples/register.pl \
+                examples/srfsh_config.xsd \
+                examples/math_xul_client/math \
+                examples/math_xul_client/install.js
+
+strn_compat_FILES = src/ports/strn_compat/strndup.c \
+                   src/ports/strn_compat/strndup.h \
+                   src/ports/strn_compat/strnlen.c \
+                   src/ports/strn_compat/strnlen.h
+
+python_FILES = src/python/opensrf.py \
+              src/python/setup.py \
+              src/python/srfsh.py \
+              src/python/osrf
+
+java_FILES = src/java/deps.inc \
+            src/java/deps.sh \
+            src/java/org
+
+libosrf_FILES = src/libopensrf/basic_client.c \
+               src/libopensrf/osrf_big_hash.c \
+               src/libopensrf/osrf_big_list.c \
+               src/libopensrf/osrfConfig.c
+
+
+EXTRA_DIST = $(DOC_FILES) $(EXAMPLES_FILES) $(libosrf_FILES) $(strn_compat_FILES) $(python_FILES) $(java_FILES) autogen.sh src/extras src/gateway/fieldmapper-c-xml-out.pl DCO-1.1.txt LICENSE.txt src/perlmods src/javascript
+
+objsonincludedir = @includedir@/objson
+opensrfincludedir = @includedir@/opensrf
+
+OBJINC=@srcdir@/include/objson
+OSRFINC=@srcdir@/include/opensrf
+
+opensrfinclude_HEADERS = $(OSRFINC)/log.h \
+                               $(OSRFINC)/md5.h \
+                               $(OSRFINC)/osrf_application.h \
+                               $(OSRFINC)/osrf_app_session.h \
+                               $(OSRFINC)/osrf_big_hash.h \
+                               $(OSRFINC)/osrf_big_list.h \
+                               $(OSRFINC)/osrf_cache.h \
+                               $(OSRFINC)/osrfConfig.h \
+                               $(OSRFINC)/osrf_hash.h \
+                               $(OSRFINC)/osrf_json.h \
+                               $(OSRFINC)/osrf_json_utils.h \
+                               $(OSRFINC)/osrf_json_xml.h \
+                               $(OSRFINC)/osrf_legacy_json.h \
+                               $(OSRFINC)/osrf_list.h \
+                               $(OSRFINC)/osrf_message.h \
+                               $(OSRFINC)/osrf_prefork.h \
+                               $(OSRFINC)/osrf_settings.h \
+                               $(OSRFINC)/osrf_stack.h \
+                               $(OSRFINC)/osrf_system.h \
+                               $(OSRFINC)/osrf_transgroup.h \
+                               $(OSRFINC)/sha.h \
+                               $(OSRFINC)/socket_bundle.h \
+                               $(OSRFINC)/string_array.h \
+                               $(OSRFINC)/transport_client.h \
+                               $(OSRFINC)/transport_message.h \
+                               $(OSRFINC)/transport_session.h \
+                               $(OSRFINC)/utils.h \
+                               $(OSRFINC)/xml_utils.h
+
+objsoninclude_HEADERS = $(OBJINC)/json2xml.h $(OBJINC)/json_parser.h $(OBJINC)/object.h $(OBJINC)/xml2json.h
+
+
 SUBDIRS = src
 
 jserver:
@@ -43,3 +121,6 @@ jserver-install:
 javascript-install:
        make -s -C src javascript-install
 
+install-data-hook:
+       mv @srcdir@/src/gateway/apachetools.h @includedir@/opensrf/apachetools.h
+
index ce2f69c..bf16852 100644 (file)
@@ -50,6 +50,14 @@ function showAll {
         showInstalled;
 }
 
+function cconfig {
+        
+sed -i 's|SYSCONFDIR|@sysconfdir@|g' '@srcdir@/src/gateway/osrf_json_gateway.c'
+sed -i 's|${prefix}|@prefix@|g' '@srcdir@/src/gateway/osrf_json_gateway.c'
+sed -i 's|osrf|@abs_top_srcdir@/src/python/osrf|g' '@srcdir@/src/python/setup.py'
+sed -i 's|srfsh\.py|@abs_top_srcdir@/src/python/srfsh.py|g' '@srcdir@/src/python/setup.py'
+}
+
 function showHelp {
         echo 
         echo "------------------------------------------------------------"
@@ -81,6 +89,8 @@ case "$1" in
      --installed)
                showInstalled;
                ;;
+     --cconfig) cconfig;
+               ;;
      --libxml)
                echo @LIBXML2_HEADERS@;
                ;;
index 836fb8d..4a5d23e 100644 (file)
@@ -28,6 +28,7 @@ AC_PREFIX_DEFAULT([/opensrf/])
 
 
 AC_SUBST(prefix)
+AC_SUBST(sysconfdir)
 
 
 AC_DEFUN([AC_PYTHON_MOD],[
@@ -274,6 +275,8 @@ AC_CONFIG_FILES([Makefile
 
 AC_OUTPUT
 
+bin/osrf_config --cconfig
+
 AC_MSG_RESULT([])
 AC_MSG_RESULT([--------------------- Configuration options:  -----------------------])
 
index 0182745..c098cc8 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-use OpenSRF::System qw(/openils/conf/opensrf_core.xml);
+use OpenSRF::System qw(SYSCONFDIR/opensrf_core.xml);
 use Getopt::Long
 
 $| = 1;
index f83e0fc..6dd94ac 100755 (executable)
@@ -13,7 +13,7 @@ my $count = $ARGV[0];
 print "usage: $0 <num_requests>\n" and exit unless $count;
 
 # * connect to the Jabber network
-OpenSRF::System->bootstrap_client( config_file => "/openils/conf/opensrf_core.xml" );
+OpenSRF::System->bootstrap_client( config_file => "SYSCONFDIR/opensrf_core.xml" );
 $log->set_service('math_bench');
 
 # * create a new application session for the opensrf.math service
index 21c0c99..01ad495 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-use lib '/openils/lib/perl5/';
+use lib 'LIBDIR/perl5/';
 use OpenSRF::System;
 use OpenILS::Application::AppUtils;
 use OpenILS::Event;
index 91198f9..3b0ec67 100644 (file)
@@ -44,7 +44,7 @@ vim:et:ts=2:sw=2:
         <servers>
 
           <!-- memcached server ip:port -->
-          <server>localhost:11211</server>
+          <server>127.0.0.1:10101</server>
 
         </servers>
 
@@ -131,8 +131,8 @@ vim:et:ts=2:sw=2:
       <opensrf.math>
         <keepalive>3</keepalive>
         <stateless>1</stateless>
-        <language>perl</language>
-        <implementation>OpenSRF::Application::Demo::Math</implementation>
+        <language>c</language>
+        <implementation>libosrf_math.so</implementation>
         <max_requests>97</max_requests>
         <unix_config>
           <unix_sock>opensrf.math_unix.sock</unix_sock>
@@ -149,8 +149,8 @@ vim:et:ts=2:sw=2:
       <opensrf.dbmath>
         <keepalive>3</keepalive>
         <stateless>1</stateless>
-        <language>perl</language>
-        <implementation>OpenSRF::Application::Demo::MathDB</implementation>
+        <language>c</language>
+        <implementation>libosrf_dbmath.so</implementation>
         <max_requests>99</max_requests>
         <unix_config>
           <max_requests>1000</max_requests>
@@ -166,13 +166,13 @@ vim:et:ts=2:sw=2:
 
       <opensrf.settings>
         <keepalive>1</keepalive>
-        <stateless>1</stateless>
+        <stateless>0</stateless>
         <language>perl</language>
         <implementation>OpenSRF::Application::Settings</implementation>
         <max_requests>17</max_requests>
         <unix_config>
           <unix_sock>opensrf.settings_unix.sock</unix_sock>
-          <unix_pid>opensrf.settings_unix.pid</unix_pid>
+          <unix_pid>opoensrf.settings_unix.pid</unix_pid>
           <max_requests>1000</max_requests>
           <unix_log>opensrf.settings_unix.log</unix_log>
           <min_children>5</min_children>
index 7056aea..f16796e 100644 (file)
@@ -18,11 +18,11 @@ export TMPDIR       = $(TMP)
 export OPENSRF = opensrf
 export BINDIR  = @bindir@
 export LIBDIR  = @libdir@
-export PERLDIR = $(LIBDIR)/perl5
-export JSDIR   = $(LIBDIR)/javascript
+perldir        = $(LIBDIR)/perl5
+jsdir = $(LIBDIR)/javascript
 export INCLUDEDIR= @includedir@
 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
-
+etcdir = $(ETCDIR)
 
 
 AM_LDFLAGS = $(DEF_LDFLAGS)
@@ -43,30 +43,36 @@ endif
 
 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
 
-install-data-local:
+dist_bin_SCRIPTS = ../bin/osrf_ctl.sh
+bin_SCRIPTS = ../bin/osrf_config
+
+dist_etc_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
+
+install-exec-local:
        mkdir -p $(VAR)
        mkdir -p $(PID)
        mkdir -p $(LOG)
        mkdir -p $(SOCK)
-       mkdir -p $(JSDIR)
-       mkdir -p $(PERLDIR)
        mkdir -p $(ETCDIR)
-       cp -r ../include/opensrf $(INCLUDEDIR)
-       mv $(BINDIR)/opensrf $(BINDIR)/opensrf-c
-       cp ../bin/osrf_config $(BINDIR)
-       cp ../bin/osrf_ctl.sh $(BINDIR)
-       cp ../examples/opensrf.xml.example $(ETCDIR)
-       cp ../examples/opensrf_core.xml.example $(ETCDIR)
-       cp ../examples/srfsh.xml.example $(ETCDIR)
+       mkdir -p $(jsdir)
+       mkdir -p $(perldir)
+
+install-data-hook:
+       ln -s $(BINDIR)/opensrf $(BINDIR)/opensrf-c
        sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/opensrf.xml.example'
        sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/opensrf.xml.example'
        sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/opensrf_core.xml.example'
        sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/opensrf_core.xml.example'
        sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/srfsh.xml.example'
        sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/srfsh.xml.example'
-       cp -r ../include/objson $(INCLUDEDIR)
-       cp -r javascript/* $(JSDIR)/
-       cp -r perlmods/* $(PERLDIR)/
-       mv $(INCLUDEDIR)/apachetools.h $(INCLUDEDIR)/opensrf/apachetools.h
+       sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/examples/math_bench.pl'
+       sed -i 's|LIBDIR|$(LIBDIR)|g' '@abs_top_srcdir@/examples/multisession-test.pl'
+       sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/doc/dokuwiki-doc-stubber.pl'
+       cp -r @srcdir@/javascript/* $(jsdir)/
+       sed -i 's|LOCALSTATEDIR|$(VAR)|g' '@srcdir@/perlmods/OpenSRF/Utils/Config.pm'
+       cp -r @srcdir@/perlmods/* $(perldir)/
 
 
+uninstall-hook:
+       rm $(INCLUDEDIR)/opensrf/apachetools.h
+       rm $(bindir)/opensrf-c
index c07df0d..9cd583e 100644 (file)
@@ -26,11 +26,3 @@ libosrf_math_la_SOURCES = osrf_math.c
 libosrf_math_la_LIBADD = -lobjson -lopensrf
 libosrf_version_la_SOURCES = osrf_version.c 
 libosrf_version_la_LIBADD = -lobjson -lopensrf
-
-## rename libraries (libtool requires the prefix lib, but we dont use that here)
-## remove extra library files created by libtool
-install-exec-hook:
-       cp $(LIBDIR)/libosrf_math.so $(LIBDIR)/osrf_math.so
-       cp $(LIBDIR)/libosrf_dbmath.so $(LIBDIR)/osrf_dbmath.so
-       cp $(LIBDIR)/libosrf_version.so $(LIBDIR)/osrf_version.so       
-       rm $(LIBDIR)/libosrf*
index 2921c6b..162e3ac 100644 (file)
@@ -18,7 +18,7 @@
 #define JSON_PROTOCOL "OSRFGatewayLegacyJSON"
 #define GATEWAY_USE_LEGACY_JSON 1
 
-#define GATEWAY_DEFAULT_CONFIG "/openils/conf/opensrf_core.xml"
+#define GATEWAY_DEFAULT_CONFIG "SYSCONFDIR/opensrf_core.xml"
 
 
 /* our config structure */
similarity index 95%
rename from src/java/Makefile.in
rename to src/java/Makefile.am
index a420f98..07d5fa1 100644 (file)
@@ -10,7 +10,7 @@ JAVA_SRC = \
 
 #------------------------------------------------------------------
 
-all:   verify_deps dirs jar
+all-local:     verify_deps dirs jar
 
 verify_deps:
        @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(WSTX)" ]; then echo -e "\nmissing dependency $(WSTX)!\n" && exit 1; fi
@@ -47,13 +47,10 @@ docs:
        javadoc -classpath $(JAVA_LIBS) -d doc @files;
        rm files;
 
-install:
+install-data-local:
        mkdir -p $(LIBDIR)/java
        cp opensrf.jar $(LIBDIR)/java
 
-clean: 
-       rm -fr opensrf.jar $(JAVA_LIBDIR)
-
 dep_clean:
        rm -rf deps
 
index a6129c7..68b46e7 100644 (file)
@@ -16,7 +16,7 @@ AM_CFLAGS = $(DEF_CFLAGS) -DASSUME_STATELESS  -DOSRF_STRICT_PARAMS -rdynamic -fn
 AM_LDFLAGS = $(DEF_LDFLAGS)
 LDADD = -lxml2 -ldl -lmemcache -lopensrf -lobjson
 
-export OSRF_INC = @abs_top_builddir@/include/opensrf/
+OSRF_INC = @top_srcdir@/include/opensrf
 
 TARGS =                osrf_message.c \
                        osrf_app_session.c \
@@ -78,19 +78,15 @@ JSON_DEP =          osrf_list.c\
                        md5.c\
                        string_array.c
 
-JSON_TARGS_HEADS =             $(OSRF_INC)/osrf_json_object.h\
-                               $(OSRF_INC)/osrf_json_parser.h \
-                               $(OSRF_INC)/osrf_json_tools.h \
-                               $(OSRF_INC)/osrf_legacy_json.h \
-                               $(OSRF_INC)/osrf_json_xml.h
-
-JSON_DEP_HEADS =       $(OSRF_INC)/osrf_list.h\
-                       $(OSRF_INC)/osrf_hash.h\
-                       $(OSRF_INC)/utils.h\
-                       $(OSRF_INC)/log.h\
-                       $(OSRF_INC)/md5.h\
-                       $(OSRF_INC)/string_array.h
+JSON_TARGS_HEADS =     $(OSRF_INC)/osrf_legacy_json.h \
+                       $(OSRF_INC)/osrf_json_xml.h
 
+JSON_DEP_HEADS =       $(OSRF_INC)/osrf_list.h \
+                       $(OSRF_INC)/osrf_hash.h \
+                       $(OSRF_INC)/utils.h \
+                       $(OSRF_INC)/log.h \
+                       $(OSRF_INC)/md5.h \
+                       $(OSRF_INC)/string_array.h
 
 noinst_PROGRAMS = osrf_json_test
 
index 6dfd5e4..b01cad2 100755 (executable)
@@ -153,7 +153,7 @@ Given an OpenSRF configuration file named F<opensrf_core.xml> with the following
        <router>otherhost</router>
       </routers>
 
-      <logfile>/openils/var/log/osrfsys.log</logfile>
+      <logfile>LOCALSTATEDIR/log/osrfsys.log</logfile>
     </opensrf>
   </config>
 
@@ -163,7 +163,7 @@ with the following structure:
   {
     router_name => 'router',
     routers => ['localhost', 'otherhost'],
-    logfile => '/openils/var/log/osrfsys.log'
+    logfile => 'LOCALSTATEDIR/log/osrfsys.log'
   }
 
 You can retrieve any of these values by name from the bootstrap section of C<$config_obj>; for example:
diff --git a/src/python/Makefile.am b/src/python/Makefile.am
new file mode 100644 (file)
index 0000000..00b9e48
--- /dev/null
@@ -0,0 +1,13 @@
+# makefile for OpenSRF Python modules and scripts
+
+all-local:
+       @echo $@
+       python @srcdir@/setup.py build
+
+# ------------------------------------------------------------------------------
+# INSTALL
+# ------------------------------------------------------------------------------
+install-data-local:    
+       @echo $@
+       python @srcdir@/setup.py install
+
diff --git a/src/python/Makefile.in b/src/python/Makefile.in
deleted file mode 100644 (file)
index 4a3061d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# makefile for OpenSRF Python modules and scripts
-
-all: build
-
-# ------------------------------------------------------------------------------
-# BUILD
-# ------------------------------------------------------------------------------
-build:
-       @echo $@
-       python setup.py build
-
-# ------------------------------------------------------------------------------
-# INSTALL
-# ------------------------------------------------------------------------------
-install:       build
-       @echo $@
-       python setup.py install
-
-# ------------------------------------------------------------------------------
-# CLEAN        
-# ------------------------------------------------------------------------------
-clean:
-       python setup.py clean --all
-