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.

154 lines
4.8 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/jocelyn/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. # Set up options for configure
  23. # snort should be installed in /opt because it is easier
  24. # to maintain if it has its own directory structure
  25. prefix=/opt/snort
  26. set_confopt
  27. # postgresql support
  28. pgsqldir=""
  29. if [ -r /opt/postgresql/include/libpq-fe.h ] ; then
  30. pgsqldir=/opt/postgresql
  31. elif [ -r /usr/include/libpq-fe.h ] ; then
  32. pgsqldir=/usr
  33. elif [ -r /usr/include/pgsql/libpq-fe.h ] ; then
  34. pgsqldir=/usr
  35. elif [ -r /usr/include/postgresqllibpq-fe.h ] ; then
  36. pgsqldir=/usr
  37. elif [ -f /usr/local/include/libpq-fe.h ] ; then
  38. pgsqldir=/usr/local
  39. elif [ -f /usr/local/include/pgsql/libpq-fe.h ] ; then
  40. pgsqldir=/usr/local
  41. elif [ -f /usr/local/include/postgresql/libpq-fe.h ] ; then
  42. local pgsqldir=/usr/local
  43. fi
  44. if [ "$pgsqldir" != "" ] ; then
  45. var_append extraconfopt " " "--with-postgresql=$pgsqldir"
  46. fi
  47. # mysql support
  48. mysqldir=""
  49. if [ -r /opt/mysql/include/mysql/mysql.h ] ; then
  50. mysqldir=/opt/mysql
  51. elif [ -r /usr/include/mysql.h ] ; then
  52. mysqldir=/usr/
  53. elif [ -r /usr/include/mysql/mysql.h ] ; then
  54. mysqldir=/usr
  55. elif [ -r /usr/local/include/mysql.h ] ; then
  56. mysqldir=/usr/local
  57. elif [ -r /usr/local/include/mysql/mysql.h ] ; then
  58. mysqldir=/usr/local
  59. fi
  60. if [ "$mysqldir" != "" ] ; then
  61. var_append extraconfopt " " "--with-mysql=$mysqldir"
  62. fi
  63. # openSSL support
  64. ssldir=""
  65. if [ -r /opt/openssl/include/crypto.h ] ; then
  66. ssldir=/opt/openssl
  67. elif [ -r /usr/include/openssl/crypto.h ]; then
  68. ssldir=/usr/
  69. elif [ -r /usr/local/include/openssl/crypto.h ]; then
  70. ssldir=/usr/local/
  71. fi
  72. if [ "$ssldir" != "" ] ; then
  73. var_append extraconfopt " " "--with-openssl=$ssldir"
  74. fi
  75. # FlexResp feature
  76. # NOTE: At time of writing, FlexResp:
  77. # (a) is considered in Alpha stage and "to be used with caution"
  78. # (b) requires libnet, which is an unmaintained package in ROCK
  79. # (c) does not work with libnet 1.1 (the latest stable release)
  80. # (d) works only with libnet 1.02a, which is deprecated
  81. # For these reasons, FlexResp is not enabled.
  82. # var_append extraconfopt " " "--enable-flexresp"
  83. snort_premake()
  84. {
  85. # Comply with FHS for /var/opt/
  86. cd $builddir/snort-$ver/src
  87. sed 's/\/var\/log\/snort/\/var\/opt\/snort\/log/' snort.h > temp.f
  88. mv -f temp.f snort.h
  89. }
  90. snort_postmake()
  91. {
  92. # 'make install' sadly doesn't copy a lot of useful stuff
  93. # so we have to do it ourselves
  94. cd $builddir/snort-$ver
  95. # The contrib directory contains helper scripts and tars
  96. # of plugins. This directory is just copied over.
  97. cp -r contrib /opt/snort/
  98. # The etc directory includes snort.conf, sigs, maps and rules.
  99. # Technically the maps should not be here but snort convention
  100. # places them in etc.
  101. # For security reasons this directory should not be world-readable
  102. mkdir -p /opt/snort/var
  103. cp -r etc /opt/snort/
  104. cp -r rules /opt/snort/etc/
  105. mv /opt/snort/etc/etc/* /opt/snort/etc/
  106. rm -rf /opt/snort/etc/etc/
  107. sed 's/\.\.\/rules/.\/rules/' /opt/snort/etc/snort.conf > temp.f
  108. mv -f temp.f /opt/snort/etc/snort.conf
  109. chmod -R 700 /opt/snort/etc
  110. # Remove Makefiles (left from build)
  111. rm -f /opt/snort/*/Makefile*
  112. rm -f /opt/snort/*/*/Makefile*
  113. # Create a SysV init script for snort
  114. install_init snort $confdir/snort.init
  115. # Link snort's etc and var dirs to system's /etc and /var dirs.
  116. # If the directory exists, make a new one with $TIMESTAMP in the name;
  117. # this allows for more than one "version" of each directory
  118. # so that previous configs and data are not overwritten
  119. TIMESTAMP=`date +%y%m0%H%M`
  120. mkdir -p /etc/opt
  121. mkdir -p /var/opt
  122. if [ -d /opt/snort/etc ] ; then
  123. if [ -d /etc/opt/snort ] ; then
  124. mv -fv /opt/snort/etc /etc/opt/snort/new$TIMESTAMP
  125. else
  126. mv -fv /opt/snort/etc /etc/opt/snort
  127. fi
  128. ln -sf /etc/opt/snort /opt/snort/etc
  129. fi
  130. if [ -d /opt/snort/var ] ; then
  131. if [ -d /var/opt/snort ] ; then
  132. mv -fv /opt/snort/var /var/opt/snort/new$TIMESTAMP
  133. else
  134. mv -fv /opt/snort/var /var/opt/snort
  135. fi
  136. ln -sf /var/opt/snort /opt/snort/var
  137. mkdir -p /var/opt/snort/log
  138. fi
  139. }
  140. premake=snort_premake
  141. postmake=snort_postmake