netpbm10 stable port information

Package: netpbm10
Version: 10.35.81
Revision: 1
BuildDepends: libjpeg8, libpng3, libtiff, fink (>= 0.24.12-1)
Depends: %N-shlibs (= %v-%r)
Replaces: netpbm
Conflicts: netpbm
BuildDependsOnly: True
Source: mirror:sourceforge:netpbm/netpbm-%v.tgz
Source-MD5: d02c5681d36ab4d58747363d7e0b3e4e
NoSetMAKEFLAGS: true
NoSetLDFLAGS: true
SetLIBRARY_PATH: %p/lib
PatchFile: %n.patch
PatchFile-MD5: 7f1bbffe63a1545174ce4bf4d7c7e13a
PatchScript: <<
sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p1
cat Makefile.config.in Makefile.config.fink >Makefile.config
<<
CompileScript: make -j1
InstallScript: <<
make package pkgdir=`pwd`/package SYMLINK='ln -s'
install -d -m 755 %i/share
printf "package\n%i\n\n\n\n\n\n\n" | ./installnetpbm
rm -rf %i/share/man/web
<<
SplitOff: <<
Package: %N-shlibs
Files: lib/libnetpbm.*.dylib
Shlibs: %p/lib/libnetpbm.10.dylib 11.0.0 %n (>= 10.12-1)
Conflicts: netpbm (<< 9.25-1)
DocFiles: README doc/*
<<
SplitOff2: <<
Package: netpbm-bin
Depends: %N-shlibs (= %v-%r), libjpeg8-shlibs, libpng3-shlibs, libtiff-shlibs
Files: bin share/man/man1 share/man/man3
DocFiles: README doc/*
<<
DocFiles: README doc/*
Description: Graphics manipulation programs and libraries
DescPort: <<
Change by J-F Mertens: pnmtopng.c extracted from old version of netpbm
since the one in the current version does not work with, e.g., latex2html.

Change undone in Feb. 2007 because the 'old' pnmtopng.c no longer compiles.
Hopefully this does not break latex2html.

Patches for gcc 4.0 compatibility thanks to Matt Sachs.

Security patches thanks to Tomoaki Okayama:
CVE-2005-2471: netpbm-10.25-CAN-2005-2471.patch (from RedHat)
CVE-2005-2978: netpbm-10.26.12-pnmtopng-CAN-2005-2978.patch (from SUSE)
CVE-2005-3662: netpbm-10.26.12-pnmtopng-overflow.patch (from SUSE)
<<
License: OSI-Approved
Homepage: http://netpbm.sourceforge.net
Maintainer: Dave Morrison
DescPackaging: <<
Originally packaged by Masanori Sekino.

Note: we cannot update the dependency from libpng3 to libpng14 or later
until a newer netpbm10 (at least 10.47.04) is declared sufficiently stable
to package for fink
<<

netpbm10 stable port .patch

diff -Naur netpbm-10.35.81/Makefile.config.fink netpbm-10.35.81-patched/Makefile.config.fink
--- netpbm-10.35.81/Makefile.config.fink 1969-12-31 19:00:00.000000000 -0500
+++ netpbm-10.35.81-patched/Makefile.config.fink 2011-07-20 07:25:27.000000000 -0400
@@ -0,0 +1,18 @@
+#
+# Configuration for fink
+#
+
+DEFAULT_TARGET = nonmerge
+NETPBMLIBTYPE = dylib
+NETPBMLIBSUFFIX = dylib
+STATICLIB_TOO = n
+NETPBM_RUNTIME_PATH = @PREFIX@/lib
+CC = cc -no-cpp-precomp
+CFLAGS = -Os -fstrict-aliasing -funroll-all-loops -isystem @PREFIX@/include
+CFLAGS_SHLIB = -fno-common
+LADD = -L@PREFIX@/lib
+LDSHLIB = -dynamiclib -install_name $(NETPBM_RUNTIME_PATH)/libnetpbm.$(MAJ).dylib -compatibility_version $$(($(MAJ)+1)) -current_version $$(($(MAJ)+1)).$(MIN)
+TIFFLIB = libtiff.dylib
+JPEGLIB = libjpeg.dylib
+PNGLIB = libpng.dylib
+ZLIB = libz.dylib
diff -Naur netpbm-10.35.81/buildtools/installnetpbm.pl netpbm-10.35.81-patched/buildtools/installnetpbm.pl
--- netpbm-10.35.81/buildtools/installnetpbm.pl 2007-01-14 21:50:02.000000000 -0500
+++ netpbm-10.35.81-patched/buildtools/installnetpbm.pl 2011-07-20 07:25:27.000000000 -0400
@@ -117,7 +117,7 @@
} elsif ($ENV{OSTYPE} && $ENV{OSTYPE} eq "msdosdjgpp") {
$default = "/dev/env/DJDIR";
} else {
- $default = "/usr/local/netpbm";
+ $default = "@PREFIX@";
}

my $response = prompt("install prefix", $default);
@@ -572,7 +572,7 @@
my $manDir;

while (!$manDir) {
- my $default = "$prefix/man";
+ my $default = "$prefix/share/man";

my $response = prompt("man page directory", $default);

@@ -771,9 +771,9 @@

print("\n");

- removeObsoleteManPage($manDir);
+# removeObsoleteManPage($manDir);

- makeInManwebPath("$manDir/web");
+# makeInManwebPath("$manDir/web");

$$mandirR = $manDir;
}
diff -Naur netpbm-10.35.81/converter/other/pnmtopng.c netpbm-10.35.81-patched/converter/other/pnmtopng.c
--- netpbm-10.35.81/converter/other/pnmtopng.c 2010-12-10 13:19:40.000000000 -0500
+++ netpbm-10.35.81-patched/converter/other/pnmtopng.c 2011-07-20 07:25:27.000000000 -0400
@@ -527,7 +527,7 @@
unsigned int * const bestMatchP) {

unsigned int paletteIndex;
- unsigned int bestIndex;
+ unsigned int bestIndex = 0;
unsigned int bestMatch;

assert(paletteSize > 0);
@@ -1427,9 +1427,9 @@
colorhist_vector chv;
unsigned int colors;

- gray * alphas_of_color[MAXPALETTEENTRIES];
+ gray * alphas_of_color[MAXPALETTEENTRIES + 1];
unsigned int alphas_first_index[MAXPALETTEENTRIES];
- unsigned int alphas_of_color_cnt[MAXPALETTEENTRIES];
+ unsigned int alphas_of_color_cnt[MAXPALETTEENTRIES + 1];

getChv(ifP, rasterPos, cols, rows, maxval, format, MAXCOLORS,
&chv, &colors);
@@ -2348,7 +2348,7 @@
/* The color part of the color/alpha palette passed to the PNG
compressor
*/
- unsigned int palette_size;
+ unsigned int palette_size = MAXCOLORS;

