diff options
author | ggilestro | 2019-06-24 17:23:38 +0100 |
---|---|---|
committer | ggilestro | 2019-06-24 17:23:38 +0100 |
commit | 803068c6a741280a796c1456d3217a0f07fb7d33 (patch) | |
tree | 8ab20d8f7e9ae7ec1e6ff5461f25f8d1d67c4d02 | |
download | aur-803068c6a741280a796c1456d3217a0f07fb7d33.tar.gz |
first package commit
-rw-r--r-- | .SRCINFO | 37 | ||||
-rw-r--r-- | PKGBUILD | 52 | ||||
-rw-r--r-- | ethoscope-node.install | 49 |
3 files changed, 138 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..73f4f18b8683 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,37 @@ +pkgbase = ethoscope-node + pkgdesc = A platform from monitoring animal behaviour in real time from a raspberry pi + pkgver = r1702.g1c43fc3 + pkgrel = 1 + url = http://lab.gilest.ro/ethoscope + install = ethoscope-node.install + arch = any + license = GPL3 + makedepends = git + makedepends = gcc-fortran + makedepends = rsync + makedepends = wget + makedepends = fping + makedepends = ntp + makedepends = openssh + makedepends = mariadb + makedepends = dnsmasq + depends = python-pip + depends = python-numpy + depends = python-bottle + depends = python-pyserial + depends = python-mysql-connector + depends = python-netifaces + depends = python-cherrypy + depends = python-eventlet + depends = python-gitpython + depends = python-scapy + depends = python-dnspython + depends = python-greenlet + depends = python-monotonic + depends = scapy + provides = ethoscope + source = ethoscope-node::git+https://github.com/gilestrolab/ethoscope.git + md5sums = SKIP + +pkgname = ethoscope-node + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d526d8ef6827 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Giorgio Gilestro <giorgio at gilest.ro> + +pkgname=ethoscope-node +pkgver=r1702.g1c43fc3 +pkgrel=1 +pkgdesc="A platform from monitoring animal behaviour in real time from a raspberry pi" +arch=('any') +url="http://lab.gilest.ro/ethoscope" +license=('GPL3') +makedepends=('git' 'gcc-fortran' 'rsync' 'wget' 'fping' 'ntp' 'openssh' 'mariadb' 'dnsmasq' ) #'base-devel' ) +depends=('python-pip' 'python-numpy' 'python-bottle' 'python-pyserial' 'python-mysql-connector' 'python-netifaces' 'python-cherrypy' 'python-eventlet' 'python-gitpython' 'python-scapy' 'python-dnspython' 'python-greenlet' 'python-monotonic' 'scapy') +provides=('ethoscope') +install="ethoscope-node.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,srv/git} + install -dm0755 $pkgdir/usr/lib/systemd/system/ + + #create bare repo + git clone --bare https://github.com/gilestrolab/ethoscope.git "${pkgdir}/srv/git/ethoscope.git" + + #setting python3 branch + cd "${srcdir}/${pkgname}" + git checkout python3.7 + + #cp node server and node updater + cd "${srcdir}" + cp -R --no-dereference --preserve=mode,links -v * "${pkgdir}/opt/${pkgname}" + ln -s /opt/ethoscope-node/scripts/ethoscope_updater "${pkgdir}/opt/" + + #install python service + cd "${srcdir}/${pkgname}/node_src" + #pip install -e . --install-option="--prefix=${pkgdir}" --no-deps + python setup.py install --root="$pkgdir/" --optimize=1 --skip-build + + #install service files + cd "${srcdir}"/"${pkgname}"/scripts/ + install -D --mode=0755 ethoscope_node.service ethoscope_backup.service ethoscope_video_backup.service "${pkgdir}/usr/lib/systemd/system/" + cd "${srcdir}"/"${pkgname}"/scripts/ethoscope_updater/ + install -D --mode=0755 ethoscope_update_node.service "${pkgdir}/usr/lib/systemd/system/" + +} + + diff --git a/ethoscope-node.install b/ethoscope-node.install new file mode 100644 index 000000000000..f72c68cce205 --- /dev/null +++ b/ethoscope-node.install @@ -0,0 +1,49 @@ +## arg 1: the new package version +#pre_install() { + # do something here +#} + +# arg 1: the new package version +post_install() { + echo "changing the remote GIT source to local BARE created during installation" + cd /opt/ethoscope-node + git remote set-url origin /srv/git/ethoscope.git + + #setting branch + git checkout python3.7 + + echo "enabling NODE specific systemd service files" + systemctl enable ethoscope_node.service ethoscope_update_node.service ethoscope_backup.service ethoscope_video_backup.service + echo "enabling the GIT server on the node" + systemctl enable git-daemon.socket +} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + echo "changing the remote GIT source to local BARE created during installation" + cd /opt/ethoscope-node + git remote set-url origin /srv/git/ethoscope.git + + #setting branch + git checkout python3.7 +} + +# arg 1: the old package version +pre_remove() { + echo "disabling systemd service files" + systemctl disable ethoscope_node.service ethoscope_update_node.service ethoscope_backup.service ethoscope_video_backup.service + systemctl disable git-daemon.socket + +} + +## arg 1: the old package version +#post_remove() { + # do something here +#} |