blob: 722cf1fb37bf2fedd05f525236457b65a3f45076 (
plain) (
blame)
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
|
# Maintainer: kj_sh604 <406hs_jk@proton.me>
pkgname=coreutils-uutils-libselinux
pkgver=0.1.0
pkgrel=1
pkgdesc='(warning: use at own risk) Cross-platform Rust rewrite of the GNU
coreutils installed as system core utilities. Built with libselinux for the
chcon and runcon binaries'
arch=('x86_64')
license=('GPL3' 'MIT')
url='https://github.com/uutils/coreutils'
conflicts=(
coreutils
b3sum
sha3sum
)
provides=(
coreutils
b3sum
sha3sum
)
depends=(
gcc-libs
glibc
libselinux
oniguruma
)
makedepends=(
cargo
clang
python-sphinx
rust
)
source=("uutils-coreutils-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
0001-update-selinux-progs.patch)
sha256sums=('55c528f2b53c1b30cb704550131a806e84721c87b3707b588a961a6c97f110d8'
'd8290988c9c8275e2087f1a63d63c420c88ebcf7c50aed0ef53d9dcd46517b36')
prepare() {
cd ${pkgname%-uutils-libselinux}-${pkgver}
# patch SELINUX_PROGS to include stty
patch -Np1 -i $srcdir/0001-update-selinux-progs.patch
}
package() {
cd ${pkgname%-uutils-libselinux}-${pkgver}
export RUSTONIG_DYNAMIC_LIBONIG=1
make install \
USE=selinux \
DESTDIR="$pkgdir" \
PREFIX=/usr \
MANDIR=/share/man/man1 \
PROG_PREFIX= \
PROFILE=release \
MULTICALL=y
# add libstdbuf.so
mkdir -p $pkgdir/usr/lib/coreutils
cd $srcdir && cd ${pkgname%-uutils-libselinux}-${pkgver}/target/release/deps
mv liblibstdbuf.so $pkgdir/usr/lib/coreutils/libstdbuf.so
# clean conflicts (archlinux ships these in other apps)
cd $pkgdir/usr/bin
rm groups hostname install kill more uptime
# symlink missing binaries
if [ -f "coreutils" ]; then
local binaries=(
"b2sum" "b3sum" "install" "md5sum" "sha1sum" "sha224sum" "sha256sum"
"sha3-224sum" "sha3-256sum" "sha3-384sum" "sha3-512sum" "sha384sum"
"sha3sum" "sha512sum" "shake128sum" "shake256sum"
)
for bin in "${binaries[@]}"; do
ln -s coreutils "$bin" || echo "warning: failed to create symlink for $bin"
done
else
echo "coreutils binary not found, skipping symlink creation."
fi
# additional cleanup
rm $pkgdir/usr/share/bash-completion/completions/*
rm $pkgdir/usr/share/man/man1/{groups.1,hostname.1,install.1,kill.1,more.1,uptime.1}
}
# vim: ts=2 sw=2 et:
|