From 24cb18bba765fe1ce92eb405db14062cf22b02d6 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Tue, 4 Dec 2012 16:20:42 +0000 Subject: [PATCH] procps: Split package into subpackages Split procps package into various subpackages, one for each applet. This allows the user to choose which applets they want. This is similar to coreutils package. All subpackages are defaulted to YES, to keep the current behaviour, i.e., selecting procps package will select all its subpackages. Signed-off-by: Jonh Wendell Signed-off-by: Florian Fainelli SVN-Revision: 34481 --- utils/procps/Makefile | 52 ++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/utils/procps/Makefile b/utils/procps/Makefile index 8e16706bc..7fd866f17 100644 --- a/utils/procps/Makefile +++ b/utils/procps/Makefile @@ -19,7 +19,11 @@ PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk -define Package/procps +PROCPS_APPLETS := \ + ps free pgrep pkill pmap pwdx skill w \ + slabtop snice tload top vmstat watch + +define Package/procps/Default SECTION:=utils CATEGORY:=Utilities DEPENDS:=+libncurses @@ -27,12 +31,32 @@ define Package/procps URL:=http://procps.sourceforge.net/ endef +define Package/procps + $(call Package/procps/Default) + MENU:=1 +endef + define Package/procps/description procps is the package that has a bunch of small useful utilities that give information about processes using the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill. endef +define GenPlugin + define Package/$(1) + $(call Package/procps/Default) + DEPENDS:=procps + TITLE:=Applet $(2) from the procps package + DEFAULT:=y + endef + + define Package/$(1)/description + Installs the applet $(2). + endef +endef + +$(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,procps-$(a),$(a)))) + MAKE_FLAGS += \ CFLAGS="$(TARGET_CFLAGS)" \ CPPFLAGS="$(TARGET_CPPFLAGS)" \ @@ -40,22 +64,20 @@ MAKE_FLAGS += \ define Package/procps/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/free $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ps/ps $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/pgrep $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/pkill $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/pmap $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/pwdx $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/skill $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/slabtop $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/snice $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tload $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/top $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/vmstat $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/w $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/watch $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/lib $(INSTALL_BIN) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(1)/usr/lib/ endef +AUXDIR_ps := "ps/" + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(AUXDIR_$(2))$(2) $$(1)/usr/bin/ + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,procps-$(a),$(a)))) $(eval $(call BuildPackage,procps)) -- 2.30.2