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:
javascript-install:
make -s -C src javascript-install
+install-data-hook:
+ mv @srcdir@/src/gateway/apachetools.h @includedir@/opensrf/apachetools.h
+
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 "------------------------------------------------------------"
--installed)
showInstalled;
;;
+ --cconfig) cconfig;
+ ;;
--libxml)
echo @LIBXML2_HEADERS@;
;;
AC_SUBST(prefix)
+AC_SUBST(sysconfdir)
AC_DEFUN([AC_PYTHON_MOD],[
AC_OUTPUT
+bin/osrf_config --cconfig
+
AC_MSG_RESULT([])
AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
#!/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;
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
#!/usr/bin/perl
-use lib '/openils/lib/perl5/';
+use lib 'LIBDIR/perl5/';
use OpenSRF::System;
use OpenILS::Application::AppUtils;
use OpenILS::Event;
<servers>
<!-- memcached server ip:port -->
- <server>localhost:11211</server>
+ <server>127.0.0.1:10101</server>
</servers>
<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>
<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>
<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>
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)
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
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*
#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 */
--- /dev/null
+JAVAC=javac -J-Xmx256m
+JAVA=java -Xmx256m
+JAVA_LIBDIR = .lib
+JAVA_LIBS = .:$(OSRF_JAVA_DEPSDIR)/$(WSTX):$(OSRF_JAVA_DEPSDIR)/$(STAX):$(OSRF_JAVA_DEPSDIR)/$(MEMCACHE):$(OSRF_JAVA_DEPSDIR)/$(JSON)
+JAVA_SRC = \
+ org/opensrf/net/xmpp/*.java \
+ org/opensrf/util/*.java \
+ org/opensrf/*.java \
+ org/opensrf/test/*.java
+
+#------------------------------------------------------------------
+
+all-local: verify_deps dirs jar
+
+verify_deps:
+ @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(WSTX)" ]; then echo -e "\nmissing dependency $(WSTX)!\n" && exit 1; fi
+ @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(STAX)" ]; then echo -e "\nmissing dependency $(STAX)!\n" && exit 1; fi
+ @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(MEMCACHE)" ]; then echo -e "\nmissing dependency $(MEMCACHE)!\n" && exit 1; fi
+ @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(JSON)" ]; then echo -e "\nmissing dependency $(JSON)!\n" && exit 1; fi
+
+dirs:
+ mkdir -p $(JAVA_LIBDIR)
+
+opensrf:
+ $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1
+
+jar: opensrf
+ rm -f opensrf.jar
+ jar cf opensrf.jar -C $(JAVA_LIBDIR) org
+
+# only prints the first 30 lines of errors
+slim:
+ mkdir -p $(JAVA_LIBDIR)
+ $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
+ @echo -e "\nTruncating at 30 lines"
+
+check:
+ mkdir -p $(JAVA_LIBDIR)
+ $(JAVAC) -Xlint:unchecked -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
+ @echo -e "\nTruncating at 30 lines"
+
+run:
+ $(JAVA) -cp $(JAVA_LIBS):opensrf.jar $(JAVA_EXE) $(JAVA_ARGS)
+
+docs:
+ find . -name *.java > files;
+ javadoc -classpath $(JAVA_LIBS) -d doc @files;
+ rm files;
+
+install-data-local:
+ mkdir -p $(LIBDIR)/java
+ cp opensrf.jar $(LIBDIR)/java
+
+dep_clean:
+ rm -rf deps
+
+
+++ /dev/null
-JAVAC=javac -J-Xmx256m
-JAVA=java -Xmx256m
-JAVA_LIBDIR = .lib
-JAVA_LIBS = .:$(OSRF_JAVA_DEPSDIR)/$(WSTX):$(OSRF_JAVA_DEPSDIR)/$(STAX):$(OSRF_JAVA_DEPSDIR)/$(MEMCACHE):$(OSRF_JAVA_DEPSDIR)/$(JSON)
-JAVA_SRC = \
- org/opensrf/net/xmpp/*.java \
- org/opensrf/util/*.java \
- org/opensrf/*.java \
- org/opensrf/test/*.java
-
-#------------------------------------------------------------------
-
-all: verify_deps dirs jar
-
-verify_deps:
- @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(WSTX)" ]; then echo -e "\nmissing dependency $(WSTX)!\n" && exit 1; fi
- @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(STAX)" ]; then echo -e "\nmissing dependency $(STAX)!\n" && exit 1; fi
- @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(MEMCACHE)" ]; then echo -e "\nmissing dependency $(MEMCACHE)!\n" && exit 1; fi
- @if [ ! -e "$(OSRF_JAVA_DEPSDIR)/$(JSON)" ]; then echo -e "\nmissing dependency $(JSON)!\n" && exit 1; fi
-
-dirs:
- mkdir -p $(JAVA_LIBDIR)
-
-opensrf:
- $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1
-
-jar: opensrf
- rm -f opensrf.jar
- jar cf opensrf.jar -C $(JAVA_LIBDIR) org
-
-# only prints the first 30 lines of errors
-slim:
- mkdir -p $(JAVA_LIBDIR)
- $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
- @echo -e "\nTruncating at 30 lines"
-
-check:
- mkdir -p $(JAVA_LIBDIR)
- $(JAVAC) -Xlint:unchecked -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
- @echo -e "\nTruncating at 30 lines"
-
-run:
- $(JAVA) -cp $(JAVA_LIBS):opensrf.jar $(JAVA_EXE) $(JAVA_ARGS)
-
-docs:
- find . -name *.java > files;
- javadoc -classpath $(JAVA_LIBS) -d doc @files;
- rm files;
-
-install:
- mkdir -p $(LIBDIR)/java
- cp opensrf.jar $(LIBDIR)/java
-
-clean:
- rm -fr opensrf.jar $(JAVA_LIBDIR)
-
-dep_clean:
- rm -rf deps
-
-
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 \
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
<router>otherhost</router>
</routers>
- <logfile>/openils/var/log/osrfsys.log</logfile>
+ <logfile>LOCALSTATEDIR/log/osrfsys.log</logfile>
</opensrf>
</config>
{
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:
--- /dev/null
+# 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
+
+++ /dev/null
-# 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
-