File unclutter.spec of Package unclutter

#
# spec file for package unclutter
#
# Copyright (c) 2025
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed.
#

Name:           unclutter
Version:        8
Release:        0
Summary:        Tool to hide the X mouse cursor after a period of inactivity
License:        MIT
URL:            https://www.x.org/
Source0:        unclutter-8.tar.bz2
Patch0:         unclutter-8-return.diff
Patch1:         unclutter-8-gcc14.patch
Patch2:         unclutter-gcc15.patch
BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  imake
BuildRequires:  makedepend
BuildRequires:  xorg-cf-files
BuildRequires:  xorgproto-devel
BuildRequires:  libX11-devel
BuildRequires:  libXext-devel

%description
Unclutter is a program that removes the mouse cursor from the screen
so that it does not obstruct the area you are viewing. The cursor is
restored as soon as the mouse is moved.

%prep
%setup -q -n unclutter-8
%patch0 -p0
%patch1 -p0
%patch2 -p0

%build
xmkmf
%make_build

%install
rm -rf %{buildroot}
%make_install
%make_install install.man

# Move manpage to the FHS-compliant location so that it is packaged correctly
mkdir -p %{buildroot}%{_mandir}/man1
if [ -f %{buildroot}/usr/man/man1/unclutter.1x ]; then
    mv %{buildroot}/usr/man/man1/unclutter.1x %{buildroot}%{_mandir}/man1/
    # Clean up empty directories under /usr/man if possible
    rmdir -p --ignore-fail-on-non-empty %{buildroot}/usr/man/man1 2>/dev/null || true
    rmdir -p --ignore-fail-on-non-empty %{buildroot}/usr/man 2>/dev/null || true
fi

%files
%doc README
%{_bindir}/unclutter
%{_mandir}/man1/unclutter.1x*

%changelog
# Changelog managed externally in .changes file
openSUSE Build Service is sponsored by