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.

210 lines
5.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:=ulogd
  9. PKG_VERSION:=2.0.5
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/ulogd/ \
  13. ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \
  14. ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \
  15. ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/
  16. PKG_HASH:=a221cb9f77347c0ca00d0937e27c1b90e3291a553cc62a4139b788e2e420e8c0
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  20. PKG_FIXUP:=autoreconf
  21. PKG_INSTALL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/ulogd/Default
  24. SECTION:=net
  25. CATEGORY:=Network
  26. URL:=http://www.netfilter.org/projects/ulogd/index.html
  27. endef
  28. define Package/ulogd
  29. $(call Package/ulogd/Default)
  30. DEPENDS:=+libmnl +libnfnetlink +libpthread
  31. TITLE:=Netfilter userspace logging daemon
  32. MENU:=1
  33. endef
  34. define Package/ulogd/conffiles
  35. /etc/ulogd.conf
  36. endef
  37. define Package/ulogd-mod-dbi
  38. $(call Package/ulogd/Default)
  39. DEPENDS:=ulogd +libdbi
  40. TITLE:=Output plugin for logging to a database using libdbi
  41. endef
  42. define Package/ulogd-mod-json
  43. $(call Package/ulogd/Default)
  44. DEPENDS:=ulogd +jansson
  45. TITLE:=JSON output plugin
  46. endef
  47. define Package/ulogd-mod-mysql
  48. $(call Package/ulogd/Default)
  49. DEPENDS:=ulogd +libmysqlclient
  50. TITLE:=Output plugin for logging to a MySQL database
  51. endef
  52. define Package/ulogd-mod-nfacct
  53. $(call Package/ulogd/Default)
  54. DEPENDS:=ulogd +libnetfilter-acct
  55. TITLE:=Input plugin for flow-based logging (accounting)
  56. endef
  57. define Package/ulogd-mod-nfct
  58. $(call Package/ulogd/Default)
  59. DEPENDS:=ulogd +libnetfilter-conntrack
  60. TITLE:=Input plugin for flow-based logging (conntracking)
  61. endef
  62. define Package/ulogd-mod-nflog
  63. $(call Package/ulogd/Default)
  64. DEPENDS:=ulogd +libnetfilter-log
  65. TITLE:=Input plugin using NFLOG
  66. endef
  67. define Package/ulogd-mod-pcap
  68. $(call Package/ulogd/Default)
  69. DEPENDS:=ulogd +libpcap
  70. TITLE:=Output plugin for logging in pcap format
  71. endef
  72. define Package/ulogd-mod-pgsql
  73. $(call Package/ulogd/Default)
  74. DEPENDS:=ulogd +libpq
  75. TITLE:=Output plugin for logging to a PostgreSQL database
  76. endef
  77. define Package/ulogd-mod-sqlite
  78. $(call Package/ulogd/Default)
  79. DEPENDS:=ulogd +libsqlite3
  80. TITLE:=Output plugin for logging to an SQLite database
  81. endef
  82. define Package/ulogd-mod-syslog
  83. $(call Package/ulogd/Default)
  84. DEPENDS:=ulogd
  85. TITLE:=Syslog output plugin
  86. endef
  87. define Package/ulogd-mod-xml
  88. $(call Package/ulogd/Default)
  89. DEPENDS:=ulogd +libnetfilter-acct +libnetfilter-conntrack +libnetfilter-log
  90. TITLE:=XML output plugin
  91. endef
  92. define Package/ulogd-mod-extra
  93. $(call Package/ulogd/Default)
  94. DEPENDS:=ulogd
  95. TITLE:=Extra plugins
  96. endef
  97. PKG_BUILD_DEPENDS:=libnetfilter-acct libnetfilter-conntrack libnetfilter-log
  98. PKG_CONFIG_DEPENDS:= \
  99. CONFIG_PACKAGE_ulogd-mod-dbi \
  100. CONFIG_PACKAGE_ulogd-mod-mysql \
  101. CONFIG_PACKAGE_ulogd-mod-pgsql \
  102. CONFIG_PACKAGE_ulogd-mod-sqlite \
  103. TARGET_CFLAGS += \
  104. -D_GNU_SOURCE \
  105. CONFIGURE_ARGS += \
  106. --enable-nfacct \
  107. --enable-nfct \
  108. --enable-nflog \
  109. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-dbi),)
  110. CONFIGURE_ARGS += --with-dbi \
  111. --with-dbi-inc=$(STAGING_DIR)/usr/include/dbi \
  112. --with-dbi-lib=$(STAGING_DIR)/usr/lib
  113. else
  114. CONFIGURE_ARGS += --without-dbi
  115. endif
  116. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-mysql),)
  117. CONFIGURE_ARGS += --with-mysql="$(STAGING_DIR)/usr"
  118. else
  119. CONFIGURE_ARGS += --without-mysql
  120. endif
  121. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-pgsql),)
  122. CONFIGURE_ARGS += --with-pgsql="$(STAGING_DIR)/usr"
  123. else
  124. CONFIGURE_ARGS += --without-pgsql
  125. endif
  126. ifneq ($(SDK)$(CONFIG_PACKAGE_ulogd-mod-sqlite),)
  127. CONFIGURE_ARGS += --with-sqlite="$(STAGING_DIR)/usr"
  128. else
  129. CONFIGURE_ARGS += --without-sqlite
  130. endif
  131. define Package/ulogd/install
  132. $(INSTALL_DIR) $(1)/etc
  133. $(CP) $(PKG_BUILD_DIR)/ulogd.conf $(1)/etc/
  134. $(INSTALL_DIR) $(1)/usr/sbin
  135. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ulogd $(1)/usr/sbin/
  136. $(INSTALL_DIR) $(1)/usr/lib/ulogd
  137. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_raw2packet_BASE.so $(1)/usr/lib/ulogd/
  138. $(INSTALL_DIR) $(1)/etc/init.d
  139. $(INSTALL_BIN) ./files/ulogd.init $(1)/etc/init.d/ulogd
  140. endef
  141. define BuildPlugin
  142. define Package/ulogd-mod-$(1)/install
  143. $(INSTALL_DIR) $$(1)/usr/lib/ulogd
  144. for m in $(2); do \
  145. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_$$$$$$$${m}.so $$(1)/usr/lib/ulogd/ ; \
  146. done
  147. endef
  148. $$(eval $$(call BuildPackage,ulogd-mod-$(1)))
  149. endef
  150. ULOGD_EXTRA_PLUGINS:= \
  151. filter_HWHDR \
  152. filter_IFINDEX \
  153. filter_IP2BIN \
  154. filter_IP2HBIN \
  155. filter_IP2STR \
  156. filter_MARK \
  157. filter_PRINTFLOW \
  158. filter_PRINTPKT \
  159. filter_PWSNIFF \
  160. inppkt_UNIXSOCK \
  161. output_GPRINT \
  162. output_GRAPHITE \
  163. output_LOGEMU \
  164. output_OPRINT \
  165. $(eval $(call BuildPackage,ulogd))
  166. $(eval $(call BuildPlugin,dbi,output_DBI))
  167. $(eval $(call BuildPlugin,json,output_JSON))
  168. $(eval $(call BuildPlugin,mysql,output_MYSQL))
  169. $(eval $(call BuildPlugin,nfacct,inpflow_NFACCT))
  170. $(eval $(call BuildPlugin,nfct,inpflow_NFCT))
  171. $(eval $(call BuildPlugin,nflog,inppkt_NFLOG))
  172. $(eval $(call BuildPlugin,pcap,output_PCAP))
  173. $(eval $(call BuildPlugin,pgsql,output_PGSQL))
  174. $(eval $(call BuildPlugin,sqlite,output_SQLITE3))
  175. $(eval $(call BuildPlugin,syslog,output_SYSLOG))
  176. $(eval $(call BuildPlugin,xml,output_XML))
  177. $(eval $(call BuildPlugin,extra,$(ULOGD_EXTRA_PLUGINS)))