summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorOrhun Parmaksız2023-03-31 21:36:30 +0300
committerOrhun Parmaksız2023-03-31 21:36:30 +0300
commit65040f52f3a9a6163aceaeb557abff37e13c6a8c (patch)
treead13398e2de19b8e62d450249807b0111f2d89c0 /PKGBUILD
downloadaur-65040f52f3a9a6163aceaeb557abff37e13c6a8c.tar.gz
Initial upload: repgrep-git 0.12.1.r4.g9a6ea57-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD49
1 files changed, 49 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..092aa8c608e4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# Maintainer: orhun <orhunparmaksiz@gmail.com>
+# https://github.com/orhun/pkgbuilds
+
+pkgname=repgrep-git
+_pkgname=rgr
+pkgver=0.12.1.r4.g9a6ea57
+pkgrel=1
+pkgdesc="An interactive command line replacer for ripgrep (git)"
+arch=('x86_64')
+url="https://github.com/acheronfail/repgrep"
+license=('MIT' 'Apache' 'Unlicense')
+depends=('gcc-libs')
+makedepends=('cargo' 'git' 'asciidoctor')
+conflicts=("${pkgname%-git}")
+provides=("${pkgname%-git}")
+source=("git+${url}")
+sha512sums=('SKIP')
+
+pkgver() {
+ cd "${pkgname%-git}"
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "${pkgname%-git}"
+ cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
+}
+
+build() {
+ cd "${pkgname%-git}"
+ cargo build --release --frozen
+}
+
+check() {
+ cd "${pkgname%-git}"
+ cargo test --frozen
+}
+
+package() {
+ cd "${pkgname%-git}"
+ install -Dm 755 "target/release/$_pkgname" -t "$pkgdir/usr/bin"
+ install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
+ install -Dm 644 LICENSE-MIT -t "$pkgdir/usr/share/licenses/$pkgname"
+ out_dir=$(find target -name repgrep-stamp -print0 | xargs -0 ls -t | head -n1 | xargs dirname)
+ install -Dm 644 "$out_dir/$_pkgname.bash" "$pkgdir/usr/share/bash-completion/completions/$_pkgname"
+ install -Dm 644 "$out_dir/$_pkgname.fish" "$pkgdir/usr/share/fish/vendor_completions.d/$_pkgname.fish"
+ install -Dm 644 "$out_dir/_$_pkgname" "$pkgdir/usr/share/zsh/site-functions/_$_pkgname"
+ install -Dm 644 "$out_dir/$_pkgname.1" -t "$pkgdir/usr/share/man/man1"
+}