[packages/file] Up to 4.47 (upstream url is dead now, so use alternative url)
arekm
arekm at pld-linux.org
Sun Apr 12 23:23:50 CEST 2026
commit 6a8d4b0f2d10f2b93c4a185811ab8508e8e0699b
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Apr 12 23:23:35 2026 +0200
Up to 4.47 (upstream url is dead now, so use alternative url)
file-python-magic-close-fix-whitespace.patch | 20 ++++++++++++++++++++
file.spec | 15 +++++++++++----
name-use-count.patch | 8 ++++----
3 files changed, 35 insertions(+), 8 deletions(-)
---
diff --git a/file.spec b/file.spec
index 4642764..27b4497 100644
--- a/file.spec
+++ b/file.spec
@@ -34,12 +34,13 @@ Summary(uk.UTF-8): Утиліта для визначення типів фай
Summary(zh_CN.UTF-8): 判定文件类型的工具。
Summary(zh_TW.UTF-8): 用於決定檔案類型的一個工具程式。
Name: file
-Version: 5.46
-Release: 2
+Version: 5.47
+Release: 1
License: distributable
Group: Applications/File
-Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
-# Source0-md5: 459da2d4b534801e2e2861611d823864
+#Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
+Source0: https://distfiles.macports.org/file/%{name}-%{version}.tar.gz
+# Source0-md5: 1023ef52a2fb64acdf80211e469d6939
Source1: http://ftp1.pld-linux.org/people/glen/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: 6a45bcaefd19b94db36a1b2b7c5b806b
Source2: %{name}-zisofs.magic
@@ -49,6 +50,7 @@ Patch0: searchpath.patch
Patch1: automake.patch
Patch2: %{name}-gettext-no-random-translations.patch
Patch3: name-use-count.patch
+Patch4: %{name}-python-magic-close-fix-whitespace.patch
URL: http://www.darwinsys.com/file/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
@@ -290,6 +292,7 @@ Wiązania Pythona 3 do biblioteki libmagic.
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
+%patch -P 4 -p1
%if "%{_ver_lt '%{cc_version}' '3.4'}" == "1"
%{__sed} -i -e 's,-Wextra,,' configure.ac
@@ -349,6 +352,8 @@ ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libmagic.so.*.*.*) \
cd python
%py_install
cd ..
+%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
+%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
%py_postclean
%endif
@@ -356,6 +361,8 @@ cd ..
cd py3
%py3_install
cd ..
+%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
%endif
awk -f %{SOURCE4} < $RPM_BUILD_ROOT%{_datadir}/misc/magic > $RPM_BUILD_ROOT%{_datadir}/misc/magic.mime
diff --git a/file-python-magic-close-fix-whitespace.patch b/file-python-magic-close-fix-whitespace.patch
new file mode 100644
index 0000000..01b805f
--- /dev/null
+++ b/file-python-magic-close-fix-whitespace.patch
@@ -0,0 +1,20 @@
+--- a/python/magic.py
++++ b/python/magic.py
+@@ -127,14 +127,14 @@
+ class Magic(object):
+ def __init__(self, ms):
+ self._magic_t = ms
+- self._close = _close
++ self._close = _close
+
+ def close(self):
+ """
+ Closes the magic database and deallocates any resources used.
+ """
+- if _close:
+- _close(self._magic_t)
++ if self._close:
++ self._close(self._magic_t)
+
+ @staticmethod
+ def __tostr(s):
diff --git a/name-use-count.patch b/name-use-count.patch
index 640fd67..b61aea5 100644
--- a/name-use-count.patch
+++ b/name-use-count.patch
@@ -1,10 +1,10 @@
---- file-5.39/src/file.h~ 2020-06-15 03:01:01.000000000 +0300
-+++ file-5.39/src/file.h 2020-06-21 14:52:44.027423622 +0300
-@@ -459,7 +459,7 @@
+--- file-5.47/src/file.h~ 2025-07-23 18:52:08.000000000 +0300 2025-09-02 22:52:18.000000000 +0200
++++ file-5.47/src/file.h 2026-04-12 23:13:56.169533185 +0200
+@@ -517,7 +517,7 @@
#define FILE_ELF_SHNUM_MAX 32768
#define FILE_ELF_SHSIZE_MAX (128 * 1024 * 1024)
#define FILE_INDIR_MAX 50
--#define FILE_NAME_MAX 100
+-#define FILE_NAME_MAX 150
+#define FILE_NAME_MAX 256
#define FILE_REGEX_MAX 8192
#define FILE_ENCODING_MAX (64 * 1024)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/file.git/commitdiff/6a8d4b0f2d10f2b93c4a185811ab8508e8e0699b
More information about the pld-cvs-commit
mailing list