#!/usr/bin/ksh93
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
#ident "@(#)install-sfw 1.3 10/04/22 SMI"
# stop at first error
set -o errexit
PKGVERS=${VERS}
PREFIX=${ROOT}/usr
SHAREDIR=${PREFIX}/share
SRCDIR=${PREFIX}/src/
SNORTSRCDIR=${SRCDIR}/snort_dynamicsrc
DYNAMICENGINE=${PREFIX}/lib/snort_dynamicengine
DYNAMICPREPROC=${PREFIX}/lib/snort_dynamicpreprocessor
DYNAMICRULE=${PREFIX}/lib/snort_dynamicrules
SNORTDOCDIR=${SHAREDIR}/doc/snort
MAN1DIR=${SHAREDIR}/man/man1m
OLDMANDIR=${SHAREDIR}/man/man8
source ${SRC}/tools/install.subr
# remove src files which is not necessary to deliver
rm -rf ${SNORTSRCDIR}
# remove usr/src if the directory contains nothing
rmdir ${SRCDIR} >/dev/null 2>&1
# remove all *.la files in plugins
rm -rf ${DYNAMICENGINE}/*.la
rm -rf ${DYNAMICPREPROC}/*.la
rm -rf ${DYNAMICRULE}/*.la
# remove TODO WISHLIST README.WIN32 files in snort share doc.
rm -rf ${SNORTDOCDIR}/TODO
rm -rf ${SNORTDOCDIR}/WISHLIST
rm -rf ${SNORTDOCDIR}/README.WIN32
# remove old snort manual
rm -rf ${OLDMANDIR}/snort.8
_install N snort.xml ${ROOT}/lib/svc/manifest/network/snort.xml 444
_install N snortd ${ROOT}/lib/svc/method/snortd 555
cd ${PKGVERS}
MANSCRIPT=../sunman-stability
_install M snort.8 ${MAN1DIR}/snort.1m 444
_install N etc/snort.conf ${ROOT}/etc/snort.conf 644
_install N etc/threshold.conf ${ROOT}/etc/threshold.conf 644
_install N etc/gen-msg.map ${ROOT}/etc/gen-msg.map 644
_install N etc/attribute_table.dtd ${ROOT}/etc/attribute_table.dtd 644
_install N etc/unicode.map ${ROOT}/etc/unicode.map 644
_install N etc/classification.config ${ROOT}/etc/classification.config 644
_install N etc/reference.config ${ROOT}/etc/reference.config 644
_install N ../auth_attr ${ROOT}/etc/security/auth_attr.d/snort 444
_install N ../exec_attr ${ROOT}/etc/security/exec_attr.d/snort 444
exit 0