mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

105 lines
3.3 KiB

# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/misc/snort/snort.conf
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
if [ $prefix_auto = 1 ] ; then
prefix=opt/snort
set_confopt
fi
# postgresql support
if [ -n "$pkg_postgresql_prefix" ] ; then
var_append extraconfopt " " "--with-postgresql=$pkg_postgrsql_prefix"
fi
# mysql support
if [ -n "$pkg_mysql_prefix" ] ; then
var_append extraconfopt " " "--with-mysql=$pkg_mysql_prefix"
fi
# openSSL support
ssldir=""
if [ -r /opt/openssl/include/crypto.h ] ; then
ssldir=/opt/openssl
elif [ -r /usr/include/openssl/crypto.h ]; then
ssldir=/usr/
elif [ -r /usr/local/include/openssl/crypto.h ]; then
ssldir=/usr/local/
fi
if [ "$ssldir" != "" ] ; then
var_append extraconfopt " " "--with-openssl=$ssldir"
fi
# FlexResp feature
# NOTE: At time of writing, FlexResp:
# (a) is considered in Alpha stage and "to be used with caution"
# (b) requires libnet, which is an unmaintained package in ROCK
# (c) does not work with libnet 1.1 (the latest stable release)
# (d) works only with libnet 1.02a, which is deprecated
# For these reasons, FlexResp is not enabled.
# var_append extraconfopt " " "--enable-flexresp"
snort_premake()
{
# Comply with FHS for /var/opt/
sed 's/\/var\/log\/snort/\/var\/opt\/snort\/log/' src/snort.h > \
src/snort.h.new
mv -f src/snort.h{.new,}
}
snort_postmake()
{
# 'make install' sadly doesn't copy a lot of useful stuff
# so we have to do it ourselves
# The contrib directory contains helper scripts and tars
# of plugins. This directory is just copied over.
cp -fr contrib $docdir
# The etc directory includes snort.conf, sigs, maps and rules.
# Technically the maps should not be here but snort convention
# places them in etc.
# For security reasons this directory should not be world-readable
mkdir -p $root/$prefix/var
mkdir -p $root/$prefix/etc
cp -r etc/* $root/$prefix/etc/
cp -r rules $root/$prefix/etc/
# THIS IS DANGEROUS - IT MIGHT AFFECT OTHER PACKAFES FILES !!!
# FIS THIS PROPERLY!
# mv /opt/snort/etc/etc/* /opt/snort/etc/
# rm -rf /opt/snort/etc/etc/
sed 's/\.\.\/rules/.\/rules/' $root/$prefix/etc/snort.conf > \
$root/$prefix/etc/snort.conf.new
mv -f $root/$prefix/etc/snort.conf{.new,}
# THIS IS DANGEROUS - IT MIGHT AFFECT OTHER PACKAGES FILES !!!
# Remove Makefiles (left from build)
# rm -f $root/$prefix/*/Makefile*
# rm -f $root/$prefix/*/*/Makefile*
# Create a SysV init script for snort
install_init snort $confdir/snort.init
}
hook_add premake 3 snort_premake
hook_add postmake 3 snort_postmake