OpenSDE Packages Database (without history before r20070)
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.

97 lines
3.1 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../snort/snort.conf
  6. # Copyright (C) 2007 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. if [ $prefix_auto = 1 ] ; then
  18. prefix=opt/snort
  19. set_confopt
  20. fi
  21. # postgresql support
  22. if pkginstalled postgresql; then
  23. pkgprefix -t postgresql
  24. var_append extraconfopt " " "--with-postgresql=/$( pkgprefix postgresql )"
  25. var_append LDFLAGS ' ' "-L$( pkgprefix libdir postgresql )"
  26. export LDFLAGS
  27. fi
  28. # mysql support
  29. if pkginstalled mysql; then
  30. pkgprefix -t mysql
  31. var_append extraconfopt " " "--with-mysql=/$( pkgprefix mysql )"
  32. var_append LD_RUN_PATH ':' "$( pkgprefix libdir mysql )/mysql"
  33. export LD_RUN_PATH
  34. fi
  35. # prelude support
  36. if pkginstalled libprelude; then
  37. pkgprefix -t libprelude
  38. var_append extraconfopt " " "--enable-prelude"
  39. var_append extraconfopt " " "--with-libprelude-prefix=/$( pkgprefix libprelude )"
  40. fi
  41. # FlexResp feature
  42. # NOTE: At time of writing, FlexResp:
  43. # (a) is considered in Alpha stage and "to be used with caution"
  44. # (b) requires libnet, which is an unmaintained package in ROCK
  45. # (c) does not work with libnet 1.1 (the latest stable release)
  46. # (d) works only with libnet 1.02a, which is deprecated
  47. # For these reasons, FlexResp is not enabled.
  48. # var_append extraconfopt " " "--enable-flexresp"
  49. # 2005-09-21 //morfoh
  50. # snort-inline isn't building due to libnet 1.02a dependency
  51. # see Note above
  52. # var_append extraconfopt " " "--enable-inline"
  53. # FlexResp2 Support
  54. pkginstalled libdnet && var_append confopt ' ' "--enable-flexresp2"
  55. # TimeStats functionality
  56. var_append confopt ' ' "--enable-timestats"
  57. # Statistics reporting through proc
  58. var_append confopt ' ' "--enable-linux-smp-stats"
  59. snort_preconf()
  60. {
  61. # Comply with FHS for /var/opt/
  62. sed -i "s,/var/log/snort,${localstatedir}/log," src/snort.h
  63. }
  64. snort_postmake()
  65. {
  66. # 'make install' sadly doesn't copy a lot of useful stuff
  67. # so we have to do it ourselves
  68. # The etc directory includes snort.conf, sigs and maps.
  69. # Technically the maps should not be here but snort convention
  70. # places them in etc.
  71. # For security reasons this directory should not be world-readable
  72. cp -fr etc/{*.conf,*.config,*.map,generators,sid} $root/$sysconfdir
  73. # Installing
  74. # Sourcefire VRT Certified Rules - The Official Snort Ruleset (unregistered user release)
  75. tar -v $taropt `match_source_file -p snortrules-pr` -C $root/$sysconfdir/
  76. # some changes on the shipped snort.conf example we use as default
  77. # replacing RULE_PATH '../rules' to './rules'
  78. sed -i 's,\.\./rules,./rules,' $root/$sysconfdir/snort.conf
  79. }
  80. hook_add preconf 5 snort_preconf
  81. hook_add postmake 5 snort_postmake