You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2007-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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=bash
  9. PKG_VERSION:=5.0
  10. PKG_RELEASE:=4
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@GNU/bash
  13. PKG_HASH:=b4a80f2ac66170b2913efbfb9f2594f1f76c7b1afd11f799e22035d63077fb4d
  14. PKG_LICENSE:=GPL-3.0-or-later
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
  17. PKG_CPE_ID:=cpe:/a:gnu:bash
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/bash
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. SUBMENU:=Shells
  24. TITLE:=The GNU Bourne Again SHell
  25. DEPENDS:=+libncurses +libreadline
  26. URL:=http://www.gnu.org/software/bash/
  27. endef
  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. define Package/bash/conffiles
  34. /etc/bash.bashrc
  35. /etc/bash.bash_logout
  36. endef
  37. # Bash detects and enables certain features by runtest simple piece of code
  38. # which is not viable when doing cross compilation and default to no in many
  39. # cases. Grep for 'cross.compil' in aclocal.m4 and config-bot.h for details
  40. #
  41. # bash_cv_job_control_missing: Job control is needed for bash to be used as the
  42. # default shell
  43. #
  44. # bash_cv_getcwd_malloc: The replacement by bash does not work well with
  45. # overlayfs. See "bash getcwd errors when running under OverlayFS"
  46. # http://permalink.gmane.org/gmane.linux.embedded.yocto.general/25204
  47. #
  48. # bash_cv_dev_fd: The test is done on build system but OpenWrt currently does
  49. # not have /dev/fd, it provides /proc/self/fd/ instead
  50. #
  51. # bash_cv_sys_named_pipes: Required for process substituion
  52. CONFIGURE_VARS += \
  53. ac_cv_rl_prefix="$(STAGING_DIR)/usr" \
  54. ac_cv_rl_version="8.0" \
  55. bash_cv_getcwd_malloc=yes \
  56. bash_cv_job_control_missing=present \
  57. bash_cv_dev_fd=whacky \
  58. bash_cv_sys_named_pipes=present \
  59. # The following are some other tests that cannot run when cross-compiling
  60. CONFIGURE_VARS += \
  61. bash_cv_func_sigsetjmp=present \
  62. bash_cv_printf_a_format=yes \
  63. CONFIGURE_ARGS+= \
  64. --with-installed-readline="$(STAGING_DIR)/usr" \
  65. --with-curses \
  66. --without-bash-malloc \
  67. --bindir=/bin \
  68. --disable-rpath \
  69. --enable-direxpand-default \
  70. --enable-job-control \
  71. --enable-readline
  72. define Package/bash/postinst
  73. #!/bin/sh
  74. grep -q bash "$${IPKG_INSTROOT}/etc/shells" || {
  75. echo /bin/bash >> "$${IPKG_INSTROOT}/etc/shells"
  76. echo /bin/rbash >> "$${IPKG_INSTROOT}/etc/shells"
  77. }
  78. endef
  79. define Package/bash/install
  80. $(INSTALL_DIR) $(1)/bin
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/bash $(1)/bin/
  82. $(LN) bash $(1)/bin/rbash
  83. $(CP) ./files/* $(1)/
  84. endef
  85. $(eval $(call BuildPackage,bash))