SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "coreutils-multicall"

# SliTaz package receipt.

PACKAGE="coreutils-multicall"
VERSION="9.0"
CATEGORY="system-tools"
SHORT_DESC="Utilities for using and setting the basic system."
MAINTAINER="al.bobylev@gmail.com"
LICENSE="GPL3"
WEB_SITE="https://www.gnu.org/software/coreutils/coreutils.html"

TARBALL="coreutils-$VERSION.tar.xz"
WGET_URL="https://ftp.gnu.org/gnu/coreutils/$TARBALL"

SUGGESTED="coreutils-lang"
SIBLINGS="coreutils"
DEPENDS="acl attr glibc-base gmp libcap"
BUILD_DEPENDS="automake gmp-dev libcap-dev xz"

# What is the latest version available today?
current_version()
{
    wget -O - ${WGET_URL%/*} 2>/dev/null | \
    sed '/latest/d;/coreutils-/!d;/tar/!d;s|.*coreutils-||;s|.tar.*||' | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    # LFS: Coreutils Internationalization Fixes Patch
#    patch -Np1 -i $WOK/coreutils/stuff/coreutils-8.25-i18n-2.patch

    # SliTaz: show extended info touching CPU via uname
    patch  -p1 -i $WOK/coreutils/stuff/uname.u

    autoreconf -fi

    # bypass checking whether mknod can create fifo without root privileges
    export    FORCE_UNSAFE_CONFIGURE=1

    ./configure                \
        --enable-single-binary=symlinks    \
        $CONFIGURE_ARGS &&
    make &&
    make install

    # LFS: Move programs to the locations specified by the FHS
    mkdir -p $install/bin
    mkdir -p $install/usr/sbin
    mkdir -p $install/usr/share/man/man8

    while read i
      do
        rm $install/usr/bin/$i
        ln -s /usr/bin/coreutils    $install/bin/$i
      done <<EOT
cat
chgrp
chmod
chown
cp
date
dd
df
echo
false
ln
ls
mkdir
mknod
mv
pwd
rm
rmdir
stty
sync
true
uname
EOT
    rm $install/usr/bin/chroot
    ln -s /usr/bin/coreutils        $install/usr/sbin/chroot
    mv  $install/usr/share/man/man1/chroot.1 \
                        $install/usr/share/man/man8/chroot.8

    sed -i 's|"1"|"8"|' $install/usr/share/man/man8/chroot.8

    find $install/usr/share/man -type f -exec gzip -9 \{\} \;
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    cp -a $install/*    $fs
    # according to https://doc.slitaz.org/en:cookbook:wok
    # Generally, the base packages contain no man, info or doc files
    rm -r            $fs/usr/share
}

post_install()
{
    # Remove Busybox applets in order to not clash with ("/bin", "/sbin",
    # "/usr/bin" and "/usr/sbin" conflicts with the same filename)
    rm "$1/bin/base64"    # /usr/bin/base64
    rm "$1/bin/kill"    # /usr/bin/kill
    rm "$1/bin/mktemp"    # /usr/bin/mktemp
    rm "$1/bin/nice"    # /usr/bin/nice
    rm "$1/bin/printenv"    # /usr/bin/printenv
    rm "$1/bin/sleep"    # /usr/bin/sleep
    rm "$1/bin/stat"    # /usr/bin/stat
    rm "$1/bin/touch"    # /usr/bin/touch
}

post_remove()
{
    # Restore all Busybox applets that have been replaced

    # /bin:
    while read i
      do
        busybox ln -s busybox "$1/bin/$i"
      done <<EOT
base64
cat
chgrp
chmod
chown
cp
date
dd
df
echo
false
kill
ln
ls
mkdir
mknod
mktemp
mv
nice
printenv
pwd
rm
rmdir
sleep
stat
stty
sync
touch
true
uname
EOT

    # /usr/bin:
    while read i
      do
        busybox ln -s /bin/busybox "$1/usr/bin/$i"
      done <<EOT
[
basename
cksum
comm
cut
dirname
du
env
expand
expr
fold
groups
head
hostid
id
install
logname
md5sum
mkfifo
nohup
od
printf
readlink
realpath
seq
sha1sum
sha256sum
sha512sum
sort
split
sum
tac
tail
tee
test
timeout
tr
tty
unexpand
uniq
uptime
users
wc
who
whoami
yes
EOT

    # /usr/sbin:
    busybox ln -s /bin/busybox "$1/usr/sbin/chroot"
}
6025 packages and 203653 files in current database (Sun Jun 2 07:10:57 2024)