-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
50 lines (43 loc) · 1.54 KB
/
PKGBUILD
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
# Maintainer: Dominik Fischer <d dot f dot fischer at web dot de>
pkgname=pkgrepotools-git
pkgver=r0
pkgrel=1
# Do not try to track version changes with git. The version generated by the pkgver
# function in the git template will in turn reference the commit hash, so commiting
# a version change will change the version, which is an unbreakable race condition.
pkgdesc="builds and distributes packages expanding templates off-file"
arch=('any')
url="https://github.com/dffischer/pkgrepotools"
license=('GPL')
depends=('bash' 'sed')
makedepends=('ruby-ronn')
optdepends=("pacman>=5: to use aurbranch without a .SRCINFO argument, $(
)makepkg-expanded and graph-templates"
'git: for offbranch, aurbranch and aurremote'
'graphviz: to process what graph-templates generates')
replaces=('makepkg-expanded')
_gvdir='usr/share/graphviz/gvpr'
# template input; name=git
find_executables() {
cd $_gitname
executables=($(find -mindepth 1 -maxdepth 1 \
-executable -type f \! -iname '*.gvpr'))
executables=("${executables[@]#./}")
}
build() {
find_executables
sed -i "s|\\([[:alpha:]]\\+\\)\\.gvpr|/$_gvdir/\\1|" *.md
ronn --roff ${executables[@]/%/.md}
}
package() {
find_executables
install -Dt "$pkgdir/usr/bin" ${executables[@]}
install -Dm644 -t "$pkgdir/usr/share/man/man1" *.1
install -d "$pkgdir/$_gvdir"
for gvpr in *.gvpr
do
install "$gvpr" "$pkgdir/$_gvdir/${gvpr%.gvpr}"
done
IFS=: eval 'GLOBIGNORE="${executables[*]/%/.md}:*.gvpr"'
install -Dm655 -t "$pkgdir/usr/share/doc/${pkgname%-git}" *.md
}