3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=ed510e7ee2130d1f37f27901b89e985a
10 PKG_SOURCE_URL
:=http
://www.ba.cnr.it
/~paolo
/pmacct
/
11 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)rc2.
tar.gz
14 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
15 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
17 include $(TOPDIR
)/package
/rules.mk
19 PMACCT_BASIC_CONFIGURE_OPTS
:= \
21 PMACCT_MYSQL_CONFIGURE_OPTS
:= \
23 --with-mysql-includes
="$(STAGING_DIR)/usr/include" \
24 --with-mysql-libs
="$(STAGING_DIR)/usr/lib/mysql"
26 PMACCT_PGSQL_CONFIGURE_OPTS
:= \
28 --with-pgsql-includes
="$(STAGING_DIR)/usr/include" \
29 --with-pgsql-libs
="$(STAGING_DIR)/usr/lib"
31 PMACCT_SQLITE_CONFIGURE_OPTS
:= \
33 --with-sqlite3-includes
="$(STAGING_DIR)/usr/include" \
34 --with-sqlite3-libs
="$(STAGING_DIR)/usr/lib"
36 NFACCTD_CUSTOM_CONFIGURE_OPTS
:= \
38 ifeq ($(BR2_PACKAGE_NFACCTD_ENABLE_DEBUG
),y
)
39 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-debug
42 ifeq ($(BR2_PACKAGE_NFACCTD_ENABLE_IPV6
),y
)
43 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-ipv6
46 ifeq ($(BR2_PACKAGE_NFACCTD_WITH_MYSQL
),y
)
47 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_MYSQL_CONFIGURE_OPTS
)
50 ifeq ($(BR2_PACKAGE_NFACCTD_WITH_PGSQL
),y
)
51 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_PGSQL_CONFIGURE_OPTS
)
54 ifeq ($(BR2_PACKAGE_NFACCTD_WITH_SQLITE
),y
)
55 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_SQLITE_CONFIGURE_OPTS
)
58 PMACCTD_CUSTOM_CONFIGURE_OPTS
:= \
60 ifeq ($(BR2_PACKAGE_PMACCTD_ENABLE_DEBUG
),y
)
61 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-debug
64 ifeq ($(BR2_PACKAGE_PMACCTD_ENABLE_IPV6
),y
)
65 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-ipv6
68 ifeq ($(BR2_PACKAGE_PMACCTD_WITH_MYSQL
),y
)
69 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_MYSQL_CONFIGURE_OPTS
)
72 ifeq ($(BR2_PACKAGE_PMACCTD_WITH_PGSQL
),y
)
73 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_PGSQL_CONFIGURE_OPTS
)
76 ifeq ($(BR2_PACKAGE_PMACCTD_WITH_SQLITE
),y
)
77 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_SQLITE_CONFIGURE_OPTS
)
82 ifneq ($(BR2_PACKAGE_
$(1)),)
83 BUILD_TARGETS
+= $(PKG_BUILD_DIR
)/$(2)
84 BUILD_TARGETS
+= $(PKG_BUILD_DIR
)/$(3)
87 $(PKG_BUILD_DIR
)/$(2) $(PKG_BUILD_DIR
)/$(3): $(PKG_BUILD_DIR
)/.prepared
88 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
89 (cd
$(PKG_BUILD_DIR
); rm -rf config.
{cache
,status
} ; \
90 $(TARGET_CONFIGURE_OPTS
) \
91 CFLAGS
="$(TARGET_CFLAGS)" \
92 CPPFLAGS
="-I$(STAGING_DIR)/usr/include" \
93 LDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
95 --target
=$(GNU_TARGET_NAME
) \
96 --host
=$(GNU_TARGET_NAME
) \
97 --build
=$(GNU_HOST_NAME
) \
103 --datadir=/usr
/share \
104 --includedir=/usr
/include \
105 --infodir=/usr
/share
/info \
107 --libexecdir
=/usr
/lib
/locate \
108 --localstatedir
=/var
/lib \
109 --mandir=/usr
/share
/man \
110 --sbindir
=/usr
/sbin \
112 $(DISABLE_LARGEFILE
) \
116 --with-pcap-includes
="$(STAGING_DIR)/usr/include" \
117 --with-pcap-libs
="$(STAGING_DIR)/usr/lib" \
118 $$($(1)_CONFIGURE_OPTS
) \
120 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
121 $(TARGET_CONFIGURE_OPTS
) \
122 CFLAGS
="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
123 mv
-f
$(PKG_BUILD_DIR
)/nfacctd
$(PKG_BUILD_DIR
)/$(2)
124 mv
-f
$(PKG_BUILD_DIR
)/pmacctd
$(PKG_BUILD_DIR
)/$(3)
130 $$(IPKG_
$(1)): $(PKG_BUILD_DIR
)/$(2)
131 install -d
-m0755
$$(IDIR_
$(1))/etc
132 install -m0644 .
/files
/$(3).conf
$$(IDIR_
$(1))/etc
/
133 install -d
-m0755
$$(IDIR_
$(1))/etc
/default
134 install -m0644 .
/files
/$(3).default
$$(IDIR_
$(1))/etc
/default
/$(3)
135 install -d
-m0755
$$(IDIR_
$(1))/etc
/init.d
136 install -m0755 .
/files
/$(3).init
$$(IDIR_
$(1))/etc
/init.d
/$(3)
137 install -d
-m0755
$$(IDIR_
$(1))/usr
/sbin
138 install -m0755
$(PKG_BUILD_DIR
)/$(2) $$(IDIR_
$(1))/usr
/sbin
/$(3)
139 $(RSTRIP
) $$(IDIR_
$(1))
140 $(IPKG_BUILD
) $$(IDIR_
$(1)) $(PACKAGE_DIR
)
144 $(eval
$(call PKG_template
,NFACCTD_BASIC
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
145 $(eval
$(call PKG_template
,NFACCTD_MYSQL
,nfacctd-mysql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
146 $(eval
$(call PKG_template
,NFACCTD_PGSQL
,nfacctd-pgsql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
147 $(eval
$(call PKG_template
,NFACCTD_SQLITE
,nfacctd-sqlite
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
148 $(eval
$(call PKG_template
,NFACCTD_CUSTOM
,nfacctd-custom
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
149 $(eval
$(call PKG_template
,PMACCTD_BASIC
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
150 $(eval
$(call PKG_template
,PMACCTD_MYSQL
,pmacctd-mysql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
151 $(eval
$(call PKG_template
,PMACCTD_PGSQL
,pmacctd-pgsql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
152 $(eval
$(call PKG_template
,PMACCTD_SQLITE
,pmacctd-sqlite
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
153 $(eval
$(call PKG_template
,PMACCTD_CUSTOM
,pmacctd-custom
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
154 $(eval
$(call PKG_template
,PMACCT_CLIENT
,pmacct-client
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
156 $(eval
$(call PKG_build
,PMACCT_BASIC
,nfacctd-basic
,pmacctd-basic
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
157 $(eval
$(call PKG_build
,PMACCT_MYSQL
,nfacctd-mysql
,pmacctd-mysql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
158 $(eval
$(call PKG_build
,PMACCT_PGSQL
,nfacctd-pgsql
,pmacctd-pgsql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
159 $(eval
$(call PKG_build
,PMACCT_SQLITE
,nfacctd-sqlite
,pmacctd-sqlite
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
160 $(eval
$(call PKG_build
,NFACCTD_CUSTOM
,nfacctd-custom
,pmacctd-dummy
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
161 $(eval
$(call PKG_build
,PMACCTD_CUSTOM
,nfacctd-dummy
,pmacctd-custom
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
163 $(eval
$(call PKG_package
,NFACCTD_BASIC
,nfacctd-basic
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
164 $(eval
$(call PKG_package
,NFACCTD_MYSQL
,nfacctd-mysql
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
165 $(eval
$(call PKG_package
,NFACCTD_PGSQL
,nfacctd-pgsql
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
166 $(eval
$(call PKG_package
,NFACCTD_SQLITE
,nfacctd-sqlite
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
167 $(eval
$(call PKG_package
,NFACCTD_CUSTOM
,nfacctd-custom
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
168 $(eval
$(call PKG_package
,PMACCTD_BASIC
,pmacctd-basic
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
169 $(eval
$(call PKG_package
,PMACCTD_MYSQL
,pmacctd-mysql
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
170 $(eval
$(call PKG_package
,PMACCTD_PGSQL
,pmacctd-pgsql
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
171 $(eval
$(call PKG_package
,PMACCTD_SQLITE
,pmacctd-sqlite
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
172 $(eval
$(call PKG_package
,PMACCTD_CUSTOM
,pmacctd-custom
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
174 $(PKG_BUILD_DIR
)/.configured
:
177 $(PKG_BUILD_DIR
)/.built
: $(BUILD_TARGETS
)
180 $(IPKG_PMACCT_CLIENT
):
181 install -d
-m0755
$(IDIR_PMACCT_CLIENT
)/usr
/sbin
182 $(CP
) $(PKG_BUILD_DIR
)/pmacct
$(IDIR_PMACCT_CLIENT
)/usr
/sbin
/
183 $(RSTRIP
) $(IDIR_PMACCT_CLIENT
)
184 $(IPKG_BUILD
) $(IDIR_PMACCT_CLIENT
) $(PACKAGE_DIR
)