A new user interface for you! Read more...

File ARToolKitPlus.spec of Package ARToolKitPlus

#
# spec file for package ARToolKitPlus
#
# Copyright (c) 2016 SUSE LINUX 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/
#


Name:           ARToolKitPlus
Version:        2.1.1
Release:        0
%define major 2
Summary:        Augmented Reality Tracking Library
License:        GPL-2.0
Group:          Development/Libraries/C and C++
Url:            http://studierstube.icg.tu-graz.ac.at/handheld_ar/artoolkitplus.php
Source0:        %{name}-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE ARToolKitPlus-2.1.1-include.patch adam@mizerski.pl -- Fix paths in headers
Source1:        %{name}-2.1.1-include.patch
# PATCH-FIX-UPSTREAM ARToolKitPlus-2.1.1-abuild.patch adam@mizerski.pl -- add missing C libraries
Patch0:         %{name}-2.1.1-abuild.patch
# PATCH-FIX-UPSTREAM ARToolKitPlus-2.1.1-calcCameraMatrix.patch adam@mizerski.pl -- make calcCameraMatrix function not static
Patch1:         %{name}-2.1.1-calcCameraMatrix.patch
# PATCH-FIX-OPENSUSE ARToolKitPlus-2.1.1-dont-install-doc.patch adam@mizerski.pl -- Don't install doc. Let the %doc macro do it.
Patch2:         %{name}-2.1.1-dont-install-doc.patch
# PATCH-FIX-OPENSUSE ARToolKitPlus-2.1.1-qmake-release.patch adam@mizerski.pl -- Force qmake to build in release mode (I don't know why, CONFIG=release wasn't enough)
Patch3:         %{name}-2.1.1-qmake-release.patch
# PATCH-FIX-UPSTREAM ARToolKitPlus-2.1.1-gcc47.patch
Patch4:         %{name}-2.1.1-gcc47.patch
# PATCH-FIX-UPSTREAM fix-gcc6-c++14.patch -- Fix compile with gcc6 (uses c++14 as default)
Patch5:         fix-gcc6-c++14.patch
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libqt4-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
ARToolKit is a software library that can be used to calculate camera position and orientation relative to physical markers in real time. This enables the easy development of a wide range of Augmented Reality applications. ARToolKitPlus is an extended version of ARToolKit's vision code that adds features, but breaks compatibility due to a new class-based API.

%package utils
Summary:        Augmented Reality Tracking Library utilities
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{major} = %{version}

%description utils
This package contains utilities for ARToolKitPlus.

%package -n lib%{name}%{major}
Summary:        Augmented Reality Tracking Library
Group:          Development/Libraries/C and C++

%description -n lib%{name}%{major}
ARToolKit is a software library that can be used to calculate camera position and orientation relative to physical markers in real time. This enables the easy development of a wide range of Augmented Reality applications. ARToolKitPlus is an extended version of ARToolKit's vision code that adds features, but breaks compatibility due to a new class-based API.

%package -n lib%{name}-devel
Summary:        Augmented Reality Tracking Library headers
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{major} = %{version}

%description -n lib%{name}-devel
This package contains header files and include files that are needed for development using ARToolKitPlus.

%package doc
Summary:        Augmented Reality Tracking Library documentation
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{major} = %{version}

%description doc
This package contains documentation for ARToolKitPlus.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
export ARTKP=$(pwd)
qmake artoolkitplus.pro PREFIX=%{_prefix} LIBDIR=%{_libdir} ARCH=%{_arch} CONFIG=release

%build
export ARTKP=$(pwd)
make sub-src %{?_smp_mflags}
make %{?_smp_mflags}

%install
make INSTALL_ROOT=%{buildroot} install
pushd %{buildroot}%{_includedir}
patch -p2 < %{SOURCE1}
popd
cp -r src %{buildroot}%{_includedir}/%{name}/
rm -r %{buildroot}%{_includedir}/%{name}/src/{librpp,math}
for what in \*.cpp \*.pro \*.txt Makefile
do
    find %{buildroot}%{_includedir}/%{name}/src -name $what -delete -print
done
find %{buildroot}%{_includedir}/%{name}/ -type f -exec dos2unix {} \;
%fdupes %{buildroot}%{_datadir}/%{name}
dos2unix LICENSE.GPL README THANKS

%post -n lib%{name}%{major} -p /sbin/ldconfig
%postun -n lib%{name}%{major} -p /sbin/ldconfig
%post -n lib%{name}-devel -p /sbin/ldconfig
%postun -n lib%{name}-devel -p /sbin/ldconfig

%files -n lib%{name}%{major}
%defattr(-,root,root)
%doc LICENSE.GPL README THANKS
%{_libdir}/*.so.*

%files -n lib%{name}-devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_includedir}/*

%files utils
%defattr(-,root,root)
%{_bindir}/*
%{_datadir}/%{name}/

%files doc
%defattr(-,root,root)
%doc doc/ART02-Tutorial.pdf
%doc doc/html

%changelog