Commit 3ca28703 authored by Jakub Jirutka's avatar Jakub Jirutka

main/zsh: add subpackages -calendar, -completion, -vcs, -zftp

parent 72696bba
......@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=zsh
pkgver=5.2
pkgrel=1
pkgrel=2
pkgdesc="A very advanced and programmable command interpreter (shell)"
url="http://www.zsh.org/"
arch="all"
......@@ -15,14 +15,22 @@ source="http://www.zsh.org/pub/$pkgname-$pkgver.tar.xz
fix-zle-segfault.patch
fix-oom-fatal-error.patch
fix-vcs_info.patch"
subpackages="$pkgname-doc"
subpackages="$pkgname-doc $pkgname-calendar $pkgname-completion $pkgname-vcs
$pkgname-zftp"
builddir="$srcdir/$pkgname-$pkgver"
_libdir="usr/lib/zsh/$pkgver"
_sharedir="usr/share/zsh/$pkgver"
prepare() {
cd "$builddir"
default_prepare || return 1
update_config_sub || return 1
# Remove completions that are useless on Alpine.
cd Completion
rm -Rf AIX BSD Cygwin Darwin Debian Mandriva Redhat Solaris openSUSE
}
build() {
......@@ -52,6 +60,54 @@ package() {
install -Dm644 "$srcdir"/zprofile "$pkgdir"/etc/zsh/zprofile
}
doc() {
default_doc || return 1
_submv $_sharedir/help
}
calendar() {
pkgdesc="Calendar Function System for ZSH"
arch="noarch"
depends="$pkgname"
_submv $_sharedir/functions/Calendar
}
completion() {
pkgdesc="Base completions for ZSH"
arch="noarch"
depends="$pkgname"
local destdir="$subpkgdir/$_sharedir/functions/Completion"
cd "$pkgdir"
mkdir -p "$destdir"
find $_sharedir/functions/Completion/* -type d -prune \
-exec mv {} "$destdir"/ +
}
vcs() {
pkgdesc="Version Control Information module for ZSH (vcs_info)"
arch="noarch"
depends="$pkgname"
_submv $_sharedir/functions/VCS_Info
}
zftp() {
pkgdesc="Zftp Function System for ZSH"
depends="$pkgname"
_submv $_libdir/zsh/zftp.so || return 1
_submv $_sharedir/functions/Zftp
}
_submv() {
local path="$1"
mkdir -p "$subpkgdir"/${path%/*}
mv "$pkgdir"/$path "$subpkgdir"/$path
}
md5sums="afe96fde08b70e23c1cab1ca7a68fb34 zsh-5.2.tar.xz
a5e93cd6880da04a63fc4fcaaa03987f zprofile
1413688affa980b053dd2cdc784f8626 fix-zle-segfault.patch
......
zsh.post-install
\ No newline at end of file
#!/bin/sh
add-shell '/bin/zsh'
ver_new="$1"
ver_old="$2"
if [ "$(apk version -t "$ver_old" "5.2-r2")" = "<" ]; then
cat <<-EOF
*
* Some modules has been moved into subpackages:
* zsh-calendar calendar function system
* zsh-completion completion functions
* zsh-vcs version control information (vcs_info)
* zsh-zftp zftp function system
*
EOF
fi
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment