[packages] bash: import upstream 4.2 patch series
[openwrt/svn-archive/archive.git] / utils / bash / Makefile
1 #
2 # Copyright (C) 2007-2012 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:=bash
11 PKG_VERSION:=4.2
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@GNU/bash
16 PKG_MD5SUM:=3fb927c7c33022f1c327f14a81c0d4b0
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/bash
21 SECTION:=utils
22 CATEGORY:=Utilities
23 TITLE:=The GNU Bourne Again SHell
24 DEPENDS:=+libncurses
25 URL:=http://www.gnu.org/software/bash/
26 endef
27
28 define Package/bash/description
29 Bash is an sh-compatible command language interpreter that executes
30 commands read from the standard input or from a file. Bash also
31 incorporates useful features from the Korn and C shells (ksh and csh).
32 endef
33
34
35 define Build/Configure
36 $(call Build/Configure/Default, \
37 --without-bash-malloc \
38 --bindir=/bin \
39 )
40 endef
41
42
43 define Build/Compile
44 $(MAKE) -C $(PKG_BUILD_DIR)/builtins LDFLAGS_FOR_BUILD= mkbuiltins
45 $(MAKE) -C $(PKG_BUILD_DIR) \
46 DESTDIR="$(PKG_INSTALL_DIR)" \
47 SHELL="/bin/bash" \
48 all install
49 endef
50
51 define Package/bash/postinst
52 #!/bin/sh
53 grep bash $${IPKG_INSTROOT}/etc/shells || \
54 echo "/bin/bash" >> $${IPKG_INSTROOT}/etc/shells
55 echo "/bin/rbash" >> $${IPKG_INSTROOT}/etc/shells
56 endef
57
58 define Package/bash/install
59 $(INSTALL_DIR) $(1)/bin
60 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/bash $(1)/bin/
61 ln -sf bash $(1)/bin/rbash
62 endef
63
64 $(eval $(call BuildPackage,bash))
65