summaryrefslogtreecommitdiff
path: root/fastbangs-rs-git/PKGBUILD
blob: dfa6072eefeb1811a7b03f6fdb447202978eed6c (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
pkgname=fastbangs-rs-git
pkgver=r20.bce539d
pkgrel=1
pkgdesc='Shortcut-based meta search engine'
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
url='https://codeberg.com/lialenck/fastbangs-rs'
license=('AGPL3')
conflicts=('fastbangs-rs')
provides=('fastbangs-rs')
makedepends=('esbuild' 'sassc' 'rustup')
backup=('etc/fastbangs-rs.yaml')
source=('git+https://codeberg.org/lialenck/fastbangs-rs.git'
	    'fastbangs-rs.service'
	    'fastbangs-rs.yaml'
	    'tmpfiles.conf'
	    'sysusers.conf')
b2sums=('SKIP'
	    'SKIP'
	    'SKIP'
	    'SKIP'
	    'SKIP')

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

rust_chost() {
	sed \
		-e "s/-pc-linux/-unknown-linux/" \
		-e "s/armv7l-/armv7-/" \
		<<< "$CHOST"
}

prepare() {
    cd "fastbangs-rs"
	rustup install stable
	rustup target add "$(rust_chost)"
	cargo +stable fetch --target "$(rust_chost)"
}

build() {
    cd "fastbangs-rs"
	mkdir -p build
	cargo +stable build \
		--frozen \
		--target "$(rust_chost)" \
		--release
}

package() {
	install -Dm755 fastbangs-rs/target/"$(rust_chost)"/release/fastbangs "$pkgdir/usr/bin/fastbangs-rs"
	install -Dm644 fastbangs-rs.service "$pkgdir/usr/lib/systemd/system/fastbangs-rs.service"
	install -Dm644 fastbangs-rs.yaml "$pkgdir/etc/fastbangs-rs.yaml"
    install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/fastbangs-rs.conf"
	install -Dm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/fastbangs-rs.conf"
}