NetBSD/usr.sbin/dhcpd/dhcp2netbsd

97 lines
3.1 KiB
Bash

#! /bin/sh
#
# $NetBSD
#
# Copyright (c) 1996 Matthew R. Green
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Matthew R. Green.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# dhcp2netbsd: convert a dhcp directory into a netbsd source tree.
if [ $# -ne 2 ]; then echo "dhcp2netbsd src dest"; exit 1; fi
r=$1
d=$2/dhcpd
echo preparing directory $d
rm -rf $d
mkdir -p $d
echo copying tree from $r into $d
cd $r
pax -rw . $d
cd $d
# based on Makefile.dist
echo updating manual page pathnames
perl -pi -e 's#ETCDIR#/etc#g; s#RUNDIR#/var/run#g; s#DBDIR#/var/db#g; ' dhcpd.8
echo creating subdirectories
mkdir dhclient
echo creating Makefile
cat > Makefile<<'__eof_makefile'
# $NetBSD: dhcp2netbsd,v 1.1 1996/10/03 06:57:19 mrg Exp $
# XXX - are these useful for users?
#SUBDIR= dhclient
PROG= dhcpd
SRCS= options.c errwarn.c convert.c tree.c memory.c alloc.c print.c hash.c \
tables.c inet.c dispatch.c bpf.c packet.c raw.c nit.c socket.c dhcpd.c \
dhcp.c bootp.c conflex.c confpars.c db.c
MAN= dhcpd.8 dhcpd.conf.5
.include <bsd.subdir.mk>
.include <bsd.prog.mk>
__eof_makefile
echo creating dhclient Makefile
cat > dhclient/Makefile<<'__eof_dhclient_makefile'
# $NetBSD: dhcp2netbsd,v 1.1 1996/10/03 06:57:19 mrg Exp $
SRCS= dhclient.c options.c errwarn.c convert.c tree.c memory.c alloc.c \
print.c hash.c tables.c inet.c dispatch.c bpf.c packet.c raw.c nit.c \
socket.c
PROG= dhclient
NOMAN= 1
.PATH: ${.CURDIR}/..
.include <bsd.prog.mk>
__eof_dhclient_makefile
echo deleting processed manuals, old BSD includes, configuration program
echo and old translation tools
rm -rf includes configure *.cat? dhcpxlt.c
echo done
exit 0