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

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/misc/snort/snort.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. if [ $prefix_auto = 1 ] ; then
  23. prefix=opt/snort
  24. set_confopt
  25. fi
  26. # postgresql support
  27. if [ -n "$pkg_postgresql_prefix" ] ; then
  28. var_append extraconfopt " " "--with-postgresql=$pkg_postgrsql_prefix"
  29. fi
  30. # mysql support
  31. if [ -n "$pkg_mysql_prefix" ] ; then
  32. var_append extraconfopt " " "--with-mysql=$pkg_mysql_prefix"
  33. fi
  34. # openSSL support
  35. ssldir=""
  36. if [ -r /opt/openssl/include/crypto.h ] ; then
  37. ssldir=/opt/openssl
  38. elif [ -r /usr/include/openssl/crypto.h ]; then
  39. ssldir=/usr/
  40. elif [ -r /usr/local/include/openssl/crypto.h ]; then
  41. ssldir=/usr/local/
  42. fi
  43. if [ "$ssldir" != "" ] ; then
  44. var_append extraconfopt " " "--with-openssl=$ssldir"
  45. fi
  46. # FlexResp feature
  47. # NOTE: At time of writing, FlexResp:
  48. # (a) is considered in Alpha stage and "to be used with caution"
  49. # (b) requires libnet, which is an unmaintained package in ROCK
  50. # (c) does not work with libnet 1.1 (the latest stable release)
  51. # (d) works only with libnet 1.02a, which is deprecated
  52. # For these reasons, FlexResp is not enabled.
  53. # var_append extraconfopt " " "--enable-flexresp"
  54. snort_premake()
  55. {
  56. # Comply with FHS for /var/opt/
  57. sed 's/\/var\/log\/snort/\/var\/opt\/snort\/log/' src/snort.h > \
  58. src/snort.h.new
  59. mv -f src/snort.h{.new,}
  60. }
  61. snort_postmake()
  62. {
  63. # 'make install' sadly doesn't copy a lot of useful stuff
  64. # so we have to do it ourselves
  65. # The contrib directory contains helper scripts and tars
  66. # of plugins. This directory is just copied over.
  67. cp -fr contrib $docdir
  68. # The etc directory includes snort.conf, sigs, maps and rules.
  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. mkdir -p $root/$prefix/var
  73. mkdir -p $root/$prefix/etc
  74. cp -r etc/* $root/$prefix/etc/
  75. cp -r rules $root/$prefix/etc/
  76. # THIS IS DANGEROUS - IT MIGHT AFFECT OTHER PACKAFES FILES !!!
  77. # FIS THIS PROPERLY!
  78. # mv /opt/snort/etc/etc/* /opt/snort/etc/
  79. # rm -rf /opt/snort/etc/etc/
  80. sed 's/\.\.\/rules/.\/rules/' $root/$prefix/etc/snort.conf > \
  81. $root/$prefix/etc/snort.conf.new
  82. mv -f $root/$prefix/etc/snort.conf{.new,}
  83. # THIS IS DANGEROUS - IT MIGHT AFFECT OTHER PACKAGES FILES !!!
  84. # Remove Makefiles (left from build)
  85. # rm -f $root/$prefix/*/Makefile*
  86. # rm -f $root/$prefix/*/*/Makefile*
  87. # Create a SysV init script for snort
  88. install_init snort $confdir/snort.init
  89. }
  90. hook_add premake 3 snort_premake
  91. hook_add postmake 3 snort_postmake