Patch from Kevin Beswick (kbeswick00@gmail.com) to address various problems with...
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 30 Jun 2008 19:46:08 +0000 (19:46 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 30 Jun 2008 19:46:08 +0000 (19:46 +0000)
  * src/libopensrf/Makefile.am:
    * Fix typo for -I (includes) vs. -L (linking libraries) compile option
  * src/Makefile.am:
    * Propagate NDEBUG compile flag to all other makefiles
    * Create target directories
    * Set directories in example config files to match configured options
  * configure.ac:
    * Set default prefix to /opensrf/ instead of /openils/
  * bin/osrf_config.in:
    * Add --localstatedir option for osrf_config
    * Correct output value for --apxs
  * bin/osrf_ctl.sh
    * Set default PID dir to localstatedir rather than sysconfdir
  * Makefile.am:
    * Propagate NDEBUG compile flag to all other makefiles
    * Remove explicit rpath option, automake will figure that out for us (supposedly)
  * examples/opensrf_core.xml.example, examples/opensrf.xml.example, examples/srfsh.xml.example:
    * Set directories in example config files to match configured options

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

Makefile.am
bin/osrf_config.in
bin/osrf_ctl.sh
configure.ac
examples/opensrf.xml.example
examples/opensrf_core.xml.example
examples/srfsh.xml.example
src/Makefile.am
src/libopensrf/Makefile.am

index 33102a4..289b3e3 100644 (file)
 # GNU General Public License for more details.
 
 
+if !DEBUG
+MAYBE_DEBUG = -DNDEBUG
+endif
+
 export PREFIX                   = @prefix@
 export TMP                      = @TMP@
 export LIBXML2_HEADERS          = @LIBXML2_HEADERS@
@@ -19,9 +23,10 @@ export APR_HEADERS              = @APR_HEADERS@
 export ETCDIR                   = @sysconfdir@
 export APXS2                    = @APXS2@
 export APACHE2_HEADERS          = @APACHE2_HEADERS@
-export DEF_CFLAGS              = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@abs_top_builddir@/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) @INCLUDES@
-export DEF_LDFLAGS             = -Wl, -rpath=$(LIBDIR) -L$(TMPDIR) @LIBDIRS@
+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_LDFLAGS             = -L$(TMPDIR) @LIBDIRS@
 export DEF_LDLIBS              = -lobjson -lopensrf
+export VAR                     = @localstatedir@
 export PID                     = @localstatedir@/run/opensrf
 export SOCK                    = @localstatedir@/lock/opensrf
 export LOG                     = @localstatedir@/log/opensrf
index 0391d56..ce2f69c 100644 (file)
@@ -105,11 +105,14 @@ case "$1" in
      --sysconfdir)
                echo @sysconfdir@;
                ;;
+     --localstatedir)
+               echo @localstatedir@;
+               ;;
      --tmpdir)
                echo @TMP@;
                ;;
      --apxs)
-               echo @APXS@;
+               echo @APXS2@;
                ;;
      --includedir)
                echo @includedir@;
index fe752b7..a8fbdd5 100755 (executable)
@@ -9,7 +9,7 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
 
 OPT_ACTION=""
 OPT_CONFIG=""
@@ -94,7 +94,7 @@ if [ ! -r "$OPT_CONFIG" ]; then
        echo "Please specify the location of the opensrf_core.xml file using the -c flag";
        exit 1;
 fi;
-[ -z "$OPT_PID_DIR" ] && OPT_PID_DIR=`$OSRF_CONFIG --sysconfdir`/run;
+[ -z "$OPT_PID_DIR" ] && OPT_PID_DIR=`$OSRF_CONFIG --localstatedir`/run;
 [ -z "$OPT_ACTION" ] && usage;
 
 PID_ROUTER="$OPT_PID_DIR/router.pid";
index 19a1696..7d109fc 100644 (file)
@@ -24,7 +24,7 @@ AC_INIT([OpenSRF],[trunk],[open-ils-dev@list.georgialibraries.org])
 AM_INIT_AUTOMAKE([OpenSRF], [trunk])
 AC_REVISION($Revision: 0.1 $)
 AC_CONFIG_SRCDIR([configure.ac])
-AC_PREFIX_DEFAULT([/openils/])
+AC_PREFIX_DEFAULT([/opensrf/])
 
 
 AC_SUBST(prefix)
index e8939fa..2598164 100644 (file)
@@ -22,16 +22,16 @@ vim:et:ts=2:sw=2:
     <dirs>
 
       <!-- opensrf log files go in this directory -->
-      <log>/path/to/log</log>
+      <log>LOCALSTATEDIR/log</log>
 
       <!-- opensrf unix domaind socket files go here -->
-      <sock>/path/to/sock</sock>
+      <sock>LOCALSTATEDIR/lock</sock>
 
       <!-- opensrf pids go here -->
-      <pid>/path/to/pid</pid>
+      <pid>LOCALSTATEDIR/run</pid>
 
       <!-- global config directory -->
