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.

160 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.19
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_LICENSE:=GPL-2.0
  12. PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  13. PKG_CPE_ID:=cpe:/a:snort:snort
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=https://www.snort.org/downloads/archive/snort/ \
  16. @SF/$(PKG_NAME)
  17. PKG_HASH:=b12fc6db72afb58987a2bf1954b8f45bde02047c235513c7663857b9506369c7
  18. PKG_BUILD_DEPENDS:=libtirpc
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
  20. PKG_FIXUP:=autoreconf
  21. PKG_INSTALL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/snort
  24. SUBMENU:=Firewall
  25. SECTION:=net
  26. CATEGORY:=Network
  27. DEPENDS:=+libdaq +libdnet +libnghttp2 +libopenssl +libpcap +libpcre +libpthread +libtirpc +libuuid +zlib +luajit +SNORT_LZMA:liblzma
  28. TITLE:=Lightweight Network Intrusion Detection System
  29. URL:=http://www.snort.org/
  30. CONFLICTS:=snort3
  31. MENU:=1
  32. endef
  33. define Package/snort/description
  34. Snort is an open source network intrusion detection and prevention system.
  35. It is capable of performing real-time traffic analysis, alerting, blocking
  36. and packet logging on IP networks. It utilizes a combination of protocol
  37. analysis and pattern matching in order to detect anomalies, misuse and
  38. attacks.
  39. endef
  40. define Package/snort/config
  41. source "$(SOURCE)/Config.in"
  42. endef
  43. CONFIGURE_ARGS += \
  44. --prefix="/usr" \
  45. --enable-flexresp \
  46. --with-dnet-includes="$(STAGING_DIR)/usr/include" \
  47. --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \
  48. --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
  49. --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
  50. --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
  51. --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
  52. --with-daq-includes="$(STAGING_DIR)/usr/include/daq2" \
  53. --with-daq-libraries="$(STAGING_DIR)/usr/lib/daq2" \
  54. --disable-static-daq
  55. ifeq ($(CONFIG_SNORT_LZMA),)
  56. CONFIGURE_ARGS += \
  57. --disable-lzma
  58. endif
  59. CONFIGURE_VARS += \
  60. PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
  61. MAKE_FLAGS += \
  62. extra_incl=""
  63. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc
  64. define Build/InstallDev
  65. $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
  66. $(CP) \
  67. $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \
  68. $(STAGING_DIR)/usr/include/snort/dynamic_preproc/
  69. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc
  70. $(CP) \
  71. $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \
  72. $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/
  73. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine
  74. $(CP) \
  75. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
  76. $(STAGING_DIR)/usr/lib/snort_dynamicengine/
  77. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
  78. $(CP) \
  79. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
  80. $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
  81. endef
  82. define Package/snort/conffiles
  83. /etc/config/snort
  84. /etc/snort/snort.conf
  85. endef
  86. define Package/snort/install
  87. $(INSTALL_DIR) $(1)/usr/bin
  88. $(INSTALL_BIN) \
  89. $(PKG_INSTALL_DIR)/usr/bin/snort \
  90. $(1)/usr/bin/snort
  91. $(INSTALL_BIN) \
  92. $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
  93. $(1)/usr/bin
  94. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
  95. $(CP) \
  96. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
  97. $(1)/usr/lib/snort_dynamicengine/
  98. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
  99. $(CP) \
  100. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
  101. $(1)/usr/lib/snort_dynamicpreprocessor/
  102. $(INSTALL_DIR) $(1)/etc/snort
  103. $(INSTALL_CONF) \
  104. $(PKG_BUILD_DIR)/etc/snort.conf \
  105. $(1)/etc/snort/
  106. $(INSTALL_CONF) \
  107. $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
  108. $(1)/etc/snort/
  109. $(INSTALL_CONF) \
  110. $(PKG_BUILD_DIR)/etc/classification.config \
  111. $(1)/etc/snort/
  112. $(INSTALL_CONF) \
  113. $(PKG_BUILD_DIR)/etc/gen-msg.map \
  114. $(1)/etc/snort/
  115. $(INSTALL_CONF) \
  116. $(PKG_BUILD_DIR)/etc/reference.config \
  117. $(1)/etc/snort/
  118. $(INSTALL_CONF) \
  119. $(PKG_BUILD_DIR)/etc/unicode.map \
  120. $(1)/etc/snort/
  121. $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
  122. $(INSTALL_CONF) \
  123. $(PKG_BUILD_DIR)/preproc_rules/*.rules \
  124. $(1)/etc/snort/preproc_rules/
  125. $(INSTALL_DIR) $(1)/etc/init.d
  126. $(INSTALL_BIN) \
  127. ./files/snort.init \
  128. $(1)/etc/init.d/snort
  129. $(INSTALL_DIR) $(1)/etc/config
  130. $(INSTALL_CONF) \
  131. ./files/snort.config \
  132. $(1)/etc/config/snort
  133. endef
  134. $(eval $(call BuildPackage,snort))