file-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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: 1%{?_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. Buildroot: %{_tmppath}/%{name}-%{version}-root
  34. #BuildRequires: automake
  35. #BuildRequires: autoconf
  36. BuildRequires: zlib-devel
  37. Vendor: Project Vine
  38. Distribution: Vine Linux
  39. Packager: daisuke
  40. %description
  41. The file command is used to identify a particular file according to the
  42. type of data contained by the file. File can identify many different
  43. file types, including ELF binaries, system libraries, RPM packages, and
  44. different graphics formats.
  45. You should install the file package, since the file command is such a
  46. useful utility.
  47. %description -l ja
  48. file コマンドは、ファイルに含まれるデータの種類によって各ファイルが
  49. どのようなファイルかを判定するために使います。file は ELF バイナリ、シ
  50. ステムライブラリ、RPM パッケージ、そして様々なグラフィックフォーマット
  51. を含む、多くの異なるファイルの種類を見分けることができます。
  52. %package devel
  53. Summary: Libraries and header files for file development
  54. Summary(ja): libmagic の開発用ファイル
  55. Group: Development/Libraries
  56. Requires: %{name} = %{version}-%{release}
  57. %description devel
  58. The file-devel package contains the header files and libmagic library
  59. necessary for developing programs using libmagic.
  60. %package -n python-magic
  61. Summary: Python bindings for the libmagic API
  62. Group: Development/Libraries
  63. BuildRequires: python-devel
  64. Requires: %{name} = %{version}-%{release}
  65. %description -n python-magic
  66. This package contains the Python bindings to allow access to the
  67. libmagic API. The libmagic library is also used by the familiar
  68. file(1) command.
  69. %prep
  70. %setup -q
  71. # Don't use -b -- it will lead to poblems when compiling magic file!
  72. %patch0 -p1
  73. %patch1 -p1
  74. %patch2 -p1
  75. %patch3 -p1
  76. %patch4 -p1
  77. %patch5 -p1
  78. %patch6 -p1
  79. %patch7 -p1
  80. %patch8 -p1
  81. %patch9 -p1
  82. %patch10 -p1
  83. %patch11 -p1
  84. %patch12 -p1
  85. %patch13 -p1
  86. #Vine
  87. %patch100 -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
  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
  101. cd python
  102. CFLAGS="%{optflags}" %{__python} setup.py build
  103. %install
  104. rm -rf $RPM_BUILD_ROOT
  105. mkdir -p $RPM_BUILD_ROOT%{_bindir}
  106. mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
  107. mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3
  108. mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5
  109. mkdir -p $RPM_BUILD_ROOT%{_datadir}/misc
  110. mkdir -p $RPM_BUILD_ROOT%{_datadir}/file
  111. make install DESTDIR=$RPM_BUILD_ROOT
  112. cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
  113. ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
  114. ##ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
  115. ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
  116. cd python
  117. %{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
  118. %{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
  119. # LIBTOOL=/usr/bin/libtool
  120. #ln -s file/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
  121. #ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
  122. #ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
  123. #{ cd ${RPM_BUILD_ROOT}
  124. # strip .%{_bindir}/file
  125. # cp %SOURCE1 .%{_datadir}/magic.mime
  126. #}
  127. # remove unuse files
  128. rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
  129. %clean
  130. rm -rf $RPM_BUILD_ROOT
  131. %post -p /sbin/ldconfig
  132. %postun -p /sbin/ldconfig
  133. %files
  134. %defattr(-,root,root)
  135. %doc COPYING ChangeLog README
  136. %{_bindir}/*
  137. %{_libdir}/libmagic.so.*
  138. %{_datadir}/file/*
  139. %{_datadir}/magic*
  140. %{_datadir}/misc/*
  141. %{_mandir}/man[15]/*
  142. %files devel
  143. %defattr(-,root,root,-)
  144. %{_libdir}/*.so
  145. %{_includedir}/magic.h
  146. %{_mandir}/man3/*
  147. %files -n python-magic
  148. %defattr(-, root, root, -)
  149. %doc python/README COPYING python/example.py
  150. %{python_sitelib}/magic.py
  151. %{python_sitelib}/magic.pyc
  152. %{python_sitelib}/magic.pyo
  153. %{python_sitelib}/*egg-info
  154. %changelog
  155. * Sun Sep 22 2013 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.14-1
  156. - new upstream reelase
  157. - add patch100 to fix build error
  158. - remove -static subpackage and add Obs: file-static
  159. - fix old changelog date...
  160. * Thu Nov 29 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 5.11-1
  161. - new upstream reelase
  162. - drop all local patches
  163. - import fedora patches
  164. * Wed Feb 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.05-3
  165. - rebuild with python-2.7.2
  166. * Sun Feb 20 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.05-2
  167. - rebuild package
  168. - fix Patch100
  169. * Sat Feb 12 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.05-1
  170. - new upstream release
  171. - updated Vine patches (but Patch100 has not been ported yet...)
  172. - split to devel and static subpackcages
  173. * Mon Sep 27 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.21-3
  174. - rebuilt with rpm-4.8.1
  175. - add environment variable LIBTOOL for make command
  176. * Fri Sep 26 2008 Shu KONNO <owa@bg.wakwak.com> 4.21-2
  177. - spec in utf-8
  178. - removed *.la
  179. * Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.21-1
  180. - applied new versioning policy
  181. * Tue Dec 11 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 4.21-0vl1
  182. - new upstream release
  183. - import debian/fedora patches
  184. - drop obsolete vine magic.
  185. * Thu Jun 14 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.09-0vl3
  186. - rebuild for VineSeed with new tool chain
  187. * Thu May 31 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.09-0vl2.2
  188. - add patch110 for fix CVE-2007-2799
  189. - add zlib-devel to BuildPreReq tag
  190. * Mon Mar 26 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.09-0vl2.1
  191. - add patch100 for fix CVE-2007-1536
  192. * Sun Sep 10 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.09-0vl2
  193. - changed Group to Applications/System
  194. * Sun Apr 18 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 4.09-0vl1
  195. - new upstream release
  196. - update vine patches
  197. * Wed Sep 10 2003 Tomoya TAKA <taka@vinelinux.org> 4.03-0vl2
  198. - update Patch10, use 'size_t' in src/jcode.[ch]
  199. * Tue Sep 09 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.03-0vl1
  200. - update to 4.03
  201. - update Patch0, 1, 10 for 4.03
  202. - s/Copyright/License/
  203. * Mon May 12 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.02-1vl1
  204. - update to 4.02
  205. - update Vine patches for 4.02
  206. * Sun Mar 9 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 3.41-0vl1
  207. - new upstream release
  208. - fixed security bug (http://www.idefense.com/advisory/03.04.03.txt)
  209. - remove unneeded patches.
  210. - update Vine patches for 3.41
  211. * Mon Apr 1 2002 Jun Nishii <jun@vinelinux.org> 3.37-0vl2
  212. - added NPDL2 data [Vine:02348]
  213. * Fri Feb 08 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 3.37-0vl1
  214. - update to 3.37
  215. * Sun Jul 15 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
  216. - 3.35-0vl3
  217. - disable some entries in elf for problems on big-endian archs
  218. * Wed Jun 6 2001 Jun Nishii <jun@vinelinux.org>
  219. - file-3.35-0vl1
  220. - ver.up
  221. - added %doc
  222. * Thu Jan 11 2001 Jun Nishii <jun@vinelinux.org>
  223. - file-3.33-1vl4
  224. - more fix and clean up jtext patch (file-3.33-vinejtext.patch)
  225. * Thu Jan 11 2001 Jun Nishii <jun@vinelinux.org>
  226. - file-3.33-1vl3
  227. - fix again jtext patch (file-3.33-vinejtext.patch)
  228. - added file-3.33-vinenames.patch to avoid miss-judgement
  229. * Wed Jan 10 2001 Jun Nishii <jun@vinelinux.org>
  230. - file-3.33-1vl2
  231. - update jtext patch (file-3.33-vinejtext.patch)
  232. * Mon Jan 8 2001 Jun Nishii <jun@vinelinux.org>
  233. - file-3.33-1vl1
  234. - modify description-ja and spec
  235. * Sun Jul 09 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  236. - file-3.28-2vl2
  237. - fixed %files section to handle compressed man pages
  238. * Tue Jun 13 2000 Lisa Sagami <czs14350@nifty.ne.jp>
  239. - marged RH 3.28-2 and Vine 3.27-3vl3
  240. * Wed Feb 16 2000 Cristian Gafton <gafton@redhat.com>
  241. - add ia64 patch from rth
  242. * Mon Feb 7 2000 Bill Nottingham <notting@redhat.com>
  243. - handle compressed manpages
  244. - update to 3.28
  245. * Mon Sep 6 1999 Norihito Ohmori <ohmori@flatout.org>
  246. - Japanese Text detection bug fix. (by Toru Hoshina <hoshina@best.com>)
  247. * Fri Aug 27 1999 Norihito Ohmori <ohmori@flatout.org>
  248. - patch dues not apply bug.
  249. * Thu Aug 26 1999 Norihito Ohmori <ohmori@flatout.org>
  250. - not need kcc (Thanks for Toru Hoshina <hoshina@best.com>)
  251. - ASCII data and Shift JIS data detected in Japanese Text Detection bug fix.
  252. * Mon Aug 23 1999 Jeff Johnson <jbj@redhat.com>
  253. - identify ELF stripped files correctly (#4665).
  254. - use SPARC (not sparc) consistently throughout (#4665).
  255. - add entries for MS Office files (#4665).
  256. * Thu Aug 12 1999 Jeff Johnson <jbj@redhat.com>
  257. - diddle magic so that *.tfm files are identified correctly.
  258. * Tue Jul 6 1999 Jeff Johnson <jbj@redhat.com>
  259. - update to 3.27.
  260. * Mon Mar 22 1999 Preston Brown <pbrown@redhat.com>
  261. - experimental support for realmedia files added
  262. * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
  263. - auto rebuild in the new build environment (release 5)
  264. * Fri Mar 19 1999 Jeff Johnson <jbj@redhat.com>
  265. - strip binary.
  266. * Fri Nov 27 1998 Jakub Jelinek <jj@ultra.linux.cz>
  267. - add SPARC V9 magic.
  268. * Tue Nov 10 1998 Jeff Johnson <jbj@redhat.com>
  269. - update to 3.26.
  270. * Mon Aug 24 1998 Jeff Johnson <jbj@redhat.com>
  271. - update to 3.25.
  272. - detect gimp XCF versions.
  273. * Thu May 07 1998 Prospector System <bugs@redhat.com>
  274. - translations modified for de, fr, tr
  275. * Wed Apr 08 1998 Erik Troan <ewt@redhat.com>
  276. - updated to 3.24
  277. - buildrooted
  278. * Mon Jun 02 1997 Erik Troan <ewt@redhat.com>
  279. - built against glibc
  280. * Mon Mar 31 1997 Erik Troan <ewt@redhat.com>
  281. - Fixed problems caused by 64 bit time_t.
  282. * Thu Mar 06 1997 Michael K. Johnson <johnsonm@redhat.com>
  283. - Improved recognition of Linux kernel images.