File dbeaver.spec of Package dbeaver
#
# spec file for package dbeaver
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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: dbeaver
Version: 25.2.3
Release: 0
Summary: Universal database manager
License: GPL-2.0-or-later
Group: Productivity/Databases/Clients
URL: https://%{name}.io
Source0: %{name}-%{version}.tar.xz
ExclusiveArch: x86_64
BuildRequires: fdupes
BuildRequires: update-desktop-files
Requires: java >= 11
%define install_dir /opt/%{name}
%description
Free multi-platform database tool for developers, database administrators, analysts and all people who need to work with databases.
Supports all popular databases:
- MySQL
- PostgreSQL
- SQLite
- Oracle
- DB2
- SQL Server
- Sybase
- MS Access
- Teradata
- Firebird
- Apache Hive
- Phoenix
- Presto
- etc.
%prep
%setup -q -n %{name}
# correct desktop file
%{__mv} %{name}-ce.desktop %{name}.desktop
%{__sed} -i 's#^Name=dbeaver-ce$#Name=%{name}#g' %{name}.desktop
%{__sed} -i 's#^Path=/usr/share/dbeaver-ce/$#Path=%{install_dir}#g' %{name}.desktop
%{__sed} -i 's#^Exec=/usr/share/dbeaver-ce/dbeaver$#Exec=%{install_dir}/%{name}#g' %{name}.desktop
%{__sed} -i 's#^Icon=/usr/share/dbeaver-ce/dbeaver.png$#Icon=%{name}#g' %{name}.desktop
# strip imcompatible plugins
%{__rm} -r plugins/com.sun.jna_*/com/sun/jna/linux-risc*
%build
%{__strip} %{name}
%install
%{__mkdir_p} %{buildroot}%{_bindir}
%{__mkdir_p} %{buildroot}%{install_dir}
%{__install} -D -m 0644 -p %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
%{__install} -D -m 0644 -p %{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%{__cp} -a -t %{buildroot}%{install_dir} %{_builddir}/%{name}/*
%{__rm} %{buildroot}%{install_dir}/%{name}.desktop
%{__rm} %{buildroot}%{install_dir}/%{name}.png
%{__ln_s} %{install_dir}/%{name} %{buildroot}%{_bindir}/%{name}
%suse_update_desktop_file -r -N DBeaver %{name} Development IDE Database GUIDesigner
%fdupes %{buildroot}%{install_dir}
%check
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{install_dir}
%changelog