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:=27667e0f2328fdbd79cfd622e4453e5c57e58f781c5da97c9be337d93aa2a02e
20 PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam
22 PKG_CHECK_FORMAT_SECURITY:=0
25 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
27 include $(INCLUDE_DIR)/package.mk
30 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
33 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
34 BB_MAKE_VERBOSE := V=1
39 define Package/busybox
42 MAINTAINER:=Felix Fietkau <nbd@nbd.name>
43 TITLE:=Core utilities for embedded Linux
44 URL:=http://busybox.net/
45 DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter
49 define Package/busybox/description
50 The Swiss Army Knife of embedded Linux.
51 It slices, it dices, it makes Julian Fries.
54 define Package/busybox/config
55 source "$(SOURCE)/Config.in"
58 BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT)
60 # don't create a version string containing the actual timestamp
61 export KCONFIG_NOTIMESTAMP=1
63 define Build/Configure
64 rm -f $(PKG_BUILD_DIR)/.configured*
65 grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config
66 yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \
68 CROSS_COMPILE="$(TARGET_CROSS)" \
76 ifdef CONFIG_BUSYBOX_USE_LIBRPC
77 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
78 export LDFLAGS=$(TARGET_LDFLAGS)
82 ifdef CONFIG_BUSYBOX_CONFIG_PAM
83 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
84 export LDFLAGS=$(TARGET_LDFLAGS)
85 LDLIBS += pam pam_misc pthread
89 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
91 CROSS_COMPILE="$(TARGET_CROSS)" \
93 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
99 rm -rf $(PKG_INSTALL_DIR)
100 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
101 $(MAKE) -C $(PKG_BUILD_DIR) \
103 CROSS_COMPILE="$(TARGET_CROSS)" \
104 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
106 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
112 define Package/busybox/install
113 $(INSTALL_DIR) $(1)/etc/init.d
114 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
115 $(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
116 $(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd
117 $(INSTALL_BIN) ./files/ntpd-hotplug $(1)/usr/sbin/ntpd-hotplug
121 $(eval $(call BuildPackage,busybox))