summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ad0bc63d6b5b9dbd35c61878c1baa3fbf2359af5 (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
# Maintainer: Kodi Craft <kodi at kdcf dot me>
#

_pkgname=drophost
pkgname=${_pkgname}-git
pkgbase=drophost-git
pkgver=r2.89ae21b
pkgrel=1
makedepends=('rust' 'cargo' 'python' 'git')
arch=('any')
pkgdesc="A simple drop-in /etc/hosts generator"
source=("$pkgname::git+https://github.com/KodiCraft/drophost.git")
url="https://github.com/KodiCraft/drophost.git"
license=('MIT')
sha256sums=('SKIP')
conflicts=('drophost')
provides=('drophost')

pkgver() {
    cd "$srcdir/$pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  return 0
}

package() {
  cd "$srcdir/$pkgname"
  
  git submodule update --init --recursive

  # User may not be using rustup, so always succeed
  rustup override set nightly || true
  cargo install \
    --locked \
    --path . \
    --root="$pkgdir/usr"

  rm "$pkgdir/usr/.crates.toml" "$pkgdir/usr/.crates2.json"

  mkdir -p "$pkgdir/etc/systemd/system/" 
  cp "./drophost.service" "$pkgdir/etc/systemd/system/"
  chmod 1711 "$pkgdir/etc/systemd/system/drophost.service"
}