SHA256
1
0
forked from pool/coreutils
coreutils/coreutils.spec
Bernhard Voelker e62f2bf92f Accepting request 1163997 from home:berny:branches:Base:System
- Update to 9.5:
  Bug fixes:
  * chmod -R now avoids a race where an attacker may replace a traversed file
    with a symlink, causing chmod to operate on an unintended file.
    [This bug was present in "the beginning".]
  * cp, mv, and install no longer issue spurious diagnostics like "failed
    to preserve ownership" when copying to GNU/Linux CIFS file systems.
    They do this by working around some Linux CIFS bugs.
  * cp --no-preserve=mode will correctly maintain set-group-ID bits
    for created directories.  Previously on systems that didn't support ACLs,
    cp would have reset the set-group-ID bit on created directories.
    [bug introduced in coreutils-8.20]
  * join and uniq now support multi-byte characters better.
    For example, 'join -tX' now works even if X is a multi-byte character,
    and both programs now treat multi-byte characters like U+3000
    IDEOGRAPHIC SPACE as blanks if the current locale treats them so.
  * numfmt options like --suffix no longer have an arbitrary 127-byte limit.
    [bug introduced with numfmt in coreutils-8.21]
  * mktemp with --suffix now better diagnoses templates with too few X's.
    Previously it conflated the insignificant --suffix in the error.
    [bug introduced in coreutils-8.1]
  * sort again handles thousands grouping characters in single-byte locales
    where the grouping character is greater than CHAR_MAX.  For e.g. signed
    character platforms with a 0xA0 (aka &nbsp) grouping character.
    [bug introduced in coreutils-9.1]
  * split --line-bytes with a mixture of very long and short lines
    no longer overwrites the heap (CVE-2024-0684).
    [bug introduced in coreutils-9.2]
  * tail no longer mishandles input from files in /proc and /sys file systems,
    on systems with a page size larger than the stdio BUFSIZ.
    [This bug was present in "the beginning".]
  * timeout avoids a narrow race condition, where it might kill arbitrary
    processes after a failed process fork.
    [bug introduced with timeout in coreutils-7.0]
  * timeout avoids a narrow race condition, where it might fail to
    kill monitored processes immediately after forking them.
    [bug introduced with timeout in coreutils-7.0]
  * wc no longer fails to count unprintable characters as parts of words.
    [bug introduced in textutils-2.1]
  Changes in behavior:
  * base32 and base64 no longer require padding when decoding.
    Previously an error was given for non padded encoded data.
  * base32 and base64 have improved detection of corrupted encodings.
    Previously encodings with non zero padding bits were accepted.
  * basenc --base16 -d now supports lower case hexadecimal characters.
    Previously an error was given for lower case hex digits.
  * cp --no-clobber, and mv -n no longer exit with failure status if
    existing files are encountered in the destination.  Instead they revert
    to the behavior from before v9.2, silently skipping existing files.
  * ls --dired now implies long format output without hyperlinks enabled,
    and will take precedence over previously specified formats or hyperlink
    mode.
  * numfmt will accept lowercase 'k' to indicate Kilo or Kibi units on input,
    and uses lowercase 'k' when outputting such units in '--to=si' mode.
  * pinky no longer tries to canonicalize the user's login location by default,
    rather requiring the new --lookup option to enable this often slow feature.
  * wc no longer ignores encoding errors when counting words.
    Instead, it treats them as non white space.
  New features:
  * chgrp now accepts the --from=OWNER:GROUP option to restrict changes to files
    with matching current OWNER and/or GROUP, as already supported by chown(1).
  * chmod adds support for -h, -H,-L,-P, and --dereference options, providing
    more control over symlink handling.  This supports more secure handling of
    CLI arguments, and is more consistent with chown, and chmod on other
    systems.
  * cp now accepts the --keep-directory-symlink option (like tar), to preserve
    and follow existing symlinks to directories in the destination.
  * cp and mv now accept the --update=none-fail option, which is similar
    to the --no-clobber option, except that existing files are diagnosed,
    and the command exits with failure status if existing files.
    The -n,--no-clobber option is best avoided due to platform differences.
  * env now accepts the -a,--argv0 option to override the zeroth argument
    of the command being executed.
  * mv now accepts an --exchange option, which causes the source and
    destination to be exchanged.  It should be combined with
    --no-target-directory (-T) if the destination is a directory.
    The exchange is atomic if source and destination are on a single
    file system that supports atomic exchange; --exchange is not yet
    supported in other situations.
  * od now supports printing IEEE half precision floating point with -t fH,
    or brain 16 bit floating point with -t fB, where supported by the compiler.
  * tail now supports following multiple processes, with repeated --pid options.
  Improvements:
  * cp,mv,install,cat,split now read and write a minimum of 256KiB at a time.
    This was previously 128KiB and increasing to 256KiB was seen to increase
    throughput by 10-20% when reading cached files on modern systems.
  * env,kill,timeout now support unnamed signals. kill(1) for example now
    supports sending such signals, and env(1) will list them appropriately.
  * SELinux operations in file copy operations are now more efficient,
    avoiding unneeded MCS/MLS label translation.
  * sort no longer dynamically links to libcrypto unless -R is used.
    This decreases startup overhead in the typical case.
  * wc is now much faster in single-byte locales and somewhat faster in
    multi-byte locales.
