SHA256
1
0
forked from pool/velociraptor

Accepting request 1193528 from security:sensor

OBS-URL: https://build.opensuse.org/request/show/1193528
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/velociraptor?expand=0&rev=13
This commit is contained in:
Dominique Leuenberger 2024-08-13 11:24:37 +00:00 committed by Git OBS Bridge
commit 3e27b00639
2 changed files with 37 additions and 19 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Aug 12 20:47:33 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- Move system-user-velociraptor to the client flavor build in order
to build it on all architectures.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 03 17:01:54 UTC 2024 - antonio.teixeira@suse.com Wed Jul 03 17:01:54 UTC 2024 - antonio.teixeira@suse.com

View File

@ -57,7 +57,7 @@
# Older SLE releases and debbuild don't support uppercase VERSION macro # Older SLE releases and debbuild don't support uppercase VERSION macro
%if "%{_vendor}" == "debbuild" || 0%{?sle_version} < 150000 %if "%{_vendor}" == "debbuild" || 0%{?sle_version} < 150000
%define VERSION %{version} %global VERSION %{version}
%endif %endif
#Compat macro for new _fillupdir macro introduced in Nov 2017 #Compat macro for new _fillupdir macro introduced in Nov 2017
@ -163,16 +163,20 @@ BuildRequires: zlib-devel
%endif %endif
%endif %endif
%if %{build_server} %if %{build_server}
BuildRequires: sysuser-tools BuildRequires: group(velociraptor)
Requires: group(velociraptor) Requires: group(velociraptor)
Requires: user(velociraptor) Requires: user(velociraptor)
Obsoletes: velociraptor-kafka-humio-gateway < %{version} Obsoletes: velociraptor-kafka-humio-gateway < %{version}
%else
%if 0%{?suse_version}
BuildRequires: sysuser-tools
%{?sysusers_requires} %{?sysusers_requires}
%endif %endif
%endif
%if 0%{?suse_version} %if 0%{?suse_version}
# SLE12 doesn't support sysusers and releases lower than SP4 don't build the server flavor which includes the system-user-velociraptor package. # SLE12 doesn't support sysusers
%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150400 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
Requires(pre): pwdutils Requires(pre): pwdutils
%define pre_create_group 1 %define pre_create_group 1
%else %else
@ -219,20 +223,7 @@ https://docs.velociraptor.app/
This package contains the velociraptor server and full console GUI. This package contains the velociraptor server and full console GUI.
For just the endpoint agent, please install the 'velociraptor-client' package. For just the endpoint agent, please install the 'velociraptor-client' package.
%package -n system-user-velociraptor
Summary: System user and group 'velociraptor'
Version: 1.0.0
License: Apache-2.0
Group: System/Monitoring
Provides: group(velociraptor)
Provides: user(velociraptor)
BuildArch: noarch
%description -n system-user-velociraptor
This package provides a shared system user for all velociraptor components
%endif %endif
%if %{build_client} %if %{build_client}
%description %description
Velociraptor is a tool for collecting host based state information Velociraptor is a tool for collecting host based state information
@ -244,6 +235,20 @@ https://docs.velociraptor.app/
This package contains only the endpoint agent. For the full server and GUI This package contains only the endpoint agent. For the full server and GUI
console, please install the 'velociraptor' package. console, please install the 'velociraptor' package.
%if 0%{?suse_version}
%package -n system-user-velociraptor
Summary: System user and group 'velociraptor'
Version: 1.0.0
License: Apache-2.0
Group: System/Monitoring
Provides: group(velociraptor)
Provides: user(velociraptor)
BuildArch: noarch
%description -n system-user-velociraptor
This package provides a shared system user for all velociraptor components
%endif
%endif %endif
%prep %prep
@ -291,8 +296,11 @@ export VELOCIRAPTOR_GIT_HEAD=$git_commit
%if %{build_server} %if %{build_server}
(cd gui/velociraptor ; npm run build) (cd gui/velociraptor ; npm run build)
%else
%if 0%{?suse_version}
%sysusers_generate_pre %{SOURCE10} velociraptor-user %sysusers_generate_pre %{SOURCE10} velociraptor-user
%endif %endif
%endif
%if 0%{?suse_version} %if 0%{?suse_version}
LLVM_STRIP=llvm-strip LLVM_STRIP=llvm-strip
@ -316,8 +324,10 @@ config_file_source=%{SOURCE4}
sysconfig_file_source=%{SOURCE7} sysconfig_file_source=%{SOURCE7}
config_file=server.config config_file=server.config
install -D -m 0644 %{SOURCE10} %{buildroot}%{_sysusersdir}/system-user-velociraptor.conf
%else %else
%if 0%{?suse_version}
install -D -m 0644 %{SOURCE10} %{buildroot}%{_sysusersdir}/system-user-velociraptor.conf
%endif
service_file_source=%{SOURCE5} service_file_source=%{SOURCE5}
config_file_source=%{SOURCE6} config_file_source=%{SOURCE6}
sysconfig_file_source=%{SOURCE8} sysconfig_file_source=%{SOURCE8}
@ -356,13 +366,15 @@ install -D -m 0755 output/velociraptor-v%{VERSION}-linux-* %buildroot/%{_bindir}
%dir %attr(%{state_dir_perms}) %{_sharedstatedir}/%{name}/logs %dir %attr(%{state_dir_perms}) %{_sharedstatedir}/%{name}/logs
%dir %attr(%{state_dir_perms}) %{_sharedstatedir}/%{name}/tmp %dir %attr(%{state_dir_perms}) %{_sharedstatedir}/%{name}/tmp
%if %{build_server} %if %{build_client}
%if 0%{?suse_version}
%files -n system-user-velociraptor %files -n system-user-velociraptor
%defattr(-, root, root) %defattr(-, root, root)
%{_sysusersdir}/system-user-velociraptor.conf %{_sysusersdir}/system-user-velociraptor.conf
%pre -n system-user-velociraptor -f velociraptor-user.pre %pre -n system-user-velociraptor -f velociraptor-user.pre
%endif %endif
%endif
%if 0%{?suse_version} %if 0%{?suse_version}
%pre %pre