File krename.spec of Package krename4
#
# spec file for package krename
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: krename
Version: 4.0.9
Release: 0
Summary: A Powerful Batch Renamer for KDE
License: GPL-2.0+
Group: Productivity/File utilities
Url: http://www.krename.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM desktop-files.diff asterios.dramis@gmail.com -- Make the desktop file KDE and XDG compatible
Patch0: desktop-files.diff
# PATCH-FIX-UPSTREAM servicemenus-files.patch asterios.dramis@gmail.com -- Make the desktop files KDE and XDG compatible
Patch1: servicemenus-files.patch
# PATCH-FIX-UPSTREAM krename-4.0.7_add_common_names_to_FindLIBPODOFO.patch sf#3256922 asterios.dramis@gmail.com -- Fix podofo library names cmake check (patch taken from upstream)
Patch2: krename-4.0.7_add_common_names_to_FindLIBPODOFO.patch
# PATCH-FIX-UPSTREAM remove-gplv2-code.diff dmueller@suse.de -- Remove GPLv2 only code (only used for self-testing)
Patch3: remove-gplv2-code.diff
# PATCH-FIX-openSUSE tittiatcokeƦgmail.com -- make sure that the freetype includes are found
Patch4: fix-freetype2-includes.patch
# PATCH-FIX-OPENSUSE gcc6-fix.patch boo#985366 -- fix build with gcc6
Patch5: gcc6-fix.patch
# PATCH-FIX-UPSTREAM -- add support for exiv2 >= 0.27
Patch6: Fix-building-against-exiv2-0.27.patch
# PATCH-FIX-UPSTREAM
Patch7: Fix-build-with-exiv2_0.28.patch
# PATCH-FIX-UPSTREAM
Patch8: Support-podofo-0.10.patch
BuildRequires: freetype2-devel
BuildRequires: libexiv2-devel
BuildRequires: libkde4-devel
BuildRequires: libpodofo-devel
%if %suse_version > 1200
BuildRequires: pkgconfig(taglib)
%else
BuildRequires: taglib-devel
%endif
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%kde4_runtime_requires
%description
KRename is a powerful batch renamer for KDE. It allows you to easily rename
hundreds or even more files in one go. The filenames can be created by parts of
the original filename, numbering the files or accessing hundreds of informations
about the file, like creation date or Exif informations of an image.
%prep
%setup -q
%patch -P0
%patch -P1
%patch -P2 -p1
# GPLv2 only code, not really needed, lets avoid the license discussion
rm -rf src/modeltest.*
%patch -P3
%if 0%{?suse_version} > 1310
%patch -P4 -p1
%endif
%patch -P5 -p1
%patch -P6 -p1
%patch -P7 -p1
%if 0%{?suse_version} > 1550
%patch -P8 -p1
%endif
# Remove build time references so build-compare can do its work (fix rpmlint warning "file-contains-date-and-time")
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" src/main.cpp
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/main.cpp
%build
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -I%_includedir/freetype2"
%cmake_kde4 -d build
%make_jobs
%install
cd build
%kde4_makeinstall
cd ..
%if 0%{?suse_version}
%suse_update_desktop_file -r %{name} Qt KDE System FileManager
%endif
%kde_post_install
%find_lang %{name}
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README TODO
%{_kde4_bindir}/krename
%{_kde4_applicationsdir}/krename.desktop
%{_kde4_iconsdir}/hicolor/*/*/krename.png
%{_kde4_iconsdir}/locolor/*/*/krename.png
%{_kde4_servicesdir}/ServiceMenus/krename_all_nonrec.desktop
%{_kde4_servicesdir}/ServiceMenus/krename_dir_rec.desktop
%changelog