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