| 1 | # $FreeWRT$
|
|---|
| 2 | #-
|
|---|
| 3 | # This file is part of the FreeWRT project. FreeWRT is copyrighted
|
|---|
| 4 | # material, please see the LICENCE file in the top-level directory
|
|---|
| 5 | # or at http://www.freewrt.org/licence for details.
|
|---|
| 6 |
|
|---|
| 7 | include $(TOPDIR)/rules.mk
|
|---|
| 8 |
|
|---|
| 9 | PKG_NAME:= snort-wireless
|
|---|
| 10 | PKG_VERSION:= 2.4.3-alpha04
|
|---|
| 11 | PKG_RELEASE:= 2
|
|---|
| 12 | PKG_MD5SUM:= 1aa699ae279bf7a1140cf6cca02f9999
|
|---|
| 13 | PKG_INIT:= 75
|
|---|
| 14 |
|
|---|
| 15 | PKG_SOURCE_URL:= http://www.snort-wireless.org/files/
|
|---|
| 16 |
|
|---|
| 17 | include $(TOPDIR)/mk/package.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-nls \
|
|---|
| 38 | --enable-shared \
|
|---|
| 39 | --disable-static \
|
|---|
| 40 | --enable-flexresp \
|
|---|
| 41 | --with-libnet-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 42 | --with-libnet-libraries="$(STAGING_DIR)/usr/lib" \
|
|---|
| 43 | --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 44 | --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
|
|---|
| 45 | --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 46 | --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
|
|---|
| 47 |
|
|---|
| 48 | SNORT_WIRELESS_BASIC_CONFIGURE_OPTS := \
|
|---|
| 49 | --without-mysql \
|
|---|
| 50 | --without-postgresql \
|
|---|
| 51 |
|
|---|
| 52 | SNORT_WIRELESS_MYSQL_CONFIGURE_OPTS := \
|
|---|
| 53 | --with-mysql=$(STAGING_DIR)/usr \
|
|---|
| 54 | --without-postgresql \
|
|---|
| 55 |
|
|---|
| 56 | SNORT_WIRELESS_PGSQL_CONFIGURE_OPTS := \
|
|---|
| 57 | --without-mysql \
|
|---|
| 58 | --with-postgresql=$(STAGING_DIR)/usr \
|
|---|
| 59 |
|
|---|
| 60 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS := \
|
|---|
| 61 |
|
|---|
| 62 | ifeq ($(FWRT_PACKAGE_SNORT_WIRELESS_ENABLE_DEBUG),y)
|
|---|
| 63 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --enable-debug
|
|---|
| 64 | else
|
|---|
| 65 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --disable-debug
|
|---|
| 66 | endif
|
|---|
| 67 |
|
|---|
| 68 | ifeq ($(FWRT_PACKAGE_SNORT_WIRELESS_ENABLE_INLINE),y)
|
|---|
| 69 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --enable-inline
|
|---|
| 70 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --with-libipq-includes="$(STAGING_DIR)/include/libipq"
|
|---|
| 71 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --with-libipq-libraries="$(STAGING_DIR)/lib"
|
|---|
| 72 | else
|
|---|
| 73 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --disable-inline
|
|---|
| 74 | endif
|
|---|
| 75 |
|
|---|
| 76 | ifeq ($(FWRT_PACKAGE_SNORT_WIRELESS_WITH_MYSQL),y)
|
|---|
| 77 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --with-mysql="$(STAGING_DIR)/usr"
|
|---|
| 78 | else
|
|---|
| 79 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --without-mysql
|
|---|
| 80 | endif
|
|---|
| 81 |
|
|---|
| 82 | ifeq ($(FWRT_PACKAGE_SNORT_WIRELESS_WITH_PGSQL),y)
|
|---|
| 83 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --with-postgresql="$(STAGING_DIR)/usr"
|
|---|
| 84 | else
|
|---|
| 85 | SNORT_WIRELESS_CUSTOM_CONFIGURE_OPTS += --without-postgresql
|
|---|
| 86 | endif
|
|---|
| 87 |
|
|---|
| 88 | define PKG_build
|
|---|
| 89 |
|
|---|
| 90 | ifneq ($(FWRT_PACKAGE_$(1)),)
|
|---|
| 91 | BUILD_TARGETS += $(WRKBUILD)/$(2)
|
|---|
| 92 | endif
|
|---|
| 93 |
|
|---|
| 94 | $(WRKBUILD)/$(2): $(WRKBUILD)/.prepared
|
|---|
| 95 | touch -r $(WRKBUILD)/Makefile.am $(WRKBUILD)/configure.in
|
|---|
| 96 | touch -r $(WRKBUILD)/Makefile.in $(WRKBUILD)/configure
|
|---|
| 97 | -$(MAKE) -C $(WRKBUILD) distclean
|
|---|
| 98 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 99 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 100 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 101 | CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/mysql" \
|
|---|
| 102 | LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/mysql" \
|
|---|
| 103 | ./configure \
|
|---|
| 104 | $(PKG_CONFIGURE_OPTS) \
|
|---|
| 105 | $$($(1)_CONFIGURE_OPTS) \
|
|---|
| 106 | );
|
|---|
| 107 | $(MAKE) -C $(WRKBUILD)
|
|---|
| 108 | mv $(WRKBUILD)/src/snort $(WRKBUILD)/$(2)
|
|---|
| 109 |
|
|---|
| 110 | $$(IPKG_$(1)): $(WRKBUILD)/.installed $(WRKBUILD)/$(2)
|
|---|
| 111 | install -m0644 ./ipkg/snort-wireless.conffiles $$(IDIR_$(1))/CONTROL/conffiles
|
|---|
| 112 | install -d -m0755 $$(IDIR_$(1))/etc/init.d
|
|---|
| 113 | install -m0755 ./files/snort-wireless.init \
|
|---|
| 114 | $$(IDIR_$(1))/etc/init.d/S$(PKG_INIT)snort-wireless
|
|---|
| 115 | install -d -m0755 $$(IDIR_$(1))/etc/snort
|
|---|
| 116 | install -m0644 $(WRKBUILD)/etc/snort.conf $$(IDIR_$(1))/etc/snort/
|
|---|
| 117 | install -m0644 $(WRKBUILD)/etc/classification.config $$(IDIR_$(1))/etc/snort/
|
|---|
| 118 | install -m0644 $(WRKBUILD)/etc/gen-msg.map $$(IDIR_$(1))/etc/snort/
|
|---|
| 119 | install -m0644 $(WRKBUILD)/etc/reference.config $$(IDIR_$(1))/etc/snort/
|
|---|
| 120 | install -m0644 $(WRKBUILD)/etc/sid-msg.map $$(IDIR_$(1))/etc/snort/
|
|---|
| 121 | install -m0644 $(WRKBUILD)/etc/threshold.conf $$(IDIR_$(1))/etc/snort/
|
|---|
| 122 | install -m0644 $(WRKBUILD)/etc/unicode.map $$(IDIR_$(1))/etc/snort/
|
|---|
| 123 | install -d -m0755 $$(IDIR_$(1))/usr/sbin
|
|---|
| 124 | install -m0755 $(WRKBUILD)/$(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 | $(WRKBUILD)/.configured:
|
|---|
| 142 | touch $@
|
|---|
| 143 |
|
|---|
| 144 | $(WRKBUILD)/.built: $(BUILD_TARGETS)
|
|---|
| 145 | touch $@
|
|---|
| 146 |
|
|---|
| 147 | $(WRKBUILD)/.installed: $(WRKBUILD)/.built
|
|---|
| 148 | mkdir -p $(WRKINST)
|
|---|
| 149 | $(MAKE) -C $(WRKBUILD) \
|
|---|
| 150 | DESTDIR="$(WRKINST)" \
|
|---|
| 151 | install
|
|---|
| 152 | touch $@
|
|---|