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