disable delayed branch optimization for kernel - seems to improve stability on v1...
[openwrt.git] / openwrt / package / snort / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=snort
6 PKG_VERSION:=2.3.3
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=06bf140893e7cb120aaa9372d10a0100
9
10 PKG_SOURCE_URL:= \
11 http://www.snort.org/dl/current/ \
12 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 include $(TOPDIR)/package/templates.mk
20
21 PKG_CONFIGURE_OPTS := \
22 --target=$(GNU_TARGET_NAME) \
23 --host=$(GNU_TARGET_NAME) \
24 --build=$(GNU_HOST_NAME) \
25 --program-prefix="" \
26 --program-suffix="" \
27 --prefix=/usr \
28 --exec-prefix=/usr \
29 --bindir=/usr/sbin \
30 --datadir=/usr/share \
31 --includedir=/usr/include \
32 --infodir=/usr/share/info \
33 --libdir=/usr/lib \
34 --libexecdir=/usr/lib/locate \
35 --localstatedir=/var/lib \
36 --mandir=/usr/share/man \
37 --sbindir=/usr/sbin \
38 --sysconfdir=/etc \
39 $(DISABLE_LARGEFILE) \
40 $(DISABLE_NLS) \
41 --enable-shared \
42 --disable-static \
43 --enable-flexresp \
44 --with-libnet-includes="$(STAGING_DIR)/usr/include" \
45 --with-libnet-libraries="$(STAGING_DIR)/usr/lib" \
46 --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
47 --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
48 --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
49 --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
50
51 SNORT_BASIC_CONFIGURE_OPTS := \
52 --without-mysql \
53 --without-postgresql \
54
55 SNORT_MYSQL_CONFIGURE_OPTS := \
56 --with-mysql=$(STAGING_DIR)/usr \
57 --without-postgresql \
58
59 SNORT_PGSQL_CONFIGURE_OPTS := \
60 --without-mysql \
61 --with-postgresql=$(STAGING_DIR)/usr \
62
63 SNORT_CUSTOM_CONFIGURE_OPTS := \
64
65 ifeq ($(BR2_PACKAGE_SNORT_ENABLE_DEBUG),y)
66 SNORT_CUSTOM_CONFIGURE_OPTS += --enable-debug
67 else
68 SNORT_CUSTOM_CONFIGURE_OPTS += --disable-debug
69 endif
70
71 ifeq ($(BR2_PACKAGE_SNORT_ENABLE_INLINE),y)
72 SNORT_CUSTOM_CONFIGURE_OPTS += --enable-inline
73 SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-includes="$(STAGING_DIR)/include/libipq"
74 SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-libraries="$(STAGING_DIR)/lib"
75 else
76 SNORT_CUSTOM_CONFIGURE_OPTS += --disable-inline
77 endif
78
79 ifeq ($(BR2_PACKAGE_SNORT_WITH_MYSQL),y)
80 SNORT_CUSTOM_CONFIGURE_OPTS += --with-mysql="$(STAGING_DIR)/usr"
81 else
82 SNORT_CUSTOM_CONFIGURE_OPTS += --without-mysql
83 endif
84
85 ifeq ($(BR2_PACKAGE_SNORT_WITH_PGSQL),y)
86 SNORT_CUSTOM_CONFIGURE_OPTS += --with-postgresql="$(STAGING_DIR)/usr"
87 else
88 SNORT_CUSTOM_CONFIGURE_OPTS += --without-postgresql
89 endif
90
91 define PKG_build
92
93 ifneq ($(BR2_PACKAGE_$(1)),)
94 BUILD_TARGETS += $(PKG_BUILD_DIR)/$(2)
95 endif
96
97 $(PKG_BUILD_DIR)/$(2): $(PKG_BUILD_DIR)/.prepared
98 touch -r $(PKG_BUILD_DIR)/Makefile.am $(PKG_BUILD_DIR)/configure.in
99 touch -r $(PKG_BUILD_DIR)/Makefile.in $(PKG_BUILD_DIR)/configure
100 -$(MAKE) -C $(PKG_BUILD_DIR) distclean
101 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
102 $(TARGET_CONFIGURE_OPTS) \
103 CFLAGS="$(TARGET_CFLAGS)" \
104 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/mysql" \
105 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/mysql" \
106 ./configure \
107 $(PKG_CONFIGURE_OPTS) \
108 $$($(1)_CONFIGURE_OPTS) \
109 );
110 $(MAKE) -C $(PKG_BUILD_DIR)
111 mv $(PKG_BUILD_DIR)/src/snort $(PKG_BUILD_DIR)/$(2)
112
113 $$(IPKG_$(1)): $(PKG_BUILD_DIR)/.installed $(PKG_BUILD_DIR)/$(2)
114 rm -rf $$(IDIR_$(1))
115 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
116 install -m0644 ./ipkg/snort.conffiles $$(IDIR_$(1))/CONTROL/conffiles
117 install -d -m0755 $$(IDIR_$(1))/etc/default
118 install -m0644 ./ipkg/snort.default $$(IDIR_$(1))/etc/default/snort
119 install -d -m0755 $$(IDIR_$(1))/etc/init.d
120 install -m0755 ./ipkg/snort.init $$(IDIR_$(1))/etc/init.d/snort
121 install -d -m0755 $$(IDIR_$(1))/etc/snort
122 install -m0644 $(PKG_BUILD_DIR)/etc/snort.conf $$(IDIR_$(1))/etc/snort/
123 install -m0644 $(PKG_BUILD_DIR)/etc/classification.config $$(IDIR_$(1))/etc/snort/
124 install -m0644 $(PKG_BUILD_DIR)/etc/gen-msg.map $$(IDIR_$(1))/etc/snort/
125 install -m0644 $(PKG_BUILD_DIR)/etc/reference.config $$(IDIR_$(1))/etc/snort/
126 install -m0644 $(PKG_BUILD_DIR)/etc/sid-msg.map $$(IDIR_$(1))/etc/snort/
127 install -m0644 $(PKG_BUILD_DIR)/etc/threshold.conf $$(IDIR_$(1))/etc/snort/
128 install -m0644 $(PKG_BUILD_DIR)/etc/unicode.map $$(IDIR_$(1))/etc/snort/
129 install -d -m0755 $$(IDIR_$(1))/usr/sbin
130 install -m0755 $(PKG_BUILD_DIR)/$(2) $$(IDIR_$(1))/usr/sbin/snort
131 $(RSTRIP) $$(IDIR_$(1))
132 mkdir -p $(PACKAGE_DIR)
133 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
134
135 endef
136
137 $(eval $(call PKG_template,SNORT_BASIC,snort,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
138 $(eval $(call PKG_template,SNORT_MYSQL,snort-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
139 $(eval $(call PKG_template,SNORT_PGSQL,snort-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
140 $(eval $(call PKG_template,SNORT_CUSTOM,snort-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
141
142 $(eval $(call PKG_build,SNORT_BASIC,snort,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
143 $(eval $(call PKG_build,SNORT_MYSQL,snort-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
144 $(eval $(call PKG_build,SNORT_PGSQL,snort-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
145 $(eval $(call PKG_build,SNORT_CUSTOM,snort-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
146
147 include $(TOPDIR)/package/rules.mk
148
149 $(PKG_BUILD_DIR)/.built: $(BUILD_TARGETS)
150 touch $(PKG_BUILD_DIR)/.built
151
152 $(PKG_BUILD_DIR)/.installed: $(PKG_BUILD_DIR)/.built
153 mkdir -p $(PKG_INSTALL_DIR)
154 $(MAKE) -C $(PKG_BUILD_DIR) \
155 DESTDIR="$(PKG_INSTALL_DIR)" \
156 install
157 touch $(PKG_BUILD_DIR)/.installed
158
This page took 0.068018 seconds and 5 git commands to generate.