Package: libpng
Version: 1.2.8rel-3
Severity: serious
Tags: patch

Hi,

libpng fails to build when awk is provided by gawk, but builds well when
awk is provided by mawk. See below:

...

awk -F '[\t [\]();]' -v PNGMAJ=0 'BEGIN{printf("PNG12_%s {global:\n",PNGMAJ)}\
{ for (i=1;i+2<=NF;++i)\
        if ($(i)=="PNG_FUNCTION_EXPORT" && $(i+2)=="END")\
                print $(i+1) ";";\
for (i=1;i+1<=NF;++i)\
        if ($(i)=="PNG_DATA_EXPORT")\
                print $(i+1) ";";}\
END{print "local: *; };"}' >libpng.syms.new
awk: warning: escape sequence `\]' treated as plain `]'
rm -f libpng.syms
mv libpng.syms.new libpng.syms
gcc -shared -lz -lm -Wl,-soname,libpng12.so.0 \
-Wl,-version-script,libpng.syms \
-o libpng12.so.0.1.2.8 \
png.pic.o pngset.pic.o pngget.pic.o pngrutil.pic.o pngtrans.pic.o 
pngwutil.pic.o pngread.pic.o pngrio.pic.o pngwio.pic.o pngwrite.pic.o 
pngrtran.pic.o pngwtran.pic.o pngmem.pic.o pngerror.pic.o pngpread.pic.o
/usr/bin/ld:libpng.syms:2: syntax error in VERSION script
collect2: ld returned 1 exit status
make[1]: *** [libpng12.so.0.1.2.8] Error 1
make[1]: Leaving directory `/build/buildd/libpng-1.2.8rel'
make: *** [debian/stamp-makefile-build] Error 2

...

awk is always installed on a Debian system (via base-files), but you
can't be sure which one of mawk and gawk will be installed. As libpng 
use mawk functionalities, you need to build-depends on it, and call mawk
instead of awk.

Please find attached a patch to do that.

I have set the severity of the bug to serious, but as mawk seems to be
the package installed by default on a system, you may want to decrease
the severity of the bug.

Bye,
Aurelien

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.4-1-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
diff -u libpng-1.2.8rel/debian/control libpng-1.2.8rel/debian/control
--- libpng-1.2.8rel/debian/control
+++ libpng-1.2.8rel/debian/control
@@ -2,7 +2,7 @@
 Section: libs
 Priority: optional
 Maintainer: Josselin Mouette <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 4.2), zlib1g-dev, cdbs
+Build-Depends: debhelper (>= 4.2), zlib1g-dev, cdbs, mawk
 Standards-Version: 3.6.2
 
 Package: libpng12-0
diff -u libpng-1.2.8rel/debian/patches/makefile.patch 
libpng-1.2.8rel/debian/patches/makefile.patch
--- libpng-1.2.8rel/debian/patches/makefile.patch
+++ libpng-1.2.8rel/debian/patches/makefile.patch
@@ -35,7 +35,7 @@
  libpng.syms: png.h pngconf.h
        $(CC) $(CFLAGS) -E -DPNG_BUILDSYMS png.h |\
 -      awk -F '[\t [\]();]' 'BEGIN{print "{global:"}\
-+      awk -F '[\t [\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG12_%s 
{global:\n",PNGMAJ)}\
++      mawk -F '[\t [\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG12_%s 
{global:\n",PNGMAJ)}\
        { for (i=1;i+2<=NF;++i)\
                if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
                        print $$(i+1) ";";\

Reply via email to