summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorcameel2018-08-04 17:23:10 +0200
committercameel2018-08-04 17:23:10 +0200
commit4e6a3b97a74e33356b164f0579e791e61ee7669c (patch)
tree6ccfad32e43fcc21c8aa4ab5ec45c972b490ce10 /PKGBUILD
downloadaur-ansible-completion-git.tar.gz
Initial PKGBUILD
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD36
1 files changed, 36 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..0e876f1f123
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Kamil ƚliwak <cameel2@gmail.com>
+
+pkgname=ansible-completion-git
+pkgver=r67.40053ed
+pkgrel=1
+pkgdesc='Basic bash completion for Ansible'
+arch=('any')
+url="https://github.com/dysosmus/ansible-completion"
+license=('GPL3')
+depends=('bash-completion' 'ansible')
+makedepends=('git')
+provides=('ansible-completion')
+conflicts=('ansible-completion')
+source=("$pkgname"::git+${url}.git)
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "${pkgname}"
+
+ # TODO: Right now there are no tags in the git repo.
+ # Change the command below to use tags when the first official version gets released.
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ cd "${pkgname}"
+
+ mkdir --parents "${pkgdir}/usr/share/bash-completion/completions/"
+ for file in *-completion.bash; do
+ # Completion files are loaded on demand and their names must match command names.
+ # We have to strip the `-completion.bash` suffix to get the command name.
+ command_name=${file/-completion.bash/}
+
+ install -Dm644 "${file}" "${pkgdir}/usr/share/bash-completion/completions/${command_name}"
+ done
+}