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.

164 lines
4.4 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=snort
  9. PKG_VERSION:=2.9.7.2
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/
  13. PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
  14. PKG_BUILD_DEPENDS:=librpc
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_FIXUP:=autoreconf
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/snort
  20. SUBMENU:=Firewall
  21. SECTION:=net
  22. CATEGORY:=Network
  23. DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib +SNORT_MYSQL:libmysqlclient +SNORT_PGSQL:libpq +SNORT_PGSQL:libuuid +SNORT_LZMA:liblzma
  24. TITLE:=Lightweight Network Intrusion Detection System
  25. URL:=http://www.snort.org/
  26. MENU:=1
  27. endef
  28. define Package/snort/description
  29. Snort is an open source network intrusion detection and prevention system.
  30. It is capable of performing real-time traffic analysis, alerting, blocking
  31. and packet logging on IP networks. It utilizes a combination of protocol
  32. analysis and pattern matching in order to detect anomalies, misuse and
  33. attacks.
  34. endef
  35. define Package/snort/config
  36. source "$(SOURCE)/Config.in"
  37. endef
  38. CONFIGURE_ARGS += \
  39. --prefix="/usr" \
  40. --enable-flexresp \
  41. --with-dnet-includes="$(STAGING_DIR)/usr/include" \
  42. --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \
  43. --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
  44. --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
  45. --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
  46. --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
  47. --with-daq-includes="$(STAGING_DIR)/usr/include" \
  48. --with-daq-libraries="$(STAGING_DIR)/usr/lib" \
  49. --disable-static-daq
  50. ifeq ($(CONFIG_SNORT_MYSQL),)
  51. CONFIGURE_ARGS += \
  52. --without-mysql
  53. endif
  54. ifeq ($(CONFIG_PGSQL),)
  55. CONFIGURE_ARGS += \
  56. --without-postgresql
  57. endif
  58. ifeq ($(CONFIG_SNORT_LZMA),)
  59. CONFIGURE_ARGS += \
  60. --disable-lzma
  61. endif
  62. CONFIGURE_VARS += \
  63. CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
  64. LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
  65. PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
  66. MAKE_FLAGS += \
  67. extra_incl=""
  68. define Build/InstallDev
  69. $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
  70. $(CP) \
  71. $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \
  72. $(STAGING_DIR)/usr/include/snort/dynamic_preproc/
  73. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc
  74. $(CP) \
  75. $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \
  76. $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/
  77. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine
  78. $(CP) \
  79. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
  80. $(STAGING_DIR)/usr/lib/snort_dynamicengine/
  81. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
  82. $(CP) \
  83. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
  84. $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
  85. endef
  86. define Package/snort/conffiles
  87. /etc/config/snort
  88. /etc/snort/snort.conf
  89. endef
  90. define Package/snort/install
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(INSTALL_BIN) \
  93. $(PKG_INSTALL_DIR)/usr/bin/snort \
  94. $(1)/usr/bin/snort
  95. $(INSTALL_BIN) \
  96. $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
  97. $(1)/usr/bin
  98. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
  99. $(CP) \
  100. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
  101. $(1)/usr/lib/snort_dynamicengine/
  102. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
  103. $(CP) \
  104. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
  105. $(1)/usr/lib/snort_dynamicpreprocessor/
  106. $(INSTALL_DIR) $(1)/etc/snort
  107. $(INSTALL_CONF) \
  108. $(PKG_BUILD_DIR)/etc/snort.conf \
  109. $(1)/etc/snort/
  110. $(INSTALL_CONF) \
  111. $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
  112. $(1)/etc/snort/
  113. $(INSTALL_CONF) \
  114. $(PKG_BUILD_DIR)/etc/classification.config \
  115. $(1)/etc/snort/
  116. $(INSTALL_CONF) \
  117. $(PKG_BUILD_DIR)/etc/gen-msg.map \
  118. $(1)/etc/snort/
  119. $(INSTALL_CONF) \
  120. $(PKG_BUILD_DIR)/etc/reference.config \
  121. $(1)/etc/snort/
  122. $(INSTALL_CONF) \
  123. $(PKG_BUILD_DIR)/etc/unicode.map \
  124. $(1)/etc/snort/
  125. $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
  126. $(INSTALL_CONF) \
  127. $(PKG_BUILD_DIR)/preproc_rules/*.rules \
  128. $(1)/etc/snort/preproc_rules/
  129. $(INSTALL_DIR) $(1)/etc/init.d
  130. $(INSTALL_BIN) \
  131. ./files/snort.init \
  132. $(1)/etc/init.d/snort
  133. $(INSTALL_DIR) $(1)/etc/config
  134. $(INSTALL_CONF) \
  135. ./files/snort.config \
  136. $(1)/etc/config/snort
  137. endef
  138. $(eval $(call BuildPackage,snort))