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.

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