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.

207 lines
5.2 KiB

  1. #
  2. # Copyright (C) 2006-2014 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.4
  10. PKG_RELEASE:=1
  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_MD5SUM:=7c71ec460dfea5287eba27472c521ebc
  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. CONFIGURE_ARGS += \
  104. --enable-nfacct \
  105. --enable-nfct \
  106. --enable-nflog \
  107. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-dbi),)
  108. CONFIGURE_ARGS += --with-dbi \
  109. --with-dbi-inc=$(STAGING_DIR)/usr/include/dbi \
  110. --with-dbi-lib=$(STAGING_DIR)/usr/lib
  111. else
  112. CONFIGURE_ARGS += --without-dbi
  113. endif
  114. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-mysql),)
  115. CONFIGURE_ARGS += --with-mysql="$(STAGING_DIR)/usr"
  116. else
  117. CONFIGURE_ARGS += --without-mysql
  118. endif
  119. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-pgsql),)
  120. CONFIGURE_ARGS += --with-pgsql="$(STAGING_DIR)/usr"
  121. else
  122. CONFIGURE_ARGS += --without-pgsql
  123. endif
  124. ifneq ($(SDK)$(CONFIG_PACKAGE_ulogd-mod-sqlite),)
  125. CONFIGURE_ARGS += --with-sqlite="$(STAGING_DIR)/usr"
  126. else
  127. CONFIGURE_ARGS += --without-sqlite
  128. endif
  129. define Package/ulogd/install
  130. $(INSTALL_DIR) $(1)/etc
  131. $(CP) $(PKG_BUILD_DIR)/ulogd.conf $(1)/etc/
  132. $(INSTALL_DIR) $(1)/usr/sbin
  133. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ulogd $(1)/usr/sbin/
  134. $(INSTALL_DIR) $(1)/usr/lib/ulogd
  135. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_raw2packet_BASE.so $(1)/usr/lib/ulogd/
  136. $(INSTALL_DIR) $(1)/etc/init.d
  137. $(INSTALL_BIN) ./files/ulogd.init $(1)/etc/init.d/ulogd
  138. endef
  139. define BuildPlugin
  140. define Package/ulogd-mod-$(1)/install
  141. $(INSTALL_DIR) $$(1)/usr/lib/ulogd
  142. for m in $(2); do \
  143. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_$$$$$$$${m}.so $$(1)/usr/lib/ulogd/ ; \
  144. done
  145. endef
  146. $$(eval $$(call BuildPackage,ulogd-mod-$(1)))
  147. endef
  148. ULOGD_EXTRA_PLUGINS:= \
  149. filter_HWHDR \
  150. filter_IFINDEX \
  151. filter_IP2BIN \
  152. filter_IP2HBIN \
  153. filter_IP2STR \
  154. filter_MARK \
  155. filter_PRINTFLOW \
  156. filter_PRINTPKT \
  157. filter_PWSNIFF \
  158. inppkt_UNIXSOCK \
  159. output_GPRINT \
  160. output_GRAPHITE \
  161. output_LOGEMU \
  162. output_OPRINT \
  163. $(eval $(call BuildPackage,ulogd))
  164. $(eval $(call BuildPlugin,dbi,output_DBI))
  165. $(eval $(call BuildPlugin,json,output_JSON))
  166. $(eval $(call BuildPlugin,mysql,output_MYSQL))
  167. $(eval $(call BuildPlugin,nfacct,inpflow_NFACCT))
  168. $(eval $(call BuildPlugin,nfct,inpflow_NFCT))
  169. $(eval $(call BuildPlugin,nflog,inppkt_NFLOG))
  170. $(eval $(call BuildPlugin,pcap,output_PCAP))
  171. $(eval $(call BuildPlugin,pgsql,output_PGSQL))
  172. $(eval $(call BuildPlugin,sqlite,output_SQLITE3))
  173. $(eval $(call BuildPlugin,syslog,output_SYSLOG))
  174. $(eval $(call BuildPlugin,xml,output_XML))
  175. $(eval $(call BuildPlugin,extra,$(ULOGD_EXTRA_PLUGINS)))