summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 22d113471d5a61233e23263bd500093cc20187c6 (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
40
41
42
# Maintainer: Andrew Shark <ashark at linuxcomp at ru>
pkgname=evsieve-git
_pkgname=${pkgname%-git}
pkgver=v1.3.1.r151.g0ba0bf5
pkgrel=1
pkgdesc="A utility for mapping events from Linux event devices."
arch=("x86_64")
url="https://github.com/KarsMulder/${_pkgname}"
license=("GPL2" "MIT")
depends=("libevdev" "gcc-libs")
makedepends=("git" "rust")
provides=(${_pkgname})
conflicts=(${_pkgname})
source=("git+${url}")
sha256sums=('SKIP')

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

prepare() {
    cd "${_pkgname}"
    cargo fetch --locked --target x86_64-unknown-linux-gnu
}

build() {
    cd "${_pkgname}"
    cargo build --release --frozen --target-dir=target
}

package() {
    cd "${_pkgname}"

    install -Dm 755 "target/release/${_pkgname}" -t "${pkgdir}/usr/bin"
    _pkg_license_dir="${pkgdir}/usr/share/licenses/${_pkgname}"
    install -Dm 644 "COPYING" -t "$_pkg_license_dir"
    install -Dm 644 "LICENSE" -t "$_pkg_license_dir"
    cp -R licenses "$_pkg_license_dir"
    find "$_pkg_license_dir" -type f -exec chmod 644 -- {} +
    find "$_pkg_license_dir" -type d -exec chmod 755 -- {} +
}