[ofa-general] [PATCH] Ensure ownership of the /etc/opensm directory

Ira Weiny weiny2 at llnl.gov
Wed Mar 19 09:36:49 PDT 2008


We found that the rpm generated for opensm did not "own" the directory
specified by the --with-opensm-conf-sub-dir configure option.  Also "ofa" was
hard coded into the autoconf stuff.  This patch makes sure that the rpm owns
whatever directory was configured for the config files as well as putting the
config file all together in the configured directory.

Ira

>From de8246f7e5501a1ad4de12f8d5938443f04e0e56 Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at wopri.(none)>
Date: Tue, 18 Mar 2008 19:08:18 -0700
Subject: [PATCH] Ensure ownership of the /etc/opensm directory.
Also change references to ofa to be the option specified via the
--with-opensm-conf-sub-dir

Signed-off-by: Ira K. Weiny <weiny2 at wopri.(none)>
---
 opensm/configure.in                  |    1 +
 opensm/opensm.spec.in                |    7 ++++---
 opensm/scripts/opensmd.in            |    2 +-
 opensm/scripts/redhat-opensm.init.in |    4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/opensm/configure.in b/opensm/configure.in
index 184c9f8..5bb87b4 100644
--- a/opensm/configure.in
+++ b/opensm/configure.in
@@ -98,6 +98,7 @@ AC_ARG_WITH(opensm-conf-sub-dir,
     esac ]
 )
 AC_MSG_RESULT(${withopensmconfsubdir=no})
+AC_SUBST(OPENSM_CONF_SUB_DIR)
 
 dnl Set up <sysconfdir>/opensm config dir.
 CONF_DIR_TMP1="`eval echo ${sysconfdir}/$OPENSM_CONF_SUB_DIR`"
diff --git a/opensm/opensm.spec.in b/opensm/opensm.spec.in
index 6de6333..882e6e4 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,ofa,logrotate.d}
+mkdir -p $etc/{init.d, at OPENSM_CONF_SUB_DIR@,logrotate.d}
 install -m 755 scripts/${REDHAT}opensm.init $etc/init.d/opensmd
-install -m 644 scripts/opensm.conf $etc/ofa/opensm.conf
+install -m 644 scripts/opensm.conf $etc/@OPENSM_CONF_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,9 +128,10 @@ fi
 %doc AUTHORS COPYING README
 %{_sysconfdir}/init.d/opensmd
 %{_sbindir}/sldd.sh
-%config(noreplace) %{_sysconfdir}/ofa/opensm.conf
+%config(noreplace) %{_sysconfdir}/@OPENSM_CONF_SUB_DIR@/opensm.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/opensm
 %dir /var/cache/opensm
+%dir %{_sysconfdir}/@OPENSM_CONF_SUB_DIR@
 
 %files libs
 %defattr(-,root,root,-)
diff --git a/opensm/scripts/opensmd.in b/opensm/scripts/opensmd.in
index 0b150f7..23f50fa 100755
--- a/opensm/scripts/opensmd.in
+++ b/opensm/scripts/opensmd.in
@@ -34,7 +34,7 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 
-CONFIG=@sysconfdir@/ofa/opensm.conf
+CONFIG=@sysconfdir@/@OPENSM_CONF_SUB_DIR@/opensm.conf
 
 if [ ! -f @CONFIG@ ]; then
     exit 0
diff --git a/opensm/scripts/redhat-opensm.init.in b/opensm/scripts/redhat-opensm.init.in
index 4ce6605..689ffa0 100755
--- a/opensm/scripts/redhat-opensm.init.in
+++ b/opensm/scripts/redhat-opensm.init.in
@@ -38,7 +38,7 @@
 #  $Id: openib-1.0-opensm.init,v 1.5 2006/08/02 18:18:23 dledford Exp $
 #
 # processname: @sbindir@/opensm
-# config: @sysconfdir@/ofa/opensm.conf
+# config: @sysconfdir@/@OPENSM_CONF_SUB_DIR@/opensm.conf
 # pidfile: /var/run/opensm.pid
 
 prefix=@prefix@
@@ -46,7 +46,7 @@ exec_prefix=@exec_prefix@
 
 . /etc/rc.d/init.d/functions
 
-CONFIG=@sysconfdir@/ofa/opensm.conf
+CONFIG=@sysconfdir@/@OPENSM_CONF_SUB_DIR@/opensm.conf
 if [ ! -f $CONFIG ]; then
     exit 0
 fi
-- 
1.5.1



More information about the general mailing list