-      <conf>/path/to/conf</conf>
+      <conf>SYSCONFDIR</conf>
     </dirs>
 
     <!-- prefork, simple. prefork is suggested -->
index 9b93f81..bfde5c9 100644 (file)
@@ -27,7 +27,7 @@ vim:et:ts=2:sw=2:
     <port>5222</port>
 
     <!-- log to a local file -->
-    <logfile>/openils/var/log/osrfsys.log</logfile>
+    <logfile>LOCALSTATEDIR/log/osrfsys.log</logfile>
 
     <!-- Log to syslog. You can use this same layout for 
         defining the logging of all services in this file -->
@@ -41,7 +41,7 @@ vim:et:ts=2:sw=2:
     <loglevel>3</loglevel>
 
     <!-- config file for the services -->
-    <settings_config>/openils/conf/opensrf.xml</settings_config>
+    <settings_config>SYSCONFDIR/opensrf.xml</settings_config>
 
   </opensrf>
 
@@ -57,7 +57,7 @@ vim:et:ts=2:sw=2:
     <secret>secret</secret>
     <listen_address>10.0.0.3</listen_address>
     <loglevel>3</loglevel>
-    <logfile>/openils/var/log/osrfsys.log</logfile>
+    <logfile>LOCALSTATEDIR/log/osrfsys.log</logfile>
   </chopchop>
 
   <!-- The section between <gateway>...</gateway> is a standard OpenSRF C stack config file -->
@@ -88,7 +88,7 @@ vim:et:ts=2:sw=2:
     <username>mylogin</username>
     <passwd>mypassword</passwd>
     <port>5222</port>
-    <logfile>/openils/var/log/gateway.log</logfile>
+    <logfile>LOCALSTATEDIR/log/gateway.log</logfile>
     <loglevel>3</loglevel>
 
   </gateway>
@@ -128,7 +128,7 @@ vim:et:ts=2:sw=2:
         <max_reconnect_attempts>5</max_reconnect_attempts>
   
         </transport>
-      <logfile>/openils/var/log/router.log</logfile>
+      <logfile>LOCALSTATEDIR/log/router.log</logfile>
       <loglevel>2</loglevel>
   
     </router>
index bf635f6..e8dd6be 100644 (file)
@@ -6,6 +6,6 @@
   <username>myusername</username>
   <passwd>mypassword</passwd>
   <port>5222</port>
-  <logfile>/path/to/log/srfsh.log</logfile>
+  <logfile>LOCALSTATEDIR/log/srfsh.log</logfile>
   <loglevel>4</loglevel>
 </srfsh>
index 37371d7..754f7fc 100644 (file)
@@ -23,13 +23,11 @@ export JSDIR        = $(LIBDIR)/javascript
 export INCLUDEDIR= @includedir@
 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
 
+
+
 AM_LDFLAGS = $(DEF_LDFLAGS)
 AM_CFLAGS = $(DEF_CFLAGS)
 
-if DEBUG
-AM_CFLAGS += -DNDEBUG
-endif
-
 if BUILDJSON
 LDADD = -lobjson
 BJSON=1
@@ -46,6 +44,10 @@ endif
 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
 
 install-data-local:
+       mkdir -p $(VAR)
+       mkdir -p $(PID)
+       mkdir -p $(LOG)
+       mkdir -p $(SOCK)
        mkdir -p $(JSDIR)
        mkdir -p $(PERLDIR)
        mkdir -p $(ETCDIR)
@@ -53,6 +55,12 @@ install-data-local:
        mv $(BINDIR)/opensrf $(BINDIR)/opensrf-c
        cp ../bin/osrf_config $(BINDIR)
        cp ../bin/osrf_ctl.sh $(BINDIR)
+       sed -i 's|LOCALSTATEDIR|$(VAR)|g' '../examples/opensrf.xml.example'
+       sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '../examples/opensrf.xml.example'
+       sed -i 's|LOCALSTATEDIR|$(VAR)|g' '../examples/opensrf_core.xml.example'
+       sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '../examples/opensrf_core.xml.example'
+       sed -i 's|LOCALSTATEDIR|$(VAR)|g' '../examples/srfsh.xml.example'
+       sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '../examples/srfsh.xml.example'
        cp ../examples/opensrf.xml.example $(ETCDIR)
        cp ../examples/opensrf_core.xml.example $(ETCDIR)
        cp ../examples/srfsh.xml.example $(ETCDIR)
index d49f181..0afb912 100644 (file)
@@ -12,7 +12,7 @@
 # GNU General Public License for more details.
 
 
-AM_CFLAGS = $(DEF_CFLAGS) -DASSUME_STATELESS  -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -I./.libs/ -DOSRF_JSON_ENABLE_XML_UTILS
+AM_CFLAGS = $(DEF_CFLAGS) -DASSUME_STATELESS  -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -L./.libs/ -DOSRF_JSON_ENABLE_XML_UTILS
 AM_LDFLAGS = $(DEF_LDFLAGS)
 LDADD = -lxml2 -ldl -lmemcache -lopensrf -lobjson