File vigra.spec of Package vigra

#
# spec file for package vigra
#
# 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:           vigra
BuildRequires:  boost-devel fftw3-devel gcc-c++ libjpeg-devel libpng-devel libtiff-devel pkg-config python-devel zlib-devel
License:        MIT
Group:          Development/Libraries/C and C++
AutoReqProv:    on
Summary:        Computer vision Library
Version:        1.6.0
Release:        20
Source:         %{name}%{version}.tar.bz2
Patch:          vigra1.6.0-autoconf.patch
Patch1:         vigra1.6.0-libpng14.patch
Patch2:         vigra-config.patch
Url:            http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
VIGRA stands for "Vision with Generic Algorithms". It is a novel
computer vision library that puts its main emphasis on customizable
algorithms and data structures. By using template techniques similar to
those in the C++ Standard Template Library, you can easily adapt any
VIGRA component to the needs of your application, without giving up
execution speed.



Authors:
--------
    Ullrich Koethe <koethe@informatik.uni-hamburg.de>

%package -n libvigraimpex2
License:        MIT
Group:          Development/Libraries/C and C++
Summary:        Computer vision Library
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}

%description -n libvigraimpex2
VIGRA stands for "Vision with Generic Algorithms". It is a novel
computer vision library that puts its main emphasis on customizable
algorithms and data structures. By using template techniques similar to
those in the C++ Standard Template Library, you can easily adapt any
VIGRA component to the needs of your application, without giving up
execution speed.



Authors:
--------
    Ullrich Koethe <koethe@informatik.uni-hamburg.de>

%package devel
License:        MIT
Group:          Development/Libraries/C and C++
Summary:        Development files for VIGRA Library
Requires:       libvigraimpex2 = %{version} 
Requires:       glibc-devel
Requires:       libstdc++-devel 
Requires:       libtiff-devel
Requires:       fftw3-devel

%description devel
VIGRA stands for "Vision with Generic Algorithms". It is a novel
computer vision library that puts its main emphasis on customizable
algorithms and data structures. By using template techniques similar to
those in the C++ Standard Template Library, you can easily adapt any
VIGRA component to the needs of your application, without giving up
execution speed.



Authors:
--------
    Ullrich Koethe <koethe@informatik.uni-hamburg.de>

%prep
%setup -q -n %{name}%{version}
%patch
%patch1 -p1
%patch2

%build
export vigra_srcdir=$PWD
%if %suse_version >= 1110
cp -a config/configure.in config/acinclude.m4 .
rm config/libtool.m4 config/status.m4 config/aclocal.m4
ACLOCAL="aclocal -I config" autoreconf -f -i
%configure\
%else
CXXFLAGS="$RPM_OPT_FLAGS" CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir}\
%endif
	--disable-static --with-pic\
	--docdir=%{_docdir}/%{name}\
	--with-tiff\
	--with-jpeg\
	--with-png\
	--with-zlib\
	--with-fftw\
	--with-boostpython\
	CXXFLAGS="$RPM_OPT_FLAGS" CFLAGS="$RPM_OPT_FLAGS"
make %{?jobs:-j%jobs}

%install
make install\
	libdir=$RPM_BUILD_ROOT/%{_libdir}\
	bindir=$RPM_BUILD_ROOT/%{_bindir}\
	docdir=$RPM_BUILD_ROOT/%{_docdir}/%{name}\
	includedir=$RPM_BUILD_ROOT/%{_includedir}
mkdir -p $RPM_BUILD_ROOT/%{_docdir}/libvigraimpex2
mv $RPM_BUILD_ROOT/%{_docdir}/%{name}/LICENSE.txt $RPM_BUILD_ROOT/%{_docdir}/libvigraimpex2/
cp -a README.txt $RPM_BUILD_ROOT/%{_docdir}/libvigraimpex2/
%{__rm} -f %{buildroot}%{_libdir}/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%post -n libvigraimpex2 -p /sbin/ldconfig

%postun -n libvigraimpex2 -p /sbin/ldconfig

%files -n libvigraimpex2
%defattr(-,root,root)
%doc %dir %{_docdir}/libvigraimpex2
%doc %{_docdir}/libvigraimpex2/LICENSE.txt
%doc %{_docdir}/libvigraimpex2/README.txt
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_bindir}/vigra-config
%{_libdir}/*.so
%{_includedir}/*
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/[a-z]*
%doc %{_docdir}/%{name}/[A-KM-QS-Z]*
%doc %{_docdir}/%{name}/RG*
%doc %{_docdir}/%{name}/Ra*

%changelog
openSUSE Build Service is sponsored by