file-vl.spec 13 KB

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