summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3cdd6761387bc4d87f227a1b94283a396e099ee8 (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
# Maintainer: Wayback Archiver <wabarc@tuta.io>

pkgname=wayback
pkgver=0.20.1
pkgrel=1
pkgdesc="A toolkit for snapshot webpage to Internet Archive, archive.today, IPFS and beyond"
arch=('x86_64')
url="https://github.com/wabarc/wayback"
license=('GPL3')
makedepends=('git' 'go')
# See https://wiki.archlinux.org/title/PKGBUILD#optdepends
optdepends=('chromium: capture webpage support'
            'youtube-dl: download media support'
            'tor: onion service support'
            'wget: warc support'
            'libwebp: convert webp support'
            'nss: network security service')
source=('git+https://github.com/wabarc/wayback.git')
sha256sums=('SKIP')

prepare() {
	rm -rf "${pkgdir}/*"
}

pkgver() {
    cd "${srcdir}/${pkgname}"
    git describe --tags `git rev-list --tags --max-count=1` | sed -e 's/v//g'
}

build() {
    cd "${srcdir}/${pkgname}"
    make linux-amd64
    cp -f "build/binary/${pkgname}-linux-amd64" "build/binary/${pkgname}"
}

check() {
    cd "${srcdir}/${pkgname}"
    sha256sum "build/binary/${pkgname}"
    bash -c "build/binary/${pkgname}"
}

package() {
    cd "${srcdir}/${pkgname}"
    install -Dm 755 "build/binary/${pkgname}" -t "${pkgdir}/usr/bin"
    install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/wayback"
    install -Dm 644 build/systemd/wayback.service -t "${pkgdir}/usr/lib/systemd/system/"
}