Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define debug_package %{nil}

Name:           phatch
Version:        0.2.7
Release:        32%{?dist}
Summary:        Photo batch processor
Group:          Applications/Multimedia
License:        GPLv3+
URL:            http://photobatch.stani.be/
Source0:        http://photobatch.stani.be/download/package/%{name}-%{version}.1.tar.gz

BuildArch:      noarch

BuildRequires:  gettext
BuildRequires:  python2
BuildRequires:  desktop-file-utils
BuildRequires:  python2-setuptools

Requires:       hicolor-icon-theme
Requires:       xdg-utils
Requires:       python2-wxpython
Requires:       %{name}-cli = %{version}-%{release}
Patch1:         crash_fix.patch
Patch2:         pyexiv2_compat.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=895778
Patch3:         phatch-pillow.patch
Patch4:         phatch-gtk3-compatibility.patch
Patch5:         phatch-wxpy3.0-compat.patch
Patch6:         phatch-0.2.7-fromstring-tostring-deprecated.patch

%description
Phatch is a simple to use cross-platform GUI Photo Batch Processor
which handles all popular image formats and can duplicate
(sub)folder hierarchies. Phatch can batch re-size, rotate,
apply perspective, shadows, rounded corners, ...
and more in minutes instead of hours or days if you do it manually.
Phatch allows you to use EXIF and IPTC tags for renaming
and data stamping. Phatch also supports a console version
to batch photos on web-servers.


%package cli
Summary: Command line interface for phatch
Group: Applications/Multimedia
Requires:       python2-imaging
Requires:       python2-gobject-base
Requires:       pyexiv2
Requires:       /usr/bin/tiffcp
Requires:       /usr/bin/tiffinfo
Requires:       gnu-free-sans-fonts
Requires:       mlocate
Requires:       dcraw
Requires:       ImageMagick
Requires:       /usr/bin/jpegtran
Requires:       fbida
Requires:       xcftools


%package -n nautilus-%{name}
Summary: Nautilus extension for %{name}
Group: Applications/Multimedia
Requires: %{name} = %{version}-%{release}
Requires: python2-nautilus


%description cli
Command line interface for phatch


%description -n nautilus-%{name}
Nautilus extension for %{name}


%prep
%setup -q
rm -f docs/build/html/.buildinfo
# let %%doc manage documentation
sed -i -e 's/\+ doc_files//' setup.py
# Change search path for documentation
sed -i -e "s@help_path =.*@help_path=\'%{_docdir}/%{name}\'@" %{name}/pyWx/gui.py
%patch1 -p1 -b .orig
%patch2 -p1 -b .orig
%patch3 -p1 -b .orig
%patch4 -p0 -b .orig
%patch5 -p1 -b .orig
%patch6 -p1 -b .orig


%build
%py2_build


%install
%py2_install
desktop-file-install --vendor=""                                 \
       --dir=$RPM_BUILD_ROOT%{_datadir}/applications/   \
       $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop
desktop-file-install --vendor=""                                 \
       --dir=$RPM_BUILD_ROOT%{_datadir}/applications/   \
       $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}-inspector.desktop
%find_lang %{name}
# for non-executable-script
chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/%{name}/{%{name}.py,lib/pyWx/dialogsInspector.py,lib/metadataTest.py,other/surd.py,other/EXIF.py,other/pep8.py}

# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
<!--
BugReportURL: https://bugs.launchpad.net/phatch/+bug/1322916
SentUpstream: 2014-09-17
-->
<application>
  <id type="desktop">phatch.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <summary>Process many images in one step</summary>
  <description>
    <p>
      Phatch (PHoto bATCH Processor) is an application to batch process images.
      With phatch, you specify a group of images that you want to process, and then
      specify the effects you want to apply; once you click apply the process is run
      automatically without having to edit each image individually.
      Phatch has many effects you can apply to your images, including resizing,
      rotating, renaming, colour effects (like desaturation and color warmth),
      drop shadows and adding a background.
    </p>
  </description>
  <url type="homepage">http://photobatch.stani.be/</url>
  <screenshots>
    <screenshot type="default">http://photobatch.wdfiles.com/local--files/start/Screenshot-Phatch3d.jpg</screenshot>
  </screenshots>
</application>
EOF

