Compare commits

...
Sign in to create a new pull request.

36 commits

Author SHA1 Message Date
Python Maint
a0317f94b5 Rebuilt for Python 3.15.0b4 ABI change 2026-07-22 10:16:14 +02:00
Fedora Release Engineering
9213a0ec8f Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild 2026-07-17 08:18:23 +00:00
Karel Zak
d3c879ee06 upgrade to upstream release v2.42.2 2026-06-16 14:56:23 +02:00
Python Maint
e20697608b Rebuilt for Python 3.15 2026-06-03 17:43:18 +02:00
Karel Zak
62e94b8fcb revert util-linux-i18n noarch (rhbz#2453891) 2026-05-20 11:07:37 +02:00
Karel Zak
49c5ecdbfb make util-linux-i18n noarch (rhbz#2453891) 2026-05-20 10:28:46 +02:00
Karel Zak
ad160404f2 fix pam_lastlog2 patch to modify only Makefile.in 2026-05-19 13:49:26 +02:00
Karel Zak
f891325268 upgrade to upstream release v2.42.1
- fix pam_lastlog2 libpam linking (rhbz#2453457)
2026-05-19 13:29:13 +02:00
Karel Zak
da7125e4bb upgrade to upstream release v2.42 2026-04-02 14:26:48 +02:00
Fedora Release Engineering
196be3f2a1 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-17 19:43:43 +00:00
Nuo Cheng
47417a6e2e Update util-linux-su.pamd
fix variables not set in /etc/environment through command 'su --login'
2026-01-12 12:21:28 +01:00
Karel Zak
4737f2d702 enable BuildRequires for parsers 2026-01-12 12:15:47 +01:00
Karel Zak
06dbf9bb28 fix built on new gcc (bison based code and libblkid API) 2026-01-12 11:55:59 +01:00
Karel Zak
4bac19fd38 add completition bits blkpr lsfd 2025-12-15 16:53:44 +01:00
Karel Zak
df438c4170 upgrade to upstream release v2.41.3 2025-12-15 16:42:08 +01:00
Karel Zak
ab6d50b588 Merge #25 liblastlog2 uses /var/lib/lastlog 2025-12-02 15:55:21 +00:00
Karel Zak
9c226720cb backport upstream patches for GCC-15
- regenerate Fedora patches from the Git tree
2025-12-02 16:37:43 +01:00
Fxzx micah
7ef16d92f7 liblastlog2 uses /var/lib/lastlog
You can verify it through man pam_lastlog2.
2025-11-18 19:22:12 +00:00
Karel Zak
ba1905c6c7 upgrade to upstream release v2.41.2 2025-10-23 13:01:34 +02:00
Python Maint
9e2caeba0d Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 15:01:56 +02:00
Python Maint
5679a7db71 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 15:21:47 +02:00
Karel Zak
b9ed3a9a74 use RPM macros for /var/lib and /run 2025-08-05 09:59:26 +02:00
Karel Zak
39c148ff89 add /var/lib/liblastlog to files list 2025-08-05 09:49:01 +02:00
Fedora Release Engineering
04d2b6b0ad Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 19:54:31 +00:00
Karel Zak
eeebe2875e Merge #24 tests: migrate from STI to TMT 2025-07-16 10:48:03 +00:00
Karel Zak
164a6760ec enable lastlog2-import.service 2025-07-15 14:24:23 +02:00
Lukáš Zaoral
0382798ff4
tests: migrate from STI to TMT
Related: https://fedoraproject.org/wiki/Changes/DisableSTI
2025-06-24 14:19:13 +02:00
Karel Zak
7d135acec2 Fix ldattach build on recent glibc headers. 2025-06-24 11:20:00 +02:00
Karel Zak
b309d832e2 Temporarily disable support for EROFS backing files. 2025-06-24 11:02:22 +02:00
Karel Zak
404f522557 remove obsolete patch 2025-06-24 10:45:43 +02:00
Karel Zak
bf8d5779df upgrade to upstream release v2.41.1
... https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41-ReleaseNotes
- add lastlog2 library and PAM module
- add new utils bits, coresched and lastlog2
2025-06-24 10:37:18 +02:00
Python Maint
8e9f6cee44 Rebuilt for Python 3.14 2025-06-09 12:44:41 +02:00
Miro Hrončok
0e7e2e7599 Revert to util-linux-2.40.4-7 to rebuild it for Python 3.14
The revert is needed because of https://bodhi.fedoraproject.org/updates/FEDORA-2025-dd6b6950ff failures.

This reverts commit e873a14a1d
2025-06-09 12:44:41 +02:00
Python Maint
ca46de6072 Rebuilt for Python 3.14 2025-06-02 20:26:03 +02:00
Karel Zak
67c133a8d4 add BuildRequires for lastlog2 2025-05-12 14:33:31 +02:00
Karel Zak
e873a14a1d upgrade to upstream release v2.41
... https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41-ReleaseNotes
- add lastlog2 library and PAM module
- add new utils bits, coresched and lastlog2
2025-05-12 14:16:44 +02:00
16 changed files with 172 additions and 232 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

7
.gitignore vendored
View file

@ -99,3 +99,10 @@
/util-linux-2.40.1.tar.xz
/util-linux-2.40.2.tar.xz
/util-linux-2.40.4.tar.xz
/util-linux-2.41.tar.xz
/util-linux-2.41.1.tar.xz
/util-linux-2.41.2.tar.xz
/util-linux-2.41.3.tar.xz
/util-linux-2.42.tar.xz
/util-linux-2.42.1.tar.xz
/util-linux-2.42.2.tar.xz

View file

@ -0,0 +1,27 @@
From a2357184ff3dc3beb001fcb12e1e4c0dcf8d0dbd Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 2 Dec 2025 16:15:44 +0100
Subject: login: use O_CREAT on lastlog
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=151635
Signed-off-by: Karel Zak <kzak@redhat.com>
---
login-utils/login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/login-utils/login.c b/login-utils/login.c
index 321f9d6ce..edc69fd9a 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -682,7 +682,7 @@ static void log_lastlog(struct login_context *cxt)
sa.sa_handler = SIG_IGN;
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
goto done;
offset = cxt->pwd->pw_uid * sizeof(ll);
--
2.51.1

View file

@ -1,33 +0,0 @@
From ff0ac0f27dc3de7d250b2a69f6452bfeec104f8c Mon Sep 17 00:00:00 2001
From: Eric Sandeen <sandeen@redhat.com>
Date: Fri, 24 Jan 2025 08:37:12 -0600
Subject: [PATCH] blkid: allow up to 64k erofs block sizes
Today, mkfs.erofs defaults to page size for block size, but blkid
does not recognize this. Increase the limit to 64k.
Reviewed-by: Gao Xiang <xiang@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libblkid/src/superblocks/erofs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libblkid/src/superblocks/erofs.c b/libblkid/src/superblocks/erofs.c
index 05822460b..57fd80220 100644
--- a/libblkid/src/superblocks/erofs.c
+++ b/libblkid/src/superblocks/erofs.c
@@ -73,8 +73,8 @@ static int probe_erofs(blkid_probe pr, const struct blkid_idmag *mag)
if (!sb)
return errno ? -errno : BLKID_PROBE_NONE;
- /* EROFS is restricted to 4KiB block size */
- if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 4096)
+ /* block size must be between 512 and 64k */
+ if (sb->blkszbits < 9 || sb->blkszbits > 16)
return BLKID_PROBE_NONE;
if (!erofs_verify_checksum(pr, mag, sb))
--
2.48.1

View file

@ -0,0 +1,27 @@
From 617a887a6ec7e433f6a9f4c60592ed38b12b9f18 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 2 Dec 2025 16:17:55 +0100
Subject: login: add /run/motd.d` to the hardcoded MOTD_FILE
Addresses: https://github.com/coreos/console-login-helper-messages/issues/60
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/pathnames.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/pathnames.h b/include/pathnames.h
index 34ba11ca3..c91a077e1 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -41,7 +41,7 @@
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/var/spool/mail"
#endif
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN "/etc/nologin"
#endif
--
2.51.1

View file

@ -1,133 +0,0 @@
From 2b99ee2526ae61be761b0e31c50e106dbec5e9e4 Mon Sep 17 00:00:00 2001
From: Filipe Manana <fdmanana@kernel.org>
Date: Thu, 17 Aug 2023 10:20:13 +0100
Subject: [PATCH] libmount: Fix regression when mounting with atime
A regression was introduced in v2.39 that causes mounting with the atime
option to fail:
$ mkfs.ext4 -F /dev/sdi
$ mount -o atime /dev/sdi /mnt/sdi
mount: /mnt/sdi: not mount point or bad option.
dmesg(1) may have more information after failed mount system call.
The failure comes from the mount_setattr(2) call returning -EINVAL. This
is because we pass an invalid value for the attr_clr argument. From a
strace capture we have:
mount_setattr(4, "", AT_EMPTY_PATH, {attr_set=0, attr_clr=MOUNT_ATTR_NOATIME, propagation=0 /* MS_??? */, userns_fd=0}, 32) = -1 EINVAL (Invalid argument)
We can't pass MOUNT_ATTR_NOATIME to mount_setattr(2) through the attr_clr
argument because all atime options are exclusive, so in order to set atime
one has to pass MOUNT_ATTR__ATIME to attr_clr and leave attr_set as
MOUNT_ATTR_RELATIME (which is defined as a value of 0).
This can be read from the man page for mount_setattr(2) and also from the
kernel source:
$ cat fs/namespace.c
static int build_mount_kattr(const struct mount_attr *attr, size_t usize,
struct mount_kattr *kattr, unsigned int flags)
{
(...)
/*
* Since the MOUNT_ATTR_<atime> values are an enum, not a bitmap,
* users wanting to transition to a different atime setting cannot
* simply specify the atime setting in @attr_set, but must also
* specify MOUNT_ATTR__ATIME in the @attr_clr field.
* So ensure that MOUNT_ATTR__ATIME can't be partially set in
* @attr_clr and that @attr_set can't have any atime bits set if
* MOUNT_ATTR__ATIME isn't set in @attr_clr.
*/
if (attr->attr_clr & MOUNT_ATTR__ATIME) {
if ((attr->attr_clr & MOUNT_ATTR__ATIME) != MOUNT_ATTR__ATIME)
return -EINVAL;
/*
* Clear all previous time settings as they are mutually
* exclusive.
*/
kattr->attr_clr |= MNT_RELATIME | MNT_NOATIME;
switch (attr->attr_set & MOUNT_ATTR__ATIME) {
case MOUNT_ATTR_RELATIME:
kattr->attr_set |= MNT_RELATIME;
break;
case MOUNT_ATTR_NOATIME:
kattr->attr_set |= MNT_NOATIME;
break;
case MOUNT_ATTR_STRICTATIME:
break;
default:
return -EINVAL;
}
(...)
So fix this by setting attr_clr MOUNT_ATTR__ATIME if we want to clear any
atime related option.
Signed-off-by: Filipe Manana <fdmanana@kernel.org>
---
libmount/src/optlist.c | 13 ++++++++++++-
tests/expected/libmount/context-mount-flags | 3 +++
tests/ts/libmount/context | 9 ++++++++-
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c
index e93810b47..d0afc94f7 100644
--- a/libmount/src/optlist.c
+++ b/libmount/src/optlist.c
@@ -875,7 +875,18 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *cl
if (opt->ent->mask & MNT_INVERT) {
DBG(OPTLIST, ul_debugobj(ls, " clr: %s", opt->ent->name));
- *clr |= x;
+ /*
+ * All atime settings are mutually exclusive so *clr must
+ * have MOUNT_ATTR__ATIME set.
+ *
+ * See the function fs/namespace.c:build_mount_kattr()
+ * in the linux kernel source.
+ */
+ if (x == MOUNT_ATTR_RELATIME || x == MOUNT_ATTR_NOATIME ||
+ x == MOUNT_ATTR_STRICTATIME)
+ *clr |= MOUNT_ATTR__ATIME;
+ else
+ *clr |= x;
} else {
DBG(OPTLIST, ul_debugobj(ls, " set: %s", opt->ent->name));
*set |= x;
diff --git a/tests/expected/libmount/context-mount-flags b/tests/expected/libmount/context-mount-flags
index 960641863..eb71323dd 100644
--- a/tests/expected/libmount/context-mount-flags
+++ b/tests/expected/libmount/context-mount-flags
@@ -3,3 +3,6 @@ ro,nosuid,noexec
successfully mounted
rw,nosuid,noexec
successfully umounted
+successfully mounted
+rw,relatime
+successfully umounted
diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context
index f5b47185e..a5d2e81a3 100755
--- a/tests/ts/libmount/context
+++ b/tests/ts/libmount/context
@@ -116,8 +116,15 @@ $TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPU
ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG
-ts_finalize_subtest
+# Test that the atime option works after the migration to use the new kernel mount APIs.
+ts_run $TESTPROG --mount -o atime $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
+$TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPUT 2>> $TS_ERRLOG
+is_mounted $DEVICE || echo "$DEVICE not mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
+is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+ts_finalize_subtest
ts_init_subtest "mount-loopdev"
mkdir -p $MOUNTPOINT &> /dev/null
--
2.40.1

View file

@ -1,13 +0,0 @@
diff --git a/include/pathnames.h b/include/pathnames.h
index 3845d4c33..fac3a0783 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -41,7 +41,7 @@
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/var/spool/mail"
#endif
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN "/etc/nologin"
#endif

View file

@ -1,12 +0,0 @@
diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c
--- util-linux-2.36/login-utils/login.c.kzak 2020-07-23 14:13:26.777030764 +0200
+++ util-linux-2.36/login-utils/login.c 2020-07-23 14:11:22.793686983 +0200
@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con
sa.sa_handler = SIG_IGN;
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
goto done;
offset = cxt->pwd->pw_uid * sizeof(ll);

5
plans/ci.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -1 +1 @@
SHA512 (util-linux-2.40.4.tar.xz) = 0024955056ba7b4c54040a917f9919f49692e57ba6d42d17a6c29c1eefe88bf48b1214a545072b71c468829a63a8f15237f49733e9127c134e11126d1e435124
SHA512 (util-linux-2.42.2.tar.xz) = 7415add0be2930654e322830808dde03ff6d511bd357f0679e6b6287a13ca79fe58ce4ac05edef86b76fb381b3a36ca2da9d3c31b5dc0a1d889c203156a57277

View file

@ -1,13 +0,0 @@
# Test which run in classic and docker environemnt
- hosts: localhost
tags:
- classic
- container
- atomic
roles:
- role: standard-test-beakerlib
tests:
- various
required_packages:
- util-linux
- util-linux-user

13
tests/various/main.fmf Normal file
View file

@ -0,0 +1,13 @@
summary: This test groups small sanity and regression tests for util-linux
description: ''
contact: Miroslav Vadkerti <mvadkert@redhat.com>
component:
- util-linux
test: ./runtest.sh
framework: beakerlib
recommend:
- util-linux
- util-linux-user
duration: 10m
extra-summary: /CoreOS/util-linux/Sanity/various
extra-task: /CoreOS/util-linux/Sanity/various

View file

@ -27,7 +27,6 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
#. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="util-linux"

View file

@ -1,4 +1,5 @@
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid

View file

@ -1 +0,0 @@
u uuidd - "UUID generator helper daemon" /var/lib/libuuid

View file

@ -1,7 +1,7 @@
### Header
Summary: Collection of basic system utilities
Name: util-linux
Version: 2.40.4
Version: 2.42.2
# -p -e rc1
Release: %autorelease
License: GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain
@ -35,6 +35,7 @@ BuildRequires: %{pypkg}-devel
BuildRequires: gcc
BuildRequires: rubygem-asciidoctor
BuildRequires: po4a
BuildRequires: sqlite-devel
%ifarch ppc64le
BuildRequires: librtas-devel
%endif
@ -43,7 +44,8 @@ BuildRequires: librtas-devel
#BuildRequires: autoconf
#BuildRequires: automake
#BuildRequires: libtool
#BuildRequires: bison
BuildRequires: bison
BuildRequires: flex
### Sources
Source0: https://www.kernel.org/pub/linux/utils/util-linux/v%{upstream_major}/util-linux-%{upstream_version}.tar.xz
@ -56,9 +58,6 @@ Source13: util-linux-su-l.pamd
Source14: util-linux-runuser.pamd
Source15: util-linux-runuser-l.pamd
# temporary, will be in upstream >= v2.41
Source16: util-linux-uuidd-sysusers.conf
### Obsoletes & Conflicts & Provides
Conflicts: initscripts < 9.79-4
Conflicts: bash-completion < 1:2.1-1
@ -93,6 +92,7 @@ Requires: libblkid = %{version}-%{release}
Requires: libmount = %{version}-%{release}
Requires: libsmartcols = %{version}-%{release}
Requires: libfdisk = %{version}-%{release}
Requires: liblastlog2 = %{version}-%{release}
Requires: util-linux-core = %{version}-%{release}
%if "%{_sbindir}" == "%{_bindir}"
@ -103,16 +103,9 @@ Provides: /usr/sbin/runuser
Provides: /usr/sbin/sfdisk
%endif
### Ready for upstream?
###
# 151635 - makeing /var/log/lastlog
Patch0: login-lastlog-create.patch
# Add `/run/motd.d` to the hardcoded MOTD_FILE
# https://github.com/coreos/console-login-helper-messages/issues/60
Patch1: login-default-motd-file.patch
# Backport better support for erofs on ppc64le
Patch2: 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch
### Fedora specific patches
Patch0: 0000-login-use-O_CREAT-on-lastlog.patch
Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch
%description
The util-linux package contains a large variety of low-level system
@ -215,6 +208,25 @@ This is the device mounting development library and headers,
part of util-linux.
%package -n liblastlog2
Summary: lastlog database library and PAM module
License: BSD-2-Clause
%description -n liblastlog2
This is the lastlog database library and PAM module, part of util-linux.
%package -n liblastlog2-devel
Summary: lastlog database library
License: BSD-2-Clause
Requires: liblastlog2%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description -n liblastlog2-devel
This is the lastlog database development library and headers,
part of util-linux.
%package -n libblkid
Summary: Block device ID library
License: LGPL-2.1-or-later
@ -335,7 +347,6 @@ export DAEMON_LDFLAGS="$SUID_LDFLAGS"
--disable-silent-rules \
--disable-bfs \
--disable-pg \
--disable-liblastlog2 \
--enable-chfn-chsh \
--enable-usrdir-path \
--enable-write \
@ -374,11 +385,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps}
# install util-linux
%make_install
# And a dirs uuidd needs that the makefiles don't create
install -d %{buildroot}/run/uuidd
install -d %{buildroot}/var/lib/libuuid
install -m 644 -D %{SOURCE16} %{buildroot}%{_sysusersdir}/uuidd.conf
# And a dirs that the makefiles don't create
install -d %{buildroot}%{_rundir}/uuidd
install -d %{buildroot}%{_sharedstatedir}/libuuid
install -d %{buildroot}%{_sharedstatedir}/lastlog
# /etc/adjtime
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime
@ -440,7 +450,7 @@ rm -f %{buildroot}/sbin/sfdisk \
ln -sf ../proc/self/mounts %{buildroot}/etc/mtab
# remove static libs
rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk}.a
rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk,lastlog2}.a
# temporary remove to avoid conflicts with bash-completion pkg
rm -f %{buildroot}%{compldir}/{mount,umount}
@ -470,16 +480,26 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \
mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/
%endif
%post
%systemd_post fstrim.{service,timer}
%post -n liblastlog2
%systemd_post lastlog2-import.service
%preun
%systemd_preun fstrim.{service,timer}
%postun
%systemd_postun_with_restart fstrim.timer
%systemd_postun fstrim.service
%postun -n liblastlog2
%systemd_postun lastlog2-import.service
# Please, keep uuidd running after installation! Note that systemd_post is
# "systemctl preset" and it enable/disable service only.
%post -n uuidd
@ -525,6 +545,7 @@ fi
%{_unitdir}/fstrim.*
%{_bindir}/bits
%{_bindir}/cal
%{_bindir}/chmem
%{_bindir}/choom
@ -532,18 +553,22 @@ fi
%{_bindir}/colcrt
%{_bindir}/colrm
%{_bindir}/column
%{_bindir}/copyfilerange
%{_bindir}/coresched
%{_bindir}/eject
%{_bindir}/enosys
%{_bindir}/exch
%{_bindir}/fallocate
%{_bindir}/fincore
%{_bindir}/fadvise
%{_bindir}/getino
%{_bindir}/getopt
%{_bindir}/hexdump
%{_bindir}/irqtop
%{_bindir}/isosize
%{_bindir}/last
%{_bindir}/lastb
%{_bindir}/lastlog2
%{_bindir}/look
%{_bindir}/lsblk
%{_bindir}/lscpu
@ -576,6 +601,8 @@ fi
%{_bindir}/wdctl
%{_bindir}/whereis
%{_bindir}/write
%{_mandir}/man1/bits.1*
%{_mandir}/man1/cal.1*
%{_mandir}/man1/chfn.1*
%{_mandir}/man1/choom.1*
@ -584,12 +611,15 @@ fi
%{_mandir}/man1/colcrt.1*
%{_mandir}/man1/colrm.1*
%{_mandir}/man1/column.1*
%{_mandir}/man1/copyfilerange.1*
%{_mandir}/man1/coresched.1.*
%{_mandir}/man1/eject.1*
%{_mandir}/man1/enosys.1*
%{_mandir}/man1/exch.1*
%{_mandir}/man1/fadvise.1*
%{_mandir}/man1/fallocate.1*
%{_mandir}/man1/fincore.1*
%{_mandir}/man1/getino.1*
%{_mandir}/man1/getopt.1*
%{_mandir}/man1/hexdump.1*
%{_mandir}/man1/irqtop.1*
@ -643,6 +673,7 @@ fi
%{_mandir}/man8/fsfreeze.8*
%{_mandir}/man8/fstrim.8*
%{_mandir}/man8/isosize.8*
%{_mandir}/man8/lastlog2.8*
%{_mandir}/man8/ldattach.8*
%{_mandir}/man8/lsblk.8*
%{_mandir}/man8/lslocks.8*
@ -690,17 +721,22 @@ fi
%{_sbindir}/zramctl
%{compldir}/addpart
%{compldir}/bits
%{compldir}/blkdiscard
%{compldir}/blkpr
%{compldir}/blkzone
%{compldir}/cal
%{compldir}/chcpu
%{compldir}/chfn
%{compldir}/chmem
%{compldir}/choom
%{compldir}/chsh
%{compldir}/col
%{compldir}/colcrt
%{compldir}/colrm
%{compldir}/column
%{compldir}/copyfilerange
%{compldir}/coresched
%{compldir}/ctrlaltdel
%{compldir}/delpart
%{compldir}/eject
@ -715,17 +751,20 @@ fi
%{compldir}/fsck.minix
%{compldir}/fsfreeze
%{compldir}/fstrim
%{compldir}/getino
%{compldir}/getopt
%{compldir}/hexdump
%{compldir}/irqtop
%{compldir}/isosize
%{compldir}/last
%{compldir}/lastb
%{compldir}/lastlog2
%{compldir}/ldattach
%{compldir}/look
%{compldir}/lsblk
%{compldir}/lscpu
%{compldir}/lsclocks
%{compldir}/lsfd
%{compldir}/lsipc
%{compldir}/lsirq
%{compldir}/lslocks
@ -890,11 +929,11 @@ fi
%{_mandir}/man8/uuidd.8*
%{_sbindir}/uuidd
%{_unitdir}/uuidd.*
%dir %attr(2775, uuidd, uuidd) /var/lib/libuuid
%dir %attr(2775, uuidd, uuidd) /run/uuidd
%dir %attr(2775, uuidd, uuidd) %{_sharedstatedir}/libuuid
%dir %attr(2775, uuidd, uuidd) %{_rundir}/uuidd
%{compldir}/uuidd
%{_tmpfilesdir}/uuidd-tmpfiles.conf
%{_sysusersdir}/uuidd.conf
%{_sysusersdir}/uuidd-sysusers.conf
%files -n libfdisk
@ -930,6 +969,32 @@ fi
%{_libdir}/pkgconfig/mount.pc
%files -n liblastlog2
%license Documentation/licenses/COPYING.BSD-2-Clause
%dir %{_sharedstatedir}/lastlog
%{_libdir}/liblastlog2.so.*
%{_pam_moduledir}/pam_lastlog2.so
%{_tmpfilesdir}/lastlog2-tmpfiles.conf
%{_unitdir}/lastlog2*
%{_mandir}/man8/pam_lastlog2.8*
%files -n liblastlog2-devel
%license Documentation/licenses/COPYING.BSD-2-Clause
%{_libdir}/liblastlog2.so
%{_includedir}/liblastlog2
%{_libdir}/pkgconfig/lastlog2.pc
%{_mandir}/man3/lastlog2.3.*
%{_mandir}/man3/ll2_import_lastlog.3*
%{_mandir}/man3/ll2_new_context.3*
%{_mandir}/man3/ll2_read_all.3*
%{_mandir}/man3/ll2_read_entry.3*
%{_mandir}/man3/ll2_remove_entry.3*
%{_mandir}/man3/ll2_rename_user.3*
%{_mandir}/man3/ll2_unref_context.3*
%{_mandir}/man3/ll2_update_login_time.3*
%{_mandir}/man3/ll2_write_entry.3*
%files -n libblkid
%license Documentation/licenses/COPYING.LGPL-2.1-or-later
%{_libdir}/libblkid.so.*