File ARToolKit_v4l.spec of Package ARToolKit_v4l

#
# spec file for package ARToolKit_v4l
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define realname ARToolKit
%define vidlib v4l
Name:           %{realname}_%{vidlib}
Version:        2.72.1
Release:        0
Summary:        Augmented Reality Tracking Library
License:        GPL-2.0-only
Group:          Development/Libraries/C and C++
URL:            http://www.hitl.washington.edu/artoolkit/
Source0:        %{realname}-%{version}.tar.bz2
Source1:        %{realname}-rpmlintrc
# PATCH-FEATURE-UPSTREAM ARToolKit-2.72.1-shared.patch adam@mizerski.pl -- Make libraries shared
Patch0:         %{realname}-2.72.1-shared.patch
# PATCH-FIX-UPSTREAM ARToolKit-2.72.1-linking.patch adam@mizerski.pl -- Fix linking of binaries
Patch1:         %{realname}-2.72.1-linking.patch
# PATCH-FEATURE-OPENSUSE ARToolKit-2.72.1-configure.patch adam@mizerski.pl -- Make ./Configure use pkg-config and $RPM_OPT_FLAGS
Patch2:         %{realname}-2.72.1-configure.patch
# the following patch from
# http://www.kameda-lab.org/_local/imagelab.tsukuba.ac.jp/ubuntu1004+opencv21/ARToolKitk/index-e.html
Patch3:         artk-v4l2-2.72.1.20101003.patch
BuildRequires:  freeglut-devel
BuildRequires:  glib2-devel
BuildRequires:  libv4l-devel
Conflicts:      %{realname}_gst = %{version}
Provides:       %{realname} = %{version}

%description
The Augmented Reality Tool Kit (ARToolKit) captures images from video sources, optically tracks markers in the images, and composites them with computer-generated content using OpenGL.
This version uses Video4Linux.

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

%description devel
This package contains files that are needed for development using ARToolKit.

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

%description examples-and-utils
This package contains examples and utilities for ARToolKit.

%package data
Summary:        Augmented Reality Tracking Library data
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
BuildArch:      noarch

%description data
This package contains data for ARToolKit.

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

%description doc
This package contains documentation for ARToolKit.

%prep
%autosetup -n %{realname} -p1
export RPM_OPT_FLAGS="%{optflags} -fpermissive"
echo "3
n
n
y" | ./Configure

%build
%make_build -j1

%install
find include/AR bin/{Wrl,Data} doc -type f -exec chmod 0644 "{}" "+"
chmod 644 patterns/*

mkdir -p %{buildroot}%{_libdir}/
mv lib/*.so* %{buildroot}%{_libdir}/

mkdir -p %{buildroot}%{_includedir}
cp -r include/AR %{buildroot}%{_includedir}

mkdir -p %{buildroot}%{_datadir}/%{realname}/
mkdir -p %{buildroot}%{_libdir}/%{realname}/
cp -r bin %{buildroot}%{_libdir}/%{realname}/
mv %{buildroot}%{_libdir}/%{realname}/bin/{Wrl,Data} patterns %{buildroot}%{_datadir}/%{realname}/
ln -s %{_datadir}/%{realname}/{Wrl,Data} %{buildroot}%{_libdir}/%{realname}/bin/

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig

%files
%{_libdir}/*.so.*
%license COPYING.txt
%doc ChangeLog.txt README.txt

%files devel
%{_libdir}/*.so
%{_includedir}/*

%files examples-and-utils
%dir %{_libdir}/%{realname}/
%{_libdir}/%{realname}/*

%files data
%dir %{_datadir}/%{realname}/
%{_datadir}/%{realname}/*

%files doc
%doc doc

%changelog
openSUSE Build Service is sponsored by