summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c2602b2228647b5febeb5fc29725d26624f7308 (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: Monirzadeh aur.phantom634 at passinbox dot com
pkgname=chapar-bin
pkgver=0.3.1
pkgrel=1  # Set the initial package release number
pkgdesc="Chapar is a simple and easy to use api testing tools aims to help developers to test their api endpoints. it support http and grpc protocols."
arch=('x86_64')
url="https://github.com/chapar-rest/chapar"
license=('BSD-3-Clause')
depends=()
makedepends=('curl' 'jq')  # List any build dependencies here
conflicts=(chapar)

# Fetch the latest release URL
source_url=$(curl -s https://api.github.com/repos/chapar-rest/chapar/releases/latest | jq -r '.assets[] | select(.name | test("amd64.tar.xz")) | .browser_download_url')

# Set the source
source=("$source_url")
sha256sums=('SKIP')  # Replace with actual checksum or 'SKIP' if not needed

pkgver() {
  curl -s https://api.github.com/repos/chapar-rest/chapar/releases/latest | jq -r .tag_name | sed 's/v//'
}

package() {
    # Create necessary directories
    mkdir -p "$pkgdir/usr/bin"
    mkdir -p "$pkgdir/usr/share/applications"
    mkdir -p "$pkgdir/usr/share/icons"

    # Extract the tar.xz file
    tar -xvf "$srcdir/chapar-linux-v${pkgver}-amd64.tar.xz" -C "$srcdir" --strip-components=1

    # Install the binary
    install -Dm755 "$srcdir/chapar" "$pkgdir/usr/bin/chapar"

    # Copy the desktop entry
    sed -e "s#{ICON_PATH}#${pkgdir}/usr/share/icons/chapar.png#" \
        "$srcdir/desktop-assets/chapar.desktop" > "$pkgdir/usr/share/applications/chapar.desktop"

    # Copy the icon
    cp -v "$srcdir/appicon.png" "$pkgdir/usr/share/icons/chapar.png"

    # copy the LICENSE file if you want to include it
    install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}