# # spec file for package wtmpdb # # Copyright (c) 2025 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/ # %define lname libwtmpdb0 Name: wtmpdb Version: 0.73.0+git20250408.edb8638 Release: 1.1 Summary: Database for recording the last logged in users and system reboots License: BSD-2-Clause URL: https://github.com/thkukuk/wtmpdb Source: %{name}-%{version}.tar.xz BuildRequires: docbook5-xsl-stylesheets BuildRequires: meson BuildRequires: pkgconfig BuildRequires: pkgconfig(audit) BuildRequires: pkgconfig(libsystemd) >= 257 BuildRequires: pkgconfig(pam) BuildRequires: pkgconfig(sqlite3) Requires(post): pam-config Requires(postun): pam-config # Split provide for last Provides: util-linux:/usr/bin/last %description pam_wtmpdb and wtmpdb are Y2038-safe versions of wtmp and the last utility. pam_wtmpdb collects all data in a sqlite3 database and the wtmpdb utility creates boot and shutdown entries or formats and prints the contents of the wtmp database. %package -n %{lname} Summary: PAM module to store login and logout of users %description -n %{lname} The libwtmpdb provides various interfaces to read, write or modify the wtmpdb database. %package devel Summary: Development files for libwtmpdb Requires: %{lname} = %{version} %description devel This package contains all necessary include files and libraries needed to develop applications that needs to read, write or modify the wtmpdb database. %prep %autosetup %build %meson -Dman=enabled -Dcompat-symlink=true -Dwtmpdbd=enabled %meson_build %install %meson_install mkdir -p %{buildroot}%{_mandir}/man1 echo ".so man8/wtmpdb.8" > %{buildroot}%{_mandir}/man1/last.1 %check %meson_test %pre %service_add_pre wtmpdb-update-boot.service wtmpdb-rotate.timer wtmpdbd.socket %preun %service_del_preun wtmpdb-update-boot.service wtmpdb-rotate.timer wtmpdbd.socket %post %tmpfiles_create wtmpdb.conf %service_add_post wtmpdb-update-boot.service wtmpdb-rotate.timer wtmpdbd.socket pam-config -a --wtmpdb --wtmpdb-skip_if=sshd %postun if [ "$1" -eq 0 ]; then pam-config -d --wtmpdb fi %service_del_postun_without_restart wtmpdb-update-boot.service %service_del_postun wtmpdb-rotate.timer wtmpdbd.socket %post -n %{lname} -p /sbin/ldconfig %postun -n %{lname} -p /sbin/ldconfig %files %license LICENSE %{_bindir}/last %{_bindir}/wtmpdb %{_libexecdir}/wtmpdbd %{_unitdir}/wtmpdb-update-boot.service %{_unitdir}/wtmpdb-rotate.service %{_unitdir}/wtmpdb-rotate.timer %{_prefix}/lib/systemd/system/wtmpdbd.service %{_prefix}/lib/systemd/system/wtmpdbd.socket %{_tmpfilesdir}/wtmpdb.conf %{_pam_moduledir}/pam_wtmpdb.so %ghost %{_localstatedir}/lib/wtmpdb %{_mandir}/man1/last.1%{?ext_man} %{_mandir}/man8/wtmpdb.8%{?ext_man} %{_mandir}/man8/wtmpdbd.8%{?ext_man} %{_mandir}/man8/wtmpdbd.service.8%{?ext_man} %{_mandir}/man8/wtmpdbd.socket.8%{?ext_man} %{_mandir}/man8/pam_wtmpdb.8%{?ext_man} %files -n %{lname} %license LICENSE %{_libdir}/libwtmpdb.so.* %files devel %{_libdir}/libwtmpdb.so %{_includedir}/wtmpdb.h %{_libdir}/pkgconfig/libwtmpdb.pc %changelog * Tue Apr 8 2025 Thorsten Kukuk - Update to version 0.73.0+git20250408.edb8638: * Release version 0.73.0 * expand accepted time format options * use documented -t short option for last --until * hurd: avoid PATH_MAX * hurd: compat for lack of CLOCK_BOOTTIME * Wed Mar 5 2025 kukuk@suse.com - Update to version 0.72.0+git20250305.10803fd: * Release version 0.72.0 * i386: fix integer format length errors * Add utmp format importer * Fix wtmp database path in documentation * test: schedule test logins on correct day * rotate: don't throw away microseconds calculating threshold * Thu Feb 6 2025 kukuk@suse.com - Update to version 0.71.0+git20250206.608632a: * Fix expected output of wtmpdb_rotate() test * Make header usable from C++ * Mon Feb 3 2025 kukuk@suse.com - Update to version 0.71.0+git20250203.86b8442: * Release version 0.71.0 * zero struct tm before calling strptime() * Accept classic 'last -N' form for max entries * tst-varlink: fix order of error checking * CI: use valgrind * Run meson test in verbose mode * tst-varlink works only if run as root * Use meson feature and not combo options * Add CI for openSUSE * CI: make sure sqlite3 devel is installed * Tue Jan 21 2025 kukuk@suse.com - Update to version 0.70.0+git20250121.3e409b5: * Fix installation of all wtmpdbd man page variants * Release version 0.70.0 * Add wtmpdbd.8 manual page * wtmpdbd: fix printing help text * wtmpdbd: more fine granular log level filtering * wtmpdbd: implement varlink_event_loop_with_idle * wtmpdbd.socket: fix socket descriptor name * meson: no longer check for v258 sd-varlink function * Mon Jan 20 2025 kukuk@suse.com - Update to version 0.60.0+git20250120.64d23d8: * Release version 0.60.0 * Merge reader/write socket to one generic one * wtmpdbd: add Ping, SetLogLevel and GetEnvironment * Fri Jan 17 2025 kukuk@suse.com - Update to version 0.50.0+git20250117.a9b48cf: * wtmpdbd.service: secure more * wtmpdb: Implement json output for last (#20) * Thu Jan 16 2025 kukuk@suse.com - Update to version 0.50.0+git20250110.cbabeb7: * Harden wtmpdbd.service * libwtmpdb: fallback to sqlite if SELinux blocks varlink socket * Fri Jan 10 2025 kukuk@suse.com - Update to version 0.50.0+git20250110.12da60f: * Release version 0.50.0 * README: add wtmpdbd * wtmpdbd: Print stopped message * wtmpdbd.service: preset WTMPDBD_OPTS * wtmpdbd: don't call listen if started by a socket * tst-varlink: skip if varlink is not supported * libwtmpdb: set varlink_is_active to 0 without systemd * libwtmpdb: always define varlink checks * wtmpdb: define quiet only if we have systemd * libwtmpdb: return error if varlink support is missing * Send sd_notify(STOPPING=1); * Check if systemd has sd_varlink_server_listen_name() * wtmpdbd.service: optional read /etc/default/wtmpdbd * wtmpdbd: simplify creation of varlink sockets * Set umaks with varlink to 0077, improve error reporting * wtmpdbd: enable to start via sockets * libwtmpdb: handle ECONNRESET as wtmpdbd not running * libwtmpdb: fix crash in varlink if error==NULL * Install daemon in libexec directory * tst-get_id: skip if there is no db file * libwtmpdb: improve error return code * db path "varlink" will enforce varlink interface * Add service and socket files * wmtpdb: call wtmpdb_* functions with NULL as path * wtmpdbd: add socket activation * Implement varlink read_all client side * Make wtmpdbd support compiletime config * Add daemon using varlink for communication * Document that openssh is special * libwtmpdb: create wrapper around sqlite functions * Make mkdir_p more robust * Wed Aug 14 2024 kukuk@suse.com - Update to version 0.13.0+git.20240814: * wtmpdb-update-boot service requires dbus * Fri Jul 26 2024 kukuk@suse.com - Update to version 0.13.0+git.20240726: * Release version 0.13.0 * Fix variable overflow and check for it (#15) * Wed May 8 2024 kukuk@suse.com - Update to version 0.12.0+git.20240508: - boot: Query systemd if soft-reboot was done * Mon Jan 8 2024 Thorsten Kukuk - Update to version 0.11.0 - last: add support for time-format option * Wed Dec 13 2023 Thorsten Kukuk - Update to version 0.10.0 - last: support matching for username and/or tty * Thu Oct 26 2023 Thorsten Kukuk - Update to version 0.9.3 - wtmpdb last: don't print date in the future if there is no db entry * Tue Sep 19 2023 Stefan Schubert - Update to version 0.9.2 - Set busy timeout for DB access: The process is waiting until 5 seconds for DB connection if the DB is locked by another process. * Tue Aug 22 2023 Thorsten Kukuk - Fix last.1 manual page reference - Update to version 0.9.1 - Fix printf format specifier on 32bit * Mon Aug 14 2023 Thorsten Kukuk - Update to version 0.9.0 - Try to detect systemctl soft-reboot - Many conversation warning/error fixes * Wed Aug 9 2023 Thorsten Kukuk - Update to version 0.8.0 - wtmpdb boottime: print boot time * Sat Jul 1 2023 Jan Engelhardt - https://en.opensuse.org/SourceUrls - Use noun phrase for Summary. - Wrap descriptions at 70 (for yast2 textmode). * Thu Jun 29 2023 Thorsten Kukuk - Update to version 0.7.1 - wtmpdb last: Support "YYYY-MM-DD", "today" and "yesterday" as time option * Tue Jun 27 2023 Thorsten Kukuk - Add last compat symlink and manual page * Wed Jun 21 2023 Thorsten Kukuk - Update to version 0.7.0 - wtmpdb rotate: use sqlite3_bind_* internal - wtmpdb last: Implement -x, -d, -i and -w options * Wed Jun 7 2023 Thorsten Kukuk - Update to version 0.6.0 - wtmpdb rotate: move old log entries into wtmpdb_.db * Wed Apr 26 2023 Thorsten Kukuk - Update to version 0.5.0 - Use uint64_t instead of usec_t to avoid conflicts - wtmpdb boot: more accurate calculation of boot time * Mon Apr 24 2023 Thorsten Kukuk - Use Requires(pre) and Requires(post) instead of PreReq * Tue Apr 18 2023 Thorsten Kukuk - Update to version 0.4.0 - libwtmpdb: Use project version for library version - libwtmpdb: Always use _PATH_WTMPDB as fallback * Mon Apr 17 2023 Thorsten Kukuk - Skip pam_wtmpdb for sshd * Wed Apr 12 2023 Thorsten Kukuk - Update to version 0.3.0 - pam_wtmpdb: Add skip_if option - Add manual pages - wtmpdb last: fix wtmp begins timestamp if no matching entry was found - wtmpdb last: Add --since and --until options - Add compat symlink for "last" - wtmpdb last: add --present option - wtmpdb last: implement -n/--limit - pam_wtmpdb: Try XDG_VTNR if PAM_TTY is not a tty * Mon Apr 3 2023 Thorsten Kukuk - Update to version 0.2.0 - pam_lastlog: support PAM_XDISPLAY - wtmpdb last: show PAM service on request - wtmpdb: log audit records for boot/shutdown * Thu Mar 30 2023 Thorsten Kukuk - Initial package