packages: add missing conffiles define
[openwrt/svn-archive/archive.git] / utils / mksh / Makefile
1 #
2 # Copyright (C) 2007-2011 OpenWrt.org
3 # Copyright (c) 2009 Thorsten Glaser <tg@mirbsd.org>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=mksh
12 PKG_VERSION:=39
13 PKG_RELEASE:=2
14
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:=b2eeb4fe4ccac2704e1440e53cd2672c
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/mksh
24 SECTION:=shells
25 CATEGORY:=Base system
26 TITLE:=MirBSD Korn Shell
27 DEPENDS:=$(DEP)
28 URL:=http://mirbsd.de/mksh
29 endef
30
31 define Package/mksh/description
32 mksh is the MirBSD enhanced version of the Public Domain Korn
33 shell (pdksh), a Bourne-compatible shell which is largely si-
34 milar to the original AT&T Korn shell; mksh is the only pdksh
35 derivate currently being actively developed. It includes bug
36 fixes and feature improvements, in order to produce a modern,
37 robust shell good for interactive and especially script use.
38 mksh has UTF-8 support (e.g. in the emacs editing mode); R38c
39 corresponds to OpenBSD 4.5-current ksh (without GNU bash-like
40 $PS1 and fancy character classes). The code has throughoutly
41 been cleaned up and simplified, bugs fixed, standards compli-
42 ance added, and several enhancements (for extended compatibi-
43 lity to other modern shells - as well as a couple of its own)
44 have been placed.
45 endef
46
47 define Build/Compile
48 # -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot
49 # -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable
50 # UTF-8 mode, neither use setlocale/nl_langinfo
51 # nor look at $LC_* and $LANG (not recommended)
52 # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency
53 # HAVE_REALPATH=x ⇒ add the realpath builtin, which was
54 # disabled by MKSH_SMALL, back if realpath() exists
55 cd $(PKG_BUILD_DIR); \
56 CC="$(TARGET_CC)" \
57 TARGET_OS="$(shell uname -s)" \
58 CFLAGS="$(TARGET_CFLAGS)" \
59 CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0" \
60 HAVE_CAN_FSTACKPROTECTORALL=0 \
61 HAVE_REALPATH=x \
62 LDFLAGS="$(TARGET_LDFLAGS)" \
63 $(BASH) Build.sh -Q -r
64 endef
65
66 define Package/mksh/postinst
67 #!/bin/sh
68 grep mksh $${IPKG_INSTROOT}/etc/shells || \
69 echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells
70 endef
71
72 define Package/mksh/install
73 $(INSTALL_DIR) $(1)/etc
74 $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc
75 $(INSTALL_DIR) $(1)/bin
76 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/
77 endef
78
79 define Package/mksh/conffiles
80 /etc/mkshrc
81 endef
82
83 $(eval $(call BuildPackage,mksh))