File krename.spec of Package krename

# spec file for package krename
# Copyright (c) 2012 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

Name:           krename
Version:        4.0.9
Release:        0
Summary:        A Powerful Batch Renamer for KDE
License:        GPL-2.0+
Group:          Productivity/File utilities
# PATCH-FIX-UPSTREAM desktop-files.diff -- Make the desktop file KDE and XDG compatible
Patch0:         desktop-files.diff
# PATCH-FIX-UPSTREAM servicemenus-files.patch -- 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 -- 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 -- Remove GPLv2 only code (only used for self-testing)
Patch3:         remove-gplv2-code.diff
BuildRequires:  freetype2-devel
BuildRequires:  libexiv2-devel
BuildRequires:  libkde4-devel
BuildRequires:  libpodofo-devel
%if %suse_version > 1200
BuildRequires:  pkgconfig(taglib)
BuildRequires:  taglib-devel
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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.

%setup -q
%patch2 -p1
# GPLv2 only code, not really needed, lets avoid the license discussion
rm -rf src/modeltest.*

# 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


export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -I%_includedir/freetype2"

%cmake_kde4 -d build 

cd build
cd ..

%if 0%{?suse_version}
%suse_update_desktop_file -r %{name} Qt KDE System FileManager


%find_lang %{name}

%files -f %{name}.lang

openSUSE Build Service is sponsored by