Best way to patch absolute symlink path in Makefile.am

I'm having trouble figuring out how to patch some Makefile.am files to fix the symlink paths during staging, make stage-qa displays these warnings:

Code:
====> Running Q/A tests (stage-qa)
Warning: Bad symlink '/var/db/glusterd/hooks/1/delete/post/S57glusterfind-delete-post' pointing to an absolute pathname '/usr/local/libexec/glusterfs/glusterfind/S57glusterfind-delete-post.py'
Warning: Bad symlink '/usr/local/sbin/gfind_missing_files' pointing to an absolute pathname '/usr/local/libexec/glusterfs/gfind_missing_files/gfind_missing_files.sh'
Warning: Bad symlink '/usr/local/sbin/glustereventsd' pointing to an absolute pathname '/usr/local/libexec/glusterfs/gfevents/glustereventsd.py'
Warning: Bad symlink '/usr/local/sbin/gluster-eventsapi' pointing to an absolute pathname '/usr/local/libexec/glusterfs/peer_eventsapi.py'

For some reason $(DESTDIR) isn't getting prefixed with ${STAGEDIR}.

Code:
install-data-local:
    $(mkdir_p) $(DESTDIR)$(GLUSTERD_WORKDIR)/glusterfind/.keys
    $(mkdir_p) $(DESTDIR)$(GLUSTERD_WORKDIR)/hooks/1/delete/post/
    rm -f $(DESTDIR)$(GLUSTERD_WORKDIR)/hooks/1/delete/post/S57glusterfind-delete-post
    ln -s $(GLUSTERFS_LIBEXECDIR)/glusterfind/S57glusterfind-delete-post.py \
        $(DESTDIR)$(GLUSTERD_WORKDIR)/hooks/1/delete/post/S57glusterfind-delete-post

I tried a few different things like adding MAKE_ENV+=DESTDIR=${STAGEDIR}${PREFIX} or doing the same with MAKE_ARGS. I tried adding "USES=pathfix" and "USES=desthack". None of that seems to have any effect.

The full port (unfinished) can be found at:

An example of one of these Makefile.am files can be found at:

The poudriere testport log can be found at (ignore the pkg-list errors, I haven't worked on pkg-list yet):
 
At first glance it looks like I would need to make a patch to change this line in configure.ac:

Makefile:
GLUSTERFS_LIBEXECDIR="$(eval echo $libexecdir)/glusterfs"

I have a feeling that might have some unwanted effects according to this:

So it looks like I will have to use re-install those symlinks using a post-install section in the port, and do something like?

Makefile:
    rm -f ${STAGEDIR}$(DESTDIR)$(GLUSTERD_WORKDIR)/hooks/1/delete/post/S57glusterfind-delete-post
    ln -s ${STAGEDIR}$(GLUSTERFS_LIBEXECDIR)/glusterfind/S57glusterfind-delete-post.py \
        ${STAGEDIR}$(DESTDIR)$(GLUSTERD_WORKDIR)/hooks/1/delete/post/S57glusterfind-delete-post

Or can I instead do a post-configure patch and pre-append ${STAGEDIR} to that line?
 
I've never actually done this, so take my advice with a grain of salt. If it was me, I'd try to leave the upstream sources as unmodified as possible to make my life easier during upgrades. I'd re-install the symlinks in the post-install section.
 
Back
Top