From patchwork Fri Apr 19 21:27:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1925725 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 4VLnmz6qGLz1yPJ for ; Sat, 20 Apr 2024 07:28:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B234241ACC; Fri, 19 Apr 2024 21:28:00 +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 j5qdvRBWe3SC; Fri, 19 Apr 2024 21:27:59 +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 8DFE541ACE Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 8DFE541ACE; Fri, 19 Apr 2024 21:27:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 755DD1BF977 for ; Fri, 19 Apr 2024 21:27:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6F74F8228F for ; Fri, 19 Apr 2024 21:27:56 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7zEm-aoQImGL for ; Fri, 19 Apr 2024 21:27:54 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::42a; helo=mail-wr1-x42a.google.com; envelope-from=angelo.compagnucci@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 2288D8220B DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2288D8220B Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2288D8220B for ; Fri, 19 Apr 2024 21:27:53 +0000 (UTC) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-346359c8785so1998519f8f.0 for ; Fri, 19 Apr 2024 14:27:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713562071; x=1714166871; 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=aELWl515npyjWEWt6U6j7bdKXD9uouxrLtny6bf6QaM=; b=kwPGAQ/lWOIcH1y3xO/nc/x6+KZ0mkNFZeALIfWTYlr/3En3ke0DlbE/DfjBHi4o5M 674PEmagQwlrsW8rZU8apsw2ExIYP9shVtM8fJ219aV0F0M3yKvpxRC/7gFmJYnVIvFn /+sll/eLiFrKxOVpH/bGv7pht8/dx0ppdGjnP9G2sQYr1dV4n+GPirmVrYbrXCvfjx0p r864jn1EIHZckNeYA5rfHBiGiATCrjFevGEZ+TNmLIqYxAXEyEO/RLX0GfQH6HPnP4Ix dQwXGRMu9lVEXyAtebwVsiNjpIylO7wpZfMFi5IY8rjf6kHFVw0Ck3CbCP6bUE+Z7I6l nimQ== X-Gm-Message-State: AOJu0YxRJ9spgHtMx0ukiyvh8AqInrmq5L5dr7g2joBuPlHxev1/nwuK FybgBmgY1QlCw/RLrmofy93KH0+MVDboe6BKAHFEViQuxZWzCJ8Gk7JRKA== X-Google-Smtp-Source: AGHT+IE9P0bbGbat4aoKysg9BW2GaOwPKgFDzJteLDcnshIU0+oFcK8HsHpDrif6YBoSw5bothZQWQ== X-Received: by 2002:a5d:4e0a:0:b0:346:4d41:8d24 with SMTP id p10-20020a5d4e0a000000b003464d418d24mr2057679wrt.0.1713562070949; Fri, 19 Apr 2024 14:27:50 -0700 (PDT) Received: from localhost.localdomain ([212.22.152.70]) by smtp.gmail.com with ESMTPSA id s8-20020a170906500800b00a4e24d259edsm2596766ejj.167.2024.04.19.14.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:27:49 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Fri, 19 Apr 2024 23:27:44 +0200 Message-Id: <20240419212745.512436-2-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419212745.512436-1-angelo.compagnucci@gmail.com> References: <20240419212745.512436-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=1713562071; x=1714166871; 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=aELWl515npyjWEWt6U6j7bdKXD9uouxrLtny6bf6QaM=; b=GFb3u48lyFZkSDMPuhNAuUPpb2trKIMpFMBzh1/aYvxdgPZe9XEPWnA1S8xzl/yvwa W1mWVZt9paM2uWcj/ltNBbIGWfRjLDWjvtjMJ7tHOLHxCCWnKjyCscH4jb9Z8ubS6ymP QAH+4ZEOR48WP+vleZQFz8dqzoyhAbo6rw4cCuYUH813cTXlhpqKvWCzxqMAhtPsbw8m SQmZ/wxoHHDmJRhLkcGOoIOl7p5m5955QKkACE0QUojIzlg72kCaA84WuicYqi3ZF2mU HDvY+JSMIrGZLPpS9erqRw1Tjwi+dfAchANYb20a/+2OtcG5iBfDF3O63ki1iH9GtSnR t/Sg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp1.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=GFb3u48l 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 , Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Angelo Compagnucci 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 --- ...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 +