diff options
| author | kj-sh604 | 2025-05-27 00:30:39 -0400 |
|---|---|---|
| committer | kj-sh604 | 2025-05-27 00:30:39 -0400 |
| commit | f9249e0b33c727ea0cbae4b0729436889c3007be (patch) | |
| tree | 2b76ed5a9c9e8234a5f415cd7601708a4c5cb11d /coreutils-uutils | |
| parent | 397c55996cc1a988804c6dbf216c6638eabddf98 (diff) | |
mod: initial `selinux` implementation
removes reliance on GNU coreutils chcon, runcon, and stty
Diffstat (limited to 'coreutils-uutils')
| -rw-r--r-- | coreutils-uutils/.SRCINFO | 20 | ||||
| -rw-r--r-- | coreutils-uutils/0001-update-selinux-progs.patch | 12 | ||||
| -rw-r--r-- | coreutils-uutils/PKGBUILD | 72 | ||||
| -rw-r--r-- | coreutils-uutils/disable_selinux.patch | 13 |
4 files changed, 50 insertions, 67 deletions
diff --git a/coreutils-uutils/.SRCINFO b/coreutils-uutils/.SRCINFO index 502e0ee..4c653bd 100644 --- a/coreutils-uutils/.SRCINFO +++ b/coreutils-uutils/.SRCINFO @@ -1,22 +1,18 @@ pkgbase = coreutils-uutils pkgdesc = (warning: use at own risk) Cross-platform Rust rewrite of the GNU coreutils being used as actual system coreutils pkgver = 0.1.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/uutils/coreutils arch = x86_64 license = GPL3 license = MIT - makedepends = rust makedepends = cargo + makedepends = clang + makedepends = libselinux makedepends = python-sphinx - depends = glibc - depends = acl - depends = attr - depends = gmp - depends = libcap - depends = openssl + makedepends = rust depends = gcc-libs - depends = libkeccak + depends = glibc depends = oniguruma provides = coreutils provides = b3sum @@ -24,11 +20,9 @@ pkgbase = coreutils-uutils conflicts = coreutils conflicts = b3sum conflicts = sha3sum - source = https://ftp.gnu.org/gnu/coreutils/coreutils-9.7.tar.xz source = uutils-coreutils-0.1.0.tar.gz::https://github.com/uutils/coreutils/archive/0.1.0.tar.gz - source = disable_selinux.patch - sha256sums = e8bb26ad0293f9b5a1fc43fb42ba970e312c66ce92c1b0b16713d7500db251bf + source = 0001-update-selinux-progs.patch sha256sums = 55c528f2b53c1b30cb704550131a806e84721c87b3707b588a961a6c97f110d8 - sha256sums = 302614165d99f04600627222ddad0444a0144fcad6a1ff59ad43fb0b3162060e + sha256sums = d8290988c9c8275e2087f1a63d63c420c88ebcf7c50aed0ef53d9dcd46517b36 pkgname = coreutils-uutils diff --git a/coreutils-uutils/0001-update-selinux-progs.patch b/coreutils-uutils/0001-update-selinux-progs.patch new file mode 100644 index 0000000..aee086f --- /dev/null +++ b/coreutils-uutils/0001-update-selinux-progs.patch @@ -0,0 +1,12 @@ +--- a/GNUmakefile ++++ b/GNUmakefile +@@ -177,7 +177,8 @@ + + SELINUX_PROGS := \ + chcon \ +- runcon ++ runcon \ ++ stty + + ifneq ($(OS),Windows_NT) + PROGS := $(PROGS) $(UNIX_PROGS) diff --git a/coreutils-uutils/PKGBUILD b/coreutils-uutils/PKGBUILD index 35f08e5..cae62bb 100644 --- a/coreutils-uutils/PKGBUILD +++ b/coreutils-uutils/PKGBUILD @@ -1,71 +1,61 @@ # Maintainer: kj_sh604 <406hs_jk@proton.me> pkgname=coreutils-uutils -_gnuver=9.7 -_uuver=0.1.0 -pkgver=${_uuver} -pkgrel=1 +pkgver=0.1.0 +pkgrel=2 pkgdesc='(warning: use at own risk) Cross-platform Rust rewrite of the GNU coreutils being used as actual system coreutils' arch=('x86_64') license=('GPL3' 'MIT') url='https://github.com/uutils/coreutils' -_url='https://www.gnu.org/software/coreutils/' -depends=('glibc' 'acl' 'attr' 'gmp' 'libcap' 'openssl' 'gcc-libs' 'libkeccak' 'oniguruma') conflicts=('coreutils' 'b3sum' 'sha3sum') provides=('coreutils' 'b3sum' 'sha3sum') -makedepends=('rust' 'cargo' 'python-sphinx') -source=("https://ftp.gnu.org/gnu/coreutils/coreutils-$_gnuver.tar.xz" - "uutils-coreutils-$_uuver.tar.gz::$url/archive/$_uuver.tar.gz" - disable_selinux.patch) -sha256sums=('e8bb26ad0293f9b5a1fc43fb42ba970e312c66ce92c1b0b16713d7500db251bf' - '55c528f2b53c1b30cb704550131a806e84721c87b3707b588a961a6c97f110d8' - '302614165d99f04600627222ddad0444a0144fcad6a1ff59ad43fb0b3162060e') +depends=( + gcc-libs + glibc + oniguruma +) +makedepends=( + cargo + clang + libselinux + python-sphinx + rust +) +source=("uutils-coreutils-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz" + 0001-update-selinux-progs.patch) +sha256sums=('55c528f2b53c1b30cb704550131a806e84721c87b3707b588a961a6c97f110d8' + 'd8290988c9c8275e2087f1a63d63c420c88ebcf7c50aed0ef53d9dcd46517b36') -prepare() { - cd coreutils-$_uuver - # the following is derived from the latest uutils-coreutils changes from Tobias Powalowski: - # disable selinux in Makefile, upstream seems broken in parameter parsing - # SELINUX_ENABLE=0 should not enable SELINUX but fails - patch -Np1 -i ../../disable_selinux.patch -} - -build() { - # build gnu coreutils that are not implemented in the MULTICALL rust uutils - cd coreutils-$_gnuver - ./configure \ - --prefix=/usr \ - --libexecdir=/usr/lib \ - --with-openssl \ - --enable-no-install-program="[, arch, b2sum, b3sum, base32, base64, basename, basenc, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, hashsum, head, hostid, hostname, id, install, join, kill, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mktemp, more, mv, nice, nl, nohup, nproc, numfmt, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm, rmdir, seq, sha1sum, sha224sum, sha256sum, sha3-224sum, sha3-256sum, sha3-384sum, sha3-512sum, sha384sum, sha3sum, sha512sum, shake128sum, shake256sum, shred, shuf, sleep, sort, split, stat, stdbuf, sum, sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort, tty, uname, unexpand, uniq, unlink, uptime, users, vdir, wc, who, whoami, yes" + prepare() { + cd ${pkgname%-uutils}-${pkgver} + # patch SELINUX_PROGS to include stty + patch -Np1 -i ../../0001-update-selinux-progs.patch } package() { + cd ${pkgname%-uutils}-${pkgver} export RUSTONIG_DYNAMIC_LIBONIG=1 - cd coreutils-$_uuver - make \ + make install \ + USE=selinux \ DESTDIR="$pkgdir" \ PREFIX=/usr \ MANDIR=/share/man/man1 \ PROG_PREFIX= \ PROFILE=release \ - MULTICALL=y \ - install - # merge specified gnu coreutils with the rust uutils - cd $srcdir && cd coreutils-$_gnuver - make DESTDIR="$pkgdir" install + MULTICALL=y # add libstdbuf.so mkdir -p $pkgdir/usr/lib/coreutils - cd $srcdir && cd coreutils-$_uuver/target/release/deps + cd $srcdir && cd ${pkgname%-uutils}-${pkgver}/target/release/deps mv liblibstdbuf.so $pkgdir/usr/lib/coreutils/libstdbuf.so - # clean conflicts, arch ships these in other apps + # 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" + "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" diff --git a/coreutils-uutils/disable_selinux.patch b/coreutils-uutils/disable_selinux.patch deleted file mode 100644 index f6a5bff..0000000 --- a/coreutils-uutils/disable_selinux.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/GNUmakefile b/GNUmakefile -index f46126a82..58bf7fbdd 100644 ---- a/GNUmakefile -+++ b/GNUmakefile -@@ -181,8 +181,6 @@ SELINUX_PROGS := \ - - ifneq ($(OS),Windows_NT) - PROGS := $(PROGS) $(UNIX_PROGS) --# Build the selinux command even if not on the system -- PROGS := $(PROGS) $(SELINUX_PROGS) - endif - - UTILS ?= $(PROGS) |
