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.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.snort.org
/dl
/current
/
16 PKG_MD5SUM
:=9dc9060d1f2e248663eceffadfc45e7e
18 include $(INCLUDE_DIR
)/package.mk
20 define Package
/snort
/Default
21 SUBMENU
:=snort
(Ligthweight Network Intrusion Detection System
)
24 DEPENDS
:=+libnet0
+libpcap
+libpcre
25 TITLE
:=Ligthweight Network Intrusion Detection System
26 URL
:=http
://www.snort.org
/
30 $(call Package
/snort
/Default
)
33 define Package
/snort-mysql
34 $(call Package
/snort
/Default
)
35 DEPENDS
+= +libmysqlclient
39 define Package
/snort-pgsql
40 $(call Package
/snort
/Default
)
46 define Compile
/Template
48 $(PKG_BUILD_DIR
)/snort
$(1): $(STAMP_CONFIGURED
)
49 touch
-r
$(PKG_BUILD_DIR
)/Makefile.am
$(PKG_BUILD_DIR
)/configure.in
50 touch
-r
$(PKG_BUILD_DIR
)/Makefile.in
$(PKG_BUILD_DIR
)/configure
51 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
52 $(call Build
/Configure
/Default
, \
54 --with-libnet-includes
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \
55 --with-libnet-libraries
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib" \
56 --with-libpcap-includes
="$(STAGING_DIR)/usr/include" \
57 --with-libpcap-libraries
="$(STAGING_DIR)/usr/lib" \
58 --with-libpcre-includes
="$(STAGING_DIR)/usr/include" \
59 --with-libpcre-libraries
="$(STAGING_DIR)/usr/lib" \
62 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
63 LDFLAGS
="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
64 PATH
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \
67 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
70 mv
$(PKG_BUILD_DIR
)/src
/snort
$(PKG_BUILD_DIR
)/snort
$(1)
72 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/snort
$(1)
77 define Install
/Template
79 define Package
/snort
$(1)/conffiles
82 /etc
/snort
/threshold.conf
85 define Package
/snort
$(1)/install
86 $(INSTALL_DIR
) $$(1)/usr
/sbin
87 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/snort
$(1) $$(1)/usr
/sbin
/snort
88 $(INSTALL_DIR
) $$(1)/etc
/snort
89 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/snort.conf
$$(1)/etc
/snort
/
90 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/classification.config
$$(1)/etc
/snort
/
91 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/gen-msg.map
$$(1)/etc
/snort
/
92 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/reference.config
$$(1)/etc
/snort
/
93 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/sid-msg.map
$$(1)/etc
/snort
/
94 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/threshold.conf
$$(1)/etc
/snort
/
95 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/unicode.map
$$(1)/etc
/snort
/
96 $(INSTALL_DIR
) $$(1)/etc
/default
97 $(INSTALL_DATA
) .
/files
/snort.default
$$(1)/etc
/default
/snort
98 $(INSTALL_DIR
) $$(1)/etc
/init.d
99 $(INSTALL_BIN
) .
/files
/snort.init
$$(1)/etc
/init.d
/snort
105 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort
),)
107 $(call Compile
/Template
,, \
109 --without-postgresql \
111 $(call Install
/Template
,)
114 $(eval
$(Compile
/snort
))
116 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort-mysql
),)
117 define Compile
/snort-mysql
118 $(call Compile
/Template
,-mysql
, \
119 --with-mysql
="$(STAGING_DIR)/usr" \
120 --without-postgresql \
122 $(call Install
/Template
,-mysql
)
125 $(eval
$(Compile
/snort-mysql
))
128 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort-pgsql
),)
129 define Compile
/snort-pgsql
130 $(call Compile
/Template
,-pgsql
, \
132 --with-postgresql
="$(STAGING_DIR)/usr" \
134 $(call Install
/Template
,-pgsql
)
137 $(eval
$(Compile
/snort-pgsql
))
139 define Build
/Configure
145 $(eval
$(call BuildPackage
,snort
))
146 $(eval
$(call BuildPackage
,snort-mysql
))
147 $(eval
$(call BuildPackage
,snort-pgsql
))