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.

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