From 430b559ba2826f80dffa840622ae0fc744000b13 Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Fri, 1 May 2015 23:27:13 -0700 Subject: [PATCH] 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 --- Makefile.am | 22 ++++++++++------------ configure.ac | 3 --- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3d0a09fe..07c45e71 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,15 +19,7 @@ AM_LDFLAGS = ./proc/libprocps.la transform = s/pscommand/ps/; $(program_transform_name) bin_PROGRAMS = \ - ps/pscommand - -sbin_PROGRAMS = \ - sysctl - -lib_LTLIBRARIES = \ - proc/libprocps.la - -usrbin_exec_PROGRAMS = \ + ps/pscommand \ free \ pgrep \ pkill \ @@ -38,6 +30,12 @@ usrbin_exec_PROGRAMS = \ vmstat \ w +sbin_PROGRAMS = \ + sysctl + +lib_LTLIBRARIES = \ + proc/libprocps.la + dist_man_MANS = \ free.1 \ pgrep.1 \ @@ -70,7 +68,7 @@ dist_procpsng_DATA = \ Documentation/FAQ if BUILD_PIDOF -usrbin_exec_PROGRAMS += pidof +bin_PROGRAMS += pidof dist_man_MANS += pidof.1 pidof_SOURCES = pidof.c lib/fileutils.c else @@ -86,7 +84,7 @@ else endif if WITH_NCURSES -usrbin_exec_PROGRAMS += \ +bin_PROGRAMS += \ slabtop \ watch \ top/top @@ -110,7 +108,7 @@ dist_procpsng_DATA += \ endif if BUILD_SKILL -usrbin_exec_PROGRAMS += \ +bin_PROGRAMS += \ skill \ snice skill_SOURCES = skill.c lib/strutils.c lib/fileutils.c lib/nsutils.c diff --git a/configure.ac b/configure.ac index 4b647415..550344e2 100644 --- a/configure.ac +++ b/configure.ac @@ -69,9 +69,6 @@ AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_STRTOD -usrbin_execdir='${exec_prefix}/usr/bin' -AC_SUBST([usrbin_execdir]) - AM_GNU_GETTEXT_VERSION([0.14.1]) AM_GNU_GETTEXT([external]) if test -d "$srcdir/po"