%define pkg_version 1.0.2
%define pkg_release 2%{?_dist_release}

Summary:	Vector animation rendere
Name:		synfig
Version:	%{pkg_version}
Release:	%{pkg_release}

Source0:	%{name}-%{version}.tar.gz

# imported from debian sid
Patch0:		c++11.patch
Patch1:		no-mod_ffmpeg.patch

License:	GPLv2
Group:		Applications/Graphics
URL:		http://www.synfig.org/cms/

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

BuildRequires:	ETL-devel >= 0.04.17
BuildRequires:	cairo-devel
BuildRequires:	pango-devel
BuildRequires:	fontconfig-devel
BuildRequires:	freetype2-devel
BuildRequires:	ImageMagick-c++-devel
BuildRequires:	libxml++-devel
BuildRequires:	libjpeg-turbo-devel
BuildRequires:	libmng-devel
BuildRequires:	libpng-devel
BuildRequires:	libtool-ltdl-devel
BuildRequires:	libtool
BuildRequires:	libboost-devel
BuildRequires:	libboost-program-options
BuildRequires:	libboost-system
BuildRequires:	libboost-filesystem
BuildRequires:	libboost-chrono
BuildRequires:	libsigc++-devel
BuildRequires:	libtiff-devel
BuildRequires:	OpenEXR-devel
BuildRequires:	autoconf automake gettext-devel
BuildRequires:	mlt-devel fftw3-devel
# FIXME: Lack of this causes synfig to segfault
Requires:	urw-fonts

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi


%description
synfig is a vector based 2D animation package. It is designed to be
capable of producing feature-film quality animation. It eliminates the
need for tweening, preventing the need to hand-draw each frame. synfig
features spatial and temporal resolution independence (sharp and smooth
at any resolution or framerate), high dynamic range images, and a
flexible plugin system.

This package contains the renderer used to convert synfig .sif files to
raster images, videos and other formats. Layer types include geometric,
gradient, filter, distortion, transformation, fractal and others. Output
targets include JPEG, PNG, GIF, BMP, PPM, DV, OpenEXR, ffmpeg (MPEG1),
libavcodec (AVI), imagemagick (MIFF), yuv420p, MNG and others.


%package		devel
Summary:        Development files for synfig
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description	devel
This package contains the libraries and header files that are needed
for writing applications that are using synfig.


%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
export CXXFLAGS="%{optflags} -std=c++11"
%configure \
	--disable-static

%{__make} %{?_smp_mflags}

%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__make} install DESTDIR=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

%find_lang %{name}

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p/sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%{_sysconfdir}/synfig_modules.cfg
%{_bindir}/synfig
%{_libdir}/libsynfig.so.*
%{_libdir}/synfig/modules/*.so

%files devel
%defattr(-,root,root,-)
%{_bindir}/synfig-config
%{_includedir}/synfig-1.0
%{_libdir}/libsynfig.so
%{_libdir}/pkgconfig/synfig.pc


%changelog
* Mon Jan 08 2018 Toshiaki Ara <ara_t@384.jp> 1.0.2-2
- rebuild with libboost-1.66.0

* Sun Jul 10 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.2-1
- new upstream release.

* Sun Aug 02 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.64.2-2
- rebuild with ImageMagick-6.9.1.4

* Mon Dec 01 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.64.2-1
- new upstream release

* Wed Jul 02 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.64.1-3
- rebuild with ImageMagick-6.8.9.5
- add Patch0 (synfig-0.64.1-mod_png.patch)

* Tue Dec 31 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.64.1-2
- rebuild with icu-52.1

* Sun Dec 08 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.64.1-1
- new upstream release

* Wed Aug 14 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.64.0-1
- new upstream release
- add BuildRequires: pango-devel, libboost-devel, libboost-program-options

* Mon Apr 30 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.63.05-1
- new upstream release

* Sat Mar 03 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.63.04-1
- new upstream release

* Sun Dec 25 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.63.03-1
- new upstream release

* Sat Oct 08 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.63.02-1
- initial build for Vine Linux

