etc/services - sync with NetBSD-8
[minix.git] / external / bsd / bind / bind2netbsd
blob0d01a004ecda51273f9034c6c849f938d66174d9
1 #! /bin/sh
3 # $NetBSD: bind2netbsd,v 1.2 2014/03/06 02:12:56 christos Exp $
5 # Copyright (c) 2000 The NetBSD Foundation, Inc.
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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
29 # bind2netbsd: convert a bind tree into a
30 # netbsd bind source tree, under src/external/bsd/bind/dist,
31 # based on bind2netbsd by Bernd Ernesti and changes by Simon Burge
33 # Rough instructions for importing new bind release:
35 # $ cd /some/where/temporary
36 # $ tar xpfz /new/bind/release/tar/file
37 # $ sh /usr/src/external/bsd/bind/dist/bind2netbsd bind-9.x.y `pwd`
38 # $ cd src/external/bsd/bind/dist
39 # $ cvs -d cvs.netbsd.org:/cvsroot import -m "Import bind 9.x.y" src/external/bsd/bind/dist ISC bind-9-x-y
40 # $ cd ../../../../../bind-9.x.y
41 # $ run ./configure
42 # $ run make
43 # - use the binclude4netbsd to create and import the new headers in
44 # /usr/src/external/bsd/bind/include
45 # - check makefiles to see if any extra sources have been added.
46 # - update distrib/sets if necessary.
48 # Note that properly the import message should include a short summary
49 # of changes since the previous import rather than just "Import bind 9.x.y".
52 if [ $# -ne 2 ]; then echo "bind2netbsd src dest"; exit 1; fi
54 r=$1
55 d=$2/src/external/bsd/bind/dist
57 case "$d" in
58 /*)
61 d=`/bin/pwd`/$d
63 esac
65 case "$r" in
66 /*)
69 r=`/bin/pwd`/$r
71 esac
73 echo preparing directory $d
74 rm -rf $d
75 mkdir -p $d
77 ### Copy the files and directories
78 echo copying $r to $d
79 cd $r
80 pax -rw * $d
82 if [ -d $d/libtool.m4 ]
83 then
84 mv $d/libtool.m4 $d/m4
87 ### Remove the $'s around RCS tags
88 cleantags $d
90 ### Add our NetBSD RCS Id
91 find $d -type f -name '*.[chly]' -print | while read c; do
92 sed 1q < $c | grep -q '\$NetBSD' || (
93 echo "/* \$NetBSD\$ */" >/tmp/bind3n$$
94 echo "" >>/tmp/bind3n$$
95 cat $c >> /tmp/bind3n$$
96 mv /tmp/bind3n$$ $c && echo added NetBSD RCS tag to $c
98 done
100 find $d -type f -name '*.[0-9]' -print | while read m; do
101 sed 1q < $m | grep -q '\$NetBSD' || (
102 echo ".\\\" \$NetBSD\$" >/tmp/bind2m$$
103 echo ".\\\"" >>/tmp/bind2m$$
104 cat $m >> /tmp/bind2m$$
105 mv /tmp/bind2m$$ $m && echo added NetBSD RCS tag to $m
107 done
109 find $d -type f -name '*.texi' -print | while read t; do
110 sed "2 s/^/@c \$NetBSD\$\\
111 /" < $t > /tmp/bind4t$$
112 mv /tmp/bind4t$$ $t && echo added NetBSD RCS tag to $t
113 done
115 echo done
117 ### Clean up any CVS directories that might be around.
118 echo "cleaning up CVS residue."
120 cd $d
121 find . -type d -name "CVS" -print | xargs rm -r
123 echo done
125 ### Fixing file and directory permissions.
126 echo "Fixing file/directory permissions."
128 cd $d
129 find . -type f -print | xargs chmod u+rw,go+r
130 find . -type d -print | xargs chmod u+rwx,go+rx
132 echo done
134 exit 0