File hugin.spec of Package hugin

#
# spec file for package hugin
#
# 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:           hugin
BuildRequires:  Mesa-devel OpenEXR-devel SDL-devel boost-devel cmake fftw3-devel freeglut-devel gcc-c++ glew-devel lapack libexiv2-devel liblapack3 libpano-devel >= 2.9.18 libxml2 update-desktop-files vigra zip
%if %suse_version > 1130
BuildRequires:  python-wxWidgets >= 2.7.0 wxWidgets-devel
%else
BuildRequires:  python-wxGTK >= 2.7.0 wxGTK-devel
%endif
%if %suse_version > 1020
BuildRequires:  fdupes
%endif
License:        GPLv2+
Group:          Productivity/Graphics/Other
Summary:        Toolchain for Stitching of Images and Creating Panoramas
Version:        2011.0.0
Release:        1
Source:         http://sourceforge.net/projects/%{name}/files/%{name}/%{name}-2011.0/%{name}-%{version}.tar.bz2
# For SVN snapshot:
# svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin
#Source:         %{name}-svn2008xxxx.tar.bz2
Source1:        %{name}-svn-dummy
Url:            http://hugin.sourceforge.net/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       make
# Optional package, if missing, it could cause unexpected errors:
Requires:       enblend-enfuse >= 3.2
# Optional third party package:
Recommends:     autopano-sift exiftool
%if %suse_version > 1130
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires
%endif

%description
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.

%prep
%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 >README_JP.new
sed 1,4d <README_JP.new >README_JP.new2
touch -r README_JP README_JP.new2
mv README_JP.new2 README_JP
rm README_JP.new
# For SVN snapshot:
#mkdir bin
#cp %{S:1} bin/svn
#chmod +x bin/svn

%build
export PATH=$PWD/bin:$PATH
LIB_SUFFIX=%{_lib}
LIB_SUFFIX=${LIB_SUFFIX#lib}
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_SUFFIX=$LIB_SUFFIX -DENABLE_LAPACK=ON .
# parallel make kills our workers
make -j1 VERBOSE=1

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

%clean
rm -rf $RPM_BUILD_ROOT

%post
%icon_theme_cache_post
%mime_database_post

%postun
%icon_theme_cache_postun
%mime_database_postun

%files -f %{name}.lang
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{_bindir}/*
%{_datadir}/hugin
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/48x48/mimetypes/*.png
%{_datadir}/mime/packages/*.xml
%{_datadir}/pixmaps/*.png
%dir %{_libdir}/hugin
%{_libdir}/hugin/*.so.*
%doc %{_mandir}/man?/*.*

%changelog
openSUSE Build Service is sponsored by