%global forgeurl https://github.com/kleest/samsung-scantopc

Name:           samsung-scantopc
Version:        0.6.0
%forgemeta
Release:        2%{?dist}
Summary:        Tool to interact with the "scan to PC" option in Samsung MFP

License:        GPLv3
URL:            %{forgeurl}
Source0:        %{forgesource}
Source1:        %{name}.service
Patch0:         %{name}-xdg_dir.patch
Patch1:         %{name}-logs.patch
Patch2:         %{name}-pypdf.patch

BuildArch:      noarch

BuildRequires:  systemd-rpm-macros
Requires:       python-sane
Requires:       python-pillow
Requires:       python-six
Requires:       python-pypdf
Requires:       python-pysnmp <= 6.1

%description
Tool to interact with the "scan to PC" option in Samsung MFP.

%prep
%forgeautosetup -p1


%build


%install
install -D -t %{buildroot}%{_datadir}/%{name} etc/samsungScannerServer.conf
install -m 755 -D samsungScannerServer.py %{buildroot}%{_bindir}/samsung-scantopc
install -m 644 -D %{SOURCE1} %{buildroot}%{_userunitdir}/%{name}.service

%files
%license LICENSE
%doc README.md
%{_bindir}/*
%{_userunitdir}/*
%{_datadir}/%{name}


%changelog
* Tue Oct 15 2024 Jerzy Drożdż <jerzy.drozdz@jdsieci.pl> - 0.6.0-2
- Added patch to utilize pypdf instead unmaintained PyPDF3

* Tue Oct 15 2024 Jerzy Drożdż <jerzy.drozdz@jdsieci.pl> - 0.6.0-1
- Initial release