1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/snort/snort.conf
3 # Copyright (C) 2004 - 2022 The T2 SDE Project
4 # Copyright (C) 1998 - 2003 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 if [ $prefix_auto = 1 ]; then
19 if pkginstalled postgresql; then
20 pkgprefix -t postgresql
21 var_append extraconfopt " " "--with-postgresql=$root/$( pkgprefix postgresql )"
22 var_append LDFLAGS ' ' "-L$root$( pkgprefix libdir postgresql )"
27 if pkginstalled mysql; then
29 var_append extraconfopt " " "--with-mysql-includes=$root$( pkgprefix includedir mysql )/mysql/"
30 var_append extraconfopt " " "--with-mysql-libraries=$root$( pkgprefix libdir mysql )/mysql/"
34 if pkginstalled libprelude; then
35 pkgprefix -t libprelude
36 var_append extraconfopt " " "--enable-prelude"
37 var_append extraconfopt " " "--with-libprelude-prefix=$root/$( pkgprefix libprelude )"
41 # NOTE: At time of writing, FlexResp:
42 # (a) is considered in Alpha stage and "to be used with caution"
44 # (c) does not work with libnet 1.1 (the latest stable release)
45 # (d) works only with libnet 1.02a, which is deprecated
46 # For these reasons, FlexResp is not enabled.
47 # var_append extraconfopt " " "--enable-flexresp"
49 # snort-inline isn't building due to libnet 1.02a dependency
51 # var_append extraconfopt " " "--enable-inline"
55 # Comply with FHS for /var/opt/
56 sed -i "s,/var/log/snort,${localstatedir}/log," src/snort.h
61 # 'make install' sadly doesn't copy a lot of useful stuff
62 # so we have to do it ourselves
64 # The etc directory includes snort.conf, sigs and maps.
65 # Technically the maps should not be here but snort convention
67 # For security reasons this directory should not be world-readable
68 cp -fr etc/{*.conf,*.config,*.map} $root$sysconfdir
71 # Sourcefire VRT Certified Rules - The Official Snort Ruleset (unregistered user release)
72 tar -v $taropt `match_source_file -p rules` -C $root$sysconfdir/
74 # some changes on the shipped snort.conf example we use as default
75 # replacing RULE_PATH '../rules' to './rules'
76 sed -i 's,\.\./rules,./rules,' $root$sysconfdir/snort.conf
79 hook_add preconf 5 snort_preconf
80 hook_add postmake 5 snort_postmake