5d04e20ea0c065d2f0366e5078ee532c8be0ea30
[openwrt/svn-archive/archive.git] / net / ulogd / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ulogd
11 PKG_VERSION:=1.24
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/ulogd/ \
16 ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \
17 ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \
18 ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/
19 PKG_MD5SUM:=05b4ed2926b9a22aaeaf642917bbf8ff
20
21 define Package/ulogd/Default
22 SECTION:=net
23 CATEGORY:=Network
24 URL:=http://gnumonks.org/projects/ulogd
25 endef
26
27 define Package/ulogd
28 $(call Package/ulogd/Default)
29 DEPENDS:=+iptables
30 TITLE:=Netfilter userspace logging daemon
31 MENU:=1
32 endef
33
34 define Package/ulogd/conffiles
35 /etc/default/ulogd
36 /etc/ulogd.conf
37 endef
38
39 define Package/ulogd-mod-mysql
40 $(call Package/ulogd/Default)
41 DEPENDS:=ulogd +libmysqlclient
42 TITLE:=Output plugin for logging to a MySQL database
43 endef
44
45 define Package/ulogd-mod-pcap
46 $(call Package/ulogd/Default)
47 DEPENDS:=ulogd +libpcap
48 TITLE:=Output plugin for logging in pcap format
49 endef
50
51 define Package/ulogd-mod-pgsql
52 $(call Package/ulogd/Default)
53 DEPENDS:=ulogd +libpq
54 TITLE:=Output plugin for logging to a PostgreSQL database
55 endef
56
57 define Package/ulogd-mod-sqlite
58 $(call Package/ulogd/Default)
59 DEPENDS:=ulogd +libsqlite3
60 TITLE:=Output plugin for logging to an SQLite database
61 endef
62
63 define Package/ulogd-mod-extra
64 $(call Package/ulogd/Default)
65 DEPENDS:=ulogd
66 TITLE:=Extra plugins
67 endef
68
69 define Package/ulogd-mod-extra/description
70 This package contains the LOCAL, LOGEMU, OPRINT, PWSNIFF and SYSLOG plugins.
71 endef
72
73 include $(INCLUDE_DIR)/package.mk
74
75 ifneq ($(Package/ulogd-mod-mysql),)
76 ULOGD_MYSQL_OPTION:= --with-mysql="$(STAGING_DIR)/usr"
77 endif
78
79 ifneq ($(Package/ulogd-mod-pcap),)
80 ULOGD_PCAP_HEADER:=yes
81 else
82 ULOGD_PCAP_HEADER:=no
83 endif
84
85 ifneq ($(Package/ulogd-mod-pgsql),)
86 ULOGD_PGSQL_OPTION:= --with-pgsql="$(STAGING_DIR)/usr"
87 endif
88
89 ifneq ($(Package/ulogd-mod-sqlite),)
90 ULOGD_SQLITE_OPTION:= --with-sqlite3="$(STAGING_DIR)/usr"
91 endif
92
93 define Build/Configure
94 $(call Build/Configure/Default, \
95 $(ULOGD_MYSQL_OPTION) \
96 $(ULOGD_PGSQL_OPTION) \
97 $(ULOGD_SQLITE_OPTION) \
98 , \
99 ac_cv_header_pcap_h=$(ULOGD_PCAP_HEADER) \
100 )
101 endef
102
103 define Build/Compile
104 $(MAKE) -C $(PKG_BUILD_DIR) \
105 DESTDIR="$(PKG_INSTALL_DIR)" \
106 CFLAGS="$(TARGET_CFLAGS) \
107 -Iinclude \
108 -I$(PKG_BUILD_DIR)/include/ulogd \
109 -I$(PKG_BUILD_DIR)/include \
110 -I$(PKG_BUILD_DIR)/libipulog/include \
111 -I$(STAGING_DIR)/usr/include" \
112 all install
113 endef
114
115 define Package/ulogd/install
116 $(INSTALL_DIR) $(1)/etc
117 $(CP) $(PKG_INSTALL_DIR)/etc/ulogd.conf $(1)/etc/
118 $(INSTALL_DIR) $(1)/usr/sbin
119 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ulogd $(1)/usr/sbin/
120 $(INSTALL_DIR) $(1)/usr/lib/ulogd
121 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_BASE.so $(1)/usr/lib/ulogd/
122 $(INSTALL_DIR) $(1)/etc/default
123 $(INSTALL_DATA) ./files/ulogd.default $(1)/etc/default/ulogd
124 $(INSTALL_DIR) $(1)/etc/init.d
125 $(INSTALL_BIN) ./files/ulogd.init $(1)/etc/init.d/ulogd
126 endef
127
128 define BuildPlugin
129 define Package/$(1)/install
130 $(INSTALL_DIR) $$(1)/usr/lib/ulogd
131 for m in $(2); do \
132 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_$$$$$$$${m}.so $$(1)/usr/lib/ulogd/ ; \
133 done
134 endef
135
136 $$(eval $$(call BuildPackage,$(1)))
137 endef
138
139 $(eval $(call BuildPackage,ulogd))
140 $(eval $(call BuildPlugin,ulogd-mod-mysql,MYSQL))
141 $(eval $(call BuildPlugin,ulogd-mod-pcap,PCAP))
142 $(eval $(call BuildPlugin,ulogd-mod-pgsql,PGSQL))
143 $(eval $(call BuildPlugin,ulogd-mod-sqlite,SQLITE3))
144 $(eval $(call BuildPlugin,ulogd-mod-extra,LOCAL LOGEMU OPRINT PWSNIFF SYSLOG))