summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 402d087f927ea99583e2f3b29fc64446e38fe464 (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
# Maintainer: FTS427 <FTS427@outlook.com>
# Contributor: futrime <https://github.com/futrime>
pkgname=lip-git
_pkgname=lip
pkgver=0.34.4
pkgrel=2
pkgdesc="A general package installer"
arch=('x86_64' 'aarch64')
url="https://github.com/futrime/lip"
license=('GPL3')
conflicts=('lip-bin')
options=(!strip)
makedepends=('dotnet-sdk' 'dotnet-runtime' 'dotnet-host' 'git')
source=("$pkgname::git+${url}.git#tag=v$pkgver"
        "lip.1")
sha256sums=('SKIP'
            '341f8366713c3463d309d7db58b4b4f1ac270a03afe5714ddd3bc2195d293cfd')
pkgver() {
    cd "$pkgname"
    git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
    cd "$pkgname"
    if [[ -z "$(git config --get user.name)" ]]; then
        git config user.name local && git config user.email '<>' && git config commit.gpgsign false
    fi
}
build() {
    cd "$pkgname"
    if [ "$arch" == x86_64 ]; then
        _runtime="linux-x64"
    else
        _runtime="linux-arm64"
    fi
    dotnet publish Lip.CLI \
        --configuration Release \
        --output bin \
        --runtime "$_runtime" \
        --self-contained true \
        -p:PublishSingleFile=true \
        -p:Version="${pkgver%.r*}"
}
package() {
    install -Dm 644 "$_pkgname.1" "$pkgdir/usr/share/man/man1/$_pkgname.1"
    install -Dm 755 "$pkgname/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
    install -Dm 755 "$pkgname/bin/${_pkgname}d" "$pkgdir/usr/bin/${_pkgname}d"
    install -Dm 644 "$pkgname/COPYING" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
}