diff options
author | Nathan Kinder <nkinder@redhat.com> | 2007-04-24 18:02:21 +0000 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2007-04-24 18:02:21 +0000 |
commit | f6ea31659e16dc61bf109e6f1bc5de49545a7003 (patch) | |
tree | 5c112610ded5a33d99ad841bcff4b34fdec117f2 | |
parent | 9385cdf0423d4d90a5288d0fc9137dcfe820a7c8 (diff) | |
download | ds-f6ea31659e16dc61bf109e6f1bc5de49545a7003.tar.gz ds-f6ea31659e16dc61bf109e6f1bc5de49545a7003.tar.xz ds-f6ea31659e16dc61bf109e6f1bc5de49545a7003.zip |
Resolves: 236612
Summary: Added a configure option for FHS optional software layout style.
-rwxr-xr-x | configure | 118 | ||||
-rw-r--r-- | configure.ac | 41 | ||||
-rw-r--r-- | ldap/admin/src/create_instance.c | 62 | ||||
-rw-r--r-- | m4/fhs.m4 | 13 |
4 files changed, 186 insertions, 48 deletions
@@ -1056,6 +1056,7 @@ Optional Packages: --with-tags[=TAGS] include additional configurations [automatic] --with-fhs Use FHS layout + --with-fhs-opt Use FHS optional layout --with-instconfigdir=/path Base directory for instance specific writable configuration directories (default @@ -4306,7 +4307,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4309 "configure"' > conftest.$ac_ext + echo '#line 4310 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5441,7 +5442,7 @@ fi # Provide some information about the compiler. -echo "$as_me:5444:" \ +echo "$as_me:5445:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -6504,11 +6505,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6507: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6508: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6511: \$? = $ac_status" >&5 + echo "$as_me:6512: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6772,11 +6773,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6775: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6776: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6779: \$? = $ac_status" >&5 + echo "$as_me:6780: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6876,11 +6877,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6879: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6880: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6883: \$? = $ac_status" >&5 + echo "$as_me:6884: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9221,7 +9222,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 9224 "configure" +#line 9225 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9321,7 +9322,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 9324 "configure" +#line 9325 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11661,11 +11662,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11664: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11665: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11668: \$? = $ac_status" >&5 + echo "$as_me:11669: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -11765,11 +11766,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11768: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11769: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11772: \$? = $ac_status" >&5 + echo "$as_me:11773: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13335,11 +13336,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13338: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13339: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13342: \$? = $ac_status" >&5 + echo "$as_me:13343: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13439,11 +13440,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13442: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13443: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13446: \$? = $ac_status" >&5 + echo "$as_me:13447: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15642,11 +15643,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15645: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15646: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15649: \$? = $ac_status" >&5 + echo "$as_me:15650: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15910,11 +15911,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15913: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15914: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15917: \$? = $ac_status" >&5 + echo "$as_me:15918: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16014,11 +16015,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16017: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16018: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16021: \$? = $ac_status" >&5 + echo "$as_me:16022: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -22949,6 +22950,8 @@ if test "${with_fhs+set}" = set; then withval="$with_fhs" with_fhs=yes + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 @@ -22963,33 +22966,74 @@ _ACEOF fi +# check for --with-fhs-opt +echo "$as_me:$LINENO: checking for --with-fhs-opt" >&5 +echo $ECHO_N "checking for --with-fhs-opt... $ECHO_C" >&6 + +# Check whether --with-fhs-opt or --without-fhs-opt was given. +if test "${with_fhs_opt+set}" = set; then + withval="$with_fhs_opt" + with_fhs_opt=yes + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -# installation paths - by default, configure will just -# use /usr as the prefix for everything, which means -# /usr/etc and /usr/var. FHS sez to use /etc and /var. +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +if test "$with_fhs" = "yes" -a "$with_fhs_opt" = "yes"; then + { { echo "$as_me:$LINENO: error: Can't set both --with-fhs and --with-fhs-opt. Please only use one of these options." >&5 +echo "$as_me: error: Can't set both --with-fhs and --with-fhs-opt. Please only use one of these options." >&2;} + { (exit 1); exit 1; }; } +fi + + +# installation paths - by default, we store everything +# under the prefix. The with-fhs option will use /usr, +# /etc, and /var. The with-fhs-opt option will use the +# prefix, but it's sysconfdir and localstatedir will be +# /etc/opt, and /var/opt. if test "$with_fhs" = "yes"; then ac_default_prefix=/usr prefix=$ac_default_prefix exec_prefix=$prefix sysconfdir='/etc' localstatedir='/var' -fi - + # relative to datadir + sampledatadir=/$PACKAGE_NAME/data + # relative to datadir + scripttemplatedir=/$PACKAGE_NAME/script-templates + # relative to libdir + serverdir=/$PACKAGE_NAME + # relative to libdir + serverplugindir=/$PACKAGE_NAME/plugins +else + if test "$with_fhs_opt" = "yes"; then + # Override sysconfdir and localstatedir if FHS optional + # package was requested. + sysconfdir='/etc/opt' + localstatedir='/var/opt' + fi + # Paths for default layout + # relative to datadir + sampledatadir=/data + # relative to datadir + scripttemplatedir=/script-templates + # relative to libdir + serverdir= + # relative to libdir + serverplugindir=/plugins +fi + +# Shared paths for both FHS and default layouts # relative to sysconfdir configdir=/$PACKAGE_NAME/config -# relative to datadir -sampledatadir=/$PACKAGE_NAME/data # relative to sysconfdir propertydir=/$PACKAGE_NAME/property # relative to sysconfdir schemadir=/$PACKAGE_NAME/schema -# relative to libdir -serverdir=/$PACKAGE_NAME -# relative to libdir -serverplugindir=/$PACKAGE_NAME/plugins -# relative to datadir -scripttemplatedir=/$PACKAGE_NAME/script-templates diff --git a/configure.ac b/configure.ac index 13826904..6913711a 100644 --- a/configure.ac +++ b/configure.ac @@ -126,9 +126,11 @@ AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME]) m4_include(m4/fhs.m4) -# installation paths - by default, configure will just -# use /usr as the prefix for everything, which means -# /usr/etc and /usr/var. FHS sez to use /etc and /var. +# installation paths - by default, we store everything +# under the prefix. The with-fhs option will use /usr, +# /etc, and /var. The with-fhs-opt option will use the +# prefix, but it's sysconfdir and localstatedir will be +# /etc/opt, and /var/opt. if test "$with_fhs" = "yes"; then ac_default_prefix=/usr prefix=$ac_default_prefix @@ -137,22 +139,39 @@ dnl as opposed to the default /usr/etc sysconfdir='/etc' dnl as opposed to the default /usr/var localstatedir='/var' + # relative to datadir + sampledatadir=/$PACKAGE_NAME/data + # relative to datadir + scripttemplatedir=/$PACKAGE_NAME/script-templates + # relative to libdir + serverdir=/$PACKAGE_NAME + # relative to libdir + serverplugindir=/$PACKAGE_NAME/plugins +else + if test "$with_fhs_opt" = "yes"; then + # Override sysconfdir and localstatedir if FHS optional + # package was requested. + sysconfdir='/etc/opt' + localstatedir='/var/opt' + fi + # Paths for default layout + # relative to datadir + sampledatadir=/data + # relative to datadir + scripttemplatedir=/script-templates + # relative to libdir + serverdir= + # relative to libdir + serverplugindir=/plugins fi +# Shared paths for both FHS and default layouts # relative to sysconfdir configdir=/$PACKAGE_NAME/config -# relative to datadir -sampledatadir=/$PACKAGE_NAME/data # relative to sysconfdir propertydir=/$PACKAGE_NAME/property # relative to sysconfdir schemadir=/$PACKAGE_NAME/schema -# relative to libdir -serverdir=/$PACKAGE_NAME -# relative to libdir -serverplugindir=/$PACKAGE_NAME/plugins -# relative to datadir -scripttemplatedir=/$PACKAGE_NAME/script-templates AC_SUBST(configdir) AC_SUBST(sampledatadir) diff --git a/ldap/admin/src/create_instance.c b/ldap/admin/src/create_instance.c index bbf2c7f4..c2b0d47e 100644 --- a/ldap/admin/src/create_instance.c +++ b/ldap/admin/src/create_instance.c @@ -709,9 +709,14 @@ char *gen_script_auto(char *s_root, char *cs_path, return NULL; } +#if defined (IS_FHS) PR_snprintf(ofn, sizeof(ofn), "%s%c%s%cscript-templates%ctemplate-%s", cf->datadir, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, FILE_PATHSEP, name); +#else + PR_snprintf(ofn, sizeof(ofn), "%s%cscript-templates%ctemplate-%s", + cf->datadir, FILE_PATHSEP, FILE_PATHSEP, name); +#endif PR_snprintf(fn, sizeof(fn), "%s%c%s", cs_path, FILE_PATHSEP, name); create_instance_mkdir(cs_path, NEWDIR_MODE); #ifdef USE_NSPERL @@ -4366,8 +4371,13 @@ int parse_form(server_config_s *cf) prefix = cf->prefix = PL_strdup("/"); } +#if defined (IS_FHS) cf->sroot = PR_smprintf("%s%s%c%s", prefix, LIBDIR, FILE_PATHSEP, cf->package_name); +#else + cf->sroot = PR_smprintf("%sopt%c%s", prefix, FILE_PATHSEP, cf->package_name); +#endif + temp = ds_a_get_cgi_var("sasl_path", NULL, NULL); if (NULL != temp) { /* if sasl_path is given, we set it in the conf file regardless of @@ -4382,7 +4392,12 @@ int parse_form(server_config_s *cf) cf->sasl_path = PR_smprintf("%s%s%csasl2", prefix, LIBDIR, FILE_PATHSEP); } #endif + +#if defined (IS_FHS) cf->plugin_dir = PR_smprintf("%s%cplugins", cf->sroot, FILE_PATHSEP); +#else + cf->plugin_dir = PR_smprintf("%s%s%cplugins", prefix, LIBDIR, FILE_PATHSEP); +#endif if (!(cf->servname = ds_a_get_cgi_var("servname", "Server Name", "Please give a hostname for your server."))) @@ -4595,29 +4610,50 @@ int parse_form(server_config_s *cf) temp = ds_a_get_cgi_var("lock_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->lock_dir = PR_smprintf("%s%clock%c%s%c%s-%s", cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, PRODUCT_NAME, cf->servid); +#else + cf->lock_dir = PR_smprintf("%s%c%s%c%s-%s%clock", + cf->localstatedir, FILE_PATHSEP, + cf->package_name, FILE_PATHSEP, + PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#endif } else { cf->lock_dir = PL_strdup(temp); } temp = ds_a_get_cgi_var("log_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->log_dir = PR_smprintf("%s%clog%c%s%c%s-%s", cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, PRODUCT_NAME, cf->servid); +#else + cf->log_dir = PR_smprintf("%s%c%s%c%s-%s%clog", + cf->localstatedir, FILE_PATHSEP, + cf->package_name, FILE_PATHSEP, + PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#endif } else { cf->log_dir = PL_strdup(temp); } temp = ds_a_get_cgi_var("run_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->run_dir = PR_smprintf("%s%crun%c%s", cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP, cf->package_name); +#else + cf->run_dir = PR_smprintf("%s%c%s%c%s-%s%crun", + cf->localstatedir, FILE_PATHSEP, + cf->package_name, FILE_PATHSEP, + PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#endif } else { cf->run_dir = PL_strdup(temp); } @@ -4626,20 +4662,34 @@ int parse_form(server_config_s *cf) temp = ds_a_get_cgi_var("db_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->db_dir = PR_smprintf("%s%clib%c%s%c%s-%s%cdb", cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#else + cf->db_dir = PR_smprintf("%s%c%s%c%s-%s%cdb", + cf->localstatedir, FILE_PATHSEP, + cf->package_name, FILE_PATHSEP, + PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#endif } else { cf->db_dir = PL_strdup(temp); } temp = ds_a_get_cgi_var("bak_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->bak_dir = PR_smprintf("%s%clib%c%s%c%s-%s%cbak", cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#else + cf->bak_dir = PR_smprintf("%s%c%s%c%s-%s%cbak", + cf->localstatedir, FILE_PATHSEP, + cf->package_name, FILE_PATHSEP, + PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#endif } else { cf->bak_dir = PL_strdup(temp); } @@ -4648,18 +4698,30 @@ int parse_form(server_config_s *cf) temp = ds_a_get_cgi_var("ldif_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->ldif_dir = PR_smprintf("%s%c%s%cldif", cf->datadir, FILE_PATHSEP, cf->package_name, FILE_PATHSEP); +#else + cf->ldif_dir = PR_smprintf("%s%cldif", + cf->datadir, FILE_PATHSEP); +#endif } else { cf->ldif_dir = PL_strdup(temp); } temp = ds_a_get_cgi_var("tmp_dir", NULL, NULL); if (NULL == temp) { +#if defined (IS_FHS) cf->tmp_dir = PR_smprintf("%s%ctmp%c%s%c%s-%s", cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, PRODUCT_NAME, cf->servid); +#else + cf->tmp_dir = PR_smprintf("%s%c%s%c%s-%s%ctmp", + cf->localstatedir, FILE_PATHSEP, + cf->package_name, FILE_PATHSEP, + PRODUCT_NAME, cf->servid, FILE_PATHSEP); +#endif } else { cf->tmp_dir = PL_strdup(temp); } @@ -25,6 +25,7 @@ AC_MSG_CHECKING(for --with-fhs) AC_ARG_WITH(fhs, [ --with-fhs Use FHS layout], [ with_fhs=yes + AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no)) @@ -32,3 +33,15 @@ if test "$with_fhs" = "yes"; then AC_DEFINE([IS_FHS], [1], [Use FHS layout]) fi +# check for --with-fhs-opt +AC_MSG_CHECKING(for --with-fhs-opt) +AC_ARG_WITH(fhs-opt, [ --with-fhs-opt Use FHS optional layout], +[ + with_fhs_opt=yes + AC_MSG_RESULT(yes) +], +AC_MSG_RESULT(no)) + +if test "$with_fhs" = "yes" -a "$with_fhs_opt" = "yes"; then + AC_MSG_ERROR([Can't set both --with-fhs and --with-fhs-opt. Please only use one of these options.]) +fi |