File PlotDigitizer.spec of Package PlotDigitizer
#
# spec file for package PlotDigitizer
#
# Copyright (c) 2025 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: PlotDigitizer
Version: 2.6.11
Release: 0
Summary: Digitize data points off scanned plots, scaled drawings, or orthographic photos
License: LGPL-2.0-or-later OR GPL-2.0-or-later
URL: https://plotdigitizer.sourceforge.net/
Source: %{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM PlotDigitizer-hidpi-JTable-row-sizes.patch badshah400@gmail.com -- Adapt table row size according to content font size (mainly for HiDPI)
Patch0: PlotDigitizer-hidpi-JTable-row-sizes.patch
# PATCH-FIX-UPSTREAM PlotDigitizer-hidpi-AppWindow-size.patch badshah400@gmail.com -- Make default app window size better for large font systems or HiDPI screens
Patch1: PlotDigitizer-hidpi-AppWindow-size.patch
# PATCH-FIX-UPSTREAM PlotDigitizer-info-panel-default-color.patch badshah400@gmail.com -- Fix bottom info panel being rendered using white font on gray background when dark themes are used
Patch2: PlotDigitizer-info-panel-default-color.patch
BuildRequires: ant
BuildRequires: autotrace
BuildRequires: icns-utils
BuildRequires: hicolor-icon-theme
BuildRequires: java-devel
BuildRequires: javapackages-tools
BuildRequires: strip-nondeterminism
Requires: autotrace
BuildArch: noarch
%description
PlotDigitizer is an easy to use Java program that allows you to digitize data
points off of scanned plots, scaled drawings, or orthographic photographs.
Includes an automatic digitization feature that can automatically digitize many
types of functional data.
%prep
%autosetup -p1
%build
%ant jar
icns2png -x resources_macosx/PlotDigitizer.icns
%install
mkdir -p %{buildroot}/%{_datadir}/%{name}
install -m 0644 jars/%{name}.jar %{buildroot}/%{_datadir}/%{name}/
cp -r -t %{buildroot}/%{_datadir}/%{name}/ SamplePlots
strip-all-nondeterminism %{buildroot}%{_datadir}/%{name}/%{name}.jar
# Section startscript
mkdir -p %{buildroot}/%{_bindir}
cat > %{buildroot}/%{_bindir}/%{name} << EOF
#!/bin/sh
exec java -Xmx256m -jar %{_datadir}/%{name}/%{name}.jar
EOF
chmod +x %{buildroot}/%{_bindir}/%{name}
# /Section
# Section desktop menu entry
mkdir -p %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/net.sourceforge.%{name}.desktop << EOF
[Desktop Entry]
Type=Application
Name=%{name}
GenericName=Plot digitizer
Keywords=plotting;digitization;scan;graphics;
Comment=%{summary}
Categories=Science;DataVisualization;
Icon=%{name}
Exec=%{name}
Terminal=false
StartupWMClass=jahuwaldt-swing-MDIApplication
EOF
# /Section
# Section icons
for size in 16 32 128 256 512
do
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps
install -m 0644 %{name}_${size}x${size}x32.png \
%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/%{name}.png
done
# /Section
%files
%license GPL_license.txt LesserGPL_license.txt
%doc README*.txt
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/icons/hicolor/*/apps/*.png
%{_datadir}/applications/*.desktop
%changelog