Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.ac, src/Makefile.am: Follow GNU coding standards regarding directory variables #1231

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Feb 24, 2025

Closes: #1229
Reported-by: @zeha
Cc: @thesamesam


Is this okay?


Revisions:

v2
  • Remove definitions of $prefix and $exec_prefix. [@thesamesam ]
$ git range-diff master gh/ep ep 
1:  8840d0e3 ! 1:  6f4e5d61 configure.ac, src/Makefile.am: Follow GNU coding standards regarding directory variables
    @@ Metadata
      ## Commit message ##
         configure.ac, src/Makefile.am: Follow GNU coding standards regarding directory variables
     
    +    According to Sam, if we just remove the definitions, autotools will
    +    provide the right values.
    +
    +    Note that this changes the default from /usr to /usr/local, which is the
    +    right value according to the GNU conding standards (and also what the
    +    BSDs prefer, according to one conversation I had with Ingo Schwarze from
    +    OpenBSD).
    +
         Closes: <https://github.com/shadow-maint/shadow/issues/1229>
    +    Link: <https://www.gnu.org/software/autoconf/manual/autoconf-2.72/html_node/Default-Prefix.html>
         Reported-by: Chris Hofstaedtler <[email protected]>
         Cc: Sam James <[email protected]>
         Signed-off-by: Alejandro Colomar <[email protected]>
    @@ src/Makefile.am
      
     -ubindir = ${prefix}/bin
     -usbindir = ${prefix}/sbin
    -+prefix = /usr/local
    -+exec_prefix = ${prefix}
     +ubindir = ${exec_prefix}/bin
     +usbindir = ${exec_prefix}/sbin
      suidperms = 4755
v3
  • Replace ${} by $() in surrounding code. [@thesamesam ]
$ git range-diff master gh/ep ep 
1:  6f4e5d61 = 1:  6f4e5d61 configure.ac, src/Makefile.am: Follow GNU coding standards regarding directory variables
-:  -------- > 2:  0fada16b src/Makefile.am: Use $() for consistency
v3b
  • Rebase
$ git range-diff master..gh/ep shadow/master..ep 
1:  6f4e5d61 = 1:  983e3308 configure.ac, src/Makefile.am: Follow GNU coding standards regarding directory variables
2:  0fada16b = 2:  8d0eb980 src/Makefile.am: Use $() for consistency
v3c
  • Rebase
$ git rd
1:  983e3308 = 1:  3d09f4f9 configure.ac, src/Makefile.am: Follow GNU coding standards regarding directory variables
2:  8d0eb980 = 2:  51b0e9f9 src/Makefile.am: Use $() for consistency

@zeha
Copy link
Contributor

zeha commented Feb 24, 2025

#1227 relies on exec_prefix already being set in configure.ac; with both combined, i get this in config.h:

#define PASSWD_PROGRAM "NONE/bin/passwd"

but maybe you can just push a fix to #1227.

@alejandro-colomar
Copy link
Collaborator Author

alejandro-colomar commented Feb 24, 2025

#1227 relies on exec_prefix already being set in configure.ac; with both combined, i get this in config.h:

#define PASSWD_PROGRAM "NONE/bin/passwd"

but maybe you can just push a fix to #1227.

I bail out; too much autotools for me. @thesamesam please help. :-)

@thesamesam
Copy link
Contributor

I'll look but probably tomorrow.

Copy link
Contributor

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with that one change for {} vs ().

…directory variables

According to Sam, if we just remove the definitions, autotools will
provide the right values.

Note that this changes the default from /usr to /usr/local, which is the
right value according to the GNU conding standards (and also what the
BSDs prefer, according to one conversation I had with Ingo Schwarze from
OpenBSD).

Closes: <shadow-maint#1229>
Link: <https://www.gnu.org/software/autoconf/manual/autoconf-2.72/html_node/Default-Prefix.html>
Reported-by: Chris Hofstaedtler <[email protected]>
Cc: Sam James <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
Some code was using $() and other ${}.  Use the same everywhere.

Reported-by: Sam James <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
@@ -2,13 +2,13 @@
EXTRA_DIST = \
.indent.pro

ubindir = ${prefix}/bin
usbindir = ${prefix}/sbin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current state of MR, the same exec_prefix will be used for ubindir && bindir

Do we keepubindir and usbindir in such case?
Or they are intentionally separate in Makefile.am so one can use make variables to have different values for ubindir and bindir e.g.

make install ubindir=/tmp/bin usbindir=/tmp/sbin

Otherwise LGTM and +1 for removing hacks :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to remove them, but in a separate PR. I'd say even in a separate release, just to make sure we don't break anything at some point.

@alejandro-colomar
Copy link
Collaborator Author

alejandro-colomar commented Mar 5, 2025

#1227 relies on exec_prefix already being set in configure.ac; with both combined, i get this in config.h:

#define PASSWD_PROGRAM "NONE/bin/passwd"

but maybe you can just push a fix to #1227.

Has this been fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exec_prefix is set to / for prefix=/usr
5 participants