public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Vincent Mihalkovic <vmihalko@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/file] f45: Fix file 5.48 regressions and modernize Python bindings
Date: Mon, 31 Aug 2026 19:42:24 GMT [thread overview]
Message-ID: <178820534434.1.2638766139335418760.rpms-file-d92e0521fbd4@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/file
Branch : f45
Commit : d92e0521fbd4f9998a651a5b275481d07ac2757d
Author : Vincent Mihalkovic <vmihalko@redhat.com>
Date : 2026-08-31T14:23:45+02:00
Stats : +50/-61 in 8 file(s)
URL : https://src.fedoraproject.org/rpms/file/c/d92e0521fbd4f9998a651a5b275481d07ac2757d?branch=f45
Log:
Fix file 5.48 regressions and modernize Python bindings
- Backport the upstream Landlock decompressor fix
- Migrate Python 3 bindings to pyproject macros
- Drop unused Python 2 packaging
- Update test expectations for file 5.48
Resolves: rhbz#2513643
Resolves: rhbz#2427330
Resolves: rhbz#2378541
---
diff --git a/file-5.49-landlock-execute.patch b/file-5.49-landlock-execute.patch
new file mode 100644
index 0000000..9851e47
--- /dev/null
+++ b/file-5.49-landlock-execute.patch
@@ -0,0 +1,20 @@
+From: Christos Zoulas <christos@zoulas.com>
+Date: Thu, 27 Aug 2026 17:37:15 +0000
+Subject: PR/785: hexa: Disable execute restrictions for now. On NixOS and Fedora this breaks executing binaries like bzip2
+
+# Backport of upstream commit dcf3495219a0ccae60f10c00e6b16696c6fe3977
+# https://github.com/file/file/commit/dcf3495219a0ccae60f10c00e6b16696c6fe3977
+diff --git a/src/landlock.c b/src/landlock.c
+index 15b01d19..3136724f 100644
+--- a/src/landlock.c
++++ b/src/landlock.c
+@@ -108,7 +108,9 @@ enable_landlock(int flags, int action)
+
+ (void)memset(&attr, 0, sizeof(attr));
+ attr.handled_access_fs =
++#if 0
+ LANDLOCK_ACCESS_FS_EXECUTE |
++#endif
+ LANDLOCK_ACCESS_FS_WRITE_FILE |
+ LANDLOCK_ACCESS_FS_READ_FILE |
+ LANDLOCK_ACCESS_FS_READ_DIR |
diff --git a/file.spec b/file.spec
index ea8debc..41ebaaf 100644
--- a/file.spec
+++ b/file.spec
@@ -5,17 +5,10 @@
%bcond_with python3
%endif
-# python2 is not available on RHEL > 7
-%if 0%{?fedora} > 31 || 0%{?rhel} > 7
-%bcond_with python2
-%else
-%bcond_without python2
-%endif
-
Summary: Utility for determining file types
Name: file
Version: 5.48
-Release: 2%{?dist}
+Release: 3%{?dist}
# Main license is BSD-2-Clause-Darwin
# Shipped exceptions:
@@ -48,6 +41,10 @@ Patch3: file-5.45-readelf-limit-revert.patch
Patch4: file-5.46-fix-tests-rpm-magic.patch
+# Disable Landlock execute restrictions so external decompressors can run
+# Upstream: https://github.com/file/file/commit/dcf3495219a0ccae60f10c00e6b16696c6fe3977
+Patch5: file-5.49-landlock-execute.patch
+
URL: https://www.darwinsys.com/file/
Requires: file-libs%{?_isa} = %{version}-%{release}
BuildRequires: zlib-devel
@@ -85,26 +82,10 @@ Requires: file-devel = %{version}-%{release}
%description static
The file-static package contains the static version of the libmagic library.
-%if %{with python2}
-%package -n python2-magic
-Summary: Python 2 bindings for the libmagic API
-BuildRequires: python2-devel
-BuildRequires: python2-setuptools
-BuildArch: noarch
-Requires: file-libs = %{version}-%{release}
-%{?python_provide:%python_provide python2-magic}
-
-%description -n python2-magic
-This package contains the Python 2 bindings to allow access to the
-libmagic API. The libmagic library is also used by the familiar
-file(1) command.
-%endif
-
%if %{with python3}
%package -n python3-file-magic
Summary: Python 3 bindings for the libmagic API
BuildRequires: python3-devel
-BuildRequires: python3-setuptools
BuildArch: noarch
Requires: file-libs = %{version}-%{release}
Conflicts: python3-magic
@@ -123,9 +104,11 @@ iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
touch -r doc/libmagic.man doc/libmagic.man_
mv doc/libmagic.man_ doc/libmagic.man
+%generate_buildrequires
%if %{with python3}
-rm -rf %{py3dir}
-cp -a python %{py3dir}
+cd python
+%pyproject_buildrequires
+cd ..
%endif
%build
@@ -139,13 +122,10 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
export LD_LIBRARY_PATH=$PWD/src/.libs
%make_build
-%if %{with python2}
-cd python
-CFLAGS="%{optflags}" %{__python2} setup.py build
-%endif
%if %{with python3}
-cd %{py3dir}
-CFLAGS="%{optflags}" %{__python3} setup.py build
+cd python
+%pyproject_wheel
+cd ..
%endif
%install
@@ -166,13 +146,11 @@ cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
-%if %{with python2}
-cd python
-%{__python2} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
-%endif
%if %{with python3}
-cd %{py3dir}
-%{__python3} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
+cd python
+%pyproject_install
+%pyproject_save_files magic
+cd ..
%endif
%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
@@ -214,28 +192,19 @@ make -C tests check
%files static
%{_libdir}/libmagic.a
-%if %{with python2}
-%files -n python2-magic
-%license COPYING
-%doc python/README.md python/example.py
-%{python2_sitelib}/magic.py
-%{python2_sitelib}/magic.pyc
-%{python2_sitelib}/magic.pyo
-%if 0%{?fedora} || 0%{?rhel} >= 6
-%{python2_sitelib}/*egg-info
-%endif
-%endif
-
%if %{with python3}
-%files -n python3-file-magic
-%license COPYING
+%files -n python3-file-magic -f %{pyproject_files}
%doc python/README.md python/example.py
-%{python3_sitelib}/magic.py
-%{python3_sitelib}/*egg-info
-%{python3_sitelib}/__pycache__/*
%endif
%changelog
+* Mon Aug 31 2026 Vincent Mihalkovic <vmihalko@redhat.com> - 5.48-3
+- Allow external decompressors to execute under Landlock
+- Migrate Python bindings to pyproject macros
+ Resolves: rhbz#2513643
+ Resolves: rhbz#2427330
+ Resolves: rhbz#2378541
+
* Wed Jul 15 2026 Fedora Release Engineering <releng@fedoraproject.org> - 5.48-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
diff --git a/tests/file-tests/reference/ins/internet_connection_settings.ins.ref b/tests/file-tests/reference/ins/internet_connection_settings.ins.ref
index 97886b6..6f505ff 100644
--- a/tests/file-tests/reference/ins/internet_connection_settings.ins.ref
+++ b/tests/file-tests/reference/ins/internet_connection_settings.ins.ref
@@ -1 +1 @@
-Generic INItialization configuration [Phone]
+ASCII text
diff --git a/tests/file-tests/reference/isp/self-created.isp.ref b/tests/file-tests/reference/isp/self-created.isp.ref
index 7034b45..6f505ff 100644
--- a/tests/file-tests/reference/isp/self-created.isp.ref
+++ b/tests/file-tests/reference/isp/self-created.isp.ref
@@ -1 +1 @@
-Generic INItialization configuration [Connection]
+ASCII text
diff --git a/tests/file-tests/reference/msi/SampleFirst_full.msi.ref b/tests/file-tests/reference/msi/SampleFirst_full.msi.ref
index faad2e8..42db532 100644
--- a/tests/file-tests/reference/msi/SampleFirst_full.msi.ref
+++ b/tests/file-tests/reference/msi/SampleFirst_full.msi.ref
@@ -1 +1 @@
-Composite Document File V2 Document, Little Endian, Os: Windows, Version 5.1, MSI Installer, Code page: 1252, Title: Installation Database, Subject: Acme's Foobar 1.0 Installer, Author: file-test creator, Keywords: Installer, Comments: created following http://wix.tramontana.co.hu/tutorial, Template: Intel;1033, Revision Number: {F6B1C691-4136-4489-AD6A-DFE142735E4B}, Create Time/Date: Mon Mar 24 11:00:28 2014, Last Saved Time/Date: Mon Mar 24 11:00:28 2014, Number of Pages: 100, Number of Words: 2, Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0), Security: 2
+Composite Document File V2 Document, Little Endian, Os: Windows, Version 5.1, Microsoft Installer, Code page: 1252, Title: Installation Database, Subject: Acme's Foobar 1.0 Installer, Author: file-test creator, Keywords: Installer, Comments: created following http://wix.tramontana.co.hu/tutorial, Template: Intel;1033, Revision Number: {F6B1C691-4136-4489-AD6A-DFE142735E4B}, Create Time/Date: Mon Mar 24 11:00:28 2014, Last Saved Time/Date: Mon Mar 24 11:00:28 2014, Number of Pages: 100, Number of Words: 2, Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0), Security: 2
diff --git a/tests/file-tests/reference/ttf/NanumGothic.ttf.ref b/tests/file-tests/reference/ttf/NanumGothic.ttf.ref
index c8dff04..7fe5183 100644
--- a/tests/file-tests/reference/ttf/NanumGothic.ttf.ref
+++ b/tests/file-tests/reference/ttf/NanumGothic.ttf.ref
@@ -1 +1 @@
-TrueType Font data, 15 tables, 1st "OS/2", name offset 0x424104
+TrueType Font data, 15 tables (FontKit), 1st "OS/2", name offset 0x424104
diff --git a/tests/file-tests/reference/txt/dsn_15.txt.ref b/tests/file-tests/reference/txt/dsn_15.txt.ref
index 7f7bc56..d92a7fa 100644
--- a/tests/file-tests/reference/txt/dsn_15.txt.ref
+++ b/tests/file-tests/reference/txt/dsn_15.txt.ref
@@ -1 +1 @@
-RFC 822 mail, ASCII text
+RFC 822 mail text
diff --git a/tests/file-tests/reference/wsh/HelloWorld.wsh.ref b/tests/file-tests/reference/wsh/HelloWorld.wsh.ref
index 44ddc8e..6f505ff 100644
--- a/tests/file-tests/reference/wsh/HelloWorld.wsh.ref
+++ b/tests/file-tests/reference/wsh/HelloWorld.wsh.ref
@@ -1 +1 @@
-Generic INItialization configuration [Options]
+ASCII text
reply other threads:[~2026-08-31 19:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178820534434.1.2638766139335418760.rpms-file-d92e0521fbd4@fedoraproject.org \
--to=vmihalko@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox