file-vl.spec 10 KB

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