changeset 1035:885652bb25c2

core/util-linux: add more documentation
author David Demelier <markand@malikania.fr>
date Fri, 30 Aug 2019 21:45:00 +0200
parents 4b7330e49c3f
children 97cbce8be985
files core/util-linux/util-linux.sh
diffstat 1 files changed, 47 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/core/util-linux/util-linux.sh	Fri Aug 30 21:40:00 2019 +0200
+++ b/core/util-linux/util-linux.sh	Fri Aug 30 21:45:00 2019 +0200
@@ -15,6 +15,25 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
+#
+# User notes
+# ----------
+#
+# This package provides both libraries and utilities. Some libraries like
+# libuuid, libblkid are dependencies of other packages. Vanilla does not split
+# util-linux in different packages like many distribution do.
+#
+# Since util-linux tools override busybox utilities, users who only want
+# util-linux libraries may specify the COMPONENTS option to either "no" or a
+# space-separated list of individual components to build.
+#
+# Example:
+#
+# COMPONENTS="no" (only build libraries)
+# COMPONENTS="fdisk mountpoint" (will build libraries, fdisk and mountpoint)
+# COMPONENTS="yes" (will build almost everything, the default)
+#
+
 PKGNAME=util-linux
 PKGVERSION=2.33.1
 PKGREVISION=1
@@ -31,11 +50,11 @@
 : ${LIBS:=}
 : ${AUDIT:=no}
 : ${COLORS:=yes}
-: ${COMPONENTS:=}
+: ${COMPONENTS:=yes}
 : ${NCURSES:=yes}
 : ${NLS:=yes}
 : ${PYTHON:=yes}
-: ${SELINUX:=no}
+: ${SELINUX:=no}        # TODO: add dependencies once selinux is available.
 
 if [ "$AUDIT" = "yes" ]; then
 	with_audit="--with-audit"
@@ -43,13 +62,20 @@
 	with_audit="--without-audit"
 fi
 
-if [ -n "$COMPONENTS" ]; then
+case $COMPONENTS in
+"yes")
+	with_components="--enable-all-programs"
+	;;
+"no")
+	with_components="--disable-all-programs"
+	;;
+*)
 	with_components="--disable-all-programs"
 
 	for c in $COMPONENTS; do
 		with_components="$with_components --enable-$c"
 	done
-fi
+esac
 
 if [ "$COLORS" = "yes" ]; then
 	with_colors="--enable-colors-default"
@@ -83,9 +109,17 @@
 	tar xvf $PKGNAME-$PKGVERSION.tar.xz
 	cd $PKGNAME-$PKGVERSION
 
+	# All these tools are provided by shadow instead:
+	# --disable-chfn-chsh
+	# --disable-chsh
+	# --disable-login
+	# --disable-nologin
+	# --disable-su
+	# --disable-vipw
+
+	# The configure.ac script has hardcoded /sbin checks.
 	sed -i -e 's|/sbin|/bin|' configure.ac
 	autoreconf -vif
-	# chfn, chsh, login, nologin, su, vipw, vigr are provided by shadow.
 	CC="$CC" \
 	CFLAGS="$CFLAGS" \
 	LDFLAGS="$LDFLAGS" \
@@ -93,17 +127,21 @@
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
+		--prefix= \
 		--bindir=/bin \
+		--libdir=/lib \
+		--sbindir=/bin \
+		--disable-chfn-chsh \
 		--disable-gtk-doc \
-		--disable-chfn-chsh \
 		--disable-login \
 		--disable-nologin \
 		--disable-su \
 		--disable-vipw \
+		--enable-libblkid \
+		--enable-libmount \
+		--enable-libsmartcols \
+		--enable-libuuid \
 		--enable-shared \
-		--libdir=/lib \
-		--prefix= \
-		--sbindir=/bin \
 		--without-systemd \
 		$with_audit \
 		$with_colors \