reduce dependencies for coreutils-single

Don't depend on libcrypto from the multicall binary in
the coreutils-single package, because that trades space for speed.

Don't depend on libgmp from the multicall binary in
the coreutils-single package, because that only benefits
factor and expr.  The large size of gmp is not seen as
an appropriate tradeoff for this functionality.

Note also there is reduced startup overhead for all tools
with these removed due to not linking with the shared libs.
This commit is contained in:
Pádraig Brady 2015-12-03 13:53:49 +00:00 committed by Ondřej Vašík
parent 7f1720d9a2
commit 63c57dca19
2 changed files with 44 additions and 6 deletions

25
coreutils-find-requires.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh -
# Reduce requires for coreutils-single
# Needed since it has overlapping "binaries" with the main package
# Ideally we could do the following in the spec only for the single subpackage
# %define __requires_exclude_from ^(%{_bindir}|%{_sbindir})/([^c]|c[^o]|co[^r]|cor[^e])
original_find_requires="$1"
shift
# Get the list of files.
files=`sed "s/['\"]/\\\&/g"`
single_bin='/usr/bin/coreutils'
single=`echo $files | grep "$single_bin"`
echo $files | tr [:blank:] '\n' |
if [ "$single" ]; then
# Only allow the coreutils multicall binary
# Also adjust for .single renaming
sed -n 's|\(.*'"$single_bin"'\)\(.single\)\?$|\1.single|p'
else
cat
fi |
$original_find_requires

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
Release: 103%{?dist}
Release: 104%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -14,6 +14,12 @@ Source103: coreutils-DIR_COLORS.256color
Source105: coreutils-colorls.sh
Source106: coreutils-colorls.csh
# Provide our own custom requires for coreutils-single package
Source10: coreutils-find-requires.sh
%global _use_internal_dependency_generator 0
%global __find_provides %{_rpmconfigdir}/find-provides
%global __find_requires %{SOURCE10} %{_rpmconfigdir}/find-requires
# From upstream
# Our patches
@ -110,7 +116,6 @@ Requires(preun): /sbin/install-info
Requires(post): /sbin/install-info
Requires(post): grep
Requires: ncurses
Requires: gmp
Provides: fileutils = %{version}-%{release}
Provides: sh-utils = %{version}-%{release}
@ -201,13 +206,18 @@ autoconf --force
automake --copy --add-missing
for type in separate single; do
mkdir $type && \
(cd $type && ln -s ../configure && \
test $type = 'single' && configure_single='--enable-single-binary'
%configure $configure_single \
(cd $type && ln -s ../configure || exit 1
if test $type = 'single'; then
config_single='--enable-single-binary'
config_single="$config_single --without-openssl" # smaller/slower sha*sum
config_single="$config_single --without-gmp" # expr/factor machine ints
else
config_single='--with-openssl' # faster sha*sum
fi
%configure $config_single \
--cache-file=../config.cache \
--enable-install-program=arch \
--enable-no-install-program=uptime \
--with-openssl \
--with-tty-group \
DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
mkdir src # not needed with coreutils > 8.24
@ -340,6 +350,9 @@ fi
%license COPYING
%changelog
* Thu Dec 03 2015 Pádraig Brady <pbrady@redhat.com> - 8.24-104
- Avoid libgmp and libcrypto dependencies from coreutils-single
* Thu Dec 03 2015 Pádraig Brady <pbrady@redhat.com> - 8.24-103
- Remove erroneous /usr/bin/kill from coreutils-single