From patchwork Fri Apr 19 21:32:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1925738 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLntJ6gkzz1yZP for ; Sat, 20 Apr 2024 07:32:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2D84941ABD; Fri, 19 Apr 2024 21:32:37 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Vr2tgRSNi6tD; Fri, 19 Apr 2024 21:32:36 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 71A5041ACC Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 71A5041ACC; Fri, 19 Apr 2024 21:32:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 945511BF977 for ; Fri, 19 Apr 2024 21:32:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 809BF41E57 for ; Fri, 19 Apr 2024 21:32:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gdwL8ziRsDoD for ; Fri, 19 Apr 2024 21:32:29 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::531; helo=mail-ed1-x531.google.com; envelope-from=angelo.compagnucci@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 6438041E56 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6438041E56 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6438041E56 for ; Fri, 19 Apr 2024 21:32:29 +0000 (UTC) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-56e477db7fbso4147108a12.3 for ; Fri, 19 Apr 2024 14:32:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713562347; x=1714167147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/YtdkjfRUgKDB5qjpyxdfO9xycZqVJyyELhdSf1/KVo=; b=RLQWCHcrXNmpvfEy1ayxlPsBxIuSalFvKD1TOBld6MLStZDREXx7JpOU4qDEqNh6Cg lyvCZjc8IYU4OZvl0malwBVXY/F089VUfIHoaS27iq5fvB/rVf0BqLkMv2DLDfW+KzvM tsxUeDOSDyJwA7xz9dSJX1pVWADxarBZtlphbG1exPRhH64NFDsaHutXg67ekPg9I77I mUX/6LwUInqwa4IMSDV11bWZhHSU5sx3bGtpjLXFLm43SeOJZz/LwivxCKC0Rcpldvz7 fNs79XrZAkqrDMlwtauj9w7wJvIfOJP2ZWqdAGdvutcKWC4zbyYk1yvMA2SqmIqgaZ7E M5Tw== X-Gm-Message-State: AOJu0YzI5p1KzzrEAucxUsJzTILAeFrvbbjoIyDY5NC40medqf6A3P8z gPH0MndUdC2602dXVfMSxMkH9k+cilWvGgKc0wCvy8MdEpl4G2AZuBNTBw== X-Google-Smtp-Source: AGHT+IHEo20j3cSQhX7ouFmeEqArz0OB8pCYA8JBXe0OgXHH6vBu9G3CA2h2YCmAnAbZfT4JcHV3Cg== X-Received: by 2002:a05:6402:2695:b0:571:e17e:3208 with SMTP id w21-20020a056402269500b00571e17e3208mr1215658edd.3.1713562346747; Fri, 19 Apr 2024 14:32:26 -0700 (PDT) Received: from localhost.localdomain ([212.22.152.70]) by smtp.gmail.com with ESMTPSA id h25-20020a0564020e9900b0056bc0c44f02sm2529297eda.96.2024.04.19.14.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:32:25 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Fri, 19 Apr 2024 23:32:15 +0200 Message-Id: <20240419213216.518041-2-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419213216.518041-1-angelo.compagnucci@gmail.com> References: <20240419213216.518041-1-angelo.compagnucci@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713562347; x=1714167147; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/YtdkjfRUgKDB5qjpyxdfO9xycZqVJyyELhdSf1/KVo=; b=FuQsY1m/ukNU2nP36RfAsAb4J+WjhrZB9c1SKRfXHocFaK9CedvhWfsn+F+ngQ+vyJ L6ErliXCEX59T4VPNOJLK9Ly+myQdidKJCZvxSWuI4YyuQMV7ZK8QE0FuwZCeSr2ygLt cLPdNPx9Te+tcwrLQwB7ISuPrHSy2nnP9sCS+ceACv8wyeBAYk/xbDY9lUOHZZPNY6To PAMEODwJuGi5f+uOIhLvjD0X9MFflXODU5B3BgpKy4pSIlldiF4sMRbT+7wcG93MxzAV EY3A77JU/gRcHm45E1abzqI28zlFlosUuXj9aJd7MME8wxez2S9WZH3vpSe9mt4hfkiP /4sw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=FuQsY1m/ Subject: [Buildroot] [PATCH 1/2] package/fail2ban: fix data_files installation path X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" When packaging data_files in a wheel, those files shall have the destination path expressed as relative to the wheel installation. The reason for that is the wheel installation shall be contained inside a specific folder and/or in site-packages. When building the wheel file by the bdist_wheel command, python will package files with absolute pats as python files ending up installing them in site-packages. Fixes: http://autobuild.buildroot.net/results/36ac5278d19195a21c3d02d087965e08f49228ef Signed-off-by: Angelo Compagnucci Tested-by: Fiona Klute --- ...001-setup.py-fix-data-relative-paths.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 package/fail2ban/0001-setup.py-fix-data-relative-paths.patch diff --git a/package/fail2ban/0001-setup.py-fix-data-relative-paths.patch b/package/fail2ban/0001-setup.py-fix-data-relative-paths.patch new file mode 100644 index 0000000000..e1b5bc490b --- /dev/null +++ b/package/fail2ban/0001-setup.py-fix-data-relative-paths.patch @@ -0,0 +1,73 @@ +From 7b7fa3c02d4575c09362336bc310835c37859f1a Mon Sep 17 00:00:00 2001 +From: Angelo Compagnucci +Date: Fri, 19 Apr 2024 22:47:20 +0200 +Subject: [PATCH] setup.py: fix data relative paths +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As per distutils documentation: + +The directory should be a relative path. It is interpreted relative to the +installation prefix (Python’s sys.prefix for system installations; +site.USER_BASE for user installations). Distutils allows directory to be an +absolute installation path, but this is discouraged since it is incompatible +with the wheel packaging format [1]. + +When packaging to a bdist_wheel indeed, the files in the "data_files" dictionary +are not picked at all as data files if they have an absolute path, +but they are instead added to the wheel as python files. +This has the effect of installing them as part of python files in the +site-packages folder when the wheel is installed. + +This patch cannot be sent upstream because it breaks the legacy way of +installing the package with *python setup.py install* and it is needed only to +comply with the pep517 buildroot compatibility layer. + +[1] https://docs.python.org/3.10/distutils/setupscript.html#installing-additional-files +Signed-off-by: Angelo Compagnucci +--- + setup.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/setup.py b/setup.py +index 91f71cf2..99ba2e32 100755 +--- a/setup.py ++++ b/setup.py +@@ -238,26 +238,26 @@ setup( + for f in w[2]] + } if with_tests else {}, + data_files = [ +- ('/etc/fail2ban', ++ ('etc/fail2ban', + glob("config/*.conf") + ), +- ('/etc/fail2ban/filter.d', ++ ('etc/fail2ban/filter.d', + glob("config/filter.d/*.conf") + ), +- ('/etc/fail2ban/filter.d/ignorecommands', ++ ('etc/fail2ban/filter.d/ignorecommands', + [p for p in glob("config/filter.d/ignorecommands/*") if isfile(p)] + ), +- ('/etc/fail2ban/action.d', ++ ('etc/fail2ban/action.d', + glob("config/action.d/*.conf") + + glob("config/action.d/*.py") + ), +- ('/etc/fail2ban/fail2ban.d', ++ ('etc/fail2ban/fail2ban.d', + '' + ), +- ('/etc/fail2ban/jail.d', ++ ('etc/fail2ban/jail.d', + '' + ), +- ('/var/lib/fail2ban', ++ ('var/lib/fail2ban', + '' + ), + ] + data_files_extra, +-- +2.34.1 + From patchwork Fri Apr 19 21:32:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1925739 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLntM4JCTz1yZP for ; Sat, 20 Apr 2024 07:32:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2756341AB2; Fri, 19 Apr 2024 21:32:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IxoNvO7ge_zn; Fri, 19 Apr 2024 21:32:39 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1021B41AEF Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 1021B41AEF; Fri, 19 Apr 2024 21:32:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1AA0D1BF977 for ; Fri, 19 Apr 2024 21:32:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 14A4C60A42 for ; Fri, 19 Apr 2024 21:32:33 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CUb91qpG0gUH for ; Fri, 19 Apr 2024 21:32:31 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::236; helo=mail-lj1-x236.google.com; envelope-from=angelo.compagnucci@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 973A860737 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 973A860737 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by smtp3.osuosl.org (Postfix) with ESMTPS id 973A860737 for ; Fri, 19 Apr 2024 21:32:31 +0000 (UTC) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2d6ff0422a2so31630581fa.2 for ; Fri, 19 Apr 2024 14:32:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713562349; x=1714167149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bsp11k5RSBwND3eBlBT3u+QMzN+e8MVAwtez1k43L0M=; b=B2jyHiyGsfqTNxg9oNLts2ZFFLykP/J0P9pcDJqDgu8ilIgAfj0WFt17JC+jVcyTus FlbYZwcuCHB/J5rS8OW7bzew4AsI7ru4CaFo7j7igOMUPWHJ+S08/PcoOftWUpQnbgfD ncmZkMtinbFfLKPg0jACo78B63LWczD3NWm5axl7gQe874WhLmN+v0DVstEZ1hJoZdHy US51jnwBDGGVGRmu6wvYfsAqQB8IYX85aXEgm2ZepXFf7oXVCikVakJb8v2u4ZyX0swD 98I0BEDU2tMIeu6I5WgiM5Rn3KHJczbV3YBezSatxePqr1PrRsbJJNSx8/rr9RbxRVZ4 tPIA== X-Gm-Message-State: AOJu0Ywnyl+s0PQ2IlMV4JfNL1fa4CFQgCuU1lpgIeTbmuyEESwPGu1Z XnGMFTLgFeMPW1BqRQKiBrgz40sRPxX/yc/o8R4jfThwhEv95py4MgdxaA== X-Google-Smtp-Source: AGHT+IGWVUY7EaNDuaQH4L6DSlWRpz9F7YLjITow+Y8CXgrjc7+BduruNK8InPwQqKRK/a0GqKV7HQ== X-Received: by 2002:a2e:a419:0:b0:2d8:144e:c464 with SMTP id p25-20020a2ea419000000b002d8144ec464mr2318076ljn.36.1713562348561; Fri, 19 Apr 2024 14:32:28 -0700 (PDT) Received: from localhost.localdomain ([212.22.152.70]) by smtp.gmail.com with ESMTPSA id h25-20020a0564020e9900b0056bc0c44f02sm2529297eda.96.2024.04.19.14.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:32:27 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Fri, 19 Apr 2024 23:32:16 +0200 Message-Id: <20240419213216.518041-3-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419213216.518041-1-angelo.compagnucci@gmail.com> References: <20240419213216.518041-1-angelo.compagnucci@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713562349; x=1714167149; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bsp11k5RSBwND3eBlBT3u+QMzN+e8MVAwtez1k43L0M=; b=LF65kQE1QKcjpohTVOk6T35Ooyi+kbE8YBHGJjVRLerQKiCb5UbMUum1upS6sWB3bm waBLrVFutPUG1zk/Qb4G7xZbULCvbyoV3p3B1QiGSS6UQxKZvt0V+YtHHSP95tOuzYmP mTiIyrJuFRrUHFtx8tSMnxqrWKqA1xJZux5NqfZep/zCI8TMvLjPKQGESOrqg4P2msFQ Jx7IvAqDeAjTw+HQUwnUVZZ442sxoCnXhrZ8H0r1XcX2Uq11UkDNpWYTrYwQKT9JRL3H +Hovn0ZE/7iIFgGDOIulw4d25N+nZCZMZBdy4pegT7QJDOEQHWgViJhC2AVOR7AQByIo iZxA== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=LF65kQE1 Subject: [Buildroot] [PATCH 2/2] package/pkg-python: fix pep517 data files installation X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" When installing a wheel in pep517 compatibility mode, the pyinstaller.py is invoked with the --data parameter which point to the directory in which data files should be installed. Actually the --data parameter points to the /usr subdirectory which is indeed wrong cause it shall point to the root directory where the wheel will be installed. This fixes the problem of having configuration files installed in /usr/etc instead of /etc. Fixes: http://autobuild.buildroot.net/results/36ac5278d19195a21c3d02d087965e08f49228ef Signed-off-by: Angelo Compagnucci Tested-by: Fiona Klute --- package/pkg-python.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index 839f728e2f..4f9bee4b90 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -70,7 +70,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --scripts=$(TARGET_DIR)/usr/bin \ - --data=$(TARGET_DIR)/usr + --data=$(TARGET_DIR) PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ $(TOPDIR)/support/scripts/pyinstaller.py \ @@ -79,7 +79,7 @@ PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --scripts=$(STAGING_DIR)/usr/bin \ - --data=$(STAGING_DIR)/usr + --data=$(STAGING_DIR) PKG_PYTHON_PEP517_DEPENDENCIES = \ host-python-pypa-build \