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.6 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.7
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=https://netfilter.org/projects/ulogd/files/ \
  13. ftp://ftp.netfilter.org/pub/ulogd/
  14. PKG_HASH:=990a05494d9c16029ba0a83f3b7294fc05c756546b8d60d1c1572dc25249a92b
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/ulogd/Default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. URL:=http://www.netfilter.org/projects/ulogd/index.html
  25. endef
  26. define Package/ulogd
  27. $(call Package/ulogd/Default)
  28. DEPENDS:=+libmnl +libnfnetlink +libpthread
  29. TITLE:=Netfilter userspace logging daemon
  30. MENU:=1
  31. endef
  32. define Package/ulogd/conffiles
  33. /etc/ulogd.conf
  34. endef
  35. define Package/ulogd-mod-dbi
  36. $(call Package/ulogd/Default)
  37. DEPENDS:=ulogd +PACKAGE_ulogd-mod-dbi:libdbi
  38. TITLE:=Output plugin for logging to a database using libdbi
  39. endef
  40. define Package/ulogd-mod-json
  41. $(call Package/ulogd/Default)
  42. DEPENDS:=ulogd +PACKAGE_ulogd-mod-json:jansson
  43. TITLE:=JSON output plugin
  44. endef
  45. define Package/ulogd-mod-mysql
  46. $(call Package/ulogd/Default)
  47. DEPENDS:=ulogd +PACKAGE_ulogd-mod-mysql:libmysqlclient
  48. TITLE:=Output plugin for logging to a MySQL database
  49. endef
  50. define Package/ulogd-mod-nfacct
  51. $(call Package/ulogd/Default)
  52. DEPENDS:=ulogd +PACKAGE_ulogd-mod-nfacct:libnetfilter-acct
  53. TITLE:=Input plugin for flow-based logging (accounting)
  54. endef
  55. define Package/ulogd-mod-nfct
  56. $(call Package/ulogd/Default)
  57. DEPENDS:=ulogd +PACKAGE_ulogd-mod-nfct:libnetfilter-conntrack
  58. TITLE:=Input plugin for flow-based logging (conntracking)
  59. endef
  60. define Package/ulogd-mod-nflog
  61. $(call Package/ulogd/Default)
  62. DEPENDS:=ulogd +PACKAGE_ulogd-mod-nflog:libnetfilter-log
  63. TITLE:=Input plugin using NFLOG
  64. endef
  65. define Package/ulogd-mod-pcap
  66. $(call Package/ulogd/Default)
  67. DEPENDS:=ulogd +PACKAGE_ulogd-mod-pcap:libpcap
  68. TITLE:=Output plugin for logging in pcap format
  69. endef
  70. define Package/ulogd-mod-pgsql
  71. $(call Package/ulogd/Default)
  72. DEPENDS:=ulogd +PACKAGE_ulogd-mod-pgsql:libpq
  73. TITLE:=Output plugin for logging to a PostgreSQL database
  74. endef
  75. define Package/ulogd-mod-sqlite
  76. $(call Package/ulogd/Default)
  77. DEPENDS:=ulogd +PACKAGE_ulogd-mod-sqlite:libsqlite3
  78. TITLE:=Output plugin for logging to an SQLite database
  79. endef
  80. define Package/ulogd-mod-syslog
  81. $(call Package/ulogd/Default)
  82. DEPENDS:=ulogd
  83. TITLE:=Syslog output plugin
  84. endef
  85. define Package/ulogd-mod-xml
  86. $(call Package/ulogd/Default)
  87. DEPENDS:=ulogd +PACKAGE_ulogd-mod-xml:libnetfilter-acct +PACKAGE_ulogd-mod-xml:libnetfilter-conntrack +PACKAGE_ulogd-mod-xml:libnetfilter-log
  88. TITLE:=XML output plugin
  89. endef
  90. define Package/ulogd-mod-extra
  91. $(call Package/ulogd/Default)
  92. DEPENDS:=ulogd
  93. TITLE:=Extra plugins
  94. endef
  95. PKG_BUILD_DEPENDS:=libnetfilter-acct libnetfilter-conntrack libnetfilter-log
  96. PKG_CONFIG_DEPENDS:= \
  97. CONFIG_PACKAGE_ulogd-mod-dbi \
  98. CONFIG_PACKAGE_ulogd-mod-mysql \
  99. CONFIG_PACKAGE_ulogd-mod-pgsql \
  100. CONFIG_PACKAGE_ulogd-mod-sqlite \
  101. TARGET_CFLAGS += \
  102. -D_GNU_SOURCE \
  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 += \
  116. --with-mysql-inc=$(STAGING_DIR)/usr/include/mysql \
  117. --with-mysql-lib=$(STAGING_DIR)/usr/lib/mysql
  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)))