%define pkg_name      xyscan
%define pkg_version   4.3.0
%define pkg_version_s 4.30
%define pkg_release 2%{?_dist_release}

Summary: A data thief for scientist
Name:    %{pkg_name}
Version: %{pkg_version}
Release: %{pkg_release}

License: GPLv3 or later
Group:   Applications/Edutainment
URL:     http://rhig.physics.yale.edu/~ullrich/software/xyscan/
Source0: http://rhig.physics.yale.edu/~ullrich/software/xyscan/Distributions/%{pkg_version_s}/%{name}-%{pkg_version_s}-src.tgz
Source1: xyscan.desktop

Buildroot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtmultimedia-devel
BuildRequires: poppler-qt5-devel
Requires: qt5-qtbase
Requires: qt5-qtmultimedia
Requires: poppler-qt5

Vendor: Project Vine
Distribution: Vine Linux
Packager: ara_t


%description
xyscan is a tool for scientists in need to extract values of data points
from a plot that is available in electronic format. It can handle plots
with linear and logarithmic scales, tilted (distorted plots), and allows
to "scan" error bars as well. In fact xyscan can be used for extracting
numeric values from any kind of 2D technical drawings.


%prep
%{__rm} -rf ${RPM_BUILD_ROOT}
%setup -q -n %{name}

%build
qmake-qt5 xyscan.pro INCPATH="%{_includedir}/poppler/qt5"
%{__perl} -pi -e 's|/usr/local/bin/|/usr/bin/|g' Makefile
%{__perl} -pi -e 's|/usr/local/share/|/usr/share/|g' Makefile
%{__make} %{?_smp_mflags}

%install
%{__make} install INSTALL_ROOT=${RPM_BUILD_ROOT}

%{__mkdir_p} ${RPM_BUILD_ROOT}%{_datadir}/applications/
%{__mkdir_p} ${RPM_BUILD_ROOT}%{_datadir}/icons/
%{__cp} -a %{SOURCE1} ${RPM_BUILD_ROOT}%{_datadir}/applications/
%{__cp} images/xyscanIcon.png ${RPM_BUILD_ROOT}%{_datadir}/icons/

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%doc license.txt
%{_bindir}/xyscan
# %{_libdir}/xyscan-%{version}/
%{_datadir}/applications/xyscan.desktop
%{_datadir}/icons/xyscanIcon.png
%{_datadir}/xyscan/


%changelog
* Mon Oct 14 2019 Toshiaki Ara <ara_t@384.jp> 4.3.0-2
- rebuild wiith poppler-0.81.0

* Sun Apr 01 2018 Toshiaki Ara <ara_t@384.jp> 4.3.0-1
- update to 4.3.0

* Wed Jan 03 2018 Toshiaki Ara <ara_t@384.jp> 4.2.1-2
- rebuild under poppler-0.61.1

* Sat Dec 02 2017 Toshiaki Ara <ara_t@384.jp> 4.2.1-1
- update to 4.2.1 for VineSeed

* Sat Jul 30 2016 Toshiaki Ara <ara_t@384.jp> 3.3.0-1
- new package

