Merge pull request #4853 from StevenHessing/noddos
[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.11
12 PKG_RELEASE:=3
13 PKG_LICENSE:=GPL-2.0
14 PKG_LICENSE_FILES:=COPYING COPYING.LIB
15
16 PKG_SOURCE_PROTO:=git
17 PKG_SOURCE_URL:=https://gitlab.com/procps-ng/procps.git
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 PKG_SOURCE_VERSION:=8a198e3eafbde0b627e9992b41d26e6762e4f8c7
20 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
21 PKG_MIRROR_HASH:=60da7bd78e834112494e4019998c9de8d61f747eab244ef3c42cadc7fd0958cc
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_INSTALL:=1
25 PKG_FIXUP:=autoreconf
26 PKG_BUILD_DEPENDS:=gettext libiconv
27
28 include $(INCLUDE_DIR)/package.mk
29
30 CONFIGURE_ARGS += --enable-skill
31
32 PROCPS_APPLETS := \
33 free kill pgrep pkill pmap ps pwdx skill slabtop \
34 snice tload top uptime vmstat w watch
35
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 MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
43 endef
44
45 define Build/Prepare
46 $(call Build/Prepare/Default)
47 echo "$(PKG_VERSION)" > "$(PKG_BUILD_DIR)/.tarball-version"
48 endef
49
50 define Package/procps-ng
51 $(call Package/procps-ng/Default)
52 MENU:=1
53 endef
54
55 define Package/procps-ng/description
56 procps is a set of command line and full-screen utilities that provide information out of the pseudo-filesystem
57 most commonly located at /proc. This filesystem provides a simple interface to the kernel data structures.
58 The programs of procps generally concentrate on the structures that describe the processess running on the system.
59
60 NOTE: some utilities provided by procps-ng packages (ps, uptime, kill, ...) are installed as busybox applets, by default.
61 Conflicting applets should be removed from the build to avoid file conflicts.
62 endef
63
64 define GenPlugin
65 define Package/$(1)
66 $(call Package/procps-ng/Default)
67 DEPENDS:=procps-ng
68 TITLE:=Applet $(2) from the procps-ng package
69 DEFAULT:=y
70 endef
71
72 define Package/$(1)/description
73 Installs the applet $(2).
74 endef
75 endef
76
77 $(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,procps-ng-$(a),$(a))))
78
79 MAKE_FLAGS += \
80 CFLAGS="$(TARGET_CFLAGS)" \
81 CPPFLAGS="$(TARGET_CPPFLAGS)" \
82 LDFLAGS="$(TARGET_LDFLAGS)" \
83
84 define Package/procps-ng/install
85 $(INSTALL_DIR) $(1)/usr/bin
86 $(INSTALL_DIR) $(1)/usr/lib
87 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libprocps.so* $(1)/usr/lib/
88 endef
89
90 define BuildPlugin
91 define Package/$(1)/install
92 $(INSTALL_DIR) $$(1)/usr/bin
93 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
94 endef
95
96 $$(eval $$(call BuildPackage,$(1)))
97 endef
98
99 $(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,procps-ng-$(a),$(a))))
100 $(eval $(call BuildPackage,procps-ng))