repair wrong path for ocf_root when prefix ne default #138

Open
wants to merge 3 commits into from

2 participants

@grueni

I compile resource-agents after ClusterLabs-resource-agents.
With ClusterLabs-resource-agents I use

export PREFIX=/opt/ha
./configure --prefix=$PREFIX --enable-fatal-warnings=no --with-daemon-user=${CLUSTER_USER} --with-daemon-group=${CLUSTER_GROUP} --with-ocf-root=$PREFIX/lib/ocf.

/opt/ha/include/heartbeat/glue_config.h contains now the definition of OCF_ROOT_DIR.

See below the values constructed in configure.ac when the options --prefix and/or --with-ocf-root are used.
OCF_RA_DIR_PREFIX is used in Makefile.am and the value is obviously wrong.

When the patch is used the values are "/opt/ha/lib/ocf/resource.d/" and "/opt/ha/lib/ocf/lib/".

I checked with Solaris 11U6 and openSuse 12.2.

I added some "rm .." to Makefile.am because "gmake install" produces errors with ${LN_S} when used more than once

The patch was reviewed from Fabio Di Nitto, see here http://lists.corosync.org/pipermail/discuss/2012-September/002027.html.

# ./configure --enable-fatal-warnings=no
...
  Prefix                   = /usr
...
  OCF_ROOT_DIR             = /opt/ha/lib/ocf
  OCF_RA_DIR               = /opt/ha/lib/ocf/resource.d/
  OCF_RA_DIR_PREFIX        = /opt/ha/lib/ocf/resource.d/
  OCF_LIB_DIR              = /opt/ha/lib/ocf/lib/
  OCF_LIB_DIR_PREFIX       = /opt/ha/lib/ocf/lib/
....

# ./configure --enable-fatal-warnings=no --prefix=/opt/ha
...  
  Prefix                   = /opt/ha
...
  OCF_ROOT_DIR             = /opt/ha/lib/ocf
  OCF_RA_DIR               = /opt/ha/lib/ocf/resource.d/
  OCF_RA_DIR_PREFIX        = /opt/ha//opt/ha/lib/ocf/resource.d/
  OCF_LIB_DIR              = /opt/ha/lib/ocf/lib/
  OCF_LIB_DIR_PREFIX       = /opt/ha//opt/ha/lib/ocf/lib/
...

# ./configure --enable-fatal-warnings=no --prefix=/opt/ha --with-ocf-root=/opt/ha/lib/ocf
...
  Prefix                   = /opt/ha
...
  OCF_ROOT_DIR             = /opt/ha/lib/ocf
  OCF_RA_DIR               = /opt/ha/lib/ocf/resource.d/
  OCF_RA_DIR_PREFIX        = /opt/ha//opt/ha/lib/ocf/resource.d/
  OCF_LIB_DIR              = /opt/ha/lib/ocf/lib/
  OCF_LIB_DIR_PREFIX       = /opt/ha//opt/ha/lib/ocf/lib/
...
@dmuhamedagic

@fabbione, @feist: Can you please take a look at this one (actually, just the first commit). Thanks!

@dmuhamedagic

06f8fd6 cherry picked. Thanks!

@dmuhamedagic

@fabbione, @feist : still no news from you. Do you have an opinion to share?

Andreas Grueninger Fix: no leading slahs for prefix, wrong variable
prefix has always a leading slash, if destdir is not used the slash is doubled
mkinstalldirs resolves to /root/install-sh
800e5d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment