add mksh (based on patch from #1470)
authorFelix Fietkau <nbd@openwrt.org>
Fri, 16 Mar 2007 20:47:13 +0000 (20:47 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 16 Mar 2007 20:47:13 +0000 (20:47 +0000)
SVN-Revision: 6585

utils/mksh/Makefile [new file with mode: 0644]
utils/mksh/patches/100-dot_mkshrc [new file with mode: 0644]

diff --git a/utils/mksh/Makefile b/utils/mksh/Makefile
new file mode 100644 (file)
index 0000000..9206c1e
--- /dev/null
@@ -0,0 +1,48 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mksh
+PKG_VERSION:=R29b
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).cpio.gz
+PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh
+PKG_MD5SUM:=a21850403bd30bab461f2fc9f9b803b8
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+# This program seems to depend on libssp, but only for GCC 4
+GCCVER:=$(if $(DUMP),4,$(word 1,$(subst ., ,$(CONFIG_GCC_VERSION))))
+ifeq ($(GCCVER),4)
+  DEP:=+libssp
+else
+  DEP:=
+endif
+
+define Package/mksh
+  SECTION:=shells
+  CATEGORY:=Base system
+  TITLE:=mksh
+  DEPENDS:=$(DEP)
+  DESCRIPTION:=MirBSD version of ksh
+endef
+
+define Build/Compile
+       cd $(PKG_BUILD_DIR); \
+               CC=$(TARGET_CC) \
+               TARGET_OS=$(shell uname -s) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="-DMKSH_SMALL=1" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+                       $(BASH) Build.sh -d -r
+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
+
+$(eval $(call BuildPackage,mksh))
diff --git a/utils/mksh/patches/100-dot_mkshrc b/utils/mksh/patches/100-dot_mkshrc
new file mode 100644 (file)
index 0000000..a3f6b97
--- /dev/null
@@ -0,0 +1,19 @@
+--- mksh.old/dot.mkshrc        2007-03-04 06:21:11.000000000 +0000
++++ mksh.dev/dot.mkshrc        2007-03-05 22:11:49.000000000 +0000
+@@ -1,6 +1,6 @@
+ # $MirOS: src/bin/mksh/dot.mkshrc,v 1.8 2007/03/04 06:20:48 tg Exp $
+-: ${EDITOR:=/bin/ed} ${HOSTNAME:=$(hostname -s 2>/dev/null || hostname)}
++: ${EDITOR:=/bin/ed} ${HOSTNAME:=$(</proc/sys/kernel/hostname)}
+ PS1='$(((rv=$?)) && print $rv\|)${USER:=$(id -un)}@${HOSTNAME:=nil}:$(
+       local pfx=~ wd=${PWD:-$(pwd)}
+       [[ ${wd#$pfx} = $wd || $pfx = ?(/) ]] || wd=\~${wd#$pfx}
+@@ -21,7 +21,7 @@ export EDITOR HOSTNAME MKSH=$(whence -p 
+ alias l='/bin/ls -F'
+ alias la='l -a'
+ alias ll='l -l'
+-alias lo='la -lo'
++alias lo='la -l'
+ [ -x /usr/bin/hd ] || eval alias hd="'hexdump -e '\\''\"%08.8_ax  \" 8/1" \
+       '"%02X " " - " 8/1 "%02X "'"'\\'' -e '\\''"'"  |" "%_p"'"'\\''" \
+       "-e '\\''"'"|\n"'"'\\'' '"