1*84d9c625SLionel Sambuc#! /bin/sh 2*84d9c625SLionel Sambuc# 3*84d9c625SLionel Sambuc# $NetBSD: nvi2netbsd,v 1.1 2013/11/22 16:00:45 christos Exp $ 4*84d9c625SLionel Sambuc# 5*84d9c625SLionel Sambuc# Copyright (c) 2000 The NetBSD Foundation, Inc. 6*84d9c625SLionel Sambuc# All rights reserved. 7*84d9c625SLionel Sambuc# 8*84d9c625SLionel Sambuc# Redistribution and use in source and binary forms, with or without 9*84d9c625SLionel Sambuc# modification, are permitted provided that the following conditions 10*84d9c625SLionel Sambuc# are met: 11*84d9c625SLionel Sambuc# 1. Redistributions of source code must retain the above copyright 12*84d9c625SLionel Sambuc# notice, this list of conditions and the following disclaimer. 13*84d9c625SLionel Sambuc# 2. Redistributions in binary form must reproduce the above copyright 14*84d9c625SLionel Sambuc# notice, this list of conditions and the following disclaimer in the 15*84d9c625SLionel Sambuc# documentation and/or other materials provided with the distribution. 16*84d9c625SLionel Sambuc# 17*84d9c625SLionel Sambuc# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18*84d9c625SLionel Sambuc# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19*84d9c625SLionel Sambuc# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20*84d9c625SLionel Sambuc# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21*84d9c625SLionel Sambuc# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22*84d9c625SLionel Sambuc# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23*84d9c625SLionel Sambuc# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24*84d9c625SLionel Sambuc# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25*84d9c625SLionel Sambuc# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26*84d9c625SLionel Sambuc# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27*84d9c625SLionel Sambuc# POSSIBILITY OF SUCH DAMAGE. 28*84d9c625SLionel Sambuc# 29*84d9c625SLionel Sambuc# based on amd2netbsd, 30*84d9c625SLionel Sambuc# itself based on bind2netbsd by Bernd Ernesti and changes by Simon Burge 31*84d9c625SLionel Sambuc# 32*84d9c625SLionel Sambuc# Rough instructions for importing new nvi release: 33*84d9c625SLionel Sambuc# 34*84d9c625SLionel Sambuc# $ cd /some/where/temporary 35*84d9c625SLionel Sambuc# $ tar xpfz /new/nvi/release/tar/file 36*84d9c625SLionel Sambuc# $ sh /usr/src/external/bsd/nvi/nvi2netbsd nvi-x.y.z `pwd` 37*84d9c625SLionel Sambuc# $ cd src/external/bsd/nvi/dist 38*84d9c625SLionel Sambuc# $ cvs import -m "Import nvi x.y.z" src/external/bsd/nvi/dist NVI nvi-x-y-z 39*84d9c625SLionel Sambuc# $ cd ../../../nvi/build.unix 40*84d9c625SLionel Sambuc# $ run ../dist/configure --with-db_type=db1 --enable-widechar 41*84d9c625SLionel Sambuc# ... to be continued 42*84d9c625SLionel Sambuc# 43*84d9c625SLionel Sambuc 44*84d9c625SLionel Sambucif [ $# -ne 2 ]; then echo "nvi2netbsd src dest"; exit 1; fi 45*84d9c625SLionel Sambuc 46*84d9c625SLionel Sambucr="$1" 47*84d9c625SLionel Sambucd="$2"/src/external/bsd/nvi/dist 48*84d9c625SLionel Sambuc 49*84d9c625SLionel Sambuccase "$d" in 50*84d9c625SLionel Sambuc /*) 51*84d9c625SLionel Sambuc ;; 52*84d9c625SLionel Sambuc *) 53*84d9c625SLionel Sambuc d="`/bin/pwd`/$d" 54*84d9c625SLionel Sambuc ;; 55*84d9c625SLionel Sambucesac 56*84d9c625SLionel Sambuc 57*84d9c625SLionel Sambuccase "$r" in 58*84d9c625SLionel Sambuc /*) 59*84d9c625SLionel Sambuc ;; 60*84d9c625SLionel Sambuc *) 61*84d9c625SLionel Sambuc r="`/bin/pwd`/$r" 62*84d9c625SLionel Sambuc ;; 63*84d9c625SLionel Sambucesac 64*84d9c625SLionel Sambuc 65*84d9c625SLionel Sambucecho preparing directory "$d" 66*84d9c625SLionel Sambucrm -rf "$d" 67*84d9c625SLionel Sambucmkdir -p "$d" 68*84d9c625SLionel Sambuc 69*84d9c625SLionel Sambuc### Copy the files and directories 70*84d9c625SLionel Sambucecho copying "$r" to "$d" 71*84d9c625SLionel Sambuccd "$r" 72*84d9c625SLionel Sambucpax -rw * "$d" 73*84d9c625SLionel Sambuc 74*84d9c625SLionel Sambucecho removing unneeded directories and files 75*84d9c625SLionel Sambuc 76*84d9c625SLionel Sambuc### Remove unneeded files 77*84d9c625SLionel Sambuccd "$d" 78*84d9c625SLionel Sambucrm -f catalog/english.base # we generate it 79*84d9c625SLionel Sambucrm -fr dist/autom4te.cache 80*84d9c625SLionel Sambucrm -f dist/tags 81*84d9c625SLionel Sambucrm -fr docs/html 82*84d9c625SLionel Sambucrm -f docs/*/*.ps docs/*/grohtml* docs/*/*.0 docs/*/*.txt 83*84d9c625SLionel Sambucrm -f common/options_def.h # must be removed: we generate it 84*84d9c625SLionel Sambucrm -fr include compat db.1.85 85*84d9c625SLionel Sambucrm -fr .git 86*84d9c625SLionel Sambuc 87*84d9c625SLionel Sambuccd catalog 88*84d9c625SLionel Sambucfor f in *.base; do 89*84d9c625SLionel Sambuc f2="`echo "$f" | sed -e 's/\.base$//'`" 90*84d9c625SLionel Sambuc rm -f "$f2" "$f2".check 91*84d9c625SLionel Sambucdone 92*84d9c625SLionel Sambuc 93*84d9c625SLionel Sambuccleantags "$d" 94*84d9c625SLionel Sambuc 95*84d9c625SLionel Sambuc### Clean up any CVS directories that might be around. 96*84d9c625SLionel Sambucecho "cleaning up CVS residue." 97*84d9c625SLionel Sambuc( 98*84d9c625SLionel Sambuc cd "$d" 99*84d9c625SLionel Sambuc find . -type d -name "CVS" -print | xargs rm -r 100*84d9c625SLionel Sambuc) 101*84d9c625SLionel Sambucecho done 102*84d9c625SLionel Sambuc 103*84d9c625SLionel Sambuc### Fixing file and directory permissions. 104*84d9c625SLionel Sambucecho "Fixing file/directory permissions." 105*84d9c625SLionel Sambuc( 106*84d9c625SLionel Sambuc cd "$d" 107*84d9c625SLionel Sambuc find . -type f -print | xargs chmod u+rw,go+r 108*84d9c625SLionel Sambuc find . -type d -print | xargs chmod u+rwx,go+rx 109*84d9c625SLionel Sambuc) 110*84d9c625SLionel Sambucecho done 111*84d9c625SLionel Sambuc 112*84d9c625SLionel Sambucexit 0 113