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.

156 lines
4.2 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:=4
  11. PKG_LICENSE:=GPL-2.0
  12. PKG_MAINTAINER:=Luka Perkov <luka@openwrt.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:=db57c532919d9ababac127f29dbdc05ed832394880e46cad81a5dde713ccb4be
  17. PKG_BUILD_DEPENDS:=librpc
  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 +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. define Build/InstallDev
  62. $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
  63. $(CP) \
  64. $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \
  65. $(STAGING_DIR)/usr/include/snort/dynamic_preproc/
  66. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc
  67. $(CP) \
  68. $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \
  69. $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/
  70. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine
  71. $(CP) \
  72. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
  73. $(STAGING_DIR)/usr/lib/snort_dynamicengine/
  74. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
  75. $(CP) \
  76. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
  77. $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
  78. endef
  79. define Package/snort/conffiles
  80. /etc/config/snort
  81. /etc/snort/snort.conf
  82. endef
  83. define Package/snort/install
  84. $(INSTALL_DIR) $(1)/usr/bin
  85. $(INSTALL_BIN) \
  86. $(PKG_INSTALL_DIR)/usr/bin/snort \
  87. $(1)/usr/bin/snort
  88. $(INSTALL_BIN) \
  89. $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
  90. $(1)/usr/bin
  91. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
  92. $(CP) \
  93. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
  94. $(1)/usr/lib/snort_dynamicengine/
  95. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
  96. $(CP) \
  97. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
  98. $(1)/usr/lib/snort_dynamicpreprocessor/
  99. $(INSTALL_DIR) $(1)/etc/snort
  100. $(INSTALL_CONF) \
  101. $(PKG_BUILD_DIR)/etc/snort.conf \
  102. $(1)/etc/snort/
  103. $(INSTALL_CONF) \
  104. $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
  105. $(1)/etc/snort/
  106. $(INSTALL_CONF) \
  107. $(PKG_BUILD_DIR)/etc/classification.config \
  108. $(1)/etc/snort/
  109. $(INSTALL_CONF) \
  110. $(PKG_BUILD_DIR)/etc/gen-msg.map \
  111. $(1)/etc/snort/
  112. $(INSTALL_CONF) \
  113. $(PKG_BUILD_DIR)/etc/reference.config \
  114. $(1)/etc/snort/
  115. $(INSTALL_CONF) \
  116. $(PKG_BUILD_DIR)/etc/unicode.map \
  117. $(1)/etc/snort/
  118. $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
  119. $(INSTALL_CONF) \
  120. $(PKG_BUILD_DIR)/preproc_rules/*.rules \
  121. $(1)/etc/snort/preproc_rules/
  122. $(INSTALL_DIR) $(1)/etc/init.d
  123. $(INSTALL_BIN) \
  124. ./files/snort.init \
  125. $(1)/etc/init.d/snort
  126. $(INSTALL_DIR) $(1)/etc/config
  127. $(INSTALL_CONF) \
  128. ./files/snort.config \
  129. $(1)/etc/config/snort
  130. endef
  131. $(eval $(call BuildPackage,snort))