-%bcond_without tests
+#
+# Conditional build:
+%bcond_with advcopy # progress bar in cp (orphaned patch)
+%bcond_without tests # do not perform "make test check"
+#
Summary: GNU Core-utils - basic command line utilities
Summary(pl.UTF-8): GNU Core-utils - podstawowe narzędzia działające z linii poleceń
Name: coreutils
-Version: 6.12
-Release: 3
+Version: 8.14
+Release: 1
License: GPL v3+
Group: Applications/System
-Source0: http://ftp.gnu.org/gnu/coreutils/%{name}-%{version}.tar.lzma
-# Source0-md5: c10ccd62490cac4de3bff5022468c9b5
+Source0: http://ftp.gnu.org/gnu/coreutils/%{name}-%{version}.tar.xz
+# Source0-md5: bcb135ce553493a45aba01b39eb3920a
Source1: %{name}-non-english-man-pages.tar.bz2
# Source1-md5: f7c986ebc74ccb8d08ed70141063f14c
Source2: DIR_COLORS
Patch4: %{name}-uname-cpuinfo.patch
Patch5: %{name}-date-man.patch
Patch6: %{name}-mem.patch
-Patch7: %{name}-install-C.patch
-Patch8: %{name}-po.patch
+Patch7: %{name}-7.4-sttytcsadrain.patch
+
Patch9: %{name}-fmt-wchars.patch
Patch10: %{name}-runuser.patch
Patch11: %{name}-split-pam.patch
Patch12: %{name}-sparc64.patch
+# http://translationproject.org/latest/coreutils/pl.po (pass through msgcat to generate shorter diff)
Patch13: %{name}-pl.po-update.patch
-Patch14: %{name}-utimens.patch
+# from http://www.beatex.org/web/advancedcopy.html, edited by shadzik
+Patch14: %{name}-advcopy.patch
URL: http://www.gnu.org/software/coreutils/
BuildRequires: acl-devel
-BuildRequires: autoconf >= 2.61
-BuildRequires: automake >= 1:1.10
+BuildRequires: attr-devel
+BuildRequires: autoconf >= 2.64
+BuildRequires: automake >= 1:1.11.1
BuildRequires: gcc >= 5:3.2
-BuildRequires: gettext-devel >= 0.16-2
+BuildRequires: gettext-devel >= 0.18.1
+BuildRequires: gmp-devel
BuildRequires: help2man
+BuildRequires: libcap-devel
BuildRequires: libselinux-devel
-BuildRequires: lzma >= 1:4.42
BuildRequires: pam-devel
BuildRequires: rpmbuild(find_lang) >= 1.24
+BuildRequires: tar >= 1:1.22
BuildRequires: texinfo >= 4.2
+BuildRequires: xz
+%if %{with tests}
+BuildRequires: strace
+%endif
Requires: pam >= 0.77.3
Requires: setup >= 2.4.6-2
Provides: coreutils-su
unexpand uniq unlink users vdir wc who whoami yes
%prep
-%setup -q -c -T -a1
-lzma -dc %{SOURCE0} | tar xf - -C ..
-%patch13 -p1
+%setup -q -a1
+#%patch13 -p1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
-%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%ifarch sparc64
%patch12 -p1
%endif
+%if %{with advcopy}
+# progress-bar patch, -g,--progress-bar //if in doubt, comment it out
%patch14 -p1
+%endif
%{__perl} -pi -e 's@GNU/Linux@PLD Linux@' m4/host-os.m4
# allow rebuilding *.gmo
-rm -f po/stamp-po
+%{__rm} po/stamp-po
+
+# fails under C locale:
+# LC_ALL=C echo -e "ça\nçb\n"|LC_ALL=C fmt -p 'ç'
+# fmt: memory exhausted
+%{__sed} -i -e 25,27d tests/misc/fmt
+
+# /etc/resolv.conf is blocked in pld builders, try some other file
+%{__sed} -i -e 's,/etc/resolv.conf,/etc/hosts,' gnulib-tests/test-read-file.c
+
+# getgid needs to be fixed:
+# getgid: missing operand
+# Try `getgid --help' for more information.
+%{__rm} tests/misc/help-version
+%{__sed} -i -e '/misc\/help-version/d' tests/Makefile.am
%build
%{__gettextize}
%configure \
CFLAGS="%{rpmcflags} -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT" \
DEFAULT_POSIX2_VERSION=199209 \
+ --disable-silent-rules \
--enable-install-program=arch \
--enable-no-install-program=hostname,kill,uptime \
--enable-pam
%{__make}
-%{?with_tests:%{__make} tests}
+%if %{with tests}
+sed -i -e 's#COLUMNS##g' tests/envvar-check
+%{__make} -j1 tests check
+%endif
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-mv -f $RPM_BUILD_ROOT%{_bindir}/{arch,basename,cat,chgrp,chmod,chown,cp,date,dd,df,\
-echo,false,id,link,ln,ls,mkdir,mknod,mktemp,mv,nice,printf,pwd,rm,rmdir,sleep,sort,\
-stty,sync,touch,true,unlink,uname} $RPM_BUILD_ROOT/bin
+mv -f $RPM_BUILD_ROOT%{_bindir}/{arch,basename,cat,chgrp,chmod,chown,cp,date,dd,\
+df,echo,false,id,link,ln,ls,mkdir,mknod,mktemp,mv,nice,printf,pwd,rm,rmdir,\
+sleep,sort,stat,stty,sync,touch,true,unlink,uname} $RPM_BUILD_ROOT/bin
mv -f $RPM_BUILD_ROOT%{_bindir}/chroot $RPM_BUILD_ROOT%{_sbindir}
# su is missed by "make install" called by non-root
-install src/su $RPM_BUILD_ROOT/bin
-install src/runuser $RPM_BUILD_ROOT/sbin
+install -p src/su $RPM_BUILD_ROOT/bin
+install -p src/runuser $RPM_BUILD_ROOT/sbin
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
-install %{SOURCE3} %{SOURCE4} $RPM_BUILD_ROOT/etc/shrc.d
-install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/su
-install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/su-l
-install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/runuser
-install %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/runuser-l
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
+cp -p %{SOURCE3} %{SOURCE4} $RPM_BUILD_ROOT/etc/shrc.d
+cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/su
+cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/su-l
+cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/runuser
+cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/runuser-l
cp -a man/pt_BR man/pt
-for d in cs da de es fi fr hu id it ja ko nl pl pt ru zh_CN ; do
+for d in cs da de es fi fr hu id it ja ko nl pl pt ru zh_CN; do
install -d $RPM_BUILD_ROOT%{_mandir}/$d/man1
- install man/$d/*.1 $RPM_BUILD_ROOT%{_mandir}/$d/man1
+ cp -p man/$d/*.1 $RPM_BUILD_ROOT%{_mandir}/$d/man1
done
install %{SOURCE9} $RPM_BUILD_ROOT%{_mandir}/pl/man1/mktemp.1
-# unwanted
+# unwanted (-f left intentionally - some manuals could have no translations)
rm -f $RPM_BUILD_ROOT%{_mandir}/*/man1/{hostname,kill,uptime}.1
+# always remove, never packaged but sometimes installed
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%find_lang %{name}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/su-l
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/runuser
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/runuser-l
-/etc/shrc.d/fileutils.csh
-/etc/shrc.d/fileutils.sh
+%config(noreplace) /etc/shrc.d/fileutils.*sh
+%dir %{_libdir}/coreutils
+%attr(755,root,root) %{_libdir}/coreutils/libstdbuf.so
%{_mandir}/man1/*
%lang(cs) %{_mandir}/cs/man1/*
%lang(da) %{_mandir}/da/man1/*