Creating a link with automake

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a link with automake

Bernhard Seckinger
Hi,

I've got a program, that contains some php-script frontend (cli not web)
(and other stuff, which is irrelevant here). I've put the php-scripts into
$pkgdatadir. Now I'd like to have a link from $bindir to the main script i.e.

ln -s ${pkgdatadir}/croco.php ${bindir}/croco

To do this I've added to the Makefile.ac the following:

install-exec-local:
    mkdir -p ${bindir}
    ln -s ${pkgdatadir}/croco.php ${bindir}/croco

When using "make install" this works. But when I run "make distcheck" I get an
error, telling that I'm not allowed to create the ${bindir}. I've allready
tried to replace the mkdir command with

    ${srcdir}/../install-sh -d ${bindir}

which is probably architecture-independend, but I still get a similar error.

Does anyone know, how to do this?

Thanks, Berni

--
-- Meine R├Ątselwebseite: www.croco-puzzle.com


Reply | Threaded
Open this post in threaded view
|

Re: Creating a link with automake

Bob Friesenhahn
On Fri, 20 Jan 2017, Bernhard Seckinger wrote:

> I've got a program, that contains some php-script frontend (cli not web)
> (and other stuff, which is irrelevant here). I've put the php-scripts into
> $pkgdatadir. Now I'd like to have a link from $bindir to the main script i.e.
>
> ln -s ${pkgdatadir}/croco.php ${bindir}/croco
>
> To do this I've added to the Makefile.ac the following:
>
> install-exec-local:
>    mkdir -p ${bindir}
>    ln -s ${pkgdatadir}/croco.php ${bindir}/croco
>
> When using "make install" this works. But when I run "make distcheck" I get an
> error, telling that I'm not allowed to create the ${bindir}. I've allready
> tried to replace the mkdir command with
>
>    ${srcdir}/../install-sh -d ${bindir}
>
> which is probably architecture-independend, but I still get a similar error.
>
> Does anyone know, how to do this?

You need to add support for the DESTDIR environment variable, which
specifies an alternate directory path to install into.  Perhaps this
will work:

install-exec-local:
  mkdir -p ${DESTDIR}${bindir}
  ln -s ${DESTDIR}${pkgdatadir}/croco.php ${DESTDIR}${bindir}/croco

Bob
--
Bob Friesenhahn
[hidden email], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

Reply | Threaded
Open this post in threaded view
|

Re: Creating a link with automake

Bernhard Seckinger
Hi Bob,

> You need to add support for the DESTDIR environment variable, which
> specifies an alternate directory path to install into.  Perhaps this
> will work:

That's it. :-) I read about DESTDIR but unfortunately forgot it...

Thanks, Berni

--
-- Meine R├Ątselwebseite: www.croco-puzzle.com


Reply | Threaded
Open this post in threaded view
|

Re: Creating a link with automake

Simon Richter-2
In reply to this post by Bob Friesenhahn
Hi,

On Fri, Jan 20, 2017 at 12:44:53PM -0600, Bob Friesenhahn wrote:

> install-exec-local:
> mkdir -p ${DESTDIR}${bindir}
> ln -s ${DESTDIR}${pkgdatadir}/croco.php ${DESTDIR}${bindir}/croco

With automake, this could also be written as

install-exec-local:
        $(MKDIR_P) $(DESTDIR)$(bindir)
        $(LN_S) $(DESTDIR)$(pkgdatadir)/croco.php $(DESTDIR)$(bindir)/croco

I'm not sure about the real world significance of this, but there is
probably a historical reason why there would be variables defined for these
commands.

   Simon

Reply | Threaded
Open this post in threaded view
|

Re: Creating a link with automake

Thomas Jahns
In reply to this post by Bernhard Seckinger
On 01/20/2017 11:21 AM, Bernhard Seckinger wrote:

> I've got a program, that contains some php-script frontend (cli not web)
> (and other stuff, which is irrelevant here). I've put the php-scripts into
> $pkgdatadir. Now I'd like to have a link from $bindir to the main script i.e.
>
> ln -s ${pkgdatadir}/croco.php ${bindir}/croco
>
> To do this I've added to the Makefile.ac the following:
>
> install-exec-local:
>     mkdir -p ${bindir}
>     ln -s ${pkgdatadir}/croco.php ${bindir}/croco
>
> When using "make install" this works. But when I run "make distcheck" I get an
> error, telling that I'm not allowed to create the ${bindir}. I've allready
> tried to replace the mkdir command with
>
>     ${srcdir}/../install-sh -d ${bindir}
>
> which is probably architecture-independend, but I still get a similar error.
>
> Does anyone know, how to do this?
I think the SCRIPTS primary is what you're searching for:

https://www.gnu.org/software/automake/manual/automake.html#Scripts

Regards, Thomas



smime.p7s (6K) Download Attachment