-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coreutils.spec
190 lines (156 loc) · 5.52 KB
/
coreutils.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# (tpg) optimize size a bit
%ifnarch riscv64
%global optflags %{optflags} -Oz -fno-strict-aliasing -fpic -Dlint --rtlib=compiler-rt
%endif
# do not make coreutils-single depend on /usr/bin/coreutils
%global __requires_exclude ^%{_bindir}/coreutils$
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 9.5
Release: 1
License: GPLv3+
Group: System/Base
Url: https://www.gnu.org/software/coreutils/
Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source1: coreutils-colorls.sh
Source2: coreutils-colorls.csh
Patch0: coreutils-9.0-clang.patch
# disable the test-lock gnulib test prone to deadlock
Patch100: coreutils-8.26-test-lock.patch
# downstream changes to default DIR_COLORS
Patch102: https://src.fedoraproject.org/rpms/coreutils/raw/rawhide/f/coreutils-8.32-DIR_COLORS.patch
#do display processor type for uname -p/-i based on uname(2) syscall
Patch103: coreutils-8.2-uname-processortype.patch
#df --direct
Patch104: coreutils-df-direct.patch
#add note about mkdir --mode behaviour into info documentation(#610559)
Patch107: coreutils-8.4-mkdir-modenote.patch
# sh-utils
#add info about TZ envvar to date manpage
Patch703: sh-utils-2.0.11-dateman.patch
# (sb) lin18nux/lsb compliance - multibyte functionality patch
# FIXME restore when ported
#Patch800: https://www.linuxfromscratch.org/patches/downloads/coreutils/coreutils-9.5-i18n-1.patch
BuildRequires: bison
BuildRequires: flex
BuildRequires: gettext
BuildRequires: strace
BuildRequires: texinfo >= 4.3
BuildRequires: pkgconfig(libacl)
BuildRequires: pkgconfig(libattr)
BuildRequires: pkgconfig(libcap)
BuildRequires: hostname
BuildRequires: gettext-devel
%rename mktemp
Provides: stat = %{version}
Provides: %{_bindir}/env
Provides: /bin/env
Provides: %{_bindir}/tr
Provides: /bin/false
Provides: /bin/true
Provides: %{_bindir}/true
Provides: %{_bindir}/false
Obsoletes: base64 < 9.0
Suggests: coreutils-doc
Conflicts: util-linux < 2.23.1-2
%description
This package is the union of the old GNU fileutils, sh-utils, and
textutils packages.
These tools are the GNU versions of common useful and popular
file & text utilities which are used for:
- file management
- shell scripts
- modifying text file (spliting, joining, comparing, modifying, ...)
Most of these programs have significant advantages over their Unix
counterparts, such as greater speed, additional options, and fewer
arbitrary limits.
%package doc
Summary: Coreutils documentation in info format
Group: Books/Computer books
Requires: coreutils
BuildArch: noarch
Conflicts: util-linux < 2.23.1-2
%description doc
This package contains coreutils documentation in GNU info format.
%prep
%autosetup -N
# will be regenerated in the build directories
rm -f src/fs.h
# will be further modified by coreutils-8.32-DIR_COLORS.patch
sed src/dircolors.hin \
-e 's| 00;36$| 01;36|' \
> DIR_COLORS
sed src/dircolors.hin \
-e 's| 01;31$| 00;31|' \
-e 's| 01;35$| 00;35|' \
> DIR_COLORS.lightbgcolor
# apply all patches
%autopatch -p1
(echo ">>> Fixing permissions on tests") 2>/dev/null
find tests -name '*.sh' -perm 0644 -print -exec chmod 0755 '{}' '+'
(echo "<<< done") 2>/dev/null
autoreconf -fiv
%build
export ac_cv_func_lchmod="no"
%configure \
--enable-largefile \
--enable-no-install-program=hostname,uptime,kill \
--enable-install-program=arch \
--without-selinux \
--with-packager="%{packager}" \
--with-packager-version="%{version}-%{release}" \
--with-packager-bug-reports="%{bugurl}" \
--enable-single-binary=symlinks \
--without-openssl \
--with-tty-group \
--enable-systemd \
DEFAULT_POSIX2_VERSION=200112 alternative=199209
%make_build
%install
%make_install
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -p -c -m644 DIR_COLORS{,.lightbgcolor} %{buildroot}%{_sysconfdir}
install -p -c -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d/colorls.sh
install -p -c -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/colorls.csh
# (tpg) compress these files
xz --text ChangeLog
# Fix conflicts with glibc
rm -rf %{buildroot}%{_datadir}/locale/*/LC_TIME
%find_lang %{name}
%files -f %{name}.lang
%config(noreplace) %{_sysconfdir}/DIR_COLORS*
%config(noreplace) %{_sysconfdir}/profile.d/*
%{_bindir}/*
%dir %{_libexecdir}/coreutils
%{_libexecdir}/coreutils/libstdbuf.so
%files doc
%doc ABOUT-NLS ChangeLog.xz NEWS THANKS TODO README
%{_infodir}/coreutils*
%{_mandir}/man*/*
%post
# FIXME this is a temporary workaround to keep
# /bin/rm hardcodes etc. working during the
# usrmerge transition.
# This has to go as soon as we can be reasonably
# sure /bin is a symlink.
# We can't just package the symlinks as we usually
# would because that will wreak havoc on systems
# where /bin already is a symlink (owning 2 conflicting
# files)
if test -d /bin -a ! -h /bin; then
sln /usr/bin/coreutils /bin/coreutils
for i in cat chgrp chmod chown chroot cp cut date echo expr false head id install ln ls mkdir mknod mktemp mv readlink realpath rm rmdir sleep sort stat tail tee test touch tr true uname uniq unlink yes; do
sln /bin/coreutils /bin/$i
done
fi
%posttrans
# Needed here again, in case our newly placed (in %%post)
# symlinks were removed again by uninstalling the
# previous version of coreutils
# (which owned those files)
if test -d /bin -a ! -h /bin; then
sln /usr/bin/coreutils /bin/coreutils
for i in cat chgrp chmod chown chroot cp cut date echo expr false head id install ln ls mkdir mknod mktemp mv readlink realpath rm rmdir sleep sort stat tail tee test touch tr true uname uniq unlink yes; do
sln /bin/coreutils /bin/$i
done
fi