]> git.rmz.io Git - dotfiles.git/blob - vim/ultisnips/PKGBUILD.snippets
b18ae811cc5cabf50985e11dc4ed4a0d49066acf
[dotfiles.git] / vim / ultisnips / PKGBUILD.snippets
1 snippet pkgver "pkgver() function" b
2 pkgver() {
3 cd ${1:$pkgname-$pkgver}
4 ( set -o pipefail
5 git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
6 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
7 )
8 }
9 endsnippet
10
11 snippet prep "prepare() function" b
12 prepare() {
13 cd ${1:$pkgname-$pkgver}
14 $0
15 }
16 endsnippet
17
18 snippet build "build() function" b
19 build() {
20 cd ${1:$pkgname-$pkgver}
21 ./configure \
22 --prefix=/usr $2
23 $0
24 }
25 endsnippet
26
27 snippet pack "package() function" b
28 package() {
29 cd ${1:$pkgname-$pkgver}
30 make DESTDIR="$pkgdir" install
31 $0
32 }
33 endsnippet