mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-19 02:00:06 +02:00
Also build blkid, fdisk, hexdump and uuidgen, but put fdisk in a subpackage, marked as untested, as the geometry detection is not implemented for Haiku, so the default values are not useful at all. fdisk is working fine but it does not know how to inform Haiku that a partition table was modified. Workaround: reboot.
167 lines
4.3 KiB
Bash
167 lines
4.3 KiB
Bash
SUMMARY="A random collection of Linux utilities"
|
|
DESCRIPTION="Various useful Linux utilities."
|
|
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/"
|
|
COPYRIGHT="Various Authors"
|
|
LICENSE="GNU GPL v2
|
|
GNU LGPL v2
|
|
BSD (4-clause)
|
|
Public Domain"
|
|
REVISION="1"
|
|
SOURCE_URI="https://www.kernel.org/pub/linux/utils/util-linux/v2.32/util-linux-$portVersion.tar.xz"
|
|
CHECKSUM_SHA256="6c7397abc764e32e8159c2e96042874a190303e77adceb4ac5bd502a272a4734"
|
|
SOURCE_DIR="util-linux-$portVersion"
|
|
PATCHES="util_linux-$portVersion.patchset"
|
|
|
|
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
|
|
commandSuffix=$secondaryArchSuffix
|
|
commandBinDir=$binDir
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
commandSuffix=
|
|
commandBinDir=$prefix/bin
|
|
fi
|
|
|
|
util_linuxLibs="libblkid libfdisk libsmartcols libuuid"
|
|
libblkidVersion="1.1.0"
|
|
libfdiskVersion="1.1.0"
|
|
libsmartcolsVersion="1.1.0"
|
|
libuuidVersion="1.3.0"
|
|
portVersionCompat="$portVersion compat >= 2"
|
|
for i in $util_linuxLibs; do
|
|
eval "${i}VersionCompat=\"\$${i}Version compat >= \${${i}Version%%.*}\""
|
|
done
|
|
|
|
PROVIDES="
|
|
util_linux$secondaryArchSuffix = $portVersion compat >= 2
|
|
cmd:blkid$commandSuffix = $portVersion
|
|
cmd:cal$commandSuffix = $portVersion
|
|
cmd:hexdump$commandSuffix = $portVersion
|
|
cmd:nologin$commandSuffix = $portVersion
|
|
cmd:rename$commandSuffix = $portVersion
|
|
cmd:ul$commandSuffix = $portVersion
|
|
cmd:uuidgen$commandSuffix = $portVersion
|
|
lib:libblkid$secondaryArchSuffix = $libblkidVersionCompat
|
|
lib:libfdisk$secondaryArchSuffix = $libfdiskVersionCompat
|
|
lib:libsmartcols$secondaryArchSuffix = 1.1.0 compat >= 1
|
|
lib:libuuid$secondaryArchSuffix = $libuuidVersionCompat
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libintl$secondaryArchSuffix
|
|
lib:libncursesw$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
"
|
|
|
|
SUMMARY_fdisk="A random collection of Linux utilities (fdisk)"
|
|
ARCHITECTURES_fdisk="!x86_gcc2 ?x86 ?x86_64"
|
|
SECONDARY_ARCHITECTURES="?x86"
|
|
PROVIDES_fdisk="
|
|
util_linux${secondaryArchSuffix}_fdisk = $portVersion compat >= 2
|
|
cmd:fdisk$commandSuffix = $portVersionCompat
|
|
"
|
|
REQUIRES_fdisk="
|
|
util_linux$secondaryArchSuffix == $portVersion base
|
|
haiku$secondaryArchSuffix
|
|
lib:libintl$secondaryArchSuffix
|
|
lib:libncursesw$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_devel="
|
|
util_linux${secondaryArchSuffix}_devel = $portVersion compat >= 2
|
|
devel:libblkid$secondaryArchSuffix = $libblkidVersionCompat
|
|
devel:libfdisk$secondaryArchSuffix = $libfdiskVersionCompat
|
|
devel:libsmartcols$secondaryArchSuffix = 1.1.0 compat >= 1
|
|
devel:libuuid$secondaryArchSuffix = $libuuidVersionCompat
|
|
"
|
|
REQUIRES_devel="
|
|
util_linux$secondaryArchSuffix == $portVersion base
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
devel:libintl$secondaryArchSuffix
|
|
devel:libncursesw$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:aclocal
|
|
cmd:autoconf
|
|
cmd:autom4te
|
|
cmd:automake
|
|
cmd:bison
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:gettext$secondaryArchSuffix
|
|
cmd:libtoolize$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
cmd:sed
|
|
"
|
|
|
|
BUILD()
|
|
{
|
|
export CFLAGS="-D_BSD_SOURCE -DB_USE_POSITIVE_POSIX_ERRORS"
|
|
export LDFLAGS="-lnetwork -lbsd -lposix_error_mapper"
|
|
|
|
./autogen.sh
|
|
if [ "$effectiveTargetArchitecture" = x86 ]; then
|
|
maybe_x86="scanf_cv_alloc_modifier=no"
|
|
else
|
|
maybe_x86=
|
|
fi
|
|
runConfigure --omit-dirs "binDir sbinDir" ./configure $maybe_x86 \
|
|
--bindir="$commandBinDir" --sbindir="$commandBinDir" \
|
|
--disable-all-programs \
|
|
--disable-libmount \
|
|
--disable-makedev \
|
|
--enable-blkid \
|
|
--enable-cal \
|
|
--enable-fdisk \
|
|
--enable-hexdump \
|
|
--enable-libfdisk \
|
|
--enable-libsmartcols \
|
|
--enable-libuuid \
|
|
--enable-rename \
|
|
--enable-nologin \
|
|
--enable-ul \
|
|
--enable-uuidgen \
|
|
--without-udev \
|
|
|
|
# --disable-all-programs kills several --enable-* switches, so enable them:
|
|
for i in BLKID FDISK LIBBLKID LIBFDISK HEXDUMP UUIDGEN; do
|
|
sed -i \
|
|
-e "/BUILD_${i}_TRUE/ s/\"#\"/\"\"/;" \
|
|
-e "/BUILD_${i}_FALSE/ s/\"\"/\"#\"/;" \
|
|
config.status
|
|
done
|
|
make
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make install
|
|
|
|
# Cleanup
|
|
rm -rf $prefix/sbin
|
|
|
|
rm -f "$libDir"/lib*.la
|
|
|
|
prepareInstalledDevelLibs $util_linuxLibs
|
|
fixPkgconfig
|
|
|
|
packageEntries fdisk \
|
|
"$commandBinDir"/fdisk \
|
|
"$dataDir"/bash-completion/completions/fdisk \
|
|
"$manDir"/man8/fdisk.8
|
|
|
|
packageEntries devel \
|
|
"$developDir" \
|
|
"$manDir"/man3
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
make check
|
|
}
|