summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMamoru Komachi <usata@gentoo.org>2004-02-04 15:32:53 +0000
committerMamoru Komachi <usata@gentoo.org>2004-02-04 15:32:53 +0000
commiteae5beed30bc4bde519fe7850feeae9f3295f61a (patch)
tree2eb4e26d557fa13d14f40ee6259fac1aa75bc3d0 /app-shells
parentAdded completion functions for rc, rc-update, rc-status, opengl-update and eb... (diff)
downloadhistorical-eae5beed30bc4bde519fe7850feeae9f3295f61a.tar.gz
historical-eae5beed30bc4bde519fe7850feeae9f3295f61a.tar.bz2
historical-eae5beed30bc4bde519fe7850feeae9f3295f61a.zip
Added completion functions for rc, rc-update, rc-status, opengl-update and ebuild. Thanks to baptux <bapt@ifrance.com> for polishing zsh completion ;)
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/zsh/Manifest10
-rw-r--r--app-shells/zsh/files/_portage-20040204293
-rw-r--r--app-shells/zsh/files/digest-zsh-4.0.7-r12
-rw-r--r--app-shells/zsh/files/digest-zsh-4.0.9-r33
-rw-r--r--app-shells/zsh/files/digest-zsh-4.1.1-r53
-rw-r--r--app-shells/zsh/zsh-4.0.9-r3.ebuild (renamed from app-shells/zsh/zsh-4.0.7-r1.ebuild)35
-rw-r--r--app-shells/zsh/zsh-4.1.1-r4.ebuild4
-rw-r--r--app-shells/zsh/zsh-4.1.1-r5.ebuild125
8 files changed, 454 insertions, 21 deletions
diff --git a/app-shells/zsh/Manifest b/app-shells/zsh/Manifest
index 3153ee772f65..7e7dba614a64 100644
--- a/app-shells/zsh/Manifest
+++ b/app-shells/zsh/Manifest
@@ -1,12 +1,12 @@
-MD5 7de77f5de66677fa307a33fe35b19d79 zsh-4.0.9-r3.ebuild 2667
-MD5 d6e49ac5f8ebab43b6840bd0b59c9af5 zsh-4.1.1-r5.ebuild 3374
-MD5 1bb931588ac834f8a9883ccdc0592106 ChangeLog 7101
+MD5 251e4c8aa7e0a8a19681c4d73a0b6f47 zsh-4.0.9-r3.ebuild 2669
+MD5 d6c683c148853196ec43cabba95b667f zsh-4.1.1-r5.ebuild 3374
+MD5 7a5a758ef6d0de777f5f7a3a2dba8f3b ChangeLog 7425
MD5 28ed8ea6cdccb353e2e8ad783eb51f5b metadata.xml 506
MD5 0c1d77e92495ecb2290575dfa560bcd1 zsh-4.0.9-r2.ebuild 2628
-MD5 c5ba39315b7b503fada39512785a4d30 zsh-4.1.1-r4.ebuild 3324
+MD5 219f19ba1e213dd846d6e778dbb10238 zsh-4.1.1-r4.ebuild 3324
MD5 2aa47fce01c92a0cc7e070f04018ac93 files/_portage 7539
MD5 de58f149f41740c394800ba8d2cdf361 files/digest-zsh-4.0.9-r3 199
-MD5 be90470e46a98d564fa26ee0cf479105 files/_portage-20040204 10945
+MD5 d401be6503fc2e34341d56e99ee25e94 files/_portage-20040204 10954
MD5 1a527b6a4700642b4742d9cc8de90285 files/digest-zsh-4.1.1-r5 199
MD5 f83ccd2b6f1cd3e75c910c48159892f5 files/zsh-4.1.1-gentoo.diff 488
MD5 64023b41a9987655e0e014d32562cfad files/zprofile 404
diff --git a/app-shells/zsh/files/_portage-20040204 b/app-shells/zsh/files/_portage-20040204
new file mode 100644
index 000000000000..0dbcf063b8a8
--- /dev/null
+++ b/app-shells/zsh/files/_portage-20040204
@@ -0,0 +1,293 @@
+#compdef emerge rc-update rc-status ebuild opengl-update rc
+
+# $Id: _portage-20040204,v 1.1 2004/02/04 15:32:45 usata Exp $
+
+# ZSH completion function for Portage
+# Author: baptux <bapt@ifrance.com>
+# Author: Mamoru KOMACHI <usata@gentoo.org>
+
+# Already done:
+#
+# emerge (fully done)
+# rc-update (fully done)
+# rc-status (fully done)
+# ebuild (fully done)
+# opengl-update (fully done)
+# rc (fully done)
+
+# Stuff for rc
+_rc () {
+ if (( CURRENT == 2 ));then
+ _values "runlevels" $gentoo_runlevels
+ fi
+}
+
+# Stuff for opengl-update (the easiest to do :) )
+
+_opengl-update () {
+ if (( CURRENT == 2 ));then
+ _values "opengl-update options" \
+ 'xfree[Use libGL.so from XFree86]' \
+ 'nvidia[Use libGL.so from the NVidia drivers.]'
+ fi
+}
+
+# Stuff for ebuild
+_ebuild () {
+ if (( CURRENT == 2 ));then
+ _files -g \*.ebuild
+ elif (( CURRENT > 2 ));then
+ _values "ebuild command" \
+ 'clean[Cleans the temporary build directory]' \
+ 'help[Show help]' \
+ 'setup[Run all package specific setup actions and exotic system checks.]' \
+ 'fetch[Fetch all necessary files]' \
+ 'digest[Creates a digest file for the package]' \
+ 'unpack[Extracts the sources to a subdirectory in the build directory]' \
+ 'compile[Compiles the extracted sources by running the src_compile()]' \
+ 'preinst[Run specific actions that need to be done before installation]' \
+ 'install[Installs the package to the temporary install directory]' \
+ 'postinst[Run specific actions that need to be done after installation]' \
+ 'qmerge[Installs the package de the filesystem]' \
+ 'merge[perform the following actions: fetch, unpack, compile, install and qmerge.]' \
+ 'unmerge[Remove the installed files of the packages]' \
+ 'prerm[Run specific actions that need to be executed before unmerge]' \
+ 'postrm[Run specific actions that need to be executed after unmerge]' \
+ 'config[Run specific actions needed to be executed after the emerge process has completed.]' \
+ 'package[This command is a lot like the merge command, but create a .tbz2 package]' \
+ 'rpm[Builds a RedHat RPM package]'
+ fi
+
+}
+
+# Stuff for rc-status
+_rc-status () {
+ if (( CURRENT == 2 ));then
+ _values "rc-status options" \
+ '-a[Show services at all run levels]' \
+ '--all[Show services at all run levels]' \
+ '-l[Show list of run levels]' \
+ '--list[Show list of run levels]' \
+ '-u[Show services not assigned to any run level]' \
+ '--unused[Show services not assigned to any run level]' \
+ $gentoo_runlevels
+ fi
+}
+
+# Stuff for rc-update
+
+_rc-update () {
+ if (( CURRENT == 2 ));then
+ _values "rc-update actions" \
+ 'add[Add script to a runlevel]' \
+ 'del[Delete script from a runlevel]' \
+ 'show[Show scripts lanched at a runlevel]' \
+ '-a[Add script to a runlevel]' \
+ '-d[Delete script from a runlevel]' \
+ '-s[Show scripts lanched at a runlevel]'
+ elif (( CURRENT == 3 ));then
+ case "$words[2]" in
+ add|-a|del|-d)
+ _arguments -s \
+ '*:scripts:_files -W /etc/init.d/'
+ ;;
+ show|-s)
+ _values "runlevels" $gentoo_runlevels
+ ;;
+ esac
+ elif (( CURRENT == 4 ));then
+ case "$words[2]" in
+ add|-a|del|-d)
+ _values "runlevels" $gentoo_runlevels
+ ;;
+ esac
+ fi
+}
+
+# Stuff for emerge
+
+_emerge () {
+ local state
+ if (( CURRENT == 2 ));then
+ _arguments -s \
+ '*:*:->actions' \
+ "$common_args[@]" "$install_args[@]" && return 0
+ elif (( CURRENT > 2 ));then
+ case "$words[2]" in
+ unmerge|-C)
+ _arguments -s \
+ '*:installed pkgname with versions:_portage_unmerge' "$common_args[@]" && return 0
+ ;;
+ clean|-c)
+ _arguments -s \
+ '*:installed pkgname:_portage_clean' "$common_args[@]" && return 0
+ ;;
+ --usepkgonly|-K)
+ _arguments -s \
+ '*:use package only:_portage_tbz2list' "$common_args[@]" && return 0
+ ;;
+ depclean|help|-h|info|regen|sync|rsync|--searchdesc|-S|search|-s|inject|-j|prune|-P)
+ ;;
+ *)
+ _arguments -s \
+ '*:*:->install_portage' \
+ "$common_args[@]" \
+ "$install_args[@]" && return 0
+ ;;
+ esac
+ fi
+ while [[ -n "$state" ]]; do
+ lstate=$state
+ state=''
+ case "$lstate" in
+ actions)
+ _alternative \
+ ':emerge actions:_actions' \
+ '*:portage:_portage_pkglist'
+ ;;
+ install_portage)
+ _alternative \
+ '*:portage:_portage_pkglist'
+ ;;
+ esac
+ done
+}
+
+#Function to show only installed packages "cat/name-ver"
+_portage_unmerge(){
+ installed_portage=(/var/db/pkg/*-*/*)
+ installed_dir=/var/db/pkg/
+ installed_pkg=${installed_portage//$installed_dir/}
+ _tags -s installed_pkg && { compadd "$@" -k installed_pkg || compadd "$@" ${(kv)=installed_pkg} }
+}
+
+#Functions to show "cat/name", classes and dependencies
+_portage_clean() {
+ installed_portage=(/var/db/pkg/*-*/*)
+ installed_dir=/var/db/pkg/
+ installed_pkg=${installed_portage//$installed_dir/}
+ installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
+ _tags -s installed_pkg && { compadd "$@" -k installed_pkg || compadd "$@" ${(kv)=installed_pkg} }
+ _tags -s installed_pkgname && { compadd "$@" -k installed_pkgname || compadd "$@" ${(kv)=installed_pkgname} }
+}
+
+#Function to show tbz2 files available
+_portage_tbz2list() {
+ # this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
+ # binary mirror will be available we should rewrite it accordingly.
+ _path_files -g \*.tbz2 -W "${pkgdir}/All"
+}
+
+#Function to show all available portage names
+_portage_pkglist(){
+ portage_classlist="world system"
+ portage_pkglist="$portage_pkglist ${portage_classlist}"
+ _tags -s portage_pkglist && { compadd "$@" -k portage_pkglist || compadd "$@" ${(kv)=portage_pkglist} }
+ _path_files -/ -W "${portdir}"
+ # XXX: If I add ${portdir_overlay} category completion won't work properly
+ #[[ -n "${portdir_overlay}" ]] && _path_files -/ -W "${portdir_overlay}"
+ _path_files -g \*.ebuild
+}
+
+common_args=(
+ {'(-p)--pretend','(--pretend)-p'}'[simply display what would be done]'
+ {'(-d)--debug','(--debug)-d'}'[Tells emerge to run the emerge command in debug mode]'
+)
+install_args=(
+ {'(--upgradeonly -U --update -u --quiet -q --onlydeps -o --oneshot --nospinner --noreplace -n --nodeps -O --noconfmem -D --deep --changelog --buildpkg -B -b --buildpkgonly --emptytree -e -f --fetchonly)-l','(--upgradeonly -U --update -u --quiet -q --onlydeps -o --nospinner --noreplace -n --nodeps -O --noconfmem -D --deep --emptytree -e -f --fetchonly -l --buildpkg -b -B --buildpkgonly )--changelog'}'[This will show the ChangeLog]'
+ {'(-b --buildpkgonly -B --changelog -l)--buildpkg','(--changelog -l --buildpkg --buildpkgonly -B)-b'}'[Tells emerge to build binary packages]'
+ {'(-B -b --buildpkg --changelog -l)--buildpkgonly','(--changelog -l --buildpkgonly --buildpkg -b)-B'}'[Tells emerge to only build binary packages]'
+ {'(-D --changelog -l)--deep','(-l --changelog --deep)-D'}'[Consider the entire dependency tree of packages]'
+ {'(-e -l --changelog)--emptytree','(--emptytree -l --changelog)-e'}'[Only consider glibc as installed packages]'
+ {'(-f -l --changelog)--fetchonly','(-l --changelog --fetchonly)-f'}'[Just perform fetches for all packages]'
+ '(-l --changelog)--noconfmem[Causes portage to disregard merge records]'
+ {'(--changelog -l -O)--nodeps','(--nodeps --changelog -l)-O'}'[Merges specified packages without merging dependencies]'
+ {'(-l --changelog -n)--noreplace','(-l --changelog --noreplace)-n'}'[Skip packages already installed]'
+ '(-l --changelog)--nospiner[Disables the spinner for the session]'
+ '(-l --changelog)--oneshot[Do not add package to the world profile]'
+ {'(--onlydeps --changelog -l)-o','(--changelog -o -l)--onlydeps'}'[Only merge (or pretend to merge) the dependencies]'
+ {'(--quiet --changelog -l)-q','(-q --changelog -l)--quiet'}'[General outcome is a reduced or condensed output]'
+ {'(--update --changelog -l)-u','(-u --changelog -l)--update'}'[Updates packages to the most recent version available]'
+ {'(--upgradeonly --changelog -l)-U','(-U --changelog -l)--upgradeonly'}'[Do not update packages to a lower version]'
+ {'(--usepkg --changelog -l)-k','(-k --changelog -l)--usepkg'}'[Tells emerge to use binary packages if available]'
+ {'(--usepkgonly --changelog -l)-K','(-K --changelog -l)--usepkgonly'}'[Tells emerge to use binary packages only]'
+ {'(--verbose)-v','(-v)--verbose'}'[Tell emerge to run in verbose mode]'
+ '(-p --pretend)--columns[Displays versions in aligned format]'
+ '--resume[Resumes the last merge operation]'
+ '--skipfirst[Removes the first package in the resume list]'
+)
+
+_options() {
+ _arguments -s \
+ "$unmerge_args[@]" "$common_args[@]" "$install_args[@]"
+}
+
+_actions() {
+ _values "emerge actions" \
+ 'sync[Initiates a portage tree update]' \
+ 'rsync[Initiates a portage tree update]' \
+ 'unmerge[Removes all matching packages]' \
+ 'search[Searches for matches]' \
+ 'regen[Causes portage to check and update the dependency cache]' \
+ 'prune[Removes all but the latest versions of matching packages]' \
+ 'inject[Portage thinks that this package is installed]' \
+ 'info[This is a list of information to include in bug reports]' \
+ 'help[Displays help]' \
+ 'depclean[Clean all packages that have no reason for being installed]'\
+ 'clean[Cleans the system by removing packages]' \
+ '-c[Cleans the system by removing packages]' \
+ '-h[Displays help]' \
+ '-i[Portage thinks that this package is installed]' \
+ '-P[Removes all but the latest versions of matching packages]' \
+ '-s[Searches for matches]' \
+ '-S[Matches the search string against the description field]' \
+ '--searchdesc[Matches the search string against the description field]' \
+ '-C[Removes all matching packages]' \
+ 'world[Represent all packages in the world profiles]' \
+ 'system[Represent all the system packages]'
+}
+
+#Reading informations from make.conf
+[[ -n "${PORTDIR}" ]] && portdir="${PORTDIR}"
+[[ -n "${PKGDIR}" ]] && pkgdir="${PKGDIR}"
+if [[ -n "${PORTDIR_OVERLAY}" ]] ; then
+ for overlay in ${=PORTDIR_OVERLAY} ; do
+ portdir_overlay=(${overlay} ${portdir_overlay})
+ done
+fi
+[[ -r /etc/make.globals ]] && source /etc/make.globals
+[[ -r /etc/make.conf ]] && source /etc/make.conf
+
+[[ -z "${portdir}" ]] && portdir="${PORTDIR}"
+[[ -z "${pkgdir}" ]] && pkgdir="${PKGDIR}"
+if [[ -z "${portdir_overlay}" ]] ; then
+ for overlay in ${=PORTDIR_OVERLAY} ; do
+ portdir_overlay=(${overlay} ${portdir_overlay})
+ done
+fi
+
+portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
+portage_pkglist=(${portage_pkglist##*/})
+gentoo_runlevels=(/etc/runlevels/*)
+gentoo_runlevels=(${${gentoo_runlevels/\/etc\/runlevels\//}%/})
+
+case "$service" in
+ emerge)
+ _emerge "$@" && return 0
+ ;;
+ rc-update)
+ _rc-update "$@" && return 0
+ ;;
+ rc-status)
+ _rc-status "$@" && return 0
+ ;;
+ ebuild)
+ _ebuild "$@" && return 0
+ ;;
+ opengl-update)
+ _opengl-update "$@" && return 0
+ ;;
+ rc)
+ _rc "$@" && return 0
+ ;;
+esac
diff --git a/app-shells/zsh/files/digest-zsh-4.0.7-r1 b/app-shells/zsh/files/digest-zsh-4.0.7-r1
deleted file mode 100644
index 9dadbb2f32e9..000000000000
--- a/app-shells/zsh/files/digest-zsh-4.0.7-r1
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 85915f723384062480f1890b6625b6d5 zsh-4.0.7.tar.gz 2179033
-MD5 886e922b43f677a4d16f6399c0ec6420 zsh_4.0.7-18.diff.gz 250567
diff --git a/app-shells/zsh/files/digest-zsh-4.0.9-r3 b/app-shells/zsh/files/digest-zsh-4.0.9-r3
new file mode 100644
index 000000000000..19f27e152f5f
--- /dev/null
+++ b/app-shells/zsh/files/digest-zsh-4.0.9-r3
@@ -0,0 +1,3 @@
+MD5 26cc0f9051ba41063e950723246dfaa8 zsh-4.0.9.tar.bz2 1749802
+MD5 f7032dd0a992cba7bb903ab90a9ca667 zsh-4.0.9-doc.tar.bz2 1411985
+MD5 1e755a2ffa0bad11b0ebc7d5d7622674 zsh-4.0.9-euc-0.2.patch.gz 2869
diff --git a/app-shells/zsh/files/digest-zsh-4.1.1-r5 b/app-shells/zsh/files/digest-zsh-4.1.1-r5
new file mode 100644
index 000000000000..f9bbd87c4098
--- /dev/null
+++ b/app-shells/zsh/files/digest-zsh-4.1.1-r5
@@ -0,0 +1,3 @@
+MD5 48958b1a3fc86261a26eea40a4f7d4af zsh-4.1.1.tar.bz2 1924514
+MD5 a4fb455591ee95e5264bf985af3473ea zsh-4.1.1-euc-0.2.patch.gz 2788
+MD5 3ec54fa702b9a5c5209b56c2c8ed6a88 zsh-4.1.1-doc.tar.bz2 1572953
diff --git a/app-shells/zsh/zsh-4.0.7-r1.ebuild b/app-shells/zsh/zsh-4.0.9-r3.ebuild
index 54d0978c44d3..4dbe2135b15a 100644
--- a/app-shells/zsh/zsh-4.0.7-r1.ebuild
+++ b/app-shells/zsh/zsh-4.0.9-r3.ebuild
@@ -1,29 +1,32 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.0.7-r1.ebuild,v 1.2 2004/01/03 18:22:36 usata Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.0.9-r3.ebuild,v 1.1 2004/02/04 15:32:45 usata Exp $
-inherit eutils
-
-IUSE="maildir ncurses static"
+IUSE="maildir ncurses static doc cjk"
DESCRIPTION="UNIX Shell similar to the Korn shell"
HOMEPAGE="http://www.zsh.org/"
-MYPATCH="${P/-/_}-18.diff"
-SRC_URI="ftp://ftp.zsh.org/pub/${P}.tar.gz
- mirror://debian/pool/main/z/${PN}/${MYPATCH}.gz"
+MYDATE="20040204"
+
+SRC_URI="ftp://ftp.zsh.org/pub/${P}.tar.bz2
+ doc? ( ftp://ftp.zsh.org/pub/${P}-doc.tar.bz2 )
+ cjk? ( http://www.ono.org/software/dist/${P}-euc-0.2.patch.gz )"
SLOT="0"
LICENSE="ZSH"
-KEYWORDS="x86 alpha ~ppc ~sparc"
+KEYWORDS="~x86 ~alpha ~ppc ~sparc"
-DEPEND="${RDEPEND}
- sys-apps/groff"
+DEPEND="virtual/glibc
+ sys-apps/groff
+ ${RDEPEND}"
RDEPEND="ncurses? ( >=sys-libs/ncurses-5.1 )"
src_unpack() {
unpack ${A}
- epatch ${MYPATCH}
+ cd ${S}
+ use cjk && epatch ../${P}-euc-0.2.patch
+ epatch ${FILESDIR}/${PN}-strncmp.diff
cd ${S}/Doc
ln -sf . man1
# fix zshall problem with soelim
@@ -70,8 +73,18 @@ src_install() {
insinto /etc/zsh
doins ${FILESDIR}/zprofile
+ keepdir /usr/share/zsh/site-functions
+ insinto /usr/share/zsh/site-functions
+ newins ${FILESDIR}/_portage-${MYDATE} _portage
+
dodoc ChangeLog* META-FAQ README INSTALL LICENCE config.modules
+ if [ "`use doc`" ] ; then
+ dohtml Doc/*
+ insinto /usr/share/doc/${PF}
+ doins Doc/zsh{.dvi,_us.ps,_a4.ps}
+ fi
+
docinto StartupFiles
dodoc StartupFiles/z*
}
diff --git a/app-shells/zsh/zsh-4.1.1-r4.ebuild b/app-shells/zsh/zsh-4.1.1-r4.ebuild
index eaa9d62335f3..c781988b9bc7 100644
--- a/app-shells/zsh/zsh-4.1.1-r4.ebuild
+++ b/app-shells/zsh/zsh-4.1.1-r4.ebuild
@@ -1,8 +1,6 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.1.1-r4.ebuild,v 1.2 2004/01/22 12:42:09 usata Exp $
-
-inherit eutils
+# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.1.1-r4.ebuild,v 1.3 2004/02/04 15:32:45 usata Exp $
IUSE="cjk maildir ncurses static doc"
diff --git a/app-shells/zsh/zsh-4.1.1-r5.ebuild b/app-shells/zsh/zsh-4.1.1-r5.ebuild
new file mode 100644
index 000000000000..579bb746e685
--- /dev/null
+++ b/app-shells/zsh/zsh-4.1.1-r5.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.1.1-r5.ebuild,v 1.1 2004/02/04 15:32:45 usata Exp $
+
+IUSE="cjk maildir ncurses static doc"
+
+DESCRIPTION="UNIX Shell similar to the Korn shell"
+HOMEPAGE="http://www.zsh.org/"
+
+MYDATE="20040204"
+
+SRC_URI="ftp://ftp.zsh.org/pub/${P}.tar.bz2
+ cjk? ( http://www.ono.org/software/dist/${P}-euc-0.2.patch.gz )
+ doc? ( ftp://ftp.zsh.org/pub/${P}-doc.tar.bz2 )"
+
+SLOT="0"
+LICENSE="ZSH"
+KEYWORDS="~x86 ~alpha ~ppc ~sparc ~amd64 ~hppa"
+
+DEPEND="sys-apps/groff
+ >=sys-apps/sed-4
+ ${RDEPEND}"
+RDEPEND=">=dev-libs/libpcre-3.9
+ sys-libs/libcap
+ ncurses? ( >=sys-libs/ncurses-5.1 )"
+
+src_unpack() {
+ unpack ${P}.tar.bz2
+ use doc && unpack ${P}-doc.tar.bz2
+ cd ${S}
+ epatch ${FILESDIR}/${P}-gentoo.diff
+ use cjk && epatch ${DISTDIR}/${P}-euc-0.2.patch.gz
+ epatch ${FILESDIR}/${PN}-strncmp.diff
+ cd ${S}/Doc
+ ln -sf . man1
+ # fix zshall problem with soelim
+ soelim zshall.1 > zshall.1.soelim
+ mv zshall.1.soelim zshall.1
+}
+
+src_compile() {
+ local myconf
+
+ use ncurses && myconf="--with-curses-terminfo"
+ use maildir && myconf="${myconf} --enable-maildir-support"
+ use static && myconf="${myconf} --disable-dynamic" \
+ && LDFLAGS="${LDFLAGS} -static"
+
+ econf \
+ --bindir=/bin \
+ --libdir=/usr/lib \
+ --enable-etcdir=/etc/zsh \
+ --enable-zshenv=/etc/zsh/zshenv \
+ --enable-zlogin=/etc/zsh/zlogin \
+ --enable-zlogout=/etc/zsh/zlogout \
+ --enable-zprofile=/etc/zsh/zprofile \
+ --enable-zshrc=/etc/zsh/zshrc \
+ --enable-fndir=/usr/share/zsh/${PV}/functions \
+ --enable-site-fndir=/usr/share/zsh/site-functions \
+ --enable-function-subdirs \
+ --enable-ldflags="${LDFLAGS}" \
+ ${myconf} || die "configure failed"
+
+ if [ -n "`use static`" ] ; then
+ # compile all modules statically, see Bug #27392
+ sed -i -e "s/link=no/link=static/g" \
+ -e "s/load=no/load=yes/g" \
+ config.modules || die
+ else
+ # avoid linking to libs in /usr/lib, see Bug #27064
+ sed -i -e "/LIBS/s%-lpcre%/usr/lib/libpcre.a%" \
+ Makefile || die
+ fi
+
+ # emake still b0rks
+ emake -j1 || die "make failed"
+ #make check || die "make check failed"
+}
+
+src_install() {
+ einstall \
+ bindir=${D}/bin \
+ libdir=${D}/usr/lib \
+ fndir=${D}/usr/share/zsh/${PV}/functions \
+ sitefndir=${D}/usr/share/zsh/site-functions \
+ install.bin install.man install.modules \
+ install.info install.fns || die "make install failed"
+
+ insinto /etc/zsh
+ doins ${FILESDIR}/zprofile
+
+ keepdir /usr/share/zsh/site-functions
+ insinto /usr/share/zsh/site-functions
+ newins ${FILESDIR}/_portage-${MYDATE} _portage
+
+ dodoc ChangeLog* META-FAQ README INSTALL LICENCE config.modules
+
+ if [ "`use doc`" ] ; then
+ dohtml Doc/*
+ insinto /usr/share/doc/${PF}
+ doins Doc/zsh{.dvi,_us.ps,_a4.ps}
+ fi
+
+ docinto StartupFiles
+ dodoc StartupFiles/z*
+}
+
+pkg_preinst() {
+ # Our zprofile file does the job of the old zshenv file
+ # Move the old version into a zprofile script so the normal
+ # etc-update process will handle any changes.
+ if [ -f /etc/zsh/zshenv -a ! -f /etc/zsh/zprofile ]; then
+ mv /etc/zsh/zshenv /etc/zsh/zprofile
+ fi
+}
+
+pkg_postinst() {
+
+ # see Bug 26776
+ ewarn
+ ewarn "If you are upgrading from zsh-4.0.x you may need to"
+ ewarn "remove all your old ~/.zcompdump files in order to use"
+ ewarn "completion. For more info see zcompsys manpage."
+ ewarn
+}