file-vl.spec 14 KB

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