%global gittag master

%global gimpplugindir %(gimptool --gimpplugindir)/plug-ins
%global gimpscriptdir %(gimptool --gimpdatadir)/scripts

Name:           gimp-deskew-plugin
Version:        1.1
Release:        6%{?dist}
Summary:        A deskew plug-in for GIMP

License:        GPL v2+
URL:            https://github.com/prokoudine/gimp-deskew-plugin
Source0:        %{url}/archive/%{gittag}/%{name}-%{gittag}.zip

Patch0:		gimp-deskew-automake.patch

BuildRequires:  automake >= 1.6, autoconf >= 2.54
BuildRequires:  glib2-devel >= 2.0.0, intltool >= 0.17
BuildRequires:  gimp-devel >= 2.0, gimp-devel-tools >= 2.0
BuildRequires:  gcc, gcc-c++, make
Requires:       gimp >= 2.0, gimp-libs >= 2.0
Supplements:    gimp-divide-scanned-images

%description

Copyright (C) 2007 Karl Chen <quarl@cs.berkeley.edu>

http://www.cubewano.org/gimp-deskew-plugin/

Distributed under GPL v2+ (see COPYING).

Uses Radon skew detection algorithm and code from the PageTools project
(http://sourceforge.net/projects/pagetools).  kale4@users.sourceforge.net,
yet@users.sourceforge.net.

%prep
%autosetup -n %{name}-%{gittag}


%build
%{_builddir}/%{name}-%{gittag}/autogen.sh --prefix=/usr
%make_build


%install
rm -rf $RPM_BUILD_ROOT
%make_install

mv %{buildroot}/usr/usr/* %{buildroot}/usr/
rm -rf %{buildroot}/usr/usr

%files
%license COPYING
%{gimpplugindir}/deskew
%{_datarootdir}/%{name}/help/en/gimp-help.xml
%{_datarootdir}/%{name}/help/en/index.html
%{_datarootdir}/%{name}/help/images/wilber.png


%changelog
* Sat Nov 17 2018 FeRD (Frank Dana) <ferdnyc AT gmail com> - 1.1-6
- Fixed automake detection in autogen.sh

* Sun Dec 10 2017 Michael Mansell <michael.mansell@gmail.com>
- Updated gimp paths to use system tooling to determine location

* Sun Nov 26 2017 Michael Mansell <michael.mansell@gmail.com>
- Initial attempt
- Fix for weird path issues and extra files