# Template file for 'gizmo'
pkgname=gizmo
version=0.2.3
revision=1
_commit=51608fe2a4ff2bacb5a82b58613fed0d9e37cc79
build_style=go
go_import_path=github.com/gizmo-platform/gizmo
go_ldflags="-X ${go_import_path}/pkg/buildinfo.Version=${version}
 -X ${go_import_path}/pkg/buildinfo.Commit=${_commit}"
short_desc="Software for the Gizmo Mechatronics Platform"
maintainer="Michael Aldridge <maldridge@gizmoplatform.org>"
license="ISC"
homepage="https://gizmoplatform.org"
distfiles="https://github.com/gizmo-platform/gizmo/archive/refs/tags/v${version}.tar.gz"
checksum=97e612b853c5296f5f4f4c801e9b22b811495a1f0ee6b66144390da792263d3a

post_install() {
	vsv gizmo-fms
	vlicense LICENSE
}

gizmo-fms_package() {
	short_desc+=" - FMS"
	depends="${sourcepkg}>=${version}_${revision} apache-htpasswd dialog terraform gizmo-docs"
	make_dirs="/var/lib/gizmo 0755 _gizmo _gizmo"
	system_accounts="_gizmo"
	_gizmo_homedir="/var/lib/gizmo"
	_gizmo_shell="/bin/nologin"
	_gizmo_descr="Unprivileged service account"

	pkg_install() {
		vmove etc/sv/gizmo-fms
	}
}