%files
%doc COPYING docs/build/html/*
%{_datadir}/appdata/%{name}*.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}-inspector.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}*.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}*.svg
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/pixmaps/%{name}-inspector.png
%{python2_sitelib}/%{name}/pyWx
%{python2_sitelib}/%{name}/lib/pyWx


%files cli -f %{name}.lang
%doc AUTHORS COPYING README
%{python2_sitelib}/%{name}
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_mandir}/man?/%{name}*
%{python2_sitelib}/*egg-info
%exclude %{python_sitelib}/%{name}/pyWx
%exclude %{python_sitelib}/%{name}/lib/pyWx


%files -n nautilus-%{name}
%doc COPYING
%{python2_sitelib}/%{name}/lib/linux/nautilusExtension.*


%changelog
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.2.7-31
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.7-29
- Remove obsolete scriptlets

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sun Aug 21 2016 Jaromír Cápík <jaromir.capik@email.cz> - 0.2.7-26
- Fixing deprecated fromstring/tostring [patch from Nuno Dias] (#1297194)

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-25
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Sep 18 2015 Richard Hughes <rhughes@redhat.com> - 0.2.7-23
- Remove no longer required AppData file

* Mon Jul 13 2015 Jaromir Capik <jcapik@redhat.com> - 0.2.7-22
- Replacing notify-python with pygobject3-base in the Requires (#1192867)

* Tue Jul 07 2015 Jaromir Capik <jcapik@redhat.com> - 0.2.7-21
- Adding wxpy3 compatibility patch from Olly Betts (#1192867)

* Tue Jul 07 2015 Jaromir Capik <jcapik@redhat.com> - 0.2.7-20
- Adding gtk3 compatibility patch from Scott Talbert (#1192867)

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Mar 26 2015 Richard Hughes <rhughes@redhat.com> - 0.2.7-18
- Add an AppData file for the software center

* Thu Oct 02 2014 Rex Dieter <rdieter@fedoraproject.org> 0.2.7-17
- update icon/mime scriptlets

* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.7-16
- Replace python-setuptools-devel BR with python-setuptools

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed Sep 04 2013 jcapik@redhat.com - 0.2.7-14
- Unversioned docdir change (#994032)
- Spec cleaning
- Fixing bogus dates in the changelog

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Feb  4 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.7-12
- Add patch for compatibility with python-pillow

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Mar 24 2012 Lakshmi Narasimhan T V <lakshminaras2002@gmail.com> - 0.2.7-10
- Rebuild for xcftools 

* Thu Mar 08 2012 Lakshmi Narasimhan T V <lakshminaras2002@gmail.com> - 0.2.7-9
- Rebuild for xcftools

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Jun 25 2011 Lakshmi Narasimhan T V <lakshminaras2002@gmail.com> - 0.2.7-7
- Fix pyexiv2 compatibility issue #704703. Updated the patch pyexiv2_compat.patch

* Thu Jun 23 2011 Lakshmi Narasimhan T V <lakshminaras2002@gmail.com> - 0.2.7-6
- Fix pyexiv2 compatibility issue #704703. Applied patch pyexiv2_compat.patch

* Thu May 12 2011 Lakshmi Narasimhan T V <lakshminaras2002@gmail.com> - 0.2.7-5
- Fix crash issue #646035

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Nov 20 2010 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.2.7-3
- Remove thai-scalable-purisa-fonts from requires
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.2.7-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Sat Mar 13 2010 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.2.7-1
- Update to 0.2.7
- Package is now noarch
* Tue Dec 15 2009 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.2.5-1
- Update to 0.2.5
- New cli subpackage to use the application with no gui requirements
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Fri Dec 19 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.6-3
- Fix requires for nautilus-extension
- Licence file added to nautilus-extension
- No more docs subdirectory in documentation folder
- Fix version
* Thu Dec 18 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.6-2
- subpckage created for nautilus extension
- timestamp preserved for sed'ed file
- wxPython removed from BuildRequires
- Source0 updated
- whole documentation included
- update-desktop-database and update-mime-database added
- egg-info properly builded
- python-devel buildrequries changed to python
* Sun Nov  9 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.6-1
- Rebuild for 0.1.6
* Wed Jul 23 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.5-2
- Licence tag updated
* Mon Jul 21 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.5-1
- rebuild for 0.1.5
- package now builds under F8
* Thu Jul  3 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.4.bzr538-2
- find_lang usage to locate all locale files
* Wed Jul  2 2008 Nicoleau Fabien <nicoleau.fabien@gmail.com> - 0.1.4.bzr538-1
- Initial build