summaryrefslogtreecommitdiff
blob: 7e45914dfe9a51c9bd53949b05703970c09eb677 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit systemd udev

DESCRIPTION="Platform independent instrument control for Zurich Instruments devices"
HOMEPAGE="https://www.zhinst.com/labone"
SRC_URI="https://www.zhinst.com/sites/default/files/media/release_file/2021-09/LabOneLinux64-${PV}.tar.gz"

LICENSE="zi-labone"
SLOT="0"
KEYWORDS="-* ~amd64"
RESTRICT="mirror bindist"
IUSE="minimal"

QA_PREBUILT="*"

RDEPEND=""

S=${WORKDIR}/LabOneLinux64-${PV}

src_install() {
	local application_directory=/opt/zi
	local installation_directory="${application_directory}/LabOne64-${PV}"

	if ! use minimal ; then

		# the applications

		dodir ${installation_directory}
		for dir in API DataServer Firmware Documentation WebServer ; do
			mv "$dir" "${D}${installation_directory}/" || die
		done

		cp "release_notes_$(ver_cut 1-2).txt" "${D}${installation_directory}/" || die

		dosym ../..${installation_directory}/DataServer/ziServer /opt/bin/ziServer
		dosym ../..${installation_directory}/DataServer/ziDataServer /opt/bin/ziDataServer
		dosym ../..${installation_directory}/DataServer/ziWebServer /opt/bin/ziWebServer

		# the services

		# LabOne comes with systemd support.

		local service
		for service in labone-data-server hf2-data-server ; do
			sed -e 's:/usr/local/bin/:/opt/bin/:g' -i Installer/systemd/${service}.service || die
			systemd_dounit Installer/systemd/${service}.service
		done

		# For OpenRC we need to do our own thing...

		for service in labone-data-server hf2-data-server ; do
			doinitd "${FILESDIR}/${service}"
			doconfd "${FILESDIR}/${service}.conf"
		done

	else

		insinto "${installation_directory}/API/C/lib"
		doins API/C/lib/*.so
		insinto "${installation_directory}/API/C/include"
		doins API/C/include/*.h

	fi

	dosym "../..${installation_directory}/API/C/include/ziAPI.h" "usr/include/ziAPI.h"
	dosym "../..${installation_directory}/API/C/lib/libziAPI-linux64.so" "usr/$(get_libdir)/libziAPI-linux64.so"

	udev_dorules Installer/udev/55-zhinst.rules
}