aboutsummaryrefslogtreecommitdiff
path: root/sysutils/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/util-linux')
-rw-r--r--sysutils/util-linux/Makefile87
-rw-r--r--sysutils/util-linux/distinfo3
-rw-r--r--sysutils/util-linux/files/patch-Makefile.am27
-rw-r--r--sysutils/util-linux/files/patch-configure.ac12
-rw-r--r--sysutils/util-linux/files/patch-tests_functions.sh33
-rw-r--r--sysutils/util-linux/pkg-descr1
-rw-r--r--sysutils/util-linux/pkg-plist125
7 files changed, 288 insertions, 0 deletions
diff --git a/sysutils/util-linux/Makefile b/sysutils/util-linux/Makefile
new file mode 100644
index 000000000000..983cef9a56f0
--- /dev/null
+++ b/sysutils/util-linux/Makefile
@@ -0,0 +1,87 @@
+PORTNAME= util-linux
+DISTVERSION= 2.41.2
+CATEGORIES= sysutils
+MASTER_SITES= KERNEL_ORG/linux/utils/util-linux/v${DISTVERSION:R}/
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Random collection of Linux utilities
+WWW= https://github.com/util-linux/util-linux
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+IGNORE_i386= configure: error: could not enable timestamps after mid-January 2038.
+
+# gsed/gxargs are only TEST_DEPENDS, but we need to BINARY_ALIAS them,
+# so they need to be listed in BUILD_DEPENDS instead.
+BUILD_DEPENDS= bash:shells/bash \
+ gsed:textproc/gsed \
+ gxargs:misc/findutils
+LIB_DEPENDS= libblkid.so:filesystems/libblkid \
+ libuuid.so:misc/libuuid
+RUN_DEPENDS= bash:shells/bash
+
+USES= autoreconf gettext-tools gmake libtool ncurses pkgconfig \
+ shebangfix tar:xz
+
+USE_LDCONFIG= yes
+
+SHEBANG_FILES= misc-utils/getopt-example.bash \
+ tools/*.sh \
+ tools/git-tp-sync \
+ tests/run.sh \
+ tests/ts/*/*
+
+GNU_CONFIGURE= yes
+GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
+CONFIGURE_ARGS= --disable-nls --disable-ipcrm --disable-ipcs \
+ --disable-makeinstall-chown --disable-makeinstall-setuid \
+ --disable-asciidoc --disable-liblastlog2 \
+ --with-pkgconfigdir=${PREFIX}/libdata/pkgconfig
+
+# INSTALL_TARGET= install-strip
+TEST_ENV= PATH=${PATH}:${STAGEDIR}${PREFIX}/bin:${STAGEDIR}${PREFIX}/sbin
+TEST_TARGET= check # tests fail due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273196 - workaround use gxargs
+BINARY_ALIAS= sed=gsed xargs=gxargs
+
+CONFLICTS_INSTALL= heirloom-doctools
+
+OPTIONS_DEFINE= CAL FLOCK GETOPT HARDLINK
+OPTIONS_DEFAULT= GETOPT
+OPTIONS_SUB= yes
+
+CAL_DESC= Install util-linux cal(1)
+CAL_CONFIGURE_ENABLE= cal
+
+FLOCK_DESC= Install util-linux flock(1)
+FLOCK_RUN_DEPENDS= flock>=2:sysutils/flock
+
+GETOPT_DESC= Install util-linux getopt(1)
+GETOPT_RUN_DEPENDS= getopt>=1:misc/getopt
+
+HARDLINK_DESC= Install util-linux hardlink(1)
+HARDLINK_CONFIGURE_ENABLE=hardlink
+
+post-install: # https://github.com/karelzak/util-linux/issues/1149
+ ${RM} -r ${STAGEDIR}${DOCSDIR}
+ ${RM} -r ${STAGEDIR}${PREFIX}/include/blkid/
+ ${RM} ${STAGEDIR}${PREFIX}/share/man/man5/terminal-colors.d.5*
+ ${MV} ${STAGEDIR}${PREFIX}/sbin/fdisk ${STAGEDIR}${PREFIX}/sbin/fdisk-linux
+ ${FIND} ${STAGEDIR}${PREFIX} -name 'flock*' -delete
+ ${FIND} ${STAGEDIR}${PREFIX} -name 'getopt*' -delete
+ ${FIND} ${STAGEDIR}${PREFIX} -name 'blkid*' -delete
+ ${FIND} ${STAGEDIR}${PREFIX} -name 'libblkid*' -delete
+ ${FIND} ${STAGEDIR}${PREFIX} -name 'libuuid*' -delete
+ ${FIND} ${STAGEDIR}${PREFIX} -name 'uuid*' -delete
+ ${STRIP_CMD} \
+ ${STAGEDIR}${PREFIX}/lib/libfdisk.so.1.1.0 \
+ ${STAGEDIR}${PREFIX}/lib/libsmartcols.so.1.1.0
+
+# tests as of 2.41.2 (see https://github.com/util-linux/util-linux/issues/3767):
+# 3 tests of 337 FAILED
+#
+# misc/setpgid
+# misc/whereis
+# misc/flock
+
+.include <bsd.port.mk>
diff --git a/sysutils/util-linux/distinfo b/sysutils/util-linux/distinfo
new file mode 100644
index 000000000000..5599bc363000
--- /dev/null
+++ b/sysutils/util-linux/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1759307268
+SHA256 (util-linux-2.41.2.tar.xz) = 6062a1d89b571a61932e6fc0211f36060c4183568b81ee866cf363bce9f6583e
+SIZE (util-linux-2.41.2.tar.xz) = 9612488
diff --git a/sysutils/util-linux/files/patch-Makefile.am b/sysutils/util-linux/files/patch-Makefile.am
new file mode 100644
index 000000000000..fc5132a38224
--- /dev/null
+++ b/sysutils/util-linux/files/patch-Makefile.am
@@ -0,0 +1,27 @@
+--- Makefile.am.orig 2025-05-05 08:28:44 UTC
++++ Makefile.am
+@@ -84,7 +84,7 @@ DISTCLEANFILES =
+ CLEANFILES =
+ DISTCLEANFILES =
+
+-SUBDIRS = po
++SUBDIRS =
+
+ RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
+ -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
+@@ -95,7 +95,6 @@ EXTRA_DIST += \
+ .version \
+ autogen.sh \
+ Documentation \
+- po/update-potfiles \
+ README.licensing
+
+ include tools/Makemodule.am
+@@ -120,7 +119,6 @@ include man-common/Makemodule.am
+ include pam_lastlog2/Makemodule.am
+ include bash-completion/Makemodule.am
+ include man-common/Makemodule.am
+-include po-man/Makemodule.am
+
+ include Documentation/Makemodule.am
+ include tests/Makemodule.am
diff --git a/sysutils/util-linux/files/patch-configure.ac b/sysutils/util-linux/files/patch-configure.ac
new file mode 100644
index 000000000000..798eb638b5fa
--- /dev/null
+++ b/sysutils/util-linux/files/patch-configure.ac
@@ -0,0 +1,12 @@
+--- configure.ac.orig 2025-06-24 07:55:28 UTC
++++ configure.ac
+@@ -257,7 +257,8 @@ PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig'])
+ PKG_PROG_PKG_CONFIG
+ PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig'])
+
+-GTK_DOC_CHECK([1.10])
++AM_CONDITIONAL([ENABLE_GTK_DOC], false)
++AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], true)
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+
+
diff --git a/sysutils/util-linux/files/patch-tests_functions.sh b/sysutils/util-linux/files/patch-tests_functions.sh
new file mode 100644
index 000000000000..c0d2183eb709
--- /dev/null
+++ b/sysutils/util-linux/files/patch-tests_functions.sh
@@ -0,0 +1,33 @@
+--- tests/functions.sh.orig 2025-06-23 11:25:00 UTC
++++ tests/functions.sh
+@@ -479,8 +479,8 @@ function ts_init_suid {
+
+ # Save info about original setting
+ TS_SUID_PROGS[$ct]=$PROG
+- TS_SUID_USER[$ct]=$(stat --printf="%U" $PROG)
+- TS_SUID_GROUP[$ct]=$(stat --printf="%G" $PROG)
++ TS_SUID_USER[$ct]=$(stat -f "%Su" $PROG)
++ TS_SUID_GROUP[$ct]=$(stat -f "%Sg" $PROG)
+
+ chown root:root $PROG &> /dev/null
+ chmod u+s $PROG &> /dev/null
+@@ -688,12 +688,13 @@ function ts_cleanup_on_exit {
+ }
+
+ function ts_cleanup_on_exit {
+-
+- for idx in $(seq 0 $((${#TS_SUID_PROGS[*]} - 1))); do
+- PROG=${TS_SUID_PROGS[$idx]}
+- chmod a-s $PROG &> /dev/null
+- chown ${TS_SUID_USER[$idx]}:${TS_SUID_GROUP[$idx]} $PROG &> /dev/null
+- done
++ if [ ${#TS_SUID_PROGS[*]} -ge 1 ] ; then
++ for idx in $(seq 0 $((${#TS_SUID_PROGS[*]} - 1))); do
++ PROG=${TS_SUID_PROGS[$idx]}
++ chmod a-s $PROG &> /dev/null
++ chown ${TS_SUID_USER[$idx]}:${TS_SUID_GROUP[$idx]} $PROG &> /dev/null
++ done
++ fi
+
+ for dev in "${TS_LOOP_DEVS[@]}"; do
+ ts_device_deinit "$dev"
diff --git a/sysutils/util-linux/pkg-descr b/sysutils/util-linux/pkg-descr
new file mode 100644
index 000000000000..b8490fad7131
--- /dev/null
+++ b/sysutils/util-linux/pkg-descr
@@ -0,0 +1 @@
+util-linux is a random collection of Linux utilities.
diff --git a/sysutils/util-linux/pkg-plist b/sysutils/util-linux/pkg-plist
new file mode 100644
index 000000000000..774bb8aec5ee
--- /dev/null
+++ b/sysutils/util-linux/pkg-plist
@@ -0,0 +1,125 @@
+bin/bits
+%%CAL%%bin/cal
+bin/chrt
+bin/colcrt
+bin/colrm
+bin/column
+%%HARDLINK%%bin/hardlink
+bin/hexdump
+bin/ipcmk
+bin/isosize
+bin/logger
+bin/look
+bin/mcookie
+bin/mesg
+bin/namei
+bin/rename
+bin/renice
+bin/rev
+bin/scriptreplay
+bin/setpgid
+@comment bin/setsid
+bin/ul
+bin/wall
+bin/whereis
+include/libfdisk/libfdisk.h
+include/libsmartcols/libsmartcols.h
+lib/libfdisk.a
+lib/libfdisk.so
+lib/libfdisk.so.1
+lib/libfdisk.so.1.1.0
+lib/libsmartcols.a
+lib/libsmartcols.so
+lib/libsmartcols.so.1
+lib/libsmartcols.so.1.1.0
+libdata/pkgconfig/fdisk.pc
+libdata/pkgconfig/smartcols.pc
+sbin/cfdisk
+sbin/fdisk-linux
+sbin/findfs
+sbin/fsck.cramfs
+sbin/fsck.minix
+sbin/mkfs
+sbin/mkfs.bfs
+sbin/mkfs.cramfs
+sbin/mkfs.minix
+sbin/mkswap
+sbin/nologin
+sbin/sfdisk
+sbin/swaplabel
+sbin/wipefs
+%%CAL%%share/bash-completion/completions/cal
+share/bash-completion/completions/cfdisk
+share/bash-completion/completions/chrt
+share/bash-completion/completions/colcrt
+share/bash-completion/completions/colrm
+share/bash-completion/completions/column
+share/bash-completion/completions/fdisk
+share/bash-completion/completions/findfs
+share/bash-completion/completions/fsck.cramfs
+share/bash-completion/completions/fsck.minix
+%%HARDLINK%%share/bash-completion/completions/hardlink
+share/bash-completion/completions/hexdump
+share/bash-completion/completions/ipcmk
+share/bash-completion/completions/isosize
+share/bash-completion/completions/logger
+share/bash-completion/completions/look
+share/bash-completion/completions/mcookie
+share/bash-completion/completions/mesg
+share/bash-completion/completions/mkfs
+share/bash-completion/completions/mkfs.bfs
+share/bash-completion/completions/mkfs.cramfs
+share/bash-completion/completions/mkfs.minix
+share/bash-completion/completions/mkswap
+share/bash-completion/completions/namei
+share/bash-completion/completions/rename
+share/bash-completion/completions/renice
+share/bash-completion/completions/rev
+share/bash-completion/completions/scriptreplay
+share/bash-completion/completions/setpgid
+@comment share/bash-completion/completions/setsid
+share/bash-completion/completions/sfdisk
+share/bash-completion/completions/swaplabel
+share/bash-completion/completions/ul
+share/bash-completion/completions/wall
+share/bash-completion/completions/whereis
+share/bash-completion/completions/wipefs
+share/man/man1/bits.1.gz
+%%CAL%%share/man/man1/cal.1.gz
+share/man/man1/chrt.1.gz
+share/man/man1/colcrt.1.gz
+share/man/man1/colrm.1.gz
+share/man/man1/column.1.gz
+%%HARDLINK%%share/man/man1/hardlink.1.gz
+share/man/man1/hexdump.1.gz
+share/man/man1/ipcmk.1.gz
+share/man/man1/logger.1.gz
+share/man/man1/look.1.gz
+share/man/man1/mcookie.1.gz
+share/man/man1/mesg.1.gz
+share/man/man1/namei.1.gz
+share/man/man1/rename.1.gz
+share/man/man1/renice.1.gz
+share/man/man1/rev.1.gz
+share/man/man1/scriptreplay.1.gz
+share/man/man1/setpgid.1.gz
+@comment share/man/man1/setsid.1.gz
+share/man/man1/ul.1.gz
+share/man/man1/wall.1.gz
+share/man/man1/whereis.1.gz
+share/man/man5/scols-filter.5.gz
+share/man/man8/cfdisk.8.gz
+share/man/man8/fdisk.8.gz
+share/man/man8/findfs.8.gz
+share/man/man8/fsck.cramfs.8.gz
+share/man/man8/fsck.minix.8.gz
+share/man/man8/isosize.8.gz
+share/man/man8/mkfs.8.gz
+share/man/man8/mkfs.bfs.8.gz
+share/man/man8/mkfs.cramfs.8.gz
+share/man/man8/mkfs.minix.8.gz
+share/man/man8/mkswap.8.gz
+share/man/man8/nologin.8.gz
+share/man/man8/sfdisk.8.gz
+share/man/man8/swaplabel.8.gz
+share/man/man8/wipefs.8.gz