#
# /vol/src/devel/gated/master/gated/Makefile,v 1.22.2.5 1993/07/21 23:11:37 jch Exp
#
# Gated Release 3.0
# Copyright (c) 1990,1991,1992,1993 by Cornell University. All rights reserved.
# Refer to Particulars and other Copyright notices at the end of this file.
#

VERSION:sh	=	test -f src/VERSION && cat src/VERSION || echo beta
VERSION_L:sh	=	test -f src/VERSION && cat src/VERSION | sed \
				-e 's/^R//' \
				-e 's/_/./g' \
				-e 's/Alpha_/ Alpha /' \
				-e 's/Beta_/ Beta /'
TARDIR		=	tar
TMPDIR		=	/tmp
TARNAME		=	gated-${VERSION}
TMPFILE		=	${TMPDIR}/make-gated.$$$$
DISTFILE	=	${TARNAME}.tar.Z
TESTFILE	=	tar/gated.tar.test
TAPE		=	/dev/rmt8
MAILTO		=	nobody
FTPDIR		=	/vol/ftp/pub/gated
LIST		=	people
COMPONENTS	=	util/components.release

gated:	src
	(cd src; make)

true:;

install:	src man install-man
	(cd src; make install)

install-man:
	(cd src; make install-man)

dist-date:	true
	${MAKE} VERSION=${VERSION}-`date +%d%h%y` dist

ftp-date:	dist-date ftp

announce:	ftp ${COMPONENTS}
	-sed 	-e 's/%list%/${LIST}/' \
		-e 's/%release%/${VERSION_L}/' \
		-e 's/%version%/${VERSION}/' \
		< ${COMPONENTS} > ${TMPFILE} ; \
		comp -form ${TMPFILE} ; \
		rm -f ${TMPFILE}
			
ftp:	dist
	cd ${FTPDIR} && rm -f ${TARNAME}*
	mv ${TARDIR}/${TARNAME}* ${FTPDIR}
	cd ${FTPDIR} && chmod 664 ${TARNAME}*
	@if [ -d ${FTPDIR}/.cap ]; then \
		echo "Name=Gated ${VERSION_L} Distribution (Compressed Tar)" \
			> ${FTPDIR}/.cap/${DISTFILE} ; \
		echo 'Type=9' >> ${FTPDIR}/.cap/${DISTFILE} ; \
		cat ${FTPDIR}/.cap/${DISTFILE} ; \
	fi
	
dist:	${TARDIR}/${TARNAME}.tar.Zu
	cd ${TARDIR} ; split ${TARNAME}.tar.Zu ${TARNAME}.tar.Zus.

mail:	${TARDIR}/${TARNAME}.tar.Zu
	mail -s ${TARNAME}.tar.Zu ${MAILTO} < ${TARDIR}/${TARNAME}.tar.Zu

${TARDIR}/${TARNAME}.tar.Zu:	${TARDIR}/${TARNAME}.tar.Z
	cd ${TARDIR} ; uuencode ${TARNAME}.tar.Z ${TARNAME}.tar.Z > ${TARNAME}.tar.Zu
	
${TARDIR}/${TARNAME}.tar.Z:	copyright
	@rm -r -f ${TMPDIR}/${TARNAME}
	@echo "Exporting ${VERSION}"
	@cd ${TMPDIR} ; cvs -Q export -r${VERSION} -d ${TARNAME} gated
	@echo "Adding copyright"
	@find ${TMPDIR}/${TARNAME} -type f -print | util/copyright -d ${TMPDIR}/${TARNAME}
	@echo "Cleaning distribution tree"
	@find ${TMPDIR}/${TARNAME} \( -name \*.save -o -name \*.orig -o -name \*.old -o -name \*~ -o -name _\* \) -print \
		> ${TMPFILE} ; \
		xargs rm < ${TMPFILE} ; \
		rm ${TMPFILE}
	@echo "Setting groups and modes"
	@chgrp -R staff ${TMPDIR}/${TARNAME}
	@chmod -R u=rwX,go=rX ${TMPDIR}/${TARNAME}
	tar cFFf - -C ${TMPDIR} ${TARNAME} | compress -c > ${TARDIR}/${TARNAME}.tar.Z
	@rm -r -f ${TMPDIR}/${TARNAME}

checkout:	true
	cvs checkout -d . gated

version:	true
	@echo ${VERSION} | awk '{ \
		out = version[n = split($$0, version, "_")] + 1 ; \
		while (--n) { out = version[n] "_" out ; } \
		print out ; \
	}' | tee src/VERSION
	@cd src ; cvs commit -m`cat VERSION` VERSION
	@cd src ; ${MAKE} build_depend ; cvs commit -m`cat VERSION` util/Depends
	@cvs tag `cat src/VERSION`

unversion:	true
	@cvs tag -d `cat src/VERSION`
	@echo ${VERSION} | awk '{ \
		out = version[n = split($$0, version, "_")] - 1 ; \
		while (--n) { out = version[n] "_" out ; } \
		print out ; \
	}' | tee src/VERSION

commit:	true
	@cvs commit

copyright:	true
	@cd util; ${MAKE}

#
# ------------------------------------------------------------------------
# 
# 	GateD, Release 3
# 
# 	Copyright (c) 1990,1991,1992,1993 by Cornell University
# 	    All rights reserved.
# 
# 	THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY
# 	EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
# 	LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
# 	AND FITNESS FOR A PARTICULAR PURPOSE.
# 
# 	Royalty-free licenses to redistribute GateD Release
# 	3 in whole or in part may be obtained by writing to:
# 
# 	    GateDaemon Project
# 	    Information Technologies/Network Resources
# 	    200 CCC, Garden Avenue
# 	    Cornell University
# 	    Ithaca, NY  14853-2601  USA
# 
# 	GateD is based on Kirton's EGP, UC Berkeley's routing
# 	daemon	 (routed), and DCN's HELLO routing Protocol.
# 	Development of GateD has been supported in part by the
# 	National Science Foundation.
# 
# 	Please forward bug fixes, enhancements and questions to the
# 	gated mailing list: gated-people@gated.cornell.edu.
# 
# 	Authors:
# 
# 		Jeffrey C Honig <jch@gated.cornell.edu>
# 		Scott W Brim <swb@gated.cornell.edu>
# 
# ------------------------------------------------------------------------
# 
#       Portions of this software may fall under the following
#       copyrights:
# 
# 	Copyright (c) 1988 Regents of the University of California.
# 	All rights reserved.
# 
# 	Redistribution and use in source and binary forms are
# 	permitted provided that the above copyright notice and
# 	this paragraph are duplicated in all such forms and that
# 	any documentation, advertising materials, and other
# 	materials related to such distribution and use
# 	acknowledge that the software was developed by the
# 	University of California, Berkeley.  The name of the
# 	University may not be used to endorse or promote
# 	products derived from this software without specific
# 	prior written permission.  THIS SOFTWARE IS PROVIDED
# 	``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
# 	INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# 	MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
