3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=b725f7b4af335d2f668cb61621a5c2d9
10 PKG_SOURCE_URL
:=http
://www.ba.cnr.it
/~paolo
/pmacct
/
11 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
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 NFACCTD_CUSTOM_CONFIGURE_OPTS
:= \
33 ifeq ($(BR2_PACKAGE_NFACCTD_ENABLE_DEBUG
),y
)
34 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-debug
37 ifeq ($(BR2_PACKAGE_NFACCTD_ENABLE_IPV6
),y
)
38 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-ipv6
41 ifeq ($(BR2_PACKAGE_NFACCTD_WITH_MYSQL
),y
)
42 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_MYSQL_CONFIGURE_OPTS
)
45 ifeq ($(BR2_PACKAGE_NFACCTD_WITH_PGSQL
),y
)
46 NFACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_PGSQL_CONFIGURE_OPTS
)
49 PMACCTD_CUSTOM_CONFIGURE_OPTS
:= \
51 ifeq ($(BR2_PACKAGE_PMACCTD_ENABLE_DEBUG
),y
)
52 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-debug
55 ifeq ($(BR2_PACKAGE_PMACCTD_ENABLE_IPV6
),y
)
56 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= --enable-ipv6
59 ifeq ($(BR2_PACKAGE_PMACCTD_WITH_MYSQL
),y
)
60 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_MYSQL_CONFIGURE_OPTS
)
63 ifeq ($(BR2_PACKAGE_PMACCTD_WITH_PGSQL
),y
)
64 PMACCTD_CUSTOM_CONFIGURE_OPTS
+= $(PMACCT_PGSQL_CONFIGURE_OPTS
)
69 ifneq ($(BR2_PACKAGE_
$(1)),)
70 BUILD_TARGETS
+= $(PKG_BUILD_DIR
)/$(2)
71 BUILD_TARGETS
+= $(PKG_BUILD_DIR
)/$(3)
74 $(PKG_BUILD_DIR
)/$(2) $(PKG_BUILD_DIR
)/$(3): $(PKG_BUILD_DIR
)/.prepared
75 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
76 (cd
$(PKG_BUILD_DIR
); rm -rf config.
{cache
,status
} ; \
77 $(TARGET_CONFIGURE_OPTS
) \
78 CFLAGS
="$(TARGET_CFLAGS)" \
79 CPPFLAGS
="-I$(STAGING_DIR)/usr/include" \
80 LDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
82 --target
=$(GNU_TARGET_NAME
) \
83 --host
=$(GNU_TARGET_NAME
) \
84 --build
=$(GNU_HOST_NAME
) \
90 --datadir=/usr
/share \
91 --includedir=/usr
/include \
92 --infodir=/usr
/share
/info \
94 --libexecdir
=/usr
/lib
/locate \
95 --localstatedir
=/var
/lib \
96 --mandir=/usr
/share
/man \
99 $(DISABLE_LARGEFILE
) \
103 --with-pcap-includes
="$(STAGING_DIR)/usr/include" \
104 --with-pcap-libs
="$(STAGING_DIR)/usr/lib" \
105 $$($(1)_CONFIGURE_OPTS
) \
107 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
108 $(TARGET_CONFIGURE_OPTS
) \
109 CFLAGS
="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
110 mv
-f
$(PKG_BUILD_DIR
)/nfacctd
$(PKG_BUILD_DIR
)/$(2)
111 mv
-f
$(PKG_BUILD_DIR
)/pmacctd
$(PKG_BUILD_DIR
)/$(3)
117 $$(IPKG_
$(1)): $(PKG_BUILD_DIR
)/$(2)
118 install -d
-m0755
$$(IDIR_
$(1))/etc
119 install -m0644 .
/files
/$(3).conf
$$(IDIR_
$(1))/etc
/
120 install -d
-m0755
$$(IDIR_
$(1))/etc
/default
121 install -m0644 .
/files
/$(3).default
$$(IDIR_
$(1))/etc
/default
/$(3)
122 install -d
-m0755
$$(IDIR_
$(1))/etc
/init.d
123 install -m0755 .
/files
/$(3).init
$$(IDIR_
$(1))/etc
/init.d
/$(3)
124 install -d
-m0755
$$(IDIR_
$(1))/usr
/sbin
125 install -m0755
$(PKG_BUILD_DIR
)/$(2) $$(IDIR_
$(1))/usr
/sbin
/$(3)
126 $(RSTRIP
) $$(IDIR_
$(1))
127 $(IPKG_BUILD
) $$(IDIR_
$(1)) $(PACKAGE_DIR
)
131 $(eval
$(call PKG_template
,NFACCTD_BASIC
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
132 $(eval
$(call PKG_template
,NFACCTD_MYSQL
,nfacctd-mysql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
133 $(eval
$(call PKG_template
,NFACCTD_PGSQL
,nfacctd-pgsql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
134 $(eval
$(call PKG_template
,NFACCTD_CUSTOM
,nfacctd-custom
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
135 $(eval
$(call PKG_template
,PMACCTD_BASIC
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
136 $(eval
$(call PKG_template
,PMACCTD_MYSQL
,pmacctd-mysql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
137 $(eval
$(call PKG_template
,PMACCTD_PGSQL
,pmacctd-pgsql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
138 $(eval
$(call PKG_template
,PMACCTD_CUSTOM
,pmacctd-custom
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
139 $(eval
$(call PKG_template
,PMACCT_CLIENT
,pmacct-client
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
141 $(eval
$(call PKG_build
,PMACCT_BASIC
,nfacctd-basic
,pmacctd-basic
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
142 $(eval
$(call PKG_build
,PMACCT_MYSQL
,nfacctd-mysql
,pmacctd-mysql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
143 $(eval
$(call PKG_build
,PMACCT_PGSQL
,nfacctd-pgsql
,pmacctd-pgsql
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
144 $(eval
$(call PKG_build
,NFACCTD_CUSTOM
,nfacctd-custom
,pmacctd-dummy
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
145 $(eval
$(call PKG_build
,PMACCTD_CUSTOM
,nfacctd-dummy
,pmacctd-custom
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
147 $(eval
$(call PKG_package
,NFACCTD_BASIC
,nfacctd-basic
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
148 $(eval
$(call PKG_package
,NFACCTD_MYSQL
,nfacctd-mysql
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
149 $(eval
$(call PKG_package
,NFACCTD_PGSQL
,nfacctd-pgsql
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
150 $(eval
$(call PKG_package
,NFACCTD_CUSTOM
,nfacctd-custom
,nfacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
151 $(eval
$(call PKG_package
,PMACCTD_BASIC
,pmacctd-basic
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
152 $(eval
$(call PKG_package
,PMACCTD_MYSQL
,pmacctd-mysql
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
153 $(eval
$(call PKG_package
,PMACCTD_PGSQL
,pmacctd-pgsql
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
154 $(eval
$(call PKG_package
,PMACCTD_CUSTOM
,pmacctd-custom
,pmacctd
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
156 $(PKG_BUILD_DIR
)/.configured
:
159 $(PKG_BUILD_DIR
)/.built
: $(BUILD_TARGETS
)
162 $(IPKG_PMACCT_CLIENT
):
163 install -d
-m0755
$(IDIR_PMACCT_CLIENT
)/usr
/sbin
164 cp
-fpR
$(PKG_BUILD_DIR
)/pmacct
$(IDIR_PMACCT_CLIENT
)/usr
/sbin
/
165 $(RSTRIP
) $(IDIR_PMACCT_CLIENT
)
166 $(IPKG_BUILD
) $(IDIR_PMACCT_CLIENT
) $(PACKAGE_DIR
)