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.

168 lines
4.5 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:=3
  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_MD5SUM:=b01e9964827394c39194a0147bc15705
  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_MYSQL:libmysqlclient +SNORT_PGSQL:libpq +SNORT_PGSQL:libuuid +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_MYSQL),)
  54. CONFIGURE_ARGS += \
  55. --without-mysql
  56. endif
  57. ifeq ($(CONFIG_PGSQL),)
  58. CONFIGURE_ARGS += \
  59. --without-postgresql
  60. endif
  61. ifeq ($(CONFIG_SNORT_LZMA),)
  62. CONFIGURE_ARGS += \
  63. --disable-lzma
  64. endif
  65. CONFIGURE_VARS += \
  66. CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
  67. LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
  68. PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
  69. MAKE_FLAGS += \
  70. extra_incl=""
  71. define Build/InstallDev
  72. $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
  73. $(CP) \
  74. $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \
  75. $(STAGING_DIR)/usr/include/snort/dynamic_preproc/
  76. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc
  77. $(CP) \
  78. $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \
  79. $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/
  80. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine
  81. $(CP) \
  82. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
  83. $(STAGING_DIR)/usr/lib/snort_dynamicengine/
  84. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
  85. $(CP) \
  86. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
  87. $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
  88. endef
  89. define Package/snort/conffiles
  90. /etc/config/snort
  91. /etc/snort/snort.conf
  92. endef
  93. define Package/snort/install
  94. $(INSTALL_DIR) $(1)/usr/bin
  95. $(INSTALL_BIN) \
  96. $(PKG_INSTALL_DIR)/usr/bin/snort \
  97. $(1)/usr/bin/snort
  98. $(INSTALL_BIN) \
  99. $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
  100. $(1)/usr/bin
  101. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
  102. $(CP) \
  103. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
  104. $(1)/usr/lib/snort_dynamicengine/
  105. $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
  106. $(CP) \
  107. $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
  108. $(1)/usr/lib/snort_dynamicpreprocessor/
  109. $(INSTALL_DIR) $(1)/etc/snort
  110. $(INSTALL_CONF) \
  111. $(PKG_BUILD_DIR)/etc/snort.conf \
  112. $(1)/etc/snort/
  113. $(INSTALL_CONF) \
  114. $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
  115. $(1)/etc/snort/
  116. $(INSTALL_CONF) \
  117. $(PKG_BUILD_DIR)/etc/classification.config \
  118. $(1)/etc/snort/
  119. $(INSTALL_CONF) \
  120. $(PKG_BUILD_DIR)/etc/gen-msg.map \
  121. $(1)/etc/snort/
  122. $(INSTALL_CONF) \
  123. $(PKG_BUILD_DIR)/etc/reference.config \
  124. $(1)/etc/snort/
  125. $(INSTALL_CONF) \
  126. $(PKG_BUILD_DIR)/etc/unicode.map \
  127. $(1)/etc/snort/
  128. $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
  129. $(INSTALL_CONF) \
  130. $(PKG_BUILD_DIR)/preproc_rules/*.rules \
  131. $(1)/etc/snort/preproc_rules/
  132. $(INSTALL_DIR) $(1)/etc/init.d
  133. $(INSTALL_BIN) \
  134. ./files/snort.init \
  135. $(1)/etc/init.d/snort
  136. $(INSTALL_DIR) $(1)/etc/config
  137. $(INSTALL_CONF) \
  138. ./files/snort.config \
  139. $(1)/etc/config/snort
  140. endef
  141. $(eval $(call BuildPackage,snort))