File hugin.spec of Package hugin

# spec file for package hugin
# 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:           hugin
BuildRequires:  Mesa-devel
BuildRequires:  OpenEXR-devel
BuildRequires:  SDL-devel
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  fdupes
BuildRequires:  fftw3-devel
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  glew-devel
BuildRequires:  lapack
BuildRequires:  libexiv2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  liblapack3
BuildRequires:  libpano-devel >= 2.9.18
BuildRequires:  libtiff-devel
BuildRequires:  libxml2
BuildRequires:  tclap
BuildRequires:  update-desktop-files
BuildRequires:  vigra
BuildRequires:  zip
%if 0%{?suse_version} > 1130
BuildRequires:  python-wxWidgets >= 2.7.0
BuildRequires:  wxWidgets-devel
BuildRequires:  python-wxGTK >= 2.7.0
BuildRequires:  wxGTK-devel
%define mversion 2011.4
Version:        %{mversion}.0
Release:        0
Summary:        Toolchain for Stitching of Images and Creating Panoramas
License:        GPL-2.0+
Group:          Productivity/Graphics/Other
# For SVN snapshot:
# svn co hugin
#Source:         %%{name}-svn2008xxxx.tar.bz2
Source1:        %{name}-svn-dummy
Patch0:         gcc47.diff
Requires:       enblend-enfuse >= 3.2
Recommends:     autopano-sift
Recommends:     exiftool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1130
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires

Hugin can be used to stitch multiple images together. The resulting
image can span 360 degrees. Another common use is the creation of very
high resolution pictures by combining multiple images.

Other tools in this package can correct lens distortion, vignetting and
chromatic abberation, create HDR images, provide automatic feature
detection and extraction of key points.

%setup -q

# For SVN snapshot:
#setup -q -n %%{name}
# Rename Catalan in Spain to Catalan.
mv src/translations/ca_ES.po src/translations/ca.po
# Rename Czech in Czech Republic to Czech.
mv src/translations/cs_CZ.po src/translations/cs.po
#sed -i "s/ca_ES/ca/;s/cs_CZ/cs/" src/hugin/po/LINGUAS
# Convert Japanese documentation to UTF-8 and delete note about Shift-JIS:
iconv -f shift-jis -t utf-8 <README_JP >
sed 1,4d < >README_JP.new2
touch -r README_JP README_JP.new2
# For SVN snapshot:
#mkdir bin
#cp %%{SOURCE1} bin/svn
#chmod +x bin/svn
%patch0 -p1

export PATH=$PWD/bin:$PATH
export CFLAGS="%{optflags}"
# parallel make kills our workers
make -j1 VERBOSE=1

%suse_update_desktop_file hugin 2DGraphics
%suse_update_desktop_file PTBatcherGUI 2DGraphics
%suse_update_desktop_file calibrate_lens_gui 2DGraphics
# locales
%{find_lang} %{name}
# Use better place for MIME icons.
mv %{buildroot}%{_datadir}/icons/gnome %{buildroot}%{_datadir}/icons/hicolor
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -a AUTHORS authors.txt COPYING ChangeLog LICENCE_VIGRA README README_JP TODO %{buildroot}%{_docdir}/%{name}/
chmod -x %{buildroot}%{_docdir}/%{name}/*
%fdupes %{buildroot}

%if 0%{?suse_version} > 1130
  if test -f %{_bindir}/update-mime-database ; then
    %{_bindir}/update-mime-database %{_datadir}/mime >/dev/null

%if 0%{?suse_version} > 1130
  if test -f %{_bindir}/update-mime-database ; then
    %{_bindir}/update-mime-database %{_datadir}/mime >/dev/null

%files -f %{name}.lang
%doc %{_docdir}/%{name}
%dir %{_libdir}/hugin
%doc %{_mandir}/man?/*.*