Blob Blame History Raw
#just in case this will be a must in future.
%global _hardened_build 1

Name:		pngquant
Version:	1.8.3
Release:	6%{?dist}
Summary:	PNG quantization tool for reducing image file size
Group:		Applications/Multimedia
License:	BSD with advertising
URL:		http://%{name}.org
Source0:	http://%{name}.org/%{name}-%{version}-src.tar.bz2

# this will be in the next version
Patch0:		pngquant_respect_system_flags.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.


%prep
%setup -q
%patch0


%build
# since there is no autotools/configure-script in sources
echo '#!/bin/sh' > configure
chmod +x configure

#have the compiler-flags exported properly
%configure

make %{?_smp_mflags}


%install
# have the compiler-flags exported properly, again
# otherwise make_install will trigger rebuild without
# proper compiler-flags
%configure

%if 0%{?el5}
  rm -rf "%{buildroot}"
  make install DESTDIR="%{buildroot}" PREFIX=%{_prefix}
%else
  %make_install PREFIX=%{_prefix}
%endif

install	-Dpm0644 %{name}.1 \
	%{buildroot}/%{_mandir}/man1/%{name}.1


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


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


%changelog
* 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.