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.

200 lines
5.1 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-mysql
  43. $(call Package/ulogd/Default)
  44. DEPENDS:=ulogd +libmysqlclient
  45. TITLE:=Output plugin for logging to a MySQL database
  46. endef
  47. define Package/ulogd-mod-nfacct
  48. $(call Package/ulogd/Default)
  49. DEPENDS:=ulogd +libnetfilter-acct
  50. TITLE:=Input plugin for flow-based logging (accounting)
  51. endef
  52. define Package/ulogd-mod-nfct
  53. $(call Package/ulogd/Default)
  54. DEPENDS:=ulogd +libnetfilter-conntrack
  55. TITLE:=Input plugin for flow-based logging (conntracking)
  56. endef
  57. define Package/ulogd-mod-nflog
  58. $(call Package/ulogd/Default)
  59. DEPENDS:=ulogd +libnetfilter-log
  60. TITLE:=Input plugin using NFLOG
  61. endef
  62. define Package/ulogd-mod-pcap
  63. $(call Package/ulogd/Default)
  64. DEPENDS:=ulogd +libpcap
  65. TITLE:=Output plugin for logging in pcap format
  66. endef
  67. define Package/ulogd-mod-pgsql
  68. $(call Package/ulogd/Default)
  69. DEPENDS:=ulogd +libpq
  70. TITLE:=Output plugin for logging to a PostgreSQL database
  71. endef
  72. define Package/ulogd-mod-sqlite
  73. $(call Package/ulogd/Default)
  74. DEPENDS:=ulogd +libsqlite3
  75. TITLE:=Output plugin for logging to an SQLite database
  76. endef
  77. define Package/ulogd-mod-syslog
  78. $(call Package/ulogd/Default)
  79. DEPENDS:=ulogd
  80. TITLE:=Syslog output plugin
  81. endef
  82. define Package/ulogd-mod-xml
  83. $(call Package/ulogd/Default)
  84. DEPENDS:=ulogd +libnetfilter-acct +libnetfilter-conntrack +libnetfilter-log
  85. TITLE:=XML output plugin
  86. endef
  87. define Package/ulogd-mod-extra
  88. $(call Package/ulogd/Default)
  89. DEPENDS:=ulogd
  90. TITLE:=Extra plugins
  91. endef
  92. PKG_BUILD_DEPENDS:=libnetfilter-acct libnetfilter-conntrack libnetfilter-log
  93. PKG_CONFIG_DEPENDS:= \
  94. CONFIG_PACKAGE_ulogd-mod-dbi \
  95. CONFIG_PACKAGE_ulogd-mod-mysql \
  96. CONFIG_PACKAGE_ulogd-mod-pgsql \
  97. CONFIG_PACKAGE_ulogd-mod-sqlite \
  98. CONFIGURE_ARGS += \
  99. --enable-nfacct \
  100. --enable-nfct \
  101. --enable-nflog \
  102. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-dbi),)
  103. CONFIGURE_ARGS += --with-dbi \
  104. --with-dbi-inc=$(STAGING_DIR)/usr/include/dbi \
  105. --with-dbi-lib=$(STAGING_DIR)/usr/lib
  106. else
  107. CONFIGURE_ARGS += --without-dbi
  108. endif
  109. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-mysql),)
  110. CONFIGURE_ARGS += --with-mysql="$(STAGING_DIR)/usr"
  111. else
  112. CONFIGURE_ARGS += --without-mysql
  113. endif
  114. ifneq ($(DEVELOPER)$(SDK)$(CONFIG_PACKAGE_ulogd-mod-pgsql),)
  115. CONFIGURE_ARGS += --with-pgsql="$(STAGING_DIR)/usr"
  116. else
  117. CONFIGURE_ARGS += --without-pgsql
  118. endif
  119. ifneq ($(SDK)$(CONFIG_PACKAGE_ulogd-mod-sqlite),)
  120. CONFIGURE_ARGS += --with-sqlite="$(STAGING_DIR)/usr"
  121. else
  122. CONFIGURE_ARGS += --without-sqlite
  123. endif
  124. define Package/ulogd/install
  125. $(INSTALL_DIR) $(1)/etc
  126. $(CP) $(PKG_BUILD_DIR)/ulogd.conf $(1)/etc/
  127. $(INSTALL_DIR) $(1)/usr/sbin
  128. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ulogd $(1)/usr/sbin/
  129. $(INSTALL_DIR) $(1)/usr/lib/ulogd
  130. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_raw2packet_BASE.so $(1)/usr/lib/ulogd/
  131. $(INSTALL_DIR) $(1)/etc/init.d
  132. $(INSTALL_BIN) ./files/ulogd.init $(1)/etc/init.d/ulogd
  133. endef
  134. define BuildPlugin
  135. define Package/ulogd-mod-$(1)/install
  136. $(INSTALL_DIR) $$(1)/usr/lib/ulogd
  137. for m in $(2); do \
  138. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_$$$$$$$${m}.so $$(1)/usr/lib/ulogd/ ; \
  139. done
  140. endef
  141. $$(eval $$(call BuildPackage,ulogd-mod-$(1)))
  142. endef
  143. ULOGD_EXTRA_PLUGINS:= \
  144. filter_HWHDR \
  145. filter_IFINDEX \
  146. filter_IP2BIN \
  147. filter_IP2HBIN \
  148. filter_IP2STR \
  149. filter_MARK \
  150. filter_PRINTFLOW \
  151. filter_PRINTPKT \
  152. filter_PWSNIFF \
  153. inppkt_UNIXSOCK \
  154. output_GPRINT \
  155. output_GRAPHITE \
  156. output_LOGEMU \
  157. output_OPRINT \
  158. $(eval $(call BuildPackage,ulogd))
  159. $(eval $(call BuildPlugin,dbi,output_DBI))
  160. $(eval $(call BuildPlugin,mysql,output_MYSQL))
  161. $(eval $(call BuildPlugin,nfacct,inpflow_NFACCT))
  162. $(eval $(call BuildPlugin,nfct,inpflow_NFCT))
  163. $(eval $(call BuildPlugin,nflog,inppkt_NFLOG))
  164. $(eval $(call BuildPlugin,pcap,output_PCAP))
  165. $(eval $(call BuildPlugin,pgsql,output_PGSQL))
  166. $(eval $(call BuildPlugin,sqlite,output_SQLITE3))
  167. $(eval $(call BuildPlugin,syslog,output_SYSLOG))
  168. $(eval $(call BuildPlugin,xml,output_XML))
  169. $(eval $(call BuildPlugin,extra,$(ULOGD_EXTRA_PLUGINS)))