File obconf-qt.spec of Package obconf-qt
#
# spec file for package obconf-qt
#
# Copyright (c) 2024 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/
#
Name: obconf-qt
Version: @SERVICE@
Release: 0
Summary: The Qt port of obconf, the Openbox configuration tool
License: GPL-2.0-or-later
Group: System/GUI/Other
URL: https://github.com/lxqt/obconf-qt
Source0: %{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: cmake(lxqt2-build-tools)
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: pkgconfig
BuildRequires: pkgconfig(obrender-3.5)
BuildRequires: pkgconfig(obt-3.5)
BuildRequires: update-desktop-files
Requires(post): update-alternatives
Requires(postun): update-alternatives
Conflicts: obconf
Recommends: %{name}-lang
%description
ObConf-Qt is a Qt port of ObConf, a configuration editor for window manager
OpenBox.
%lang_package
%prep
%autosetup
%build
%cmake_qt6
%qt6_build
%install
%qt6_install
install -dm 755 %{buildroot}%{_sysconfdir}/alternatives/
touch %{buildroot}%{_sysconfdir}/alternatives/obconf
ln -s %{_sysconfdir}/alternatives/obconf \
%{buildroot}%{_bindir}/obconf
%find_lang %{name} --with-qt
%post
%{_sbindir}/update-alternatives --install \
%{_bindir}/obconf \
obconf \
%{_bindir}/%{name} \
40
%postun
if [ $1 -eq 0 ]; then
%{_sbindir}/update-alternatives --remove obconf \
%{_bindir}/%{name}
fi
%files
%doc AUTHORS CHANGELOG README.md
%{_bindir}/obconf
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%ghost %{_sysconfdir}/alternatives/obconf
%license COPYING
%files lang -f %{name}.lang
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/translations
%if 0%{?sle_version}
%{_datadir}/%{name}/translations/%{name}_???.qm
%endif
%changelog