2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://www.snort.org
/dl
/current
/
17 PKG_MD5SUM
:=9dc9060d1f2e248663eceffadfc45e7e
19 include $(INCLUDE_DIR
)/package.mk
21 define Package
/snort
/Default
22 SUBMENU
:=snort
(Ligthweight Network Intrusion Detection System
)
25 DEPENDS
:=+libnet0
+libpcap
+libpcre
26 TITLE
:=Ligthweight Network Intrusion Detection System
27 URL
:=http
://www.snort.org
/
31 $(call Package
/snort
/Default
)
34 define Package
/snort-mysql
35 $(call Package
/snort
/Default
)
36 DEPENDS
+= +libmysqlclient
40 define Package
/snort-pgsql
41 $(call Package
/snort
/Default
)
47 define Compile
/Template
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
, \
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" \
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" \
68 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
71 mv
$(PKG_BUILD_DIR
)/src
/snort
$(PKG_BUILD_DIR
)/snort
$(1)
73 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/snort
$(1)
78 define Install
/Template
80 define Package
/snort
$(1)/conffiles
83 /etc
/snort
/threshold.conf
86 define Package
/snort
$(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.default
$$(1)/etc
/default
/snort
99 $(INSTALL_DIR
) $$(1)/etc
/init.d
100 $(INSTALL_BIN
) .
/files
/snort.init
$$(1)/etc
/init.d
/snort
106 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort
),)
108 $(call Compile
/Template
,, \
110 --without-postgresql \
112 $(call Install
/Template
,)
115 $(eval
$(Compile
/snort
))
117 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort-mysql
),)
118 define Compile
/snort-mysql
119 $(call Compile
/Template
,-mysql
, \
120 --with-mysql
="$(STAGING_DIR)/usr" \
121 --without-postgresql \
123 $(call Install
/Template
,-mysql
)
126 $(eval
$(Compile
/snort-mysql
))
129 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort-pgsql
),)
130 define Compile
/snort-pgsql
131 $(call Compile
/Template
,-pgsql
, \
133 --with-postgresql
="$(STAGING_DIR)/usr" \
135 $(call Install
/Template
,-pgsql
)
138 $(eval
$(Compile
/snort-pgsql
))
140 define Build
/Configure
146 $(eval
$(call BuildPackage
,snort
))
147 $(eval
$(call BuildPackage
,snort-mysql
))
148 $(eval
$(call BuildPackage
,snort-pgsql
))