Blob Blame Raw
Name:           wings
Version:        0.99.02
Release:        1%{?dist}
Summary:        3D Subdivision Modeler

Group:          Applications/Multimedia
License:        Distributable
URL:            http://www.wings3d.com
Source0:	http://prdownloads.sourceforge.net/wings/wings-%{version}.tar.bz2
Source1:	http://prdownloads.sourceforge.net/wings/wings3d_manual1.6.1.pdf
Source3:	wings.png
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	erlang-esdl-devel
BuildRequires:	libGL-devel
BuildRequires:	libGLU-devel
BuildRequires:  desktop-file-utils
Provides:       wings-povray = %{version}-%{release}
Obsoletes:      wings-povray

%description
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).


%package docs
Group:		Applications/Multimedia
Summary:	Documentation for Wings 3D
Requires:	%{name} = %{version}-%{release}

%description docs
Documentation for Wings 3D.


%prep
%setup -q
sed -i 's|-include("sdl_keyboard.hrl").|-include_lib("esdl/include/sdl_keyboard.hrl").|' src/wings_edge_cmd.erl plugins_src/commands/wpc_constraints.erl 
cp %{SOURCE1} .

%define erlangdir %{_libdir}/erlang

%build
# %%{?_smp_mflags} breaks the build
PATH=%{erlangdir}/bin:$PATH make


%install
%define wingsdir $RPM_BUILD_ROOT%{_libdir}/wings
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p %{wingsdir}/bin

# copy the wings binaries
mkdir -p %{wingsdir}/lib
mkdir -p %{wingsdir}/lib/wings-%{version}
cp -rf ebin %{wingsdir}/lib/wings-%{version}
cp -rf plugins %{wingsdir}/lib/wings-%{version}
cp -rf fonts %{wingsdir}/lib/wings-%{version}

# copy the erlang kernel binaries
cp -rf %{erlangdir}/lib/kernel* %{wingsdir}/lib
rm -rf %{wingsdir}/lib/kernel*/{examples,include,src}

# copy the erlang stdlib binaries
cp -rf %{erlangdir}/lib/stdlib* %{wingsdir}/lib
rm -rf %{wingsdir}/lib/stdlib*/{examples,include,src}

# copy the esdl binaries
cp -rf %{erlangdir}/lib/esdl* %{wingsdir}/lib
rm -rf %{wingsdir}/lib/esdl*/{include,src,vsn}

# copy erlang binaries and scripts
cp -f %{erlangdir}/erts*/bin/{beam,child_setup,erlexec,inet_gethost} %{wingsdir}/bin
cp -f %{erlangdir}/bin/start.boot %{wingsdir}/bin


find $RPM_BUILD_ROOT -name '.cvsignore' | xargs rm -rf
find $RPM_BUILD_ROOT -name 'README' | xargs rm -f

cat > $RPM_BUILD_ROOT%{_bindir}/wings <<EOF
#!/bin/sh
ROOTDIR=%{_libdir}/wings
BINDIR=\$ROOTDIR/bin
EMU=beam
PROGNAME=wings
export ROOTDIR
export BINDIR
export EMU
export PROGNAME
exec \$BINDIR/erlexec -noinput -run wings_start start_halt \$*
EOF
chmod 755 $RPM_BUILD_ROOT%{_bindir}/wings

cat > wings.desktop <<EOF
[Desktop Entry]
Name=Wings 3D
Comment=Wings 3D polygon mesh modeler
Exec=wings
Icon=wings.png
Terminal=true
Type=Application
Encoding=UTF-8
X-Desktop-File-Install-Version=0.9
StartupNotify=true
StartupWMClass=Wings 3D
EOF

desktop-file-install --vendor fedora \
    --add-category Graphics \
    --dir $RPM_BUILD_ROOT%{_datadir}/applications \
    wings.desktop

mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/pixmaps


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{_bindir}/wings
%{_libdir}/wings
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%doc README license.terms AUTHORS


%files docs
%defattr(-,root,root,-)
%doc wings3d_manual1.6.1.pdf


%changelog
* Thu Mar 27 2008 Gerard Milmeister <gemi@bluewin.ch> - 0.99.02-1
- new releae 0.99.02

* Sun Apr  8 2007 Gerard Milmeister <gemi@bluewin.ch> - 0.98.36-1
- new version 0.98.36

* Thu Feb 15 2007 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-11
- add optflags (bugzilla 228925)

* Sun Dec 10 2006 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-10
- split off povray plug-in

* Mon Aug 28 2006 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-9
- Rebuild for FE6

* Wed Jun  7 2006 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-8
- revert to use erlang R10B

* Thu May 18 2006 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-7
- rebuilt for erlang R11B

* Thu Apr 27 2006 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-5
- split off docs package

* Tue Apr 25 2006 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-3
- build against erlang-esdl-devel

* Sun Dec 18 2005 Gerard Milmeister <gemi@bluewin.ch> - 0.98.32b-1
- New Version 0.98.32b

* Sun Mar  6 2005 Gerard Milmeister <gemi@bluewin.ch> - 0.98.27b-1
- New Version 0.98.27b

* Sun Feb 13 2005 Gerard Milmeister <gemi@bluewin.ch> - 0:0.98.27a-1
- New Version 0.98.27a

* Mon Dec 27 2004 Gerard Milmeister <gemi@bluewin.ch> - 0:0.98.26-0.fdr.1.b
- New Version 0.98.26b

* Sat Jul 17 2004 Gerard Milmeister <gemi@bluewin.ch> - 0:0.98.24-0.fdr.1
- New Version 0.98.24

* Fri Jun  4 2004 Gerard Milmeister <gemi@bluewin.ch> - 0:0.98.23a-0.fdr.1
- New Version 0.98.23a

* Thu May  6 2004 Gerard Milmeister <gemi@bluewin.ch> - 0:0.98.22c-0.fdr.1
- New Version 0.98.22c

* Sun Apr 11 2004 Gerard Milmeister <gemi@bluewin.ch> - 0:0.98.20c-0.fdr.1
- First Fedora release