Blob Blame Raw
Name:           wings
Version:        0.98.32b
Release:        10%{?dist}
Summary:        3D Subdivision Modeler

Group:          Applications/Multimedia
License:        Distributable
URL:            http://www.wings3d.com
Source0:	http://prdownloads.sourceforge.net/wings/wings-0.98.32b.tar.bz2
Source1:	http://prdownloads.sourceforge.net/wings/wings3d_manual1.6.1.pdf
Source2:	http://www.midcoast.com.au/~rgcoy/downloads/wingspov-0.98.28_v1.tgz
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

%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). This package also includes the Povray exporter
plug-in.


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

%description docs
Documentation for Wings 3D.


%package povray
Group:		Applications/Multimedia
Summary:	Povray import/export plug-in for Wings 3D
Requires:	%{name} = %{version}-%{release}

%description povray
Povray import/export plug-in for Wings 3D.
Install this only if povray is actually installed.


%prep
%setup -q
cp %{SOURCE1} .
tar zxf %{SOURCE2}

%define erlangdir %{_libdir}/erlang-R10B

%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 X-Fedora \
    --add-category Application \
    --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/*
%exclude %{_libdir}/wings/lib/wings-%{version}/plugins/import_export/kayos_utils.beam
%exclude %{_libdir}/wings/lib/wings-%{version}/plugins/import_export/pov_exp.beam
%exclude %{_libdir}/wings/lib/wings-%{version}/plugins/import_export/pov_ui.beam
%exclude %{_libdir}/wings/lib/wings-%{version}/plugins/import_export/wpc_pov.beam
%doc README license.terms AUTHORS


%files povray
%defattr(-,root,root,-)
%{_libdir}/wings/lib/wings-%{version}/plugins/import_export/kayos_utils.beam
%{_libdir}/wings/lib/wings-%{version}/plugins/import_export/pov_exp.beam
%{_libdir}/wings/lib/wings-%{version}/plugins/import_export/pov_ui.beam
%{_libdir}/wings/lib/wings-%{version}/plugins/import_export/wpc_pov.beam


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


%changelog
* 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