From 63c57dca196ca34c10b9039f15085543f0dd1f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 3 Dec 2015 13:53:49 +0000 Subject: [PATCH] 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. --- coreutils-find-requires.sh | 25 +++++++++++++++++++++++++ coreutils.spec | 25 +++++++++++++++++++------ 2 files changed, 44 insertions(+), 6 deletions(-) create mode 100755 coreutils-find-requires.sh diff --git a/coreutils-find-requires.sh b/coreutils-find-requires.sh new file mode 100755 index 0000000..27d1368 --- /dev/null +++ b/coreutils-find-requires.sh @@ -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 diff --git a/coreutils.spec b/coreutils.spec index 626f42a..1cea379 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -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 - 8.24-104 +- Avoid libgmp and libcrypto dependencies from coreutils-single + * Thu Dec 03 2015 Pádraig Brady - 8.24-103 - Remove erroneous /usr/bin/kill from coreutils-single