wok-next view coreutils/receipt @ rev 21020
Cleaning is almost finished... I should proceed to upgrades.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 02 14:15:08 2018 +0200 (2018-11-02) |
parents | 49a10d2a7814 |
children | 303e20b105cd |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="coreutils"
4 VERSION="8.30"
5 CATEGORY="meta"
6 SHORT_DESC="Utilities for using and setting the basic system"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://www.gnu.org/software/coreutils/coreutils.html"
10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter05/coreutils.html"
12 TARBALL="$PACKAGE-$VERSION.tar.xz"
13 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
15 BUILD_DEPENDS="automake autoconf gettext-dev xz libcap-dev gmp-dev patch \
16 texinfo openssl-dev"
17 SPLIT="\
18 $PACKAGE-character $PACKAGE-command $PACKAGE-conditions \
19 $PACKAGE-context-system $PACKAGE-context-user $PACKAGE-context-working \
20 $PACKAGE-directory $PACKAGE-disk $PACKAGE-file-attributes \
21 $PACKAGE-file-format $PACKAGE-file-output-full $PACKAGE-file-output-part \
22 $PACKAGE-file-sort $PACKAGE-file-special $PACKAGE-file-summarize \
23 $PACKAGE-line $PACKAGE-numeric $PACKAGE-operations \
24 $PACKAGE-path $PACKAGE-print $PACKAGE-redirection \
25 $PACKAGE-multicall:multi"
27 compile_rules() {
28 case $SET in
29 multi) SET_ARGS='--enable-single-binary=symlinks';;
30 *) SET_ARGS='';;
31 esac
32 # Rebuild fixed translations
33 msgfmt po/nb.po -o po/nb.gmo
34 msgfmt po/sl.po -o po/sl.gmo
36 autoreconf -fi
38 FORCE_UNSAFE_CONFIGURE=1 \
39 ./configure \
40 --with-openssl \
41 $SET_ARGS \
42 $CONFIGURE_ARGS &&
43 make &&
44 make install || return 1
46 # LFS: Move programs to the locations specified by the FHS
47 mkdir -p \
48 $install/bin \
49 $install/usr/sbin \
50 $install/usr/share/man/man8
52 while read from to; do
53 case $SET in
54 multi)
55 rm $install$from
56 # make relative symlinks
57 case $to in
58 /bin/*) ln -s ../usr/bin/coreutils $install$to;;
59 *) ln -s ../bin/coreutils $install$to;;
60 esac
61 ;;
62 *)
63 mv $install$from $install$to
64 ;;
65 esac
66 done <<EOT
67 /usr/bin/cat /bin/cat
68 /usr/bin/chgrp /bin/chgrp
69 /usr/bin/chmod /bin/chmod
70 /usr/bin/chown /bin/chown
71 /usr/bin/cp /bin/cp
72 /usr/bin/date /bin/date
73 /usr/bin/dd /bin/dd
74 /usr/bin/df /bin/df
75 /usr/bin/echo /bin/echo
76 /usr/bin/false /bin/false
77 /usr/bin/kill /bin/kill
78 /usr/bin/ln /bin/ln
79 /usr/bin/ls /bin/ls
80 /usr/bin/mkdir /bin/mkdir
81 /usr/bin/mknod /bin/mknod
82 /usr/bin/mv /bin/mv
83 /usr/bin/pwd /bin/pwd
84 /usr/bin/rm /bin/rm
85 /usr/bin/rmdir /bin/rmdir
86 /usr/bin/stty /bin/stty
87 /usr/bin/sync /bin/sync
88 /usr/bin/true /bin/true
89 /usr/bin/uname /bin/uname
90 /usr/bin/chroot /usr/sbin/chroot
91 EOT
92 mv $install/usr/share/man/man1/chroot.1 \
93 $install/usr/share/man/man8/chroot.8
94 sed -i 's|"1"|"8"|' $install/usr/share/man/man8/chroot.8
95 }
97 genpkg_rules() {
98 DEPENDS="glibc-base" # default
99 case $PACKAGE in
100 coreutils)
101 DEPENDS=${SPLIT/coreutils-multicall:multi} # all but coreutils-multicall
102 TAGS="LFS"
103 ;;
104 *-character)
105 copy expand tr unexpand
106 CAT="system-tools|operate on characters"
107 ;;
108 *-command)
109 copy env kill nice nohup sleep stdbuf timeout libstdbuf.so chroot
110 CAT="system-tools|commands"
111 ;;
112 *-conditions)
113 copy false true [ expr test
114 CAT="system-tools|conditions"
115 DEPENDS="glibc-base gmp"
116 ;;
117 *-context-system)
118 copy date uname chcon hostid nproc runcon uptime
119 CAT="system-tools|system context"
120 ;;
121 *-context-user)
122 copy groups id logname pinky users who whoami
123 CAT="system-tools|user context"
124 ;;
125 *-context-working)
126 copy pwd stty printenv tty
127 CAT="system-tools|working context"
128 ;;
129 *-directory)
130 copy ls dir dircolors vdir
131 CAT="system-tools|list directories"
132 DEPENDS="glibc-base libcap"
133 ;;
134 *-disk)
135 copy df sync du stat truncate
136 CAT="system-tools|work with disks"
137 ;;
138 *-file-attributes)
139 copy chgrp chmod chown touch
140 CAT="system-tools|change file attributes"
141 ;;
142 *-file-format)
143 copy fmt fold pr
144 CAT="system-tools|format file contents"
145 ;;
146 *-file-output-full)
147 copy cat base32 base64 nl od tac
148 CAT="system-tools|output entire files"
149 ;;
150 *-file-output-part)
151 copy csplit head split tail
152 CAT="system-tools|output file parts"
153 ;;
154 *-file-sort)
155 copy comm ptx shuf sort tsort uniq
156 CAT="system-tools|operate on sorted files"
157 DEPENDS="glibc-base openssl" # openssl for `sort`
158 ;;
159 *-file-special)
160 copy ln mkdir mknod rmdir link mkfifo mktemp readlink realpath unlink
161 CAT="system-tools|work with special file types"
162 ;;
163 *-file-summarize)
164 copy b2sum cksum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum sum wc
165 CAT="system-tools|summarize files"
166 DEPENDS="glibc-base openssl"
167 ;;
168 *-line)
169 copy cut join paste
170 CAT="system-tools|operate on fields within a line"
171 ;;
172 *-numeric)
173 copy factor seq
174 CAT="system-tools|numeric"
175 DEPENDS="glibc-base gmp"
176 ;;
177 *-operations)
178 copy cp dd mv install rm shred
179 CAT="system-tools|perform basic operations"
180 DEPENDS="glibc-base acl attr"
181 ;;
182 *-path)
183 copy basename dirname pathchk
184 CAT="system-tools|perform path manipulation"
185 ;;
186 *-print)
187 copy echo numfmt printf yes
188 CAT="system-tools|print text"
189 ;;
190 *-redirection)
191 copy tee
192 CAT="system-tools|redirection"
193 ;;
194 *-multicall)
195 copy @std
196 CAT="system-tools|packed in single binary like Busybox"
197 DEPENDS="glibc-base acl attr gmp libcap openssl"
198 ;;
199 esac
200 }
202 # Remove Busybox applets in order to not clash with ("/bin", "/sbin",
203 # "/usr/bin" and "/usr/sbin" conflicts with the same filename)
205 # for /usr/bin/nice /usr/bin/sleep
206 post_install_coreutils_command() {
207 for i in nice sleep; do
208 readlink "$1/bin/$i" | grep -q busybox && rm "$1/bin/$i"
209 done
210 :
211 }
212 # for /usr/bin/printenv
213 post_install_coreutils_context_working() {
214 readlink "$1/bin/printenv" | grep -q busybox && rm "$1/bin/printenv"
215 :
216 }
217 # for /usr/bin/stat
218 post_install_coreutils_disk() {
219 readlink "$1/bin/stat" | grep -q busybox && rm "$1/bin/stat"
220 :
221 }
222 # for /usr/bin/touch
223 post_install_coreutils_file_attributes() {
224 readlink "$1/bin/touch" | grep -q busybox && rm "$1/bin/touch"
225 :
226 }
227 # for /usr/bin/base64
228 post_install_coreutils_file_output_full() {
229 readlink "$1/bin/base64" | grep -q busybox && rm "$1/bin/base64"
230 :
231 }
232 # for /usr/bin/mktemp
233 post_install_coreutils_file_special() {
234 readlink "$1/bin/mktemp" | grep -q busybox && rm "$1/bin/mktemp"
235 :
236 }
237 # for /usr/bin/base64 /usr/bin/mktemp /usr/bin/nice /usr/bin/printenv
238 # /usr/bin/sleep /usr/bin/stat /usr/bin/touch
239 post_install_coreutils_multicall() {
240 for i in base64 mktemp nice printenv sleep stat touch; do
241 readlink "$1/bin/$i" | grep -q busybox && rm "$1/bin/$i"
242 done
243 :
244 }