Most packages that use autotools are user-level utilities, or at least high enough that are completely under / usr, or low enough to be completely lower than / usr.
I am writing a package that would have to install some files in / bin, some in / sbin, / usr / bin and / usr / sbin. It replaces several existing binaries that are traditionally located in these places.
You also need to install the PAM module in / lib / security (and obviously / usr / lib / security will not work).
Now the problem is that the default prefix by default is / usr / local (I can control this default in my configure.ac file), and at least for Gentoo Linux the default is --prefix = / usr (this problem because it overrides all the default values โโthat I entered in my configure.ac file).
I briefly looked at how other similar packages deal with this problem. Here are my findings:
- bash -4.1 seems to be installed in / usr / bin, and distro build scripts move the bash binary to / bin
- Linux-PAM has hacks in the configure.ac file, so if the prefix is โโ"/ usr", it will use "/ sbin" and "/ lib" for some of its files. It also sets the default prefix for "/ usr". I'm not sure what will happen if the user passes another -prefix.
- shadow-utils sets exec_prefix to "" if the prefix is โโ"/ usr". Then bin_PROGRAMS refers to "/ bin", and Ubindir is declared as "$ {prefix} / bin", so ubin_PROGRAMS refers to "/ usr / bin"
My questions:
- What are the other distros settings for -prefix? Can I reasonably assume this is always / usr? At the moment, I'm only concerned about Linux, not BSD.
- Which of the above solutions seems the cleanest? Do you see some better solutions?
- What are the potential problems with the above solutions? Are there any solutions to these problems?
- I am fine with installing everything in "/ bin" and creating symbolic links for compatibility. Does this simplify the task?
- Is there another common build system acceptable for low-level system utilities that better handle my requirements?
Feel free to ask what I'm trying to do. Please note: if I want to maintain compatibility with what I replace, if he used to send the binary A and B, one of them / sbin and one in / usr / bin, I think I just need to put the replacements in these places or Less have symbolic links. PAM modules also have a fixed installation location.
I am obviously going to put forward any useful answer. I am the "accepted answer." I mainly seek advice "what should I do", what is the purest solution to the problem and, if applicable, a discussion of options and disadvantages, pluses and minuses.
source share