versat / cntlm

Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy intended to help you break free from the chains of Microsoft proprietary world. More info on http://cntlm.sourceforge.net/ website. This version also supports: SSPI (on Windows, NTLM authentication only), Kerberos authentication, IPv6, proxy PAC files.
GNU General Public License v2.0
127 stars 40 forks source link

move default install dir to /usr/local #79

Closed fralken closed 2 years ago

fralken commented 2 years ago

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?

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

jschwartzenberg commented 2 years ago

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.

fralken commented 2 years ago

I don't understand exactly what you mean. You can override any of these variables.

jschwartzenberg commented 2 years ago

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.

fralken commented 2 years ago

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.

jschwartzenberg commented 2 years ago

Yes exactly. With most tools I've seen instead of BASEDIR, PREFIX was used I think.

fralken commented 2 years ago

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).

jschwartzenberg commented 2 years ago

Yeah I think it's the only way to handle it.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information