clean up old stuff
[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 rm -rf $$(IDIR_$(1))
111 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
112 install -m0644 ./ipkg/snort-wireless.conffiles $$(IDIR_$(1))/CONTROL/conffiles
113 install -d -m0755 $$(IDIR_$(1))/etc/default
114 install -m0644 ./ipkg/snort-wireless.default $$(IDIR_$(1))/etc/default/snort
115 install -d -m0755 $$(IDIR_$(1))/etc/init.d
116 install -m0755 ./ipkg/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 $(PKG_BUILD_DIR)/.installed
155
This page took 0.051993 seconds and 5 git commands to generate.