Makefile 2.8 KB

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