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