source: freewrt/package/snort/Makefile@ d419478

freewrt_1_0 freewrt_2_0
Last change on this file since d419478 was d419478, checked in by Thorsten Glaser <tg@…>, 19 years ago
  • whitespace cleanup, while here
  • move WRKDIR and DISTFILES definition into PKG_template
  • define WRKDIR via parent BUILD_DIR instead of going up from WRKSRC
  • use a sub-directory as WRKDIR, like BSD
  • rename PKG_BUILD_DIR into WRKBUILD
  • define WRKBUILD relative via WRKDIR
  • rename PKG_INSTALL_DIR into WRKINST
  • fix a few dependencies
  • make use of common cases in the definition of WRKBUILD and WRKINST, removing many redundant lines
  • use WRKDIR instead of BUILD_DIR in places where the latter was used previously
  • while here, remove PKG_CAT stuff

this only affects packages, for now

git-svn-id: svn://www.freewrt.org/trunk/freewrt@303 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 4.9 KB
Line 
1# $Id: Makefile 3567 2006-04-01 15:23:25Z nico $
2
3include $(TOPDIR)/rules.mk
4
5PKG_NAME:=snort
6PKG_VERSION:=2.4.5
7PKG_RELEASE:=1
8PKG_MD5SUM:=108b3c20dcbaf3cdb17ea9203342eaaa
9
10PKG_SOURCE_URL:=http://www.snort.org/dl/current/
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12
13
14include $(TOPDIR)/package/rules.mk
15
16PKG_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
46SNORT_BASIC_CONFIGURE_OPTS := \
47 --without-mysql \
48 --without-postgresql \
49
50SNORT_MYSQL_CONFIGURE_OPTS := \
51 --with-mysql=$(STAGING_DIR)/usr \
52 --without-postgresql \
53
54SNORT_PGSQL_CONFIGURE_OPTS := \
55 --without-mysql \
56 --with-postgresql=$(STAGING_DIR)/usr \
57
58SNORT_CUSTOM_CONFIGURE_OPTS := \
59
60ifeq ($(BR2_PACKAGE_SNORT_ENABLE_DEBUG),y)
61SNORT_CUSTOM_CONFIGURE_OPTS += --enable-debug
62else
63SNORT_CUSTOM_CONFIGURE_OPTS += --disable-debug
64endif
65
66ifeq ($(BR2_PACKAGE_SNORT_ENABLE_INLINE),y)
67SNORT_CUSTOM_CONFIGURE_OPTS += --enable-inline
68SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-includes="$(STAGING_DIR)/include/libipq"
69SNORT_CUSTOM_CONFIGURE_OPTS += --with-libipq-libraries="$(STAGING_DIR)/lib"
70else
71SNORT_CUSTOM_CONFIGURE_OPTS += --disable-inline
72endif
73
74ifeq ($(BR2_PACKAGE_SNORT_WITH_MYSQL),y)
75SNORT_CUSTOM_CONFIGURE_OPTS += --with-mysql="$(STAGING_DIR)/usr"
76else
77SNORT_CUSTOM_CONFIGURE_OPTS += --without-mysql
78endif
79
80ifeq ($(BR2_PACKAGE_SNORT_WITH_PGSQL),y)
81SNORT_CUSTOM_CONFIGURE_OPTS += --with-postgresql="$(STAGING_DIR)/usr"
82else
83SNORT_CUSTOM_CONFIGURE_OPTS += --without-postgresql
84endif
85
86define PKG_build
87
88ifneq ($(BR2_PACKAGE_$(1)),)
89BUILD_TARGETS += $(WRKBUILD)/$(2)
90endif
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
128endef
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
Note: See TracBrowser for help on using the repository browser.