File doublecmd.spec of Package doublecmd

#
# spec file for package doublecmd-qt
#
# Copyright (c) 2022 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/
#


%global flavor @BUILD_FLAVOR@%{nil}

%if "%{flavor}" == "gtk"
%define build_qt 0
%define build_gtk 1
%define name_suffix -gtk
%else
%define build_qt 1
%define build_gtk 0
%define name_suffix -qt
%endif


Name:           doublecmd%{name_suffix}
Version:        1.1.21
Release:        0
Summary:        Twin-panel (commander-style) file manager
License:        GPL-2.0
Group:          Productivity/File utilities
URL:            http://doublecmd.sourceforge.net
Source0:        doublecmd-%{version}.tar.gz
Source99:       doublecmd.rpmlintrc
BuildRequires:  fpc >= 3.2.0
BuildRequires:  fpc-src
BuildRequires:  gcc
BuildRequires:  glib2-devel
BuildRequires:  lazarus >= 3.0
BuildRequires:  dbus-1-devel
BuildRequires:  libbz2-devel
BuildRequires:  polkit

# QT
%if %{build_qt}
BuildRequires:  libQt6Pas-devel
BuildRequires:  lazarus-lcl-qt6
Conflicts:      doublecmd-gtk
Provides:       doublecmd
Provides:       doublecmd-qt6 = %{version}
Obsoletes:      doublecmd-qt6 < %{version}
%endif

# GTK
%if %{build_gtk}
BuildRequires:  gtk2-devel
BuildRequires:  ncurses-devel
Conflicts:      doublecmd-qt
Provides:       doublecmd
Provides:       doublecmd-gtk = %{version}
Obsoletes:      doublecmd-gtk < %{version}
%endif


%description
Double Commander is a cross platform open source file manager with two panels side by side.
It is inspired by Total Commander and features some new ideas.


%prep
%setup -q -n doublecmd-%{version}


%build
%if %{build_qt}
./build.sh beta qt6
%endif

%if %{build_gtk}
./build.sh beta gtk2
%endif


%install
install/linux/install.sh --install-prefix=%{buildroot}


%files
%{_libdir}/doublecmd
%{_bindir}/doublecmd
%{_datadir}/doublecmd
%{_mandir}/man1/doublecmd.*
%{_datadir}/pixmaps/doublecmd.*
%{_datadir}/applications/doublecmd.desktop
%{_datadir}/icons/hicolor/scalable/apps/doublecmd.svg
%{_datadir}/polkit-1/actions/org.doublecmd.root.policy

%changelog
openSUSE Build Service is sponsored by