summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8e1c4821e6827bc9b9b113fb90b0a8558b7634e1 (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
# Maintainer: Davron <xamdamovdavron6@gmail.com>
pkgname='jprq'
pkgver=2.3
pkgrel=1
epoch=
pkgdesc="This is a free and open tool for exposing local servers to public network (the internet)"
arch=('any')
makedepends=("curl")
license=('MIT')
url="https://github.com/azimjohn/jprq/releases/download/2.3"

build() {
	set -e

	URL_PREFIX="https://github.com/azimjohn/jprq/releases/download/2.3"

	case "$(uname -sm)" in
	  "Darwin $CARCH") FILENAME="jprq-darwin-amd64" ;;
	  "Darwin $CARCH") FILENAME="jprq-darwin-arm64" ;;
	  "Linux $CARCH") FILENAME="jprq-linux-amd64" ;;
	  "Linux $CARCH") FILENAME="jprq-linux-386" ;;
	  *) echo "Unsupported architecture: $(uname -sm)" >&2; exit 1 ;;
	esac

	echo "Downloading $FILENAME from github releases"
	if ! curl -sSLf "$URL_PREFIX/$FILENAME" -o "jprq"; then
	  echo "Failed to write to $INSTALL_DIR; try with sudo" >&2
	  exit 1
	fi

	echo "jprq is successfully installed"
}

package() {
    install -Dm755 ./jprq "$pkgdir/usr/bin/jprq"
}