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