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 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
20 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/snort
/Default
25 SUBMENU
:=snort
(Ligthweight Network Intrusion Detection System
)
28 DEPENDS
:=+libnet0
+libpcap
+libpcre
29 TITLE
:=Ligthweight Network Intrusion Detection System
30 URL
:=http
://www.snort.org
/
34 $(call Package
/snort
/Default
)
37 define Package
/snort-mysql
38 $(call Package
/snort
/Default
)
39 DEPENDS
+= +libmysqlclient
43 define Package
/snort-pgsql
44 $(call Package
/snort
/Default
)
50 define Compile
/Template
52 $(PKG_BUILD_DIR
)/snort
$(1): $(PKG_BUILD_DIR
)/.configured
53 touch
-r
$(PKG_BUILD_DIR
)/Makefile.am
$(PKG_BUILD_DIR
)/configure.in
54 touch
-r
$(PKG_BUILD_DIR
)/Makefile.in
$(PKG_BUILD_DIR
)/configure
55 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
56 $(call Build
/Configure
/Default
, \
58 --with-libnet-includes
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \
59 --with-libnet-libraries
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib" \
60 --with-libpcap-includes
="$(STAGING_DIR)/usr/include" \
61 --with-libpcap-libraries
="$(STAGING_DIR)/usr/lib" \
62 --with-libpcre-includes
="$(STAGING_DIR)/usr/include" \
63 --with-libpcre-libraries
="$(STAGING_DIR)/usr/lib" \
66 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
67 LDFLAGS
="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
68 PATH
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \
71 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
74 mv
$(PKG_BUILD_DIR
)/src
/snort
$(PKG_BUILD_DIR
)/snort
$(1)
76 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/snort
$(1)
81 define Install
/Template
83 define Package
/snort
$(1)/conffiles
86 /etc
/snort
/threshold.conf
89 define Package
/snort
$(1)/install
90 $(INSTALL_DIR
) $$(1)/usr
/sbin
91 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/snort
$(1) $$(1)/usr
/sbin
/snort
92 $(INSTALL_DIR
) $$(1)/etc
/snort
93 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/snort.conf
$$(1)/etc
/snort
/
94 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/classification.config
$$(1)/etc
/snort
/
95 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/gen-msg.map
$$(1)/etc
/snort
/
96 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/reference.config
$$(1)/etc
/snort
/
97 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/sid-msg.map
$$(1)/etc
/snort
/
98 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/threshold.conf
$$(1)/etc
/snort
/
99 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/unicode.map
$$(1)/etc
/snort
/
100 $(INSTALL_DIR
) $$(1)/etc
/default
101 $(INSTALL_DATA
) .
/files
/snort.default
$$(1)/etc
/default
/snort
102 $(INSTALL_DIR
) $$(1)/etc
/init.d
103 $(INSTALL_BIN
) .
/files
/snort.init
$$(1)/etc
/init.d
/snort
109 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort
),)
111 $(call Compile
/Template
,, \
113 --without-postgresql \
115 $(call Install
/Template
,)
118 $(eval
$(Compile
/snort
))
120 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort-mysql
),)
121 define Compile
/snort-mysql
122 $(call Compile
/Template
,-mysql
, \
123 --with-mysql
="$(STAGING_DIR)/usr" \
124 --without-postgresql \
126 $(call Install
/Template
,-mysql
)
129 $(eval
$(Compile
/snort-mysql
))
132 ifneq ($(SDK
)$(CONFIG_PACKAGE_snort-pgsql
),)
133 define Compile
/snort-pgsql
134 $(call Compile
/Template
,-pgsql
, \
136 --with-postgresql
="$(STAGING_DIR)/usr" \
138 $(call Install
/Template
,-pgsql
)
141 $(eval
$(Compile
/snort-pgsql
))
143 define Build
/Configure
149 $(eval
$(call BuildPackage
,snort
))
150 $(eval
$(call BuildPackage
,snort-mysql
))
151 $(eval
$(call BuildPackage
,snort-pgsql
))