The make build was failing when the list of UTILS didn't contain stdbuf.
This fixes this issue by adding feat_externa_libstdbuf only when stdbuf is being compiled.
Fixes https://github.com/uutils/coreutils/issues/8701
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
When creating the `target` directory, `cargo` also creates
`target/CACHEDIR.TAG` which is important for backup tools to
know to ignore the directory.
This doesn't happen if something else creates the `target`
directory (e.g. `locales` Makefile target).
Swap the execution order to fix this.
Use external libstdbuf.so when building with make, as embedding the library
is only needed to work around "cargo install" limitations with shared libraries.
Also change default installation directory to /usr/local/libexec/coreutils/ for consistency
with GNU coreutils
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
When packaging uutils for Conda-Forge and a cross-compiled architecture,
the install of completion scripts and manpages fails with the following
error.
> .../coreutils manpage arch > .../man/arch.1
> /bin/sh: .../coreutils: Bad CPU type in executable
> make: *** [GNUmakefile:349: manpages] Error 126
When cross-compiling, the `coreutils` tool will be for a different
architecture then the build platform. So we won't be able to extract the
manpages and completions.
Provide build arguments that let us skip the build and install of
manpages and completions.
When packaging uutils for Conda-Forge, the install of completion scripts
fails with the following error.
make: /bin/sh: Argument list too long
The completion scripts are installed with a `foreach` loop that expands
into a single long command. That command hits the maximum argument
length on the build platform used by Conda-Forge.
To fix, we change the Make command to split each install into a seperate
command. This is done by embedding a newline in the command. See the
following for an example of how this works.
https://www.extrema.is/blog/2021/12/17/makefile-foreach-commands
This makes it easier to install binaries into an arch-dependent
directory (e.g. /usr/${host}/bin) while keeping arch-independent files
like the shell completions under /usr/share by specifying e.g.
PREFIX=/usr/${host} and DATAROOTDIR=/usr/share
The ToDo list was updated to mark `chcon` as done.
Building and testing `chcon` requires enabling the `feat_selinux` feature. If `make` is used for building, then please specify `SELINUX_ENABLED=1` if building and testing on a system where SELinux is not enabled.