1999-11-13 02:58:56 +03:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2001-02-11 10:04:20 +03:00
|
|
|
# $NetBSD: bind2netbsd,v 1.16 2001/02/11 07:04:20 itojun Exp $
|
1999-11-13 02:58:56 +03:00
|
|
|
#
|
|
|
|
# Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
# 3. All advertising materials mentioning features or use of this software
|
|
|
|
# must display the following acknowledgement:
|
|
|
|
# This product includes software developed by the NetBSD
|
|
|
|
# Foundation, Inc. and its contributors.
|
|
|
|
# 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
|
|
|
# from this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
# bind2netbsd: convert a bind source tree into a
|
2001-01-27 11:09:42 +03:00
|
|
|
# netbsd bind source tree, under basesrc/dist and basesrc/crypto/dist,
|
1999-11-13 02:58:56 +03:00
|
|
|
|
|
|
|
# Note: you need to extract the src and doc tar files and put it into
|
|
|
|
# one directory. This directory is the 'src' argument of bind2netbsd.
|
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then echo "bind2netbsd src dest"; exit 1; fi
|
|
|
|
|
|
|
|
r=$1
|
|
|
|
d=$2/basesrc/dist/bind
|
2001-01-27 11:09:42 +03:00
|
|
|
dcrypto=$2/basesrc/crypto/dist/bind
|
1999-11-13 02:58:56 +03:00
|
|
|
|
|
|
|
case "$d" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
d=`/bin/pwd`/$d
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$r" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
r=`/bin/pwd`/$r
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo preparing directory $d
|
|
|
|
rm -rf $d
|
2000-04-28 07:34:00 +04:00
|
|
|
mkdir -p $d
|
1999-11-14 19:37:20 +03:00
|
|
|
mkdir -p $d/man
|
2000-04-28 07:37:55 +04:00
|
|
|
mkdir -p $d/doc
|
2001-01-27 11:09:42 +03:00
|
|
|
mkdir -p $dcrypto/lib
|
1999-11-13 02:58:56 +03:00
|
|
|
|
1999-11-14 19:37:20 +03:00
|
|
|
### Copy the files and directories
|
1999-11-13 02:58:56 +03:00
|
|
|
cd $r/src
|
2001-02-11 10:04:20 +03:00
|
|
|
pax -rvw LICENSE LICENSE_RSA README Version bin include lib $d
|
1999-11-20 21:21:56 +03:00
|
|
|
cd $r/src/port/netbsd/include
|
1999-11-18 00:18:03 +03:00
|
|
|
pax -rvw port_after.h port_before.h prand_conf.h $d/include
|
1999-11-20 21:21:56 +03:00
|
|
|
cd $r/src/port/netbsd/bin
|
1999-11-18 00:18:03 +03:00
|
|
|
pax -rvw probe_ipv6 $d/bin
|
1999-11-13 02:58:56 +03:00
|
|
|
cd $r/doc/man
|
1999-11-20 21:05:24 +03:00
|
|
|
pax -rvw dig.1 dnskeygen.1 dnsquery.1 host.1 named-bootconf.8 named-xfer.8 named.8 named.conf.5 ndc.8 nslookup.8 nsupdate.8 $d/man
|
2000-04-28 07:34:00 +04:00
|
|
|
cd $r/doc
|
2000-04-28 07:37:55 +04:00
|
|
|
pax -rvw bog $d/doc
|
|
|
|
cd $d/doc/bog
|
2000-04-28 07:34:00 +04:00
|
|
|
make clean
|
1999-11-13 02:58:56 +03:00
|
|
|
|
2001-01-27 11:09:42 +03:00
|
|
|
### Remove lib/bsd
|
1999-11-14 19:37:20 +03:00
|
|
|
cd $d/lib
|
2001-01-27 11:09:42 +03:00
|
|
|
rm -r bsd
|
1999-11-14 19:37:20 +03:00
|
|
|
|
2000-11-10 12:23:42 +03:00
|
|
|
### Remove yacc/lex-generated files
|
|
|
|
cd $d/bin
|
2000-11-10 12:51:03 +03:00
|
|
|
rm -f named/ns_parser.c named/ns_parser.h
|
2000-11-10 12:23:42 +03:00
|
|
|
rm -f nslookup/commands.c
|
|
|
|
|
1999-11-14 19:37:20 +03:00
|
|
|
### Remove .cvsignore, Makefiles and *.mdoc files
|
1999-11-13 02:58:56 +03:00
|
|
|
find $d -name '.cvsignore' -exec rm {} \;
|
|
|
|
find $d -name 'Makefile' -exec rm {} \;
|
|
|
|
cd $d/lib/isc && rm *.mdoc
|
|
|
|
|
2000-11-10 12:23:42 +03:00
|
|
|
### Remove the $'s around the Header:
|
|
|
|
find $d -type f -print | while read f; do
|
|
|
|
sed -e ' s/\$\(Header.*\) \$/\1/' < $f > /tmp/bind1f$$ && mv /tmp/bind1f$$ $f && \
|
|
|
|
echo removed \$Header tag from $f
|
|
|
|
done
|
|
|
|
|
1999-11-20 21:21:56 +03:00
|
|
|
### Remove the $'s around the Id:
|
|
|
|
find $d -type f -print | while read f; do
|
|
|
|
sed -e ' s/\$\(Id.*\) \$/\1/' < $f > /tmp/bind1f$$ && mv /tmp/bind1f$$ $f && \
|
|
|
|
echo removed \$Id tag from $f
|
|
|
|
done
|
|
|
|
|
|
|
|
### Add our NetBSD RCS Id
|
1999-11-13 02:58:56 +03:00
|
|
|
find $d -name '*.[chly]' -print | while read c; do
|
|
|
|
sed 1q < $c | grep -q '\$NetBSD' || (
|
1999-11-14 19:27:08 +03:00
|
|
|
echo "/* \$NetBSD\$ */" >/tmp/bind3n$$
|
|
|
|
echo "" >>/tmp/bind3n$$
|
1999-11-13 02:58:56 +03:00
|
|
|
cat $c >> /tmp/bind3n$$
|
|
|
|
mv /tmp/bind3n$$ $c && echo added RCS tag to $c
|
|
|
|
)
|
|
|
|
done
|
|
|
|
|
|
|
|
find $d/man -name '*.[0-9]' -print | while read m; do
|
|
|
|
sed 1q < $m | grep -q '\$NetBSD' || (
|
1999-11-14 19:27:08 +03:00
|
|
|
echo ".\\\" \$NetBSD\$" >/tmp/bind2m$$
|
|
|
|
echo ".\\\"" >>/tmp/bind2m$$
|
1999-11-13 02:58:56 +03:00
|
|
|
cat $m >> /tmp/bind2m$$
|
|
|
|
mv /tmp/bind2m$$ $m && echo added RCS tag to $m
|
|
|
|
|
|
|
|
sed -e "s/@INDOT@//g" -e "s/@INDOT_U@//g" \
|
|
|
|
-e "s/@XFER_INDOT@//g" -e "s/@XFER_INDOT_U@//g" \
|
|
|
|
-e "s/@CMD_EXT@/1/g" -e "s/@CMD_EXT_U@/1/g" \
|
|
|
|
-e "s/@LIB_NETWORK_EXT@/3/g" -e "s/@LIB_NETWORK_EXT_U@/3/g" \
|
|
|
|
-e "s/@FORMAT_EXT@/5/g" -e "s/@FORMAT_EXT_U@/5/g" \
|
|
|
|
-e "s/@DESC_EXT@/7/g" -e "s/@DESC_EXT_U@/7/g" \
|
|
|
|
-e "s/@SYS_OPS_EXT@/8/g" -e "s/@SYS_OPS_EXT_U@/8/g" \
|
|
|
|
-e "s/@SYSCALL_EXT@/2/g" -e "s/@SYSCALL_EXT_U@/2/g" \
|
|
|
|
-e "s/@BSD_SYSCALL_EXT@/2/g" -e "s/@BSD_SYSCALL_EXT_U@/2/g" \
|
|
|
|
-e "s/@LIB_C_EXT@/3/g" -e "s/@LIB_C_EXT_U@/3/g" < $m > /tmp/bind3m$$ && \
|
|
|
|
mv /tmp/bind3m$$ $m && echo fixup $m
|
|
|
|
)
|
|
|
|
done
|
|
|
|
|
2000-04-28 07:37:55 +04:00
|
|
|
find $d/doc/bog -type f -print | while read m; do
|
2000-04-28 07:34:00 +04:00
|
|
|
sed 1q < $m | grep -q '\$NetBSD' || (
|
|
|
|
echo ".\\\" \$NetBSD\$" >/tmp/bind2m$$
|
|
|
|
echo ".\\\"" >>/tmp/bind2m$$
|
|
|
|
cat $m >> /tmp/bind2m$$
|
|
|
|
mv /tmp/bind2m$$ $m && echo added RCS tag to $m
|
|
|
|
)
|
|
|
|
done
|
|
|
|
|
1999-11-20 21:21:56 +03:00
|
|
|
# XXX Not all files contains now the NetBSD RCS Id.
|
|
|
|
# Make sure you add the RCS Id before you do the import.
|
|
|
|
# This is the list of missing files as of 8.2.2-P5:
|
|
|
|
# LICENSE
|
2000-11-10 12:41:14 +03:00
|
|
|
# LICENSE_RSA
|
1999-11-20 21:21:56 +03:00
|
|
|
# README
|
|
|
|
# bin/probe_ipv6
|
|
|
|
# bin/irpd/irs-irpd.conf
|
|
|
|
# bin/named/named.conf
|
|
|
|
# bin/named/test/127.0.0.zone
|
|
|
|
# bin/named/test/localhost.zone
|
|
|
|
# bin/named/test/named.conf
|
|
|
|
# bin/named/test/root.hint
|
|
|
|
# bin/named-bootconf/Grot/named-bootconf.pl
|
|
|
|
# bin/nslookup/nslookup.help
|
|
|
|
# lib/dst/README
|
|
|
|
# lib/irs/Makefile.BSD
|
|
|
|
# lib/irs/README
|
|
|
|
|
1999-11-13 02:58:56 +03:00
|
|
|
echo done
|
|
|
|
|
|
|
|
### Clean up any CVS directories that might be around.
|
|
|
|
echo "cleaning up CVS residue."
|
|
|
|
(
|
|
|
|
cd $d
|
|
|
|
find . -type d -name "CVS" -print | xargs rm -r
|
|
|
|
)
|
|
|
|
echo done
|
|
|
|
|
|
|
|
### Fixing file and directory permissions.
|
|
|
|
echo "Fixing file/directory permissions."
|
|
|
|
(
|
|
|
|
cd $d
|
|
|
|
find . -type f -print | xargs chmod u+rw,go+r
|
|
|
|
find . -type d -print | xargs chmod u+rwx,go+rx
|
|
|
|
)
|
|
|
|
echo done
|
|
|
|
|
2001-01-27 11:09:42 +03:00
|
|
|
echo "Split crypto source code."
|
|
|
|
(
|
|
|
|
#mv $d/lib/cylink $dcrypto/lib
|
|
|
|
#mv $d/lib/dnssafe $dcrypto/lib
|
|
|
|
)
|
|
|
|
echo done
|
|
|
|
|
1999-11-13 02:58:56 +03:00
|
|
|
exit 0
|