libglpng1 stable port information

Package: libglpng1
Version: 1.45
Revision: 2
Description: PNG loader library for OpenGL
License: BSD
Maintainer: Hanspeter Niederstrasser
Depends: <<
%N-shlibs (= %v-%r)
<<
BuildDepends: <<
fink (>= 0.24.12),
libpng14
<<
BuildDependsOnly: true
Source: mirror:debian:pool/main/libg/libglpng/libglpng_%v.orig.tar.gz
Source-MD5: 9e0daad8e39fbf3179c73c0d3f74f104
SourceDirectory: libglpng-%v.orig
PatchFile: %n.patch
PatchFile-MD5: 516606e18ae4d88a4358eafc55d571f4
PatchScript: <<
### src/glpng.c has a bunch of windows line endings.
/usr/bin/perl -pi -e "s|\r||g" src/glpng.c
### add Makefile and proper location of png.h
%{default_script}
<<
CompileScript: cd src ; CPPFLAGS="-I%p/include" LDFLAGS="-L%p/lib" PREFIX="%p" /usr/bin/make ; /usr/bin/head -n 21 glpng.c > ../LICENSE
InstallScript: cd src ; /usr/bin/make -w install DESTDIR="%d" PREFIX="%p"
DocFiles: glpng.htm Example/Stunt.png Example/Test.c LICENSE
SplitOff: <<
Package: %N-shlibs
Depends: <<
libpng14-shlibs
<<
Files: lib/libglpng.1.dylib
Shlibs: <<
%p/lib/libglpng.1.dylib 0.0.0 %n (>= 1.45-1)
<<
Description: Shared libraries for libglpng1 package
DocFiles: glpng.htm LICENSE
<<
Homepage: http://www.wyatt100.freeserve.co.uk/download.htm
DescDetail: <<
Library for OpenGL to load PNG graphics files as an OpenGL
texture as easily as possible. It also has a number of
options for generating the alpha channel and mipmaps.
<<
DescPort: <<
Patchfile copied from Macports. Had to comment out the necessary
flags because otherwise they wouldn't be accepted from the command
line.

Modified code to use OpenGL framework rather than X11 GL.
<<

libglpng1 stable port .patch

diff -ruN libglpng-1.45.orig/src/Makefile libglpng-1.45/src/Makefile
--- libglpng-1.45.orig/src/Makefile 1969-12-31 19:00:00.000000000 -0500
+++ libglpng-1.45/src/Makefile 2010-06-19 11:40:09.000000000 -0400
@@ -0,0 +1,30 @@
+CC = gcc
+#CFLAGS =
+#CPPFLAGS =
+#DESTDIR =
+INSTALL = install
+INSTALL_DATA = $(INSTALL) -m 644
+LD = $(CC)
+#LDFLAGS =
+LN = ln
+MKDIR = mkdir -p
+#PREFIX =
+
+all: libglpng.a libglpng.1.dylib
+
+libglpng.o:
+ $(CC) $(CFLAGS) -I../include $(CPPFLAGS) -c -o libglpng.o glpng.c
+
+libglpng.a: libglpng.o
+ $(AR) cqs libglpng.a libglpng.o
+
+libglpng.1.dylib: libglpng.o
+ $(LD) $(LDFLAGS) -dynamiclib -install_name $(PREFIX)/lib/libglpng.1.dylib -framework OpenGL -lpng -lz -lm -o libglpng.1.dylib libglpng.o
+
+install: all
+ $(MKDIR) $(DESTDIR)$(PREFIX)/lib
+ $(INSTALL_DATA) libglpng.1.dylib $(DESTDIR)$(PREFIX)/lib
+ $(INSTALL_DATA) libglpng.a $(DESTDIR)$(PREFIX)/lib
+ $(LN) -sf libglpng.1.dylib $(DESTDIR)$(PREFIX)/lib/libglpng.dylib
+ $(MKDIR) $(DESTDIR)$(PREFIX)/include/GL/
+ $(INSTALL_DATA) ../include/GL/glpng.h $(DESTDIR)$(PREFIX)/include/GL/
diff -ruN libglpng-1.45.orig/src/glpng.c libglpng-1.45/src/glpng.c
--- libglpng-1.45.orig/src/glpng.c 2000-07-10 15:27:10.000000000 -0400
+++ libglpng-1.45/src/glpng.c 2010-06-19 11:58:34.000000000 -0400
@@ -26,10 +26,10 @@
#endif

#include
-#include
+#include
#include
#include
-#include "png/png.h"
+#include

/* Used to decide if GL/gl.h supports the paletted extension */
#ifdef GL_COLOR_INDEX1_EXT

libglpng1 _unstable_ port .patch