3 # $NetBSD: ppp2netbsd,v 1.3 2007/09/10 10:35:51 cube Exp $
5 # Copyright (c) 2005 The NetBSD Foundation.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
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.
30 # Execute this at the top of the ppp distribution
33 # cvs import src/dist/pppd MACKERRAS PPP2_4_X
36 UNUSED_DIRS
="common contrib etc.ppp include linux modules solaris scripts"
37 UNUSED_FILES
="Changes-2.3 README.linux README.pppoe README.sol2 configure"
38 UNUSED_FILES
="${UNUSED_FILES} pppd/md[45].* pppd/sha1.* pppd/srp-entry.*"
39 UNUSED_FILES
="${UNUSED_FILES} pppd/sys-linux.c pppd/sys-solaris.c"
40 UNUSED_FILES
="${UNUSED_FILES} pppdump/zlib.* pppdump/ppp-comp.h"
43 GPL_DIRS
="pppd/plugins/pppoatm pppd/plugins/radius pppd/plugins/rp-pppoe"
44 GPL_FILES
="pppd/tdb.* pppd/spinlock.* pppd/plugins/passprompt.c
45 pppd/plugins/winbind.c"
47 echo -n "Removing unwanted stuf... "
48 for obj
in ${UNUSED_DIRS} ${GPL_DIRS} ${UNUSED_FILES} ${GPL_FILES}; do
55 echo -n "Removing Makefiles... "
56 find .
-type f
-name 'Makefile*' |
while read m
; do
63 echo -n "Fixing RCS Ids... "
64 find .
-type f |
while read f
; do
65 sed -e 's/\$\(Id:.*\) \$/\1/' < ${f} > /tmp
/ppp2netbsd.$$
&& \
67 mv /tmp
/ppp2netbsd.$$
${f}
74 echo -n "Adding NetBSD Ids to manpages... "
75 find .
-type f
-name '*.[1-8]' |
while read f
; do
76 (echo ".\\\" \$NetBSD\$"; echo '.\"'; cat ${f}) > /tmp
/ppp2netbsd.$$
&& \
78 mv /tmp
/ppp2netbsd.$$
${f}
83 echo -n "Adding NetBSD Ids to C source files and headers... "
84 find .
-type f
-name '*.[ch]' |
while read f
; do
85 (echo "/* \$NetBSD\$ */"; echo; cat ${f}) \
86 > /tmp
/ppp2netbsd.$$
&& echo -n "${f} " && \
87 mv /tmp
/ppp2netbsd.$$
${f}
92 echo -n "Fixing RCSID references... "
93 find .
-type f
-name '*.c' |
while read f
; do
96 #include <sys/cdefs.h>\
101 __RCSID("\$NetBSD\$");\
110 /^#ifndef[ ]lint$/,/^#endif$/{
112 #include <sys/cdefs.h>
113 /^static const char rcsid\[\] = "/{i\
117 __RCSID("\$NetBSD\$");\
119 };};}' < ${f} > /tmp
/ppp2netbsd.$$
&& echo -n "${f} " && \
120 mv /tmp
/ppp2netbsd.$$
${f}
123 #\(#ifndef[ ]lint\n\)\(static const char rcsid\[\] = .*\)$/\
124 ##include <sys\/cdefs.h>\n\
129 #__RCSID("\$NetBSD\$");\n\