File wings.spec of Package wings

# spec file for package wings
# Copyright (c) 2012 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

%define erlangdir %{_libdir}/erlang

Name:           wings
Version:        2.1.5
Release:        1
License:        SUSE-Permissive
Summary:        3D Subdivision Modeler
Group:          Productivity/Graphics/3D Editors
Source0:        %{name}-%{version}.tar.bz2
Source1:        wings.png
Patch0:         wings-2.1.5-makefiles.patch
BuildRequires:  Mesa-devel
BuildRequires:  erlang-esdl-devel
BuildRequires:	erlang-wx
BuildRequires:	erlang-opencl-devel
BuildRequires:  gcc
BuildRequires:  libSDL-devel
BuildRequires:  update-desktop-files
# might be that the automatic dependency resolving does not work correctly?
# => please see bnc #750318 - so we require libSDL_sound here to be sure
# Requires:       libSDL_sound
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Wings 3D is a subdivision modeler with an user interface that is easy
to use for both beginners and advanced users (inspired by Nendo and
Mirai from Izware).

%setup -q

# link is for include statement to find wings/.. directories
(cd .. && ln -s %{name}-%{version} %{name})
%patch0 -p1

# remove -Werror, since erlc 20+ warns on export_all
find . -name Makefile -exec sed -i .bak -e 's/-Werror//' {} \;

# add 

export ESDL_PATH=
PATH=%{erlangdir}/bin:$PATH make %{?_smp_mflags} TYPE=wx 

%define wingsdir %{_libdir}/%{name}-%{version}

mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{wingsdir}

# copy the wings binaries
cp -rf ebin %{buildroot}%{wingsdir}
cp -rf textures %{buildroot}%{wingsdir}
cp -rf shaders %{buildroot}%{wingsdir}
cp -rf plugins %{buildroot}%{wingsdir}
cp -rf %{buildroot}%{wingsdir}

mkdir -p %{buildroot}%{_datadir}/pixmaps
cp %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/

cat > %{buildroot}%{_bindir}/wings <<EOF
exec %{_bindir}/erl -smp -pa ${ROOTDIR} -run wings_start start_halt \$*
chmod 0755 %{buildroot}%{_bindir}/wings

cat > wings.desktop <<EOF
[Desktop Entry]
Name=Wings 3D
GenericName=Wings 3D
Comment=Wings 3D polygon mesh modeler
StartupWMClass=Wings 3D

%suse_update_desktop_file -n -i %{name}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

rm -rf '%{buildroot}'

%doc AUTHORS CodingGuidelines license.terms README OLD-NOTES README-20.txt

openSUSE Build Service is sponsored by