file-vl.spec 13 KB

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