From 4624ccb701ff994a6e420870b28e5bdef2191cb5 Mon Sep 17 00:00:00 2001 From: Susanne Westphal Date: Tue, 18 Jun 2024 08:40:57 +0000 Subject: [PATCH] add platform specific dependencies --- grr/core/requirements.in | 3 +-- grr/server/setup.py | 11 +++++------ travis/compile_requirements.sh | 9 +++++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/grr/core/requirements.in b/grr/core/requirements.in index 17bf35981..1ebeaff26 100644 --- a/grr/core/requirements.in +++ b/grr/core/requirements.in @@ -10,5 +10,4 @@ python-dateutil==2.8.2 pytz==2022.7.1 PyYAML==6.0.1 requests==2.25.1 -yara-python==4.2.3 -fleetspeak-server-bin==0.1.13 \ No newline at end of file +yara-python==4.2.3 \ No newline at end of file diff --git a/grr/server/setup.py b/grr/server/setup.py index 7977735b2..870e6513a 100644 --- a/grr/server/setup.py +++ b/grr/server/setup.py @@ -10,6 +10,7 @@ import configparser import itertools import os +import platform import shutil import subprocess @@ -150,7 +151,7 @@ def make_release_tree(self, base_dir, files): "grr_response_server/gui/local/static", ignore_dirs=IGNORE_GUI_DIRS ), [REL_INI_PATH], - ["requirements.in"], + ["requirements.in", "requirements_lib.in"], ) ) @@ -199,13 +200,11 @@ def make_release_tree(self, base_dir, files): # Ubuntu Jammy, see # https://packages.ubuntu.com/en/jammy/python3-mysqldb "mysqldatastore": ["mysqlclient>=1.3.10,<=1.4.6"], - # TODO: We currently release fleetspeak-server-bin packages - # for Linux only. - ':sys_platform=="linux"': [ - "fleetspeak-server-bin==0.1.13", - ], }, data_files=data_files, ) +if platform.system() == "Linux": + setup_args["install_requires"].extend(parse_requirements("requirements_lin.in")) + setup(**setup_args) diff --git a/travis/compile_requirements.sh b/travis/compile_requirements.sh index 3c6da9bcd..1da444409 100755 --- a/travis/compile_requirements.sh +++ b/travis/compile_requirements.sh @@ -6,6 +6,7 @@ set -ex DIR="$(dirname "$(which "$0")")" OUT_FOLDER=$1 +OS=$2 mkdir "$OUT_FOLDER" @@ -17,10 +18,18 @@ pip-compile --generate-hashes "$DIR/../grr/core/requirements.in" \ -o "$OUT_FOLDER/core_requirements.txt" pip-compile --generate-hashes "$DIR/../grr/server/requirements.in" \ -o "$OUT_FOLDER/server_requirements.txt" +if OS == "ubuntu"; then + pip-compile --generate-hashes "$DIR/../grr/server/requirements_lin.in" \ + -o "$OUT_FOLDER/server_requirements_lin.txt" +fi pip-compile --generate-hashes "$DIR/../grr/proto/requirements.in" \ -o "$OUT_FOLDER/proto_requirements.txt" pip-compile --generate-hashes "$DIR/../grr/client/requirements.in" \ -o "$OUT_FOLDER/client_requirements.txt" +if OS == "win"; then + pip-compile --generate-hashes "$DIR/../grr/server/requirements_win.in" \ + -o "$OUT_FOLDER/client_requirements_win.txt" +fi pip-compile --generate-hashes "$DIR/../grr/client_builder/requirements.in" \ -o "$OUT_FOLDER/client_builder_requirements.txt" pip-compile --generate-hashes "$DIR/../grr/test/requirements.in" \