summaryrefslogtreecommitdiff
path: root/www/navigator
diff options
context:
space:
mode:
authoratatat <atatat@pkgsrc.org>2004-07-23 03:46:06 +0000
committeratatat <atatat@pkgsrc.org>2004-07-23 03:46:06 +0000
commitaa75780f1495eb270fb24c9a56758ce70f070e19 (patch)
treea9b00633fbb73f0d63d88c95c54dbcac9b987515 /www/navigator
parent4507aebe78cad2ff6cae62ea3383a6d65da548a5 (diff)
downloadpkgsrc-aa75780f1495eb270fb24c9a56758ce70f070e19.tar.gz
Bump i386 packages communicator-4.75 (linux) and communicator-4.80
(bsdi) for i386 to revision 1 after adding scripts that apply tiny binary patches that stop them from closing fd 0 before running "netstat -in". I finally got tired of the warnings from my kernel, so I made the binaries stop doing it.
Diffstat (limited to 'www/navigator')
-rw-r--r--www/navigator/Makefile.common14
-rwxr-xr-xwww/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh70
-rwxr-xr-xwww/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh58
3 files changed, 141 insertions, 1 deletions
diff --git a/www/navigator/Makefile.common b/www/navigator/Makefile.common
index 4905b07f5fc..04aafdaf50e 100644
--- a/www/navigator/Makefile.common
+++ b/www/navigator/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.69 2004/05/11 05:18:59 snj Exp $
+# $NetBSD: Makefile.common,v 1.70 2004/07/23 03:46:06 atatat Exp $
#
# Common include file for communicator and navigator packages
@@ -57,6 +57,7 @@ VENDOR_NAME= Tru64 UNIX
.elif ${MACHINE_ARCH} == "i386" && defined(NS_USE_BSDI)
NS_VERS= 4.75
+PKGREVISION= 1
PKGNAME= ${BINNAME}-${NS_VERS}
PLIST_ARCH= bsdi-i386
DISTUNAME= x86-bsdi-bsd2
@@ -64,7 +65,13 @@ DIST_DIR_NAME= unsupported/bsdi21
WRKNAME= x86-bsdi-bsd2
VENDOR_NAME= BSD/OS 2.1
+BUILD_DEPENDS= binpatch>=1.0:../../pkgtools/binpatch
+post-install:
+ sh ../../www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh \
+ ${LOCALBASE} ${MOZILLA_HOME}/netscape
+
.elif ${MACHINE_ARCH} == "i386"
+PKGREVISION= 1
PLIST_ARCH= linux-i386
DISTUNAME= x86-unknown-linux2.2
DIST_DIR_NAME= supported/linux22
@@ -74,6 +81,11 @@ VENDOR_NAME= Linux 2.2
DEPENDS+= ns-flash>4.0:../../multimedia/ns-flash
. endif
+BUILD_DEPENDS= binpatch>=1.0:../../pkgtools/binpatch
+post-install:
+ sh ../../www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh \
+ ${LOCALBASE} ${MOZILLA_HOME}/netscape
+
.elif ((${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && defined(NS_USE_SUNOS))
. if !exists(/emul/sunos/usr/lib/ld.so)
PKG_FAIL_REASON= "${PKGNAME} requires SunOS libraries - see compat_sunos(8)"
diff --git a/www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh b/www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh
new file mode 100755
index 00000000000..2014b75fd45
--- /dev/null
+++ b/www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# $NetBSD: binpatch-x86-bsdi-bsd2-4.75.sh,v 1.1 2004/07/23 03:46:06 atatat Exp $
+#
+# ------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# Andrew Brown <atatat@NetBSD.org> wrote this file. As long as you
+# retain this notice you can do whatever you want with this stuff.
+# If we meet some day, and you think this stuff is worth it, you can
+# buy me a beer in return.
+# ------------------------------------------------------------------------
+
+PATH=$1/bin:$PATH
+export PATH
+
+# conversion from "386 compact demand paged pure executable" to "ELF
+# 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped"
+# at the same load address so that objdump can disassemble the binary
+# adds 0x34, so keep that in mind. the size below is taken from
+# before the objcopy.
+#
+# % objcopy -I binary -O elf32-i386 -B i386 \
+# --rename-section .data=.text,contents,alloc,load,readonly,code \
+# --adjust-vma 0x1000 netscape
+#
+# % objdump -h netscape
+# netscape: file format elf32-i386
+#
+file=$2
+size=10739712
+
+# % objdump -h netscape
+# Sections:
+# Idx Name Size VMA LMA File off Algn
+# 0 .text 00a3e000 00001000 00001000 00000034 2**0
+# CONTENTS, ALLOC, LOAD, READONLY, CODE
+# ...
+#
+# % objdump -d -j .text netscape
+# ...
+# 76df83: 68 bb 33 a2 00 push $0xa233bb
+# 76df88: e8 57 fd ff ff call 76dce4 <_binary_netscape_start+0x76cce4>
+# 76df8d: 89 c6 mov %eax,%esi
+# ...
+#
+# 0x0076df83 - 0x00001000 (+ 0x00000034) = 0x0076cf83
+#
+# note: 0x34 not added since objcopy added that overhead
+#
+offset=0x0076cf83
+
+# compare the push/call/mov instruction bytes
+#
+compare=68bb33a200e857fdffff89c6
+
+# the push instruction is five bytes long
+#
+skip=5
+
+# five nops will overwrite the call to 0x76dce4
+#
+replace=9090909090
+
+binpatch \
+ file=$file \
+ size=$size \
+ offset=$offset \
+ compare=$compare \
+ skip=$skip \
+ replace=$replace
diff --git a/www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh b/www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh
new file mode 100755
index 00000000000..7cb97e19cb4
--- /dev/null
+++ b/www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# $NetBSD: binpatch-x86-unknown-linux2.2-4.80.sh,v 1.1 2004/07/23 03:46:06 atatat Exp $
+#
+# ------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# Andrew Brown <atatat@NetBSD.org> wrote this file. As long as you
+# retain this notice you can do whatever you want with this stuff.
+# If we meet some day, and you think this stuff is worth it, you can
+# buy me a beer in return.
+# ------------------------------------------------------------------------
+
+PATH=$1/bin:$PATH
+export PATH
+
+# % objdump -h netscape
+# netscape: file format elf32-i386
+#
+file=$2
+size=13823336
+
+# % objdump -h netscape
+# Sections:
+# Idx Name Size VMA LMA File off Algn
+# ...
+# 12 .text 006c77ac 082819e0 082819e0 002399e0 2**4
+# CONTENTS, ALLOC, LOAD, READONLY, CODE
+#
+# % objdump -d -j .text netscape
+# ...
+# 884f3e9: 6a 00 push $0x0
+# 884f3eb: e8 24 06 a3 ff call 0x827fa14
+# 884f3f0: e8 1f 0c a3 ff call 0x8280014
+# ...
+#
+# 0x00884f3e9 - 0x0082819e0 + 0x002399e0 = 0x008073e9
+#
+offset=0x008073e9
+
+# compare the push/call/call instruction bytes
+#
+compare=6a00e82406a3ffe81f0ca3ff
+
+# the push instruction is two bytes long
+#
+skip=2
+
+# five nops will overwrite the call to 0x827fa14
+#
+replace=9090909090
+
+binpatch \
+ file=$file \
+ size=$size \
+ offset=$offset \
+ compare=$compare \
+ skip=$skip \
+ replace=$replace