SHA256
1
0
forked from pool/velociraptor
velociraptor/velociraptor.spec
Jeff Mahoney 089c8e865e Accepting request 952778 from home:jeff_mahoney:branches:security:sensor
- Added client systemd unit files to velociraptor package (LSS#5).
  Since the velociraptor binary in the 'server' package can
  also function as the client, we'll need the client config as well.

- Temporarily re-enable Windows artifacts (LSS#4).

OBS-URL: https://build.opensuse.org/request/show/952778
OBS-URL: https://build.opensuse.org/package/show/security:sensor/velociraptor?expand=0&rev=5
2022-02-08 17:50:07 +00:00

111 lines
3.5 KiB
RPMSpec

#
# spec file for package velociraptor
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define projname velociraptor
Name: velociraptor
Version: 0.6.3~git0.69e0fffa
Release: 0
Summary: Endpoint visibility and collection tool
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: AGPL-3.0-only
URL: https://github.com/Velocidex/velociraptor
Source: %{projname}-%{version}.tar.xz
Source1: vendor-golang-%{version}.tar.xz
Source2: vendor-nodejs-%{version}.tar.xz
Source3: %{name}.service
Source4: %{name}-server.config.placeholder
Source5: %{name}-client.service
Source6: %{name}-client.config.placeholder
Patch1: velociraptor-golang-mage-vendoring.diff
BuildRequires: golang-packaging
BuildRequires: systemd-rpm-macros
BuildRequires: golang(API) >= 1.14
BuildRequires: fileb0x
BuildRequires: mage
BuildRequires: libtsan0
BuildRequires: nodejs16
BuildRequires: npm16
Conflicts: velociraptor-client
%description
Velociraptor is a tool for collecting host based state information
using The Velociraptor Query Language (VQL) queries.
To learn more about Velociraptor, read the documentation on:
https://docs.velociraptor.app/
This package contains the endpoint agent and full console GUI.
For just the endpoint agent, please install the 'velociraptor-client' package.
%prep
%setup -q -a 1 -a 2 -n %{projname}-%{version}
%autopatch -p1
# Set the version to something more specific than <next-tag>-dev
sed -ie "s/\(VERSION *= \).*/\1 \"%{version}\"/" constants/constants.go
# These just clutter the GUI and we don't have Windows clients
# Note: There are dependencies on these that need to be resolved before
# removing them outright.
#rm -rf artifacts/definitions/Windows
%build
(cd gui/velociraptor ; npm run build)
make linux
%install
mkdir -p %buildroot/%{_bindir}
mkdir -p %buildroot/%{_sysconfdir}/velociraptor
mkdir -p %buildroot/%{_unitdir}
install -m 755 output/velociraptor-v%{version}-linux-* %buildroot/%{_bindir}/velociraptor
install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
install -m 0600 %{SOURCE4} %{buildroot}%{_sysconfdir}/velociraptor/server.config
install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}-client.service
install -m 0600 %{SOURCE6} %{buildroot}%{_sysconfdir}/velociraptor/client.config
%files
%license LICENSE
%doc README.md
%dir %{_sysconfdir}/velociraptor
%{_bindir}/velociraptor
%config(noreplace) %{_sysconfdir}/velociraptor/server.config
%config(noreplace) %{_sysconfdir}/velociraptor/client.config
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}-client.service
%pre
%service_add_pre %{name}.service
%service_add_pre %{name}-client.service
%post
%service_add_post %{name}.service
%service_add_post %{name}-client.service
%preun
%service_del_preun %{name}.service
%service_del_preun %{name}-client.service
%postun
%service_del_postun %{name}.service
%service_del_postun %{name}-client.service
%changelog