build-sys: install binaries in bindir (get rid of usrbin_execdir)

The "usrbin_execdir" hack meant to install some binaries in /bin and
others in /usr/bin. However:

- It is very inflexible: not much control on the final directory name
  and it is not possible to get rid of the usr/bin suffix without
  patching the build system.

- It is hard to use: it requires configure to receive --exec_prefix=/
  and other settings do not make much sense. It is not very obvious that
  that setting needs to be passed and it takes a while to figure it out.

- It produces garbage with the default setup: the default prefix of
  /usr/local ends up installing the binaries under /usr/local/usr/bin
  which does not make any sense.

Furthermore, the requirement to split binaries in /bin and /usr/bin is
not that strong since some distributions adopted the /usr merge and so
would agree to just deploy all binaries to /usr/bin directly.

Distributions that would still like to split /bin from /usr/bin should
actually move binaries such as `ps` and `kill` to /bin after the install
of procps-ng is complete. After all, they are the ones responsible for
determining what are the binaries that need to be in the root partition
and that list depends on their early boot init scripts, so it is
possible that the list must be augmented with other binaries from this
package.

Therefore, I propose here to get rid of that hack and simply install all
the binaries to bindir instead, which solves the problems described
above and simplifies the build and install of procps-ng.

Tested that it builds and both `make check` and `make distcheck` work.

Tested that `make install` works and produces the expected tree, the
only difference being the absence of the bogus /usr/local/usr/bin
directory and now all binaries are merged into /usr/local/bin as
expected.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
Filipe Brandenburger 2015-05-01 23:27:13 -07:00
parent edd66515ef
commit 430b559ba2
2 changed files with 10 additions and 15 deletions

View File

@ -19,15 +19,7 @@ AM_LDFLAGS = ./proc/libprocps.la
transform = s/pscommand/ps/; $(program_transform_name) transform = s/pscommand/ps/; $(program_transform_name)
bin_PROGRAMS = \ bin_PROGRAMS = \
ps/pscommand ps/pscommand \
sbin_PROGRAMS = \
sysctl
lib_LTLIBRARIES = \
proc/libprocps.la
usrbin_exec_PROGRAMS = \
free \ free \
pgrep \ pgrep \
pkill \ pkill \
@ -38,6 +30,12 @@ usrbin_exec_PROGRAMS = \
vmstat \ vmstat \
w w
sbin_PROGRAMS = \
sysctl
lib_LTLIBRARIES = \
proc/libprocps.la
dist_man_MANS = \ dist_man_MANS = \
free.1 \ free.1 \
pgrep.1 \ pgrep.1 \
@ -70,7 +68,7 @@ dist_procpsng_DATA = \
Documentation/FAQ Documentation/FAQ
if BUILD_PIDOF if BUILD_PIDOF
usrbin_exec_PROGRAMS += pidof bin_PROGRAMS += pidof
dist_man_MANS += pidof.1 dist_man_MANS += pidof.1
pidof_SOURCES = pidof.c lib/fileutils.c pidof_SOURCES = pidof.c lib/fileutils.c
else else
@ -86,7 +84,7 @@ else
endif endif
if WITH_NCURSES if WITH_NCURSES
usrbin_exec_PROGRAMS += \ bin_PROGRAMS += \
slabtop \ slabtop \
watch \ watch \
top/top top/top
@ -110,7 +108,7 @@ dist_procpsng_DATA += \
endif endif
if BUILD_SKILL if BUILD_SKILL
usrbin_exec_PROGRAMS += \ bin_PROGRAMS += \
skill \ skill \
snice snice
skill_SOURCES = skill.c lib/strutils.c lib/fileutils.c lib/nsutils.c skill_SOURCES = skill.c lib/strutils.c lib/fileutils.c lib/nsutils.c

View File

@ -69,9 +69,6 @@ AC_FUNC_MMAP
AC_FUNC_REALLOC AC_FUNC_REALLOC
AC_FUNC_STRTOD AC_FUNC_STRTOD
usrbin_execdir='${exec_prefix}/usr/bin'
AC_SUBST([usrbin_execdir])
AM_GNU_GETTEXT_VERSION([0.14.1]) AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT([external])
if test -d "$srcdir/po" if test -d "$srcdir/po"