2 # Copyright (C) 2007-2008 OpenWrt.org
3 # Copyright (c) 2009 Thorsten Glaser <tg@mirbsd.org>
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-R
$(PKG_VERSION
).cpio.gz
16 PKG_SOURCE_URL
:=http
://www.mirbsd.org
/MirOS
/dist/mir
/mksh
17 PKG_MD5SUM
:=692192a6468b5f5c5e559756f1851766
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)
21 include $(INCLUDE_DIR
)/package.mk
26 TITLE
:=MirBSD Korn Shell
30 define Package
/mksh
/description
31 mksh is the MirBSD enhanced version of the Public Domain Korn
32 shell (pdksh
), a Bourne-compatible
shell which is largely si-
33 milar to the original AT
&T Korn
shell; mksh is the only pdksh
34 derivate currently being actively developed. It includes bug
35 fixes and feature improvements
, in order to produce a modern
,
36 robust
shell good for interactive and especially script use.
37 mksh has UTF-8 support
(e.g. in the emacs editing mode
); R38c
38 corresponds to OpenBSD
4.5-current ksh
(without GNU bash-like
39 $PS1 and fancy character classes
). The code has throughoutly
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
)
47 # -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot
48 # -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable
49 # UTF-8 mode, neither use setlocale/nl_langinfo
50 # nor look at $LC_* and $LANG (not recommended)
51 # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency
52 # HAVE_REALPATH=x ⇒ add the realpath builtin, which was
53 # disabled by MKSH_SMALL, back if realpath() exists
54 cd
$(PKG_BUILD_DIR
); \
56 TARGET_OS
="$(shell uname -s)" \
57 CFLAGS
="$(TARGET_CFLAGS)" \
58 CPPFLAGS
="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0" \
59 HAVE_CAN_FSTACKPROTECTORALL
=0 \
61 LDFLAGS
="$(TARGET_LDFLAGS)" \
62 $(BASH
) Build.sh
-Q
-r
65 define Package
/mksh
/postinst
67 grep mksh
$${IPKG_INSTROOT}/etc
/shells || \
68 echo
"/bin/mksh" >> $${IPKG_INSTROOT}/etc
/shells
71 define Package
/mksh
/install
72 $(INSTALL_DIR
) $(1)/etc
73 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/dot.mkshrc
$(1)/etc
/mkshrc
74 $(INSTALL_DIR
) $(1)/bin
75 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/mksh
$(1)/bin
/
78 $(eval
$(call BuildPackage
,mksh
))