Add a shib-paths header file, auto-generated at build time.
authorwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 19 Mar 2004 01:28:29 +0000 (01:28 +0000)
committerwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 19 Mar 2004 01:28:29 +0000 (01:28 +0000)
it's included in shib-target.h, so you get it by default.
use it in the shar and test-client to find the default config and schema locations

git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@873 cb58f699-b61c-0410-a6fe-9272a202ed29

shar/shar.cpp
shar/test-client.cpp
shib-target/.cvsignore
shib-target/Makefile.am
shib-target/shib-paths.h.in [new file with mode: 0644]
shib-target/shib-target.h

index e2bd479..80c995f 100644 (file)
@@ -156,6 +156,10 @@ int real_main(int preinit)
             config=getenv("SHIBCONFIG");
         if (!schemadir)
             schemadir=getenv("SHIBSCHEMAS");
+       if (!schemadir)
+           schemadir=SHIB_SCHEMAS;
+       if (!config)
+           config=SHIB_CONFIG;
         if (!conf.init(schemadir,config))
             return -2;
 
@@ -278,6 +282,10 @@ int main(int argc, char *argv[])
         schemadir=getenv("SHIBSCHEMAS");
     if (!config)
         config=getenv("SHIBCONFIG");
+    if (!schemadir)
+        schemadir=SHIB_SCHEMAS;
+    if (!config)
+        config=SHIB_CONFIG;
 
     // initialize the shib-target library
     ShibTargetConfig& conf=ShibTargetConfig::getConfig();
index 13cc3a1..c54b84d 100644 (file)
@@ -4,9 +4,6 @@
 using namespace std;
 using namespace shibtarget;
 
-#define SCHEMAS "/opt/shibboleth/etc/shibboleth"
-#define CONFIG "/opt/shibboleth/etc/shibboleth/shibboleth.xml"
-
 int main (int argc, char *argv[])
 {
   int res,start;
@@ -14,10 +11,10 @@ int main (int argc, char *argv[])
 
   const char* config=getenv("SHIBCONFIG");
   if (!config)
-    config=SCHEMAS;
+    config=SHIB_CONFIG;
   const char* schemadir=getenv("SHIBSCHEMAS");
   if (!schemadir)
-    schemadir=SCHEMAS;
+    schemadir=SHIB_SCHEMAS;
 
   ShibTargetConfig& conf=ShibTargetConfig::getConfig();
   conf.setFeatures(ShibTargetConfig::Listener);
index 2d3ab7c..1cf4d9e 100644 (file)
@@ -9,3 +9,4 @@ Release
 *.plg
 *.mak
 *.dep
+shib-paths.h
index 6323bcf..c42d398 100644 (file)
@@ -2,6 +2,8 @@
 
 AUTOMAKE_OPTIONS = foreign
 
+pkgsysconfdir = $(sysconfdir)/@PACKAGE@
+
 lib_LTLIBRARIES = libshib-target.la
 
 if USE_OUR_ONCRPC
@@ -14,7 +16,7 @@ INIFLAGS = -DSHIBTARGET_INIFILE=\"$(sysconfdir)/@PACKAGE@/shibboleth.ini\"
 AM_CXXFLAGS = $(MY_AM_CXXFLAGS) $(INIFLAGS)
 
 libshib_targetdir = $(includedir)/shib-target
-libshib_target_HEADERS = shib-target.h shibrpc.h
+libshib_target_HEADERS = shib-target.h shibrpc.h shib-paths.h
 noinst_HEADERS = internal.h
 
 libshib_target_la_SOURCES = \
@@ -57,4 +59,12 @@ do_rpcgen:
        $(RM) $(RPCGEN_TARGET)
        $(RPCGEN) $(RPCGEN_ARGS) -o $(RPCGEN_TARGET) $(RPCGEN_SRC)
 
-EXTRA_DIST = shibtarget.dsp
+shib-paths.h: ${srcdir}/shib-paths.h.in Makefile ${top_builddir}/config.status
+       rm -f $@.tmp
+       sed < ${srcdir}/$@.in > $@.tmp \
+           -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:'
+       cmp -s $@ $@.tmp || mv $@.tmp $@
+       rm -f $@.tmp
+
+EXTRA_DIST = shibtarget.dsp shib-paths.h.in
+BUILT_SOURCES = shib-paths.h
diff --git a/shib-target/shib-paths.h.in b/shib-target/shib-paths.h.in
new file mode 100644 (file)
index 0000000..6a6bad0
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * The Shibboleth License, Version 1.
+ * Copyright (c) 2002
+ * University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution, if any, must include
+ * the following acknowledgment: "This product includes software developed by
+ * the University Corporation for Advanced Internet Development
+ * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
+ * may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear.
+ *
+ * Neither the name of Shibboleth nor the names of its contributors, nor
+ * Internet2, nor the University Corporation for Advanced Internet Development,
+ * Inc., nor UCAID may be used to endorse or promote products derived from this
+ * software without specific prior written permission. For written permission,
+ * please contact shibboleth@shibboleth.org
+ *
+ * Products derived from this software may not be called Shibboleth, Internet2,
+ * UCAID, or the University Corporation for Advanced Internet Development, nor
+ * may Shibboleth appear in their name, without prior written permission of the
+ * University Corporation for Advanced Internet Development.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
+ * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
+ * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * shib-paths.h.in -- source file for the (auto-generated) shib-paths.h
+ *                     used to define the default paths for SHIB's Target
+ *
+ * Created by: Derek Atkins <derek@ihtfp.com>
+ *
+ * $Id$
+ */
+
+#ifndef SHIB_PATHS_H
+#define SHIB_PATHS_H
+
+/*
+ * SHIB_SCHEMAS defines the default location where the schemas will be installed.
+ */
+#define SHIB_SCHEMAS "@-PKGSYSCONFDIR-@"
+
+/*
+ * SHIB_CONFIG defines the default location of the Shib Target Configuration File.
+ */
+#define SHIB_CONFIG "@-PKGSYSCONFDIR-@/shibboleth.xml"
+
+#endif /* SHIB_PATHS_H */
index bb0aaea..98d0b3e 100644 (file)
@@ -61,6 +61,7 @@
 #include <saml/saml.h>
 #include <shib/shib.h>
 #include <shib/shib-threads.h>
+#include <shib-target/shib-paths.h>
 
 #ifdef WIN32
 # ifndef SHIBTARGET_EXPORTS