summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 732f212d7867f430342815a666ffb1c1b76fa78f (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
49
50
51
52
53
# Creator and maintainer: Giorgio Gilestro <giorgio at gilest.ro>

pkgname=ethoscope-device
pkgver=r1702.g1c43fc3
pkgrel=6
pkgdesc="A platform from monitoring animal behaviour in real time from a raspberry pi - Device version"
arch=('any')
url="http://lab.gilest.ro/ethoscope"
license=('GPL3')
makedepends=('git' 'gcc-fortran' 'python' 'python-setuptools')
depends=('avahi' 'rsync' 'wget' 'fping' 'ntp' 'nss-mdns' 'openssh' 'mariadb' 'dnsmasq' 'f2fs-tools' 'i2c-tools' 'wpa_supplicant' 'ifplugd' 'qt5-base' 'python-opencv' 'hdf5' 'gtk3' 'python-pip' 'python-numpy' 'python-scipy' 'python-bottle' 'python-pyserial' 'python-mysql-connector' 'python-netifaces' 'python-cherrypy' 'python-eventlet' 'python-gitpython' 'python-dnspython' 'python-greenlet' 'python-monotonic' 'python-zeroconf' 'python-pyusb')
optdepends=('python-picamera: picamera support on raspberry pis')
provides=('ethoscope-device')
install="ethoscope-device.install"
source=("$pkgname::git+https://github.com/gilestrolab/ethoscope.git")
md5sums=('SKIP')

pkgver() {
  cd "$pkgname"
  printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  #creating packaging directories
  install -dm0755 $pkgdir/opt
  install -dm0755 $pkgdir/etc
  install -dm0755 $pkgdir/ethoscope_data
  install -dm0755 $pkgdir/usr/lib/systemd/system/
  install -dm0755 $pkgdir/usr/bin

  #setting python3 branch
  cd "${srcdir}/${pkgname}"
  git checkout dev

  #cp node server and node updater
  cd "${srcdir}"
  cp -R --no-dereference --preserve=mode,links -v * "${pkgdir}/opt/${pkgname}"
  ln -s /opt/ethoscope-device/scripts/ethoscope_updater "${pkgdir}/opt/"

  #changing the remote GIT source to local BARE created during installation
  cd "${pkgdir}/opt/${pkgname}"
  git remote set-url origin git://node/ethoscope.git

  #install service files
  cd "${srcdir}"/"${pkgname}"/scripts/
  install -D --mode=0755 ethoscope_device.service ethoscope_listener.service ethoscope_GPIO_listener.service "${pkgdir}/usr/lib/systemd/system/"

  cd "${srcdir}"/"${pkgname}"/scripts/ethoscope_updater/
  install -D --mode=0755 ethoscope_update.service "${pkgdir}/usr/lib/systemd/system/"

}