File portfolio-performance.spec of Package portfolio-performance

#
# spec file for package portfolio-performance
#
# 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:           portfolio-performance
Version:        0.80.2
Release:        0
Summary:        Calculate the overall performance of an investment portfolio
License:        EPL-1.0
Group:          Productivity/Office/Finance
URL:            https://www.%{name}.info/
Source0:        %{name}-%{version}.tar.xz
Source1:        %{name}-rpmlintrc
ExclusiveArch:  x86_64
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
Requires:       java >= 11

%define archive_name portfolio
%define binary_name PortfolioPerformance
%define display_name Portfolio Performance
%define install_dir /opt

%description
An open source tool to calculate the overall performance of an investment portfolio - across all accounts - using True-Time Weighted Return or Internal Rate of Return.

%prep
%setup -q -n %{archive_name}
%{__chmod} 644 icon.xpm

%build
%{__strip} -s %{binary_name}

%install
%{__mkdir_p} %{buildroot}%{_bindir}
%{__mkdir_p} %{buildroot}%{_datadir}/applications
%{__mkdir_p} %{buildroot}%{_datadir}/pixmaps
%{__mkdir_p} %{buildroot}%{install_dir}/%{name}
%{__cp} -a -t %{buildroot}%{install_dir}/%{name} %{_builddir}/%{archive_name}/*
%{__ln_s} %{install_dir}/%{name}/%{binary_name} %{buildroot}%{_bindir}/%{name}
%{__cp} -a %{_builddir}/%{archive_name}/icon.xpm %{buildroot}%{_datadir}/pixmaps/%{name}.xpm
%suse_update_desktop_file -c %{name} "%{display_name}" "%{display_name} Analyzer" %{name} %{name} Office Finance
%fdupes %{buildroot}%{install_dir}/%{name}

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{install_dir}
%{install_dir}/%{name}

%changelog
openSUSE Build Service is sponsored by