File gqview.spec of Package gqview

#
# spec file for package gqview
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           gqview
BuildRequires:  desktop-translations gtk2-devel intltool liblcms-devel update-desktop-files
%if %suse_version > 1020
BuildRequires:  fdupes
%endif
Version:        2.1.5
Release:        74
License:        GPLv2+
Summary:        Graphic File Browser Utility
Group:          Productivity/Graphics/Viewers
Source:         gqview-%{version}.tar.bz2
Source1:        gqview-editors-po-update.sh
Patch:          gqview-editors.patch
Patch1:         gqview-adobe-icc.patch
Patch2:         gqview-rc-quotes.patch
Patch3:         gqview-docdir.patch
Patch4:         gqview-motion-hint.patch
Recommends:     AdobeICCProfiles
# Code can use jpegtran:
Recommends:     jpeg
Recommends:     %{name}-lang
Url:            http://gqview.sourceforge.net/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
GQview is a browser for graphic files. It offers single click viewing
of graphics files, including thumbnail view, zoom, filtering features,
and external editor support.

%lang_package
%prep
%setup -q
%patch
%patch1
%patch2
%patch3
%patch4
rename no nb po/no.*
sed -i "s/\(ALL_LINGUAS.*\) no /\1 nb /" configure.in
for PO in po/*.po ; do msgconv --to-code=UTF-8 $PO -o $PO.new ; mv $PO.new $PO ; done
# Merge translated names of programs from gqview-editors.patch:
bash -x %{S:1}

%build
autoreconf -f -i
%configure
make helpdir=%{_defaultdocdir}/%{name}/html readmedir=%{_defaultdocdir}/%{name} %{?jobs:-j%jobs}

%install
make install DESTDIR=$RPM_BUILD_ROOT helpdir=%{_defaultdocdir}/%{name}/html readmedir=%{_defaultdocdir}/%{name}
# NEWS is empty
cp AUTHORS COPYING ChangeLog README TODO $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}
%find_lang %{name} %{?no_lang_C}
%suse_update_desktop_file %name GTK Graphics Photography
%if %suse_version > 1020
%fdupes $RPM_BUILD_ROOT
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%if 0%{?suse_version} > 1130

%post
%desktop_database_post
%endif

%if 0%{?suse_version} > 1130

%postun
%desktop_database_postun
%endif

%files
%defattr(-,root,root)
%doc %{_defaultdocdir}/%{name}
%{_bindir}/*
%{_datadir}/applications/gqview.desktop
%{_datadir}/pixmaps/*.png
%doc %{_mandir}/man1/*.*

%files lang -f %{name}.lang

%changelog