Blob Blame History Raw
%global libname libimagequant

Name:		pngquant
Version:	2.0.0
Release:	1%{?dist}
Summary:	PNG quantization tool for reducing image file size
%{?el5:Group:	Applications/Multimedia}

License:	BSD with advertising
URL:		http://%{name}.org
Source0:	%{url}/%{name}-%{version}-src.tar.bz2

Patch0:		%{name}-2.0.0_fix-Makefile.patch


%{?el5:BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)}
BuildRequires:	libpng-devel


%description
%{name} converts 24/32-bit RGBA PNG images to 8-bit palette with alpha channel
preserved.  Such images are compatible with all modern web browsers and a
compatibility setting is available to help transparency degrade well in
Internet Explorer 6.  Quantized files are often 40-70 percent smaller than
their 24/32-bit version. %{name} uses the median cut algorithm.


%package -n %{libname}
Summary:	Small, portable C lib for HQ conversion of RGBA to 8-bit indexed-color
%{?el5:Group:	System Environment/Libraries}

%description -n %{libname}
%{libname} converts 24/32-bit RGBA PNG images to 8-bit palette with alpha
channel preserved.  Such images are compatible with all modern web browsers and
a compatibility setting is available to help transparency degrade well in
Internet Explorer 6.  Quantized files are often 40-70 percent smaller than
their 24/32-bit version. %{libname} uses the median cut algorithm.


%package -n %{libname}-devel
Summary:	Development files for %{libname}
%{?el5:Group:	Development/Libraries}

Requires:	%{libname} = %{version}-%{release}

%description -n %{libname}-devel
This package contains files for development with %{libname}.
There is also some brief API-documentation.


%prep
%setup -q
%patch0 -p1


%build
# export compiler-flags properly
%configure ||:

make %{?_smp_mflags} PREFIX=%{_prefix}


%install
%{?el5:rm -rf %{buildroot}}

# make install will rebuild otherwise
%configure ||:

make install DESTDIR=%{buildroot} PREFIX=%{_prefix}

mkdir -p %{buildroot}%{_includedir}/imagequant \
	%{buildroot}%{_libdir} \
	%{buildroot}%{_mandir}/man1

# install libimagequant
install -pm 0755 lib/%{libname}.so.0 \
	%{buildroot}%{_libdir}
ln -fs %{_libdir}/%{libname}.so.0 \
	%{buildroot}%{_libdir}/%{libname}.so
install -pm 0644 lib/*.h \
	%{buildroot}%{_includedir}/imagequant

# install man-page for %%{name}
install	-pm 0644 %{name}.1 \
	%{buildroot}/%{_mandir}/man1/%{name}.1


%clean
%{?el5:rm -rf %{buildroot}}


%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig


%files
%doc README.md CHANGELOG COPYRIGHT
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%files -n %{libname}
%doc lib/COPYRIGHT
%{_libdir}/%{libname}.so.*

%files -n %{libname}-devel
%doc lib/MANUAL.md
%{_includedir}/imagequant
%{_libdir}/%{libname}.so


%changelog
* Fri Aug 23 2013 Björn Esser <bjoern.esser@gmail.com> - 2.0.0-1
- new upstream version 2.0.0 (#989991)
- fixes FTBFS in F20 / rawhide (#992807)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu May 30 2013 Björn Esser <bjoern.esser@gmail.com> - 1.8.3-6
- improved and added more el5-legacy related stuff

* Fri May 24 2013 Björn Esser <bjoern.esser@gmail.com> - 1.8.3-5
- add el5-build related conditonals

* Wed May 22 2013 Björn Esser <bjoern.esser@gmail.com> - 1.8.3-4
- add Group-Tag to make el5-build happy

* Sun May 19 2013 Björn Esser <bjoern.esser@gmail.com> - 1.8.3-3
- add Patch0: respect system compiler-flags
- touch a fake configure-script during prep
- export system cflags invoking configure-macro

* Fri May 17 2013 Björn Esser <bjoern.esser@gmail.com> - 1.8.3-2
- changed License: BSD --> BSD with advertising
- removed -n{name}-{version} from prep
- removed >= 1.2.46-1 from BuildRequires: libpng-devel

* Tue May 14 2013 Björn Esser <bjoern.esser@gmail.com> - 1.8.3-1
- Initial RPM release.