fix #891856 - update to file-5.14
- fix #909754 - magic number for Python-3.3 - fix #912271 - do not report dwarf debug info packages as 'stripped' - fix #882321 - do not print 'unknown capability' for ELF capabilities for architectures which File does not support - fix #866000 - show proper build id for ELF binaries - fix #860139 - better dump file recognition on big endian architectures - remove file-static subpackage - move python-magic .py files to python_sitearch
This commit is contained in:
parent
6d3f070602
commit
a5b3f76c0e
@ -1,12 +1,12 @@
|
||||
diff --git a/magic/Magdir/rpm b/magic/Magdir/rpm
|
||||
index 4eb5556..fe22b3d 100644
|
||||
index 9a795f8..31db083 100644
|
||||
--- a/magic/Magdir/rpm
|
||||
+++ b/magic/Magdir/rpm
|
||||
@@ -28,6 +28,7 @@
|
||||
@@ -29,6 +29,7 @@
|
||||
>>8 beshort 17 SuperH
|
||||
>>8 beshort 18 Xtensa
|
||||
>>8 beshort 255 noarch
|
||||
+>>10 string x %s
|
||||
|
||||
#delta RPM Daniel Novotny (dnovotny@redhat.com)
|
||||
0 string drpm Delta RPM
|
||||
0 string drpm Delta RPM
|
||||
|
||||
@ -39,22 +39,3 @@ index 0665627..fdefa8c 100644
|
||||
|
||||
# C++
|
||||
# The strength of these rules is increased so they beat the C rules above
|
||||
diff --git a/magic/Magdir/perl b/magic/Magdir/perl
|
||||
index e11f2ab..b02b2c2 100644
|
||||
--- a/magic/Magdir/perl
|
||||
+++ b/magic/Magdir/perl
|
||||
@@ -28,10 +28,14 @@
|
||||
# check the first line
|
||||
0 search/1 package
|
||||
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
|
||||
+# to be tried before C source
|
||||
+!:strength + 5
|
||||
# not 'p', check other lines
|
||||
0 search/1 !p
|
||||
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
|
||||
>>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
|
||||
+# to be tried before C source
|
||||
+!:strength + 40
|
||||
|
||||
|
||||
|
||||
|
||||
14
file-5.14-perl.patch
Normal file
14
file-5.14-perl.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff --git a/magic/Magdir/perl b/magic/Magdir/perl
|
||||
index 1d7bd31..94536e2 100644
|
||||
--- a/magic/Magdir/perl
|
||||
+++ b/magic/Magdir/perl
|
||||
@@ -33,7 +33,8 @@
|
||||
0 search/1 !p
|
||||
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
|
||||
>>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
|
||||
-!:strength + 10
|
||||
+# Originally 12, we want at least 50
|
||||
+!:strength + 50
|
||||
|
||||
# Perl POD documents
|
||||
# From: Tom Hukins <tom@eborcom.com>
|
||||
22
file-5.14-x86boot.patch
Normal file
22
file-5.14-x86boot.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff --git a/magic/Magdir/filesystems b/magic/Magdir/filesystems
|
||||
index 3323593..0f28d7b 100644
|
||||
--- a/magic/Magdir/filesystems
|
||||
+++ b/magic/Magdir/filesystems
|
||||
@@ -62,7 +62,7 @@
|
||||
30 search/481 \x55\xAA
|
||||
# to display x86 boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111)
|
||||
# DOS BPB information (70) and after DOS floppy (120) like in previous file version
|
||||
-!:strength +72
|
||||
+!:strength +0
|
||||
# for sector sizes < 512 Bytes
|
||||
>11 uleshort <512
|
||||
>>(11.s-2) uleshort 0xAA55 x86 boot sector
|
||||
@@ -1176,7 +1176,7 @@
|
||||
>11 uleshort&0xf001f 0
|
||||
>>11 uleshort <32769
|
||||
>>>11 uleshort >31
|
||||
->>>>21 ubyte&0xf0 0xF0
|
||||
+>>>>21 ubyte&0xf0 0xF0 x86 boot sector
|
||||
>>>>>0 ubyte 0xEB
|
||||
>>>>>>1 ubyte x \b, code offset 0x%x+2
|
||||
>>>>>0 ubyte 0xE9
|
||||
@ -42,18 +42,18 @@ index 39b1703..3dd92d8 100644
|
||||
include_HEADERS = magic.h
|
||||
AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
|
||||
diff --git a/src/apprentice.c b/src/apprentice.c
|
||||
index b330669..0490642 100644
|
||||
index cd45bdc..83a2a37 100644
|
||||
--- a/src/apprentice.c
|
||||
+++ b/src/apprentice.c
|
||||
@@ -281,7 +281,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action,
|
||||
|
||||
@@ -419,7 +419,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action)
|
||||
#ifndef COMPILE_ONLY
|
||||
if ((rv = apprentice_map(ms, &magic, &nmagic, fn)) == -1) {
|
||||
map = apprentice_map(ms, fn);
|
||||
if (map == NULL) {
|
||||
- if (ms->flags & MAGIC_CHECK)
|
||||
+ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
|
||||
file_magwarn(ms, "using regular magic file `%s'", fn);
|
||||
rv = apprentice_load(ms, &magic, &nmagic, fn, action);
|
||||
if (rv != 0)
|
||||
map = apprentice_load(ms, fn, action);
|
||||
if (map == NULL)
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
73
file.spec
73
file.spec
@ -1,30 +1,23 @@
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||
%global __libtoolize :
|
||||
|
||||
Summary: A utility for determining file types
|
||||
Name: file
|
||||
Version: 5.11
|
||||
Release: 7%{?dist}
|
||||
Version: 5.14
|
||||
Release: 1%{?dist}
|
||||
License: BSD
|
||||
Group: Applications/File
|
||||
Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
|
||||
# Upstream says it's up to distributions to add a way to support local-magic.
|
||||
Patch0: file-localmagic.patch
|
||||
# sent upstream - should be included in next upstream release
|
||||
Patch1: file-tnef.patch
|
||||
Patch2: file-5.10-strength.patch
|
||||
Patch3: file-5.10-sticky-bit.patch
|
||||
Patch4: file-python-func.patch
|
||||
Patch5: file-qed-vdi-image.patch
|
||||
Patch6: file-5.11-ia64-swap.patch
|
||||
Patch7: file-4.17-rpm-name.patch
|
||||
Patch8: file-5.11-magicmgc-home.patch
|
||||
Patch9: file-5.11-compress.patch
|
||||
Patch10: file-5.11-dump-twice.patch
|
||||
Patch11: file-5.04-volume_key.patch
|
||||
Patch12: file-5.04-man-return-code.patch
|
||||
Patch13: file-5.04-generic-msdos.patch
|
||||
Patch1: file-5.10-strength.patch
|
||||
Patch2: file-5.10-sticky-bit.patch
|
||||
Patch3: file-4.17-rpm-name.patch
|
||||
Patch4: file-5.04-volume_key.patch
|
||||
Patch5: file-5.04-man-return-code.patch
|
||||
Patch6: file-5.04-generic-msdos.patch
|
||||
Patch7: file-5.14-x86boot.patch
|
||||
Patch8: file-5.14-perl.patch
|
||||
URL: http://www.darwinsys.com/file/
|
||||
Requires: file-libs = %{version}-%{release}
|
||||
BuildRequires: zlib-devel
|
||||
@ -53,15 +46,6 @@ Requires: %{name} = %{version}-%{release}
|
||||
The file-devel package contains the header files and libmagic library
|
||||
necessary for developing programs using libmagic.
|
||||
|
||||
%package static
|
||||
Summary: Static library for file development
|
||||
Group: Applications/File
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description static
|
||||
The file-static package contains the static version of
|
||||
the libmagic library.
|
||||
|
||||
%package -n python-magic
|
||||
Summary: Python bindings for the libmagic API
|
||||
Group: Development/Libraries
|
||||
@ -77,6 +61,7 @@ file(1) command.
|
||||
|
||||
# Don't use -b -- it will lead to poblems when compiling magic file!
|
||||
%setup -q
|
||||
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
@ -86,11 +71,6 @@ file(1) command.
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
|
||||
iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
|
||||
touch -r doc/libmagic.man doc/libmagic.man_
|
||||
@ -123,11 +103,13 @@ cp -a ./magic/magic.local ${RPM_BUILD_ROOT}%{_sysconfdir}/magic
|
||||
|
||||
cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
|
||||
ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
|
||||
#ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
|
||||
ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
|
||||
|
||||
cd python
|
||||
%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
|
||||
# We could use python_sitelib here, but Fedora does not support noarch
|
||||
# subpackages... So just create arch specific package and install
|
||||
# files to python_sitearch
|
||||
%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} --install-purelib %{python_sitearch}
|
||||
%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
|
||||
|
||||
%post libs -p /sbin/ldconfig
|
||||
@ -153,19 +135,30 @@ cd python
|
||||
%{_includedir}/magic.h
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%files static
|
||||
%{_libdir}/*.a
|
||||
|
||||
%files -n python-magic
|
||||
%doc python/README COPYING python/example.py
|
||||
%{python_sitelib}/magic.py
|
||||
%{python_sitelib}/magic.pyc
|
||||
%{python_sitelib}/magic.pyo
|
||||
# We could use python_sitelib here, but Fedora does not support noarch
|
||||
# subpackages... So just create arch specific package and install
|
||||
# files to python_sitearch
|
||||
%{python_sitearch}/magic.py
|
||||
%{python_sitearch}/magic.pyc
|
||||
%{python_sitearch}/magic.pyo
|
||||
%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6
|
||||
%{python_sitelib}/*egg-info
|
||||
%{python_sitearch}/*egg-info
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Mar 22 2013 Jan Kaluza <jkaluza@redhat.com> - 5.14-1
|
||||
- fix #891856 - update to file-5.14
|
||||
- fix #909754 - magic number for Python-3.3
|
||||
- fix #912271 - do not report dwarf debug info packages as 'stripped'
|
||||
- fix #882321 - do not print 'unknown capability' for ELF capabilities for
|
||||
architectures which File does not support
|
||||
- fix #866000 - show proper build id for ELF binaries
|
||||
- fix #860139 - better dump file recognition on big endian architectures
|
||||
- remove file-static subpackage
|
||||
- move python-magic .py files to python_sitearch
|
||||
|
||||
* Tue Dec 04 2012 Jan Kaluza <jkaluza@redhat.com> - 5.11-7
|
||||
- removed duplicated patterns for backups generated by "dump" tool
|
||||
- recognize volume_key escrow packets
|
||||
|
||||
Loading…
Reference in New Issue
Block a user