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.

92 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2007-2011 OpenWrt.org
  3. # Copyright (c) 2009-2014 Thorsten Glaser <tg@mirbsd.org>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=mksh
  10. PKG_VERSION:=56c
  11. PKG_RELEASE:=1
  12. PKG_MAINTAINER:=Thorsten Glaser <tg@mirbsd.org>, \
  13. Alif M. Ahmad <alive4ever@live.com>
  14. PKG_LICENSE:=MirOS
  15. PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).tgz
  16. PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh \
  17. http://pub.allbsd.org/MirOS/dist/mir/mksh
  18. PKG_HASH:=dd86ebc421215a7b44095dc13b056921ba81e61b9f6f4cdab08ca135d02afb77
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/mksh
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. SUBMENU:=Shells
  25. TITLE:=MirBSD Korn Shell
  26. DEPENDS:=$(DEP)
  27. URL:=http://mirbsd.de/mksh
  28. endef
  29. define Package/mksh/description
  30. mksh is the MirBSD enhanced version of the Public Domain Korn
  31. shell (pdksh), a Bourne-compatible shell which is largely si-
  32. milar to the original AT&T Korn shell; mksh is the only pdksh
  33. derivate currently being actively developed. It includes bug
  34. fixes and feature improvements, in order to produce a modern,
  35. robust shell good for interactive and especially script use.
  36. mksh has UTF-8 support (in substring operations and the Emacs
  37. editing mode) and - while R50 corresponds to OpenBSD 5.5-cur-
  38. rent ksh (without GNU bash-like PS1 and fancy character clas-
  39. ses) - adheres to SUSv4 and is much more robust. The code has
  40. been cleaned up and simplified, bugs fixed, standards compli-
  41. ance added, and several enhancements (for extended compatibi-
  42. lity to other modern shells - as well as a couple of its own)
  43. are available. It has sensible defaults as usual with BSD.
  44. endef
  45. define Build/Compile
  46. # -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot
  47. # -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable
  48. # UTF-8 mode, neither use setlocale/nl_langinfo
  49. # nor look at $LC_* and $LANG (not recommended)
  50. # -DMKSH_BINSHPOSIX ⇒ enable POSIX mode if called as sh
  51. #XXX maybe change to -DMKSH_ASSUME_UTF8=1 now (which
  52. #XXX is always assume UTF-8 mode)
  53. # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency
  54. # HAVE_CAN_FSTACKPROTECTORSTRONG=0 ⇒ same, for gcc 4.9+
  55. cd $(PKG_BUILD_DIR); \
  56. CC="$(TARGET_CC)" \
  57. TARGET_OS="$(shell uname -s)" \
  58. CFLAGS="$(TARGET_CFLAGS)" \
  59. CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX -DMKSHRC_PATH=\\\"/etc/mkshrc\\\"" \
  60. HAVE_CAN_FSTACKPROTECTORALL=0 \
  61. HAVE_CAN_FSTACKPROTECTORSTRONG=0 \
  62. LDFLAGS="$(TARGET_LDFLAGS)" \
  63. $(BASH) Build.sh -Q -r -c lto
  64. endef
  65. define Package/mksh/postinst
  66. #!/bin/sh
  67. grep mksh $${IPKG_INSTROOT}/etc/shells || \
  68. echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells
  69. endef
  70. define Package/mksh/install
  71. $(INSTALL_DIR) $(1)/etc
  72. $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc
  73. $(INSTALL_DIR) $(1)/bin
  74. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/
  75. endef
  76. define Package/mksh/conffiles
  77. /etc/mkshrc
  78. endef
  79. $(eval $(call BuildPackage,mksh))