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.

109 lines
3.4 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.16
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@SF/procps-ng
  13. PKG_HASH:=925eacd65dedcf9c98eb94e8978bbfb63f5de37294cc1047d81462ed477a20af
  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 sysctl 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_SRC_DIR_SBIN:=sysctl
  32. procps-applets-src-dir=$(if $(filter $(PROCPS_APPLETS_SRC_DIR_SBIN),$(1)),/usr/sbin,/usr/bin)
  33. PROCPS_APPLETS_DIR_BIN:=kill ps watch
  34. PROCPS_APPLETS_DIR_SBIN:=sysctl
  35. procps-applets-dir=$(if $(filter $(PROCPS_APPLETS_DIR_BIN),$(1)),/bin,$(if $(filter $(PROCPS_APPLETS_DIR_SBIN),$(1)),/sbin,/usr/bin))
  36. define Package/procps-ng/Default
  37. SECTION:=utils
  38. CATEGORY:=Utilities
  39. DEPENDS:=+libncurses
  40. TITLE:=procps-ng utilities
  41. URL:=https://gitlab.com/procps-ng/procps
  42. endef
  43. define Build/Prepare
  44. $(call Build/Prepare/Default)
  45. echo "$(PKG_VERSION)" > "$(PKG_BUILD_DIR)/.tarball-version"
  46. endef
  47. define Package/procps-ng
  48. $(call Package/procps-ng/Default)
  49. MENU:=1
  50. endef
  51. define Package/procps-ng/description
  52. procps is a set of command line and full-screen utilities that provide information out of the pseudo-filesystem
  53. most commonly located at /proc. This filesystem provides a simple interface to the kernel data structures.
  54. The programs of procps generally concentrate on the structures that describe the processess running on the system.
  55. NOTE: some utilities provided by procps-ng packages (ps, uptime, kill, ...) are installed as busybox applets, by default.
  56. Conflicting applets should be removed from the build to avoid file conflicts.
  57. endef
  58. define GenPlugin
  59. define Package/procps-ng-$(1)
  60. $(call Package/procps-ng/Default)
  61. DEPENDS:=procps-ng
  62. TITLE:=Applet $(1) from the procps-ng package
  63. ALTERNATIVES:=200:$(2)/$(1):/usr/libexec/$(1)-procps-ng
  64. endef
  65. define Package/procps-ng-$(1)/description
  66. Installs the applet $(1).
  67. endef
  68. endef
  69. $(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,$(a),$(call procps-applets-dir,$(a)))))
  70. MAKE_FLAGS += \
  71. CFLAGS="$(TARGET_CFLAGS)" \
  72. CPPFLAGS="$(TARGET_CPPFLAGS)" \
  73. LDFLAGS="$(TARGET_LDFLAGS)" \
  74. define Package/procps-ng/install
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprocps.so* $(1)/usr/lib/
  77. endef
  78. define BuildPlugin
  79. define Package/procps-ng-$(1)/install
  80. $(INSTALL_DIR) $$(1)/usr/libexec
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)$(2)/$(1) $$(1)/usr/libexec/$(1)-procps-ng
  82. endef
  83. $$(eval $$(call BuildPackage,procps-ng-$(1)))
  84. endef
  85. $(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,$(a),$(call procps-applets-src-dir,$(a)))))
  86. $(eval $(call BuildPackage,procps-ng))