forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
89 lines (76 loc) · 2.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# Copyright (C) 2007-2011 OpenWrt.org
# Copyright (c) 2009-2014 Thorsten Glaser <[email protected]>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=mksh
PKG_VERSION:=50d
PKG_RELEASE:=1
PKG_MAINTAINER:=Thorsten Glaser <[email protected]>
PKG_LICENSE:=MirOS
PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh
PKG_MD5SUM:=1c3882c07a760b23df1ad94ad0b4ed2e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/mksh
SECTION:=shells
CATEGORY:=Base system
TITLE:=MirBSD Korn Shell
DEPENDS:=$(DEP)
URL:=http://mirbsd.de/mksh
endef
define Package/mksh/description
mksh is the MirBSD enhanced version of the Public Domain Korn
shell (pdksh), a Bourne-compatible shell which is largely si-
milar to the original AT&T Korn shell; mksh is the only pdksh
derivate currently being actively developed. It includes bug
fixes and feature improvements, in order to produce a modern,
robust shell good for interactive and especially script use.
mksh has UTF-8 support (in substring operations and the Emacs
editing mode) and - while R50 corresponds to OpenBSD 5.5-cur-
rent ksh (without GNU bash-like PS1 and fancy character clas-
ses) - adheres to SUSv4 and is much more robust. The code has
been cleaned up and simplified, bugs fixed, standards compli-
ance added, and several enhancements (for extended compatibi-
lity to other modern shells - as well as a couple of its own)
are available. It has sensible defaults as usual with BSD.
endef
define Build/Compile
# -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot
# -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable
# UTF-8 mode, neither use setlocale/nl_langinfo
# nor look at $LC_* and $LANG (not recommended)
# -DMKSH_BINSHPOSIX ⇒ enable POSIX mode if called as sh
#XXX maybe change to -DMKSH_ASSUME_UTF8=1 now (which
#XXX is always assume UTF-8 mode)
# HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency
# HAVE_CAN_FSTACKPROTECTORSTRONG=0 ⇒ same, for gcc 4.9+
cd $(PKG_BUILD_DIR); \
CC="$(TARGET_CC)" \
TARGET_OS="$(shell uname -s)" \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX" \
HAVE_CAN_FSTACKPROTECTORALL=0 \
HAVE_CAN_FSTACKPROTECTORSTRONG=0 \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(BASH) Build.sh -Q -r -c lto
endef
define Package/mksh/postinst
#!/bin/sh
grep mksh $${IPKG_INSTROOT}/etc/shells || \
echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells
endef
define Package/mksh/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/
endef
define Package/mksh/conffiles
/etc/mkshrc
endef
$(eval $(call BuildPackage,mksh))