zsh: updated to 5.4.2
[feed/packages.git] / utils / zsh / Makefile
1 #
2 # Copyright (C) 2013-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=zsh
11 PKG_VERSION:=5.4.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/zsh
16 PKG_HASH:=957bcdb2c57f64c02f673693ea5a7518ef24b6557aeb3a4ce222cefa6d74acc9
17 PKG_MAINTAINER:=Vadim A. Misbakh-Soloviov <openwrt-zsh@mva.name>
18 PKG_LICENSE:=ZSH
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/zsh
25 SECTION:=utils
26 CATEGORY:=Utilities
27 SUBMENU:=Shells
28 TITLE:=The Z shell
29 DEPENDS:=+libncurses +libncursesw +libpcre +librt
30 URL:=http://www.zsh.org/
31 endef
32
33 define Package/zsh/description
34 Zsh is a UNIX command interpreter (shell) usable as an interactive
35 login shell and as a shell script command processor. Of the standard
36 shells, zsh most closely resembles ksh but includes many enhancements.
37 Zsh has command line editing, builtin spelling correction, programmable
38 command completion, shell functions (with autoloading), a history
39 mechanism, and a host of other features.
40 endef
41
42 define Build/Configure
43 $(call Build/Configure/Default, \
44 --disable-etcdir \
45 --disable-gdbm \
46 --enable-dynamic \
47 --enable-libc-musl \
48 --enable-pcre \
49 --enable-cap \
50 --enable-multibyte \
51 --enable-unicode9 \
52 --enable-runhelpdir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/help \
53 --enable-fndir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/functions \
54 --enable-site-fndir=$(CONFIGURE_PREFIX)/share/zsh/site-functions \
55 --enable-function-subdirs \
56 --with-tcsetpgrp \
57 --with-term-lib="ncursesw", \
58 zsh_cv_shared_environ=yes \
59 zsh_cv_sys_dynamic_clash_ok=yes\
60 zsh_cv_sys_dynamic_execsyms=yes \
61 zsh_cv_sys_dynamic_rtld_global=yes \
62 zsh_cv_sys_dynamic_strip_exe=yes \
63 zsh_cv_sys_dynamic_strip_lib=yes \
64 zsh_cv_sys_nis=no \
65 zsh_cv_sys_nis_plus=no \
66 )
67 # Do not install these functions:
68 $(SED) 's, Completion/AIX/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
69 $(SED) 's, Completion/BSD/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
70 $(SED) 's, Completion/Cygwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
71 $(SED) 's, Completion/Darwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
72 $(SED) 's, Completion/Debian/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
73 $(SED) 's, Completion/Mandriva/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
74 $(SED) 's, Completion/Redhat/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
75 $(SED) 's, Completion/Solaris/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
76 $(SED) 's, Completion/X/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
77 $(SED) 's, Completion/openSUSE/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
78 # After mucking with 'config.modules', one must call
79 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" prep
80 endef
81
82 define Package/zsh/postinst
83 #!/bin/sh
84 grep zsh $${IPKG_INSTROOT}/etc/shells || \
85 echo "/usr/bin/zsh" >> $${IPKG_INSTROOT}/etc/shells
86
87 # Backwards compatibility
88 if [[ -e /bin/zsh ]] && ([[ ! -L /bin/zsh ]] || [[ "$(readlink -fn $${IPKG_INSTROOT}/bin/zsh)" != "../$(CONFIGURE_PREFIX)/bin/zsh" ]]); then
89 ln -fs "../$(CONFIGURE_PREFIX)/bin/zsh" "$${IPKG_INSTROOT}/bin/zsh"
90 fi
91 endef
92
93 define Package/zsh/install
94 $(INSTALL_DIR) $(1)/bin
95 $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/bin
96 $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)
97 $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)
98
99 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/bin/zsh $(1)/$(CONFIGURE_PREFIX)/bin/
100 $(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/* $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/
101 $(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/* $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/
102 endef
103
104 define Package/zsh/postrm
105 rm -rf "$${IPKG_INSTROOT}/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)"
106 endef
107
108 $(eval $(call BuildPackage,zsh))