# SKIP Source Code License Statement:
# ------------------------------------------------------------------
#   Copyright
#   Sun Microsystems, Inc.
# 
# 
#   Copyright (C) 1994, 1995, 1996 Sun Microsystems, Inc.  All Rights
#   Reserved.
# 
#   Permission is hereby granted, free of charge, to any person
#   obtaining a copy of this software and associated documentation
#   files (the "Software"), to deal in the Software without
#   restriction, including without limitation the rights to use,
#   copy, modify, merge, publish, distribute, sublicense, and/or sell
#   copies of the Software or derivatives of the Software, and to 
#   permit persons to whom the Software or its derivatives is furnished 
#   to do so, subject to the following conditions:
# 
#   The above copyright notice and this permission notice shall be
#   included in all copies or substantial portions of the Software.
# 
#   The Software must not be transferred to persons who are not US
#   citizens or permanent residents of the US or exported outside
#   the US (except Canada) in any form (including by electronic
#   transmission) without prior written approval from the US
#   Government. Non-compliance with these restrictions constitutes
#   a violation of the U.S. Export Control Laws.
# 
#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
#   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
#   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
#   NONINFRINGEMENT.  IN NO EVENT SHALL SUN MICROSYSTEMS, INC., BE LIABLE
#   FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
#   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
#   CONNECTION WITH THE SOFTWARE OR DERIVATES OF THIS SOFTWARE OR 
#   THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# 
#   Except as contained in this notice, the name of Sun Microsystems, Inc.
#   shall not be used in advertising or otherwise to promote
#   the sale, use or other dealings in this Software or its derivatives 
#   without prior written authorization from Sun Microsystems, Inc.
#
# ident "@(#)Makefile	1.45 96/10/25"
#
# Makefile for SunOS 4.x SKIP packaging
#

include ../../Makefile.defs

#------------------------- ENVIRONMENT---------------------------
BLD_DIR=../..
4BIN=4bin.sun4
4XPROTO=$(4BIN)/skip
DEPENDS= $(BLD_DIR)/admin/remove.skip \
	$(BLD_DIR)/admin/SunICG_CA_selfcert \
	$(BLD_DIR)/admin/dh_params \
	$(BLD_DIR)/admin/skipd.conf \
	$(BLD_DIR)/admin/hosts.4.x \
	$(BLD_DIR)/admin/install_skip_keys.sh \
	$(BLD_DIR)/admin/skipif.sh \
	$(BLD_DIR)/admin/skipd_restart.sh \
	$(BLD_DIR)/admin/skip_conf.sh \
	$(BLD_DIR)/doc/SKIP_SOFTWARE_LICENSE \
	$(BLD_DIR)/doc/BN_SOFTWARE_LICENSE \
	$(BLD_DIR)/doc/README.PATENT \
	$(BLD_DIR)/doc/00README \
	$(BLD_DIR)/doc/INSTALL \
	$(BLD_DIR)/doc/advanced.TOPICS \
	$(BLD_DIR)/doc/usersguide.txt \
	$(BLD_DIR)/doc/usersguide.html \
	$(BLD_DIR)/doc/usersguide.ps \
	$(BLD_DIR)/doc/inet-95.ps \
	$(BLD_DIR)/skip/man/certreq.1m \
	$(BLD_DIR)/skip/man/skiphost.1m \
	$(BLD_DIR)/skip/man/skipstat.1m \
	$(BLD_DIR)/skip/man/skiptool.1m \
	$(BLD_DIR)/skip/man/skipd.1m \
	$(BLD_DIR)/skip/man/skipdb.1m \
	$(BLD_DIR)/skip/man/skipca.1m \
	$(BLD_DIR)/skip/man/skiplocal.1m \
	$(BLD_DIR)/skip/man/install_skip_keys.1m \
	$(BLD_DIR)/skip/man/skipd_restart.1m \
	$(BLD_DIR)/skip/man/skip_conf.1m \
	$(BLD_DIR)/skip/man/skipif.1m \
	$(BLD_DIR)/skip/man/skiplog.1m \
	$(BLD_DIR)/skip/man/skipd.conf.4 \
	$(BLD_DIR)/skip/man/raw_keys.4 \
	$(BLD_DIR)/certs/man/print_cert.1m \
	$(BLD_DIR)/skip/sunos/rc \
	$(BLD_DIR)/skip/sunos/skip.mkdev \
	$(BLD_DIR)/skip/sunos/install.skip

