Closed fralken closed 2 years ago
Kudos, SonarCloud Quality Gate passed!
Reading this commit, can you test that changing DESTDIR
still allows installing into /usr
? Normally there's a PREFIX variable that's set to /usr/local
by default and overridden by builds performed by rpmbuild
, debuild
, etc. that sets it to /usr
.
I don't understand exactly what you mean. You can override any of these variables.
I don't understand exactly what you mean. You can override any of these variables.
There should be a single variable to determine the installation location. The different files should end up below bin
, share
, etc. inside that structure.
Unpackaged and manually built software should have this set to /usr/local
so that the respective files end up below /usr/local/bin
, /usr/local/share
, etc. But then it should be easy to override this for builds that do end up packaging to /usr
. That should be a change of just one variable.
Because now the default was /usr
this wasn't a problem for packaging scripts as even not overriding the installation prefix gave them everything in /usr
. But now that the default is /usr/local
it seems that switching back to /usr
for those scripts is not a matter of just setting one variable. Setting DESTDIR
to /usr
would put things in /usr/usr/local
from what I see. This would not be correct.
Actually, now the default is:
DESTDIR :=
SYSCONFDIR := $(DESTDIR)/etc
BINDIR := $(DESTDIR)/usr/sbin
MANDIR := $(DESTDIR)/usr/share/man
That is, the global prefix is empty, and if you set DESTDIR=/usr you end up with BINDIR=/usr/usr/sbin ... etc. that it is not what you want.
The idea behind this setting is that normally you would install this under root, but sometimes (maybe for testing purpose ore because you moved the root somewhere else) you can set DESTDIR in some way.
I guess that to support what you are describing we should have something like:
DESTDIR :=
BASEDIR := /usr
SYSCONFDIR := $(DESTDIR)/etc
BINDIR := $(DESTDIR)$(BASEDIR)/sbin
MANDIR := $(DESTDIR)$(BASEDIR)/share/man
so that you can simply change BASEDIR to /usr or /usr/local.
Yes exactly. With most tools I've seen instead of BASEDIR
, PREFIX
was used I think.
Indeed. Anyway, without changing the behaviour of the makefiles I propose to change the default BINDIR and MANDIR, as a user pointed out that in most modern operating systems writing is denied in /usr folder, at least this is for macOS. I would not add more effort on this (it's a feature I'm not using).
Yeah I think it's the only way to handle it.
Kudos, SonarCloud Quality Gate passed!
This addresses discussion #74. Now default install directories are under /usr/local and READMEs are updated accordingly. @bjdaly can you have a look at it?