source: freewrt/package/snort/Makefile@ 18c227bd

freewrt_2_0
Last change on this file since 18c227bd was 65d016f, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

fix half of the init scripts not conforming to
our standard. thx very much ulmen!

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@1000 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 5.0 KB
Line 
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
7include $(TOPDIR)/rules.mk
8
9PKG_NAME:= snort
10PKG_VERSION:= 2.4.5
11PKG_RELEASE:= 2
12PKG_MD5SUM:= 108b3c20dcbaf3cdb17ea9203342eaaa
13PKG_INIT:= 60
14
15PKG_SOURCE_URL:= http://www.snort.org/dl/current/
16PKG_SOURCE:= $(PKG_NAME)-$(PKG_VERSION).tar.gz
17
18include $(TOPDIR)/mk/package.mk
19
20PKG_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
49SNORT_BASIC_CONFIGURE_OPTS := \
50 --without-mysql \
51 --without-postgresql \
52
53SNORT_MYSQL_CONFIGURE_OPTS := \
54 --with-mysql=$(STAGING_DIR)/usr \
55 --without-postgresql \
56
57SNORT_PGSQL_CONFIGURE_OPTS := \
58 --without-mysql \
59 --with-postgresql=$(STAGING_DIR)/usr \
60
61SNORT_CUSTOM_CONFIGURE_OPTS := \
62
63ifeq ($(FWRT_PACKAGE_SNORT_ENABLE_DEBUG),y)
64SNORT_CUSTOM_CONFIGURE_OPTS += --enable-debug
65else
66SNORT_CUSTOM_CONFIGURE_OPTS += --disable-debug
67endif
68
69ifeq ($(FWRT_PACKAGE_SNORT_ENABLE_INLINE),y)
70SNORT_CUSTOM_CONFIGURE_OPTS += --enable-inline
71SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-includes="$(STAGING_DIR)/include/libipq"
72SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-libraries="$(STAGING_DIR)/lib"
73else
74SNORT_CUSTOM_CONFIGURE_OPTS += --disable-inline
75endif
76
77ifeq ($(FWRT_PACKAGE_SNORT_WITH_MYSQL),y)
78SNORT_CUSTOM_CONFIGURE_OPTS += --with-mysql="$(STAGING_DIR)/usr"
79else
80SNORT_CUSTOM_CONFIGURE_OPTS += --without-mysql
81endif
82
83ifeq ($(FWRT_PACKAGE_SNORT_WITH_PGSQL),y)
84SNORT_CUSTOM_CONFIGURE_OPTS += --with-postgresql="$(STAGING_DIR)/usr"
85else
86SNORT_CUSTOM_CONFIGURE_OPTS += --without-postgresql
87endif
88
89define PKG_build
90
91ifneq ($(FWRT_PACKAGE_$(1)),)
92BUILD_TARGETS += $(WRKBUILD)/$(2)
93endif
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
130endef
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 $@
Note: See TracBrowser for help on using the repository browser.