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 <jonh.wendell@oiwifi.com.br>
Signed-off-by: Florian Fainelli <florian@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@34481 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2012-12-04 16:20:42 +00:00
parent ebac8d9a27
commit 3f612f4854

View File

@ -19,7 +19,11 @@ PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk 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 SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
DEPENDS:=+libncurses DEPENDS:=+libncurses
@ -27,12 +31,32 @@ define Package/procps
URL:=http://procps.sourceforge.net/ URL:=http://procps.sourceforge.net/
endef endef
define Package/procps
$(call Package/procps/Default)
MENU:=1
endef
define Package/procps/description define Package/procps/description
procps is the package that has a bunch of small useful utilities that give procps is the package that has a bunch of small useful utilities that give
information about processes using the /proc filesystem. The package information about processes using the /proc filesystem. The package
includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill. includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill.
endef 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 += \ MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" \ CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \ CPPFLAGS="$(TARGET_CPPFLAGS)" \
@ -40,22 +64,20 @@ MAKE_FLAGS += \
define Package/procps/install define Package/procps/install
$(INSTALL_DIR) $(1)/usr/bin $(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_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(1)/usr/lib/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(1)/usr/lib/
endef 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)) $(eval $(call BuildPackage,procps))