diff options
Diffstat (limited to 'main/util-linux/APKBUILD')
-rw-r--r-- | main/util-linux/APKBUILD | 197 |
1 files changed, 148 insertions, 49 deletions
diff --git a/main/util-linux/APKBUILD b/main/util-linux/APKBUILD index 355784acc70..aa29dc31dad 100644 --- a/main/util-linux/APKBUILD +++ b/main/util-linux/APKBUILD @@ -2,27 +2,25 @@ # Contributor: Leonardo Arena <rnalrd@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=util-linux -pkgver=2.37.3 -pkgrel=0 +pkgver=2.40 +pkgrel=1 pkgdesc="Random collection of Linux utilities" url="https://git.kernel.org/cgit/utils/util-linux/util-linux.git" arch="all" license="GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND - LGPL-2.1-or-later AND BSD-3-Clause AND BSD-4-Clause-UC AND Public-Domain" + GPL-1.0-only AND LGPL-2.1-or-later AND LGPL-1.0-only AND BSD-1-Clause AND + BSD-3-Clause AND BSD-4-Clause-UC AND MIT AND Public-Domain" checkdepends="bash findutils xz" -makedepends_build=" - autoconf - automake - libtool - " makedepends_host=" libcap-ng-dev linux-headers ncurses-dev + sqlite-dev zlib-dev " subpackages=" $pkgname-bash-completion + $pkgname-static $pkgname-dev $pkgname-openrc @@ -37,17 +35,23 @@ subpackages=" cfdisk:_mv_bin findmnt:_mv_bin flock:_mv_bin + fstrim:_mv_bin hexdump:_mv_bin logger:_mv_bin + losetup:_mv_bin lsblk:_mv_bin mcookie:_mv_bin + mount:_mv_bin partx:_mv_bin + setarch:_mv_bin setpriv:_mv_bin sfdisk:_mv_bin + umount:_mv_bin uuidgen:_mv_bin wipefs:_mv_bin " if [ -z "$BOOTSTRAP" ]; then + checkdepends="bash findutils xz procps coreutils" makedepends_build="$makedepends_build asciidoctor" makedepends_host="$makedepends_host linux-pam-dev @@ -62,13 +66,14 @@ if [ -z "$BOOTSTRAP" ]; then runuser:_mv_bin py3-libmount:_py3 " - options="!check" _bootstrap_config="--enable-runuser --with-python=3 --with-econf" else + options="!check" _bootstrap_config="--without-python --without-econf --disable-asciidoc --disable-login" fi subpackages="$subpackages $pkgname-doc $pkgname-misc" makedepends="$makedepends_build $makedepends_host" +builddir="$srcdir/util-linux-$pkgver" options="$options suid" case $pkgver in @@ -77,12 +82,18 @@ case $pkgver in esac source="https://www.kernel.org/pub/linux/utils/util-linux/v$_v/util-linux-$pkgver.tar.xz utmps.patch + 0001-libblkid-Fix-segfault-when-blkid.conf-doesn-t-exist.patch ttydefaults.h rfkill.confd rfkill.initd + su-l.pamd " # secfixes: +# 2.40-r0: +# - CVE-2024-28085 +# 2.37.4-r0: +# - CVE-2022-0563 # 2.37.3-r0: # - CVE-2021-3995 # - CVE-2021-3996 @@ -90,23 +101,27 @@ source="https://www.kernel.org/pub/linux/utils/util-linux/v$_v/util-linux-$pkgve # - CVE-2021-37600 # login utils included in subpackage util-linux-login. -_login_cmds='newgrp login lslogins nologin su sulogin' +_login_cmds='newgrp last lastb login lslogins nologin su sulogin' prepare() { default_prepare cp "$srcdir"/ttydefaults.h include/ - libtoolize --force - aclocal -I m4 - autoconf - automake --add-missing - - # FIXME: This test fails, dunno why. - rm tests/ts/col/multibyte - # FIXME: Fails on GitLab CI, but passes locally, dunno why. - rm tests/ts/misc/setarch - # XXX: Hangs on GitLab CI. - rm tests/ts/lsns/* + + # these fail on the package builders + rm -fv tests/ts/lsfd/mkfds-netlink-protocol + rm -fv tests/ts/lsfd/option-inet + # these are flakey on the package builders + rm -fv tests/ts/lsfd/mkfds-rw-character-device + rm -fv tests/ts/lsfd/mkfds-multiplexing + + case "$CARCH" in + ppc64le) + # these fail on the CI builder + rm -fv tests/ts/lsfd/mkfds-unix-stream-requiring-sockdiag + rm -fv tests/ts/lsfd/mkfds-socketpair + ;; + esac } build() { @@ -115,9 +130,11 @@ build() { # and also much more space efficient - adds 4 kiB to each binary, that's # 20 kiB in total for util-linux-*, versus 196 kiB (libskarnet.so). # TODO: Find a better way (libutmps.so w/o dependency on libskarnet.so)? - export UTMPX_CFLAGS=$(pkg-config --cflags --static utmps) - export UTMPX_LIBS=$(pkg-config --libs --static utmps) + # also throw in lto when not bootstrapping + export CFLAGS="$CFLAGS -ffat-lto-objects -flto=auto $(pkg-config --cflags --static utmps)" + export LDFLAGS="$LDFLAGS $(pkg-config --libs --static utmps)" fi + # --disable-chfn-chsh - chfn and chsh are provided by shadow package ./configure \ --build=$CBUILD \ @@ -125,15 +142,13 @@ build() { --with-sysroot=$CBUILDROOT \ --prefix=/usr \ --disable-silent-rules \ - --enable-raw \ --enable-newgrp \ --disable-uuidd \ --disable-nls \ - --disable-tls \ --disable-kill \ - --disable-last \ --disable-chfn-chsh \ --with-vendordir=/usr/lib \ + --enable-fs-paths-extra=/usr/sbin \ $_bootstrap_config make } @@ -143,14 +158,17 @@ check() { } package() { - make -j1 DESTDIR="$pkgdir" -C "$builddir" install + make DESTDIR="$pkgdir" install - # Move rev to /bin to overwrite busybox's version. - mv "$pkgdir"/usr/bin/rev "$pkgdir"/bin + # Move to /bin to overwrite busybox's version. + mv "$pkgdir"/usr/bin/getopt \ + "$pkgdir"/usr/bin/rev "$pkgdir"/bin # use pkg-config install -D -m755 "$srcdir"/rfkill.initd "$pkgdir"/etc/init.d/rfkill install -D -m644 "$srcdir"/rfkill.confd "$pkgdir"/etc/conf.d/rfkill + + install -D -m644 "$srcdir"/su-l.pamd "$pkgdir"/etc/pam.d/su-l } _mv_bin() { @@ -160,16 +178,74 @@ _mv_bin() { install_if="$pkgname=$pkgver-r$pkgrel" case "$binname" in - agetty) pkgdesc="agetty program from util-linux";; - blkid) pkgdesc="Block device identification tool from util-linux";; - cfdisk) pkgdesc="Curses based partition table manipulator from util-linux";; - flock) pkgdesc="File locker from util-linux";; - logger) pkgdesc="Logger from util-linux";; - lsblk) pkgdesc="Block device list tool from util-linux";; - runuser) pkgdesc="Run a program with substitute user and group ID";; - setpriv) pkgdesc="Run a program with different Linux privilege settings";; - sfdisk) pkgdesc="Partition table manipulator from util-linux";; - uuidgen) pkgdesc="UUID generator from util-linux";; + agetty) + license="Public-Domain" + pkgdesc="agetty program from util-linux" + ;; + blkid) + license="LGPL-1.0-only" + pkgdesc="Block device identification tool from util-linux" + ;; + cfdisk) + license="GPL-2.0-or-later" + pkgdesc="Curses based partition table manipulator from util-linux" + ;; + findmnt) + license="GPL-2.0-or-later" + pkgdesc="Find mount from util-linux" + ;; + flock) + license="MIT" + pkgdesc="File locker from util-linux" + ;; + fstrim) + license="GPL-2.0-or-later" + pkgdesc="File system trim from util-linux" + ;; + hexdump) + license="BSD-4-Clause-UC" + pkgdesc="Hexdump from util-linux" + ;; + logger) + license="BSD-4-Clause-UC" + pkgdesc="Logger from util-linux" + ;; + losetup) + license="GPL-2.0-or-later" + pkgdesc="Loop disk setup from util-linux" + ;; + lsblk) + license="GPL-2.0-or-later" + pkgdesc="Block device list tool from util-linux" + ;; + runuser) + license="GPL-2.0-or-later" + pkgdesc="Run a program with substitute user and group ID" + ;; + mcookie) + license="Public-Domain" + pkgdesc="Generate random numbers for xauth from util-linux" + ;; + partx) + license="GPL-2.0-or-later" + pkgdesc="Tell the kernel about disk partition changes from util-linux" + ;; + setpriv) + license="GPL-2.0-or-later" + pkgdesc="Run a program with different Linux privilege settings" + ;; + sfdisk) + license="GPL-1.0-or-later" + pkgdesc="Partition table manipulator from util-linux" + ;; + uuidgen) + license="GPL-1.0-only" + pkgdesc="UUID generator from util-linux" + ;; + wipefs) + license="GPL-2.0-or-later" + pkgdesc="Utility to wipe filesystems from device from util-linux" + ;; esac local dir; for dir in usr/bin usr/sbin bin sbin; do if [ -e "$pkgdir"/$dir/$binname ]; then @@ -186,16 +262,32 @@ _mv_lib() { depends= case "$libname" in - libblkid) pkgdesc="Block device identification library from util-linux";; - libfdisk) pkgdesc="Partitioning library for fdisk-like programs";; - libmount) pkgdesc="Block device identification library from util-linux";; - libsmartcols) pkgdesc="Formatting library for ls-like programs";; - libuuid) pkgdesc="DCE compatible Universally Unique Identifier library";; + libblkid) + license="LGPL-2.1-or-later" + pkgdesc="Block device identification library from util-linux" + ;; + libfdisk) + license="LGPL-2.1-or-later" + pkgdesc="Partitioning library for fdisk-like programs" + ;; + libmount) + license="LGPL-2.1-or-later" + pkgdesc="Block device identification library from util-linux" + ;; + libsmartcols) + license="LGPL-2.1-or-later" + pkgdesc="Formatting library for ls-like programs" + ;; + libuuid) + license="BSD-3-Clause" + pkgdesc="DCE compatible Universally Unique Identifier library" + ;; esac amove lib/$libname.so.* } login() { + license="GPL-2.0-or-later AND BSD-1-Clause" pkgdesc="Login utils from util-linux package: ${_login_cmds// /, }" depends="runuser=$pkgver-r$pkgrel" # Commands in conflict with shadow-login: newgrp login nologin su @@ -208,7 +300,7 @@ login() { local cmd dir for cmd in $_login_cmds; do for dir in bin sbin usr/bin usr/sbin; do - if [ -e $dir/$cmd ]; then + if [ -e $dir/$cmd ] || [ -L $dir/$cmd ]; then amove $dir/$cmd continue 2 fi @@ -216,6 +308,8 @@ login() { error "file $cmd not found" return 1 done + + amove etc/pam.d/su-l } _login_doc() { @@ -228,12 +322,14 @@ _login_doc() { amove usr/share/man/man*/$cmd.* done - find "$subpkgdir"/usr/share/man -type f -exec gzip -9 {} \; + find "$subpkgdir"/usr/share/man -type f ! -name "*.gz" \ + -exec gzip -9 {} \; } misc() { pkgdesc="Misc binaries for $pkgname" depends= + install="$pkgname-misc.post-upgrade" install_if="$pkgname=$pkgver-r$pkgrel" local dir; for dir in usr/bin usr/sbin bin sbin; do @@ -244,6 +340,7 @@ misc() { } _py3() { + license="LGPL-2.1-or-later" pkgdesc="python3 bindings to libmount" depends= @@ -251,9 +348,11 @@ _py3() { } sha512sums=" -2303b5c55b1fd932c73b0a079d37e56e10b6a20270b72d0b7e81ec7a6b715b42ebaa336714c3e1722d05e5aa4499f8be17ceaf61bb1341532bf9697c9a2174e9 util-linux-2.37.3.tar.xz -88736b554b60f836357a29f537d51658bb487dd316c92cc5160ba06bed5f8cf8e34bbfb8eb7370c4e4a2e75997a6e4bd2058201d227e41f83a18abbf4a73bdbd utmps.patch +f06e61d4ee0e196223f7341ec75a16a6671f82d6e353823490ecff17e947bb169a6b65177e3ab0da6e733e079b24d6a77905a0e8bbfed82ca9aa22a3facb6180 util-linux-2.40.tar.xz +c1c9cd816d20582438cda75a9c0ea4e687eee124e657172729aff410f52558be19cc5d649dae07c03f7618411e5aa6c23bcebc3fdf25529517a61b6b343966ef utmps.patch +d0fbba3fb3a7ca56e6c2fbe63557bac01c25389e21c51ff5c111463a96a7b8e2eacbc5d02db811dbc3807031543ec1fc759a9669ed26e059dafdce8ae16a1558 0001-libblkid-Fix-segfault-when-blkid.conf-doesn-t-exist.patch 876bb9041eca1b2cca1e9aac898f282db576f7860aba690a95c0ac629d7c5b2cdeccba504dda87ff55c2a10b67165985ce16ca41a0694a267507e1e0cafd46d9 ttydefaults.h 401d2ccbdbfb0ebd573ac616c1077e2c2b79ff03e9221007759d8ac25eb522c401f705abbf7daac183d5e8017982b8ec5dd0a5ebad39507c5bb0a9f31f04ee97 rfkill.confd -c4e7ba6d257496c99934add2ca532db16fb070ea2367554587c9fb4e24ab1d80b8ba3fd0fd4fdd5ef1374c3ec6414007369b292ee334ef23171d0232ef709db2 rfkill.initd +b0e11226c611fd52d54f599a40d23c4f748d5bd6971732dba2d25581aedaf5d2c62bcb49515d175569ff9aa1cf49a3dff25d1a5d4dcd89428c7020fc7ea3a581 rfkill.initd +0c8e764308ac1d084ebb4246eb97203de983bc0170066c958a56b412d9fd2f98da7f78f059e59512542c56a2639d6b2da35eff6469a48ebce6b2c406e94a96a7 su-l.pamd " |