| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2016 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=iptraf-ng |
| 11 | PKG_VERSION:=1.1.4 |
| 12 | PKG_RELEASE:=1 |
| 13 | |
| 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 15 | PKG_SOURCE_URL:=https://infrastructure.fedoraproject.org/infra/hosted-content/$(PKG_NAME)/$(PKG_NAME) |
| 16 | PKG_HASH:=79140cf07c0cceb1b5723242847a73aa86f5e4f9dccfe8970fda6801d347eb09 |
| 17 | |
| 18 | PKG_LICENSE:=GPL-2.0 |
| 19 | PKG_LICENSE_FILES:=LICENSE |
| 20 | |
| 21 | PKG_MAINTAINER:= |
| 22 | |
| 23 | PKG_CHECK_FORMAT_SECURITY:=0 |
| 24 | |
| 25 | include $(INCLUDE_DIR)/package.mk |
| 26 | |
| 27 | define Package/iptraf-ng |
| 28 | SECTION:=net |
| 29 | CATEGORY:=Network |
| 30 | DEPENDS:=+libncurses |
| 31 | TITLE:=A console-based network monitoring program |
| 32 | URL:=https://infrastructure.fedoraproject.org/infra/hosted-content/iptraf-ng/ |
| 33 | endef |
| 34 | |
| 35 | define Package/iptraf-ng/description |
| 36 | iptraf-ng is a console-based network statistics utility for Linux. It gathers a |
| 37 | variety of figures such as TCP connection packet and byte counts, interface |
| 38 | statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN |
| 39 | station packet and byte counts. |
| 40 | endef |
| 41 | |
| 42 | define Package/iptraf-ng/postinst |
| 43 | #!/bin/sh |
| 44 | if [ -z "$${IPKG_INSTROOT}" ]; then |
| 45 | mkdir -p $${IPKG_INSTROOT}/var/log/iptraf-ng \ |
| 46 | $${IPKG_INSTROOT}/var/run/iptraf-ng \ |
| 47 | $${IPKG_INSTROOT}/var/lib/iptraf-ng |
| 48 | fi |
| 49 | endef |
| 50 | |
| 51 | MAKE_FLAGS += \ |
| 52 | CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \ |
| 53 | CPPFLAGS="$(TARGET_CPPFLAGS) -D_GNU_SOURCE" \ |
| 54 | NCURSES_CFLAGS="$(TARGET_CFLAGS)" \ |
| 55 | NCURSES_LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lpanel" \ |
| 56 | iptraf-ng rvnamed-ng |
| 57 | |
| 58 | define Package/iptraf-ng/install |
| 59 | $(INSTALL_DIR) $(1)/usr/bin |
| 60 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/iptraf-ng $(1)/usr/bin/ |
| 61 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/rvnamed-ng $(1)/usr/bin/ |
| 62 | endef |
| 63 | |
| 64 | $(eval $(call BuildPackage,iptraf-ng)) |