%global libseat_sover 1 # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %define libname %mklibname seat %{libseat_sover} %define devname %mklibname seat -d %global _hardened_build 1 %bcond_without server Name: seatd Version: 0.9.1 Release: %mkrel 1.1 Summary: Minimal seat management daemon Group: System/Libraries License: MIT URL: https://sr.ht/~kennylevinsen/seatd/ Source0: https://git.sr.ht/~kennylevinsen/seatd/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: seatd.sysusers BuildRequires: gcc BuildRequires: meson >= 0.60.0 BuildRequires: pkgconfig(libsystemd) %if %{with server} BuildRequires: pkgconfig(scdoc) BuildRequires: systemd-rpm-macros %endif %description A seat management daemon, that does everything it needs to do. Nothing more, nothing less. Depends only on libc. %package -n libseat Summary: Universal seat management library %description -n libseat A seat management library allowing applications to use whatever seat management is available. Supports: * seatd * (e)logind * embedded seatd for standalone operation Each backend can be compile-time included and is runtime auto-detected or manually selected with the LIBSEAT_BACKEND environment variable. Which backend is in use is transparent to the application, providing a simple common interface. %package -n %libname Summary: Libarry for libseat %description -n %libname The %libname package contains libraries for applications that use libseat. %package -n %devname Summary: Development files for libseat Group: Development/C Requires: %{libname}%{?_isa} = %{version}-%{release} Provides: libseat-devel = %{version}-%{release} %description -n %devname The %devname package contains libraries and header files for developing applications that use libseat. %prep %autosetup %build %meson \ -Dlibseat-logind=systemd \ -Dserver=%[%{with server}?"enabled":"disabled"] %meson_build %install %meson_install %if %{with server} install -D -m 0644 -pv contrib/systemd/%{name}.service \ %{buildroot}%{_unitdir}/%{name}.service install -D -m 0644 -pv %{SOURCE1} \ %{buildroot}%{_sysusersdir}/%{name}.conf %endif %check %meson_test %if %{with server} %pre %sysusers_create_compat %{SOURCE1} true %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun %{name}.service # (tv) macro wasn't expanded and resulted in empty postun true %files %license LICENSE %doc README.md %{_bindir}/%{name} # TODO: seatd-launch should run with elevated privileges, i.e. SUID or CAP_SETUID %{_bindir}/%{name}-launch %{_mandir}/man1/%{name}.1* %{_mandir}/man1/%{name}-launch.1* %{_sysusersdir}/%{name}.conf %{_unitdir}/%{name}.service %endif %files -n %libname %license LICENSE %doc README.md %{_libdir}/libseat.so.%{libseat_sover} %files -n %devname %{_includedir}/libseat.h %{_libdir}/libseat.so %{_libdir}/pkgconfig/libseat.pc