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