aboutsummaryrefslogtreecommitdiff
path: root/utils/cpusage/Makefile
diff options
context:
space:
mode:
authorThomas Huehn <thomas.huehn@hs-nordhausen.de>2022-10-08 15:11:17 +0200
committerNick Hainke <vincent@systemli.org>2022-10-08 15:34:04 +0200
commite3fe484aaeaa2e96c8b5b84176d518654b7577ac (patch)
tree104f5a599e87a343202a9e1f648212bdd36164a0 /utils/cpusage/Makefile
parent193ffa68c18e8624f61d992f9def449d2febe9f5 (diff)
cpusage: add new package
This PR adds the new package "cpusage" to OpenWrt packages. Cpusage is a small utility that prints cpu usage per second as output. Signed-off-by: Thomas Huehn <thomas.huehn@hs-nordhausen.de>
Diffstat (limited to 'utils/cpusage/Makefile')
-rw-r--r--utils/cpusage/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/utils/cpusage/Makefile b/utils/cpusage/Makefile
new file mode 100644
index 000000000..f1f63ab3d
--- /dev/null
+++ b/utils/cpusage/Makefile
@@ -0,0 +1,39 @@
+# SPDX-Identifier-License: GPL-2.0-only
+#
+# Copyright (C) 2005 Fabian Schneider,
+# 2010 Florian Sesser,
+# 2022 Thomas Hühn
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cpusage
+PKG_VERSION:=$(AUTORELEASE)
+PKG_MAINTAINER:=Thomas Hühn <thomas.huehn@hs-nordhausen.de>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/cpusage
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Outputs CPU usage statistics once per second
+endef
+
+define Package/cpusage/description
+ CPUsage outputs CPU usage statistics once per second.
+ Optionally writes CSV output (see '-o' option).
+ Originally written by Fabian Schneider (TUM, TUB) in 2005.
+ Timestamp and CSV-compliance by Florian Sesser (TUM), 2010.
+ Refreshed by Thomas Hühn in 2022.
+endef
+
+define Build/Compile
+ $(TARGET_CC) $(TARGET_CFLAGS) \
+ -o $(PKG_BUILD_DIR)/cpusage $(PKG_BUILD_DIR)/cpusage.c
+endef
+
+define Package/cpusage/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/cpusage $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,cpusage))