1 |
%define major 1 |
2 |
%define libname %mklibname magic %{major} |
3 |
%define develname %mklibname -d magic |
4 |
%define staticname %mklibname -d -s magic |
5 |
|
6 |
|
7 |
Summary: A utility for determining file types |
8 |
Name: file |
9 |
Version: 5.12 |
10 |
%define subrel 8 |
11 |
Release: %mkrel 8 |
12 |
License: BSD |
13 |
Group: File tools |
14 |
URL: http://www.darwinsys.com/file/ |
15 |
Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz |
16 |
Patch3: file-4.24-selinux.patch |
17 |
Patch4: file-5.04-oracle.patch |
18 |
Patch7: file-5.05-dump.patch |
19 |
Patch8: file-5.12-berkeleydb.patch |
20 |
Patch9: file-4.20-xen.patch |
21 |
Patch13: file-5.05-images.patch |
22 |
Patch14: file-4.20-apple.patch |
23 |
Patch24: file-5.10-sticky-bit.patch |
24 |
Patch25: file-5.12-assembler-1.patch |
25 |
Patch26: file-5.12-assembler-2.patch |
26 |
# from https://github.com/glensc/file/commit/b8bdbebce8a6b7b90d2c668413f21b3a1a699ad3 |
27 |
Patch27: file-5.12-elf-match.patch |
28 |
# from https://github.com/glensc/file/commit/4afb9b168906f117e32a11367761cd50fe9d4abe |
29 |
Patch28: file-5.12-limit-mget-recursion.patch |
30 |
# from https://github.com/glensc/file/commit/3c081560c23f20b2985c285338b52c7aae9fdb0f |
31 |
Patch29: file-5.12-prevent-infinite-recursion.patch |
32 |
# from https://github.com/glensc/file/commit/cc9e74dfeca5265ad725acc926ef0b8d2a18ee70 |
33 |
Patch30: file-5.12-count-indirect-recursion.patch |
34 |
# from https://github.com/file/file/commit/447558595a3650db2886cd2f416ad0beba965801 |
35 |
Patch31: file-5.12-CVE-2014-2270-1.patch |
36 |
# from https://github.com/file/file/commit/c0c0032b9e9eb57b91fefef905a3b018bab492d9 |
37 |
Patch32: file-5.12-leak_fix.patch |
38 |
# from https://github.com/file/file/commit/70c65d2e1841491f59168db1f905e8b14083fb1c |
39 |
Patch33: file-5.17-CVE-2014-2270-2.patch |
40 |
Patch34: file-5.14-CVE-2013-7345.patch |
41 |
Patch35: file-5.18-cdf.patch |
42 |
Patch36: file-5.16-cdf2.patch |
43 |
Patch37: file-5.16-pascal.patch |
44 |
Patch38: file-5.12-CVE-2014-3538.diff |
45 |
Patch39: file-5.19-CVE-2014-3587.patch |
46 |
Patch40: file-5.20-CVE-2014-3710.patch |
47 |
BuildRequires: zlib-devel |
48 |
BuildRequires: python-devel |
49 |
|
50 |
%description |
51 |
The file command is used to identify a particular file according to the |
52 |
type of data contained by the file. File can identify many different |
53 |
file types, including ELF binaries, system libraries, RPM packages, and |
54 |
different graphics formats. |
55 |
|
56 |
You should install the file package, since the file command is such a |
57 |
useful utility. |
58 |
|
59 |
%package -n %{libname} |
60 |
Group: System/Libraries |
61 |
Summary: Shared library for handling magic files |
62 |
|
63 |
%description -n %{libname} |
64 |
The file command is used to identify a particular file according to the |
65 |
type of data contained by the file. File can identify many different |
66 |
file types, including ELF binaries, system libraries, RPM packages, and |
67 |
different graphics formats. |
68 |
|
69 |
Libmagic is a library for handlig the so called magic files the 'file' |
70 |
command is based on. |
71 |
|
72 |
%package -n %{develname} |
73 |
Summary: Development files to build applications that handle magic files |
74 |
Group: Development/C |
75 |
Requires: %{libname} = %{version} |
76 |
Provides: libmagic-devel = %{version}-%{release} |
77 |
Provides: %{name}-devel = %{version}-%{release} |
78 |
Provides: magic-devel = %{version}-%{release} |
79 |
%define olddev %mklibname -d magic 1 |
80 |
%rename %{olddev} |
81 |
|
82 |
%description -n %{develname} |
83 |
The file command is used to identify a particular file according to the |
84 |
type of data contained by the file. File can identify many different |
85 |
file types, including ELF binaries, system libraries, RPM packages, and |
86 |
different graphics formats. |
87 |
|
88 |
Libmagic is a library for handlig the so called magic files the 'file' |
89 |
command is based on. |
90 |
|
91 |
%package -n %{staticname} |
92 |
Summary: Static library to build applications that handle magic files |
93 |
Group: Development/C |
94 |
Requires: %{develname} = %{version} |
95 |
Provides: libmagic-static-devel = %{version}-%{release} |
96 |
Provides: magic-static-devel = %{version}-%{release} |
97 |
%define oldstat %mklibname -s -d magic 1 |
98 |
%rename %{oldstat} |
99 |
|
100 |
%description -n %{staticname} |
101 |
The file command is used to identify a particular file according to the |
102 |
type of data contained by the file. File can identify many different |
103 |
file types, including ELF binaries, system libraries, RPM packages, and |
104 |
different graphics formats. |
105 |
|
106 |
Libmagic is a library for handlig the so called magic files the 'file' |
107 |
command is based on. |
108 |
|
109 |
%package -n python-magic |
110 |
Summary: Python module to use libmagic |
111 |
Group: Development/Python |
112 |
BuildArch: noarch |
113 |
Requires: %{name} >= %{version}-%{release} |
114 |
|
115 |
%description -n python-magic |
116 |
Libmagic is a library for handlig the so called magic files the 'file' |
117 |
command is based on. |
118 |
|
119 |
This package contains the python binding for libmagic. |
120 |
|
121 |
%prep |
122 |
%setup -q |
123 |
%patch3 -p1 -b .selinux~ |
124 |
%patch4 -p1 -b .oracle~ |
125 |
%patch7 -p1 -b .dump~ |
126 |
%patch8 -p1 -b .berkeley~ |
127 |
%patch9 -p1 -b .xen~ |
128 |
%patch13 -p1 -b .images~ |
129 |
%patch14 -p0 -b .apple~ |
130 |
%patch24 -p1 -b .sticky-bit~ |
131 |
%patch25 -p1 -b .assembler-1~ |
132 |
%patch26 -p1 -b .assembler-2~ |
133 |
%patch27 -p1 -b .elf-match |
134 |
%patch28 -p1 -b .mget-recursion~ |
135 |
%patch29 -p1 -b .infinite-recursion~ |
136 |
%patch30 -p1 -b .indirect-recursion~ |
137 |
%patch31 -p1 -b .CVE-2014-2270-1 |
138 |
%patch32 -p1 -b .leak_fix |
139 |
%patch33 -p1 -b .CVE-2014-2270-2 |
140 |
%patch34 -p1 -b .CVE-2013-7345 |
141 |
%patch35 -p1 -b .cdf |
142 |
%patch36 -p1 -b .cdf2 |
143 |
%patch37 -p1 -b .pascal |
144 |
%patch38 -p1 -b .CVE-2014-3538 |
145 |
%patch39 -p1 -b .CVE-2014-3587 |
146 |
%patch40 -p1 -b .CVE-2014-3710 |
147 |
|
148 |
#patch 3 |
149 |
autoreconf -fi |
150 |
|
151 |
%build |
152 |
CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \ |
153 |
%configure2_5x --enable-static |
154 |
%make |
155 |
|
156 |
cd python |
157 |
python setup.py build |
158 |
cd - |
159 |
|
160 |
%install |
161 |
rm -rf %{buildroot} |
162 |
|
163 |
%makeinstall_std |
164 |
|
165 |
# install one missing header file |
166 |
install -m644 src/file.h %{buildroot}%{_includedir}/file.h |
167 |
|
168 |
cd python |
169 |
python setup.py install --prefix=%{buildroot}%{_prefix} |
170 |
cd - |
171 |
|
172 |
%clean |
173 |
rm -rf %{buildroot} |
174 |
|
175 |
%files |
176 |
%doc README MAINT ChangeLog |
177 |
%{_bindir}/* |
178 |
%{_datadir}/misc/* |
179 |
%{_mandir}/man1/* |
180 |
%{_mandir}/man4/* |
181 |
|
182 |
%files -n %{libname} |
183 |
%{_libdir}/*.so.%{major}* |
184 |
|
185 |
%files -n %{develname} |
186 |
%{_libdir}/*.so |
187 |
%attr(644,root,root) %{_libdir}/*.la |
188 |
%{_includedir}/* |
189 |
%{_mandir}/man3/* |
190 |
|
191 |
%files -n %{staticname} |
192 |
%{_libdir}/*.a |
193 |
|
194 |
%files -n python-magic |
195 |
%doc python/README python/example.py |
196 |
%{py_puresitedir}/* |