aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGregor <dan.mcgregor@usask.ca>2017-08-10 14:15:11 -0600
committerDan McGregor <dan.mcgregor@usask.ca>2017-08-22 09:14:19 -0600
commit681d12f8bf04a403d6e692cbe0ceebad932b0731 (patch)
treee90e95df7820892273c68f446e4460cd8a9e5269
parent1ce7c78756539126eb7a9037ac257b91c07312a5 (diff)
downloadmeta-openembedded-contrib-681d12f8bf04a403d6e692cbe0ceebad932b0731.tar.gz
meta-openembedded-contrib-681d12f8bf04a403d6e692cbe0ceebad932b0731.tar.bz2
meta-openembedded-contrib-681d12f8bf04a403d6e692cbe0ceebad932b0731.zip
zsh: update to 5.4.1dankm/zsh
Also fix up autoconf to use pkg-config, and properly detect pcre. Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
-rw-r--r--meta-oe/recipes-extended/zsh/files/configure.ac.patch172
-rw-r--r--meta-oe/recipes-extended/zsh/files/dot.zshrc16
-rw-r--r--meta-oe/recipes-extended/zsh/files/pcre-pkgconfig.patch49
-rw-r--r--meta-oe/recipes-extended/zsh/files/zprofile6
-rw-r--r--meta-oe/recipes-extended/zsh/files/zsh_profile.sh5
-rw-r--r--meta-oe/recipes-extended/zsh/files/zshrc45
-rw-r--r--meta-oe/recipes-extended/zsh/zsh_5.3.1.bb61
-rw-r--r--meta-oe/recipes-extended/zsh/zsh_5.4.1.bb141
8 files changed, 434 insertions, 61 deletions
diff --git a/meta-oe/recipes-extended/zsh/files/configure.ac.patch b/meta-oe/recipes-extended/zsh/files/configure.ac.patch
new file mode 100644
index 0000000000..8e479cd23c
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/files/configure.ac.patch
@@ -0,0 +1,172 @@
+diff --git a/aclocal.m4 b/acinclude.m4
+similarity index 98%
+rename from aclocal.m4
+rename to acinclude.m4
+index e91be3c0d..26e0ae228 100644
+--- a/aclocal.m4
++++ b/acinclude.m4
+@@ -52,7 +52,7 @@ case "x$fp_cv_prog_cc_stdc" in
+ esac
+ ])
+
+-AC_DEFUN(AC_PROG_LN,
++AC_DEFUN([AC_PROG_LN],
+ [AC_MSG_CHECKING(whether ln works)
+ AC_CACHE_VAL(ac_cv_prog_LN,
+ [rm -f conftestdata conftestlink
+@@ -64,14 +64,14 @@ then
+ else
+ rm -f conftestdata
+ ac_cv_prog_LN="cp"
+-fi])dnl
++fi])
+ LN="$ac_cv_prog_LN"
+ if test "$ac_cv_prog_LN" = "ln"; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+-AC_SUBST(LN)dnl
++AC_SUBST(LN)
+ ])
+
+ builtin(include, aczsh.m4)
+diff --git a/aczsh.m4 b/aczsh.m4
+index 0219ae2fb..3eb1ac6fc 100644
+--- a/aczsh.m4
++++ b/aczsh.m4
+@@ -38,7 +38,7 @@ dnl This macro does not produce messages as it may be run several times
+ dnl before finding the right type.
+ dnl
+
+-AC_DEFUN(zsh_64_BIT_TYPE,
++AC_DEFUN([zsh_64_BIT_TYPE],
+ [AC_TRY_RUN([
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+@@ -67,7 +67,7 @@ dnl
+ dnl Usage: zsh_SHARED_FUNCTION(name[,rettype[,paramtype]])
+ dnl
+
+-AC_DEFUN(zsh_SHARED_FUNCTION,
++AC_DEFUN([zsh_SHARED_FUNCTION],
+ [zsh_SHARED_SYMBOL($1, ifelse([$2], ,[int ],[$2]) $1 [(]ifelse([$3], ,[ ],[$3])[)], $1)])
+
+ dnl
+@@ -78,7 +78,7 @@ dnl
+ dnl Usage: zsh_SHARED_VARIABLE(name[,type])
+ dnl
+
+-AC_DEFUN(zsh_SHARED_VARIABLE,
++AC_DEFUN([zsh_SHARED_VARIABLE],
+ [zsh_SHARED_SYMBOL($1, ifelse([$2], ,[int ],[$2]) $1, [&$1])])
+
+ dnl
+@@ -94,7 +94,7 @@ dnl Usage: zsh_SHARED_SYMBOL(name,declaration,address)
+ dnl Sets zsh_cv_shared_$1 cache variable to yes/no
+ dnl
+
+-AC_DEFUN(zsh_SHARED_SYMBOL,
++AC_DEFUN([zsh_SHARED_SYMBOL],
+ [AC_CACHE_CHECK([if $1 is available in shared libraries],
+ zsh_cv_shared_$1,
+ [if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then
+@@ -184,7 +184,7 @@ dnl zsh_SYS_DYNAMIC_CLASH
+ dnl Check whether symbol name clashes in shared libraries are acceptable.
+ dnl
+
+-AC_DEFUN(zsh_SYS_DYNAMIC_CLASH,
++AC_DEFUN([zsh_SYS_DYNAMIC_CLASH],
+ [AC_CACHE_CHECK([if name clashes in shared objects are OK],
+ zsh_cv_sys_dynamic_clash_ok,
+ [if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then
+@@ -259,7 +259,7 @@ dnl Check whether symbols in one dynamically loaded library are
+ dnl available to another dynamically loaded library.
+ dnl
+
+-AC_DEFUN(zsh_SYS_DYNAMIC_GLOBAL,
++AC_DEFUN([zsh_SYS_DYNAMIC_GLOBAL],
+ [AC_CACHE_CHECK([for working RTLD_GLOBAL],
+ zsh_cv_sys_dynamic_rtld_global,
+ [if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then
+@@ -329,7 +329,7 @@ dnl Check whether symbols in the executable are available to dynamically
+ dnl loaded libraries.
+ dnl
+
+-AC_DEFUN(zsh_SYS_DYNAMIC_EXECSYMS,
++AC_DEFUN([zsh_SYS_DYNAMIC_EXECSYMS],
+ [AC_CACHE_CHECK([whether symbols in the executable are available],
+ zsh_cv_sys_dynamic_execsyms,
+ [if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then
+@@ -398,7 +398,7 @@ dnl zsh_SYS_DYNAMIC_STRIP_EXE
+ dnl Check whether it is safe to strip executables.
+ dnl
+
+-AC_DEFUN(zsh_SYS_DYNAMIC_STRIP_EXE,
++AC_DEFUN([zsh_SYS_DYNAMIC_STRIP_EXE],
+ [AC_REQUIRE([zsh_SYS_DYNAMIC_EXECSYMS])
+ AC_CACHE_CHECK([whether executables can be stripped],
+ zsh_cv_sys_dynamic_strip_exe,
+@@ -471,7 +471,7 @@ dnl zsh_SYS_DYNAMIC_STRIP_EXE
+ dnl Check whether it is safe to strip dynamically loaded libraries.
+ dnl
+
+-AC_DEFUN(zsh_SYS_DYNAMIC_STRIP_LIB,
++AC_DEFUN([zsh_SYS_DYNAMIC_STRIP_LIB],
+ [AC_CACHE_CHECK([whether libraries can be stripped],
+ zsh_cv_sys_dynamic_strip_lib,
+ [if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then
+@@ -535,7 +535,7 @@ dnl zsh_PATH_UTMP(filename)
+ dnl Search for a specified utmp-type file.
+ dnl
+
+-AC_DEFUN(zsh_PATH_UTMP,
++AC_DEFUN([zsh_PATH_UTMP],
+ [AC_CACHE_CHECK([for $1 file], [zsh_cv_path_$1],
+ [for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do
+ zsh_cv_path_$1=${dir}/$1
+@@ -556,7 +556,7 @@ dnl zsh_TYPE_EXISTS(#includes, type name)
+ dnl Check whether a specified type exists.
+ dnl
+
+-AC_DEFUN(zsh_TYPE_EXISTS,
++AC_DEFUN([zsh_TYPE_EXISTS],
+ [AC_CACHE_CHECK([for $2], [zsh_cv_type_exists_[]translit($2, [ ], [_])],
+ [AC_TRY_COMPILE([$1], [$2 testvar;],
+ [zsh_cv_type_exists_[]translit($2, [ ], [_])=yes],
+@@ -575,7 +575,7 @@ dnl Check whether a specified aggregate type exists and contains
+ dnl a specified member.
+ dnl
+
+-AC_DEFUN(zsh_STRUCT_MEMBER,
++AC_DEFUN([zsh_STRUCT_MEMBER],
+ [AC_CACHE_CHECK([for $3 in $2], [zsh_cv_struct_member_[]translit($2, [ ], [_])_$3],
+ [AC_TRY_COMPILE([$1], [$2 testvar; testvar.$3;],
+ [zsh_cv_struct_member_[]translit($2, [ ], [_])_$3=yes],
+@@ -595,7 +595,7 @@ dnl After processing this macro, the configure script may refer to
+ dnl and $tzsh_name, and @tzsh@ is defined for make substitutions.
+ dnl
+
+-AC_DEFUN(zsh_ARG_PROGRAM,
++AC_DEFUN([zsh_ARG_PROGRAM],
+ [AC_ARG_PROGRAM
+ # Un-double any \ or $ (doubled by AC_ARG_PROGRAM).
+ cat <<\EOF_SED > conftestsed
+@@ -613,7 +613,7 @@ rm -f conftestsed
+ AC_SUBST(tzsh)dnl
+ ])
+
+-AC_DEFUN(zsh_COMPILE_FLAGS,
++AC_DEFUN([zsh_COMPILE_FLAGS],
+ [AC_ARG_ENABLE(cppflags,
+ AC_HELP_STRING([--enable-cppflags=...], [specify C preprocessor flags]),
+ if test "$enableval" = "yes"
+@@ -669,7 +669,7 @@ AC_DEFUN([zsh_CHECK_SOCKLEN_T],[
+ )
+
+ dnl Check for limit $1 e.g. RLIMIT_RSS.
+-AC_DEFUN(zsh_LIMIT_PRESENT,
++AC_DEFUN([zsh_LIMIT_PRESENT],
+ [AH_TEMPLATE([HAVE_]$1,
+ [Define to 1 if ]$1[ is present (whether or not as a macro).])
+ AC_CACHE_CHECK([for limit $1],
diff --git a/meta-oe/recipes-extended/zsh/files/dot.zshrc b/meta-oe/recipes-extended/zsh/files/dot.zshrc
new file mode 100644
index 0000000000..e7a3f3d11d
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/files/dot.zshrc
@@ -0,0 +1,16 @@
+# ~/.zshrc: executed by zsh(1) for login shells.
+
+export PS1='%n@%m:%~%# '
+umask 022
+
+# You may uncomment the following lines if you want `ls' to be colorized:
+# export LS_OPTIONS='--color=auto'
+# eval `dircolors`
+# alias ls='ls $LS_OPTIONS'
+# alias ll='ls $LS_OPTIONS -l'
+# alias l='ls $LS_OPTIONS -lA'
+#
+# Some more alias to avoid making mistakes:
+# alias rm='rm -i'
+# alias cp='cp -i'
+# alias mv='mv -i'
diff --git a/meta-oe/recipes-extended/zsh/files/pcre-pkgconfig.patch b/meta-oe/recipes-extended/zsh/files/pcre-pkgconfig.patch
new file mode 100644
index 0000000000..ebbd03f071
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/files/pcre-pkgconfig.patch
@@ -0,0 +1,49 @@
+diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd
+index 6eb3c691b..12c10704e 100644
+--- a/Src/Modules/pcre.mdd
++++ b/Src/Modules/pcre.mdd
+@@ -1,5 +1,5 @@
+ name=zsh/pcre
+-link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi`
++link=`if test x$enable_pcre = xyes ; then echo dynamic; else echo no; fi`
+ load=no
+
+ autofeatures="b:pcre_compile b:pcre_study b:pcre_match"
+diff --git a/configure.ac b/configure.ac
+index 920c2fc17..d1512291c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -671,17 +671,15 @@ AC_HEADER_TIME
+ AC_HEADER_STAT
+ AC_HEADER_SYS_WAIT
+
+-oldcflags="$CFLAGS"
+ if test x$enable_pcre = xyes; then
+-AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config)
+-dnl Typically (meaning on this single RedHat 9 box in front of me)
+-dnl pcre-config --cflags produces a -I output which needs to go into
+-dnl CPPFLAGS else configure's preprocessor tests don't pick it up,
+-dnl producing a warning.
+-if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then
+- CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
+-fi
++PKG_CHECK_MODULES(PCREPKG, [libpcre], [
++ PCRE_LIB="${PCREPKG_LIBS}"
++ CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}"
++ ], [
++ AC_MSG_ERROR([pcre not found, install the pcre-devel package or build with --disable-pcre])
++ ])
+ fi
++oldcflags="$CFLAGS"
+
+ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
+ termios.h sys/param.h sys/filio.h string.h memory.h \
+@@ -935,7 +933,7 @@ fi
+ if test x$enable_pcre = xyes; then
+ dnl pcre-config should probably be employed here
+ dnl AC_SEARCH_LIBS(pcre_compile, pcre)
+- LIBS="`$ac_cv_prog_PCRECONF --libs` $LIBS"
++ LIBS="$PCRE_LIB $LIBS"
+ fi
+
+ dnl ---------------------
diff --git a/meta-oe/recipes-extended/zsh/files/zprofile b/meta-oe/recipes-extended/zsh/files/zprofile
new file mode 100644
index 0000000000..2a5d983485
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/files/zprofile
@@ -0,0 +1,6 @@
+# /etc/zprofile: system-wide .profile file for the Z shell (zsh(1))
+
+[ -z "$PS1" ] || PS1='%n@%m:%~%# '
+
+# Source the system-wide bourne .profile
+. /etc/profile
diff --git a/meta-oe/recipes-extended/zsh/files/zsh_profile.sh b/meta-oe/recipes-extended/zsh/files/zsh_profile.sh
new file mode 100644
index 0000000000..eaa947e5bf
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/files/zsh_profile.sh
@@ -0,0 +1,5 @@
+# In case zsh is called as /bin/sh
+if [ "$ZSH_VERSION" ]; then
+ emulate -R zsh
+ [ "PS1" = '\u@\h:\w\$ ' ] && PS1='%n@%m:%~%# '
+fi
diff --git a/meta-oe/recipes-extended/zsh/files/zshrc b/meta-oe/recipes-extended/zsh/files/zshrc
new file mode 100644
index 0000000000..37918523a9
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/files/zshrc
@@ -0,0 +1,45 @@
+# /etc/zshrc: system-wide .zshrc file for zsh(1).
+#
+# This file is sourced only for interactive shells. It
+# should contain commands to set up aliases, functions,
+# options, key bindings, etc.
+#
+# Global Order: zshenv, zprofile, zshrc, zlogin
+
+typeset -A key
+
+key[Home]=${terminfo[khome]}
+key[End]=${terminfo[kend]}
+key[Insert]=${terminfo[kich1]}
+key[Delete]=${terminfo[kdch1]}
+key[Up]=${terminfo[kcuu1]}
+key[Down]=${terminfo[kcud1]}
+key[Left]=${terminfo[kcub1]}
+key[Right]=${terminfo[kcuf1]}
+key[PageUp]=${terminfo[kpp]}
+key[PageDown]=${terminfo[knp]}
+
+# setup key accordingly
+[[ -n "${key[Home]}" ]] && bindkey -e "${key[Home]}" beginning-of-line
+[[ -n "${key[End]}" ]] && bindkey -e "${key[End]}" end-of-line
+[[ -n "${key[Insert]}" ]] && bindkey -e "${key[Insert]}" overwrite-mode
+[[ -n "${key[Delete]}" ]] && bindkey -e "${key[Delete]}" delete-char
+[[ -n "${key[Up]}" ]] && bindkey -e "${key[Up]}" up-line-or-history
+[[ -n "${key[Down]}" ]] && bindkey -e "${key[Down]}" down-line-or-history
+[[ -n "${key[Left]}" ]] && bindkey -e "${key[Left]}" backward-char
+[[ -n "${key[Right]}" ]] && bindkey -e "${key[Right]}" forward-char
+
+unset key
+
+# Finally, make sure the terminal is in application mode, when zle is
+# active. Only then are the values from $terminfo valid.
+function zle-line-init () {
+ emulate -L zsh
+ printf '%s' $terminfo[smkx]
+}
+function zle-line-finish () {
+ emulate -L zsh
+ printf '%s' $terminfo[rmkx]
+}
+zle -N zle-line-init
+zle -N zle-line-finish
diff --git a/meta-oe/recipes-extended/zsh/zsh_5.3.1.bb b/meta-oe/recipes-extended/zsh/zsh_5.3.1.bb
deleted file mode 100644
index 1f5e390000..0000000000
--- a/meta-oe/recipes-extended/zsh/zsh_5.3.1.bb
+++ /dev/null
@@ -1,61 +0,0 @@
-SUMMARY = "UNIX Shell similar to the Korn shell"
-DESCRIPTION = "Zsh is a shell designed for interactive use, although it is also a \
- powerful scripting language. Many of the useful features of bash, \
- ksh, and tcsh were incorporated into zsh; many original features were added."
-HOMEPAGE = "http://www.zsh.org"
-SECTION = "base/shell"
-
-LICENSE = "zsh"
-LIC_FILES_CHKSUM = "file://LICENCE;md5=b7bc853894664be455a922db9805288e"
-
-DEPENDS = "ncurses bison-native libcap libpcre gdbm groff-native"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz"
-SRC_URI[md5sum] = "d583fbca0c2410bf9542ce8a651c26ca"
-SRC_URI[sha256sum] = "3d94a590ff3c562ecf387da78ac356d6bea79b050a9ef81e3ecb9f8ee513040e"
-
-inherit autotools gettext update-alternatives
-
-EXTRA_OECONF = " \
- --bindir=${base_bindir} \
- --enable-etcdir=${sysconfdir} \
- --enable-fndir=${datadir}/${PN}/${PV}/functions \
- --enable-site-fndir=${datadir}/${PN}/site-functions \
- --with-term-lib='ncursesw ncurses' \
- --with-tcsetpgrp \
- --enable-cap \
- --enable-multibyte \
- --disable-gdbm \
- --disable-dynamic \
- zsh_cv_shared_environ=yes \
-"
-
-EXTRA_OEMAKE = "-e MAKEFLAGS="
-
-ALTERNATIVE_${PN} = "sh"
-ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
-ALTERNATIVE_TARGET[sh] = "${base_bindir}/${BPN}"
-ALTERNATIVE_PRIORITY = "100"
-
-export AUTOHEADER = "true"
-
-do_configure () {
- gnu-configize --force ${S}
- oe_runconf
-}
-
-do_install_append () {
- rm -fr ${D}/usr/share
-}
-
-pkg_postinst_${PN} () {
- touch $D${sysconfdir}/shells
- grep -q "bin/zsh" $D${sysconfdir}/shells || echo /bin/zsh >> $D${sysconfdir}/shells
- grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells
-}
-
-FILES_${PN}-dbg += "\
- ${libdir}/${PN}/${PV}/${PN}/.debug/*.so \
- ${libdir}/${PN}/${PV}/${PN}/db/.debug/*.so \
- ${libdir}/${PN}/${PV}/${PN}/net/.debug/*.so \
-"
diff --git a/meta-oe/recipes-extended/zsh/zsh_5.4.1.bb b/meta-oe/recipes-extended/zsh/zsh_5.4.1.bb
new file mode 100644
index 0000000000..80e84990a1
--- /dev/null
+++ b/meta-oe/recipes-extended/zsh/zsh_5.4.1.bb
@@ -0,0 +1,141 @@
+SUMMARY = "UNIX Shell similar to the Korn shell"
+DESCRIPTION = "Zsh is a shell designed for interactive use, although it is also a \
+ powerful scripting language. Many of the useful features of bash, \
+ ksh, and tcsh were incorporated into zsh; many original features were added."
+HOMEPAGE = "http://www.zsh.org"
+SECTION = "base/shell"
+
+LICENSE = "zsh"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=1a4c4cda3e8096d2fd483ff2f4514fec"
+
+DEPENDS = "ncurses bison-native libcap groff-native"
+
+SRC_URI = " \
+ http://www.zsh.org/pub/zsh-${PV}.tar.xz;name=zsh \
+ http://www.zsh.org/pub/zsh-${PV}-doc.tar.xz;name=zsh-docs \
+ file://pcre-pkgconfig.patch \
+ file://configure.ac.patch \
+ file://zprofile \
+ file://zshrc \
+ file://zsh_profile.sh \
+ file://dot.zshrc \
+"
+
+SRC_URI[zsh.md5sum] = "0b80b7f64c30397cd747d97c378018af"
+SRC_URI[zsh.sha256sum] = "94cbd57508287e8faa081424509738d496f5f41e32ed890e3a5498ce05d3633b"
+SRC_URI[zsh-docs.md5sum] = "1724342c71a7194cdc02e22be7464ba3"
+SRC_URI[zsh-docs.sha256sum] = "b8b1a40aeec852806ad2b74b0a0c534320bf517e2fe2a087c0c9d39e75dc29f1"
+
+inherit autotools gettext update-alternatives pkgconfig
+
+PACKAGECONFIG ??= " \
+ nls pcre \
+"
+
+PACKAGECONFIG[static] = "--disable-dynamic,--enable-dynamic,,"
+PACKAGECONFIG[maildir] = "--enable-maildir-support,--disable-maildir-support,,"
+PACKAGECONFIG[nls] = "--enable-locale,--disable-locale,,"
+PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre,"
+PACKAGECONFIG[gdbm] = "--enable-gdbm,--disable-gdbm,gdbm,"
+PACKAGECONFIG[secure] = "--enable-zsh-mem --enable-zsh-secure-free,--disable-zsh-mem --disable-zsh-secure-free,,"
+
+CACHED_CONFIGUREVARS = " zsh_cv_shared_environ=yes "
+
+EXTRA_OECONF = " \
+ --bindir=${base_bindir} \
+ --enable-etcdir=${sysconfdir} \
+ --enable-fndir=${datadir}/${BPN}/${PV}/functions \
+ --enable-site-fndir=${datadir}/${BPN}/site-functions \
+ --with-term-lib='ncursesw ncurses' \
+ --with-tcsetpgrp \
+ --enable-cap \
+ --enable-multibyte \
+ --enable-largefile \
+"
+
+EXTRA_OECONF_append_libc-musl = " --enable-libc-musl "
+
+EXTRA_OEMAKE += " LLIST='-Wl,-rpath=${libdir}/${BPN}' "
+
+ALTERNATIVE_${PN} = "sh"
+ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/${BPN}"
+ALTERNATIVE_PRIORITY = "80"
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install.bin install.modules install.fns install.runhelp
+ oe_runmake 'DESTDIR=${D}' install.man || true
+
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+
+ # Remove versioned zsh binary
+ rm -f ${D}${base_bindir}/${BPN}-${PV} || true
+
+ # Set up restricted shells
+ ln -sf ${BPN} ${D}${base_bindir}/rzsh
+
+ # install etc files
+ install -d ${D}${sysconfdir}/profile.d ${D}${sysconfdir}/skel
+ install -m 0644 ${WORKDIR}/zprofile ${D}${sysconfdir}/zprofile
+ install -m 0644 ${WORKDIR}/zshrc ${D}${sysconfdir}/zshrc
+ install -m 0644 ${WORKDIR}/zsh_profile.sh ${D}${sysconfdir}/profile.d/zsh.sh
+ install -m 0644 ${WORKDIR}/dot.zshrc ${D}${sysconfdir}/skel/.zshrc
+
+ echo '# /etc/zshenv: system-wide .zshenv file for zsh(1).' > ${D}${sysconfdir}/zshenv
+ echo '# /etc/zlogin: system-wide .zlogin file for zsh(1).' > ${D}${sysconfdir}/zlogin
+ echo '# /etc/zlogout: system-wide .zlogout file for zsh(1).' > ${D}${sysconfdir}/zlogout
+
+ # install configuration examples
+ install -d ${D}${datadir}/examples/${BPN}
+ install -m 644 ${S}/StartupFiles/* ${D}${datadir}/examples/${BPN}
+}
+
+pkg_postinst_${PN} () {
+ touch $D${sysconfdir}/shells
+ grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells
+ grep -q "bin/zsh" $D${sysconfdir}/shells || echo ${base_bindir}/zsh >> $D${sysconfdir}/shells
+ grep -q "bin/rzsh" $D${sysconfdir}/shells || echo ${base_bindir}/rzsh >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+ printf "$(grep -Ev "bin/r?zsh" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
+
+PACKAGES =+ "${PN}-examples ${PN}-functions"
+
+FILES_${PN}-examples += "${datadir}/examples/${BPN}/*"
+
+FILES_${PN}-functions += " \
+ ${datadir}/${BPN}/${PV}/scripts \
+ ${datadir}/${BPN}/${PV}/functions \
+ ${datadir}/${BPN}/site-functions \
+"
+
+FILES_${PN}-dbg += "\
+ ${libdir}/${BPN}/.debug/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/.debug/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/db/.debug/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/net/.debug/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/param/.debug/*.so \
+"
+
+FILES_${PN}-doc += "\
+ ${datadir}/${BPN}/${PV}/help \
+ ${datadir}/${BPN}/${PV}/help/* \
+"
+
+FILES_${PN} += "\
+ ${libdir}/${BPN}/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/db/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/net/*.so \
+ ${libdir}/${BPN}/${PV}/zsh/param/*.so \
+"
+
+RDEPENDS_${PN}-functions += "${PN}"
+RDEPENDS_${PN}-examples += "${PN}"
+RRECOMMENDS_${PN} += "${PN}-functions"
+RRECOMMENDS_${PN}-doc += "${PN}-examples"