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.

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