File seatd.spec of Package seatd
%define realname seatd
%define realver 0.8.0
%define srcext tar.gz
%define so_ver 1
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: MIT
Group: System/X11/Servers/XF86_4
URL: https://sr.ht/~kennylevinsen/seatd/
Summary: Seat management daemon and library
# Build-time parameters
BuildRequires: pkg-config
BuildRequires: meson >= 0.60.0
BuildRequires: ninja
BuildRequires: pkgconfig(libsystemd)
#BuildRequires: scdoc >= 1.9.7
Source: https://codeload.github.com/kennylevinsen/seatd/%{srcext}/refs/tags/%{realver}#/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
Seat management takes care of mediating access to shared devices (graphics,
input), without requiring the applications needing access to be root.
This package contains a seat management daemon, that does everything it needs
to do. Nothing more, nothing less.
%package -n libseat%{?so_ver}
Group: System/Libraries
Summary: A seat management library
%description -n libseat%{?so_ver}
Seat management takes care of mediating access to shared devices (graphics,
input), without requiring the applications needing access to be root.
This package contains a seat management library allowing applications to use
whatever seat management is available.
%package devel
Group: Development/Languages/C and C++
Summary: Files needed for development using libseat
Requires: libseat%{?so_ver} = %{version}-%{release}
Provides: libseat-devel = %{version}-%{release}
Provides: libseat%{?so_ver}-devel = %{version}-%{release}
%description devel
Files needed for development using libseat.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%build
_CFLAGS='%{optflags} -Wno-error=unused-parameter'
_LDFLAGS='-Wl,--strip-all -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro'
meson setup build \
--buildtype=release \
--strip \
--optimization=2 \
\
--prefix=%{_prefix} \
--libexecdir=%{_libexecdir} \
--default-library=shared \
\
-Db_lto=%{?gcc_lto:true}%{!?gcc_lto:false} \
-Db_ndebug=if-release \
-Dc_args="$_CFLAGS" \
-Dc_link_args="$_LDFLAGS"
ninja -v -C build %{?_smp_mflags}
%install
DESTDIR=%{buildroot} ninja -C build install
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%license LICENSE
%doc README.md
%{_bindir}/seatd*
%files -n libseat%{?so_ver}
%defattr(-,root,root)
%license LICENSE
%doc README.md
%{_libdir}/libseat.so.%{?so_ver}*
%files devel
%defattr(-,root,root)
%license LICENSE
%doc README.md
%{_libdir}/pkgconfig/libseat.pc
%{_includedir}/libseat.h
%{_libdir}/*.so
%post -n libseat%{?so_ver} -p /sbin/ldconfig
%postun -n libseat%{?so_ver} -p /sbin/ldconfig
%changelog