Summary: Pngcrush is an optimizer for PNG files.
Summary(ja): pngcrush - PNG ファイルの最適化ツール
Name: pngcrush
Version: 1.7.76
Release: 1%{?_dist_release}
URL: http://pmt.sourceforge.net/pngcrush/
Source:  http://prdownloads.sourceforge.net/pmt/%{name}-%{version}.tar.xz
#Source1: http://prdownloads.sourceforge.net/pmt/%{name}-%{version}-CHANGELOG.txt
#Source2: http://prdownloads.sourceforge.net/pmt/%{name}-%{version}-HELP.txt
License: distributable
Group: Applications/Graphics
Packager: Yasumichi Akahoshi <yasumichi@users.sourceforge.jp>
Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libpng-devel pkgconfig zlib-devel

%description
Pngcrush is an optimizer for PNG (Portable Network Graphics) files.
Its main purpose is to reduce the size of the PNG IDAT datastream by trying
various compression levels an PNG filter methods. It also can be used to
remove unwanted ancillary chunks, or to add certain chunks including gAMA,
tRNS, iCCP, and textual chunks.

%description -l ja
Pngcrush は、PNG (Portable Network Graphic) ファイルの最適化ツールです。
その主な目的は、様々な圧縮レベルや、PNG フィルタ手法を試みて、PNG IDAT
データストリームのサイズを縮小することです。
また、見られていない補助的なチャンクを削除したり、ガンマ、tRNS、iCCP、
テキストなど、ある種のチャンクを追加することが可能です。

%prep
%setup -q -n %{name}-%{version}

#cp -p %{SOURCE1} CHANGELOG
#cp -p %{SOURCE2} HELP

%build
#make CFLAGS="$RPM_OPT_FLAGS"
#%ifnarch %{ix86}
#make -f Makefile.ext-zlib ZINC=%{_includedir} ZLIB=%{_libdir} \
#	CFLAGS=" -I. -O3 -fomit-frame-pointer -Wall"
#%else
#make -f Makefile.ext-zlib ZINC=%{_includedir} ZLIB=%{_libdir}
#%endif
rm -f z*.h crc32.h deflate.h inf*.h trees.h png*.h # force using system headers
pngflags=$(pkg-config --cflags --libs libpng)
gcc %{optflags} $pngflags -lz -o pngcrush pngcrush.c

%install
[ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}

#mkdir -p $RPM_BUILD_ROOT%{_bindir}
#install -m755 pngcrush-zlib $RPM_BUILD_ROOT%{_bindir}/pngcrush
%{__install} -D -m0755 pngcrush %{buildroot}%{_bindir}/pngcrush

%clean
[ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}

%files
%defattr(-,root,root)
#%doc CHANGELOG HELP
%doc ChangeLog.html
%{_bindir}/pngcrush

%changelog
* Tue Jul 01 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.76-1
- new upstream release

* Wed Jul 25 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.33-1
- new upstream release

* Mon Jul 09 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.31-1
- new upstream release

* Sun Jun 17 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.30-1
- new upstream release

* Mon May 28 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.28-1
- new upstream release

* Wed Apr 25 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.27-1
- new upstream release

* Tue Mar 06 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.25-1
- new upstream release

* Fri Jan 20 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.24-1
- new upstream release
- changed source archive type bzip2 to xz

* Sat Dec 18 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.7.13-1
- new upstream release
- added BuildRequires: libpng-devel pkgconfig
- updated spec

* Thu Oct 09 2008 Shu KONNO <owa@bg.wakwak.com> 1.6.4-1vl5
- applied new versioning policy, spec in utf-8

* Fri Oct 13 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.6.4-0vl2
- define PNG_USE_PNGGCCRD only on ix86 archs

* Fri Sep 29 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.6.4-0vl1
- new upstream release
- changed Group to Applications/Graphics

* Fri Dec 31 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.5.10-0vl6
- rebuild with libpng-1.2.8

* Sun Oct 17 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.5.10-0vl5
- rebuild with libpng-1.2.7

* Mon Aug 30 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.5.10-0vl4
- rebuild with libpng-1.2.6rc3
  - add handle-chunk-macros.patch (HANDLE_CHUNK_* -> PNG_HANDLE_CHUNK_*)

* Mon Aug 30 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.5.10-0vl3
- use system's shared libraries (patch0)
  - add (Build)Requires: libpng(-devel), zlib(-devel)
- modify description (ja)

* Mon Jul 12 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.5.10-0vl2
- add URL
- remove Requires: libpng >= 1.2.4
- use distributable as License
- use more macros
- extract source quietly

* Thu Jun 03 2004 Yasumichi Akahoshi <yasumichi@users.sourceforge.jp>
- pngcrush.spec was written for pngcrush-1.5.10.
