summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 08eb59e918f28907270d8503b0456f56a4764500 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: Michael Adler <therisen06@gmail.com>

_pkgname=notmuch-mailmover
pkgname=${_pkgname}-git
pkgver=v0.4.0
pkgrel=1
pkgdesc='notmuch-mailmover is a tool to move notmuch tagged mails into Maildir folders'
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url='https://github.com/michaeladler/notmuch-mailmover'
license=('Apache')
depends=('notmuch-runtime' 'lua')
makedepends=('git' 'cargo' 'pkgconf')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=("${pkgname%-*}::git+$url")
sha256sums=('SKIP')

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

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

build() {
  cd "${_pkgname}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release
}

check() {
  cd "${_pkgname}"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen
}

package() {
  cd "${_pkgname}"
  install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/${_pkgname}"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"

  # man page
  install -Dm644 share/notmuch-mailmover.1.gz "$pkgdir/usr/share/man/man1/notmuch-mailmover.1.gz"

  # examples
  mkdir -p "$pkgdir/usr/share/doc/notmuch-mailmover"
  cp -d -R example "$pkgdir/usr/share/doc/notmuch-mailmover/"

  # shell completions
  install -Dm644 share/notmuch-mailmover.bash "$pkgdir/usr/share/bash-completion/completions/notmuch-mailmover"
  install -Dm644 share/_notmuch-mailmover "$pkgdir/usr/share/zsh/site-functions/_notmuch-mailmover"
  install -Dm644 share/notmuch-mailmover.fish "$pkgdir/usr/share/fish/vendor_completions.d/notmuch-mailmover.fish"
}