File ganttproject.spec of Package ganttproject

#
# spec file for package ganttproject
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2012 lumnis@googlemail.com
#
# 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/
#


%define relNo 3300
Name:           ganttproject
Version:        3.3
Release:        0
Summary:        Project Management Tool
License:        GPL-3.0-only
Group:          Productivity/Office/Management
URL:            https://www.ganttproject.biz
Source0:        https://dl.ganttproject.biz/%{name}-%{version}.%{relNo}/%{name}-%{version}.%{relNo}.zip
Source1:        %{name}.desktop
Source2:        %{name}.png
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  unzip
BuildRequires:  update-alternatives
BuildRequires:  update-desktop-files
Requires:       java <= 20
Requires:       java >= 17
Requires:       openjfx-devel
BuildArch:      noarch

%description
GanttProject is a cross-platform desktop tool for project scheduling and management.

What can it do?
* Gantt chart.
  Create work breakdown structure, draw dependencies, define milestones.
* Resources.
  Assign human resources to work on tasks, see their allocation on the Resource Load chart.
* PERT chart.
  Generate PERT chart from Gantt chart.
* Export.
  Save charts as PNG images, generate PDF and HTML reports.
* Interoperate.
  Import projects from and export them to Microsoft Project formats. Export to spreadsheets with CSV.
* Collaborate.
  Share projects with your colleagues using WebDAV.

%package samples
Summary:        Sample project files for Ganttproject
Group:          Productivity/Office/Management
Requires:       %{name}
BuildArch:      noarch

%description samples
Contains the following sample files
* House Building

%prep
%autosetup -c -n %{name}-%{version}.%{relNo}

# Add path to openjfx and use software renderer because es2 does not work: symbol lookup error: /usr/lib64/openjfx/libprism_es2.so: undefined symbol: glXQueryExtension
sed -i '/^BOOT_CLASS/ aJFX_ARGS="--module-path %{_libdir}\/jvm\/openjfx\/ --add-modules=ALL-MODULE-PATH -Dprism.order=sw,es2"' ganttproject
sed -i -r '/Xmx[0-9]+m/ s/\$JAVA_EXPORTS/$JFX_ARGS $JAVA_EXPORTS/' ganttproject

%build

%install
mkdir -p %{buildroot}%{_datadir}/%{name}/{lib,plugins,samples}

install -m 644 eclipsito.jar %{buildroot}%{_datadir}/%{name}/
install -m 755 ganttproject %{buildroot}%{_datadir}/%{name}
cp lib/*  %{buildroot}%{_datadir}/%{name}/lib/
cp --recursive plugins/base %{buildroot}%{_datadir}/%{name}/plugins/

# Samples
cp *.gan %{buildroot}%{_datadir}/%{name}/samples/

# startscript
mkdir -p %{buildroot}%{_bindir}
ln -sf %{_datadir}/%{name}/ganttproject %{buildroot}%{_bindir}/ganttproject

# Icon
install -D -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/ganttproject.png

# Desktop menu entry
install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file %{name}

# rpmlint
find %{buildroot}%{_datadir}/%{name}/plugins/base -type f -name '*.xsl' -o -name '*.xml' -o -name '*.properties' \
  -o -name '*.calendar' -o -name README -o -name sortavala.txt |xargs chmod -x

%fdupes %{buildroot}/%{_datadir}/ganttproject

%files
%license LICENSE
%{_bindir}/ganttproject
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/ganttproject.png

%exclude %{_datadir}/%{name}/samples

%files samples
%{_datadir}/%{name}/samples

%changelog
openSUSE Build Service is sponsored by