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.

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