-
Notifications
You must be signed in to change notification settings - Fork 3
/
pkgbuild.snippets
66 lines (57 loc) · 1.02 KB
/
pkgbuild.snippets
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
58
59
60
61
62
63
64
65
66
global !p
import px
for full_name, name in px.libs().items():
exec("import " + full_name)
endglobal
snippet pk "pkgbuild skeleton" b
pkgname="$1"
pkgver=${PKGVER:-autogenerated}
pkgrel=${PKGREL:-1}
pkgdesc="$2"
groups=(
"$3"
)
arch=("i686" "x86_64")
license=("GPL")
depends=()
makedepends=(
"git"
)
source=(
"$pkgname::git+ssh://$4/$pkgname.git"
)
md5sums=("SKIP")
pkgver() {
cd "$srcdir/$pkgname"
local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
local count=$(git rev-list --count HEAD)
local commit=$(git rev-parse --short HEAD)
echo "$date.${count}_$commit"
}
build() {
cd "$srcdir/$pkgname"
${7:}
}
package() {
$8
}
endsnippet
snippet m "" w
mkdir $pkgdir/$1
endsnippet
priority 2
snippet c "" w
install -DT \
"$srcdir/$pkgname/$1" \
"$pkgdir/$2"
endsnippet
priority 3
snippet "^g$" "" wrA
groups=(
"$1"$2
)
endsnippet
snippet "^(\s+)("[^"]+")$" "" r
`!p snip.rv=match.group(1)``!p snip.rv=match.group(2)`
`!p snip.rv=match.group(1)`"$1"$0
endsnippet