summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb16ead5cdb5fb29eaada371e68d816d25f426d0 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: Vlad M. <vlad@archlinux.net>
# Contributor: Tim Kleinschmidt <tim.kleinschmidt@gmail.com>
# Contributor: Amr Hassan <amr.hassan@gmail.com>
# Contributor: Michael Herold <arch@michaeljherold.com>
# Contributor: Ryan Marcus <ryan@rmarcus.info>

_date() {
  date +'%Y-%m-%d'
}

_xzname='cargo-nightly-x86_64-unknown-linux-gnu'

pkgname='cargo-nightly-bin'
pkgver=20171008
pkgrel=1
pkgdesc="Rust package manager"
url="https://crates.io/"
conflicts=('cargo')
provides=('cargo')
arch=('x86_64' 'i686')
license=('APACHE' 'MIT')
depends=('curl' 'rust')
source_i686=(
"${pkgname}-$(_date).xz::https://static.rust-lang.org/dist/$(_date)/cargo-nightly-i686-unknown-linux-gnu.tar.xz")
source_x86_64=(
"${pkgname}-$(_date).xz::https://static.rust-lang.org/dist/$(_date)/cargo-nightly-x86_64-unknown-linux-gnu.tar.xz")
sha256sums_i686=('SKIP')
sha256sums_x86_64=('SKIP')


pkgver() {
  _date | sed 's/-//g'
}

package() {
  cd "${_xzname}"

  # cargo binary:
  install -d "${pkgdir}/usr/bin"
  install -m 755 cargo/bin/cargo "${pkgdir}/usr/bin/"

  # bash completions:
  install -d "${pkgdir}/etc/bash_completion.d"
  install -m 644 cargo/etc/bash_completion.d/cargo     \
    "${pkgdir}/etc/bash_completion.d/"

  # zsh completions: 
  install -d "${pkgdir}/usr/share/zsh/site-functions"
  install -m 644 cargo/share/zsh/site-functions/_cargo \
    "${pkgdir}/usr/share/zsh/site-functions/"
  
  # Miscellaneous documentation:
  install -d "${pkgdir}/usr/share/doc/cargo"
  install -m 644 cargo/share/doc/cargo/README.md       \
    "${pkgdir}/usr/share/doc/cargo/"

  # man-pages:
  install -d "${pkgdir}/usr/share/man/man1"
  for manpage in cargo/share/man/man1/*.1; do
    install -m 644 "${manpage}" "${pkgdir}/usr/share/man/man1/"
  done

  # Licenses:
  install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m 644 LICENSE-APACHE \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-APACHE"
  install -m 644 LICENSE-MIT    \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-MIT"
  install -m 644 LICENSE-MIT    \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-THIRD-PARTY"
}

# vim: ts=2 sw=2 et: