File panda3d.spec of Package panda3d

#
# spec file for package panda3d
#
# Copyright (c) 2021 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/
#
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects

Name:           panda3d
Version:        1.10.11
Release:        0
Summary:        3D game engine
License:        BSD-2-Clause
Group:          Development/Libraries/Other
Url:            https://www.panda3d.org/
Source:         https://www.panda3d.org/download/panda3d-%{version}/%{name}-%{version}.tar.gz
BuildRequires:  ARToolKit_v4l-devel
BuildRequires:  Mesa-devel
BuildRequires:  bison
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  fftw3-devel
BuildRequires:  flex
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libtiff-devel
BuildRequires:  ode-devel
BuildRequires:  openal-soft-devel
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  python3-devel
BuildRequires:  shared-mime-info
BuildRequires:  squish-devel
BuildRequires:  update-desktop-files
BuildRequires:  vrpn-devel
BuildRequires:  pkgconfig(assimp)
BuildRequires:  pkgconfig(bullet)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(glesv1_cm)
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libswscale)
BuildRequires:  pkgconfig(opus)
BuildRequires:  pkgconfig(opusfile)
BuildRequires:  pkgconfig(vorbis)

%description
Panda3D is a game engine which includes graphics, audio, I/O,
collision detection, and other abilities relevant to the creation of
3D games. Panda3D is open source and free software under the revised
BSD license, and can be used for both free and commercial game
development at no financial cost.  Panda3D's intended game-development
language is Python. The engine itself is written in C++, and utilizes
an automatic wrapper-generator to expose the complete functionality of
the engine in a Python interface.

%package devel
Summary:        Header files for the Panda3D engine
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
Panda3D is a game engine which includes graphics, audio, I/O,
collision detection, and other abilities relevant to the creation of
3D games. Panda3D is open source and free software under the revised
BSD license, and can be used for both free and commercial game
development at no financial cost.  Panda3D's intended game-development
language is Python. The engine itself is written in C++, and utilizes
an automatic wrapper-generator to expose the complete functionality of
the engine in a Python interface.

This package contains the development files which are needed for C++
development with Panda3D.

%prep
%setup -q

%build
# fmodex and nvidiacg excluded, patent/license issue
# opencv: Not needed on Linux as Panda3d supports Video4Linux
# fcollada is obsolete now, will opencollada be used in future?
RPM_OPT_FLAGS="%{optflags} -fno-strict-aliasing" \
	python3 makepanda/makepanda.py %{?jobs:--threads=%{jobs}} \
      --everything --no-fcollada \
	  --no-fmodex --no-nvidiacg --no-opencv

%install
mkdir -p %{buildroot}
python3 makepanda/installpanda.py --destdir=%{buildroot} --prefix=%{_prefix}
find %{buildroot}%{_datadir}/panda3d -type f -name "*.cpp" -exec rm -f {} \;
find %{buildroot}%{_datadir}/panda3d -type f -name "*.cxx" -exec rm -f {} \;
find %{buildroot}%{_datadir}/panda3d -type f -name "*.h" -exec rm -f {} \;
%fdupes %{buildroot}%{_includedir}
%fdupes %{buildroot}%{_datadir}
find  %{buildroot}%{_datadir}/%{name} -type f -exec chmod -x {} \;
find  %{buildroot}%{_datadir}/%{name} -name "*.py" -exec dos2unix -f {} \;
find  %{buildroot}%{_includedir} -type f -exec chmod -x {} \;
chmod -x %{buildroot}%{_sysconfdir}/ld.so.conf.d/panda3d.conf
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/pview.desktop

%post
/sbin/ldconfig
%mime_database_post

%postun
/sbin/ldconfig
%mime_database_postun

%files
%{_bindir}/*
%{_datadir}/panda3d
%{_datadir}/applications/*
%dir %{_datadir}/application-registry
%{_datadir}/application-registry/panda3d.applications
%dir %{_datadir}/mime-info
%{_datadir}/mime-info/panda3d.*
%{_datadir}/mime/packages/panda3d.xml
%config %{_sysconfdir}/Confauto.prc
%config %{_sysconfdir}/Config.prc
%{_sysconfdir}/ld.so.conf.d/panda3d.conf
%{_prefix}/lib*/python*/site-packages

%files devel
%{_includedir}/panda3d
%{_libdir}/panda3d

%changelog
openSUSE Build Service is sponsored by