Blob Blame History Raw
%define         plugin_3ds_ver          0.8.1
%define         plugin_imtex_ver        1.4.0
%define         mm3d_plugins            ad3dsfilter imtex
%define         major_version           1.3

Name:           mm3d
Version:        1.3.8a
Release:        2%{?dist}
Summary:        3D model editor

Group:          Applications/Multimedia
License:        GPLv2+
URL:            http://www.misfitcode.com/misfitmodel3d
Source0:        http://downloads.sourceforge.net/misfitmodel3d/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Source10:       http://www.misfitcode.com/misfitmodel3d/download/plugins/ad3dsfilter-%{plugin_3ds_ver}.tar.gz
Source11:       http://www.misfitcode.com/misfitmodel3d/download/plugins/imtex-%{plugin_imtex_ver}.tar.gz
Patch0:         mm3d-1.3.6-sighandler.patch
Patch10:        mm3d-ad3dsfilter-make.patch
Patch11:        mm3d-imtex-make.patch
Patch12:        mm3d-imtex-gcc43.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  dos2unix libtool qt4-devel libXmu-devel lua-devel perl-HTML-Template
BuildRequires:  lib3ds-devel imlib2-devel
BuildRequires:  desktop-file-utils


%description
Misfit Model 3D is an OpenGL-based 3D model editor that works with
triangle-based models. It supports multi-level undo, skeletal animations,
simple texturing, scripting, command-line batch processing, and a plugin
system for adding new model and image filters. Complete online help
is included. It is designed to be easy to use and easy to extend
with plugins and scripts.


%prep
%setup -q -a 10 -a 11

%patch0 -b .sigh

%patch10 -b .ad3ds
%patch11 -b .imtex
%patch12 -b .gcc43

autoreconf

for i in AUTHORS COPYING ChangeLog INSTALL README TODO doc/html/TODO
do
    dos2unix -q --keepdate $i
done

%build
export CPPFLAGS="-DDOC_ROOT=\\\"%{_docdir}/%{name}-%{version}/html\\\" -DSHARED_PLUGINS=\\\"%{_libdir}/%{name}\\\""
%configure --with-lua-dir=%{_usr} --with-lualib-dir=%{_usr} --with-lualib-lib=lua --enable-debug
make %{?_smp_mflags} "CFLAGS=$RPM_OPT_FLAGS" "CXXFLAGS=$RPM_OPT_FLAGS"

cd plugins
for d in %{mm3d_plugins}
do
    pushd $d
    make "CFLAGS=$RPM_OPT_FLAGS" "CXXFLAGS=$RPM_OPT_FLAGS"
    popd
done


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_datadir}/doc/%{name}-%{version}/html

mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/%{major_version}
for d in %{mm3d_plugins}
do
    install -p -m 0755 plugins/$d/$d.so $RPM_BUILD_ROOT%{_libdir}/%{name}/%{major_version}
done
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/plugins

desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE1}

# docs
#rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/html
#rm -f doc/html/Makefile*
cp -p AUTHORS COPYING ChangeLog INSTALL README TODO $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}

# remove unnecessary qt4 translation
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/i18n/qt_*.qm


%clean
rm -rf $RPM_BUILD_ROOT


%post
update-desktop-database &> /dev/null || :

%postun
update-desktop-database &> /dev/null || :


%files
%defattr(-,root,root,-)
%doc %{_datadir}/doc/%{name}-%{version}
#%doc AUTHORS COPYING ChangeLog INSTALL README TODO
%{_bindir}/%{name}
%{_libdir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/*
%{_datadir}/mimelnk/application/*
%{_datadir}/%{name}
%{_mandir}/man1/*


%changelog
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.8a-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jan  6 2010 Dan Horák <dan[at]danny.cz> 1.3.8a-1
- rebuilt with updated source archive (no change)

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Mar 10 2009 Dan Horák <dan[at]danny.cz> 1.3.8-1
- update to 1.3.8

* Tue Feb 24 2009 Dan Horák <dan[at]danny.cz> 1.3.7a-1
- update to 1.3.7a
- better fix for the conflict between list type and parameter

* Thu Feb 19 2009 Dan Horák <dan[at]danny.cz> 1.3.7-3
- fixes for gcc 4.4

* Fri Jun  4 2008 Dan Horák <dan[at]danny.cz> 1.3.7-2
- fix plugin installation directory
- change how the docs are installed
- fix DocPath in the desktop file
- add scriptlets for updating the desktop database

* Tue Jun  1 2008 Dan Horák <dan[at]danny.cz> 1.3.7-1
- initial Fedora version