summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e551b67d906584dc5c0bf126340e8da793ef1f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: Eriner <M@tthamilton.com>

pkgrel=1
pkgver=r1567.876f4265
pkgname=prezto-git
pkgdesc="Prezto is the configuration framework for Zsh; it enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes."
url="https://github.com/sorin-ionescu/prezto"
arch=('any')
license=('MIT')
depends=('zsh>=4.3.17')
makedepends=('git' 'coreutils' 'sed')
source=('git+https://github.com/sorin-ionescu/prezto.git' 'install')
options=('!strip')
install='install'
md5sums=('SKIP'
         '95664ce383e88798a4047305dfd44220')
_gitname='prezto'

backup=('etc/zsh/zlogin' 'etc/zsh/zlogout' 'etc/zsh/zpreztorc' 'etc/zsh/zshenv' 'etc/zsh/zshrc')

pkgver() {
	cd "$srcdir/$_gitname"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd $srcdir/$_gitname
	git submodule update --init --recursive

	mkdir -p $srcdir/etc/zsh

	rm -f $srcdir/etc/zsh/*

	echo "source /etc/zsh/zpreztorc" > "$srcdir/etc/zsh/zshrc"
	echo "source /usr/lib/prezto/init.zsh" >> "$srcdir/etc/zsh/zshrc"


	sed -i 's#\${ZDOTDIR:-\$HOME}/\.zprezto/#/usr/lib/prezto/#g' $srcdir/$_gitname/init.zsh

	for entry in ${backup[@]}; do
		rcfile=$(basename $entry)
		if [ -f $srcdir/$_gitname/runcoms/$rcfile ]; then
			echo "source /usr/lib/prezto/runcoms/$rcfile" >> "$srcdir/etc/zsh/$rcfile"
		fi
	done
}

package() {
	mkdir -p $pkgdir/usr/lib/prezto
	cp -r $srcdir/$_gitname/* $pkgdir/usr/lib/prezto

	mkdir -p $pkgdir/usr/share/doc/prezto
	mv $pkgdir/usr/lib/prezto/*.md $pkgdir/usr/share/doc/prezto

	mkdir -p $pkgdir/etc
	cp -r $srcdir/etc/zsh $pkgdir/etc
}