You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.1 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=procps-ng
  9. PKG_VERSION:=3.3.15
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@SF/procps-ng
  13. PKG_HASH:=10bd744ffcb3de2d591d2f6acf1a54a7ba070fdcc432a855931a5057149f0465
  14. PKG_MAINTAINER:=
  15. PKG_LICENSE:=GPL-2.0-or-later
  16. PKG_LICENSE_FILES:=COPYING COPYING.LIB
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. PKG_FIXUP:=autoreconf
  20. include $(INCLUDE_DIR)/package.mk
  21. CONFIGURE_ARGS += --enable-skill
  22. # most of these have alternatives provided by busybox applets
  23. PROCPS_APPLETS := \
  24. free kill pgrep pkill pmap ps pwdx skill slabtop \
  25. snice tload top uptime vmstat w watch
  26. # procps-ng will be configured with "--bindir=/usr/bin --sbindir=/usr/sbin" and
  27. # as such executables will be installed there by default, but some of them need
  28. # to reside in locations such as /bin and /sbin to be in accordance with
  29. # busybox alternatives which is also other distributions like debian and centos
  30. # are doing
  31. PROCPS_APPLETS_DIR_bin:=kill ps watch
  32. procps-applets-dir=$(if $(findstring $(1),$(PROCPS_APPLETS_DIR_bin)),/bin,/usr/bin)
  33. define Package/procps-ng/Default
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. DEPENDS:=+libncurses
  37. TITLE:=procps-ng utilities
  38. URL:=https://gitlab.com/procps-ng/procps
  39. endef
  40. define Build/Prepare
  41. $(call Build/Prepare/Default)
  42. echo "$(PKG_VERSION)" > "$(PKG_BUILD_DIR)/.tarball-version"
  43. endef
  44. define Package/procps-ng
  45. $(call Package/procps-ng/Default)
  46. MENU:=1
  47. endef
  48. define Package/procps-ng/description
  49. procps is a set of command line and full-screen utilities that provide information out of the pseudo-filesystem
  50. most commonly located at /proc. This filesystem provides a simple interface to the kernel data structures.
  51. The programs of procps generally concentrate on the structures that describe the processess running on the system.
  52. NOTE: some utilities provided by procps-ng packages (ps, uptime, kill, ...) are installed as busybox applets, by default.
  53. Conflicting applets should be removed from the build to avoid file conflicts.
  54. endef
  55. define GenPlugin
  56. define Package/$(1)
  57. $(call Package/procps-ng/Default)
  58. DEPENDS:=procps-ng
  59. TITLE:=Applet $(2) from the procps-ng package
  60. ALTERNATIVES:=200:$(3)/$(2):$(3)/$(1)
  61. endef
  62. define Package/$(1)/description
  63. Installs the applet $(2).
  64. endef
  65. endef
  66. $(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,procps-ng-$(a),$(a),$(call procps-applets-dir,$(a)))))
  67. MAKE_FLAGS += \
  68. CFLAGS="$(TARGET_CFLAGS)" \
  69. CPPFLAGS="$(TARGET_CPPFLAGS)" \
  70. LDFLAGS="$(TARGET_LDFLAGS)" \
  71. define Package/procps-ng/install
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprocps.so* $(1)/usr/lib/
  74. endef
  75. define BuildPlugin
  76. define Package/$(1)/install
  77. $(INSTALL_DIR) $$(1)$(3)
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)$(3)/$(1)
  79. endef
  80. $$(eval $$(call BuildPackage,$(1)))
  81. endef
  82. $(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,procps-ng-$(a),$(a),$(call procps-applets-dir,$(a)))))
  83. $(eval $(call BuildPackage,procps-ng))