the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: pngnq
Version: 0.5
Revision: 2
Source: mirror:sourceforge:%n/%n-%v-src.tar.gz
Source-MD5: 14aff764008dfd55e816d3fe08636cb9
SourceDirectory: %v
License: Restrictive
Homepage: http://pngnq.sourceforge.net
Maintainer: Pierre-Henri Lavigne
Description: PNG Quantizer Tool
DescDetail:<<
Pngnq is a tool for quantizing PNG images in RGBA format.
Pngnq is an adaptation by Stuart Coyle of Greg Roelf's
pnqquant using Anthony Dekker's neuquant algorithm.
The neuquant algorithm uses a neural network to optimise
the color map selection. This is fast and quite accurate,
giving good results on many types of images.
<<
DocFiles: INSTALL LICENSE README README.pngcomp
BuildDepends: libpng14
Depends: libpng14-shlibs
PatchScript:<<
#Remove the default /usr/local
perl -pi -e 's,\/usr,\%p,g' Makefile
#Adding the missng zlib flag
perl -pi -e 's,\$\{shell libpng-config --ldflags\},\$\{shell libpng-config --ldflags\} -lz,g', Makefile
#Removing the gnu install param t to avoid depending coreutils
perl -pi -e 's,install -t \$\{BINDIR\} pngnq pngcomp,install -d \$\{DESTDIR\}\$\{BINDIR\} \&\& install pngnq pngcomp \$\{DESTDIR\}\$\{BINDIR\},g' Makefile
perl -pi -e 's,install -t \$\{MANDIR\} pngnq.1,install -d \$\{DESTDIR\}\$\{MANDIR\} \&\& install pngnq.1 \$\{DESTDIR\}\$\{MANDIR\},g' Makefile
perl -pi -e 's,install -d \$\{DOCDIR\},,g' Makefile
perl -pi -e 's,install -t \$\{DOCDIR\} README LICENSE README.pngcomp,install -d \$\{DESTDIR\}\$\{DOCDIR\} && install README LICENSE README.pngcomp \$\{DESTDIR\}\$\{DOCDIR\},g' Makefile
### On 10.6, there's no getopt.h, and the ifdef to #include the included getopt.h is behind a WIN32 conditional
perl -pi -e 's|WIN32|__APPLE__|g' pngcomp.c
<<
SetCFLAGS: -D_POSIX_C_SOURCE
CompileScript:<<
#!/bin/bash -ev
CFLAGS=-D_POSIX_C_SOURCE make
<<
InstallScript:<<
#!/bin/bash -ev
make install DESTDIR=%d
<<