aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-09-18 01:55:19 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-09-18 01:57:03 +0200
commit3ca28703d16140a9e7241e20516e317f7a72993d (patch)
treed9f48025a9600cf47f58650d13cf54e8bc9efc0b /main
parent72696bba828e30c8558c498211c416770097d39f (diff)
downloadaports-3ca28703d16140a9e7241e20516e317f7a72993d.tar.bz2
aports-3ca28703d16140a9e7241e20516e317f7a72993d.tar.xz
main/zsh: add subpackages -calendar, -completion, -vcs, -zftp
Diffstat (limited to 'main')
-rw-r--r--main/zsh/APKBUILD60
-rw-r--r--[l---------]main/zsh/zsh.post-upgrade21
2 files changed, 78 insertions, 3 deletions
diff --git a/main/zsh/APKBUILD b/main/zsh/APKBUILD
index 91a3e65364..8238903c67 100644
--- a/main/zsh/APKBUILD
+++ b/main/zsh/APKBUILD
@@ -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
diff --git a/main/zsh/zsh.post-upgrade b/main/zsh/zsh.post-upgrade
index fe3999fdbc..ebc666054a 120000..100644
--- a/main/zsh/zsh.post-upgrade
+++ b/main/zsh/zsh.post-upgrade
@@ -1 +1,20 @@
-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