3 # $NetBSD: less2netbsd,v 1.7 2006/10/26 01:30:33 mrg Exp $
5 # Copyright (c) 1996, 2003 Matthew R. Green
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 # less2netbsd: convert a less source tree into a netbsd less source
30 # tree, under src/usr.bin/less ready for importing. note that you need
31 # to run ./configure to generate defines.h (a bug in less 381's configure
32 # wrongly does not find sigset_t on NetBSD; correct this in defines.h.)
34 if [ $# -ne 2 ]; then echo "less2netbsd src dest"; exit 1; fi
55 echo preparing directory
$d
58 mkdir
-p src
/usr.bin
/less
/less src
/usr.bin
/less
/lesskey src
/usr.bin
/less
/lessecho
60 ### start less ###############################
63 src
="main.c screen.c brac.c ch.c charset.c cmdbuf.c command.c decode.c edit.c filename.c forwback.c help.c ifile.c input.c jump.c line.c linenum.c lsystem.c mark.c optfunc.c option.c opttbl.c os.c output.c position.c prompt.c search.c signal.c tags.c ttyin.c version.c"
64 src
="$src charset.h cmd.h defines.h funcs.h less.h lesskey.h lglob.h option.h pckeys.h position.h regexp.h"
65 src
="$src INSTALL LICENSE NEWS README less.nro"
67 pax
-rvw $src $d/src
/usr.bin
/less
/less
69 cd $d/src
/usr.bin
/less
/less
72 ### end less ###############################
74 ### start lesskey ###############################
77 src
='lesskey.c lesskey.h lesskey.nro'
79 pax
-rvw $src $d/src
/usr.bin
/less
/lesskey
81 cd $d/src
/usr.bin
/less
/lesskey
82 mv lesskey.nro lesskey
.1
84 ### end lesskey ###############################
86 ### start lessecho ###############################
91 pax
-rvw $src $d/src
/usr.bin
/less
/lessecho
93 ### end lesskey ###############################
95 find $d -name '*.[ch]' -print |
while read c
; do