[ofa-general] [PATCH] OpenSM: Fix rpm build, <sysconfdir>/opensm/opensm.conf failed to install

Ira Weiny weiny2 at llnl.gov
Thu May 15 13:27:21 PDT 2008


Sasha,

I found this while trying to add the Performance Manager HOWTO to the rpm.
Therefore, I think this will conflict slightly with that patch.  If you like I
can resubmit that patch after you apply this.

Thanks,
Ira

>From 8453b86e94175ff3054a57c5c50e337a96d536bd Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at llnl.gov>
Date: Thu, 15 May 2008 13:13:16 -0700
Subject: [PATCH] Fix rpm build, <sysconfdir>/opensm/opensm.conf failed to install


Signed-off-by: Ira K. Weiny <weiny2 at llnl.gov>
---
 opensm/configure.in   |    9 +++++++--
 opensm/opensm.spec.in |    8 ++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/opensm/configure.in b/opensm/configure.in
index d36d7be..2ae8bd0 100644
--- a/opensm/configure.in
+++ b/opensm/configure.in
@@ -87,7 +87,7 @@ conf_dir_tmp1="`eval echo ${sysconfdir} | sed 's/^NONE/$ac_default_prefix/'`"
 SYS_CONFIG_DIR="`eval echo $conf_dir_tmp1`"
 
 dnl Check for a different subdir for the config files.
-OPENSM_CONFIG_DIR=$SYS_CONFIG_DIR/opensm
+OPENSM_CONFIG_SUB_DIR=opensm
 AC_MSG_CHECKING(for --with-opensm-conf-sub-dir)
 AC_ARG_WITH(opensm-conf-sub-dir,
     AC_HELP_STRING([--with-opensm-conf-sub-dir=dir],
@@ -96,10 +96,15 @@ AC_ARG_WITH(opensm-conf-sub-dir,
     no)
         ;;
     *)
-        OPENSM_CONFIG_DIR=$SYS_CONFIG_DIR/$withval
+        OPENSM_CONFIG_SUB_DIR=$withval
         ;;
     esac ]
 )
+dnl this needs to be configured for rpmbuilds separate from the full path
+dnl "OPENSM_CONFIG_DIR"
+AC_SUBST(OPENSM_CONFIG_SUB_DIR)
+
+OPENSM_CONFIG_DIR=$SYS_CONFIG_DIR/$OPENSM_CONFIG_SUB_DIR
 AC_MSG_RESULT($OPENSM_CONFIG_DIR)
 AC_DEFINE_UNQUOTED(OPENSM_CONFIG_DIR,
 	["$OPENSM_CONFIG_DIR"],
diff --git a/opensm/opensm.spec.in b/opensm/opensm.spec.in
index feabfef..b439323 100644
--- a/opensm/opensm.spec.in
+++ b/opensm/opensm.spec.in
@@ -94,9 +94,9 @@ if [ -f /etc/redhat-release -o -s /etc/redhat-release ]; then
 else
     REDHAT=""
 fi
-mkdir -p $etc/{init.d,logrotate.d} @OPENSM_CONFIG_DIR@
+mkdir -p $etc/{init.d,logrotate.d} $etc/@OPENSM_CONFIG_SUB_DIR@
 install -m 755 scripts/${REDHAT}opensm.init $etc/init.d/opensmd
-install -m 644 scripts/opensm.conf @OPENSM_CONFIG_DIR@/opensm.conf
+install -m 644 scripts/opensm.conf $etc/@OPENSM_CONFIG_SUB_DIR@/opensm.conf
 install -m 644 scripts/opensm.logrotate $etc/logrotate.d/opensm
 install -m 755 scripts/sldd.sh $RPM_BUILD_ROOT%{_sbindir}/sldd.sh
 
@@ -128,10 +128,10 @@ fi
 %doc AUTHORS COPYING README
 %{_sysconfdir}/init.d/opensmd
 %{_sbindir}/sldd.sh
-%config(noreplace) @OPENSM_CONFIG_DIR@/opensm.conf
+%config(noreplace) %{_sysconfdir}/@OPENSM_CONFIG_SUB_DIR@/opensm.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/opensm
 %dir /var/cache/opensm
-%dir @OPENSM_CONFIG_DIR@
+%dir %{_sysconfdir}/@OPENSM_CONFIG_SUB_DIR@
 
 %files libs
 %defattr(-,root,root,-)
-- 
1.5.1




More information about the general mailing list