1 | %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
---|
2 | %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} |
---|
3 | %define __libtoolize : |
---|
4 | |
---|
5 | Summary: A utility for determining file types. |
---|
6 | Summary(ja): ファイルの種類を判別するユーティリティー |
---|
7 | Name: file |
---|
8 | Version: 5.14 |
---|
9 | Release: 4%{?_dist_release} |
---|
10 | License: BSD |
---|
11 | Group: Applications/System |
---|
12 | Obsoletes: file-static |
---|
13 | |
---|
14 | Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz |
---|
15 | |
---|
16 | # Addtional magic file for Vine |
---|
17 | Source10: magic.printer-j |
---|
18 | |
---|
19 | # Upstream says it's up to distributions to add a way to support local-magic. |
---|
20 | Patch0: file-localmagic.patch |
---|
21 | # sent upstream - should be included in next upstream release |
---|
22 | Patch1: file-5.10-strength.patch |
---|
23 | Patch2: file-5.10-sticky-bit.patch |
---|
24 | Patch3: file-4.17-rpm-name.patch |
---|
25 | Patch4: file-5.04-volume_key.patch |
---|
26 | Patch5: file-5.04-man-return-code.patch |
---|
27 | Patch6: file-5.04-generic-msdos.patch |
---|
28 | Patch7: file-5.14-x86boot.patch |
---|
29 | Patch8: file-5.14-perl.patch |
---|
30 | Patch9: file-5.14-elfspace.patch |
---|
31 | Patch10: file-5.14-bad-fsmagic-space.patch |
---|
32 | Patch11: file-5.14-no-magic.patch |
---|
33 | Patch12: file-5.14-journald.patch |
---|
34 | Patch13: file-5.14-magic_load.patch |
---|
35 | |
---|
36 | #Vine |
---|
37 | Patch100: file-5.14-magicbuild-fix.patch |
---|
38 | Patch110: limit-repetitions-in-awk-detection.patch |
---|
39 | |
---|
40 | #Security |
---|
41 | Patch200: file-5.14_CVE-2014-1943.patch |
---|
42 | Patch210: file-5.14_CVE-2014-2270.patch |
---|
43 | Patch220: DSA-2873-1-regression.patch |
---|
44 | |
---|
45 | Buildroot: %{_tmppath}/%{name}-%{version}-root |
---|
46 | #BuildRequires: automake |
---|
47 | #BuildRequires: autoconf |
---|
48 | BuildRequires: zlib-devel |
---|
49 | |
---|
50 | Vendor: Project Vine |
---|
51 | Distribution: Vine Linux |
---|
52 | Packager: daisuke |
---|
53 | |
---|
54 | %description |
---|
55 | The file command is used to identify a particular file according to the |
---|
56 | type of data contained by the file. File can identify many different |
---|
57 | file types, including ELF binaries, system libraries, RPM packages, and |
---|
58 | different graphics formats. |
---|
59 | |
---|
60 | You should install the file package, since the file command is such a |
---|
61 | useful utility. |
---|
62 | |
---|
63 | %description -l ja |
---|
64 | file コマンドは、ファイルに含まれるデータの種類によって各ファイルが |
---|
65 | どのようなファイルかを判定するために使います。file は ELF バイナリ、シ |
---|
66 | ステムライブラリ、RPM パッケージ、そして様々なグラフィックフォーマット |
---|
67 | を含む、多くの異なるファイルの種類を見分けることができます。 |
---|
68 | |
---|
69 | |
---|
70 | %package devel |
---|
71 | Summary: Libraries and header files for file development |
---|
72 | Summary(ja): libmagic の開発用ファイル |
---|
73 | Group: Development/Libraries |
---|
74 | Requires: %{name} = %{version}-%{release} |
---|
75 | |
---|
76 | %description devel |
---|
77 | The file-devel package contains the header files and libmagic library |
---|
78 | necessary for developing programs using libmagic. |
---|
79 | |
---|
80 | %package -n python-magic |
---|
81 | Summary: Python bindings for the libmagic API |
---|
82 | Group: Development/Libraries |
---|
83 | BuildRequires: python-devel |
---|
84 | Requires: %{name} = %{version}-%{release} |
---|
85 | |
---|
86 | %description -n python-magic |
---|
87 | This package contains the Python bindings to allow access to the |
---|
88 | libmagic API. The libmagic library is also used by the familiar |
---|
89 | file(1) command. |
---|
90 | |
---|
91 | |
---|
92 | %prep |
---|
93 | %setup -q |
---|
94 | # Don't use -b -- it will lead to poblems when compiling magic file! |
---|
95 | %patch0 -p1 |
---|
96 | %patch1 -p1 |
---|
97 | %patch2 -p1 |
---|
98 | %patch3 -p1 |
---|
99 | %patch4 -p1 |
---|
100 | %patch5 -p1 |
---|
101 | %patch6 -p1 |
---|
102 | %patch7 -p1 |
---|
103 | %patch8 -p1 |
---|
104 | %patch9 -p1 |
---|
105 | %patch10 -p1 |
---|
106 | %patch11 -p1 |
---|
107 | %patch12 -p1 |
---|
108 | %patch13 -p1 |
---|
109 | |
---|
110 | #Vine |
---|
111 | %patch100 -p1 |
---|
112 | %patch110 -p1 -b .limit-repetitions-in-awk-detection |
---|
113 | |
---|
114 | #Security |
---|
115 | %patch200 -p1 -b .CVE-2014-1943 |
---|
116 | %patch210 -p1 -b .CVE-2014-2270 |
---|
117 | %patch220 -p1 -b .DSA-2873-1-regression |
---|
118 | |
---|
119 | cat %{SOURCE10} >> ./magic/Localstuff |
---|
120 | |
---|
121 | iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ |
---|
122 | touch -r doc/libmagic.man doc/libmagic.man_ |
---|
123 | mv doc/libmagic.man_ doc/libmagic.man |
---|
124 | |
---|
125 | %build |
---|
126 | autoreconf |
---|
127 | CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \ |
---|
128 | %configure --enable-fsect-man5 --disable-rpath |
---|
129 | # remove hardcoded library paths from local libtool |
---|
130 | sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool |
---|
131 | sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool |
---|
132 | export LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{name}-%{version}/src/.libs |
---|
133 | make |
---|
134 | |
---|
135 | cd python |
---|
136 | CFLAGS="%{optflags}" %{__python} setup.py build |
---|
137 | |
---|
138 | %install |
---|
139 | rm -rf $RPM_BUILD_ROOT |
---|
140 | mkdir -p $RPM_BUILD_ROOT%{_bindir} |
---|
141 | mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 |
---|
142 | mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3 |
---|
143 | mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5 |
---|
144 | mkdir -p $RPM_BUILD_ROOT%{_datadir}/misc |
---|
145 | mkdir -p $RPM_BUILD_ROOT%{_datadir}/file |
---|
146 | |
---|
147 | make install DESTDIR=$RPM_BUILD_ROOT |
---|
148 | |
---|
149 | cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic |
---|
150 | ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic |
---|
151 | ##ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime |
---|
152 | ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic |
---|
153 | |
---|
154 | cd python |
---|
155 | %{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} |
---|
156 | %{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name} |
---|
157 | |
---|
158 | |
---|
159 | # LIBTOOL=/usr/bin/libtool |
---|
160 | #ln -s file/magic ${RPM_BUILD_ROOT}%{_datadir}/magic |
---|
161 | #ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime |
---|
162 | |
---|
163 | #ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/misc/magic |
---|
164 | |
---|
165 | #{ cd ${RPM_BUILD_ROOT} |
---|
166 | # strip .%{_bindir}/file |
---|
167 | # cp %SOURCE1 .%{_datadir}/magic.mime |
---|
168 | #} |
---|
169 | |
---|
170 | # remove unuse files |
---|
171 | rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la |
---|
172 | |
---|
173 | %clean |
---|
174 | rm -rf $RPM_BUILD_ROOT |
---|
175 | |
---|
176 | %post -p /sbin/ldconfig |
---|
177 | |
---|
178 | %postun -p /sbin/ldconfig |
---|
179 | |
---|
180 | |
---|
181 | %files |
---|
182 | %defattr(-,root,root) |
---|
183 | %doc COPYING ChangeLog README |
---|
184 | %{_bindir}/* |
---|
185 | %{_libdir}/libmagic.so.* |
---|
186 | %{_datadir}/file/* |
---|
187 | %{_datadir}/magic* |
---|
188 | %{_datadir}/misc/* |
---|
189 | %{_mandir}/man[15]/* |
---|
190 | |
---|
191 | %files devel |
---|
192 | %defattr(-,root,root,-) |
---|
193 | %{_libdir}/*.so |
---|
194 | %{_includedir}/magic.h |
---|
195 | %{_mandir}/man3/* |
---|
196 | |
---|
197 | %files -n python-magic |
---|
198 | %defattr(-, root, root, -) |
---|
199 | %doc python/README COPYING python/example.py |
---|
200 | %{python_sitelib}/magic.py |
---|
201 | %{python_sitelib}/magic.pyc |
---|
202 | %{python_sitelib}/magic.pyo |
---|
203 | %{python_sitelib}/*egg-info |
---|
204 | |
---|
205 | |
---|
206 | %changelog |
---|
207 | * Thu Mar 27 2014 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.14-4 |
---|
208 | - add patch110,220 for fix regression of CVE-2014-2270 |
---|
209 | |
---|
210 | * Wed Mar 12 2014 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.14-3 |
---|
211 | - add patch210 for fix CVE-2014-2270 |
---|
212 | |
---|
213 | * Thu Feb 20 2014 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.14-2 |
---|
214 | - add patch200 for fix CVE-2014-1943 |
---|
215 | |
---|
216 | * Sun Sep 22 2013 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.14-1 |
---|
217 | - new upstream reelase |
---|
218 | - add patch100 to fix build error |
---|
219 | - remove -static subpackage and add Obs: file-static |
---|
220 | - fix old changelog date... |
---|
221 | |
---|
222 | * Thu Nov 29 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 5.11-1 |
---|
223 | - new upstream reelase |
---|
224 | - drop all local patches |
---|
225 | - import fedora patches |
---|
226 | |
---|
227 | * Wed Feb 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.05-3 |
---|
228 | - rebuild with python-2.7.2 |
---|
229 | |
---|
230 | * Sun Feb 20 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.05-2 |
---|
231 | - rebuild package |
---|
232 | - fix Patch100 |
---|
233 | |
---|
234 | * Sat Feb 12 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.05-1 |
---|
235 | - new upstream release |
---|
236 | - updated Vine patches (but Patch100 has not been ported yet...) |
---|
237 | - split to devel and static subpackcages |
---|
238 | |
---|
239 | * Mon Sep 27 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.21-3 |
---|
240 | - rebuilt with rpm-4.8.1 |
---|
241 | - add environment variable LIBTOOL for make command |
---|
242 | |
---|
243 | * Fri Sep 26 2008 Shu KONNO <owa@bg.wakwak.com> 4.21-2 |
---|
244 | - spec in utf-8 |
---|
245 | - removed *.la |
---|
246 | |
---|
247 | * Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.21-1 |
---|
248 | - applied new versioning policy |
---|
249 | |
---|
250 | * Tue Dec 11 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 4.21-0vl1 |
---|
251 | - new upstream release |
---|
252 | - import debian/fedora patches |
---|
253 | - drop obsolete vine magic. |
---|
254 | |
---|
255 | * Thu Jun 14 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.09-0vl3 |
---|
256 | - rebuild for VineSeed with new tool chain |
---|
257 | |
---|
258 | * Thu May 31 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.09-0vl2.2 |
---|
259 | - add patch110 for fix CVE-2007-2799 |
---|
260 | - add zlib-devel to BuildPreReq tag |
---|
261 | |
---|
262 | * Mon Mar 26 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.09-0vl2.1 |
---|
263 | - add patch100 for fix CVE-2007-1536 |
---|
264 | |
---|
265 | * Sun Sep 10 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.09-0vl2 |
---|
266 | - changed Group to Applications/System |
---|
267 | |
---|
268 | * Sun Apr 18 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 4.09-0vl1 |
---|
269 | - new upstream release |
---|
270 | - update vine patches |
---|
271 | |
---|
272 | * Wed Sep 10 2003 Tomoya TAKA <taka@vinelinux.org> 4.03-0vl2 |
---|
273 | - update Patch10, use 'size_t' in src/jcode.[ch] |
---|
274 | |
---|
275 | * Tue Sep 09 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.03-0vl1 |
---|
276 | - update to 4.03 |
---|
277 | - update Patch0, 1, 10 for 4.03 |
---|
278 | - s/Copyright/License/ |
---|
279 | |
---|
280 | * Mon May 12 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.02-1vl1 |
---|
281 | - update to 4.02 |
---|
282 | - update Vine patches for 4.02 |
---|
283 | |
---|
284 | * Sun Mar 9 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 3.41-0vl1 |
---|
285 | - new upstream release |
---|
286 | - fixed security bug (http://www.idefense.com/advisory/03.04.03.txt) |
---|
287 | - remove unneeded patches. |
---|
288 | - update Vine patches for 3.41 |
---|
289 | |
---|
290 | * Mon Apr 1 2002 Jun Nishii <jun@vinelinux.org> 3.37-0vl2 |
---|
291 | - added NPDL2 data [Vine:02348] |
---|
292 | |
---|
293 | * Fri Feb 08 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 3.37-0vl1 |
---|
294 | - update to 3.37 |
---|
295 | |
---|
296 | * Sun Jul 15 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org> |
---|
297 | - 3.35-0vl3 |
---|
298 | - disable some entries in elf for problems on big-endian archs |
---|
299 | |
---|
300 | * Wed Jun 6 2001 Jun Nishii <jun@vinelinux.org> |
---|
301 | - file-3.35-0vl1 |
---|
302 | - ver.up |
---|
303 | - added %doc |
---|
304 | |
---|
305 | * Thu Jan 11 2001 Jun Nishii <jun@vinelinux.org> |
---|
306 | - file-3.33-1vl4 |
---|
307 | - more fix and clean up jtext patch (file-3.33-vinejtext.patch) |
---|
308 | |
---|
309 | * Thu Jan 11 2001 Jun Nishii <jun@vinelinux.org> |
---|
310 | - file-3.33-1vl3 |
---|
311 | - fix again jtext patch (file-3.33-vinejtext.patch) |
---|
312 | - added file-3.33-vinenames.patch to avoid miss-judgement |
---|
313 | |
---|
314 | * Wed Jan 10 2001 Jun Nishii <jun@vinelinux.org> |
---|
315 | - file-3.33-1vl2 |
---|
316 | - update jtext patch (file-3.33-vinejtext.patch) |
---|
317 | |
---|
318 | * Mon Jan 8 2001 Jun Nishii <jun@vinelinux.org> |
---|
319 | - file-3.33-1vl1 |
---|
320 | - modify description-ja and spec |
---|
321 | |
---|
322 | * Sun Jul 09 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org> |
---|
323 | - file-3.28-2vl2 |
---|
324 | - fixed %files section to handle compressed man pages |
---|
325 | |
---|
326 | * Tue Jun 13 2000 Lisa Sagami <czs14350@nifty.ne.jp> |
---|
327 | - marged RH 3.28-2 and Vine 3.27-3vl3 |
---|
328 | |
---|
329 | * Wed Feb 16 2000 Cristian Gafton <gafton@redhat.com> |
---|
330 | - add ia64 patch from rth |
---|
331 | |
---|
332 | * Mon Feb 7 2000 Bill Nottingham <notting@redhat.com> |
---|
333 | - handle compressed manpages |
---|
334 | - update to 3.28 |
---|
335 | |
---|
336 | * Mon Sep 6 1999 Norihito Ohmori <ohmori@flatout.org> |
---|
337 | - Japanese Text detection bug fix. (by Toru Hoshina <hoshina@best.com>) |
---|
338 | |
---|
339 | * Fri Aug 27 1999 Norihito Ohmori <ohmori@flatout.org> |
---|
340 | - patch dues not apply bug. |
---|
341 | |
---|
342 | * Thu Aug 26 1999 Norihito Ohmori <ohmori@flatout.org> |
---|
343 | - not need kcc (Thanks for Toru Hoshina <hoshina@best.com>) |
---|
344 | - ASCII data and Shift JIS data detected in Japanese Text Detection bug fix. |
---|
345 | |
---|
346 | * Mon Aug 23 1999 Jeff Johnson <jbj@redhat.com> |
---|
347 | - identify ELF stripped files correctly (#4665). |
---|
348 | - use SPARC (not sparc) consistently throughout (#4665). |
---|
349 | - add entries for MS Office files (#4665). |
---|
350 | |
---|
351 | * Thu Aug 12 1999 Jeff Johnson <jbj@redhat.com> |
---|
352 | - diddle magic so that *.tfm files are identified correctly. |
---|
353 | |
---|
354 | * Tue Jul 6 1999 Jeff Johnson <jbj@redhat.com> |
---|
355 | - update to 3.27. |
---|
356 | |
---|
357 | * Mon Mar 22 1999 Preston Brown <pbrown@redhat.com> |
---|
358 | - experimental support for realmedia files added |
---|
359 | |
---|
360 | * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> |
---|
361 | - auto rebuild in the new build environment (release 5) |
---|
362 | |
---|
363 | * Fri Mar 19 1999 Jeff Johnson <jbj@redhat.com> |
---|
364 | - strip binary. |
---|
365 | |
---|
366 | * Fri Nov 27 1998 Jakub Jelinek <jj@ultra.linux.cz> |
---|
367 | - add SPARC V9 magic. |
---|
368 | |
---|
369 | * Tue Nov 10 1998 Jeff Johnson <jbj@redhat.com> |
---|
370 | - update to 3.26. |
---|
371 | |
---|
372 | * Mon Aug 24 1998 Jeff Johnson <jbj@redhat.com> |
---|
373 | - update to 3.25. |
---|
374 | - detect gimp XCF versions. |
---|
375 | |
---|
376 | * Thu May 07 1998 Prospector System <bugs@redhat.com> |
---|
377 | - translations modified for de, fr, tr |
---|
378 | |
---|
379 | * Wed Apr 08 1998 Erik Troan <ewt@redhat.com> |
---|
380 | - updated to 3.24 |
---|
381 | - buildrooted |
---|
382 | |
---|
383 | * Mon Jun 02 1997 Erik Troan <ewt@redhat.com> |
---|
384 | - built against glibc |
---|
385 | |
---|
386 | * Mon Mar 31 1997 Erik Troan <ewt@redhat.com> |
---|
387 | - Fixed problems caused by 64 bit time_t. |
---|
388 | |
---|
389 | * Thu Mar 06 1997 Michael K. Johnson <johnsonm@redhat.com> |
---|
390 | - Improved recognition of Linux kernel images. |
---|