snort.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ##
  2. ## snort.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: snort
  27. Summary: Network Intrusion Detection System
  28. URL: http://www.snort.org/
  29. Vendor: B. Caswell, M. Roesch
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: PLUS
  33. Group: Network
  34. License: GPL
  35. Version: 2.3.1
  36. Release: 20050310
  37. # package options
  38. %option with_mysql no
  39. %option with_pgsql no
  40. # list of sources
  41. Source0: http://www.snort.org/dl/current/snort-%{version}.tar.gz
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  46. PreReq: OpenPKG, openpkg >= 20040130
  47. BuildPreReq: libpcap, libnet, pcre
  48. PreReq: libpcap, libnet, pcre
  49. %if "%{with_mysql}" == "yes"
  50. BuildPreReq: mysql
  51. PreReq: mysql
  52. %endif
  53. %if "%{with_pgsql}" == "yes"
  54. BuildPreReq: postgresql
  55. PreReq: postgresql
  56. %endif
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. Snort is an open source network intrusion detection system,
  61. capable of performing real-time traffic analysis and packet
  62. logging on IP networks. It can perform protocol analysis, content
  63. searching/matching and can be used to detect a variety of attacks
  64. and probes. Snort uses a flexible rules language to describe traffic
  65. that it should collect or pass, as well as a detection engine that
  66. utilizes a modular plugin architecture. Snort has a real-time
  67. alerting capability as well. Snort has three primary uses. It can be
  68. used as a straight packet sniffer like tcpdump(1), a packet logger
  69. (useful for network traffic debugging, etc), or as a full blown
  70. network intrusion detection system.
  71. %track
  72. prog snort = {
  73. version = %{version}
  74. url = http://www.snort.org/dl/
  75. regex = snort-(\d+\.\d+\.\d+)\.tar\.gz
  76. }
  77. %prep
  78. %setup -q
  79. %build
  80. LIBS=""
  81. %if "%{with_pgsql}" == "yes"
  82. LIBS="$LIBS -lpq -lcrypt -lssl -lcrypto"
  83. %endif
  84. case "%{l_platform -t}" in
  85. *-sunos* ) LIBS="$LIBS -lresolv" ;;
  86. esac
  87. CC="%{l_cc}" \
  88. CFLAGS="%{l_cflags -O}" \
  89. CPPFLAGS="%{l_cppflags}" \
  90. LDFLAGS="%{l_ldflags}" \
  91. LIBS="$LIBS" \
  92. ./configure \
  93. --prefix=%{l_prefix} \
  94. --sysconfdir=%{l_prefix}/etc/snort \
  95. %if "%{with_mysql}" == "yes"
  96. --with-mysql=%{l_prefix} \
  97. %else
  98. --without-mysql \
  99. %endif
  100. %if "%{with_pgsql}" == "yes"
  101. --with-postgresql=%{l_prefix} \
  102. %else
  103. --without-postgresql \
  104. %endif
  105. --with-libpcap-includes=%{l_prefix}/include \
  106. --with-libpcap-libraries=%{l_prefix}/lib \
  107. --with-libnet-includes=%{l_prefix}/include \
  108. --with-libnet-libraries=%{l_prefix}/lib
  109. %{l_make} %{l_mflags -O}
  110. %install
  111. rm -rf $RPM_BUILD_ROOT
  112. %{l_shtool} mkdir -f -p -m 755 \
  113. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  114. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/snort \
  116. $RPM_BUILD_ROOT%{l_prefix}/share/snort/rules
  117. %{l_shtool} install -c -s -m 755 \
  118. src/snort $RPM_BUILD_ROOT%{l_prefix}/sbin/
  119. %{l_shtool} install -c -m 644 \
  120. snort.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  121. %{l_shtool} install -c -m 644 \
  122. rules/*.rules $RPM_BUILD_ROOT%{l_prefix}/share/snort/rules/
  123. %{l_shtool} install -c -m 644 \
  124. -e 's;\(var RULE_PATH\).*;\1 %{l_prefix}/share/snort/rules;g' \
  125. etc/snort.conf $RPM_BUILD_ROOT%{l_prefix}/etc/snort/
  126. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  127. %files -f files
  128. %clean
  129. rm -rf $RPM_BUILD_ROOT