File view3dscene.spec of Package view3dscene

%define debug_package %{nil}

%define newName castle-model-viewer

Name:           view3dscene
Version:        %(cat rpmbuild/SOURCES/%{newName}*/code/v3dsceneversion.pas | grep Version.*= | sed "s|.*'\(.*\)'.*|\1|")
Release:        0
Url:            https://github.com/castle-engine/%{newName}
Group:          Development/Libraries/C and C++
License:        BSD-3-Clause
Summary:        Viewer for many 3D model formats

Source0:        %{newName}.tar
Source1:        castle-engine.tar

BuildRequires:  fpc
BuildRequires:  libglvnd-devel
BuildRequires:  gtk2-devel

%description
Viewer for many 3D model formats: X3D, VRML, Collada, 3DS, MD3, Wavefront OBJ, STL and (2D) Spine JSON.
Complete documentation on https://castle-engine.sourceforge.io/view3dscene.php .
Using Castle Game Engine, see https://castle-engine.sourceforge.io/ .

%prep
%setup -q -n %{newName}
cd ..
tar -xf %{SOURCE1}
cd castle-engine
tools/build-tool/castle-engine_compile.sh
cp tools/build-tool/castle-engine ../%{newName}

%build
export PATH="$PATH:./"
export CASTLE_ENGINE_PATH="$(pwd)/../castle-engine"
make %{?_smp_mflags}


%install
install -dm755 %{buildroot}/%{_bindir}
install -pDm 755 %{newName} %{buildroot}/%{_bindir}/%{newName}
install -pDm 755 castle-model-converter %{buildroot}/%{_bindir}
install -pDm 644 freedesktop/%{newName}.png %{buildroot}/%{_datadir}/pixmaps/%{newName}.png
install -pDm 644 freedesktop/%{newName}.svg %{buildroot}/%{_datadir}/pixmaps/%{newName}.svg
install -pDm 644 freedesktop/%{newName}.xml %{buildroot}/%{_datadir}/mime/packages/%{newName}.xml
install -pDm 644 freedesktop/%{newName}.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop
cd %{buildroot}/%{_bindir} ; ln -s %{newName} ./%{name}

%files
%defattr(-,root,root)
%doc doc/man/man1/*.1 COPYING.GPL2.txt
%{_bindir}/%{newName}
%{_bindir}/%{name}
%{_bindir}/castle-model-converter
%{_datadir}/pixmaps/%{newName}.*
%{_datadir}/mime/packages/%{newName}.xml
%{_datadir}/applications/%{name}.desktop

%changelog
* Mon Sep 2 2019 Axiotis Michail
-Initial release of the xnedit editor
openSUSE Build Service is sponsored by