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