#	$(BLD_DIR)/doc/usersguide.ps \
#----------------------------------------------------------------

all: 4bin

4bin: $(DEPENDS)
	rm -rf $(4XPROTO)
	$(INSTALL) -d -m 0775 $(4XPROTO)/etc
	$(INSTALL) -d -m 0775 $(4XPROTO)/drv
	$(INSTALL) -d -m 0775 $(4XPROTO)/drv/sun4m
	$(INSTALL) -d -m 0775 $(4XPROTO)/drv/sun4c
	$(INSTALL) -d -m 0775 $(4XPROTO)/man
	$(INSTALL) -d -m 0775 $(4XPROTO)/man/man1
	$(INSTALL) -d -m 0775 $(4XPROTO)/man/man4
	$(INSTALL) -d -m 0775 $(4XPROTO)/bin
	$(INSTALL) -d -m 0775 $(4XPROTO)/doc

	$(INSTALL) -m 0555 $(BLD_DIR)/skip/sunos/install.skip \
					$(4XPROTO)/install.skip
	$(INSTALL) -m 0555 $(BLD_DIR)/admin/remove.skip	 \
					$(4XPROTO)/remove.skip

	@echo "Initializing skip/etc directory"
	$(INSTALL) -m 0444 $(BLD_DIR)/admin/SunICG_CA_selfcert \
		$(4XPROTO)/etc/SunICG_CA_selfcert
	$(INSTALL) -m 0444 $(BLD_DIR)/admin/dh_params \
		$(4XPROTO)/etc/dh_params
	$(INSTALL) -m 0444 $(BLD_DIR)/skip/sunos/rc \
		$(4XPROTO)/etc/rc
	$(INSTALL) -m 0444 $(BLD_DIR)/skip/sunos/skip.mkdev \
		$(4XPROTO)/etc/skip.mkdev
	$(INSTALL) -m 0444 $(BLD_DIR)/admin/hosts.4.x \
		$(4XPROTO)/etc/hosts
	$(INSTALL) -m 0444 $(BLD_DIR)/admin/skipd.conf \
		$(4XPROTO)/etc/skipd.conf

	@echo "Adding skip/drv to release"
	-[ -f $(BLD_DIR)/skip/sunos/4bin.sun4m/skip.o ] && \
		$(INSTALL) -m 0755 $(BLD_DIR)/skip/sunos/4bin.sun4m/skip.o \
		$(4XPROTO)/drv/sun4m/skip.o
	-[ -f $(BLD_DIR)/skip/sunos/4bin.sun4c/skip.o ] && \
		$(INSTALL) -m 0755 $(BLD_DIR)/skip/sunos/4bin.sun4c/skip.o \
		$(4XPROTO)/drv/sun4c/skip.o

	@echo "Adding skip/bin to release"
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/none.ras \
		$(4XPROTO)/bin/none.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/unknown.ras \
		$(4XPROTO)/bin/unknown.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/icon_v1.ras \
		$(4XPROTO)/bin/icon_v1.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/icon_v2.ras \
		$(4XPROTO)/bin/icon_v2.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/skiptool_small.ras \
		$(4XPROTO)/bin/skiptool_small.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/updated.ras \
		$(4XPROTO)/bin/updated.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/nomadic.ras \
		$(4XPROTO)/bin/nomadic.ras
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiptool/4bin.sun4/skiptool \
		$(4XPROTO)/bin/skiptool
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiphost/4bin.sun4/skiphost \
		$(4XPROTO)/bin/skiphost
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skipstat/4bin.sun4/skipstat \
		$(4XPROTO)/bin/skipstat
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skiplog/4bin.sun4/skiplog \
		$(4XPROTO)/bin/skiplog
	$(INSTALL) -m 0755 \
		$(BLD_DIR)/skip/tools/skiptool/4bin.sun4/skipstat_ui \
		$(4XPROTO)/bin/skipstat_ui
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/tools/skipvar/4bin.sun4/skipvar \
		$(4XPROTO)/bin/skipvar
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/keymgrd/4bin.sun4/test_key \
		$(4XPROTO)/bin/test_key
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/keymgrd/4bin.sun4/skipd \
		$(4XPROTO)/bin/skipd
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/keymgrd/4bin.sun4/skipdb \
		$(4XPROTO)/bin/skipdb
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/keymgrd/4bin.sun4/skipca \
		$(4XPROTO)/bin/skipca
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/keymgrd/4bin.sun4/skiplocal \
		$(4XPROTO)/bin/skiplocal
	$(INSTALL) -m 0755 $(BLD_DIR)/skip/keymgrd/4bin.sun4/certreq \
		$(4XPROTO)/bin/certreq
	$(INSTALL) -m 0755 $(BLD_DIR)/admin/install_skip_keys.sh  \
		$(4XPROTO)/bin/install_skip_keys
	$(INSTALL) -m 0755 $(BLD_DIR)/admin/skipif.sh  \
		$(4XPROTO)/bin/skipif
	$(INSTALL) -m 0755 $(BLD_DIR)/admin/skipd_restart.sh  \
		$(4XPROTO)/bin/skipd_restart
	$(INSTALL) -m 0755 $(BLD_DIR)/admin/skip_conf.sh  \
		$(4XPROTO)/bin/skip_conf
	$(INSTALL) -m 0755 $(BLD_DIR)/certs/hashcert/4bin.sun4/X509toHashCert \
		$(4XPROTO)/bin/X509toHashCert
	$(INSTALL) -m 0755 $(BLD_DIR)/certs/hashcert/4bin.sun4/dh_keygen \
		$(4XPROTO)/bin/dh_keygen
	$(INSTALL) -m 0755 $(BLD_DIR)/certs/utils/4bin.sun4/print_cert \
		$(4XPROTO)/bin/print_cert
	$(INSTALL) -m 0755 $(BLD_DIR)/certs/utils/4bin.sun4/md5	 \
		$(4XPROTO)/bin/md5

	@echo "Adding skip/doc to release"
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/SKIP_SOFTWARE_LICENSE \
		$(4XPROTO)/doc/SKIP_SOFTWARE_LICENSE
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/BN_SOFTWARE_LICENSE \
		$(4XPROTO)/doc/BN_SOFTWARE_LICENSE
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/README.PATENT \
		$(4XPROTO)/doc/README.PATENT
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/00README \
		$(4XPROTO)/doc/00README
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/INSTALL \
		$(4XPROTO)/doc/INSTALL
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/advanced.TOPICS \
		$(4XPROTO)/doc/advanced.TOPICS
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/usersguide.ps \
		$(4XPROTO)/doc/usersguide.ps
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/usersguide.html \
		$(4XPROTO)/doc/usersguide.html
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/usersguide.txt \
		$(4XPROTO)/doc/usersguide.txt
	$(INSTALL) -m 0644 $(BLD_DIR)/doc/inet-95.ps \
		$(4XPROTO)/doc/inet-95.ps

	@echo "Adding skip/man to release"
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/certreq.1m	 \
		$(4XPROTO)/man/man1/certreq.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skiphost.1m	 \
		$(4XPROTO)/man/man1/skiphost.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipstat.1m	 \
		$(4XPROTO)/man/man1/skipstat.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skiptool.1m	 \
		$(4XPROTO)/man/man1/skiptool.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipd.1m	  \
		$(4XPROTO)/man/man1/skipd.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipdb.1m	 \
		$(4XPROTO)/man/man1/skipdb.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipca.1m	 \
		$(4XPROTO)/man/man1/skipca.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skiplocal.1m	 \
		$(4XPROTO)/man/man1/skiplocal.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/install_skip_keys.1m \
		$(4XPROTO)/man/man1/install_skip_keys.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipd_restart.1m \
		$(4XPROTO)/man/man1/skipd_restart.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skip_conf.1m \
		$(4XPROTO)/man/man1/skip_conf.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipif.1m \
		$(4XPROTO)/man/man1/skipif.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skiplog.1m \
		$(4XPROTO)/man/man1/skiplog.1
	$(INSTALL) -m 0644 $(BLD_DIR)/certs/man/print_cert.1m \
		$(4XPROTO)/man/man1/print_cert.1
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/skipd.conf.4 \
		$(4XPROTO)/man/man4/skipd.conf.4
	$(INSTALL) -m 0644 $(BLD_DIR)/skip/man/raw_keys.4 \
		$(4XPROTO)/man/man4/raw_keys.4
	(cd $(4BIN); tar cvf skip.tar skip)
	(cd $(4BIN); compress skip.tar)

clean:
	@-$(RM) -rf $(4BIN)
	@-$(SCCSCLEAN)

cleanall:
	@-$(RM) -rf $(4BIN)
	@-$(SCCSCLEAN)
