| 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 |
|
|---|
| 7 | include $(TOPDIR)/rules.mk
|
|---|
| 8 |
|
|---|
| 9 | PKG_NAME:= pmacct
|
|---|
| 10 | PKG_VERSION:= 0.10.0
|
|---|
| 11 | PKG_RELEASE:= 2
|
|---|
| 12 | PKG_MD5SUM:= ed510e7ee2130d1f37f27901b89e985a
|
|---|
| 13 | PKG_INIT:= 50
|
|---|
| 14 |
|
|---|
| 15 | PKG_SOURCE_URL:= http://www.ba.cnr.it/~paolo/pmacct/
|
|---|
| 16 | PKG_SOURCE:= $(PKG_NAME)-$(PKG_VERSION)rc2.tar.gz
|
|---|
| 17 |
|
|---|
| 18 | include $(TOPDIR)/mk/package.mk
|
|---|
| 19 |
|
|---|
| 20 | PMACCT_CLIENT_OPTS := \
|
|---|
| 21 |
|
|---|
| 22 | PMACCT_BASIC_CONFIGURE_OPTS := \
|
|---|
| 23 |
|
|---|
| 24 | PMACCT_MYSQL_CONFIGURE_OPTS := \
|
|---|
| 25 | --enable-mysql \
|
|---|
| 26 | --with-mysql-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 27 | --with-mysql-libs="$(STAGING_DIR)/usr/lib/mysql"
|
|---|
| 28 |
|
|---|
| 29 | PMACCT_PGSQL_CONFIGURE_OPTS := \
|
|---|
| 30 | --enable-pgsql \
|
|---|
| 31 | --with-pgsql-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 32 | --with-pgsql-libs="$(STAGING_DIR)/usr/lib"
|
|---|
| 33 |
|
|---|
| 34 | PMACCT_SQLITE_CONFIGURE_OPTS := \
|
|---|
| 35 | --enable-sqlite3 \
|
|---|
| 36 | --with-sqlite3-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 37 | --with-sqlite3-libs="$(STAGING_DIR)/usr/lib"
|
|---|
| 38 |
|
|---|
| 39 | NFACCTD_CUSTOM_CONFIGURE_OPTS := \
|
|---|
| 40 |
|
|---|
| 41 | ifeq ($(FWRT_PACKAGE_NFACCTD_ENABLE_DEBUG),y)
|
|---|
| 42 | NFACCTD_CUSTOM_CONFIGURE_OPTS += --enable-debug
|
|---|
| 43 | endif
|
|---|
| 44 |
|
|---|
| 45 | ifeq ($(FWRT_PACKAGE_NFACCTD_ENABLE_IPV6),y)
|
|---|
| 46 | NFACCTD_CUSTOM_CONFIGURE_OPTS += --enable-ipv6
|
|---|
| 47 | endif
|
|---|
| 48 |
|
|---|
| 49 | ifeq ($(FWRT_PACKAGE_NFACCTD_WITH_MYSQL),y)
|
|---|
| 50 | NFACCTD_CUSTOM_CONFIGURE_OPTS += $(PMACCT_MYSQL_CONFIGURE_OPTS)
|
|---|
| 51 | endif
|
|---|
| 52 |
|
|---|
| 53 | ifeq ($(FWRT_PACKAGE_NFACCTD_WITH_PGSQL),y)
|
|---|
| 54 | NFACCTD_CUSTOM_CONFIGURE_OPTS += $(PMACCT_PGSQL_CONFIGURE_OPTS)
|
|---|
| 55 | endif
|
|---|
| 56 |
|
|---|
| 57 | ifeq ($(FWRT_PACKAGE_NFACCTD_WITH_SQLITE),y)
|
|---|
| 58 | NFACCTD_CUSTOM_CONFIGURE_OPTS += $(PMACCT_SQLITE_CONFIGURE_OPTS)
|
|---|
| 59 | endif
|
|---|
| 60 |
|
|---|
| 61 | PMACCTD_CUSTOM_CONFIGURE_OPTS := \
|
|---|
| 62 |
|
|---|
| 63 | ifeq ($(FWRT_PACKAGE_PMACCTD_ENABLE_DEBUG),y)
|
|---|
| 64 | PMACCTD_CUSTOM_CONFIGURE_OPTS += --enable-debug
|
|---|
| 65 | endif
|
|---|
| 66 |
|
|---|
| 67 | ifeq ($(FWRT_PACKAGE_PMACCTD_ENABLE_IPV6),y)
|
|---|
| 68 | PMACCTD_CUSTOM_CONFIGURE_OPTS += --enable-ipv6
|
|---|
| 69 | endif
|
|---|
| 70 |
|
|---|
| 71 | ifeq ($(FWRT_PACKAGE_PMACCTD_WITH_MYSQL),y)
|
|---|
| 72 | PMACCTD_CUSTOM_CONFIGURE_OPTS += $(PMACCT_MYSQL_CONFIGURE_OPTS)
|
|---|
| 73 | endif
|
|---|
| 74 |
|
|---|
| 75 | ifeq ($(FWRT_PACKAGE_PMACCTD_WITH_PGSQL),y)
|
|---|
| 76 | PMACCTD_CUSTOM_CONFIGURE_OPTS += $(PMACCT_PGSQL_CONFIGURE_OPTS)
|
|---|
| 77 | endif
|
|---|
| 78 |
|
|---|
| 79 | ifeq ($(FWRT_PACKAGE_PMACCTD_WITH_SQLITE),y)
|
|---|
| 80 | PMACCTD_CUSTOM_CONFIGURE_OPTS += $(PMACCT_SQLITE_CONFIGURE_OPTS)
|
|---|
| 81 | endif
|
|---|
| 82 |
|
|---|
| 83 | define PKG_build
|
|---|
| 84 |
|
|---|
| 85 | ifneq ($(FWRT_PACKAGE_$(1)),)
|
|---|
| 86 | BUILD_TARGETS += $(WRKBUILD)/$(2)
|
|---|
| 87 | BUILD_TARGETS += $(WRKBUILD)/$(3)
|
|---|
| 88 | endif
|
|---|
| 89 |
|
|---|
| 90 | $(WRKBUILD)/$(2) $(WRKBUILD)/$(3): $(WRKBUILD)/.prepared
|
|---|
| 91 | -$(MAKE) -C $(WRKBUILD) distclean
|
|---|
| 92 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 93 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 94 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 95 | CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
|
|---|
| 96 | LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
|
|---|
| 97 | ./configure \
|
|---|
| 98 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 99 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 100 | --build=$(GNU_HOST_NAME) \
|
|---|
| 101 | --program-prefix="" \
|
|---|
| 102 | --program-suffix="" \
|
|---|
| 103 | --prefix=/usr \
|
|---|
| 104 | --exec-prefix=/usr \
|
|---|
| 105 | --bindir=/usr/sbin \
|
|---|
| 106 | --datadir=/usr/share \
|
|---|
| 107 | --includedir=/usr/include \
|
|---|
| 108 | --infodir=/usr/share/info \
|
|---|
| 109 | --libdir=/usr/lib \
|
|---|
| 110 | --libexecdir=/usr/lib/locate \
|
|---|
| 111 | --localstatedir=/var/lib \
|
|---|
| 112 | --mandir=/usr/share/man \
|
|---|
| 113 | --sbindir=/usr/sbin \
|
|---|
| 114 | --sysconfdir=/etc \
|
|---|
| 115 | --disable-nls \
|
|---|
| 116 | --enable-shared \
|
|---|
| 117 | --disable-static \
|
|---|
| 118 | --with-pcap-includes="$(STAGING_DIR)/usr/include" \
|
|---|
| 119 | --with-pcap-libs="$(STAGING_DIR)/usr/lib" \
|
|---|
| 120 | $$($(1)_CONFIGURE_OPTS) \
|
|---|
| 121 | );
|
|---|
| 122 | $(MAKE) -C $(WRKBUILD) \
|
|---|
| 123 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 124 | CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
|
|---|
| 125 | mv -f $(WRKBUILD)/nfacctd $(WRKBUILD)/$(2)
|
|---|
| 126 | mv -f $(WRKBUILD)/pmacctd $(WRKBUILD)/$(3)
|
|---|
| 127 |
|
|---|
| 128 | endef
|
|---|
| 129 |
|
|---|
| 130 | define PKG_package
|
|---|
| 131 |
|
|---|
| 132 | $$(IPKG_$(1)): $(WRKBUILD)/$(2)
|
|---|
| 133 | install -d -m0755 $$(IDIR_$(1))/etc
|
|---|
| 134 | install -m0644 ./files/$(3).conf $$(IDIR_$(1))/etc/
|
|---|
| 135 | #install -d -m0755 $$(IDIR_$(1))/etc/default
|
|---|
| 136 | #install -m0644 ./files/$(3).default $$(IDIR_$(1))/etc/default/$(3)
|
|---|
| 137 | install -d -m0755 $$(IDIR_$(1))/etc/init.d
|
|---|
| 138 | install -m0755 ./files/$(3).init $$(IDIR_$(1))/etc/init.d/S$(PKG_INIT)$(3)
|
|---|
| 139 | install -d -m0755 $$(IDIR_$(1))/usr/sbin
|
|---|
| 140 | install -m0755 $(WRKBUILD)/$(2) $$(IDIR_$(1))/usr/sbin/$(3)
|
|---|
| 141 | $(RSTRIP) $$(IDIR_$(1))
|
|---|
| 142 | $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
|
|---|
| 143 |
|
|---|
| 144 | endef
|
|---|
| 145 |
|
|---|
| 146 | $(eval $(call PKG_template,NFACCTD_BASIC,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 147 | $(eval $(call PKG_template,NFACCTD_MYSQL,nfacctd-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 148 | $(eval $(call PKG_template,NFACCTD_PGSQL,nfacctd-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 149 | $(eval $(call PKG_template,NFACCTD_SQLITE,nfacctd-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 150 | $(eval $(call PKG_template,NFACCTD_CUSTOM,nfacctd-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 151 | $(eval $(call PKG_template,PMACCTD_BASIC,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 152 | $(eval $(call PKG_template,PMACCTD_MYSQL,pmacctd-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 153 | $(eval $(call PKG_template,PMACCTD_PGSQL,pmacctd-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 154 | $(eval $(call PKG_template,PMACCTD_SQLITE,pmacctd-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 155 | $(eval $(call PKG_template,PMACCTD_CUSTOM,pmacctd-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 156 | $(eval $(call PKG_template,PMACCT_CLIENT,pmacct-client,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 157 |
|
|---|
| 158 | $(eval $(call PKG_build,PMACCT_CLIENT,nfacctd-basic,pmacctd-basic,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 159 | $(eval $(call PKG_build,PMACCT_BASIC,nfacctd-basic,pmacctd-basic,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 160 | $(eval $(call PKG_build,PMACCT_MYSQL,nfacctd-mysql,pmacctd-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 161 | $(eval $(call PKG_build,PMACCT_PGSQL,nfacctd-pgsql,pmacctd-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 162 | $(eval $(call PKG_build,PMACCT_SQLITE,nfacctd-sqlite,pmacctd-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 163 | $(eval $(call PKG_build,NFACCTD_CUSTOM,nfacctd-custom,pmacctd-dummy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 164 | $(eval $(call PKG_build,PMACCTD_CUSTOM,nfacctd-dummy,pmacctd-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 165 |
|
|---|
| 166 | $(eval $(call PKG_package,NFACCTD_BASIC,nfacctd-basic,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 167 | $(eval $(call PKG_package,NFACCTD_MYSQL,nfacctd-mysql,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 168 | $(eval $(call PKG_package,NFACCTD_PGSQL,nfacctd-pgsql,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 169 | $(eval $(call PKG_package,NFACCTD_SQLITE,nfacctd-sqlite,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 170 | $(eval $(call PKG_package,NFACCTD_CUSTOM,nfacctd-custom,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 171 | $(eval $(call PKG_package,PMACCTD_BASIC,pmacctd-basic,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 172 | $(eval $(call PKG_package,PMACCTD_MYSQL,pmacctd-mysql,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 173 | $(eval $(call PKG_package,PMACCTD_PGSQL,pmacctd-pgsql,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 174 | $(eval $(call PKG_package,PMACCTD_SQLITE,pmacctd-sqlite,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 175 | $(eval $(call PKG_package,PMACCTD_CUSTOM,pmacctd-custom,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 176 |
|
|---|
| 177 | $(WRKBUILD)/.configured:
|
|---|
| 178 | touch $@
|
|---|
| 179 |
|
|---|
| 180 | $(WRKBUILD)/.built: $(BUILD_TARGETS)
|
|---|
| 181 | touch $@
|
|---|
| 182 |
|
|---|
| 183 | $(IPKG_PMACCT_CLIENT):
|
|---|
| 184 | install -d -m0755 $(IDIR_PMACCT_CLIENT)/usr/sbin
|
|---|
| 185 | $(CP) $(WRKBUILD)/pmacct $(IDIR_PMACCT_CLIENT)/usr/sbin/
|
|---|
| 186 | $(RSTRIP) $(IDIR_PMACCT_CLIENT)
|
|---|
| 187 | $(IPKG_BUILD) $(IDIR_PMACCT_CLIENT) $(PACKAGE_DIR)
|
|---|