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.

159 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.16.1
  10. PKG_RELEASE:=1
  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:=e3ac45a1a3cc2c997d52d19cd92f1adf5641c3a919387adab47a4d13a9dc9f8e
  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. MENU:=1
  31. endef
  32. define Package/snort/description
  33. Snort is an open source network intrusion detection and prevention system.
  34. It is capable of performing real-time traffic analysis, alerting, blocking
  35. and packet logging on IP networks. It utilizes a combination of protocol
  36. analysis and pattern matching in order to detect anomalies, misuse and
  37. attacks.
  38. endef
  39. define Package/snort/config
  40. source "$(SOURCE)/Config.in"
  41. endef
  42. CONFIGURE_ARGS += \
  43. --prefix="/usr" \
  44. --enable-flexresp \
  45. --with-dnet-includes="$(STAGING_DIR)/usr/include" \
  46. --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \
  47. --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
  48. --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
  49. --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
  50. --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
  51. --with-daq-includes="$(STAGING_DIR)/usr/include" \
  52. --with-daq-libraries="$(STAGING_DIR)/usr/lib" \
  53. --disable-static-daq
  54. ifeq ($(CONFIG_SNORT_LZMA),)
  55. CONFIGURE_ARGS += \
  56. --disable-lzma
  57. endif
  58. CONFIGURE_VARS += \
  59. PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
  60. MAKE_FLAGS += \
  61. extra_incl=""
  62. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc
  63. define Build/InstallDev
  64. $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
  65. $(CP) \
  66. $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \
  67. $(STAGING_DIR)/usr/include/snort/dynamic_preproc/
  68. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc
  69. $(CP) \
  70. $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \
  71. $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/
  72. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine
  73. $(CP) \
  74. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
  75. $(STAGING_DIR)/usr/lib/snort_dynamicengine/
  76. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
  77. $(CP) \
  78. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
  79. $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
  80. endef
  81. define Package/snort/conffiles
  82. /etc/config/snort
  83. /etc/snort/snort.conf
  84. endef
  85. define Package/snort/install
  86. $(INSTALL_DIR) $(1)/usr/bin
  87. $(INSTALL_BIN) \
  88. $(PKG_INSTALL_DIR)/usr/bin/snort \
  89. $(1)/usr/bin/snort
  90. $(INSTALL_BIN) \
  91. $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
  92. $(1)/usr/bin
  93. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
  94. $(CP) \
  95. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
  96. $(1)/usr/lib/snort_dynamicengine/
  97. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
  98. $(CP) \
  99. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
  100. $(1)/usr/lib/snort_dynamicpreprocessor/
  101. $(INSTALL_DIR) $(1)/etc/snort
  102. $(INSTALL_CONF) \
  103. $(PKG_BUILD_DIR)/etc/snort.conf \
  104. $(1)/etc/snort/
  105. $(INSTALL_CONF) \
  106. $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
  107. $(1)/etc/snort/
  108. $(INSTALL_CONF) \
  109. $(PKG_BUILD_DIR)/etc/classification.config \
  110. $(1)/etc/snort/
  111. $(INSTALL_CONF) \
  112. $(PKG_BUILD_DIR)/etc/gen-msg.map \
  113. $(1)/etc/snort/
  114. $(INSTALL_CONF) \
  115. $(PKG_BUILD_DIR)/etc/reference.config \
  116. $(1)/etc/snort/
  117. $(INSTALL_CONF) \
  118. $(PKG_BUILD_DIR)/etc/unicode.map \
  119. $(1)/etc/snort/
  120. $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
  121. $(INSTALL_CONF) \
  122. $(PKG_BUILD_DIR)/preproc_rules/*.rules \
  123. $(1)/etc/snort/preproc_rules/
  124. $(INSTALL_DIR) $(1)/etc/init.d
  125. $(INSTALL_BIN) \
  126. ./files/snort.init \
  127. $(1)/etc/init.d/snort
  128. $(INSTALL_DIR) $(1)/etc/config
  129. $(INSTALL_CONF) \
  130. ./files/snort.config \
  131. $(1)/etc/config/snort
  132. endef
  133. $(eval $(call BuildPackage,snort))