diff options
-rw-r--r-- | ChangeLog | 156 | ||||
-rw-r--r-- | Makefile.am | 20 | ||||
-rw-r--r-- | Makefile.in | 280 | ||||
-rw-r--r-- | Makefile.old | 2 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | README | 33 | ||||
-rw-r--r-- | aclocal.m4 | 27 | ||||
-rwxr-xr-x | autogen.sh | 120 | ||||
-rw-r--r-- | config.h.in | 14 | ||||
-rwxr-xr-x | configure | 452 | ||||
-rw-r--r-- | configure.in | 174 | ||||
-rwxr-xr-x | install-sh | 1 | ||||
-rwxr-xr-x | missing | 26 | ||||
-rwxr-xr-x | mkinstalldirs | 4 | ||||
-rw-r--r-- | pngmeta.1 | 29 | ||||
-rw-r--r-- | pngmeta.c | 146 | ||||
-rw-r--r-- | pngmeta.spec | 39 | ||||
-rw-r--r-- | pngmeta.spec.in | 51 | ||||
-rwxr-xr-x | test1 | 11 | ||||
-rwxr-xr-x | test2 | 11 | ||||
-rwxr-xr-x | test3 | 11 | ||||
-rw-r--r-- | test3.xpt | 41 | ||||
-rwxr-xr-x | test4 | 11 | ||||
-rw-r--r-- | test4.xpt | 24 |
24 files changed, 1230 insertions, 459 deletions
diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..a0a09751f --- /dev/null +++ b/ChangeLog @@ -0,0 +1,156 @@ +2001-05-16 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * Snapshotted pngmeta_1_11 for 1.11 release + + * Makefile.am: Added man page to dist + + * pngmeta.spec.in: + Tweak for gzipped mans + + * Makefile.am: Added autogen.sh + + * autogen.sh: For building from CVS + + * .cvsignore: Ignore stuff + + * README, pngmeta.spec.in: + Updated for sourceforge + + * NEWS: Updated for 1.11 + + * README: Updated for latest versions + + * configure.in: + Made local copies of libpng/zlib pick up includes too + + * test4, test3, test2, test1: + Updated to work in 'make distcheck' mode + + * pngmeta.1: Added --xrdf option + Updated zlib, png, my URIs + + * configure.in: Added pngmeta.spec.in + + * pngmeta.spec.in: + Now gets version, name from autoconf + + * pngmeta.spec, pngmeta.spec.in: + Renamed pngmeta.spec to pngmeta.spec.in + + * test1, test2, test3, test4: + Test scripts + + * 8859.png: Test images + + * pngmeta.c (png_start_image, png_end_image): + Added, separate from start/end output + Pass through any RDF/XML data stored in field XMLRDFDATA + Update to XHTML + + * ct1n0g04.png, ctzn0g04.png: + Test images + + * Makefile.old: Updated for 1.10 version + +2000-08-15 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * pngmeta.spec: Updated copyright + + * pngmeta.c: + Uses png_get_text where available + Updated copyright + + * Makefile.am: INCLUDES now CFLAGS + + * configure.in: + Loads more changes to make it try to pick installed libpng/libz + wherever possible. + +2000-02-01 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * pngmeta.spec: Tweaked + +2000-01-31 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * Makefile.am: + Added pngmeta.spec to dist + + * pngmeta.spec: New file. + + * pngmeta.1, Makefile.old, configure.in: + Updated to 1.10 version + + * pngmeta.c: + Updated for 1.10 release - added GNU --options, --help, --version + + * NEWS: Updated for 1.10 release + + * README: Updated for --options + + * Makefile.am: + Added Makefile.old to dist + + * Makefile.old: New file. + +1999-04-16 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * pngmeta.1: Added -uri URI docs. + + * NEWS, configure.in: + 1.9 + + * pngmeta.c: + Added -uri option to set uri for SOIF and RDF/XML output. + In RDF output, don't HTML-escape values that start with <RDF + + * Makefile.am: + Added test4 files to dist. + + * Makefile.am: + Added test4 for RDF/XML output + + * pngmeta.1: Added -xrdf option + + * README: 1.8 now with RDF/XML support + + * NEWS: 1.8 + + * pngmeta.c: + Added RDF/XML thanks to Dan Brickley <daniel.brickley@bristol.ac.uk> + + * configure.in: V 1.8 + Look for ../libpng-[0-9] and ../zlib-[0-9]* + +1998-09-11 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * NEWS, README, configure.in, Makefile.am: + New file. + + * pngmeta.c: + Take out version stuff; use VERSION passed in from autoconfiguration. + +1998-03-10 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * pngmeta.1: New file. + + * pngmeta.c: + Upgraded for 1.0* versions of libraries + Output SOIF when progname is PngImage.sum + Output version and lib versions in usage message. + Use libpng time conversion routine. + +1997-10-17 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * pngmeta.c: + Updated for libpng 0.96 and zlib 1.0.4 + +1997-01-30 Dave Beckett <Dave.Beckett@bristol.ac.uk> + + * pngmeta.c: PNG meta 1.3 + + * pngmeta.c: PNG meta 1.2 + + * pngmeta.c: PNG meta 1.0 + + * pngmeta.c: New file. + diff --git a/Makefile.am b/Makefile.am index e69e3bd83..7d897fb4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,23 +2,25 @@ ## ## Process this file with automake to produce Makefile.in ## -## $Source: /home/cur/djb1/develop/pngmeta/pngmeta/RCS/Makefile.am,v $ +## $Id: Makefile.am,v 1.8 2001/05/16 15:25:29 cmdjb Exp $ ## -## $Id: Makefile.am,v 1.5 2000/01/31 14:15:53 djb1 Exp $ -## -## (C) Copyright 1998, Dave Beckett, University of Kent at Canterbury +## Copyright 1998-2000, Dave Beckett, ILRT, University of Bristol +## http://purl.org/net/dajobe/ ## -INCLUDES=-I$(PNG_INCLUDE) -I$(ZLIB_INCLUDE) +CFLAGS=@CFLAGS@ bin_PROGRAMS = pngmeta +man_MANS = pngmeta.1 + AUTOMAKE_OPTIONS=foreign no-dependencies -EXTRA_DIST=test1 test2 test3 test4\ - test1.xpt test2.xpt test3.xpt test4.xpt\ - 8859.png ctzn0g04.png ct1n0g04.png\ - pngmeta.1 Makefile.old pngmeta.spec +EXTRA_DIST=test1 test2 test3 test4 \ + test1.xpt test2.xpt test3.xpt test4.xpt \ + 8859.png ctzn0g04.png ct1n0g04.png \ + pngmeta.1 Makefile.old pngmeta.spec \ + autogen.sh man_MANS=pngmeta.1 diff --git a/Makefile.in b/Makefile.in index 2837a3847..208380b43 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,11 +1,17 @@ -# Makefile.in generated automatically by automake 1.2 from Makefile.am +# Makefile.in generated automatically by automake 1.4 from Makefile.am -# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -SHELL = /bin/sh + +SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -26,7 +32,7 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include -DISTDIR = +DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -40,7 +46,7 @@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ @@ -55,29 +61,25 @@ CC = @CC@ EXEEXT = @EXEEXT@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ -PNG_INCLUDE = @PNG_INCLUDE@ VERSION = @VERSION@ -ZLIB_INCLUDE = @ZLIB_INCLUDE@ -INCLUDES=-I$(PNG_INCLUDE) -I$(ZLIB_INCLUDE) +CFLAGS = @CFLAGS@ bin_PROGRAMS = pngmeta -AUTOMAKE_OPTIONS=foreign no-dependencies +man_MANS = pngmeta.1 + +AUTOMAKE_OPTIONS = foreign no-dependencies -EXTRA_DIST=test1 test2 test3 test4\ - test1.xpt test2.xpt test3.xpt test4.xpt\ - 8859.png ctzn0g04.png ct1n0g04.png\ - pngmeta.1 Makefile.old pngmeta.spec +EXTRA_DIST = test1 test2 test3 test4 test1.xpt test2.xpt test3.xpt test4.xpt 8859.png ctzn0g04.png ct1n0g04.png pngmeta.1 Makefile.old pngmeta.spec autogen.sh -man_MANS=pngmeta.1 -TESTS=test1 test2 test3 test4 +TESTS = test1 test2 test3 test4 -MAINTAINERCLEANFILES=test1.xpt test2.xpt test3.xpt test4.xpt +MAINTAINERCLEANFILES = test1.xpt test2.xpt test3.xpt test4.xpt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = config.h pngmeta.spec PROGRAMS = $(bin_PROGRAMS) @@ -88,42 +90,48 @@ LIBS = @LIBS@ pngmeta_SOURCES = pngmeta.c pngmeta_OBJECTS = pngmeta.o pngmeta_LDADD = $(LDADD) +pngmeta_DEPENDENCIES = pngmeta_LDFLAGS = -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -MANS = pngmeta.1 +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +man1dir = $(mandir)/man1 +MANS = $(man_MANS) NROFF = nroff -DIST_COMMON = README Makefile.am Makefile.in NEWS aclocal.m4 configure \ -configure.in install-sh missing mkinstalldirs +DIST_COMMON = README ChangeLog Makefile.am Makefile.in NEWS aclocal.m4 \ +config.h.in configure configure.in install-sh missing mkinstalldirs \ +pngmeta.spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gnutar -GZIP = --best +TAR = gtar +GZIP_ENV = --best SOURCES = pngmeta.c OBJECTS = pngmeta.o -default: all - +all: all-redirect .SUFFIXES: -.SUFFIXES: .c .o -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) -config.status: $(srcdir)/configure +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) +config.h: $(top_builddir)/config.status config.h.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status +pngmeta.spec: $(top_builddir)/config.status pngmeta.spec.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: @@ -139,15 +147,15 @@ install-binPROGRAMS: $(bin_PROGRAMS) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: @@ -172,27 +180,55 @@ maintainer-clean-compile: pngmeta: $(pngmeta_OBJECTS) $(pngmeta_DEPENDENCIES) @rm -f pngmeta $(LINK) $(pngmeta_LDFLAGS) $(pngmeta_OBJECTS) $(pngmeta_LDADD) $(LIBS) -install-man: $(MANS) - $(NORMAL_INSTALL) - $(mkinstalldirs) $(mandir)/man1 - @sect=1; \ - inst=`echo "pngmeta" | sed '$(transform)'`.1; \ - if test -f $(srcdir)/pngmeta.1; then file=$(srcdir)/pngmeta.1; \ - else file=pngmeta.1; fi; \ - echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \ - $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst -uninstall-man: - $(NORMAL_UNINSTALL) - inst=`echo "pngmeta" | sed '$(transform)'`.1; \ - rm -f $(mandir)/man1/$$inst +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ @@ -220,40 +256,46 @@ top_distdir = $(distdir) # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - rm -rf $(distdir) - GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) \ - && $(MAKE) dvi \ - && $(MAKE) check \ - && $(MAKE) install \ - && $(MAKE) installcheck \ - && $(MAKE) dist - rm -rf $(distdir) - @echo "========================"; \ - echo "$(distdir).tar.gz is ready for distribution"; \ - echo "========================" + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) - GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) - GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) distdir: $(DISTFILES) - rm -rf $(distdir) + -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ done check-TESTS: $(TESTS) @failed=0; all=0; \ @@ -280,70 +322,80 @@ check-TESTS: $(TESTS) echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0 -info: -dvi: -check: all - $(MAKE) check-TESTS -installcheck: -install-exec: install-binPROGRAMS - @$(NORMAL_INSTALL) - -install-data: install-man - @$(NORMAL_INSTALL) - -install: install-exec install-data all - @: - -uninstall: uninstall-binPROGRAMS uninstall-man - -all: Makefile $(PROGRAMS) $(MANS) - +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: install-man +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS uninstall-man +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(MANS) +all-redirect: all-am install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: - $(mkinstalldirs) $(bindir) $(mandir)/man1 + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: - -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(DISTCLEANFILES) + -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \ +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic -clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \ - mostlyclean +mostlyclean: mostlyclean-am -distclean: distclean-binPROGRAMS distclean-compile distclean-tags \ - distclean-generic clean - rm -f config.status +clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ + mostlyclean-am -maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \ - maintainer-clean-tags maintainer-clean-generic \ - distclean +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ + distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f config.status - -.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \ -clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \ -install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-man uninstall-man tags \ -mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ -distdir check-TESTS info dvi installcheck install-exec install-data \ -install uninstall all installdirs mostlyclean-generic distclean-generic \ -clean-generic maintainer-clean-generic clean mostlyclean distclean \ -maintainer-clean + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile install-man1 uninstall-man1 install-man \ +uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ +maintainer-clean-tags distdir check-TESTS info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean test-results: pngmeta diff --git a/Makefile.old b/Makefile.old index e28cd7fb2..9b6c4122f 100644 --- a/Makefile.old +++ b/Makefile.old @@ -3,7 +3,7 @@ # PACKAGE=pngmeta -VERSION=1.10 +VERSION=1.11 ZLIB=../zlib LIBPNG=../libpng @@ -2,6 +2,12 @@ Changes ------- Version +1.11 Checked with latest zlib (1.1.3), libpng (1.0.11). + Added --xrdf for RDF/XML output. + Added RPM building support. + Tidied for CVS. + HTML now XHTML. + 1.10 Updated to use latest zlib (1.1.3), libpng (1.0.5o). Added GNU style --options including --help page and --version @@ -14,10 +14,10 @@ Requirements ------------ * An ANSI C compiler -- preferrably gcc -* libpng (tested with 1.0.0, 1.0.03) -* zlib (tested with 1.1.1, 1.1.3) +* libpng (tested with 1.0.8) +* zlib (tested with 1.1.4) -The latter two packages are available from ftp://ftp.uu.net/graphics/png/ +The latter two packages are available from http://www.libpng.org/pub/png/ andr many other places, see the PNG Home Page for details. @@ -132,20 +132,31 @@ This code was modified from the code for png_read_end() from the libpng library. See pngmeta.c for the full copyright headers - they have to remain in that file to comply with them. -The GNU automake/autoconf configuration files and all that libpng and -zlib searching stuff was written by me and I give permission for -other people to use it to autoconfigure png and zlib in their -programs, as long as you acknowledge me. +I wrote the GNU automake/autoconf configuration files with the libpng +and zlib searching stuff and give permission for other people to use +it to autoconfigure png and zlib in their programs, as long as you +acknowledge me via my home page URI below. + + +Getting Latest Versions +---------------------- + +See the: + PNG and MNG tools at SourceForge + http://sourceforge.net/projects/pmt/ + + CVS + http://cvs.ilrt.org/cvsweb/png/pngmeta/ Thanks ------ ... to Rick Rodgers <rodgers@nlm.nih.gov> for the manual page. -... to Dan Brickley <daniel.brickley@bristol.ac.uk> for the RDF/XML output. +... to Dan Brickley <daniel.brickley@bristol.ac.uk> for RDF/XML +output idea. Dave Beckett -D.J.Beckett@ukc.ac.uk -http://www.cs.ukc.ac.uk/people/staff/djb1/ -31st January 2000 +Dave.Beckett@bristol.ac.uk +http://purl.org/net/dajobe/ diff --git a/aclocal.m4 b/aclocal.m4 index cfcb5d2b5..9f8add8f0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,14 @@ -dnl aclocal.m4 generated automatically by aclocal 1.2 +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. @@ -10,7 +20,7 @@ dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, -[AC_REQUIRE([AM_PROG_INSTALL]) +[AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] @@ -20,8 +30,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") -AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. @@ -33,15 +43,6 @@ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# serial 1 - -AC_DEFUN(AM_PROG_INSTALL, -[AC_REQUIRE([AC_PROG_INSTALL]) -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' -AC_SUBST(INSTALL_SCRIPT)dnl -]) - # # Check to make sure that the build environment is sane. # diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 000000000..8e7a6b1de --- /dev/null +++ b/autogen.sh @@ -0,0 +1,120 @@ +#!/bin/sh +# +# autogen.sh - Generates the initial makefiles from a pristine CVS tree +# +# $Id: autogen.sh,v 1.1 2001/05/16 15:22:25 cmdjb Exp $ +# +# USAGE: autogen.sh [configure options] +# +# If environment variable DRYRUN is set, no configuring will be done - +# (e.g. in bash) DRYRUN=1 ./autogen.sh +# will not do any configuring but will emit the programs that would be run. +# +# This script is based on similar scripts used in various tools +# commonly made available via CVS and used with GNU automake. +# Try 'locate autogen.sh' on your system and see what you get. +# + +PACKAGE=pngmeta +DIE= + +if test "X$DRYRUN" != X; then + DRYRUN=echo +fi + +autoconf_vers=2.13 +automake_vers=1.4 +aclocal_vers=1.4 + +program=`basename $0` + +if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then + if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \ + exit 1; exit 0; }'); + then + echo "$program: ERROR: \`autoconf' is too old." + echo " (version $autoconf_vers or newer is required)" + DIE="yes" + fi +else + echo + echo "$program: ERROR: You must have \`autoconf' installed to compile $PACKAGE." + echo " (version $autoconf_vers or newer is required)" + DIE="yes" +fi + + +if (automake --version) < /dev/null > /dev/null 2>&1 ; then + if (automake --version | awk 'NR==1 { if( $4 >= '$automake_vers') \ + exit 1; exit 0; }'); + then + echo "$program: ERROR: \`automake' is too old." + echo " (version $automake_vers or newer is required)" + DIE="yes" + fi + if (aclocal --version) < /dev/null > /dev/null 2>&1; then + if (aclocal --version | awk 'NR==1 { if( $4 >= '$aclocal_vers' ) \ + exit 1; exit 0; }' ); + then + echo "$program: ERROR: \`aclocal' is too old." + echo " (version $aclocal_vers or newer is required)" + DIE="yes" + fi + else + echo + echo "$program: ERROR: Missing \`aclocal'" + echo " The version of automake installed doesn't appear recent enough." + DIE="yes" + fi +else + echo + echo "$program: ERROR: You must have \`automake' installed to compile $PACKAGE." + echo " (version $automake_vers or newer is required)" + DIE="yes" +fi + + +if test "X$DIE" != X; then + exit 1 +fi + +if test -z "$*"; then + echo "$program: WARNING: Running \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo "\`$0' command line." +fi + +am_opt= + +for coin in `find $srcdir -name configure.in -print` +do + dir=`dirname $coin` + if test -f $dir/NO-AUTO-GEN; then + echo $program: Skipping $dir -- flagged as no auto-gen + else + echo $program: Processing directory $dir + ( cd $dir + aclocalinclude="$ACLOCAL_FLAGS" + echo "$program: Running aclocal $aclocalinclude" + $DRYRUN aclocal $aclocalinclude + if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then + echo "$program: Running autoheader" + $DRYRUN autoheader + fi + echo "$program: Running automake $am_opt" + $DRYRUN automake --add-missing $am_opt + echo "$program: Running autoconf" + $DRYRUN autoconf + ) + fi +done + +conf_flags= + +echo "$program: Running ./configure $conf_flags $@" +if test "X$DRYRUN" = X; then + $DRYRUN ./configure $conf_flags "$@" \ + && echo "$program: Now type \`make' to compile $PACKAGE" || exit 1 +else + $DRYRUN ./configure $conf_flags "$@" +fi diff --git a/config.h.in b/config.h.in new file mode 100644 index 000000000..43dfbab9a --- /dev/null +++ b/config.h.in @@ -0,0 +1,14 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if you have the png_create_read_struct function. */ +#undef HAVE_PNG_CREATE_READ_STRUCT + +/* Define if you have the png_get_text function. */ +#undef HAVE_PNG_GET_TEXT + +/* Name of package */ +#undef PACKAGE + +/* Version number of package */ +#undef VERSION + @@ -1,6 +1,8 @@ #! /bin/sh -# From configure.in Revision: 1.4 +# From configure.in Revision: 1.7 + + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. @@ -11,11 +13,6 @@ - -# serial 1 - - - # # Check to make sure that the build environment is sane. # @@ -25,7 +22,7 @@ # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -36,19 +33,17 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --with-png=DIR DIR is root for libpng distribution" -ac_help="$ac_help --with-zlib=DIR DIR is root for libz distribution" ac_help="$ac_help + --with-png=DIR DIR is root for libpng distribution" +ac_help="$ac_help --with-zlib-lib=LIB LIB is path to libz.a" ac_help="$ac_help --with-png-lib=LIB LIB is path to libpng.a" ac_help="$ac_help - --with-png-includes=DIR DIR is path where PNG header files can be - found, defaults to /usr/include" + --with-png-includes=DIR DIR is path where PNG header files can be found" ac_help="$ac_help - --with-zlib-includes=DIR DIR is path where ZLIB header files can be - found, defaults to /usr/include" + --with-zlib-includes=DIR DIR is path where ZLIB header files can be found" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -87,6 +82,7 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 @@ -370,7 +366,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -540,9 +536,11 @@ ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +ac_exeext= +ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -582,28 +580,30 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:590: checking for a BSD compatible install" >&5 +echo "configure:589: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -633,13 +633,12 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:643: checking whether build environment is sane" >&5 +echo "configure:642: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -696,7 +695,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:700: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:699: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -725,7 +724,7 @@ fi PACKAGE=pngmeta -VERSION=1.10 +VERSION=1.11 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -742,7 +741,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:746: checking for working aclocal" >&5 +echo "configure:745: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -755,7 +754,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:759: checking for working autoconf" >&5 +echo "configure:758: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -768,7 +767,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:772: checking for working automake" >&5 +echo "configure:771: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -781,7 +780,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:785: checking for working autoheader" >&5 +echo "configure:784: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -794,7 +793,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:798: checking for working makeinfo" >&5 +echo "configure:797: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -812,15 +811,16 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:816: checking for $ac_word" >&5 +echo "configure:815: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -848,9 +848,10 @@ else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - for ac_dir in $PATH; do + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -885,25 +886,61 @@ else echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:896: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:893: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:928: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross -cat > conftest.$ac_ext <<EOF -#line 903 "configure" +cat > conftest.$ac_ext << EOF + +#line 939 "configure" #include "confdefs.h" + main(){return(0);} EOF -if { (eval echo configure:907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -917,18 +954,24 @@ else ac_cv_prog_cc_works=no fi rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:927: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:970: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:932: checking whether we are using GNU C" >&5 +echo "configure:975: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -937,7 +980,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -948,11 +991,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:956: checking whether ${CC-cc} accepts -g" >&5 +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1003: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -967,16 +1014,20 @@ rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then CFLAGS="-g -O2" else - CFLAGS="-O2" + CFLAGS="-g" fi else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi @@ -984,61 +1035,126 @@ fi # Allow use of libpng and zlib from raw distributions -PNG_INCLUDE=/usr/include # prefix? -# Check whether --with-png or --without-png was given. -if test "${with_png+set}" = set; then - withval="$with_png" +# Check whether --with-zlib or --without-zlib was given. +if test "${with_zlib+set}" = set; then + withval="$with_zlib" : fi -echo $ac_n "checking for local copy of libpng distribution""... $ac_c" 1>&6 -echo "configure:997: checking for local copy of libpng distribution" >&5 -if test "X$with_png" = "X"; then - for dir in libpng-0-9* libpng ../libpng-0-9* ../libpng; do - if test -d $dir -a -f $dir/png.h; then - with_png=$dir - LIBS="$LIBS -lpng" - break - fi - done -fi -if test "X$with_png" != "X"; then - echo "$ac_t""$with_png" 1>&6 - LDFLAGS="$LDFLAGS -L$with_png" - PNG_INCLUDE=$with_png +if test "X$with_zlib" = "X"; then + echo $ac_n "checking for installed zlib""... $ac_c" 1>&6 +echo "configure:1048: checking for installed zlib" >&5 + oLIBS="$LIBS" + LIBS="$LIBS -lz" + cat > conftest.$ac_ext <<EOF +#line 1052 "configure" +#include "confdefs.h" +#include <zlib.h> +int main() { +z_streamp zstream; char *s=zlibVersion(); +; return 0; } +EOF +if { (eval echo configure:1059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + with_zlib=default + echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* echo "$ac_t""no" 1>&6 fi - - -ZLIB_INCLUDE=/usr/include # prefix? -# Check whether --with-zlib or --without-zlib was given. -if test "${with_zlib+set}" = set; then - withval="$with_zlib" - : +rm -f conftest* + LIBS="$oLIBS" +else + echo $ac_n "checking for local copy of zlib distribution""... $ac_c" 1>&6 +echo "configure:1073: checking for local copy of zlib distribution" >&5 + echo "$ac_t""$with_zlib" 1>&6 fi - -echo $ac_n "checking for local copy of zlib distribution""... $ac_c" 1>&6 -echo "configure:1025: checking for local copy of zlib distribution" >&5 if test "X$with_zlib" = "X"; then + echo $ac_n "checking for local copy of zlib distribution""... $ac_c" 1>&6 +echo "configure:1079: checking for local copy of zlib distribution" >&5 for dir in zlib-0-9* zlib ../zlib-0-9* ../zlib; do if test -d $dir -a -f $dir/zlib.h; then with_zlib=$dir - LIBS="$LIBS -lz" break fi done + if test "X$with_zlib" != "X"; then + echo "$ac_t""$with_zlib" 1>&6 + ZLIB_INCLUDE=$with_zlib + else + echo "$ac_t""no" 1>&6 + fi fi -if test "X$with_zlib" != "X"; then - echo "$ac_t""$with_zlib" 1>&6 - LDFLAGS="$LDFLAGS -L$with_zlib" - ZLIB_INCLUDE=$with_zlib + +if test $with_zlib != default; then + LIBS="$LIBS -L$with_zlib" + CFLAGS="$CFLAGS -I$with_zlib" +fi + + +# Check whether --with-png or --without-png was given. +if test "${with_png+set}" = set; then + withval="$with_png" + : +fi + + +if test "X$with_png" = "X"; then + echo $ac_n "checking for installed libpng""... $ac_c" 1>&6 +echo "configure:1109: checking for installed libpng" >&5 + oLIBS="$LIBS" + LIBS="$LIBS -lpng" + cat > conftest.$ac_ext <<EOF +#line 1113 "configure" +#include "confdefs.h" +#include <png.h> +int main() { +png_structp png_ptr; png_infop info_ptr; info_ptr = png_create_info_struct(png_ptr); +; return 0; } +EOF +if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + with_png=default + echo "$ac_t""yes" 1>&6 else - echo "$ac_t""no" 1>&6 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LIBS="$oLIBS" + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* +else + echo $ac_n "checking for local copy of libpng distribution""... $ac_c" 1>&6 +echo "configure:1134: checking for local copy of libpng distribution" >&5 + echo "$ac_t""$with_png" 1>&6 fi +if test "X$with_png" = "X"; then + echo $ac_n "checking for local copy of libpng distribution""... $ac_c" 1>&6 +echo "configure:1140: checking for local copy of libpng distribution" >&5 + for dir in libpng-0-9* libpng ../libpng-0-9* ../libpng; do + if test -d $dir -a -f $dir/png.h; then + with_png=$dir + break + fi + done + if test "X$with_png" != "X"; then + echo "$ac_t""$with_png" 1>&6 + PNG_INCLUDE=$with_png + else + echo "$ac_t""no" 1>&6 + fi +fi + +if test $with_png != default; then + LIBS="$LIBS -L$with_png -lpng" + CFLAGS="$CFLAGS -I$with_png" +fi @@ -1050,11 +1166,11 @@ if test "${with_zlib_lib+set}" = set; then fi if test "X$with_zlib_lib" != "X"; then - LDFLAGS="$LDFLAGS -L$with_zlib_lib" + LIBS="$LIBS -L$with_zlib_lib" fi echo $ac_n "checking for zlibVersion in -lz""... $ac_c" 1>&6 -echo "configure:1058: checking for zlibVersion in -lz" >&5 +echo "configure:1174: checking for zlibVersion in -lz" >&5 ac_lib_var=`echo z'_'zlibVersion | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1062,7 +1178,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <<EOF -#line 1066 "configure" +#line 1182 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1073,7 +1189,7 @@ int main() { zlibVersion() ; return 0; } EOF -if { (eval echo configure:1077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1088,7 +1204,14 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lz" + ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF + + LIBS="-lz $LIBS" + else echo "$ac_t""no" 1>&6 { echo "configure: error: could not find libz" 1>&2; exit 1; } @@ -1106,11 +1229,11 @@ if test "${with_png_lib+set}" = set; then fi if test "X$with_png_lib" != "X"; then - LDFLAGS="$LDFLAGS -L$with_png_lib" + LIBS="$LIBS -L$with_png_lib" fi echo $ac_n "checking for png_create_read_struct in -lpng""... $ac_c" 1>&6 -echo "configure:1114: checking for png_create_read_struct in -lpng" >&5 +echo "configure:1237: checking for png_create_read_struct in -lpng" >&5 ac_lib_var=`echo png'_'png_create_read_struct | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1118,7 +1241,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpng $LIBS" cat > conftest.$ac_ext <<EOF -#line 1122 "configure" +#line 1245 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1129,7 +1252,7 @@ int main() { png_create_read_struct() ; return 0; } EOF -if { (eval echo configure:1133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1144,7 +1267,14 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo png | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF + LIBS="-lpng $LIBS" + else echo "$ac_t""no" 1>&6 { echo "configure: error: could not find libpng" 1>&2; exit 1; } @@ -1156,45 +1286,55 @@ fi -echo $ac_n "checking for location of png includes""... $ac_c" 1>&6 -echo "configure:1161: checking for location of png includes" >&5 # Check whether --with-png-includes or --without-png-includes was given. if test "${with_png_includes+set}" = set; then withval="$with_png_includes" : fi -if test "X$with_png_includes" != "X"; then - PNG_INCLUDE=$with_png_includes -fi -if test ! -f "$PNG_INCLUDE/png.h"; then - { echo "configure: error: could not find png.h in $PNG_INCLUDE" 1>&2; exit 1; } -fi -if test ! -f "$PNG_INCLUDE/pngconf.h"; then - { echo "configure: error: could not find pngconf.h in $PNG_INCLUDE" 1>&2; exit 1; } -fi -echo "$ac_t""$PNG_INCLUDE" 1>&6 +if test "X$with_png" = X; then + echo $ac_n "checking for location of png includes""... $ac_c" 1>&6 +echo "configure:1299: checking for location of png includes" >&5 + if test "X$PNG_INCLUDE" = X; then + if test "X$with_png_includes" != "X"; then + PNG_INCLUDE=$with_png_includes + fi + fi + if test ! -f "$PNG_INCLUDE/png.h"; then + { echo "configure: error: could not find png.h in $PNG_INCLUDE" 1>&2; exit 1; } + fi + if test ! -f "$PNG_INCLUDE/pngconf.h"; then + { echo "configure: error: could not find pngconf.h in $PNG_INCLUDE" 1>&2; exit 1; } + fi + + echo "$ac_t""$PNG_INCLUDE" 1>&6 + CFLAGS="-I$(PNG_INCLUDE) $(CFLAGS)" +fi -echo $ac_n "checking for location of zlib includes""... $ac_c" 1>&6 -echo "configure:1182: checking for location of zlib includes" >&5 # Check whether --with-zlib-includes or --without-zlib-includes was given. if test "${with_zlib_includes+set}" = set; then withval="$with_zlib_includes" : fi -if test "X$with_zlib_includes" != "X"; then - ZLIB_INCLUDE=$with_zlib_includes -fi -if test ! -f "$ZLIB_INCLUDE/zlib.h"; then - { echo "configure: error: could not find zlib.h in $ZLIB_INCLUDE" 1>&2; exit 1; } -fi -if test ! -f "$ZLIB_INCLUDE/zconf.h"; then - { echo "configure: error: could not find zconf.h in $ZLIB_INCLUDE" 1>&2; exit 1; } +if test "X$with_zlib" = X; then + echo $ac_n "checking for location of zlib includes""... $ac_c" 1>&6 +echo "configure:1325: checking for location of zlib includes" >&5 + if test "X$with_zlib_includes" != "X"; then + ZLIB_INCLUDE=$with_zlib_includes + fi + if test ! -f "$ZLIB_INCLUDE/zlib.h"; then + { echo "configure: error: could not find zlib.h in $ZLIB_INCLUDE" 1>&2; exit 1; } + fi + if test ! -f "$ZLIB_INCLUDE/zconf.h"; then + { echo "configure: error: could not find zconf.h in $ZLIB_INCLUDE" 1>&2; exit 1; } + fi + + echo "$ac_t""$ZLIB_INCLUDE" 1>&6 + CFLAGS="-I$(PNG_INCLUDE) $(CFLAGS)" fi -echo "$ac_t""$ZLIB_INCLUDE" 1>&6 @@ -1204,6 +1344,62 @@ EXEEXT= +for ac_func in png_create_read_struct png_get_text +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1351: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1356 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + trap '' 1 2 15 cat > confcache <<\EOF @@ -1228,7 +1424,7 @@ EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -1307,7 +1503,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1318,7 +1514,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile config.h pngmeta.spec" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -1327,9 +1523,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub +s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -1349,8 +1547,8 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_DATA@%$INSTALL_DATA%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g @@ -1360,8 +1558,6 @@ s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g -s%@PNG_INCLUDE@%$PNG_INCLUDE%g -s%@ZLIB_INCLUDE@%$ZLIB_INCLUDE%g s%@EXEEXT@%$EXEEXT%g CEOF @@ -1404,7 +1600,7 @@ EOF cat >> $CONFIG_STATUS <<EOF -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +CONFIG_FILES=\${CONFIG_FILES-"Makefile config.h pngmeta.spec"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/configure.in b/configure.in index 55888e3ba..4964c4464 100644 --- a/configure.in +++ b/configure.in @@ -2,16 +2,15 @@ dnl -*- shell-script -*- dnl dnl Process this file with autoconf to produce a configure script. dnl -dnl $Source: /home/cur/djb1/develop/pngmeta/pngmeta/RCS/configure.in,v $ +dnl $Id: configure.in,v 1.7 2001/05/16 15:14:22 cmdjb Exp $ dnl -dnl $Id: configure.in,v 1.4 2000/01/31 13:52:24 djb1 Exp $ -dnl -dnl (C) Copyright 1998, Dave Beckett, University of Kent at Canterbury +dnl Copyright 1998-2000 Dave Beckett, ILRT, University of Bristol +dnl http://purl.org/net/dajobe/ dnl -AC_REVISION($Revision: 1.4 $) +AC_REVISION($Revision: 1.7 $) AC_INIT(pngmeta.c) -AM_INIT_AUTOMAKE(pngmeta, [1.10]) +AM_INIT_AUTOMAKE(pngmeta, [1.11]) AC_PREREQ(2.12) dnl Checks for programs. @@ -21,51 +20,82 @@ AC_PROG_CC # Allow use of libpng and zlib from raw distributions -PNG_INCLUDE=/usr/include # prefix? -AC_ARG_WITH(png, -[ --with-png=DIR DIR is root for libpng distribution]) +AC_ARG_WITH(zlib, +[ --with-zlib=DIR DIR is root for libz distribution]) -AC_MSG_CHECKING(for local copy of libpng distribution) -if test "X$with_png" = "X"; then - for dir in libpng-[0-9]* libpng ../libpng-[0-9]* ../libpng; do - if test -d $dir -a -f $dir/png.h; then - with_png=$dir - LIBS="$LIBS -lpng" - break - fi - done -fi -if test "X$with_png" != "X"; then - AC_MSG_RESULT($with_png) - LDFLAGS="$LDFLAGS -L$with_png" - PNG_INCLUDE=$with_png +if test "X$with_zlib" = "X"; then + AC_MSG_CHECKING(for installed zlib) + oLIBS="$LIBS" + LIBS="$LIBS -lz" + AC_TRY_LINK([#include <zlib.h>], [z_streamp zstream; char *s=zlibVersion();], + with_zlib=default + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + LIBS="$oLIBS" else - AC_MSG_RESULT(no) + AC_MSG_CHECKING(for local copy of zlib distribution) + AC_MSG_RESULT($with_zlib) fi - -ZLIB_INCLUDE=/usr/include # prefix? -AC_ARG_WITH(zlib, -[ --with-zlib=DIR DIR is root for libz distribution]) - -AC_MSG_CHECKING(for local copy of zlib distribution) if test "X$with_zlib" = "X"; then + AC_MSG_CHECKING(for local copy of zlib distribution) for dir in zlib-[0-9]* zlib ../zlib-[0-9]* ../zlib; do if test -d $dir -a -f $dir/zlib.h; then with_zlib=$dir - LIBS="$LIBS -lz" break fi done + if test "X$with_zlib" != "X"; then + AC_MSG_RESULT($with_zlib) + ZLIB_INCLUDE=$with_zlib + else + AC_MSG_RESULT(no) + fi fi -if test "X$with_zlib" != "X"; then - AC_MSG_RESULT($with_zlib) - LDFLAGS="$LDFLAGS -L$with_zlib" - ZLIB_INCLUDE=$with_zlib + +if test $with_zlib != default; then + LIBS="$LIBS -L$with_zlib" + CFLAGS="$CFLAGS -I$with_zlib" +fi + + +AC_ARG_WITH(png, +[ --with-png=DIR DIR is root for libpng distribution]) + +if test "X$with_png" = "X"; then + AC_MSG_CHECKING(for installed libpng) + oLIBS="$LIBS" + LIBS="$LIBS -lpng" + AC_TRY_LINK([#include <png.h>], [png_structp png_ptr; png_infop info_ptr; info_ptr = png_create_info_struct(png_ptr); ], + with_png=default + AC_MSG_RESULT(yes), + LIBS="$oLIBS" + AC_MSG_RESULT(no)) else - AC_MSG_RESULT(no) + AC_MSG_CHECKING(for local copy of libpng distribution) + AC_MSG_RESULT($with_png) +fi + +if test "X$with_png" = "X"; then + AC_MSG_CHECKING(for local copy of libpng distribution) + for dir in libpng-[0-9]* libpng ../libpng-[0-9]* ../libpng; do + if test -d $dir -a -f $dir/png.h; then + with_png=$dir + break + fi + done + if test "X$with_png" != "X"; then + AC_MSG_RESULT($with_png) + PNG_INCLUDE=$with_png + else + AC_MSG_RESULT(no) + fi fi +if test $with_png != default; then + LIBS="$LIBS -L$with_png -lpng" + CFLAGS="$CFLAGS -I$with_png" +fi dnl Checks for libraries. @@ -74,10 +104,10 @@ dnl Checks for libraries. AC_ARG_WITH(zlib_lib, [ --with-zlib-lib=LIB LIB is path to libz.a]) if test "X$with_zlib_lib" != "X"; then - LDFLAGS="$LDFLAGS -L$with_zlib_lib" + LIBS="$LIBS -L$with_zlib_lib" fi -AC_CHECK_LIB(z, zlibVersion, [LIBS="$LIBS -lz"], +AC_CHECK_LIB(z, zlibVersion, [], [ AC_MSG_ERROR(could not find libz)] ) @@ -87,10 +117,10 @@ LIBS="$LIBS -lm" AC_ARG_WITH(png_lib, [ --with-png-lib=LIB LIB is path to libpng.a]) if test "X$with_png_lib" != "X"; then - LDFLAGS="$LDFLAGS -L$with_png_lib" + LIBS="$LIBS -L$with_png_lib" fi -AC_CHECK_LIB(png, png_create_read_struct, [LIBS="-lpng $LIBS"], +AC_CHECK_LIB(png, png_create_read_struct, [], [ AC_MSG_ERROR(could not find libpng)] ) @@ -99,38 +129,46 @@ AC_CHECK_LIB(png, png_create_read_struct, [LIBS="-lpng $LIBS"], dnl Checks for header files. -AC_MSG_CHECKING(for location of png includes) AC_ARG_WITH(png-includes, -[ --with-png-includes=DIR DIR is path where PNG header files can be - found, defaults to /usr/include]) -if test "X$with_png_includes" != "X"; then - PNG_INCLUDE=$with_png_includes -fi -if test ! -f "$PNG_INCLUDE/png.h"; then - AC_MSG_ERROR(could not find png.h in $PNG_INCLUDE) -fi -if test ! -f "$PNG_INCLUDE/pngconf.h"; then - AC_MSG_ERROR(could not find pngconf.h in $PNG_INCLUDE) +[ --with-png-includes=DIR DIR is path where PNG header files can be found]) + +if test "X$with_png" = X; then + AC_MSG_CHECKING(for location of png includes) + if test "X$PNG_INCLUDE" = X; then + if test "X$with_png_includes" != "X"; then + PNG_INCLUDE=$with_png_includes + fi + fi + if test ! -f "$PNG_INCLUDE/png.h"; then + AC_MSG_ERROR(could not find png.h in $PNG_INCLUDE) + fi + if test ! -f "$PNG_INCLUDE/pngconf.h"; then + AC_MSG_ERROR(could not find pngconf.h in $PNG_INCLUDE) + fi + + AC_MSG_RESULT($PNG_INCLUDE) + CFLAGS="-I$(PNG_INCLUDE) $(CFLAGS)" fi -AC_MSG_RESULT($PNG_INCLUDE) -AC_SUBST(PNG_INCLUDE) -AC_MSG_CHECKING(for location of zlib includes) AC_ARG_WITH(zlib-includes, -[ --with-zlib-includes=DIR DIR is path where ZLIB header files can be - found, defaults to /usr/include]) -if test "X$with_zlib_includes" != "X"; then - ZLIB_INCLUDE=$with_zlib_includes -fi -if test ! -f "$ZLIB_INCLUDE/zlib.h"; then - AC_MSG_ERROR(could not find zlib.h in $ZLIB_INCLUDE) +[ --with-zlib-includes=DIR DIR is path where ZLIB header files can be found]) +if test "X$with_zlib" = X; then + AC_MSG_CHECKING(for location of zlib includes) + if test "X$with_zlib_includes" != "X"; then + ZLIB_INCLUDE=$with_zlib_includes + fi + if test ! -f "$ZLIB_INCLUDE/zlib.h"; then + AC_MSG_ERROR(could not find zlib.h in $ZLIB_INCLUDE) + fi + if test ! -f "$ZLIB_INCLUDE/zconf.h"; then + AC_MSG_ERROR(could not find zconf.h in $ZLIB_INCLUDE) + fi + + AC_MSG_RESULT($ZLIB_INCLUDE) + CFLAGS="-I$(PNG_INCLUDE) $(CFLAGS)" fi -if test ! -f "$ZLIB_INCLUDE/zconf.h"; then - AC_MSG_ERROR(could not find zconf.h in $ZLIB_INCLUDE) -fi -AC_MSG_RESULT($ZLIB_INCLUDE) -AC_SUBST(ZLIB_INCLUDE) + ## I have no idea why autoconf makes me need to do this. @@ -141,5 +179,7 @@ AC_SUBST(EXEEXT) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. +AC_CHECK_FUNCS([png_create_read_struct png_get_text]) + -AC_OUTPUT(Makefile) +AC_OUTPUT([Makefile config.h pngmeta.spec]) diff --git a/install-sh b/install-sh index e8436696c..e9de23842 100755 --- a/install-sh +++ b/install-sh @@ -118,6 +118,7 @@ if [ x"$dir_arg" != x ]; then if [ -d $dst ]; then instcmd=: + chmodcmd="" else instcmd=mkdir fi @@ -82,15 +82,17 @@ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` - if test -z "$files"; then - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` - test -z "$files" || files="$files.in" - else - files=`echo "$files" | sed -e 's/:/ /g'` - fi - test -z "$files" && files="config.h.in" - touch $files + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files ;; automake) @@ -99,9 +101,9 @@ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." - find . -type f -name Makefile.am -print \ - | sed 's/^\(.*\).am$/touch \1.in/' \ - | sh + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done ;; bison|yacc) diff --git a/mkinstalldirs b/mkinstalldirs index a01481be4..4f58503ea 100755 --- a/mkinstalldirs +++ b/mkinstalldirs @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $ +# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 @@ -22,7 +22,7 @@ do esac if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 + echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? @@ -2,9 +2,9 @@ .\" .\" Manual page for pngmeta - see end of page for copyright .\" -.\" $Source: /home/cur/djb1/develop/pngmeta/pngmeta/RCS/pngmeta.1,v $ +.\" $Source: /usr/local/cvsroot/png/pngmeta/pngmeta.1,v $ .\" -.\" $Id: pngmeta.1,v 1.4 2000/01/31 14:05:45 djb1 Exp $ +.\" $Id: pngmeta.1,v 1.5 2001/05/16 14:46:52 cmdjb Exp $ .\" .SH NAME pngmeta \- extract metadata from Portable Network Graphics (PNG) image files @@ -54,9 +54,10 @@ Format output in HTML, with each field/value as an element in a descriptive list. .TP .B \--xrdf -Format output in RDF/XML, with each field/value as an element in a descriptive -.RB ( DL ) -list. +Format output in RDF/XML, with each field/value as an element in an +rdf:Description block inside the outer rdf:RDF wrapper element. +If an XMLRDFDATA field is found, it is assumed to be RDF/XML content +and is emitted in a second rdf:Description block. .SH OTHER OPTIONS .TP .B \--all @@ -100,27 +101,25 @@ http://harvest.cs.colorado.edu/ For .IR PNG .IP -http://www.cdrom.com/pub/png/ +http://www.libpng.org/pub/png/ .LP For .IR "libpng library:" .IP -ftp://swrinde.nde.swri.edu/pub/png/src/ +http://www.libpng.org/pub/png/libpng.html .br -http://www.cdrom.com/pub/png/src/ +http://libpng.sourceforge.net .LP For -.IR zlib +.IR zlib - "zlib library" .IP -http://www.cdrom.com/pub/infozip/zlib/ -.LP -For -.IR "zlib library:" +http://www.info-zip.org/pub/infozip/zlib/ +.br +http://www.mirror.ac.uk/sites/ftp.freesoftware.com/pub/infozip/zlib/ .IP -http://www.cdrom.com/pub/infozip/zlib/ .SH AUTHORS Version 1.10. -Dave Beckett (D.J.Beckett@ukc.ac.uk). +Dave Beckett, ILRT, University of Bristol, http://purl.org/net/dajobe/ .LP The .IR zlib (3) @@ -4,15 +4,11 @@ tested up to libpng 1.0.5o and zlib 1.1.3 - (C) Copyright Dave Beckett <D.J.Beckett@ukc.ac.uk>, - University of Kent at Canterbury, UK - http://www.cs.ukc.ac.uk/people/staff/djb1/ + Copyright 1998-2000 Dave Beckett, ILRT, University of Bristol + http://purl.org/net/dajobe/ - RDF support by daniel.brickley@bristol.ac.uk - $Source: /home/cur/djb1/develop/pngmeta/pngmeta/RCS/pngmeta.c,v $ - - $Id: pngmeta.c,v 1.10 2000/01/31 13:51:46 djb1 Exp $ + $Id: pngmeta.c,v 1.12 2001/05/16 14:41:06 cmdjb Exp $ The function png_skip_till_end() is a modified version of png_read_end() from libpng 1.0.0 by @@ -86,10 +82,16 @@ #define STDERR stderr #endif + +#define XMLRDF_MAGIC_FIELD "XMLRDFDATA" + + void png_skip_till_end PNGARG((png_structp png_ptr, png_infop info)); void html_quote_string PNGARG((FILE *fd, const char *string)); void print_init PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet)); +void print_start_image PNGARG((FILE *fd, int output_type, const char *filename, const char *uri, int quiet)); void print_kv PNGARG((FILE *fd, int output_type, const char *field, const char *value)); +void print_end_image PNGARG((FILE *fd, int output_type)); void print_finish PNGARG((FILE *fd, int output_type)); void user_warning_fn PNGARG((png_structp png_ptr, png_const_charp warning_msg)); @@ -97,6 +99,10 @@ void user_warning_fn PNGARG((png_structp png_ptr, png_const_charp warning_msg)); const char *progname; +/* static - used to store magic RDF field if seen */ +static char *xmlrdf_magic_block=NULL; + + /* read data, ignoring IDATs, till the end of the png file. Will not read past the end of the file, will verify the end is @@ -150,6 +156,10 @@ png_skip_till_end(png_structp png_ptr, png_infop info_ptr) else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) png_handle_zTXt(png_ptr, info_ptr, length); #endif +#if defined(PNG_READ_iTXt_SUPPORTED) + else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) + png_handle_iTXt(png_ptr, info_ptr, length); +#endif else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) png_handle_IEND(png_ptr, info_ptr, length); else @@ -196,6 +206,34 @@ void print_init(FILE *fd, int output_type, const char *filename, switch (output_type) { case OUTPUT_SOIF: + break; + + case OUTPUT_HTML: + fputs("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'blah'>\n", fd); + fputs("<html>\n<head>\n<title>Metadata for ", fd); + html_quote_string(fd, filename); + fputs("</title>\n</head>\n<body>\n\n", fd); + break; + + case OUTPUT_XRDF: + fputs("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'\n", fd); + fputs(" xmlns:png='http://www.w3.org/2000/08/pngmeta#'\n", fd); + fputs(" xmlns:dc='http://purl.org/dc/elements/1.0/'>\n", fd); + break; + + default: /* OUTPUT_TEXT */ + if (!quiet) + fprintf(fd, "%s: PNG metadata for %s:\n", progname, filename); + } +} + + +void print_start_image(FILE *fd, int output_type, const char *filename, + const char *uri, int quiet) +{ + switch (output_type) + { + case OUTPUT_SOIF: if (uri) fprintf(fd, "@FILE { %s\n", uri); else @@ -203,23 +241,16 @@ void print_init(FILE *fd, int output_type, const char *filename, break; case OUTPUT_HTML: - fputs("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2//EN'>\n", fd); - fputs("<HTML>\n<HEAD>\n<TITLE>Metadata for ", fd); - html_quote_string(fd, filename); - fputs("</TITLE>\n</HEAD>\n<BODY>\n<H1>Metadata for ", fd); + fputs("<h1>Metadata for ", fd); html_quote_string(fd, filename); - fputs("</H1>\n<DL>\n", fd); + fputs("</h1>\n<dl>\n", fd); break; case OUTPUT_XRDF: - fputs("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'\n", fd); - fputs(" xmlns:s='http://www.tasi.ac.uk/rdf/vocab#'\n", fd); - fputs(" xmlns:dc='http://purl.org/dc/elements/1.0/'>\n", fd); - if (uri) - fprintf(fd, " <s:Image about=\"%s\"\n", uri); + fprintf(fd, " <png:Image about=\"%s\"\n", uri); else { - fputs(" <s:Image about=\"", fd); + fputs(" <png:Image about=\"", fd); html_quote_string(fd, filename); fputs("\">\n", fd); } @@ -228,8 +259,7 @@ void print_init(FILE *fd, int output_type, const char *filename, break; default: /* OUTPUT_TEXT */ - if (!quiet) - fprintf(fd, "%s: PNG metadata for %s:\n", progname, filename); + break; } } @@ -245,19 +275,25 @@ void print_kv(FILE *fd, int output_type, const char *field, const char *value) break; case OUTPUT_HTML: - /* HTML: <DT>field</DT>\n<DD><P>value</P></DD>\n" */ - fputs(" <DT>", fd); + /* HTML: <dt>field<br /></dt>\n<dd>value</dd>\n" */ + fputs(" <dt>", fd); html_quote_string(fd, field); - fputs("</DT>\n <DD><P>", fd); + fputs("<br /></dt>\n <dd>", fd); html_quote_string(fd, value); - fputs("</P></DD>\n\n", fd); + fputs("</dd>\n\n", fd); break; case OUTPUT_XRDF: /* RDF: simple flat text properties */ + + if(strstr(field, XMLRDF_MAGIC_FIELD)) { + xmlrdf_magic_block=(char*)value; + break; + } + /* start tag */ - fputs(" <s:", fd); + fputs(" <png:", fd); html_quote_string(fd, field); fputs(">", fd); @@ -269,7 +305,7 @@ void print_kv(FILE *fd, int output_type, const char *field, const char *value) html_quote_string(fd, value); /* end tag */ - fputs("</s:", fd); + fputs("</png:", fd); html_quote_string(fd, field); fputs(">\n", fd); break; @@ -280,6 +316,28 @@ void print_kv(FILE *fd, int output_type, const char *field, const char *value) } +void +print_end_image(FILE *fd, int output_type) +{ + switch (output_type) + { + case OUTPUT_SOIF: + break; + + case OUTPUT_HTML: + fputs("</dl>\n\n", fd); + break; + + case OUTPUT_XRDF: + fputs(" </png:Image>\n", fd); + break; + + default: /* OUTPUT_TEXT */ + break; + } +} + + void print_finish(FILE *fd, int output_type) { switch (output_type) @@ -289,11 +347,11 @@ void print_finish(FILE *fd, int output_type) break; case OUTPUT_HTML: - fprintf(fd, "</DL>\n\n<SMALL>Created by %s V%s</SMALL>\n\n</BODY>\n</HTML>\n", progname, VERSION); + fprintf(fd, "<hr /><small>Created by %s V%s</small>\n\n</body>\n</html>\n", progname, VERSION); break; case OUTPUT_XRDF: - fprintf(fd, " </s:Image>\n</rdf:RDF>\n\n<!--Created by %s V%s -->\n", progname, VERSION); + fprintf(fd, "</rdf:RDF>\n\n<!--Created by %s V%s -->\n", progname, VERSION); break; /* case OUTPUT_TEXT / default */ @@ -340,7 +398,10 @@ int main(int argc, char *argv[]) int i; char *p; char *uri= NULL; - +#ifdef HAVE_PNG_GET_TEXT + png_textp text_ptr; + int num_text = 0; +#endif /* Make progname just become the program name, not the full path - this is file system type specific since / is used as the @@ -455,8 +516,7 @@ int main(int argc, char *argv[]) fprintf(STDERR, " --xrdf format output in XML/RDF format\n"); fprintf(STDERR, " --help display this help and exit\n"); fprintf(STDERR, " --version output version information and exit\n"); - fprintf(STDERR, "\n(C) Copyright 2000 Dave Beckett, University of Kent at Canterbury\nhttp://www.cs.ukc.ac.uk/people/staff/djb1/\n"); - fprintf(STDERR, "RDF output by daniel.brickley@bristol.ac.uk\n"); + fprintf(STDERR, "\nCopyright 1998-2000 Dave Beckett, ILRT, University of Bristol\nhttp://purl.org/net/dajobe/\n"); } exit(1); } @@ -500,6 +560,8 @@ int main(int argc, char *argv[]) png_read_info(png_ptr, info_ptr); print_init(out_fp, output_type, pngfile, uri, quiet); + + print_start_image(out_fp, output_type, pngfile, uri, quiet); if (output_type == OUTPUT_SOIF || all) { /* @@ -539,8 +601,14 @@ int main(int argc, char *argv[]) /* Local function */ png_skip_till_end(png_ptr, end_info); - - + + +#ifdef HAVE_PNG_GET_TEXT + if(png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) > 0) { + for (i = 0; i < num_text; i++) + print_kv(out_fp, output_type, text_ptr[i].key, text_ptr[i].text); + } +#else /* Print text keywords before IDAT */ for (i = 0; i < info_ptr->num_text; i++) print_kv(out_fp, output_type, info_ptr->text[i].key, info_ptr->text[i].text); @@ -548,6 +616,8 @@ int main(int argc, char *argv[]) /* Print text keywords after IDAT */ for (i = 0; i < end_info->num_text; i++) print_kv(out_fp, output_type, end_info->text[i].key, end_info->text[i].text); + +#endif /* Print modification time (tIME chunk) if present */ if (info_ptr->valid & PNG_INFO_tIME) @@ -556,7 +626,15 @@ int main(int argc, char *argv[]) else if (end_info->valid & PNG_INFO_tIME) print_kv(out_fp, output_type, "Modification Time", png_convert_to_rfc1123(png_ptr, &end_info->mod_time)); - + + + print_end_image(out_fp, output_type); + + /* print rest of RDF/XML stuff */ + if(xmlrdf_magic_block && output_type == OUTPUT_XRDF) { + fputs(xmlrdf_magic_block, out_fp); + } + print_finish(out_fp, output_type); diff --git a/pngmeta.spec b/pngmeta.spec index 83de94f0e..52a2748e7 100644 --- a/pngmeta.spec +++ b/pngmeta.spec @@ -1,19 +1,23 @@ # # pngmeta -- Get Metadata from PNG images # -%define version 1.10 %define name pngmeta +%define version 1.11 +%define release 1 +%define prefix /usr + Summary: Display metadata information from PNG images Name: %{name} Version: %{version} -Release: 1 +Release: %{release} Copyright: Freely Distributable Group: Applications/Graphics -Source: http://www.cs.ukc.ac.uk/people/staff/djb1/software/%{name}-%{version}.tar.gz -URL: http://www.cs.ukc.ac.uk/people/staff/djb1/software +Source: http://purl.org/net/dajobe/software/%{name}-%{version}.tar.gz +Vendor: Dave Beckett <Dave.Beckett@bristol.ac.uk> +URL: http://sourceforge.net/projects/pmt/ Provides: pngmeta Requires: libpng.so.2 zlib -BuildRoot: /tmp/rpmbuild_%{name} +BuildRoot: /var/tmp/%{name}-%{version} %description This small filter program extracts metadata from PNG images and @@ -22,25 +26,26 @@ values. %prep rm -rf $RPM_BUILD_ROOT -rm -rf $RPM_BUILD_DIR/%{name}-%{version} %setup %build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr +%configure --prefix=${prefix} + make %install -make install-strip prefix=$RPM_BUILD_ROOT/usr - -%files - -%doc %attr (-,root,root) NEWS -%doc %attr (-,root,root) README - -%attr (-,root,root) /usr/man/man1/pngmeta.1 -%attr (755,root,root) /usr/bin/pngmeta +if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi +mkdir -p $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install %clean rm -rf $RPM_BUILD_ROOT -rm -rf $RPM_BUILD_DIR/%{name}-%{version} + +%files +%defattr(-,root,root) +%doc NEWS README +%{prefix}/man/man1/pngmeta.1* +%attr (755,root,root) %{prefix}/bin/pngmeta + +%changelog
\ No newline at end of file diff --git a/pngmeta.spec.in b/pngmeta.spec.in new file mode 100644 index 000000000..df90e2f13 --- /dev/null +++ b/pngmeta.spec.in @@ -0,0 +1,51 @@ +# +# pngmeta -- Get Metadata from PNG images +# +%define name @PACKAGE@ +%define version @VERSION@ +%define release 1 +%define prefix /usr + +Summary: Display metadata information from PNG images +Name: %{name} +Version: %{version} +Release: %{release} +Copyright: Freely Distributable +Group: Applications/Graphics +Source: http://purl.org/net/dajobe/software/%{name}-%{version}.tar.gz +Vendor: Dave Beckett <Dave.Beckett@bristol.ac.uk> +URL: http://sourceforge.net/projects/pmt/ +Provides: pngmeta +Requires: libpng.so.2 zlib +BuildRoot: /var/tmp/%{name}-%{version} + +%description +This small filter program extracts metadata from PNG images and +displays them as either HTML, SOIF, RDF/XML or simple fields and +values. + +%prep +rm -rf $RPM_BUILD_ROOT + +%setup + +%build +%configure --prefix=${prefix} + +make + +%install +if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi +mkdir -p $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc NEWS README +%{prefix}/man/man1/pngmeta.1* +%attr (755,root,root) %{prefix}/bin/pngmeta + +%changelog
\ No newline at end of file @@ -1,3 +1,12 @@ #!/bin/sh echo 'Testing uncompressed text chunk - tEXT (plain format)' -./pngmeta -quiet ct1n0g04.png | diff -c test1.xpt - +INPUT=ct1n0g04.png +OUTPUT=test1.xpt + +for dir in . ..; do + if [ -r $dir/$OUTPUT ]; then + break; + fi +done +here=`pwd` +cd $dir && $here/pngmeta -quiet $INPUT | diff -c $OUTPUT - @@ -1,3 +1,12 @@ #!/bin/sh echo 'Testing compressed text chunk - zTXT (SOIF format)' -./pngmeta -soif -quiet ctzn0g04.png | diff -c test2.xpt - +INPUT=ctzn0g04.png +OUTPUT=test2.xpt + +for dir in . ..; do + if [ -r $dir/$OUTPUT ]; then + break; + fi +done +here=`pwd` +cd $dir && $here/pngmeta -soif -quiet $INPUT | diff -c $OUTPUT - @@ -1,3 +1,12 @@ #!/bin/sh echo 'Testing HTML output' -./pngmeta -html -quiet 8859.png | diff -c test3.xpt - +INPUT=8859.png +OUTPUT=test3.xpt + +for dir in . ..; do + if [ -r $dir/$OUTPUT ]; then + break; + fi +done +here=`pwd` +cd $dir && $here/pngmeta -html -quiet $INPUT | diff -c $OUTPUT - @@ -1,22 +1,23 @@ -<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2//EN'> -<HTML> -<HEAD> -<TITLE>Metadata for 8859.png</TITLE> -</HEAD> -<BODY> -<H1>Metadata for 8859.png</H1> -<DL> - <DT>Title</DT> - <DD><P>ISO 8859-1 characters</P></DD> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'blah'> +<html> +<head> +<title>Metadata for 8859.png</title> +</head> +<body> - <DT>Description</DT> - <DD><P>Here are all the printable characters from the +<h1>Metadata for 8859.png</h1> +<dl> + <dt>Title<br /></dt> + <dd>ISO 8859-1 characters</dd> + + <dt>Description<br /></dt> + <dd>Here are all the printable characters from the ISO Latin-1 coded character set: hex codes 20 to 7E and A0 to FF. That includes a space (20) and a -non-breaking space (A0).</P></DD> +non-breaking space (A0).</dd> - <DT>Test data</DT> - <DD><P>! " # $ % & ' ( ) * + , - . / + <dt>Test data<br /></dt> + <dd>! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ @@ -29,11 +30,11 @@ p q r s t u v w x y z { | } ~ Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ -</P></DD> +</dd> -</DL> +</dl> -<SMALL>Created by pngmeta V1.10</SMALL> +<hr /><small>Created by pngmeta V1.11</small> -</BODY> -</HTML> +</body> +</html> @@ -1,3 +1,12 @@ #!/bin/sh echo 'Testing RDF/XML output' -./pngmeta -xrdf ct1n0g04.png | diff -c test4.xpt - +INPUT=ct1n0g04.png +OUTPUT=test4.xpt + +for dir in . ..; do + if [ -r $dir/$OUTPUT ]; then + break; + fi +done +here=`pwd` +cd $dir && $here/pngmeta -xrdf -quiet $INPUT | diff -c $OUTPUT - @@ -1,20 +1,20 @@ <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' - xmlns:s='http://www.tasi.ac.uk/rdf/vocab#' + xmlns:png='http://www.w3.org/2000/08/pngmeta#' xmlns:dc='http://purl.org/dc/elements/1.0/'> - <s:Image about="ct1n0g04.png"> + <png:Image about="ct1n0g04.png"> <dc:type>image/png</dc:type> - <s:Title>PngSuite</s:Title> - <s:Author>Willem A.J. van Schaik -(gwillem@ntuvax.ntu.ac.sg)</s:Author> - <s:Copyright>Copyright Willem van Schaik, Singapore 1995</s:Copyright> - <s:Description>A compilation of a set of images created to test the + <png:Title>PngSuite</png:Title> + <png:Author>Willem A.J. van Schaik +(gwillem@ntuvax.ntu.ac.sg)</png:Author> + <png:Copyright>Copyright Willem van Schaik, Singapore 1995</png:Copyright> + <png:Description>A compilation of a set of images created to test the various color-types of the PNG format. Included are black&white, color, paletted, with alpha channel, with transparency formats. All bit-depths allowed according -to the spec are present.</s:Description> - <s:Software>Created on a NeXTstation color using "pnmtopng".</s:Software> - <s:Disclaimer>Freeware.</s:Disclaimer> - </s:Image> +to the spec are present.</png:Description> + <png:Software>Created on a NeXTstation color using "pnmtopng".</png:Software> + <png:Disclaimer>Freeware.</png:Disclaimer> + </png:Image> </rdf:RDF> -<!--Created by pngmeta V1.10 --> +<!--Created by pngmeta V1.11 --> |