You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.8 KiB

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