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.

206 lines
5.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:=ulogd
  9. PKG_VERSION:=2.0.7
  10. PKG_RELEASE:=3
  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_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  16. PKG_LICENSE:=GPL-2.0-only
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_BUILD_DEPENDS:=libnetfilter-acct libnetfilter-conntrack libnetfilter-log
  21. PKG_CONFIG_DEPENDS:= \
  22. CONFIG_PACKAGE_ulogd-mod-dbi \
  23. CONFIG_PACKAGE_ulogd-mod-mysql \
  24. CONFIG_PACKAGE_ulogd-mod-pgsql \
  25. CONFIG_PACKAGE_ulogd-mod-sqlite
  26. include $(INCLUDE_DIR)/package.mk
  27. define Package/ulogd/Default
  28. SECTION:=net
  29. CATEGORY:=Network
  30. URL:=https://www.netfilter.org/projects/ulogd/index.html
  31. endef
  32. define Package/ulogd
  33. $(call Package/ulogd/Default)
  34. DEPENDS:=+libmnl +libnfnetlink +libpthread
  35. TITLE:=Netfilter userspace logging daemon
  36. MENU:=1
  37. endef
  38. define Package/ulogd/conffiles
  39. /etc/ulogd.conf
  40. endef
  41. define Package/ulogd-mod-dbi
  42. $(call Package/ulogd/Default)
  43. DEPENDS:=ulogd +PACKAGE_ulogd-mod-dbi:libdbi
  44. TITLE:=Output plugin for logging to a database using libdbi
  45. endef
  46. define Package/ulogd-mod-json
  47. $(call Package/ulogd/Default)
  48. DEPENDS:=ulogd +PACKAGE_ulogd-mod-json:jansson
  49. TITLE:=JSON output plugin
  50. endef
  51. define Package/ulogd-mod-mysql
  52. $(call Package/ulogd/Default)
  53. DEPENDS:=ulogd +PACKAGE_ulogd-mod-mysql:libmysqlclient
  54. TITLE:=Output plugin for logging to a MySQL database
  55. endef
  56. define Package/ulogd-mod-nfacct
  57. $(call Package/ulogd/Default)
  58. DEPENDS:=ulogd +PACKAGE_ulogd-mod-nfacct:libnetfilter-acct
  59. TITLE:=Input plugin for flow-based logging (accounting)
  60. endef
  61. define Package/ulogd-mod-nfct
  62. $(call Package/ulogd/Default)
  63. DEPENDS:=ulogd +PACKAGE_ulogd-mod-nfct:libnetfilter-conntrack
  64. TITLE:=Input plugin for flow-based logging (conntracking)
  65. endef
  66. define Package/ulogd-mod-nflog
  67. $(call Package/ulogd/Default)
  68. DEPENDS:=ulogd +PACKAGE_ulogd-mod-nflog:libnetfilter-log
  69. TITLE:=Input plugin using NFLOG
  70. endef
  71. define Package/ulogd-mod-pcap
  72. $(call Package/ulogd/Default)
  73. DEPENDS:=ulogd +PACKAGE_ulogd-mod-pcap:libpcap
  74. TITLE:=Output plugin for logging in pcap format
  75. endef
  76. define Package/ulogd-mod-pgsql
  77. $(call Package/ulogd/Default)
  78. DEPENDS:=ulogd +PACKAGE_ulogd-mod-pgsql:libpq
  79. TITLE:=Output plugin for logging to a PostgreSQL database
  80. endef
  81. define Package/ulogd-mod-sqlite
  82. $(call Package/ulogd/Default)
  83. DEPENDS:=ulogd +PACKAGE_ulogd-mod-sqlite:libsqlite3
  84. TITLE:=Output plugin for logging to an SQLite database
  85. endef
  86. define Package/ulogd-mod-syslog
  87. $(call Package/ulogd/Default)
  88. DEPENDS:=ulogd
  89. TITLE:=Syslog output plugin
  90. endef
  91. define Package/ulogd-mod-xml
  92. $(call Package/ulogd/Default)
  93. DEPENDS:=ulogd +PACKAGE_ulogd-mod-xml:libnetfilter-acct +PACKAGE_ulogd-mod-xml:libnetfilter-conntrack +PACKAGE_ulogd-mod-xml:libnetfilter-log
  94. TITLE:=XML output plugin
  95. endef
  96. define Package/ulogd-mod-extra
  97. $(call Package/ulogd/Default)
  98. DEPENDS:=ulogd
  99. TITLE:=Extra plugins
  100. endef
  101. CONFIGURE_ARGS += \
  102. --enable-nfacct \
  103. --enable-nfct \
  104. --enable-nflog
  105. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-dbi),)
  106. CONFIGURE_ARGS += --with-dbi \
  107. --with-dbi-inc=$(STAGING_DIR)/usr/include/dbi \
  108. --with-dbi-lib=$(STAGING_DIR)/usr/lib
  109. else
  110. CONFIGURE_ARGS += --without-dbi
  111. endif
  112. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-mysql),)
  113. CONFIGURE_ARGS += \
  114. --with-mysql-inc=$(STAGING_DIR)/usr/include/mysql \
  115. --with-mysql-lib=$(STAGING_DIR)/usr/lib/mysql
  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)))