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.

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