| 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
|
|---|
| 10 | PKG_VERSION:= 2.4.5
|
|---|
| 11 | PKG_RELEASE:= 2
|
|---|
| 12 | PKG_MD5SUM:= 108b3c20dcbaf3cdb17ea9203342eaaa
|
|---|
| 13 | PKG_INIT:= 60
|
|---|
| 14 |
|
|---|
| 15 | PKG_SOURCE_URL:= http://www.snort.org/dl/current/
|
|---|
| 16 | PKG_SOURCE:= $(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|---|
| 17 |
|
|---|
| 18 | include $(TOPDIR)/mk/package.mk
|
|---|
| 19 |
|
|---|
| 20 | PKG_CONFIGURE_OPTS := \
|
|---|
| 21 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 22 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 23 | --build=$(GNU_HOST_NAME) \
|
|---|
| 24 | --program-prefix="" \
|
|---|
| 25 | --program-suffix="" \
|
|---|
| 26 | --prefix=/usr \
|
|---|
| 27 | --exec-prefix=/usr \
|
|---|
| 28 | --bindir=/usr/sbin \
|
|---|
| 29 | --datadir=/usr/share \
|
|---|
| 30 | --includedir=/usr/include \
|
|---|
| 31 | --infodir=/usr/share/info \
|
|---|
| 32 | --libdir=/usr/lib \
|
|---|
| 33 | --libexecdir=/usr/lib/locate \
|
|---|
| 34 | --localstatedir=/var/lib \
|
|---|
| 35 | --mandir=/usr/share/man \
|
|---|
| 36 | --sbindir=/usr/sbin \
|
|---|
| 37 | --sysconfdir=/etc \
|
|---|
| 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_BASIC_CONFIGURE_OPTS := \
|
|---|
| 50 | --without-mysql \
|
|---|
| 51 | --without-postgresql \
|
|---|
| 52 |
|
|---|
| 53 | SNORT_MYSQL_CONFIGURE_OPTS := \
|
|---|
| 54 | --with-mysql=$(STAGING_DIR)/usr \
|
|---|
| 55 | --without-postgresql \
|
|---|
| 56 |
|
|---|
| 57 | SNORT_PGSQL_CONFIGURE_OPTS := \
|
|---|
| 58 | --without-mysql \
|
|---|
| 59 | --with-postgresql=$(STAGING_DIR)/usr \
|
|---|
| 60 |
|
|---|
| 61 | SNORT_CUSTOM_CONFIGURE_OPTS := \
|
|---|
| 62 |
|
|---|
| 63 | ifeq ($(FWRT_PACKAGE_SNORT_ENABLE_DEBUG),y)
|
|---|
| 64 | SNORT_CUSTOM_CONFIGURE_OPTS += --enable-debug
|
|---|
| 65 | else
|
|---|
| 66 | SNORT_CUSTOM_CONFIGURE_OPTS += --disable-debug
|
|---|
| 67 | endif
|
|---|
| 68 |
|
|---|
| 69 | ifeq ($(FWRT_PACKAGE_SNORT_ENABLE_INLINE),y)
|
|---|
| 70 | SNORT_CUSTOM_CONFIGURE_OPTS += --enable-inline
|
|---|
| 71 | SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-includes="$(STAGING_DIR)/include/libipq"
|
|---|
| 72 | SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-libraries="$(STAGING_DIR)/lib"
|
|---|
| 73 | else
|
|---|
| 74 | SNORT_CUSTOM_CONFIGURE_OPTS += --disable-inline
|
|---|
| 75 | endif
|
|---|
| 76 |
|
|---|
| 77 | ifeq ($(FWRT_PACKAGE_SNORT_WITH_MYSQL),y)
|
|---|
| 78 | SNORT_CUSTOM_CONFIGURE_OPTS += --with-mysql="$(STAGING_DIR)/usr"
|
|---|
| 79 | else
|
|---|
| 80 | SNORT_CUSTOM_CONFIGURE_OPTS += --without-mysql
|
|---|
| 81 | endif
|
|---|
| 82 |
|
|---|
| 83 | ifeq ($(FWRT_PACKAGE_SNORT_WITH_PGSQL),y)
|
|---|
| 84 | SNORT_CUSTOM_CONFIGURE_OPTS += --with-postgresql="$(STAGING_DIR)/usr"
|
|---|
| 85 | else
|
|---|
| 86 | SNORT_CUSTOM_CONFIGURE_OPTS += --without-postgresql
|
|---|
| 87 | endif
|
|---|
| 88 |
|
|---|
| 89 | define PKG_build
|
|---|
| 90 |
|
|---|
| 91 | ifneq ($(FWRT_PACKAGE_$(1)),)
|
|---|
| 92 | BUILD_TARGETS += $(WRKBUILD)/$(2)
|
|---|
| 93 | endif
|
|---|
| 94 |
|
|---|
| 95 | $(WRKBUILD)/$(2): $(WRKBUILD)/.prepared
|
|---|
| 96 | touch -r $(WRKBUILD)/Makefile.am $(WRKBUILD)/configure.in
|
|---|
| 97 | touch -r $(WRKBUILD)/Makefile.in $(WRKBUILD)/configure
|
|---|
| 98 | -$(MAKE) -C $(WRKBUILD) distclean
|
|---|
| 99 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 100 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 101 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 102 | CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include/mysql" \
|
|---|
| 103 | LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib/mysql" \
|
|---|
| 104 | ./configure \
|
|---|
| 105 | $(PKG_CONFIGURE_OPTS) \
|
|---|
| 106 | $$($(1)_CONFIGURE_OPTS) \
|
|---|
| 107 | );
|
|---|
| 108 | $(MAKE) -C $(WRKBUILD)
|
|---|
| 109 | mv $(WRKBUILD)/src/snort $(WRKBUILD)/$(2)
|
|---|
| 110 |
|
|---|
| 111 | $$(IPKG_$(1)): $(WRKBUILD)/.installed $(WRKBUILD)/$(2)
|
|---|
| 112 | install -m0644 ./ipkg/snort.conffiles $$(IDIR_$(1))/CONTROL/conffiles
|
|---|
| 113 | install -d -m0755 $$(IDIR_$(1))/etc/init.d
|
|---|
| 114 | install -m0755 ./files/snort.init \
|
|---|
| 115 | $$(IDIR_$(1))/etc/init.d/S$(PKG_INIT)snort
|
|---|
| 116 | install -d -m0755 $$(IDIR_$(1))/etc/snort
|
|---|
| 117 | install -m0644 $(WRKBUILD)/etc/snort.conf $$(IDIR_$(1))/etc/snort/
|
|---|
| 118 | install -m0644 $(WRKBUILD)/etc/classification.config $$(IDIR_$(1))/etc/snort/
|
|---|
| 119 | install -m0644 $(WRKBUILD)/etc/gen-msg.map $$(IDIR_$(1))/etc/snort/
|
|---|
| 120 | install -m0644 $(WRKBUILD)/etc/reference.config $$(IDIR_$(1))/etc/snort/
|
|---|
| 121 | install -m0644 $(WRKBUILD)/etc/sid-msg.map $$(IDIR_$(1))/etc/snort/
|
|---|
| 122 | install -m0644 $(WRKBUILD)/etc/threshold.conf $$(IDIR_$(1))/etc/snort/
|
|---|
| 123 | install -m0644 $(WRKBUILD)/etc/unicode.map $$(IDIR_$(1))/etc/snort/
|
|---|
| 124 | install -d -m0755 $$(IDIR_$(1))/usr/sbin
|
|---|
| 125 | install -m0755 $(WRKBUILD)/$(2) $$(IDIR_$(1))/usr/sbin/snort
|
|---|
| 126 | $(RSTRIP) $$(IDIR_$(1))
|
|---|
| 127 | mkdir -p $(PACKAGE_DIR)
|
|---|
| 128 | $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
|
|---|
| 129 |
|
|---|
| 130 | endef
|
|---|
| 131 |
|
|---|
| 132 | $(eval $(call PKG_template,SNORT_BASIC,snort,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 133 | $(eval $(call PKG_template,SNORT_MYSQL,snort-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 134 | $(eval $(call PKG_template,SNORT_PGSQL,snort-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 135 | $(eval $(call PKG_template,SNORT_CUSTOM,snort-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 136 |
|
|---|
| 137 | $(eval $(call PKG_build,SNORT_BASIC,snort,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 138 | $(eval $(call PKG_build,SNORT_MYSQL,snort-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 139 | $(eval $(call PKG_build,SNORT_PGSQL,snort-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 140 | $(eval $(call PKG_build,SNORT_CUSTOM,snort-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 141 |
|
|---|
| 142 | $(WRKBUILD)/.configured:
|
|---|
| 143 | touch $@
|
|---|
| 144 |
|
|---|
| 145 | $(WRKBUILD)/.built: $(BUILD_TARGETS)
|
|---|
| 146 | touch $@
|
|---|
| 147 |
|
|---|
| 148 | $(WRKBUILD)/.installed: $(WRKBUILD)/.built
|
|---|
| 149 | mkdir -p $(WRKINST)
|
|---|
| 150 | $(MAKE) -C $(WRKBUILD) \
|
|---|
| 151 | DESTDIR="$(WRKINST)" \
|
|---|
| 152 | install
|
|---|
| 153 | touch $@
|
|---|