2 # Copyright (C) 2006-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=https
://www.busybox.net
/downloads \
17 http
://sources.buildroot.net
18 PKG_HASH
:=e3c14a3699dc7e82fed397392957afc78e37bdf25398ac38ead6e84621b2ae6a
20 PKG_BUILD_DEPENDS
:=BUSYBOX_USE_LIBRPC
:librpc BUSYBOX_CONFIG_PAM
:libpam
22 PKG_CHECK_FORMAT_SECURITY
:=0
25 #Busybox use it's own PIE config flag and LDFLAGS are used with ld, not gcc.
29 PKG_LICENSE_FILES
:=LICENSE archival
/libarchive
/bz
/LICENSE
30 PKG_CPE_ID
:=cpe
:/a
:busybox
:busybox
32 include $(INCLUDE_DIR
)/package.mk
35 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell grep
'^CONFIG_BUSYBOX_' $(TOPDIR
)/.config | mkhash md5
)
38 BUSYBOX_SYM
=$(if
$(CONFIG_BUSYBOX_CUSTOM
),CONFIG
,DEFAULT
)
39 BUSYBOX_IF_ENABLED
=$(if
$(CONFIG_BUSYBOX_
$(BUSYBOX_SYM
)_
$(1)),$(2))
41 define Package
/busybox
44 MAINTAINER
:=Felix Fietkau
<nbd@nbd.name
>
45 TITLE
:=Core utilities for embedded Linux
46 URL
:=http
://busybox.net
/
47 DEPENDS
:=+BUSYBOX_USE_LIBRPC
:librpc
+BUSYBOX_CONFIG_PAM
:libpam
+BUSYBOX_CONFIG_NTPD
:jsonfilter
50 $(call BUSYBOX_IF_ENABLED
,FLOCK
, 100:/usr
/bin
/flock
:/bin
/busybox
) \
51 $(call BUSYBOX_IF_ENABLED
,FREE
, 100:/usr
/bin
/free
:/bin
/busybox
) \
52 $(call BUSYBOX_IF_ENABLED
,IP
, 100:/sbin
/ip
:/bin
/busybox
) \
53 $(call BUSYBOX_IF_ENABLED
,KILL
, 100:/bin
/kill
:/bin
/busybox
) \
54 $(call BUSYBOX_IF_ENABLED
,PGREP
, 100:/usr
/bin
/pgrep
:/bin
/busybox
) \
55 $(call BUSYBOX_IF_ENABLED
,PKILL
, 100:/usr
/bin
/pkill
:/bin
/busybox
) \
56 $(call BUSYBOX_IF_ENABLED
,PMAP
, 100:/usr
/bin
/pmap
:/bin
/busybox
) \
57 $(call BUSYBOX_IF_ENABLED
,PS
, 100:/bin
/ps
:/bin
/busybox
) \
58 $(call BUSYBOX_IF_ENABLED
,PWDX
, 100:/usr
/bin
/pwdx
:/bin
/busybox
) \
59 $(call BUSYBOX_IF_ENABLED
,TOP
, 100:/usr
/bin
/top
:/bin
/busybox
) \
60 $(call BUSYBOX_IF_ENABLED
,UPTIME
, 100:/usr
/bin
/uptime
:/bin
/busybox
) \
61 $(call BUSYBOX_IF_ENABLED
,WATCH
, 100:/bin
/watch
:/bin
/busybox
) \
65 define Package
/busybox
/description
66 The Swiss Army Knife of embedded Linux.
67 It slices
, it dices
, it makes Julian Fries.
70 define Package
/busybox
/config
71 source
"$(SOURCE)/Config.in"
74 # don't create a version string containing the actual timestamp
75 export KCONFIG_NOTIMESTAMP
=1
79 LDLIBS
+= $(call BUSYBOX_IF_ENABLED
,PAM
,pam pam_misc pthread
)
80 ifdef CONFIG_BUSYBOX_USE_LIBRPC
83 ifeq ($(CONFIG_USE_GLIBC
),y
)
84 LDLIBS
+= $(call BUSYBOX_IF_ENABLED
,NSLOOKUP_OPENWRT
,resolv
)
89 EXTRA_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
90 EXTRA_LDFLAGS
="$(TARGET_LDFLAGS)" \
93 ifneq ($(findstring c
,$(OPENWRT_VERBOSE
)),)
97 MAKE_INSTALL_FLAGS
+= CONFIG_PREFIX
="$(PKG_INSTALL_DIR)"
100 define Build
/Configure
101 grep
'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR
)/.config | sed
-e
"s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR
)/.config
102 yes
'n' |
$(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_FLAGS
) oldconfig
105 define Package
/busybox
/install
106 $(INSTALL_DIR
) $(1)/etc
/init.d
107 $(CP
) $(PKG_INSTALL_DIR
)/* $(1)/
108 ifneq ($(CONFIG_BUSYBOX_
$(BUSYBOX_SYM
)_CROND
),)
109 $(INSTALL_BIN
) .
/files
/cron
$(1)/etc
/init.d
/cron
111 ifneq ($(CONFIG_BUSYBOX_
$(BUSYBOX_SYM
)_NTPD
),)
112 $(INSTALL_BIN
) .
/files
/sysntpd
$(1)/etc
/init.d
/sysntpd
113 $(INSTALL_BIN
) .
/files
/ntpd-hotplug
$(1)/usr
/sbin
/ntpd-hotplug
118 $(eval
$(call BuildPackage
,busybox
))