gray trans_pnm[MAXCOLORS];
png_byte trans[MAXCOLORS];
diff -Naur netpbm-10.35.81/lib/libpbm3.c netpbm-10.35.81-patched/lib/libpbm3.c
--- netpbm-10.35.81/lib/libpbm3.c 2008-03-28 14:58:06.000000000 -0400
+++ netpbm-10.35.81-patched/lib/libpbm3.c 2011-07-20 07:25:27.000000000 -0400
@@ -117,7 +117,7 @@
) ];
*/

- typedef int v8qi __attribute__ ((mode(V8QI)));
+ typedef int v8qi __attribute__ ((vector_size(8)));
typedef int di __attribute__ ((mode(DI)));

di const zero64 = 0; /* to clear with PXOR */
diff -Naur netpbm-10.35.81/pm_config.in.h netpbm-10.35.81-patched/pm_config.in.h
--- netpbm-10.35.81/pm_config.in.h 2006-10-18 14:29:13.000000000 -0400
+++ netpbm-10.35.81-patched/pm_config.in.h 2011-07-20 07:25:27.000000000 -0400
@@ -68,7 +68,7 @@
#define RGB_DB3 "PBMplus_Dir:RGB.TXT"
#else
#define RGB_DB1 "/usr/lib/X11/rgb.txt"
-#define RGB_DB2 "/usr/share/X11/rgb.txt"
+#define RGB_DB2 "/usr/X11/share/X11/rgb.txt"
#define RGB_DB3 "/usr/X11R6/lib/X11/rgb.txt"
#endif

netpbm10 _unstable_ port .patch