1#!/bin/sh
2#
3# Use this script to update the bind include files used in the nameserver,
4# after you've imported and built the latest libbind code. After you run this,
5# cvs import the resulting directory
6#
7# $ cd /usr/src/external/bsd/libbind/dist
8# $ ./include4netbsd . /tmp/include
9# $ cd /tmp/include
10# $ cvs -d cvs.netbsd.org:/cvsroot import src/include ISC libbind-X-Y-Z
11#
12
13PROG=$(basename $0)
14if [ \( -z "$1" \) -o \( -z "$2" \) ]
15then
16          echo "Usage: $PROG <libbind-src> <include-dest>" 1>&2
17          exit 1
18fi
19
20LIBBIND=$1
21INCLUDE=$2
22
23mkdir -p $INCLUDE
24
25copy()
26{
27          sed -e 's/ __P((/(/g' \
28              -e 's/));/);/g' \
29              -e 's/u_int\([136]\)/uint\1/g' \
30              -e '/\\file/d' \
31              < "$1" > "$2"
32}
33
34for i in netdb.h res_update.h resolv.h
35do
36          copy $LIBBIND/include/$i $INCLUDE/$i
37done
38
39mkdir -p $INCLUDE/arpa
40
41for i in inet.h nameser.h nameser_compat.h
42do
43          copy $LIBBIND/include/arpa/$i $INCLUDE/arpa/$i
44done
45