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.

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