summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e2a65690b0b6b360d7652de7256ac4deda4fa2b9 (plain)
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
# Maintainer: Natty4 <natty.sh.git at gmail dot com>
pkgname="dfmd-git"
pkgver=v0.1.0.r0.g62fd5d9
pkgrel=1
pkgdesc="A configurable handler for file manager DBus activities"
arch=("x86_64")
license=("GPL-3.0-or-later")
url="https://github.com/AMNatty/dfmd"
source=("${pkgname}::git+${url}?signed")
validpgpkeys=('4F9434A2EAC21BEC148F3656BF6CB659ADEE60EC')
sha1sums=('SKIP')
makedepends=("cargo" "git")
depends=("dbus")
optdepends=("xdg-utils: default open actions")

pkgver() {
    cd "${srcdir}/${pkgname}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "${srcdir}/${pkgname}"
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
    cd "${srcdir}/${pkgname}"

    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --release
}

package() {
    install -Dm755 "$srcdir/$pkgname/target/release/dfmd" "$pkgdir/usr/bin/dfmd"
    install -Dm644 "$srcdir/$pkgname/LICENSE.MIT" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.MIT"
    install -Dm644 "$srcdir/$pkgname/LICENSE.GPLv3" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.GPLv3"
    install -Dm644 "$srcdir/$pkgname/org.freedesktop.FileManager1.service" "$pkgdir/usr/share/dbus-1/services/sh.natty.FileManager1.service"
}