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.

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