Update tinyproxy to 1.6.4 (#4007)
[openwrt/svn-archive/archive.git] / net / snort-wireless / 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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=snort-wireless
12 PKG_VERSION:=2.4.3-alpha04
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.snort-wireless.org/files/
17 PKG_MD5SUM:=1aa699ae279bf7a1140cf6cca02f9999
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/snort-wireless/Default
22 SUBMENU:=snort-wireless (Ligthweight Network Intrusion Detection System)
23 SECTION:=net
24 CATEGORY:=Network
25 DEPENDS:=+libnet0 +libpcap +libpcre
26 TITLE:=Ligthweight Network Intrusion Detection System
27 URL:=http://www.snort-wireless.org/
28 endef
29
30 define Package/snort-wireless
31 $(call Package/snort-wireless/Default)
32 endef
33
34 define Package/snort-wireless-mysql
35 $(call Package/snort-wireless/Default)
36 DEPENDS+= +libmysqlclient
37 TITLE+= (MySQL)
38 endef
39
40 define Package/snort-wireless-pgsql
41 $(call Package/snort-wireless/Default)
42 DEPENDS+= +libpq
43 TITLE+= (PostgreSQL)
44 endef
45
46
47 define Compile/Template
48
49 $(PKG_BUILD_DIR)/snort$(1): $(PKG_BUILD_DIR)/.configured
50 touch -r $(PKG_BUILD_DIR)/Makefile.am $(PKG_BUILD_DIR)/configure.in
51 touch -r $(PKG_BUILD_DIR)/Makefile.in $(PKG_BUILD_DIR)/configure
52 -$(MAKE) -C $(PKG_BUILD_DIR) distclean
53 $(call Build/Configure/Default, \
54 --enable-flexresp \
55 --with-libnet-includes="$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \
56 --with-libnet-libraries="$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib" \
57 --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
58 --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
59 --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
60 --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
61 $(2) \
62 , \
63 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
64 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
65 PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \
66 $(3) \
67 );
68 $(MAKE) -C $(PKG_BUILD_DIR) \
69 extra_incl="" \
70 all
71 mv $(PKG_BUILD_DIR)/src/snort $(PKG_BUILD_DIR)/snort$(1)
72
73 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/snort$(1)
74
75 endef
76
77
78 define Install/Template
79
80 define Package/snort-wireless$(1)/conffiles
81 /etc/default/snort
82 /etc/snort/snort.conf
83 /etc/snort/threshold.conf
84 endef
85
86 define Package/snort-wireless$(1)/install
87 $(INSTALL_DIR) $$(1)/usr/sbin
88 $(INSTALL_BIN) $(PKG_BUILD_DIR)/snort$(1) $$(1)/usr/sbin/snort
89 $(INSTALL_DIR) $$(1)/etc/snort
90 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/snort.conf $$(1)/etc/snort/
91 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/classification.config $$(1)/etc/snort/
92 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/gen-msg.map $$(1)/etc/snort/
93 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/reference.config $$(1)/etc/snort/
94 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/sid-msg.map $$(1)/etc/snort/
95 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/threshold.conf $$(1)/etc/snort/
96 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/unicode.map $$(1)/etc/snort/
97 $(INSTALL_DIR) $$(1)/etc/default
98 $(INSTALL_DATA) ./files/snort-wireless.default $$(1)/etc/default/snort
99 $(INSTALL_DIR) $$(1)/etc/init.d
100 $(INSTALL_BIN) ./files/snort-wireless.init $$(1)/etc/init.d/snort
101 endef
102
103 endef
104
105
106 ifneq ($(SDK)$(CONFIG_PACKAGE_snort-wireless),)
107 define Compile/snort-wireless
108 $(call Compile/Template,, \
109 --without-mysql \
110 --without-postgresql \
111 )
112 $(call Install/Template,)
113 endef
114 endif
115 $(eval $(Compile/snort-wireless))
116
117
118 ifneq ($(SDK)$(CONFIG_PACKAGE_snort-wireless-mysql),)
119 define Compile/snort-wireless-mysql
120 $(call Compile/Template,-mysql, \
121 --with-mysql="$(STAGING_DIR)/usr" \
122 --without-postgresql \
123 )
124 $(call Install/Template,-mysql)
125 endef
126 endif
127 $(eval $(Compile/snort-wireless-mysql))
128
129 ifneq ($(SDK)$(CONFIG_PACKAGE_snort-wireless-pgsql),)
130 define Compile/snort-wireless-pgsql
131 $(call Compile/Template,-pgsql, \
132 --without-mysql \
133 --with-postgresql="$(STAGING_DIR)/usr" \
134 )
135 $(call Install/Template,-pgsql)
136 endef
137 endif
138 $(eval $(Compile/snort-wireless-pgsql))
139
140 define Build/Configure
141 endef
142
143 define Build/Compile
144 endef
145
146 $(eval $(call BuildPackage,snort-wireless))
147 $(eval $(call BuildPackage,snort-wireless-mysql))
148 $(eval $(call BuildPackage,snort-wireless-pgsql))