#Maintainer: Debucquoy Anthony <debucquoy.anthony@gmail.com>
pkgbase="dotfiles"
pkgname=(
	"zshrc-dotfiles"
	"vimrc-dotfiles"
		)
pkgver=r2.cb102e6
pkgrel=1
pkgdesc="dotfiles for tonitch"
arch=('any')
url="https://git.herisson.ovh/tonitch/dotfiles"
license=('unknown')
groups=(tonitch-dotfiles)
makedepends=('git') # 'bzr', 'git', 'mercurial' or 'subversion'
# provides=("${pkgname%-VCS}")
# conflicts=("${pkgname%-VCS}")
source=('git+https://git.herisson.ovh/tonitch/dotfiles')
sha256sums=('SKIP')

# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
# a description of each element in the source array.

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

# prepare() {
# 	cd "$srcdir/${pkgname%-VCS}"
# 	patch -p1 -i "$srcdir/${pkgname%-VCS}.patch"
# }

# build() {
# 	cd "$srcdir/${pkgname%-VCS}"
# 	./autogen.sh
# 	./configure --prefix=/usr
# 	make
# }

# check() {
# 	cd "$srcdir/${pkgname%-VCS}"
# 	make -k check
# }

package_dotfiles() {
	# Should contain all other packages
	package_zshrc-dotfiles
}

package_vimrc-dotfiles() {
	depends=('vim')
	install -Dm644 ${srcdir}/dotfiles/vimrc  ${pkgdir}/etc/skel/.vimrc
}

package_zshrc-dotfiles() {
	depends=('zsh' 'zsh-autosuggestions' 'zsh-history-substring-search' 'zsh-syntax-highlighting' 'zsh-vi-mode')
	optdepends=('zsh-lovers')
	install -Dm644 ${srcdir}/dotfiles/zshrc  ${pkgdir}/etc/zsh/zshrc
}
