automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make distcheck fail due to unset DESTDIR


From: Ralf Wildenhues
Subject: Re: make distcheck fail due to unset DESTDIR
Date: Sat, 28 Feb 2009 15:38:42 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

* Roger Leigh wrote on Sat, Feb 28, 2009 at 03:14:27PM CET:
> pg_contrib_DATA =                     \
>       debversion.sql                  \
>       uninstall_debversion.sql

> However, "make distcheck" fails, with:
> 
> make[3]: Entering directory `/home/rleigh/sbuild/sbuild-0.58.0/_build/db'
> make[3]: Nothing to be done for `install-exec-am'.
> test -z "/usr/share/postgresql/8.3/contrib" || /bin/mkdir -p 
> "/usr/share/postgresql/8.3/contrib"
>  /usr/bin/install -c -m 644 'debversion.sql' 
> '/usr/share/postgresql/8.3/contrib/debversion.sql'
> /usr/bin/install: cannot create regular file 
> `/usr/share/postgresql/8.3/contrib/debversion.sql': Permission denied
>  /usr/bin/install -c -m 644 '../../db/uninstall_debversion.sql' 
> '/usr/share/postgresql/8.3/contrib/uninstall_debversion.sql'
> /usr/bin/install: cannot create regular file 
> `/usr/share/postgresql/8.3/contrib/uninstall_debversion.sql': Permission 
> denied

> The full source is at:
> http://nagini.codelibre.net/~rleigh/sbuild-0.58.0.tar.gz

The problem is likely this code in configure.ac:
  AC_MSG_CHECKING([for PostgreSQL architecture-independent support files 
directory])
  pg_server_sharedir=`"$PG_CONFIG" --sharedir`
  AC_ARG_WITH([debug], [AS_HELP_STRING([--pg-server-sharedir], [PostgreSQL 
architecture-independent support files directory])],
                [pg_server_sharedir="${withval}"])
  AC_MSG_RESULT([$pg_server_sharedir])
  AC_SUBST([pg_server_sharedir])

  pg_contribdir="$pg_server_sharedir/contrib"
  AC_SUBST([pg_contribdir])

Why?  Apart from a DESTDIR install, distcheck also tries to configure
and install the tree below some specific --prefix, and tries to ensure
that your package installs all files below $prefix.  This is a
requirement from the GNU Coding Standards.  See here for more
information:
<http://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths>
<http://www.gnu.org/software/automake/manual/standards.html#Directory-Variables>

One way to fix your code would be to check for whether the user has
overridden $prefix, $datarootdir, or $datadir, and in that case, let
pg_server_sharedir depend on the latter (the defaults for these
variables are NONE, '${prefix}/share', and '${datarootdir}',
respectively, with recent Autoconf versions).  Another way to let
the distcheck pass (but still allow to annoy your users ;-)
is to add an appropriate --with-pg-server-sharedir to the make macro
DISTCHECK_CONFIGURE_FLAGS.

BTW, in above code, there are a couple of trivial issues: this
  AC_ARG_WITH([debug], [AS_HELP_STRING([--pg-server-sharedir], [PostgreSQL 
architecture-independent support files directory])],
                [pg_server_sharedir="${withval}"])

should likely be something like:
  AC_ARG_ENABLE([pg-server-sharedir],
    [AS_HELP_STRING([--enable-pg-server-sharedir],
       [PostgreSQL architecture-independent support files directory])],
                [pg_server_sharedir="${enableval}"])

no?

Hope that helps.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]