From ff369d9c86b2c5ed7a86443d4ce76da068c4e6f1 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Mon, 24 Mar 2025 14:25:32 +0800 Subject: [PATCH] enable static for LifseaOS new version ostree-prepare-root need libblkid, and ostree-prepare-root is compiled with static, so we need libblkid-devel-static rpm Signed-off-by: yuanhui --- util-linux.spec | 88 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index 4dcd223..460e64d 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,9 +1,9 @@ -%define anolis_release .0.4 +%define anolis_release .0.5 ### Header Summary: A collection of basic system utilities Name: util-linux Version: 2.32.1 -Release: 46%{anolis_release}%{?dist} +Release: 46%{anolis_release}%{?dist}%{?lifsea_dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://en.wikipedia.org/wiki/Util-linux @@ -355,6 +355,20 @@ Requires: pkgconfig This is development library and headers for fdisk-like programs, part of util-linux. +%if %{defined lifsea_dist} +%package -n libfdisk-devel-static +Summary: Development files for the filesystem detection library +License: LGPL-2.1-or-later +Group: Development/Libraries/C and C++ +Requires: libblkid-devel-static +Requires: libeconf-devel +Requires: libfdisk-devel = %{version} +Requires: libuuid-devel-static + +%description -n libfdisk-devel-static +Files needed to develop applications using the library for filesystem +detection. +%endif %package -n libsmartcols Summary: Formatting library for ls-like programs. @@ -376,6 +390,16 @@ Requires: pkgconfig This is development library and headers for ls-like terminal programs, part of util-linux. +%if %{defined lifsea_dist} +%package -n libsmartcols-devel-static +Summary: Development files for libsmartcols +License: LGPL-2.1-or-later +Group: Development/Libraries/C and C++ +Requires: libsmartcols-devel = %{version} + +%description -n libsmartcols-devel-static +Files to develop applications using the libsmartcols library. +%endif %package -n libmount Summary: Device mounting library @@ -400,6 +424,17 @@ Requires: pkgconfig This is the device mounting development library and headers, part of util-linux. +%if %{defined lifsea_dist} +%package -n libmount-devel-static +Summary: Development files for libmount +License: LGPL-2.1-or-later +Group: Development/Libraries/C and C++ +Requires: libblkid-devel-static +Requires: libmount-devel = %{version} + +%description -n libmount-devel-static +Files to develop applications using the libmount library. +%endif %package -n libblkid Summary: Block device ID library @@ -424,6 +459,17 @@ Requires: pkgconfig This is the block device identification development library and headers, part of util-linux. +%if %{defined lifsea_dist} +%package -n libblkid-devel-static +Summary: Development files for the filesystem detection library +License: LGPL-2.1-or-later +Group: Development/Libraries/C and C++ +Requires: libblkid-devel = %{version} + +%description -n libblkid-devel-static +Files needed to develop applications using the library for filesystem +detection. +%endif %package -n libuuid Summary: Universally unique ID library @@ -463,6 +509,17 @@ across a network. See also the "uuid-devel" package, which is a separate implementation. +%if %{defined lifsea_dist} +%package -n libuuid-devel-static +Summary: Development files for libuuid +License: BSD-3-Clause +Group: Development/Libraries/C and C++ +Requires: libuuid-devel = %{version} + +%description -n libuuid-devel-static +Files to develop applications using the library to generate universally +unique IDs (UUIDs). +%endif %package -n uuidd Summary: Helper daemon to guarantee uniqueness of time-based UUIDs @@ -539,6 +596,7 @@ export DAEMON_LDFLAGS="$SUID_LDFLAGS" --with-audit \ --with-utempter \ --disable-makeinstall-chown \ + %{?lifsea_dist:--enable-static} \ %ifarch s390 s390x --disable-hwclock \ --disable-fdformat @@ -645,8 +703,10 @@ rmdir ${RPM_BUILD_ROOT}%{_datadir}/doc/util-linux/getopt ln -sf ../proc/self/mounts %{buildroot}/etc/mtab +%if ! %{defined lifsea_dist} # remove static libs rm -f $RPM_BUILD_ROOT%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk}.a +%endif # temporary remove to avoid conflicts with bash-completion pkg rm -f $RPM_BUILD_ROOT%{compldir}/{mount,umount} @@ -1101,6 +1161,10 @@ fi %{_includedir}/libfdisk %{_libdir}/pkgconfig/fdisk.pc +%if %{defined lifsea_dist} +%files -n libfdisk-devel-static +%{_libdir}/libfdisk.*a +%endif %files -n libsmartcols %defattr(-,root,root) @@ -1114,6 +1178,10 @@ fi %{_includedir}/libsmartcols %{_libdir}/pkgconfig/smartcols.pc +%if %{defined lifsea_dist} +%files -n libsmartcols-devel-static +%{_libdir}/libsmartcols.*a +%endif %files -n libmount %defattr(-,root,root) @@ -1127,6 +1195,10 @@ fi %{_includedir}/libmount %{_libdir}/pkgconfig/mount.pc +%if %{defined lifsea_dist} +%files -n libmount-devel-static +%{_libdir}/libmount.*a +%endif %files -n libblkid %defattr(-,root,root) @@ -1141,6 +1213,10 @@ fi %{_mandir}/man3/libblkid.3* %{_libdir}/pkgconfig/blkid.pc +%if %{defined lifsea_dist} +%files -n libblkid-devel-static +%{_libdir}/libblkid.*a +%endif %files -n libuuid %defattr(-,root,root) @@ -1166,6 +1242,11 @@ fi %{_mandir}/man3/uuid_unparse.3* %{_libdir}/pkgconfig/uuid.pc +%if %{defined lifsea_dist} +%files -n libuuid-devel-static +%{_libdir}/libuuid.*a +%endif + %files -n %{pypkg}-libmount %defattr(-, root, root) %{!?_licensedir:%global license %%doc} @@ -1173,6 +1254,9 @@ fi %{_libdir}/python*/site-packages/libmount/ %changelog +* Mon Mar 24 2025 yuanhui 2.23.1-46.0.5 +- LifseaOS: enable static for LifseaOS + * Thu Feb 20 2025 Weisson 2.23.1-46.0.4 - bugfix: anbz 18732. - from upstream: https://github.com/util-linux/util-linux/pull/1294. -- Gitee