summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5915153f5d44659aeb0533e9be2e1fa1cc1f520b (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
# Maintainer: mattski <redmattski at gmail dot com>

pkgname=withings-sync
pkgver=v3.4.2
pkgrel=2
pkgdesc="A tool for synchronisation of Withings (ex. Nokia Health Body) to Garmin Connect and Trainer Road."
arch=(any)
url="https://github.com/jaroslawhartman/withings-sync"
license=(MIT)
depends=("python-cloudscraper" "python-h2" "python-httpx" "python-lxml" "python-requests" "python-rfc3986>=1.3" "python-rfc3986<2")
makedepends=("python")
source=("$pkgname::git+https://github.com/jaroslawhartman/withings-sync.git"
        "${pkgname}.service"
        "${pkgname}.timer"
        "${pkgname}.conf.example")

pkgver() {
    cd $pkgname
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd $pkgname
    python setup.py build
}

package() {
  cd $pkgname
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/user/${pkgname}.service"
  install -Dm644 "${srcdir}/${pkgname}.timer" "${pkgdir}/usr/lib/systemd/user/${pkgname}.timer"
  install -Dm600 "${srcdir}/${pkgname}.conf.example" "${pkgdir}/etc/${pkgname}/${pkgname}.conf.example"

  echo "1.) Initially run withings-sync from the cli for the <user> to enable the access to withings"
  echo "2.) Copy Conf file to home directory and update with Garmin/Trainer Road Username & P/W"
  echo "3.) Edit the service file to point to the conf file location"
  echo "       $systemctl --user edit --full withings-sync.service"
  echo "4.) Enable the timer: $systemctl --user enable --now withings-sync.timer"
}

md5sums=('SKIP'
         'cabc6d7ff62a22ed8b6722210c873bb6'
         'fdcbfb1d8c6081077048da6d92b0721f'
         '8c065062c737baae192fadb97a88abc1')