source: projects/specs/branches/6/f/file/file-vl.spec @ 8267

Revision 8267, 10.9 KB checked in by iwamoto, 10 years ago (diff)

file: fix CVE-2014-1943

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