tcpdump2netbsd revision 1.1.8.2 1 1.1.8.2 yamt #! /bin/sh
2 1.1.8.2 yamt #
3 1.1.8.2 yamt # $NetBSD: tcpdump2netbsd,v 1.1.8.2 2014/05/22 15:51:19 yamt Exp $
4 1.1.8.2 yamt #
5 1.1.8.2 yamt # Copyright (c) 2000 The NetBSD Foundation, Inc.
6 1.1.8.2 yamt # All rights reserved.
7 1.1.8.2 yamt #
8 1.1.8.2 yamt # Redistribution and use in source and binary forms, with or without
9 1.1.8.2 yamt # modification, are permitted provided that the following conditions
10 1.1.8.2 yamt # are met:
11 1.1.8.2 yamt # 1. Redistributions of source code must retain the above copyright
12 1.1.8.2 yamt # notice, this list of conditions and the following disclaimer.
13 1.1.8.2 yamt # 2. Redistributions in binary form must reproduce the above copyright
14 1.1.8.2 yamt # notice, this list of conditions and the following disclaimer in the
15 1.1.8.2 yamt # documentation and/or other materials provided with the distribution.
16 1.1.8.2 yamt #
17 1.1.8.2 yamt # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.1.8.2 yamt # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1.8.2 yamt # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1.8.2 yamt # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.1.8.2 yamt # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1.8.2 yamt # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1.8.2 yamt # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1.8.2 yamt # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1.8.2 yamt # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1.8.2 yamt # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1.8.2 yamt # POSSIBILITY OF SUCH DAMAGE.
28 1.1.8.2 yamt #
29 1.1.8.2 yamt # amd2netbsd: convert an amd source tree into a
30 1.1.8.2 yamt # netbsd amd source tree, under src/dist,
31 1.1.8.2 yamt # based on bind2netbsd by Bernd Ernesti and changes by Simon Burge
32 1.1.8.2 yamt #
33 1.1.8.2 yamt # Rough instructions for importing new amd release:
34 1.1.8.2 yamt #
35 1.1.8.2 yamt # $ cd /some/where/temporary
36 1.1.8.2 yamt # $ tar xpfz /new/amd/release/tar/file
37 1.1.8.2 yamt # $ sh /usr/src/external/bsd/tcpdump/dist/tcpdump2netbsd tcpdump-x.y.z `pwd`
38 1.1.8.2 yamt # $ cd src/dist/am-utils
39 1.1.8.2 yamt # $ cvs -d cvs.netbsd.org:/cvsroot import -m "Import tcpdump x.y.z" src/external/bsd/tcpdump/dist TCPDUMP tcpdump-x_y_z
40 1.1.8.2 yamt # $ cd ../../../tcpdump-x.y.z
41 1.1.8.2 yamt # $ run ./configure
42 1.1.8.2 yamt # copy newly generated config.h with /usr/src/external/bsd/tcpdump/include/config.h
43 1.1.8.2 yamt # - check makefiles to see if any extra sources have been added.
44 1.1.8.2 yamt # - update distrib/sets if necessary.
45 1.1.8.2 yamt
46 1.1.8.2 yamt if [ $# -ne 1 ]; then echo "tcpdump2netbsd src"; exit 1; fi
47 1.1.8.2 yamt
48 1.1.8.2 yamt r=$1
49 1.1.8.2 yamt
50 1.1.8.2 yamt case "$d" in
51 1.1.8.2 yamt /*)
52 1.1.8.2 yamt ;;
53 1.1.8.2 yamt *)
54 1.1.8.2 yamt d=`/bin/pwd`/$d
55 1.1.8.2 yamt ;;
56 1.1.8.2 yamt esac
57 1.1.8.2 yamt
58 1.1.8.2 yamt case "$r" in
59 1.1.8.2 yamt /*)
60 1.1.8.2 yamt ;;
61 1.1.8.2 yamt *)
62 1.1.8.2 yamt r=`/bin/pwd`/$r
63 1.1.8.2 yamt ;;
64 1.1.8.2 yamt esac
65 1.1.8.2 yamt
66 1.1.8.2 yamt ### Remove the $'s around RCS tags
67 1.1.8.2 yamt cleantags $r
68 1.1.8.2 yamt
69 1.1.8.2 yamt ### Clean up any CVS directories that might be around.
70 1.1.8.2 yamt echo "cleaning up CVS residue."
71 1.1.8.2 yamt (
72 1.1.8.2 yamt cd $r
73 1.1.8.2 yamt find . -type d -name "CVS" -print | xargs rm -r
74 1.1.8.2 yamt )
75 1.1.8.2 yamt echo done
76 1.1.8.2 yamt
77 1.1.8.2 yamt ### Fixing file and directory permissions.
78 1.1.8.2 yamt echo "Fixing file/directory permissions."
79 1.1.8.2 yamt (
80 1.1.8.2 yamt cd $r
81 1.1.8.2 yamt find . -type f -print | xargs chmod u+rw,go+r
82 1.1.8.2 yamt find . -type d -print | xargs chmod u+rwx,go+rx
83 1.1.8.2 yamt )
84 1.1.8.2 yamt echo done
85 1.1.8.2 yamt
86 1.1.8.2 yamt exit 0
87