Makefile: tune MANPREFIX configuration for FreeBSD #1043
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We could think of the following use cases:
User installs git-extras from official port/pkg. man/man* structure is quite common among different systems, but location of man/ itself can be different. FreeBSD Ports framework setups MANPREFIX to PREFIX by default, i.e. it's /usr/local. The idea is that software may provide different man/man* sections, with final path being /usr/local/man/man*. In contrast, git-extras' Makefile process simplifies the things due to it works with section 1 only, and expects MANPREFIX to be set down to man/man1 path. For this reason, installation via FreeBSD Ports requires unconditional man path configuration like this:
ifeq ($(OS), FreeBSD)
MANPREFIX = "$(PREFIX)/man/man1"
Otherwise, the path will be incorrect. And this is how official FreeBSD port of git-extras has been fixing this difference for many years.
2.a. User explicitly defines custom MANPREFIX. Okay, it's user's
decision -- nothing to do here, just follow as is.
(But /usr/local will be corrected to /usr/local/man/man1)
2.b. User does not define custom paths, i.e. it's expected to be
installed according to FreeBSD defaults. And default values in
git-extras' Makefile forms the expected correct path.
This change supports all the cases above, with the goal to avoid wrong man path for the most of the situations. As long as official git-extras make process tries to support FreeBSD, this change allows to omit extra patching for FreeBSD Ports framework.