Blob Blame Raw
%global wingsdir $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{name}-%{version}
%global git_tag 9a2473e

Name:           wings
Version:        1.4.1
Release:        2.git%{git_tag}%{?dist}
Summary:        3D Subdivision Modeler

Group:          Applications/Multimedia
License:        MIT
URL:            http://www.wings3d.com
#Source0:	http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
# wget --content-disposition https://github.com/dgud/wings/tarball/9a2473e
Source0:	dgud-wings-9a2473e.tar.gz
Source1:	http://prdownloads.sourceforge.net/wings/wings3d_manual1.6.1.pdf
Source2:	wings.sh
Source3:	wings.png
Source4:	wings.desktop
Patch1:		wings-0001-No-Erlang-OpenCL-support-for-now.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	erlang
BuildRequires:	erlang-esdl
BuildRequires:	libGL-devel
BuildRequires:	libGLU-devel
BuildRequires:  desktop-file-utils
BuildRequires:	libjpeg-devel

Provides:       wings-povray = %{version}-%{release}
Obsoletes:      wings-povray

#Error:erlang(lists:delete_nth/2)
#Error:erlang(tools:diff/1)
Requires:	erlang-dialyzer
Requires:	erlang-erts
Requires:	erlang-esdl
Requires:	erlang-kernel
Requires:	erlang-stdlib
Requires:	erlang-tools
Requires:	erlang-wx


%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


%description docs
Documentation for Wings 3D.


%prep
#%setup -q
%setup -q -n dgud-%{name}-%{git_tag}
sed -i 's|-include("sdl_keyboard.hrl").|-include_lib("esdl/include/sdl_keyboard.hrl").|' src/wings_body.erl src/wings_edge_cmd.erl plugins_src/commands/wpc_constraints.erl 
cp %{SOURCE1} .
cp %{SOURCE2} .
cp %{SOURCE4} .
sed -i -e "s,%LIBDIR%,%{_libdir},g" wings.sh
# No erlang-cl for now - see https://github.com/tonyrog/cl
%patch1 -p1
# Add version info
echo %{version}.git%{git_tag} > ./version


%build
# %%{?_smp_mflags} breaks the build
make


%install
rm -rf $RPM_BUILD_ROOT

# Install the wings binaries
mkdir -p %{wingsdir}/plugins/default
cp -rf ebin %{wingsdir}
cp -rf fonts %{wingsdir}
cp -rf textures %{wingsdir}
cp -rf shaders %{wingsdir}
cp -rf plugins/* %{wingsdir}/plugins/default
cp -rf fonts %{wingsdir}

find $RPM_BUILD_ROOT -name 'README' | xargs rm -f
find $RPM_BUILD_ROOT -name '*.txt' | xargs chmod 0644
find $RPM_BUILD_ROOT -name '*.auv' | xargs chmod 0644
find $RPM_BUILD_ROOT -name '*.fs' | xargs chmod 0644
find $RPM_BUILD_ROOT -name '*.vs' | xargs chmod 0644

# Install main startup script
install -D -p -m 0755 wings.sh $RPM_BUILD_ROOT%{_bindir}/wings

# Install icon
install -D -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/pixmaps/wings.png

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


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{_bindir}/wings
%{_libdir}/erlang/lib/%{name}-%{version}
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%doc AUTHORS NOTES-1.0 NOTES-1.1 NOTES-1.2 NOTES-1.3 NOTES-1.4 NOTES-1.4.1 OLD-NOTES README README.jp license.terms


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


%changelog
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-2.git9a2473e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu May 10 2012 Peter Lemenkov <lemenkov@gmail.com> - 1.4.1-1.git9a2473e
- Ver. 1.4.1.git9a2473e (post-release shapshot for 1.4.1)

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Dec  9 2010 Peter Lemenkov <lemenkov@gmail.com> - 1.2.0-3
- Explicitly use erl installed into /usr/bin

* Tue Nov 16 2010 Peter Lemenkov <lemenkov@gmail.com> - 1.2.0-2
- Drop erlang-wx dependency
- Fixed startup failure (rhbz #653720)

* Mon Jul 12 2010 Peter Lemenkov <lemenkov@gmail.com> - 1.2.0-1
- Ver. 1.2.0
- Docs subpackage no longer requires main package

* Tue Aug 11 2009 Gerard Milmeister <gemi@bluewin.ch> - 1.0.1-1
- new release 1.0.1

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.99.05-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.99.05-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Oct 30 2008 Gerard Milmeister <gemi@bluewin.ch> - 0.99.05-2
- new release 0.99.05

* Sat Sep  6 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.99.02-2
- fix license tag

* 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