From patchwork Tue Sep 24 13:26:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Portnov X-Patchwork-Id: 3869 X-Patchwork-Delegate: davids@openvpn.net Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:10cd:b0:5b9:581e:f939 with SMTP id j13csp2747086mae; Tue, 24 Sep 2024 06:27:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXhPSOklGXjN7IoL89aND/niQpIvGC3h6Wdah5BwwV83OMvtexVL+Rx05eK0s5uUv4ceB5cDg1qHpA=@openvpn.net X-Google-Smtp-Source: AGHT+IFjS+1EKOOkw2ISXKYWmMMvGIn2ogwlLthXSEgSuawFDxDbj6KQtL7qTV2e0h5gNWiw8l8Q X-Received: by 2002:a05:6e02:170c:b0:3a0:9e83:21e5 with SMTP id e9e14a558f8ab-3a0c8d2299dmr156893685ab.20.1727184441808; Tue, 24 Sep 2024 06:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727184441; cv=none; d=google.com; s=arc-20240605; b=bS4i3b+adieZ8dnhxZNo80D+2mNbefuG2u9GNuKNAtwI69VuM0Vmij0enMk4dyqQNx UNzcNJ0gSmk7qfBwWugxuYqBYWpk2zcrMjEiXoDlkJEpVTz00VhJVCTiWRhidAJFWwnR 7d7T+on8eVWw72Jf6uubsQQyA/lnU7R6ANm7Pe0YxPus/qU0OwLZqUWpChsEMAjK7ndg tF7bqvQH+y8xrGf0gIPsV6DX7iQaTBL6VeaCX3Yhhc36X8o5XH+fOTHiMlxFvzYCtnsd cWQ1yw2f1hp/IklD4jfkaroyiZ0qnwpsknNMi1uRjWW+cLzaAF1iW7B2ZHFqSjFcKBau 4JAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:to:message-id:date:from :mime-version:dkim-signature:dkim-signature:dkim-signature; bh=07VC9oW8YY9e+MYe9WKYks2k32K7dJl9f16yty0jqkE=; fh=UWlByhJXNGJKzcJ5WmyoA1tw5ugXp4S86SRVYqcTfsM=; b=NKfUN3eG+B/ujG7ojvHUyLsKqkKY71RgLAT8rtGJSU3B2bGyf8DTZeTDvTa/AQDQ6Y 7vOfpgHmZM/Jsan+HcyoOzLGk2wi8rg7Mmc2CHEPg7zE0G2EVHtP7UqeQDiooZGC+UBN BobCNouVsk7b0vv6ULWqiZsWTt+mUt4pfKMaApxnnDbTuhn559uMkJvjnEGKjdV9yjW4 96NkI2aUa04HG7Fj+DCbieYW9JPw8f06vDbqUXhTamHwkepKet9DqBbBpN6Sw/W3N6CJ YH/f0K4JnsEd0U0hBlR7jqokFyKH9uplzzIy3bcq/jobh0uT45ndJagHgfIziaF4B9c/ Mt8w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QEVncqMo; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=TzU7pCTJ; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=R2wjlzbm; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a1a585f51dsi5918225ab.164.2024.09.24.06.27.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2024 06:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QEVncqMo; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=TzU7pCTJ; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=R2wjlzbm; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1st5ZN-00040P-PL; Tue, 24 Sep 2024 13:27:10 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1st5ZM-00040H-Ig for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 13:27:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E2KrW1sArphcisKx7MTz7aoMS6RHY81UqlMnNpaJrNg=; b=QEVncqMoua7MJoyLOp0iZ09v0M wzQzGucq3GCDkqyhaXYKqldGPotTzX/ss5o2jj8FuzXwd/6UQ3Q4iEQDD0LlGUjFX6zUfTncwpjXe C8UnFLhHcXPn26iTSPy+BDzBm9D4xSgWvYagN+xPrwFH9PsCujPr24djIhi+VDQB4mNU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version:Sender:Reply-To :Cc:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=E2KrW1sArphcisKx7MTz7aoMS6RHY81UqlMnNpaJrNg=; b=T zU7pCTJMvvHxNGsZLOqlCiEbIEoq3T3BQBNswXP1doCv5YzYnH6TjFGgnNPtUnFqc5li5Kt7onIPO U/enaGPTsemV9P8IgAxwXITkGdroh2x2N5v7VpzZ4TcoylaAJUecQxm/W7Bp5KdtFxAWVFKXtOm7o ac2fWQ9lfBe0jCP4=; Received: from mail-ed1-f45.google.com ([209.85.208.45]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1st5ZM-0002yH-EK for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 13:27:09 +0000 Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5c275491c61so7350113a12.0 for ; Tue, 24 Sep 2024 06:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727184416; x=1727789216; darn=lists.sourceforge.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=E2KrW1sArphcisKx7MTz7aoMS6RHY81UqlMnNpaJrNg=; b=R2wjlzbmz1OCvwTxFlqu5fTvPY8ciIjLRAbKQeHpkyc97cHX1x+UQjCZw8/0yDoKOm IfDIgUrbU1wB91/M9w/sSGxK84f7FsfDY8CUliOxTScluQEs/uqygtcAz9x7RcdGU4KM lzELBBkIybyJc0InvSOadz44M+gVRJJUFLZ5YsXC+9GC86D4QZdD1JN2ryq441/lZr1r 1QOxCA6y8FGEXsb9jvGrGRQP5zIDDQy/x+YAQlA4rfy5Oxye0ZgeffS0Nc49Ez9gF+GV RZlHzdMwaGIgXMm8L/FWbPs3doOrJhw18J6DGdxm51FA2lrpuEVvmDONyVltIJVUI3gZ PZTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727184416; x=1727789216; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=E2KrW1sArphcisKx7MTz7aoMS6RHY81UqlMnNpaJrNg=; b=QIg1x2RgFjBYFODCQeAJcUtyrcBLe7ISp7F4HSJMGNB+V+5gkcrsdhZ7h9ifli8Odk AjIdJzRXtOevmM19g7o9C1ZEkocavmZcDk+hJIz5DmGDB0FbsdGLf5rCkc5rHoc0nEZG TrXWog/HPamg9xxCJqbDs4x2eDUXsvOeK9PV8WfT9ms1oGgQnWgWtziyzLBq8WxSFSKj j1AJYcJoQF0CnqEsIcvJUopaMIzF61ZQ094uiFZJTD941fDVwdBWgaxhDxn5zygMXp44 Q+w57bujXlUeb6v7c7OlTzSzVUA2b7Nn33LYSiDnN8qWnw5EuuSw6hUM0up3fy8YU6dr L8JA== X-Gm-Message-State: AOJu0YyS8Ty0pwYfnoUC+gNtN5QcfvYZ7DW+As76ci5PsqLB6jivrkAO Vhb7taUSgwGw1p9SRD5dXnhShh4UW80k25AysWbTJGniGr95tsKfSsf8/WMJI9WGarRlbJ5QEZ1 qwWJnoK6wIXznRyCY01+JYf38sqtDkf/EDbU= X-Received: by 2002:a17:907:6089:b0:a90:c411:24f8 with SMTP id a640c23a62f3a-a90d55de4ffmr1782525366b.2.1727184416453; Tue, 24 Sep 2024 06:26:56 -0700 (PDT) MIME-Version: 1.0 From: Petr Portnov Date: Tue, 24 Sep 2024 16:26:44 +0300 Message-ID: To: openvpn-devel X-Spam-Score: -1.1 (-) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi there! Continuing the packaging of the latest OpenVPN-linux for NixOS, I would like to propose the following addition to the build system. What it does is it allows you to customize the installation paths for DBus and systemd services and adds the option to disable the generation of `openvpn3_statedir / 'configs'` directory (which is not [...] Content analysis details: (-1.1 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.45 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mrjarviscraft[at]gmail.com] -0.9 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.45 listed in wl.mailspike.net] 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1st5ZM-0002yH-EK Subject: [Openvpn-devel] [PATCH] Configurable installation directories X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1811084152892223018?= X-GMAIL-MSGID: =?utf-8?q?1811084152892223018?= Hi there! Continuing the packaging of the latest OpenVPN-linux for NixOS, I would like to propose the following addition to the build system. What it does is it allows you to customize the installation paths for DBus and systemd services and adds the option to disable the generation of `openvpn3_statedir / 'configs'` directory (which is not always desired, e.g. when the OS takes this responsibility). ~ Petr Portnov From 848cc46d05c203de393d75434a3f571d78687f50 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Sun, 22 Sep 2024 13:16:02 +0300 Subject: [PATCH] build: allow installation directories' customization This allows to configure the installation directories for systemd and D-Bus files. Signed-off-by: Petr Portnov --- distro/systemd/meson.build | 9 +++++++-- meson.build | 12 ++++++++++-- meson_options.txt | 12 ++++++++++++ src/configmgr/meson.build | 10 ++++++---- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/distro/systemd/meson.build b/distro/systemd/meson.build index 36d556c..9c636b6 100644 --- a/distro/systemd/meson.build +++ b/distro/systemd/meson.build @@ -15,12 +15,17 @@ systemd_cfg = configuration_data({ systemd_service_cfg = dependency('systemd') +systemd_system_unit_dir = get_option('systemd_system_unit_dir') +if systemd_system_unit_dir == '' + systemd_system_unit_dir = systemd_service_cfg.get_variable('systemdsystemunitdir') +endif + configure_file( input: 'openvpn3-autoload.service.in', output: 'openvpn3-autoload.service', configuration: systemd_cfg, install: true, - install_dir: systemd_service_cfg.get_variable('systemdsystemunitdir'), + install_dir: systemd_system_unit_dir, ) configure_file( @@ -28,7 +33,7 @@ configure_file( output: 'openvpn3-session@.service', configuration: systemd_cfg, install: true, - install_dir: systemd_service_cfg.get_variable('systemdsystemunitdir'), + install_dir: systemd_system_unit_dir, ) custom_target('openvpn3-systemd', diff --git a/meson.build b/meson.build index 586c72a..ba41440 100644 --- a/meson.build +++ b/meson.build @@ -203,8 +203,16 @@ message('OpenVPN 3 Linux service binary directory: ' + get_option('prefix') / li # # D-Bus configuration -dbus_policy_dir = dep_dbus.get_variable('datadir') / 'dbus-1' / 'system.d' -dbus_service_dir = dep_dbus.get_variable('system_bus_services_dir') +dbus_policy_dir = get_option('dbus_policy_dir') +if dbus_policy_dir == '' + dbus_policy_dir = dep_dbus.get_variable('datadir') / 'dbus-1' / 'system.d' +endif + +dbus_service_dir = get_option('dbus_system_service_dir') +if dbus_service_dir == '' + dbus_service_dir = dep_dbus.get_variable('system_bus_services_dir') +endif + dbus_config = { 'OPENVPN_USERNAME': get_option('openvpn_username'), 'LIBEXEC_PATH': get_option('prefix') / libexec_dir, diff --git a/meson_options.txt b/meson_options.txt index 43e301e..04809df 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -93,6 +93,18 @@ option('use-legacy-polkit-pkla', type: 'feature', value: 'disabled', option('polkit_pkla_rulesdir', type: 'string', value: '', description: 'Override PolicyKit PKLA rules directory') +# +# Installation +# +option('dbus_policy_dir', type: 'string', + description: 'D-Bus policy directory') +option('dbus_system_service_dir', type: 'string', + description: 'D-Bus system service directory') +option('systemd_system_unit_dir', type: 'string', + description: 'Path to systemd system unit directory') +option('create_statedir', type: 'feature', value: 'enabled', + description: 'Create directory for OpenVPN 3 state during install phase') + # # Testing tools # diff --git a/src/configmgr/meson.build b/src/configmgr/meson.build index 5d0a649..6f788b7 100644 --- a/src/configmgr/meson.build +++ b/src/configmgr/meson.build @@ -52,7 +52,9 @@ configure_file( install_dir: dbus_service_dir, ) -# Create the configs directory for persistent configuration profiles -# NOTE: Can be replaced with install_emptydir() when Meson 0.60 or newer -# is available on all supported distros -meson.add_install_script('sh','-c', 'mkdir -p $DESTDIR@0@'.format(openvpn3_statedir / 'configs')) +if get_option('create_statedir').enabled() + # Create the configs directory for persistent configuration profiles + # NOTE: Can be replaced with install_emptydir() when Meson 0.60 or newer + # is available on all supported distros + meson.add_install_script('sh','-c', 'mkdir -p $DESTDIR@0@'.format(openvpn3_statedir / 'configs')) +endif -- 2.45.2