- coreutils-9.4.split-CVE-2024-0684.patch: Remove now-upstream patch.
- gnulib-readutmp-under-gdm.patch: Likewise.
- gnulib-readutmp.patch: Likewise.
- coreutils-i18n.patch: Remove multi-byte patches for join and uniq, as the
  upstream version now handles those tests.
  Pull in gnulib module mbchar manually, as it is a dependency of mbfile,
  but dropped out of the upstream dependency chain.
- coreutils-misc.patch: Remove change for gnulib-tests/test-isnanl.h.
- coreutils-fix-gnulib-time_r-tests.patch: Add upstream gnulib patch to skip
  French test if TZ='Europe/Paris' does not work.

OBS-URL: https://build.opensuse.org/request/show/1163997
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=362
2024-04-02 15:30:19 +00:00

293 lines
8.8 KiB
RPMSpec

#
# spec file for package coreutils
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# there are more fancy ways to define a package name using magic
# macros but OBS and the bots that rely on parser information from
# OBS can't deal with all of them
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "single"
%global psuffix -single
%elif "%{flavor}" == "testsuite"
%global psuffix -testsuite
%elif "%{flavor}" == "systemd"
%global psuffix -systemd
%else
%global psuffix %{nil}
%endif
Name: coreutils%{?psuffix}
Version: 9.5
Release: 0
Summary: GNU Core Utilities
License: GPL-3.0-or-later
Group: System/Base
URL: https://www.gnu.org/software/coreutils/
Source0: https://ftp.gnu.org/gnu/coreutils/coreutils-%{version}.tar.xz
Source1: https://ftp.gnu.org/gnu/coreutils/coreutils-%{version}.tar.xz.sig
Source2: https://savannah.gnu.org/project/release-gpgkeys.php?group=coreutils&download=1&file=./coreutils.keyring
Source3: baselibs.conf
Patch1: coreutils-remove_hostname_documentation.patch
Patch3: coreutils-remove_kill_documentation.patch
Patch4: coreutils-i18n.patch
Patch8: coreutils-sysinfo.patch
# OBS / RPMLINT require /usr/bin/timeout to be built with the -fpie option.
Patch100: coreutils-build-timeout-as-pie.patch
# There is no network in the build root so make the test succeed
Patch112: coreutils-getaddrinfo.patch
# Assorted fixes
Patch113: coreutils-misc.patch
# Skip 2 valgrind'ed sort tests on ppc/ppc64 which would fail due to
# a glibc issue in mkstemp.
Patch300: coreutils-skip-some-sort-tests-on-ppc.patch
Patch301: coreutils-skip-gnulib-test-tls.patch
# tests: shorten extreme-expensive factor tests
Patch303: coreutils-tests-shorten-extreme-factor-tests.patch
# Stop using Python 2.x
Patch304: coreutils-use-python3.patch
Patch500: coreutils-disable_tests.patch
Patch501: coreutils-test_without_valgrind.patch
# Downstream patch to skip a test failing on OBS.
# tests: skip tests/rm/ext3-perf.sh temporarily as it hangs on OBS.
Patch810: coreutils-skip-tests-rm-ext3-perf.patch
Patch900: coreutils-tests-workaround-make-fdleak.patch
# Upstream gnulib patch for coreutils-9.5.
Patch920: coreutils-fix-gnulib-time_r-tests.patch
BuildRequires: automake
BuildRequires: gmp-devel
BuildRequires: hostname
BuildRequires: libacl-devel
BuildRequires: libattr-devel
BuildRequires: libcap-devel
BuildRequires: libselinux-devel
BuildRequires: makeinfo
BuildRequires: perl
BuildRequires: xz
%if "%{name}" == "coreutils-systemd"
BuildRequires: pkgconfig(libsystemd)
%endif
%if 0%{?suse_version} > 1320
BuildRequires: gcc-PIE
%endif
%if "%{name}" == "coreutils-testsuite"
BuildRequires: acl
BuildRequires: gdb
BuildRequires: perl-Expect
BuildRequires: python3
BuildRequires: python3-pyinotify
BuildRequires: strace
BuildRequires: timezone
# Some tests need the 'bin' user.
BuildRequires: user(bin)
%ifarch %{ix86} x86_64 ppc ppc64 s390x armv7l armv7hl
BuildRequires: valgrind
%endif
%endif
%if "%{name}" == "coreutils" || "%{name}" == "coreutils-single"
Provides: fileutils = %{version}
Provides: mktemp = %{version}
Provides: sh-utils = %{version}
Provides: stat = %{version}
Provides: textutils = %{version}
%if "%{name}" == "coreutils-single"
Conflicts: coreutils
Provides: coreutils = %{version}-%{release}
%endif
%endif
%if "%{name}" == "coreutils-systemd"
Provides: coreutils:%{_bindir}/who
Requires: coreutils = %{version}
%endif
# ================================================
%description
These are the GNU core utilities. This package is the union of
the GNU fileutils, sh-utils, and textutils packages.
[ arch b2sum base32 base64 basename basenc cat chcon chgrp chmod chown chroot
cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand
expr factor false fmt fold groups head hostid id install join
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd readlink
realpath rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum
shred shuf sleep sort split stat stdbuf stty sum sync tac tail tee test
timeout touch tr true truncate tsort tty uname unexpand uniq unlink
uptime users vdir wc who whoami yes
%package doc
Summary: Documentation for the GNU Core Utilities
Group: Documentation/Man
Supplements: (coreutils and patterns-base-documentation)
Supplements: (coreutils-single and patterns-base-documentation)
Provides: coreutils:%{_infodir}/coreutils.info.gz
BuildArch: noarch
%description doc
This package contains the documentation for the GNU Core Utilities.
# ================================================
%lang_package
%prep
%setup -q -n coreutils-%{version}
%patch -P 4 -p1
%patch -P 1
%patch -P 3
%patch -P 8
#
%if 0%{?suse_version} <= 1320
%patch -P 100
%endif
%patch -P 112
%patch -P 113
%patch -P 300
%ifarch %{ix86} x86_64 ppc ppc64
%patch -P 301
%endif
%patch -P 303
%patch -P 304
%patch -P 500
%patch -P 501
%patch -P 810
%patch -P 900
%patch -P 920
# ================================================
%build
%if 0%{?suse_version} >= 1200
AUTOPOINT=true autoreconf -fi
%endif
export CFLAGS="%{optflags}"
%configure --libexecdir=%{_libdir} \
--enable-install-program=arch \
--enable-no-install-program=kill \
%if "%{name}" == "coreutils-single"
--enable-single-binary \
--without-openssl \
--without-gmp \
%endif
%if "%{name}" == "coreutils-systemd"
--enable-systemd \
%endif
DEFAULT_POSIX2_VERSION=200112 \
alternative=199209
%make_build -C po update-po
# Regenerate manpages
touch man/*.x
%make_build all
# make sure that parse-datetime.{c,y} ends up in debuginfo (rh#1555079)
ln -v lib/parse-datetime.{c,y} .
# ================================================
%check
%if "%{name}" == "coreutils-testsuite"
# Make our multi-byte test for sort executable
chmod a+x tests/misc/sort-mb-tests.sh
# Avoid parallel make, because otherwise some timeout based tests like
# rm/ext3-perf may fail due to high CPU or IO load.
%make_build -j1 check-very-expensive VERBOSE=yes \
&& install -d -m 755 %{buildroot}%{_docdir}/%{name} \
&& xz -c tests/test-suite.log \
> %{buildroot}%{_docdir}/%{name}/test-suite.log.xz
%else
# Run the shorter check otherwise.
%make_build check VERBOSE=yes
%endif
# ================================================
%install
%if "%{name}" == "coreutils" || "%{name}" == "coreutils-single"
make install DESTDIR=%{buildroot} pkglibexecdir=%{_libdir}/%{name}
echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1
%if "%{name}" == "coreutils"
%find_lang coreutils
# add LC_TIME directories to lang package
awk '/LC_TIME/ {a=$2; gsub(/\/[^\/]+\.mo/,"", a); print "%%dir", a} {print}' < coreutils.lang > tmp
mv tmp coreutils.lang
%else
rm -rf %{buildroot}%{_mandir}
rm -rf %{buildroot}%{_infodir}
rm -rf %{buildroot}%{_datadir}/locale
> coreutils.lang
%endif
%endif
%if "%{name}" == "coreutils-systemd"
mkdir -p %{buildroot}%{_bindir}
install src/{pinky,uptime,users,who} %{buildroot}%{_bindir}/
%endif
# ================================================
%post
%if "%{name}" == "coreutils" || "%{name}" == "coreutils-single"
%{?regenerate_initrd_post}
%endif
# ================================================
%posttrans
%if "%{name}" == "coreutils" || "%{name}" == "coreutils-single"
%{?regenerate_initrd_posttrans}
%endif
# ================================================
%files
%if "%{name}" == "coreutils" || "%{name}" == "coreutils-single"
%license COPYING
%doc NEWS README THANKS
%exclude %{_bindir}/pinky
%exclude %{_bindir}/uptime
%exclude %{_bindir}/users
%exclude %{_bindir}/who
%{_bindir}/*
%{_libdir}/%{name}
%if "%{name}" == "coreutils"
%files lang -f coreutils.lang
%files doc
%{_infodir}/coreutils.info*.gz
%{_mandir}/man1/*.1%{?ext_man}
%endif
%elif "%{name}" == "coreutils-systemd"
%license COPYING
%doc NEWS README THANKS
%{_bindir}/pinky
%{_bindir}/uptime
%{_bindir}/users
%{_bindir}/who
%else
# test-suite
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/test-suite.log.xz
%endif
# ================================================
%changelog