File: net/snort/Makefile
base-0 patch-1
Line 1Line 1
GARNAME = snort
GARNAME = snort
GARVERSION = 1.9.0
GARVERSION = 2.1.0
CATEGORIES = net
MASTER_SITES = http://www.snort.org/dl/ http://www.snort.org/dl/signatures/
CATEGORIES = net
MASTER_SITES = http://www.snort.org/dl/ http://www.snort.org/dl/signatures/
SNORTRULES = snortrules-stable.tar.gz
SNORTRULES = snortrules-snapshot-2_1.tar.gz
DISTFILES = snort-$(GARVERSION).tar.gz $(SNORTRULES) $(SNORTRULES).md5
# since the rulesets change frequently, there's not point in storing checksums in cvs
NOCHECKSUM = $(SNORTRULES) $(SNORTRULES).md5
MAINTAINER = Curtis Doty <Curtis@GreenKey.net>
LICENSE = GPL2
DISTFILES = snort-$(GARVERSION).tar.gz $(SNORTRULES) $(SNORTRULES).md5
# since the rulesets change frequently, there's not point in storing checksums in cvs
NOCHECKSUM = $(SNORTRULES) $(SNORTRULES).md5
MAINTAINER = Curtis Doty <Curtis@GreenKey.net>
LICENSE = GPL2

PATCHFILES = gar-base.diff
DESCRIPTION = The Open Source Network Intrusion Detection System
define BLURB
DESCRIPTION = The Open Source Network Intrusion Detection System
define BLURB
Line 19Line 20
attacks, SMB probes, OS fingerprinting attempts, and much more.
endef

attacks, SMB probes, OS fingerprinting attempts, and much more.
endef

LIBDEPS = lib/libpcap
LIBDEPS = lib/libpcap lib/pcre lib/libnet
DEPENDS =
# Builddeps are installed in $(BUILD_PREFIX) in their entirety
BUILDDEPS =
DEPENDS =
# Builddeps are installed in $(BUILD_PREFIX) in their entirety
BUILDDEPS =
Line 28Line 29
BUILD_SCRIPTS = $(WORKSRC)/Makefile
INSTALL_SCRIPTS = $(WORKSRC)/Makefile

BUILD_SCRIPTS = $(WORKSRC)/Makefile
INSTALL_SCRIPTS = $(WORKSRC)/Makefile

CONFIGURE_ARGS = $(DIRPATHS) --sysconfdir=$(sysconfdir)/snort --with-libpcap-includes=$(includedir)
# Snort's just another firewall/sniffer without flexresp!
LIBNET_CONFIG=$(DESTDIR)$(bindir)/libnet-config
PCRE_CONFIG=$(DESTDIR)$(bindir)/pcre-config
CONFIGURE_ARGS = $(DIRPATHS) --sysconfdir=$(sysconfdir)/snort --with-libpcap-includes=$(DESTDIR)$(includedir) --with-libpcap-libraries=$(DESTDIR)$(libdir) --enable-flexresp --with-libnet-includes=$(DESTDIR)$(includedir) --with-libnet-libraries=$(DESTDIR)$(libdir)
CONFIGURE_ENV= PCRE_CONFIG="$(PCRE_CONFIG)" LIBNET_CONFIG="$(LIBNET_CONFIG)"
NODIRPATHS = --sysconfdir

# If some dirs are trying to install into /, list their names
NODIRPATHS = --sysconfdir

# If some dirs are trying to install into /, list their names
Line 37Line 42
# This should go before any hand-made rules.
include ../../gar.mk
# This should go before any hand-made rules.
include ../../gar.mk

CPPFLAGS += "-DLIBNET_LIL_ENDIAN"

PATH+=$(DESTDIR)$(bindir)
# is it really wise to trust their checksums like this?
post-fetch:
        cd $(DOWNLOADDIR) && \
# is it really wise to trust their checksums like this?
post-fetch:
        cd $(DOWNLOADDIR) && \
        awk '/^SHA1 / {print $$4 " " $$2}' $(SNORTRULES).md5 |tr -d '()' >$(SNORTRULES).sha1
        #awk '/^SHA1 / {print $$4 " " substr($$2,2,length($$2)-2)}' $(SNORTRULES).md5 >$(SNORTRULES).sha1
        awk '/^sha1 / {print $$3 " " $$4}' $(SNORTRULES).md5 >$(SNORTRULES).sha1
        $(MAKECOOKIE)
        $(MAKECOOKIE)
post-checksum:
        cd $(DOWNLOADDIR) && sha1sum -c $(SNORTRULES).sha1
        $(MAKECOOKIE)
post-checksum:
        cd $(DOWNLOADDIR) && sha1sum -c $(SNORTRULES).sha1
        $(MAKECOOKIE)
Line 59Line 66
post-install:
        mkdir -p $(DESTDIR){$(sysconfdir),$(localstatedir)/log}/snort
        install -pm644 $(WORKSRC)/etc/*.conf* $(DESTDIR)$(sysconfdir)/snort
post-install:
        mkdir -p $(DESTDIR){$(sysconfdir),$(localstatedir)/log}/snort
        install -pm644 $(WORKSRC)/etc/*.conf* $(DESTDIR)$(sysconfdir)/snort

        install -pm644 $(WORKSRC)/etc/generators $(DESTDIR)$(sysconfdir)/snort
        install -pm644 $(WORKSRC)/etc/sid $(DESTDIR)$(sysconfdir)/snort
        install -pm644 $(WORKSRC)/etc/*.map* $(DESTDIR)$(sysconfdir)/snort
        install -pm644 $(WORKDIR)/rules/*.rules $(DESTDIR)$(sysconfdir)/snort
        $(MAKECOOKIE)
        install -pm644 $(WORKDIR)/rules/*.rules $(DESTDIR)$(sysconfdir)/snort
        $(MAKECOOKIE)