# # spec file for package util-linux # # Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "" %define ulbuild base %define ulmode full %endif # All python flavors are build separately. No module can be built together with base. # This is a limitation of %%python_subpackages. %if "%{flavor}" == "python" %define ulbuild python %define ulmode full %endif %if "%{flavor}" == "mini" %define psuffix -mini %define ulbuild base %define ulmode bootstrap %define ul_extra_bin_sbin 0 %else %if !0%{?usrmerged} %define ul_extra_bin_sbin 1 %else %define ul_extra_bin_sbin 0 %endif %endif %define _name util-linux %if ! %{defined _distconfdir} %define _distconfdir %{_sysconfdir} %else %define no_config 1 %endif %if "%ulmode" == "full" %define ulprefix %{_prefix} %define ulexecprefix %{_exec_prefix} %define ulbindir %{_bindir} %define ullibdir %{_libdir} %define ullibexecdir %{_libexecdir} %define ulincludedir %{_includedir} %define ulsbindir %{_sbindir} %define uldatadir %{_datadir} %define ulmandir %{_mandir} %define ulinfodir %{_infodir} %define uldocdir %{_docdir} %define uldistconfdir %{_distconfdir} %define ulsysconfdir %{_sysconfdir} %define ulpamdir %{_pam_vendordir} %else %define ulprefix %{_libexecdir}/build/staging %define ulexecprefix %{_libexecdir}/build/staging %define ulbindir %{ulprefix}/bin %define ullibdir %{ulprefix}/%{_lib} %define ullibexecdir %{ulprefix}/libexec %define ulincludedir %{ulprefix}/include %define ulsbindir %{ulprefix}/sbin %define uldatadir %{ulprefix}/share %define ulmandir %{uldatadir}/man %define ulinfodir %{uldatadir}/info %define uldocdir %{uldatadir}/doc %define uldistconfdir %{ulprefix}/etc %define ulsysconfdir %{ulprefix}/etc # HACK: We have to provide a non-functional PAM directory to make packages non-conflicting. %define ulpamdir %{ulsysconfdir}/pam.d %endif %if "%ulbuild" == "base" %if "%ulmode" == "full" Name: util-linux Summary: A collection of basic system utilities %else Name: util-linux-mini Summary: A collection of basic system utilities (bootstrap package) %endif Group: System/Base %else %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-libmount Summary: Python bindings for the libmount library Group: Development/Languages/Python %endif Version: 2.38.1 Release: 0 License: GPL-2.0-or-later URL: https://www.kernel.org/pub/linux/utils/util-linux/ Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.37/util-linux-%{version}.tar.xz Source2: util-linux-login_defs-check.sh Source6: etc_filesystems Source7: baselibs.conf Source8: login.pamd Source9: remote.pamd Source10: su.pamd Source11: su.default Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.37/util-linux-%{version}.tar.sign Source13: %{_name}.keyring Source14: runuser.pamd Source15: runuser-l.pamd Source16: su-l.pamd Source51: blkid.conf # PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff Patch1: libmount-print-a-blacklist-hint-for-unknown-filesyst.patch Patch2: Add-documentation-on-blacklisted-modules-to-mount-8-.patch # PATCH-FIX-SUSE util-linux-bash-completion-su-chsh-l.patch bsc1172427 -- Fix "su -s" bash completion. Patch4: util-linux-bash-completion-su-chsh-l.patch BuildRequires: audit-devel BuildRequires: bc BuildRequires: binutils-devel BuildRequires: fdupes BuildRequires: gettext-devel BuildRequires: libcap-ng-devel BuildRequires: libeconf-devel BuildRequires: libselinux-devel BuildRequires: libsepol-devel BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: pam-devel BuildRequires: pkg-config BuildRequires: readline-devel BuildRequires: utempter-devel BuildRequires: zlib-devel # util-linux is part of VMInstall, but we can well build without it # Helps shorten a cycle and eliminate a bootstrap issue #!BuildIgnore: util-linux %ifarch ppc ppc64 ppc64le BuildRequires: librtas-devel %endif %if "%ulmode" == "full" BuildRequires: bash-completion BuildRequires: file-devel BuildRequires: libudev-devel BuildRequires: socat BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(libsystemd) BuildRequires: rubygem(asciidoctor) Requires: adjtimex Requires: time Requires: which PreReq: %install_info_prereq permissions %systemd_requires %endif %if "%ulbuild" == "base" %if "%ulmode" == "full" Provides: fsck-with-dev-lock = %{version} # bnc#651598: Provides: util-linux(fake+no-canonicalize) Provides: eject = 2.1.0 Provides: login = 4.0 Provides: rfkill = 0.5 # File conflict of eject (up to 12.3 and SLE11). Obsoletes: eject <= 2.1.0 # File conflict of login (up to 12.1 and SLE11). Obsoletes: login <= 4.0 # File conflict (man page) of rfkill (up to Leap 15 and SLE 15). Obsoletes: rfkill <= 0.5 # util-linux-2.34 integrates hardlink (up to Leap 15.1 and SLE15 SP1). # The last version was 1.0+git.e66999f. Provides: hardlink = 1.1 Obsoletes: hardlink < 1.1 # util-linux-systemd was a SUSE specific package split. Now the staging is done in -mini package. # (before Leap 16 and SLE15 SP6) Provides: util-linux-systemd = %{version} Obsoletes: util-linux-systemd < 2.38 # bnc#805684: %ifarch s390x Obsoletes: s390-32 Provides: s390-32 Provides: util-linux-mini = %{version} Obsoletes: util-linux-mini <= %{version} %endif Supplements: filesystem(minix) # All login.defs variables require support from shadow side. # Upgrade this symbol version only if new variables appear! # Verify by shadow-login_defs-check.sh from shadow source package. Recommends: login_defs-support-for-util-linux >= 2.37 %endif Requires(pre): group(tty) # The problem with inconsistent /proc/self/mountinfo read is fixed in kernel 5.8. # util-linux >= 2.37 no more contain work-around. Conflicts: kernel < 5.8 %endif %if "%ulbuild" == "python" BuildRequires: %{python_module devel} %python_subpackages %endif #HACK: Change to 1 to make quilt happy. Change to 0 to build. %if 0 %description -n python-libmount %endif %if "%ulbuild" == "base" %description This package contains a large variety of low-level system utilities that are necessary for a Linux system to function. It contains the mount program, the fdisk configuration tool, and more. %if "%ulmode" == "bootstrap" This is a special version of the util-linux package for the build bootstrap. It is not intended for a standard use. %endif %if "%ulmode" == "full" %package -n libblkid1 Summary: Filesystem detection library License: LGPL-2.1-or-later Group: System/Libraries %description -n libblkid1 Library for filesystem detection. %package -n libblkid-devel Summary: Development files for the filesystem detection library License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ Requires: libblkid1 = %{version} %description -n libblkid-devel Files needed to develop applications using the library for filesystem detection. %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. %package -n libfdisk1 Summary: Filesystem detection library License: LGPL-2.1-or-later Group: System/Libraries %description -n libfdisk1 Library for filesystem detection. %package -n libfdisk-devel Summary: Development files for the filesystem detection library License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ Requires: libfdisk1 = %{version} %description -n libfdisk-devel Files needed to develop applications using the library for filesystem detection. %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: libfdisk-devel = %{version} %description -n libfdisk-devel-static Files needed to develop applications using the library for filesystem detection. %package -n libmount1 Summary: Device mount library License: LGPL-2.1-or-later Group: System/Libraries %description -n libmount1 Library designed to be used in low-level utils like mount(8) and /usr/sbin/mount. helpers. %package -n libmount-devel Summary: Development files for libmount License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ Requires: libmount1 = %{version} %description -n libmount-devel Files to develop applications using the libmount library. %package -n libmount-devel-static Summary: Development files for libmount License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ Requires: libmount-devel = %{version} %description -n libmount-devel-static Files to develop applications using the libmount library. %package -n libsmartcols1 Summary: Column-based text sort engine License: LGPL-2.1-or-later Group: System/Libraries %description -n libsmartcols1 Library to sort human readable column-based text output. %package -n libsmartcols-devel Summary: Development files for libsmartcols License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ Requires: libsmartcols1 = %{version} %description -n libsmartcols-devel Files to develop applications using the libsmartcols library. %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. %package -n libuuid1 Summary: Library to generate UUIDs License: BSD-3-Clause Group: System/Libraries %description -n libuuid1 A library to generate universally unique IDs (UUIDs). %package -n libuuid-devel Summary: Development files for libuuid License: BSD-3-Clause Group: Development/Libraries/C and C++ Requires: libuuid1 = %{version} %description -n libuuid-devel Files to develop applications using the library to generate universally unique IDs (UUIDs). %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). %package -n uuidd Summary: Helper daemon to guarantee uniqueness of time-based UUIDs License: GPL-2.0-or-later Group: System/Filesystems Requires(pre): group(uuidd) # uuidd bash-completion moved to a correct package Conflicts: util-linux < 2.25 # uuid-runtime appeared in SLE11 SP1 to SLE11 SP3 Provides: uuid-runtime = %{version} Obsoletes: uuid-runtime <= 2.19.1 %systemd_requires %description -n uuidd The uuidd package contains a userspace daemon (uuidd) which guarantees uniqueness of time-based UUID generation even at very high rates on SMP systems. %lang_package %endif %endif %if "%ulbuild" == "python" %description This package contains the Python bindings for util-linux libmount library. %endif %prep %setup -q -n %{_name}-%{version} cp -a %{S:2} . %autopatch -p1 # This test randomly fails or keeps hanging task inside build chroot (tested on 2.38). rm tests/ts/lsns/ioctl_ns %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects export SUID_CFLAGS="-fpie" export SUID_LDFLAGS="-pie" export LDFLAGS="-Wl,-z,relro,-z,now" export CFLAGS="%{optflags} -D_GNU_SOURCE" export CXXFLAGS="%{optflags} -D_GNU_SOURCE" # Here we define a build function. For the base build, we use it as it # is. For python build, we use it repeatedly for all flavors. function configure_and_build() { %if "%ulbuild" == "python" %define _configure ../configure %endif # #AUTOPOINT=true GTKDOCIZE=true autoreconf -vfi # All dirs needs to be specified, as %%configure does not derive them # from %%_prefix, and bootstrap build will fall back to /usr. %configure\ --prefix=%{ulprefix}\ --exec-prefix=%{ulexecprefix}\ --disable-silent-rules\ --bindir=%{ulbindir}\ --sbindir=%{ulsbindir}\ --sysconfdir=%{ulsysconfdir}\ --datadir=%{uldatadir}\ --includedir=%{ulincludedir}\ --libdir=%{ullibdir}\ --libexecdir=%{ullibexecdir}\ --mandir=%{ulmandir}\ --infodir=%{ulinfodir}\ --docdir=%{uldocdir}/%{name}\ --disable-makeinstall-chown\ --disable-makeinstall-setuid\ --with-audit\ --with-btrfs\ --with-gnu-ld\ --with-ncursesw\ --with-readline\ --with-selinux\ --with-utempter\ --with-bashcompletiondir=%{uldatadir}/bash-completion/completions\ --with-systemdsystemunitdir=%{_unitdir}\ --enable-libuuid-force-uuidd\ --enable-sulogin-emergency-mount\ --disable-use-tty-group\ --disable-rpath\ --enable-all-programs\ --disable-chfn-chsh\ --disable-newgrp\ --disable-vipw\ --disable-pg\ --enable-fs-paths-default="/sbin:/usr/sbin"\ %if "%ulmode" == "bootstrap" --disable-static\ --without-systemd\ --disable-nls\ --disable-uuidd\ %else --enable-static\ --with-systemd\ %endif %if "%ulbuild" == "python" --disable-all-programs\ --with-python\ --enable-pylibmount\ --enable-libmount\ --enable-libblkid\ %else --without-python\ %endif --with-vendordir=%{uldistconfdir} make %{?_smp_mflags} } %if "%ulbuild" == "base" configure_and_build %endif %if "%ulbuild" == "python" %{python_expand export PYTHON=$python mkdir -p build.$python cd build.$python configure_and_build cd .. } %endif %install %if "%ulbuild" == "base" %make_install mkdir -p %{buildroot}{%{uldistconfdir}/default,%{ulpamdir},%{ulsysconfdir}/issue.d} install -m 644 %{SOURCE51} %{buildroot}%{ulsysconfdir}/blkid.conf install -m 644 %{SOURCE8} %{buildroot}%{ulpamdir}/login install -m 644 %{SOURCE9} %{buildroot}%{ulpamdir}/remote install -m 644 %{SOURCE14} %{buildroot}%{ulpamdir}/runuser install -m 644 %{SOURCE15} %{buildroot}%{ulpamdir}/runuser-l install -m 644 %{SOURCE10} %{buildroot}%{ulpamdir}/su install -m 644 %{SOURCE16} %{buildroot}%{ulpamdir}/su-l install -m 644 %{SOURCE11} %{buildroot}%{uldistconfdir}/default/su sed 's/\bsu\b/runuser/g' <%{SOURCE11} >runuser.default install -m 644 runuser.default %{buildroot}%{uldistconfdir}/default/runuser rm -fv "%{buildroot}/%{ulsbindir}/raw" "%{buildroot}/sbin/raw" \ "%{buildroot}/%{ulmandir}/man8/raw.8"* install -m 644 %{SOURCE6} %{buildroot}%{ulsysconfdir}/filesystems echo -e "#!/bin/sh\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{ulsbindir}/flushb chmod 755 %{buildroot}%{ulsbindir}/flushb # arch dependent %ifarch s390 s390x rm -f %{buildroot}%{ulsysconfdir}/fdprm rm -f %{buildroot}%{ulbindir}/setterm rm -f %{buildroot}%{ulsbindir}/fdformat rm -f %{buildroot}%{ulsbindir}/hwclock rm -f %{buildroot}%{ulsbindir}/tunelp rm -f %{buildroot}%{ulmandir}/man8/fdformat.8* rm -f %{buildroot}%{ulmandir}/man8/hwclock.8* rm -f %{buildroot}%{ulmandir}/man8/tunelp.8* %endif %ifarch ia64 %sparc m68k rm -f %{buildroot}%{ulmandir}/man8/cfdisk.8* rm -f %{buildroot}%{ulmandir}/man8/sfdisk.8* rm -f %{buildroot}%{ulsbindir}/cfdisk rm -f %{buildroot}%{ulsbindir}/sfdisk %endif %ifarch ia64 m68k rm -f %{buildroot}%{ulsbindir}/fdisk rm -f %{buildroot}%{ulmandir}/man8/fdisk.8* %endif # create list of setarch(8) symlinks find %{buildroot}%{ulmandir}/man8 -regextype posix-egrep \ -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)\.8.*" \ -printf "%{ulmandir}/man8/%f*\n" >> %{name}.files find %{buildroot}%{ulbindir}/ -regextype posix-egrep -type l \ -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)$" \ -printf "%{ulbindir}/%f\n" >> %{name}.files mkdir -p %{buildroot}%{_sharedstatedir}/libuuid mkdir -p %{buildroot}/run/uuidd # clock.txt from uuidd is a ghost file touch %{buildroot}%{_sharedstatedir}/libuuid/clock.txt %if %{ul_extra_bin_sbin} mkdir -p %{buildroot}{/bin,/sbin} for i in dmesg findmnt kill logger lsblk more mount su umount; do if test -f "%{buildroot}%{ulbindir}/$i" ; then ln -s "%{ulbindir}/$i" "%{buildroot}/bin/" fi done for i in agetty blockdev cfdisk ctrlaltdel fdisk fsck.minix fsck.cramfs\ hwclock losetup mkfs mkfs.bfs mkfs.minix mkfs.cramfs mkswap nologin\ pivot_root raw sfdisk swapoff swapon blkid findfs fsck switch_root\ wipefs fsfreeze swaplabel fstrim chcpu; do if test -f "%{buildroot}%{ulsbindir}/$i" ; then ln -s "%{ulsbindir}/$i" "%{buildroot}/sbin/" fi done # login is always and only in /bin mv %{buildroot}%{ulbindir}/login %{buildroot}/bin/ %endif %if "%ulmode" == "full" ln -sf /sbin/service %{buildroot}%{ulsbindir}/rcuuidd ln -sf /sbin/service %{buildroot}%{ulsbindir}/rcfstrim %find_lang %{name} %{name}.lang %endif %if "%ulmode" == "bootstrap" rm -r %{buildroot}{%{ulmandir},%{ulincludedir},%{ullibdir}/{pkgconfig,*.{la,so}},%{uldocdir}} mkdir -p %{buildroot}/etc/profile.d echo -e 'PATH=$PATH:%{ulsbindir}:%{ulbindir}\nexport PATH' >%{buildroot}/etc/profile.d/%{name}.sh %endif %endif %if "%ulbuild" == "python" %{python_expand cd build.$python %make_install rm %{buildroot}%{$python_sitearch}/libmount/*.*a cd .. } # There is a limitation: python module needs to build much more, and install even more. Delete it. rm -r %{buildroot}{%{ulbindir},%{ulmandir},%{uldatadir},%{ulincludedir},%{ullibdir}/{lib,pkg}*} %endif # link duplicate manpages or python bindings %fdupes -s %{buildroot}%{ulprefix} %if "%ulbuild" == "base" %if "%ulmode" == "full" %check # Perform testsuite with the standard build only. # mark some tests "known_fail" # %if 0%{?qemu_user_space_build} export TS_OPT_fdisk_gpt_known_fail="yes" export TS_OPT_fdisk_oddinput_known_fail="yes" export TS_OPT_fdisk_sunlabel_known_fail="yes" export TS_OPT_fincore_count_known_fail="yes" export TS_OPT_libfdisk_gpt_known_fail="yes" export TS_OPT_misc_flock_known_fail="yes" export TS_OPT_misc_ionice_known_fail="yes" export TS_OPT_misc_swaplabel_known_fail="yes" export TS_OPT_kill_name_to_number_known_fail="yes" export TS_OPT_kill_print_pid_known_fail="yes" export TS_OPT_kill_queue_known_fail="yes" export TS_OPT_uuid_uuidd_known_fail="yes" # unsupported syscall in script(1) ... might be fixed in qemu export TS_OPT_script_known_fail="yes" # may segfault on qemu-user-space export TS_OPT_misc_setarch_known_fail="yes" %endif # Succeeds in local build, fails in OBS. export TS_OPT_hardlink_options_known_fail="yes" export TS_OPT_lsfd_mkfds_rw_character_device_known_fail="yes" export TS_OPT_lsfd_mkfds_symlink_known_fail="yes" # This does not work with a chroot build: / is not a mountpoint export TS_OPT_misc_mountpoint_known_fail="yes" # # hacks export PATH="$PATH:/sbin:/usr/sbin" # # do the check but don't abort yet result="0" make %{?_smp_mflags} check || result="1" # # always show test diffs (inclusive known_fail) and exit result diffs_files="$(find tests/diff -type f | sort)" echo "$diffs_files" | xargs -r cat exit "$result" %endif %verifyscript %verify_permissions -e %{ulbindir}/wall -e %{ulbindir}/write -e %{ulbindir}/mount -e %{ulbindir}/umount %verify_permissions -e %{ulbindir}/su %pre # move outdated pam.d/*.rpmsave files away for i in login remote runuser runuser-l su su-l ; do test -f /etc/pam.d/${i}.rpmsave && mv -v /etc/pam.d/${i}.rpmsave /etc/pam.d/${i}.rpmsave.old ||: done %if "%ulmode" == "full" %service_add_pre fstrim.service fstrim.timer %endif %post %set_permissions %{ulbindir}/wall %{ulbindir}/write %{ulbindir}/mount %{ulbindir}/umount %set_permissions %{ulbindir}/su %if "%ulmode" == "full" %if ! %{defined no_config} # # If outdated PAM file is detected, issue a warning. for PAM_FILE in login remote runuser runuser-l su su-l ; do if test -f %{ulsysconfdir}/pam.d/$PAM_FILE.rpmnew ; then echo "Your %{ulsysconfdir}/pam.d/$PAM_FILE is outdated. Please check %{ulsysconfdir}/pam.d/$PAM_FILE.rpmnew!" >&2 fi done # # /etc/default/su is tagged as noreplace. # But we want to migrate variables to /etc/login.defs (bsc#1121197). # Perform one-time config replace. # Applies for: Update from SLE11, online update for SLE15 SP1, Leap15.1. # Not needed for /etc/default/runuser. It was first packaged after the change. if ! grep -q "^# /etc/default/su is an override" %{ulsysconfdir}/default/su ; then if test -f %{ulsysconfdir}/default/su.rpmnew ; then if ! test -f %{ulsysconfdir}/default/su.rpmorig ; then cp -a %{ulsysconfdir}/default/su %{ulsysconfdir}/default/su.rpmorig fi mv %{ulsysconfdir}/default/su.rpmnew %{ulsysconfdir}/default/su echo "One time clean-up of %{ulsysconfdir}/default/su was performed." >&2 echo "Original contents was saved to %{ulsysconfdir}/default/su.rpmorig." >&2 echo "Please edit %{ulsysconfdir}/login.defs or %{ulsysconfdir}/default/su to restore your customization." >&2 fi fi %endif %service_add_post fstrim.service fstrim.timer %preun %service_del_preun fstrim.service fstrim.timer %postun %service_del_postun fstrim.service fstrim.timer %if %{defined no_config} %posttrans # Migration to /usr/etc. for i in login remote runuser runuser-l su su-l; do test -f /etc/pam.d/${i}.rpmsave && mv -v /etc/pam.d/${i}.rpmsave /etc/pam.d/${i} ||: done %endif %post -n libblkid1 -p /sbin/ldconfig %postun -n libblkid1 -p /sbin/ldconfig %post -n libmount1 -p /sbin/ldconfig %postun -n libmount1 -p /sbin/ldconfig %post -n libsmartcols1 -p /sbin/ldconfig %postun -n libsmartcols1 -p /sbin/ldconfig %post -n libuuid1 -p /sbin/ldconfig %postun -n libuuid1 -p /sbin/ldconfig %post -n libfdisk1 -p /sbin/ldconfig %postun -n libfdisk1 -p /sbin/ldconfig %if 0%{?suse_version} >= 1330 %pre -n uuidd %else %pre -n uuidd getent group uuidd >/dev/null || /usr/sbin/groupadd -r uuidd getent passwd uuidd >/dev/null || \ /usr/sbin/useradd -r -g uuidd -c "User for uuidd" \ -d %{_localstatedir}/run/uuidd uuidd %endif %{service_add_pre uuidd.socket uuidd.service} %post -n uuidd # Fix running instance paths during live upgrade from # Leap = 15, SLE = 15 (boo#1113188). # Useful for Tumbleweed or zypper dup only. mv /run/run/uuidd /run/uuidd >/dev/null 2>&1 || : rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || : %{service_add_post uuidd.socket uuidd.service} %preun -n uuidd %{service_del_preun uuidd.socket uuidd.service} %postun -n uuidd %{service_del_postun uuidd.socket uuidd.service} %endif %files -n %{name} -f %{name}.files %defattr(-,root,root) # # Common files for all archs %doc AUTHORS ChangeLog README NEWS %license README.licensing %license COPYING %license Documentation/licenses/* %attr(-,uuidd,uuidd) %dir %{_sharedstatedir}/libuuid %attr(-,uuidd,uuidd) %ghost %{_sharedstatedir}/libuuid/clock.txt %config(noreplace) %{ulsysconfdir}/filesystems %config(noreplace) %{ulsysconfdir}/blkid.conf %if %{defined no_config} %{ulpamdir}/login %{ulpamdir}/remote %{ulpamdir}/runuser %{ulpamdir}/runuser-l %{ulpamdir}/su %{ulpamdir}/su-l %if 0%{?suse_version} <= 1520 %dir %{uldistconfdir}/default %endif %{uldistconfdir}/default/runuser %{uldistconfdir}/default/su %else %config(noreplace) %{ulsysconfdir}/pam.d/login %config(noreplace) %{ulsysconfdir}/pam.d/remote %config(noreplace) %{ulsysconfdir}/pam.d/runuser %config(noreplace) %{ulsysconfdir}/pam.d/runuser-l %config(noreplace) %{ulsysconfdir}/pam.d/su %config(noreplace) %{ulsysconfdir}/pam.d/su-l %config(noreplace) %{ulsysconfdir}/default/runuser %config(noreplace) %{ulsysconfdir}/default/su %endif %config %dir %{ulsysconfdir}/issue.d %if %{ul_extra_bin_sbin} /bin/findmnt /bin/kill %verify(not mode) %attr(4755,root,root) /bin/su /bin/dmesg /bin/more %verify(not mode) %attr(4755,root,root) /bin/mount %verify(not mode) %attr(4755,root,root) /bin/umount /bin/login /bin/logger /bin/lsblk /sbin/agetty /sbin/blockdev /sbin/ctrlaltdel /sbin/fsck.minix /sbin/fsck.cramfs /sbin/losetup /sbin/mkfs /sbin/mkfs.bfs /sbin/mkfs.minix /sbin/mkfs.cramfs /sbin/mkswap /sbin/nologin /sbin/pivot_root /sbin/swapoff /sbin/swapon /sbin/blkid /sbin/findfs /sbin/fsck /sbin/switch_root /sbin/wipefs /sbin/fsfreeze /sbin/swaplabel /sbin/fstrim /sbin/chcpu %endif %{ulbindir}/kill %verify(not mode) %attr(4755,root,root) %{ulbindir}/su %{ulbindir}/eject %{ulbindir}/cal %{ulbindir}/chmem %{ulbindir}/choom %{ulbindir}/chrt %{ulbindir}/col %{ulbindir}/colcrt %{ulbindir}/colrm %{ulbindir}/column %{ulbindir}/dmesg %{ulbindir}/fallocate %{ulbindir}/fincore %{ulbindir}/findmnt %{ulbindir}/flock %{ulbindir}/getopt %{ulbindir}/hardlink %{ulbindir}/hexdump %{ulbindir}/ionice %{ulbindir}/ipcmk %{ulbindir}/ipcrm %{ulbindir}/ipcs %{ulbindir}/irqtop %{ulbindir}/isosize %{ulbindir}/last %{ulbindir}/lastb %{ulbindir}/line %{ulbindir}/logger %{ulbindir}/look %if !%{ul_extra_bin_sbin} %{ulbindir}/login %endif %{ulbindir}/lsblk %{ulbindir}/lscpu %{ulbindir}/lsfd %{ulbindir}/lsipc %{ulbindir}/lsirq %{ulbindir}/lslocks %{ulbindir}/lslogins %{ulbindir}/lsmem %{ulbindir}/lsns %{ulbindir}/mcookie %{ulbindir}/mesg %{ulbindir}/more %verify(not mode) %attr(4755,root,root) %{ulbindir}/mount %{ulbindir}/namei %{ulbindir}/nsenter %{ulbindir}/prlimit %{ulbindir}/rename %{ulbindir}/renice %{ulbindir}/rev %{ulbindir}/script %{ulbindir}/scriptlive %{ulbindir}/scriptreplay %{ulbindir}/setarch %{ulbindir}/setpriv %{ulbindir}/setsid %{ulbindir}/taskset %{ulbindir}/uclampset %{ulbindir}/ul %verify(not mode)%attr(4755,root,root) %{ulbindir}/umount %{ulbindir}/unshare %{ulbindir}/mountpoint %{ulbindir}/utmpdump %{ulbindir}/uuidgen %{ulbindir}/uuidparse %{ulbindir}/uname26 %{ulbindir}/wdctl %{ulsbindir}/addpart %{ulsbindir}/agetty %{ulsbindir}/blkid %{ulsbindir}/blkdiscard # blkzone depends on linux/blkzoned.h %if 0%{?suse_version} >= 1330 %{ulsbindir}/blkzone %endif %{ulsbindir}/blockdev %{ulsbindir}/chcpu %{ulsbindir}/ctrlaltdel %{ulsbindir}/delpart %{ulsbindir}/findfs %{ulsbindir}/fsck %{ulsbindir}/fsck.minix %{ulsbindir}/fsck.cramfs %{ulsbindir}/fsfreeze %{ulsbindir}/fstrim %{ulsbindir}/ldattach %{ulsbindir}/losetup %{ulsbindir}/mkfs %{ulsbindir}/mkfs.bfs %{ulsbindir}/mkfs.minix %{ulsbindir}/mkfs.cramfs %{ulsbindir}/mkswap %{ulsbindir}/nologin %{ulsbindir}/partx %{ulsbindir}/pivot_root %{ulsbindir}/resizepart %{ulsbindir}/rfkill %{ulsbindir}/rtcwake %{ulsbindir}/runuser %{ulsbindir}/sulogin %{ulsbindir}/swaplabel %{ulsbindir}/swapoff %{ulsbindir}/swapon %{ulsbindir}/switch_root %{ulsbindir}/wipefs %verify(not mode) %attr(0755,root,tty) %{ulbindir}/wall %{ulbindir}/whereis %verify(not mode) %attr(0755,root,tty) %{ulbindir}/write %{ulsbindir}/zramctl %{ulsbindir}/flushb %{ulsbindir}/readprofile %{uldatadir}/bash-completion/completions/* %if "%ulmode" == "bootstrap" /etc/profile.d/%{name}.sh %endif # # Common files for all archs not intended for mini package %if "%ulmode" == "full" %exclude %{uldatadir}/bash-completion/completions/uuidd # util-linux documentation files %doc Documentation/blkid.txt %doc Documentation/cal.txt %doc Documentation/col.txt %doc Documentation/deprecated.txt %doc Documentation/getopt.txt %doc Documentation/howto-debug.txt %doc Documentation/hwclock.txt %doc Documentation/modems-with-agetty.txt %doc Documentation/mount.txt %doc Documentation/pg.txt %{uldocdir}/%{name}/getopt-example.* %{ulmandir}/man1/kill.1.gz %{ulmandir}/man1/su.1.gz %{ulmandir}/man1/cal.1.gz %{ulmandir}/man1/choom.1.gz %{ulmandir}/man1/chrt.1.gz %{ulmandir}/man1/col.1.gz %{ulmandir}/man1/colcrt.1.gz %{ulmandir}/man1/colrm.1.gz %{ulmandir}/man1/column.1.gz %{ulmandir}/man1/dmesg.1.gz %{ulmandir}/man1/eject.1.gz %{ulmandir}/man1/fallocate.1.gz %{ulmandir}/man1/fincore.1.gz %{ulmandir}/man1/flock.1.gz %{ulmandir}/man1/getopt.1.gz %{ulmandir}/man1/hardlink.1.gz %{ulmandir}/man1/hexdump.1.gz %{ulmandir}/man1/ipcrm.1.gz %{ulmandir}/man1/ipcs.1.gz %{ulmandir}/man1/last.1.gz %{ulmandir}/man1/lastb.1.gz %{ulmandir}/man1/line.1.gz %{ulmandir}/man1/login.1.gz %{ulmandir}/man1/look.1.gz %{ulmandir}/man1/logger.1.gz %{ulmandir}/man1/lscpu.1.gz %{ulmandir}/man1/lsfd.1.gz %{ulmandir}/man1/lsipc.1.gz %{ulmandir}/man1/lsirq.1.gz %{ulmandir}/man1/lslogins.1.gz %{ulmandir}/man8/lsblk.8.gz %{ulmandir}/man1/lsmem.1.gz %{ulmandir}/man1/mcookie.1.gz %{ulmandir}/man1/mesg.1.gz %{ulmandir}/man1/more.1.gz %{ulmandir}/man1/namei.1.gz %{ulmandir}/man1/nsenter.1.gz %{ulmandir}/man1/ionice.1.gz %{ulmandir}/man1/irqtop.1.gz %{ulmandir}/man1/prlimit.1.gz %{ulmandir}/man1/rename.1.gz %{ulmandir}/man1/rev.1.gz %{ulmandir}/man1/renice.1.gz %{ulmandir}/man1/setpriv.1.gz %{ulmandir}/man1/setsid.1.gz %{ulmandir}/man1/script.1.gz %{ulmandir}/man1/scriptlive.1.gz %{ulmandir}/man1/scriptreplay.1.gz %{ulmandir}/man1/setterm.1.gz %{ulmandir}/man1/taskset.1.gz %{ulmandir}/man1/ul.1.gz %{ulmandir}/man1/unshare.1.gz %{ulmandir}/man1/wall.1.gz %{ulmandir}/man1/whereis.1.gz %{ulmandir}/man1/write.1.gz %{ulmandir}/man1/ipcmk.1.gz %{ulmandir}/man1/mountpoint.1.gz %{ulmandir}/man1/runuser.1.gz %{ulmandir}/man1/uclampset.1.gz %{ulmandir}/man1/utmpdump.1.gz %{ulmandir}/man1/uuidgen.1.gz %{ulmandir}/man1/uuidparse.1.gz %{ulmandir}/man5/adjtime_config.5.gz %{ulmandir}/man5/fstab.5.gz %{ulmandir}/man5/terminal-colors.d.5.gz %{ulmandir}/man8/addpart.8.gz %{ulmandir}/man8/agetty.8.gz %if 0%{?suse_version} >= 1330 %{ulmandir}/man8/blkzone.8.gz %endif %{ulmandir}/man8/blockdev.8.gz %{ulmandir}/man8/chmem.8.gz %{ulmandir}/man8/ctrlaltdel.8.gz %{ulmandir}/man8/delpart.8.gz %{ulmandir}/man8/blkid.8.gz %{ulmandir}/man8/blkdiscard.8.gz %{ulmandir}/man8/switch_root.8.gz %{ulmandir}/man8/mkfs.bfs.8.gz %{ulmandir}/man8/mkfs.minix.8.gz %{ulmandir}/man8/findfs.8.gz %{ulmandir}/man8/fsck.8.gz %{ulmandir}/man8/fsck.cramfs.8.gz %{ulmandir}/man8/fsck.minix.8.gz %{ulmandir}/man8/isosize.8.gz %{ulmandir}/man8/ldattach.8.gz %{ulmandir}/man8/losetup.8.gz %{ulmandir}/man8/lslocks.8.gz %{ulmandir}/man8/lsns.8.gz %{ulmandir}/man8/mkfs.8.gz %{ulmandir}/man8/mkfs.cramfs.8.gz %{ulmandir}/man8/mkswap.8.gz %{ulmandir}/man8/mount.8.gz %{ulmandir}/man8/nologin.8.gz %{ulmandir}/man8/fsfreeze.8.gz %{ulmandir}/man8/swaplabel.8.gz %{ulmandir}/man8/readprofile.8.gz %{ulmandir}/man8/rfkill.8.gz %{ulmandir}/man8/chcpu.8.gz %{ulmandir}/man8/partx.8.gz %{ulmandir}/man8/pivot_root.8.gz %{ulmandir}/man8/rtcwake.8.gz %{ulmandir}/man8/setarch.8.gz %{ulmandir}/man8/swapoff.8.gz %{ulmandir}/man8/swapon.8.gz %{ulmandir}/man8/umount.8.gz %{ulmandir}/man8/uname26.8.gz %{ulmandir}/man8/wipefs.8.gz %{ulmandir}/man8/zramctl.8.gz %{ulmandir}/man8/findmnt.8.gz %{ulmandir}/man8/fstrim.8.gz %{ulmandir}/man8/resizepart.8.gz %{ulmandir}/man8/sulogin.8.gz %{ulmandir}/man8/wdctl.8.gz %{ulsbindir}/rcfstrim %{_unitdir}/fstrim.service %{_unitdir}/fstrim.timer %endif # # Files not common for all architectures %ifnarch ia64 m68k %if %{ul_extra_bin_sbin} /sbin/fdisk %endif %{ulsbindir}/fdisk %if "%ulmode" == "full" %{ulmandir}/man8/fdisk.8.gz %endif %endif %ifnarch %sparc ia64 m68k %if "%ulmode" == "full" %{ulmandir}/man8/cfdisk.8.gz %{ulmandir}/man8/sfdisk.8.gz %endif %if %{ul_extra_bin_sbin} /sbin/cfdisk /sbin/sfdisk %endif %{ulsbindir}/cfdisk %{ulsbindir}/sfdisk %endif %ifnarch s390 s390x %{ulsbindir}/fdformat %if %{ul_extra_bin_sbin} /sbin/hwclock %endif %{ulsbindir}/hwclock %{ulbindir}/setterm %{ulsbindir}/tunelp %if "%ulmode" == "full" %{ulmandir}/man8/fdformat.8.gz %{ulmandir}/man8/hwclock.8.gz %{ulmandir}/man8/tunelp.8.gz %endif %endif # mini package needs to own all sub-filesystem file %if "%ulmode" == "bootstrap" %dir %{_libexecdir}/build %dir %{ulprefix} %dir %{ulbindir} %dir %{ullibdir} %dir %{ulsbindir} %dir %{uldatadir} %dir %{uldatadir}/bash-completion %dir %{uldatadir}/bash-completion/completions %dir %{ulsysconfdir} %dir %{ulsysconfdir}/default %dir %{ulsysconfdir}/pam.d %endif %if "%ulmode" == "full" %files -n libblkid1 %defattr(-, root, root) %endif %{ullibdir}/libblkid.so.1 %{ullibdir}/libblkid.so.1.* %if "%ulmode" == "full" %files -n libfdisk1 %defattr(-, root, root) %endif %{ullibdir}/libfdisk.so.1 %{ullibdir}/libfdisk.so.1.* %if "%ulmode" == "full" %files -n libmount1 %defattr(-, root, root) %endif %{ullibdir}/libmount.so.1 %{ullibdir}/libmount.so.1.* %if "%ulmode" == "full" %files -n libsmartcols1 %defattr(-, root, root) %endif %{ullibdir}/libsmartcols.so.1 %{ullibdir}/libsmartcols.so.1.* %if "%ulmode" == "full" %files -n libuuid1 %defattr(-, root, root) %endif %{ullibdir}/libuuid.so.1 %{ullibdir}/libuuid.so.1.* # # devel, lang and uuidd files are not packaged in staging mode # and packaged separately in full mode %if "%ulmode" == "full" # HACK: We have to use "%%files -n" here, otherwise python lua code will # issue an error, even if it is inside a false condition. %files -n %{name}-lang -f %{name}.lang %files -n libblkid-devel %defattr(-, root, root) %{ullibdir}/libblkid.so %dir %{ulincludedir}/blkid %{ulincludedir}/blkid/blkid.h %{ullibdir}/pkgconfig/blkid.pc %{ulmandir}/man3/libblkid.3.gz %files -n libblkid-devel-static %defattr(-, root, root) %{ullibdir}/libblkid.*a %files -n libfdisk-devel %defattr(-, root, root) %{ullibdir}/libfdisk.so %dir %{ulincludedir}/libfdisk %{ulincludedir}/libfdisk/libfdisk.h %{ullibdir}/pkgconfig/fdisk.pc %files -n libfdisk-devel-static %defattr(-, root, root) %{ullibdir}/libfdisk.*a %files -n libmount-devel %defattr(-, root, root) %{ullibdir}/libmount.so %dir %{ulincludedir}/libmount %{ulincludedir}/libmount/libmount.h %{ullibdir}/pkgconfig/mount.pc %files -n libmount-devel-static %defattr(-, root, root) %{ullibdir}/libmount.*a %files -n libsmartcols-devel %defattr(-, root, root) %{ullibdir}/libsmartcols.so %dir %{ulincludedir}/libsmartcols %{ulincludedir}/libsmartcols/libsmartcols.h %{ullibdir}/pkgconfig/smartcols.pc %files -n libsmartcols-devel-static %defattr(-, root, root) %{ullibdir}/libsmartcols.*a %files -n libuuid-devel %defattr(-, root, root) %{ullibdir}/libuuid.so %dir %{ulincludedir}/uuid %{ulincludedir}/uuid/uuid.h %{ullibdir}/pkgconfig/uuid.pc %{ulmandir}/man3/uuid* %files -n libuuid-devel-static %defattr(-, root, root) %{ullibdir}/libuuid.*a %files -n uuidd %defattr(-, root, root) %{ulsbindir}/uuidd %attr(-,uuidd,uuidd) %dir %{_sharedstatedir}/libuuid %attr(-,uuidd,uuidd) %ghost %{_sharedstatedir}/libuuid/clock.txt %attr(-,uuidd,uuidd) %ghost %dir /run/uuidd %{uldatadir}/bash-completion/completions/uuidd %{ulmandir}/man8/uuidd.8.gz %{ulsbindir}/rcuuidd %{_unitdir}/uuidd.service %{_unitdir}/uuidd.socket %endif %endif %if "%ulbuild" == "python" %files %{python_files} %defattr(-, root, root) %{python_sitearch}/libmount %endif %changelog