[packages] zsh: add version 5.0.2
[packages.git] / utils / zsh / Makefile
1 #
2 # Copyright (C) 2013 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.0.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/zsh
16 PKG_MD5SUM:=b8f2ad691acf58b3252225746480dcad
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/zsh
21   SECTION:=utils
22   CATEGORY:=Utilities
23   TITLE:=The Z shell
24   DEPENDS:=+libncurses +librt
25   URL:=http://www.zsh.org/
26 endef
27
28 define Package/zsh/description
29         Zsh is a UNIX command interpreter (shell) usable as an interactive
30         login  shell  and  as a shell script command processor. Of the standard
31         shells, zsh most closely resembles ksh but includes many enhancements.
32         Zsh has command line editing, builtin spelling correction, programmable
33         command completion, shell functions (with autoloading), a history
34         mechanism, and a host of other features.
35 endef
36
37 define Build/Configure
38         $(call Build/Configure/Default, \
39                 --bindir=/bin \
40                 --disable-etcdir \
41                 --with-term-lib="ncurses ncursesw" \
42         )
43         # Do not install these functions:
44         $(SED) 's, Completion/AIX/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
45         $(SED) 's, Completion/BSD/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
46         $(SED) 's, Completion/Cygwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
47         $(SED) 's, Completion/Darwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
48         $(SED) 's, Completion/Debian/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
49         $(SED) 's, Completion/Mandriva/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
50         $(SED) 's, Completion/Redhat/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
51         $(SED) 's, Completion/Solaris/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
52         $(SED) 's, Completion/X/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
53         $(SED) 's, Completion/openSUSE/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
54         # After mucking with 'config.modules', one must call
55         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" prep
56 endef
57
58 define Build/Compile
59         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
60 endef
61
62 define Package/zsh/postinst
63 #!/bin/sh
64 grep zsh $${IPKG_INSTROOT}/etc/shells || \
65         echo "/bin/zsh" >> $${IPKG_INSTROOT}/etc/shells
66 endef
67
68 define Package/zsh/install
69         $(INSTALL_DIR) $(1)/bin
70         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/zsh $(1)/bin/
71         $(INSTALL_DIR) $(1)/usr/share/zsh/$(PKG_VERSION)
72         $(CP) $(PKG_INSTALL_DIR)/usr/share/zsh/$(PKG_VERSION)/* $(1)/usr/share/zsh/$(PKG_VERSION)/
73 endef
74
75 $(eval $(call BuildPackage,zsh))