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