Name:           libAfterImage
Version:        1.20
Release:        4%{?_dist_release}
Summary:        A generic image manipulation library
Summary(ja):    一般的な画像操作ライブラリ

Group:          System Environment/Libraries
License:        LGPLv2+
URL:            http://www.afterstep.org/afterimage/index.php
Source0:        ftp://ftp.afterstep.org/stable/%{name}/%{name}-%{version}.tar.bz2
Source1:        libAfterImage-COPYING
Patch0:         libAfterImage-Makefile-ldconfig.patch
Patch1:         libAfterImage-afterimage-config.patch
Patch2:         libAfterImage-multiarch.patch
Patch3:         libafterimage-libpng15.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-root

BuildRequires:  freetype2-devel
BuildRequires:  zlib-devel
BuildRequires:  libtiff-devel
BuildRequires:  libpng-devel
BuildRequires:  giflib-devel
BuildRequires:  libjpeg-turbo-devel
BuildRequires:  libX11-devel
BuildRequires:  libXext-devel
BuildRequires:  libICE-devel
BuildRequires:  libSM-devel
BuildRequires:  librsvg2-devel
BuildRequires:  gawk

%description
libAfterImage is a generic image manipulation library. It was initially
implemented to address AfterStep Window Manager's needs for image handling,
but it evolved into extremely powerful and flexible software, suitable for
virtually any project that has needs for loading, manipulating, displaying
images, as well as writing images in files. Most of the popular image formats
are supported using standard libraries, with XCF, XPM, PPM/PNM, BMP, ICO,
TGA and GIF being supported internally.

PNG, JPEG and TIFF formats are supported via standard libraries.

Powerful text rendering capabilities included, providing support for
TrueType fonts using FreeType library, and antialiasing of standard fonts
from X window system.

%package devel
Summary:  Files needed for software development with %{name}
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: freetype2-devel
Requires: zlib-devel
Requires: libtiff-devel
Requires: libjpeg-turbo-devel
Requires: libpng-devel
Requires: libX11-devel
Requires: libXext-devel
Requires: libICE-devel
Requires: libSM-devel
Requires:  librsvg2-devel

%description devel
The %{name}-devel package contains the files needed for development with
%{name}

%prep
%setup -q
%patch0
%patch1
%patch2 -b multiarch
%patch3

%build
%configure --enable-i18n --enable-sharedlibs \
--with-xpm --without-builtin-ungif --disable-staticlibs --enable-glx \
--without-afterbase --disable-mmx-optimization \
--x-includes=%{_includedir} --x-libraries=%{_libdir}

make CCFLAGS="-DNO_DEBUG_OUTPUT -fPIC $RPM_OPT_FLAGS" %{?_smp_mflags} \
LIBAFTERIMAGE_PATH=../


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}
make install DESTDIR=$RPM_BUILD_ROOT LIBAFTERIMAGE_PATH=../

cp %{SOURCE1} %{_builddir}/%{name}-%{version}/COPYING

touch -r ChangeLog $RPM_BUILD_ROOT%{_bindir}/afterimage-{config,libs}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README ChangeLog COPYING
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%{_bindir}/*
%{_includedir}/libAfterImage/
%{_libdir}/*.so
#%{_datadir}/libAfterImage/
#%{_mandir}/man?/*

%changelog
* Fri Jul 18 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.20-4
- rebuilt with libpng-1.6.12
- added Patch3 to fix build error from fedora rawhide 

* Sat Mar 08 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.20-3
- rebuilt with new toolchain

* Mon May 09 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.20-2
- add BuildRequires: librsvg2-devel
- add Requires: librsvg2-devel (-devel package)

* Wed Feb 2 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.20-1
- new upstream release
- dropt Patch3
- fixed %%files in -devel package

* Wed Sep 29 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.18-3
- rebuilt with rpm-4.8.1 for pkg-config
- changed BuildRequires: libjpeg-devel to libjpeg-turbo-devel

* Sun Jun 13 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.18-2
- fixed release number

* Sat Jun 12 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.18-1
- initial build for VineLinux

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

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

* Thu Nov 27 2008 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
- 1.18-2
- add glx context patch (suggested by Frank Schmitt)

* Sat Oct 04 2008 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
- 1.18-1
- version upgrade

* Mon Feb 11 2008 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de> - 1.15-4
- Rebuilt for gcc43

* Sat Jan 05 2008 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
- 1.15-3
- fix #341871 multiarch

* Wed Aug 22 2007 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
- 1.15-2
- upgrade BR

* Wed Aug 22 2007 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
- 1.15-1
- version upgrade
- new license tag

* Mon Sep 11 2006 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-8
- FE6 rebuild

* Wed Feb 15 2006 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-7
- Rebuild for Fedora Extras 5

* Thu Dec 15 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-6
- fix typo

* Thu Dec 15 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-5
- modular X

* Sat Aug 20 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-4
- add -fPIC

* Sat Aug 20 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-3
- build with debug information
- add dist tag

* Thu Aug 18 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-2
- fix issues mentioned in #166046 #1

* Tue Aug 16 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
1.07-1
- Initial Release
-