No empty .Rs/.Re
[netbsd-mini2440.git] / usr.bin / less / less2netbsd
blob4261be9c800a2b2943450002c9e5741df21876c9
1 #! /bin/sh
3 # $NetBSD: less2netbsd,v 1.7 2006/10/26 01:30:33 mrg Exp $
5 # Copyright (c) 1996, 2003 Matthew R. Green
6 # All rights reserved.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
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
27 # SUCH DAMAGE.
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
36 r=$1
37 d=$2/less
39 case "$d" in
40 /*)
43 d=`/bin/pwd`/$d
45 esac
47 case "$r" in
48 /*)
51 r=`/bin/pwd`/$r
53 esac
55 echo preparing directory $d
56 rm -rf $d
57 mkdir -p $d; cd $d
58 mkdir -p src/usr.bin/less/less src/usr.bin/less/lesskey src/usr.bin/less/lessecho
60 ### start less ###############################
61 cd $r
62 echo 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
70 mv less.nro less.1
72 ### end less ###############################
74 ### start lesskey ###############################
75 cd $r
76 echo 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 ###############################
87 cd $r
88 echo lessecho:
89 src='lessecho.c'
91 pax -rvw $src $d/src/usr.bin/less/lessecho
93 ### end lesskey ###############################
95 find $d -name '*.[ch]' -print | while read c; do
96 chmod u+w $c
97 done
99 echo done
100 exit 0