From: cshore Date: Sat, 12 Mar 2011 08:50:00 +0000 (+0000) Subject: [admin] pmacct: Moved pmacct package from Network|pmacct to Administration because... X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=8e9c7eee725fb110e2471c4f1e05bfef5989b96d;p=packages.git [admin] pmacct: Moved pmacct package from Network|pmacct to Administration because it's accounting information. git-svn-id: svn://svn.openwrt.org/openwrt/packages@26105 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/admin/pmacct/Makefile b/admin/pmacct/Makefile new file mode 100644 index 000000000..9480345c5 --- /dev/null +++ b/admin/pmacct/Makefile @@ -0,0 +1,202 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pmacct +PKG_VERSION:=0.10.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.pmacct.net/ +PKG_MD5SUM:=0be1ffd9d4bda73575caa3240abbf4cb + +PKG_BUILD_DEPENDS:=libpcap + +include $(INCLUDE_DIR)/package.mk + +define Package/pmacct/Default + SECTION:=admin + CATEGORY:=Administration + URL:=http://www.pmacct.net/ +endef + +define Package/nfacctd/Default + $(call Package/pmacct/Default) + TITLE:=NetFlow accounting daemon +endef + +define Package/nfacctd + $(call Package/nfacctd/Default) +endef + +define Package/nfacctd-mysql + $(call Package/nfacctd/Default) + TITLE+= with MySQL support + DEPENDS+= +libmysqlclient +endef + +define Package/nfacctd-pgsql + $(call Package/nfacctd/Default) + TITLE+= with PostreSQL support + DEPENDS+= +libpq +endef + +define Package/nfacctd-sqlite + $(call Package/nfacctd/Default) + TITLE+= with SQLite support + DEPENDS+= +libsqlite3 +endef + +define Package/pmacctd/Default + $(call Package/pmacct/Default) + DEPENDS+= +libpcap + TITLE:=IP pcap-based accounting daemon +endef + +define Package/pmacctd + $(call Package/pmacctd/Default) +endef + +define Package/pmacctd-mysql + $(call Package/pmacctd/Default) + TITLE+= with MySQL support + DEPENDS+= +libmysqlclient +endef + +define Package/pmacctd-pgsql + $(call Package/pmacctd/Default) + TITLE+= with PostreSQL support + DEPENDS+= +libpq +endef + +define Package/pmacctd-sqlite + $(call Package/pmacctd/Default) + TITLE+= with SQLite support + DEPENDS+= +libsqlite3 +endef + +define Package/pmacct-client + $(call Package/pmacct/Default) + TITLE:=Command-line client to gather data from the IMT plugin +endef + +define Compile/Template + +$(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1): $(STAMP_CONFIGURED) + -$(MAKE) -C $(PKG_BUILD_DIR) distclean + $(call Build/Configure/Default, \ + --with-pcap-includes="$(STAGING_DIR)/usr/include" \ + --with-pcap-libs="$(STAGING_DIR)/usr/lib" \ + $(2) \ + ,\ + LIBS="-lz" \ + ,,\ + ); + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + all + mv -f $(PKG_BUILD_DIR)/src/nfacctd $(PKG_BUILD_DIR)/nfacctd$(1) + mv -f $(PKG_BUILD_DIR)/src/pmacctd $(PKG_BUILD_DIR)/pmacctd$(1) + +$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1) + +endef + + +define Install/Template + +define Package/$(1)$(2)/conffiles +/etc/default/$(1) +/etc/$(1).conf +endef + +define Package/$(1)$(2)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1)$(2) $$(1)/usr/sbin/$(1) + $(INSTALL_DIR) $$(1)/etc + $(INSTALL_DATA) ./files/$(1).conf $$(1)/etc/ + $(INSTALL_DIR) $$(1)/etc/default + $(INSTALL_DATA) ./files/$(1).default $$(1)/etc/default/$(1) + $(INSTALL_DIR) $$(1)/etc/init.d + $(INSTALL_BIN) ./files/$(1).init $$(1)/etc/init.d/$(1) +endef + +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd)$(CONFIG_PACKAGE_pmacctd),) + define Compile/pmacct/basic + $(call Compile/Template,, \ + --disable-mysql \ + --disable-pgsql \ + --disable-sqlite3 \ + ) + $(call Install/Template,nfacctd,) + $(call Install/Template,pmacctd,) + endef +endif +$(eval $(Compile/pmacct/basic)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-mysql)$(CONFIG_PACKAGE_pmacctd-mysql),) + define Compile/pmacct/mysql + $(call Compile/Template,-mysql, \ + --enable-mysql \ + --with-mysql-includes="$(STAGING_DIR)/usr/include" \ + --with-mysql-libs="$(STAGING_DIR)/usr/lib/mysql" \ + ) + $(call Install/Template,nfacctd,-mysql) + $(call Install/Template,pmacctd,-mysql) + endef +endif +$(eval $(Compile/pmacct/mysql)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-pgsql)$(CONFIG_PACKAGE_pmacctd-pgsql),) + define Compile/pmacct/pgsql + $(call Compile/Template,-pgsql, \ + --enable-pgsql \ + --with-pgsql-includes="$(STAGING_DIR)/usr/include" \ + --with-pgsql-libs="$(STAGING_DIR)/usr/lib" \ + ) + $(call Install/Template,nfacctd,-pgsql) + $(call Install/Template,pmacctd,-pgsql) + endef +endif +$(eval $(Compile/pmacct/pgsql)) + +ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-sqlite)$(CONFIG_PACKAGE_pmacctd-sqlite),) + define Compile/pmacct/sqlite + $(call Compile/Template,-sqlite, \ + --enable-sqlite3 \ + --with-sqlite3-includes="$(STAGING_DIR)/usr/include" \ + --with-sqlite3-libs="$(STAGING_DIR)/usr/lib" \ + ) + $(call Install/Template,nfacctd,-sqlite) + $(call Install/Template,pmacctd,-sqlite) + endef +endif +$(eval $(Compile/pmacct/sqlite)) + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/pmacct-client/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/src/pmacct $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,nfacctd)) +$(eval $(call BuildPackage,nfacctd-mysql)) +$(eval $(call BuildPackage,nfacctd-pgsql)) +$(eval $(call BuildPackage,nfacctd-sqlite)) +$(eval $(call BuildPackage,pmacctd)) +$(eval $(call BuildPackage,pmacctd-mysql)) +$(eval $(call BuildPackage,pmacctd-pgsql)) +$(eval $(call BuildPackage,pmacctd-sqlite)) +$(eval $(call BuildPackage,pmacct-client)) diff --git a/admin/pmacct/files/nfacctd.conf b/admin/pmacct/files/nfacctd.conf new file mode 100644 index 000000000..27b895683 --- /dev/null +++ b/admin/pmacct/files/nfacctd.conf @@ -0,0 +1,29 @@ +! +! nfacctd configuration example +! +! debug: true +daemonize: true +pidfile: /var/run/nfacctd.pid +! aggregate_filter[dummy]: src net 192.168.0.0/16 +aggregate: src_host, dst_host +! plugin_buffer_size: 1024 +! nfacctd_port: 5678 +! nfacctd_time_secs: true +! nfacctd_time_new: true +plugins: memory +imt_buckets: 65537 +imt_mem_pools_size: 65536 +! imt_mem_pools_number: 0 +! plugins: mysql +! plugins: pgsql +! plugins: sqlite3 +! sql_db: pmacct +! sql_table: acct +! sql_table_version: 2 +! sql_passwd: arealsmartpwd +! sql_user: pmacct +! sql_refresh_time: 90 +! sql_optimize_clauses: true +! sql_history: 10m +! sql_history_roundoff: mh +! networks_file: ./networks.example diff --git a/admin/pmacct/files/nfacctd.default b/admin/pmacct/files/nfacctd.default new file mode 100644 index 000000000..9315b280c --- /dev/null +++ b/admin/pmacct/files/nfacctd.default @@ -0,0 +1 @@ +OPTIONS="-f /etc/nfacctd.conf" diff --git a/admin/pmacct/files/nfacctd.init b/admin/pmacct/files/nfacctd.init new file mode 100644 index 000000000..e1113571c --- /dev/null +++ b/admin/pmacct/files/nfacctd.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=nfacctd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill -INT $(cat $PID_F) +} diff --git a/admin/pmacct/files/pmacctd.conf b/admin/pmacct/files/pmacctd.conf new file mode 100644 index 000000000..e7e4892a1 --- /dev/null +++ b/admin/pmacct/files/pmacctd.conf @@ -0,0 +1,27 @@ +! +! pmacctd configuration example +! +! debug: true +interface: vlan1 +daemonize: true +pidfile: /var/run/pmacctd.pid +pmacctd_id: 1 +aggregate: src_host,dst_host +! aggregate: src_net,dst_net +plugins: memory +imt_buckets: 65537 +imt_mem_pools_size: 65536 +! imt_mem_pools_number: 0 +! plugins: mysql +! plugins: pgsql +! plugins: sqlite3 +! sql_db: pmacct +! sql_table: acct +! sql_table_version: 2 +! sql_passwd: arealsmartpwd +! sql_user: pmacct +! sql_refresh_time: 90 +! sql_optimize_clauses: true +! sql_history: 10m +! sql_history_roundoff: mh +! networks_file: ./networks.example diff --git a/admin/pmacct/files/pmacctd.default b/admin/pmacct/files/pmacctd.default new file mode 100644 index 000000000..3c06f085f --- /dev/null +++ b/admin/pmacct/files/pmacctd.default @@ -0,0 +1 @@ +OPTIONS="-f /etc/pmacctd.conf" diff --git a/admin/pmacct/files/pmacctd.init b/admin/pmacct/files/pmacctd.init new file mode 100644 index 000000000..a57c5817b --- /dev/null +++ b/admin/pmacct/files/pmacctd.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 + +BIN=pmacctd +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + $BIN $OPTIONS +} + +stop() { + [ -f $PID_F ] && kill -INT $(cat $PID_F) +} diff --git a/net/pmacct/Makefile b/net/pmacct/Makefile deleted file mode 100644 index 240acac1d..000000000 --- a/net/pmacct/Makefile +++ /dev/null @@ -1,203 +0,0 @@ -# -# Copyright (C) 2006-2009 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=pmacct -PKG_VERSION:=0.10.3 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.pmacct.net/ -PKG_MD5SUM:=0be1ffd9d4bda73575caa3240abbf4cb - -PKG_BUILD_DEPENDS:=libpcap - -include $(INCLUDE_DIR)/package.mk - -define Package/pmacct/Default - SECTION:=net - CATEGORY:=Network - SUBMENU:=pmacct (accounting and aggregation tools) - URL:=http://www.pmacct.net/ -endef - -define Package/nfacctd/Default - $(call Package/pmacct/Default) - TITLE:=NetFlow accounting daemon -endef - -define Package/nfacctd - $(call Package/nfacctd/Default) -endef - -define Package/nfacctd-mysql - $(call Package/nfacctd/Default) - TITLE+= with MySQL support - DEPENDS+= +libmysqlclient -endef - -define Package/nfacctd-pgsql - $(call Package/nfacctd/Default) - TITLE+= with PostreSQL support - DEPENDS+= +libpq -endef - -define Package/nfacctd-sqlite - $(call Package/nfacctd/Default) - TITLE+= with SQLite support - DEPENDS+= +libsqlite3 -endef - -define Package/pmacctd/Default - $(call Package/pmacct/Default) - DEPENDS+= +libpcap - TITLE:=IP pcap-based accounting daemon -endef - -define Package/pmacctd - $(call Package/pmacctd/Default) -endef - -define Package/pmacctd-mysql - $(call Package/pmacctd/Default) - TITLE+= with MySQL support - DEPENDS+= +libmysqlclient -endef - -define Package/pmacctd-pgsql - $(call Package/pmacctd/Default) - TITLE+= with PostreSQL support - DEPENDS+= +libpq -endef - -define Package/pmacctd-sqlite - $(call Package/pmacctd/Default) - TITLE+= with SQLite support - DEPENDS+= +libsqlite3 -endef - -define Package/pmacct-client - $(call Package/pmacct/Default) - TITLE:=Command-line client to gather data from the IMT plugin -endef - -define Compile/Template - -$(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1): $(STAMP_CONFIGURED) - -$(MAKE) -C $(PKG_BUILD_DIR) distclean - $(call Build/Configure/Default, \ - --with-pcap-includes="$(STAGING_DIR)/usr/include" \ - --with-pcap-libs="$(STAGING_DIR)/usr/lib" \ - $(2) \ - ,\ - LIBS="-lz" \ - ,,\ - ); - $(MAKE) -C $(PKG_BUILD_DIR) \ - CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ - all - mv -f $(PKG_BUILD_DIR)/src/nfacctd $(PKG_BUILD_DIR)/nfacctd$(1) - mv -f $(PKG_BUILD_DIR)/src/pmacctd $(PKG_BUILD_DIR)/pmacctd$(1) - -$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1) - -endef - - -define Install/Template - -define Package/$(1)$(2)/conffiles -/etc/default/$(1) -/etc/$(1).conf -endef - -define Package/$(1)$(2)/install - $(INSTALL_DIR) $$(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1)$(2) $$(1)/usr/sbin/$(1) - $(INSTALL_DIR) $$(1)/etc - $(INSTALL_DATA) ./files/$(1).conf $$(1)/etc/ - $(INSTALL_DIR) $$(1)/etc/default - $(INSTALL_DATA) ./files/$(1).default $$(1)/etc/default/$(1) - $(INSTALL_DIR) $$(1)/etc/init.d - $(INSTALL_BIN) ./files/$(1).init $$(1)/etc/init.d/$(1) -endef - -endef - -ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd)$(CONFIG_PACKAGE_pmacctd),) - define Compile/pmacct/basic - $(call Compile/Template,, \ - --disable-mysql \ - --disable-pgsql \ - --disable-sqlite3 \ - ) - $(call Install/Template,nfacctd,) - $(call Install/Template,pmacctd,) - endef -endif -$(eval $(Compile/pmacct/basic)) - -ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-mysql)$(CONFIG_PACKAGE_pmacctd-mysql),) - define Compile/pmacct/mysql - $(call Compile/Template,-mysql, \ - --enable-mysql \ - --with-mysql-includes="$(STAGING_DIR)/usr/include" \ - --with-mysql-libs="$(STAGING_DIR)/usr/lib/mysql" \ - ) - $(call Install/Template,nfacctd,-mysql) - $(call Install/Template,pmacctd,-mysql) - endef -endif -$(eval $(Compile/pmacct/mysql)) - -ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-pgsql)$(CONFIG_PACKAGE_pmacctd-pgsql),) - define Compile/pmacct/pgsql - $(call Compile/Template,-pgsql, \ - --enable-pgsql \ - --with-pgsql-includes="$(STAGING_DIR)/usr/include" \ - --with-pgsql-libs="$(STAGING_DIR)/usr/lib" \ - ) - $(call Install/Template,nfacctd,-pgsql) - $(call Install/Template,pmacctd,-pgsql) - endef -endif -$(eval $(Compile/pmacct/pgsql)) - -ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-sqlite)$(CONFIG_PACKAGE_pmacctd-sqlite),) - define Compile/pmacct/sqlite - $(call Compile/Template,-sqlite, \ - --enable-sqlite3 \ - --with-sqlite3-includes="$(STAGING_DIR)/usr/include" \ - --with-sqlite3-libs="$(STAGING_DIR)/usr/lib" \ - ) - $(call Install/Template,nfacctd,-sqlite) - $(call Install/Template,pmacctd,-sqlite) - endef -endif -$(eval $(Compile/pmacct/sqlite)) - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/pmacct-client/install - $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_BUILD_DIR)/src/pmacct $(1)/usr/sbin/ -endef - -$(eval $(call BuildPackage,nfacctd)) -$(eval $(call BuildPackage,nfacctd-mysql)) -$(eval $(call BuildPackage,nfacctd-pgsql)) -$(eval $(call BuildPackage,nfacctd-sqlite)) -$(eval $(call BuildPackage,pmacctd)) -$(eval $(call BuildPackage,pmacctd-mysql)) -$(eval $(call BuildPackage,pmacctd-pgsql)) -$(eval $(call BuildPackage,pmacctd-sqlite)) -$(eval $(call BuildPackage,pmacct-client)) diff --git a/net/pmacct/files/nfacctd.conf b/net/pmacct/files/nfacctd.conf deleted file mode 100644 index 27b895683..000000000 --- a/net/pmacct/files/nfacctd.conf +++ /dev/null @@ -1,29 +0,0 @@ -! -! nfacctd configuration example -! -! debug: true -daemonize: true -pidfile: /var/run/nfacctd.pid -! aggregate_filter[dummy]: src net 192.168.0.0/16 -aggregate: src_host, dst_host -! plugin_buffer_size: 1024 -! nfacctd_port: 5678 -! nfacctd_time_secs: true -! nfacctd_time_new: true -plugins: memory -imt_buckets: 65537 -imt_mem_pools_size: 65536 -! imt_mem_pools_number: 0 -! plugins: mysql -! plugins: pgsql -! plugins: sqlite3 -! sql_db: pmacct -! sql_table: acct -! sql_table_version: 2 -! sql_passwd: arealsmartpwd -! sql_user: pmacct -! sql_refresh_time: 90 -! sql_optimize_clauses: true -! sql_history: 10m -! sql_history_roundoff: mh -! networks_file: ./networks.example diff --git a/net/pmacct/files/nfacctd.default b/net/pmacct/files/nfacctd.default deleted file mode 100644 index 9315b280c..000000000 --- a/net/pmacct/files/nfacctd.default +++ /dev/null @@ -1 +0,0 @@ -OPTIONS="-f /etc/nfacctd.conf" diff --git a/net/pmacct/files/nfacctd.init b/net/pmacct/files/nfacctd.init deleted file mode 100644 index e1113571c..000000000 --- a/net/pmacct/files/nfacctd.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org -START=50 - -BIN=nfacctd -DEFAULT=/etc/default/$BIN -RUN_D=/var/run -PID_F=$RUN_D/$BIN.pid - -start() { - [ -f $DEFAULT ] && . $DEFAULT - mkdir -p $RUN_D - $BIN $OPTIONS -} - -stop() { - [ -f $PID_F ] && kill -INT $(cat $PID_F) -} diff --git a/net/pmacct/files/pmacctd.conf b/net/pmacct/files/pmacctd.conf deleted file mode 100644 index e7e4892a1..000000000 --- a/net/pmacct/files/pmacctd.conf +++ /dev/null @@ -1,27 +0,0 @@ -! -! pmacctd configuration example -! -! debug: true -interface: vlan1 -daemonize: true -pidfile: /var/run/pmacctd.pid -pmacctd_id: 1 -aggregate: src_host,dst_host -! aggregate: src_net,dst_net -plugins: memory -imt_buckets: 65537 -imt_mem_pools_size: 65536 -! imt_mem_pools_number: 0 -! plugins: mysql -! plugins: pgsql -! plugins: sqlite3 -! sql_db: pmacct -! sql_table: acct -! sql_table_version: 2 -! sql_passwd: arealsmartpwd -! sql_user: pmacct -! sql_refresh_time: 90 -! sql_optimize_clauses: true -! sql_history: 10m -! sql_history_roundoff: mh -! networks_file: ./networks.example diff --git a/net/pmacct/files/pmacctd.default b/net/pmacct/files/pmacctd.default deleted file mode 100644 index 3c06f085f..000000000 --- a/net/pmacct/files/pmacctd.default +++ /dev/null @@ -1 +0,0 @@ -OPTIONS="-f /etc/pmacctd.conf" diff --git a/net/pmacct/files/pmacctd.init b/net/pmacct/files/pmacctd.init deleted file mode 100644 index a57c5817b..000000000 --- a/net/pmacct/files/pmacctd.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org -START=50 - -BIN=pmacctd -DEFAULT=/etc/default/$BIN -RUN_D=/var/run -PID_F=$RUN_D/$BIN.pid - -start() { - [ -f $DEFAULT ] && . $DEFAULT - mkdir -p $RUN_D - $BIN $OPTIONS -} - -stop() { - [ -f $PID_F ] && kill -INT $(cat $PID_F) -}