[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
w3m package
おはようございます。
w3mのパッケージを作ってみました。
現在は./configureに引数を与えるのにshのreadをpatchファイルで
つぶして決め打ちしちゃっています。
何か美しい方法はありませんか。
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# w3m
# w3m/files
# w3m/files/md5
# w3m/Makefile
# w3m/patches
# w3m/patches/patch-aa
# w3m/patches/patch-ab
# w3m/pkg
# w3m/pkg/COMMENT
# w3m/pkg/DESCR
# w3m/pkg/PLIST
#
echo c - w3m
mkdir -p w3m > /dev/null 2>&1
echo c - w3m/files
mkdir -p w3m/files > /dev/null 2>&1
echo x - w3m/files/md5
sed 's/^X//' >w3m/files/md5 << 'END-of-w3m/files/md5'
X# $NetBSD$
X
XMD5 (w3m-990406.tar.gz) = 52db22cc449ef5419c9c3fbb4a1425c6
END-of-w3m/files/md5
echo x - w3m/Makefile
sed 's/^X//' >w3m/Makefile << 'END-of-w3m/Makefile'
X# $NetBSD$
X
XDISTNAME= w3m-990406
XCATEGORIES= www
XMASTER_SITES= ftp://ei5nazha.yz.yamagata-u.ac.jp/w3m/
X
XMAINTAINER= packages@netbsd.org
XHOMEPAGE= http://ei5nazha.yz.yamagata-u.ac.jp/~aito/w3m/
X
XWRKSRC= ${WRKDIR}/w3m
X
X# XXX I tested it on sparc and macppc also, but failed since Boehm-GC support
X# is missing. Though sparc should work with Boehm-GC in our package, I didn't
X# try further. Supporting ELF systems may be harder.
X
XONLY_FOR_ARCHS= i386 m68k
X
XHAS_CONFIGURE= yes
X
XCONFIGURE_ENV= PREFIX=${PREFIX} # need on 1.3.X
X
X.include "../../mk/bsd.pkg.mk"
END-of-w3m/Makefile
echo c - w3m/patches
mkdir -p w3m/patches > /dev/null 2>&1
echo x - w3m/patches/patch-aa
sed 's/^X//' >w3m/patches/patch-aa << 'END-of-w3m/patches/patch-aa'
X# $NetBSD$
X
XIndex: configure
X===================================================================
XRCS file: /cvsroot/w3m/configure,v
Xretrieving revision 1.1.1.1
Xdiff -u -r1.1.1.1 configure
X--- configure 1999/04/12 15:31:36 1.1.1.1
X+++ configure 1999/04/12 16:18:02
X@@ -83,30 +83,31 @@
X special_sys="#define CYGWIN"
X fi
X
X-if [ -z "$def_bindir" ]; then
X- def_bindir="/usr/local/bin"
X-fi
X+#if [ -z "$def_bindir" ]; then
X+ def_bindir="${PREFIX}/bin"
X+#fi
X echo "Which directory do you want to put the binary?"
X Echo "(default: $def_bindir) "
X-readdir
X-bindir=$_dir
X-if [ -z "$bindir" ]; then
X+#readdir
X+#bindir=$_dir
X+#if [ -z "$bindir" ]; then
X bindir=$def_bindir
X-fi
X+#fi
X echo "def_bindir=$bindir" >> config.param
X
X-if [ -z "$def_helpdir" ]; then
X- def_helpdir="/usr/local/lib"
X-fi
X+#if [ -z "$def_helpdir" ]; then
X+ def_helpdir="${PREFIX}/lib"
X+#fi
X echo "Which directory do you want to put the helpfile?"
X Echo "(default: $def_helpdir) "
X-readdir
X-helpdir=$_dir
X-if [ -z "$helpdir" ]; then
X+#readdir
X+#helpdir=$_dir
X+#if [ -z "$helpdir" ]; then
X helpdir=$def_helpdir
X-fi
X+#fi
X echo "def_helpdir=$helpdir" >> config.param
X
X+def_dcode=n
X echo "Input your display kanji code."
X echo " S - Shift JIS"
X echo " E - EUC-JP"
X@@ -121,10 +122,10 @@
X Echo "(default: $def_dcode) "
X fi
X Echo "Which? "
X- read ncode
X- if [ -n "$def_dcode" -a -z "$ncode" ] ; then
X+# read ncode
X+# if [ -n "$def_dcode" -a -z "$ncode" ] ; then
X ncode=$def_dcode
X- fi
X+# fi
X if [ -z "`echo $ncode | grep '[SEjNnm]'`" ] ; then
X Echo "Illegal code. Try again."
X continue
X@@ -133,6 +134,7 @@
X done
X echo "def_dcode=$ncode" >> config.param
X
X+lynx_key=n
X echo "Do you want to use Lynx-like key binding?"
X if [ "$lynx_key" = y ]; then
X Echo '[y]? '
X@@ -142,7 +144,7 @@
X fi
X else
X Echo '[n]? '
X- read ks_ans
X+# read ks_ans
X if [ "$ks_ans" = 'y' ]; then
X lynx_key=y
X else
X@@ -158,9 +160,10 @@
X
X
X echo "Do you want to use 2-byte character for table border, item, etc."
X+kanji_symbols=n
X if [ "$kanji_symbols" = n ]; then
X Echo '[n]? '
X- read ks_ans
X+# read ks_ans
X if [ "$ks_ans" = 'y' ]; then
X kanji_symbols=y
X fi
X@@ -180,6 +183,7 @@
X def_kanji_symbols="#undef KANJI_SYMBOLS"
X fi
X
X+use_color=y
X echo "Do you want to use color ESC sequence for kterm/pxvt "
X if [ "$use_color" = n ]; then
X Echo '[n]? '
X@@ -189,7 +193,7 @@
X fi
X else
X Echo '[y]? '
X- read ks_ans
X+# read ks_ans
X if [ "$ks_ans" = 'n' ]; then
X use_color='n'
X else
X@@ -203,6 +207,7 @@
X def_color="#undef COLOR"
X fi
X
X+pref_lang=2
X echo "Which language do you prefer?"
X echo " 1 - Japanese"
X echo " 2 - English"
X@@ -215,7 +220,7 @@
X fi
X while :
X do
X- read lg_ans
X+# read lg_ans
X if [ -z "$lg_ans" ]; then
X lg_ans=$def_lg
X elif [ "$lg_ans" != 1 -a "$lg_ans" != 2 ]; then
X@@ -239,8 +244,8 @@
X if [ -n "`echo $ded | grep 'no'`" ] ; then ded=vi ; fi
X echo "Input your favorite editor program."
X Echo "(Default: $ded) "
X-readdir
X-editor=$_dir
X+#readdir
X+#editor=$_dir
X if [ -z "$editor" ] ; then editor="$ded" ; fi
X echo "ded='$editor'" >> config.param
X
X@@ -255,8 +260,8 @@
X fi
X echo "Input your favorite mailer program."
X Echo "(Default: $dmail) "
X-readdir
X-mailer=$_dir
X+#readdir
X+#mailer=$_dir
X if [ -z "$mailer" ] ; then mailer="$dmail" ; fi
X echo "dmail='$mailer'" >> config.param
X
X@@ -275,8 +280,8 @@
X fi
X echo "Input your favorite external browser program."
X Echo "(Default: $dbrowser) "
X-readdir
X-brz=$_dir
X+#readdir
X+#brz=$_dir
X if [ -z "$brz" ] ; then brz="$dbrowser" ; fi
X echo "dbrowser='$brz'" >> config.param
X
X@@ -290,14 +295,15 @@
X fi
X echo "Input your favorite C-compiler."
X Echo "(Default: $dcc) "
X-read cc
X+#read cc
X if [ -z "$cc" ] ; then cc="$dcc" ; fi
X echo "dcc='$cc'" >> config.param
X
X+dcflags="-g -O"
X if [ -z "$dcflags" ] ; then dcflags=-g ; fi
X echo "Input your favorite C flags."
X Echo "(Default: $dcflags) "
X-read cflags
X+#read cflags
X if [ -z "$cflags" ] ; then cflags="$dcflags" ; fi
X echo "dcflags='$cflags'" >> config.param
X
X@@ -323,7 +329,7 @@
X
X for lib in termcap termlib terminfo mytinfo curses ncurses
X do
X- for libdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib
X+ for libdir in /lib /usr/lib ${PREFIX}/lib /usr/ucblib /usr/ccslib /usr/ccs/lib
X do
X if [ -f $libdir/lib$lib.a -o -f $libdir/lib$lib.so ] ; then
X # check if the lib works...
X@@ -345,7 +351,7 @@
X echo "Which terminal library do you want to use?"
X Echo "(default: $termlib) "
X dtermlib=$termlib
X-read termlib
X+#read termlib
X if [ -z "$termlib" ]; then
X termlib=$dtermlib
X fi
X@@ -353,7 +359,7 @@
X extlib=''
X for lib in bsd BSD socket nsl
X do
X- for libdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib
X+ for libdir in /lib /usr/lib ${PREFIX}/lib /usr/ucblib /usr/ccslib /usr/ccs/lib
X do
X if [ -f $libdir/lib$lib.a ] ; then
X extlib="$extlib -l$lib"
X@@ -370,14 +376,14 @@
X gclib=''
X gcinclude=''
X gctarget=''
X-for libdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib ${HOME}/lib
X+for libdir in /lib /usr/lib ${PREFIX}/lib /usr/ucblib /usr/ccslib /usr/ccs/lib ${HOME}/lib
X do
X if [ -f $libdir/libgc.a -o -f $libdir/libgc.so ] ; then
X echo $libdir/libgc found
X gclib="-lgc"
X fi
X done
X-for inc in /usr/include /usr/include/gc /usr/local/include /usr/local/include/gc ${HOME}/include
X+for inc in /usr/include /usr/include/gc ${PREFIX}/include ${PREFIX}/include/gc ${HOME}/include
X do
X if [ -f $inc/gc.h ]; then
X echo $inc/gc.h found
X@@ -403,7 +409,7 @@
X if [ $gcversion -lt $mygcversion ]; then
X echo "GC library on your system seems to be old."
X Echo "Do you want to use GC library comes with w3m?[y] "
X- read ans
X+ #read ans
X if [ "$ans" = 'n' -o "$ans" = 'N' ]; then
X cflags="$cflags -I$gcinclude"
X else
X@@ -433,7 +439,7 @@
X else
X Echo ": "
X fi
X-read ldflags
X+#read ldflags
X if [ -z "$ldflags" ]; then
X ldflags=$dldflags
X fi
X@@ -802,7 +808,7 @@
X #define DEF_EDITOR "$editor"
X #define DEF_MAILER "$mailer"
X #define DEF_EXT_BROWSER "$brz"
X-#define HELP_FILE "$helpdir/w3mhelp.html"
X+#define HELP_FILE "${helpdir}/w3mhelp.html"
X #define BOOKMARK "~/.w3m/bookmark.html"
X
X $term_if
END-of-w3m/patches/patch-aa
echo x - w3m/patches/patch-ab
sed 's/^X//' >w3m/patches/patch-ab << 'END-of-w3m/patches/patch-ab'
X# $NetBSD$
X
XIndex: rc.c
X===================================================================
XRCS file: /cvsroot/w3m/rc.c,v
Xretrieving revision 1.1.1.1
Xdiff -u -r1.1.1.1 rc.c
X--- rc.c 1999/04/12 15:31:36 1.1.1.1
X+++ rc.c 1999/04/12 16:58:41
X@@ -57,7 +57,7 @@
X #define CMT_NO_PROXY "Domains for direct access (no proxy)"
X #define CMT_DROOT "Directory corresponds to / (document root)"
X #define CMT_PDROOT "Directory corresponds to /~user"
X-#define CMT_CGIBUN "Directory corresponds to /cgi-bin"
X+#define CMT_CGIBIN "Directory corresponds to /cgi-bin"
X #define CMT_CONFIRM_QQ "Confirm when quitting with q"
X #define CMT_EDITOR "Editor"
X #define CMT_MAILER "Mailer"
END-of-w3m/patches/patch-ab
echo c - w3m/pkg
mkdir -p w3m/pkg > /dev/null 2>&1
echo x - w3m/pkg/COMMENT
sed 's/^X//' >w3m/pkg/COMMENT << 'END-of-w3m/pkg/COMMENT'
XA terminal-based WWW browser with HTML tables and frames support.
END-of-w3m/pkg/COMMENT
echo x - w3m/pkg/DESCR
sed 's/^X//' >w3m/pkg/DESCR << 'END-of-w3m/pkg/DESCR'
XW3m is a termial-based WWW browser which supports HTML tables and frames. It's
Xsmall, so faster than other WWW browsers.
X
XIt uses Boehm-GC to implement the table/frame parser.
END-of-w3m/pkg/DESCR
echo x - w3m/pkg/PLIST
sed 's/^X//' >w3m/pkg/PLIST << 'END-of-w3m/pkg/PLIST'
Xbin/w3m
Xlib/w3mhelp_en.html
Xlib/w3mhelp_ja.html
Xlib/w3mhelp.html
END-of-w3m/pkg/PLIST
exit