summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ca885f455c897cd714b1db497052c1f8798e2c4d (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
# Maintainer Manuel Palenzuela <sadshinobi@protonmail.com>

author=Baitinq
pkgname=geolocate-git
pkgbase=geolocate
pkgver=geolocate.r1.53fb9b1
pkgrel=1
pkgdesc="Obtain an ip's approximate latitude and longitude in a simplistic format (latitude:longitude)"
url="https://github.com/Baitinq/geolocate"
depends=('bash' 'curl' 'jq' 'gnu-netcat')
makedepends=('git')
license=('GPL')
arch=('any')
source=("git://github.com/$author/$pkgbase")
provides=('geolocate')

md5sums=('SKIP')
sha1sums=('SKIP')
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgbase"

  # Get the version number.
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd "$srcdir/$pkgbase"

  # Install the program.
  mkdir -p "$pkgdir/usr/share/$pkgbase"
  install -Dm755 geolocate "${pkgdir}/usr/bin/$pkgbase"
  chmod +x "$pkgdir/usr/bin/$pkgbase"
  install -Dm 644 $pkgbase.service \
    "$pkgdir/etc/systemd/system/$pkgbase.service"
  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgbase"
  chmod -R 777 "$pkgdir/usr/share/$pkgbase"
}