libtextcat-vl.spec 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Summary: Text Categorization Library
  2. Summary(ja): テキスト分類ライブラリ
  3. Name: libtextcat
  4. Version: 2.2
  5. Release: 1%{?_dist_release}
  6. Group: System Environment/Libraries
  7. License: BSD
  8. Source0: http://software.wise-guys.nl/download/%{name}-%{version}.tar.gz
  9. Source1: http://external.openoffice.org/source/browse/*checkout*/external/libtextcat/data/new_fingerprints/fpdb.conf
  10. Source2: http://external.openoffice.org/source/browse/*checkout*/external/libtextcat/data/new_fingerprints/lm/chinese_simplified.lm
  11. Source3: http://external.openoffice.org/source/browse/*checkout*/external/libtextcat/data/new_fingerprints/lm/chinese_traditional.lm
  12. Source4: http://external.openoffice.org/source/browse/*checkout*/external/libtextcat/data/new_fingerprints/lm/japanese.lm
  13. URL: http://software.wise-guys.nl/libtextcat/
  14. Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  15. BuildRequires: libtool
  16. Patch0: libtextcat-2.2-exportapi.patch
  17. Patch1: libtextcat-2.2-OOo.patch
  18. %description
  19. Libtextcat is a library with functions that implement the classification
  20. technique described in Cavnar & Trenkle, "N-Gram-Based Text Categorization".
  21. It was primarily developed for language guessing, a task on which it is known
  22. to perform with near-perfect accuracy.
  23. %package devel
  24. Summary: Support files necessary to compile applications with libtextcat
  25. Summary(ja): Support files necessary to compile applications with libtextcat
  26. Group: Development/Libraries
  27. Requires: libtextcat = %{version}-%{release}
  28. %description devel
  29. Libraries, headers, and support files necessary to compile applications
  30. using libtextcat.
  31. %prep
  32. %setup -q
  33. %patch0 -p1 -b .exportapi.patch
  34. %patch1 -p1 -b .ooo.patch
  35. %build
  36. autoreconf -f -i
  37. %configure --disable-static
  38. make %{?_smp_mflags}
  39. %install
  40. rm -rf $RPM_BUILD_ROOT
  41. make DESTDIR=$RPM_BUILD_ROOT install
  42. rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
  43. mkdir -p $RPM_BUILD_ROOT/%{_datadir}/libtextcat
  44. cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_datadir}/libtextcat
  45. cd langclass/LM
  46. cp -p amharic-utf.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/amharic_utf.lm
  47. cp -p yiddish-utf.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/yiddish_utf.lm
  48. cp -p afrikaans.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/afrikaans.lm
  49. cp -p basque.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/basque.lm
  50. cp -p bosnian.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/bosnian.lm
  51. cp -p croatian-ascii.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/croatian.lm
  52. cp -p drents.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/drents.lm
  53. cp -p dutch.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/dutch.lm
  54. cp -p english.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/english.lm
  55. cp -p icelandic.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/icelandic.lm
  56. cp -p indonesian.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/indonesian.lm
  57. cp -p latin.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/latin.lm
  58. cp -p malay.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/malay.lm
  59. cp -p manx.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/manx_gaelic.lm
  60. cp -p marathi.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/marathi.lm
  61. cp -p nepali.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/nepali.lm
  62. cp -p romanian.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/romanian.lm
  63. cp -p sanskrit.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/sanskrit.lm
  64. cp -p scots.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/scots.lm
  65. cp -p serbian-ascii.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/serbian_ascii.lm
  66. cp -p slovak-ascii.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/slovak_ascii.lm
  67. cp -p swahili.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/swahili.lm
  68. cp -p tagalog.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/tagalog.lm
  69. cp -p welsh.lm $RPM_BUILD_ROOT/%{_datadir}/libtextcat/welsh.lm
  70. iconv -f WINDOWS-1256 -t UTF-8 arabic-windows1256.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/arabic.lm
  71. iconv -f ISO-8859-1 -t UTF-8 albanian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/albanian.lm
  72. iconv -f WINDOWS-1251 -t UTF-8 belarus-windows1251.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/belarus.lm
  73. iconv -f ISO-8859-1 -t UTF-8 breton.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/breton.lm
  74. iconv -f ISO-8859-1 -t UTF-8 catalan.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/catalan.lm
  75. iconv -f ISO-8859-2 -t UTF-8 czech-iso8859_2.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/czech.lm
  76. iconv -f ISO-8859-1 -t UTF-8 danish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/danish.lm
  77. iconv -f ISO-8859-3 -t UTF-8 esperanto.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/esperanto.lm
  78. iconv -f ISO-8859-15 -t UTF-8 estonian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/estonian.lm
  79. iconv -f ISO-8859-1 -t UTF-8 finnish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/finnish.lm
  80. iconv -f ISO-8859-1 -t UTF-8 french.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/french.lm
  81. iconv -f ISO-8859-1 -t UTF-8 frisian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/frisian.lm
  82. iconv -f ISO-8859-1 -t UTF-8 georgian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/georgian.lm
  83. iconv -f ISO-8859-1 -t UTF-8 german.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/german.lm
  84. iconv -f ISO-8859-7 -t UTF-8 greek-iso8859-7.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/greek.lm
  85. iconv -f ISO-8859-8 -t UTF-8 hebrew-iso8859_8.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/hebrew.lm
  86. iconv -f ISO-8859-2 -t UTF-8 hungarian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/hungarian.lm
  87. iconv -f ISO-8859-1 -t UTF-8 irish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/irish_gaelic.lm
  88. iconv -f ISO-8859-1 -t UTF-8 italian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/italian.lm
  89. iconv -f ISO-8859-13 -t UTF-8 latvian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/latvian.lm
  90. iconv -f ISO-8859-13 -t UTF-8 lithuanian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/lithuanian.lm
  91. iconv -f ISO-8859-1 -t UTF-8 malay.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/malay.lm
  92. iconv -f ISO-8859-1 -t UTF-8 middle_frisian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/middle_frisian.lm
  93. iconv -f ISO-8859-1 -t UTF-8 mingo.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/mingo.lm
  94. iconv -f ISO-8859-1 -t UTF-8 norwegian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/norwegian.lm
  95. iconv -f ISO-8859-2 -t UTF-8 polish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/polish.lm
  96. iconv -f ISO-8859-1 -t UTF-8 portuguese.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/portuguese.lm
  97. iconv -f ISO-8859-1 -t UTF-8 quechua.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/quechua.lm
  98. iconv -f ISO-8859-1 -t UTF-8 rumantsch.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/romansh.lm
  99. iconv -f ISO-8859-5 -t UTF-8 russian-iso8859_5.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/russian.lm
  100. iconv -f ISO-8859-1 -t UTF-8 scots_gaelic.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/scots_gaelic.lm
  101. iconv -f ISO-8859-2 -t UTF-8 slovenian-iso8859_2.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/slovenian.lm
  102. iconv -f ISO-8859-1 -t UTF-8 spanish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/spanish.lm
  103. iconv -f ISO-8859-1 -t UTF-8 swedish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/swedish.lm
  104. iconv -f ISO-8859-9 -t UTF-8 turkish.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/turkish.lm
  105. iconv -f KOI8-R -t UTF-8 ukrainian-koi8_r.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/ukrainian.lm
  106. #these look wrong to me, but that's what upstream OOo has done, raise this upstream
  107. iconv -f ISO-8859-1 -t UTF-8 hindi.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/hindi.lm
  108. iconv -f ISO-8859-1 -t UTF-8 persian.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/persian.lm
  109. iconv -f ISO-8859-1 -t UTF-8 korean.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/korean.lm
  110. iconv -f ISO-8859-1 -t UTF-8 tamil.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/tamil.lm
  111. iconv -f ISO-8859-1 -t UTF-8 thai.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/thai.lm
  112. iconv -f ISO-8859-1 -t UTF-8 vietnamese.lm > $RPM_BUILD_ROOT/%{_datadir}/libtextcat/vietnamese.lm
  113. #and I have no idea how they fixed the encoding of these ones
  114. cp -p %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/libtextcat/chinese_simplified.lm
  115. cp -p %{SOURCE3} $RPM_BUILD_ROOT/%{_datadir}/libtextcat/chinese_traditional.lm
  116. cp -p %{SOURCE4} $RPM_BUILD_ROOT/%{_datadir}/libtextcat/japanese.lm
  117. %post -p /sbin/ldconfig
  118. %postun -p /sbin/ldconfig
  119. %files
  120. %defattr(-,root,root,-)
  121. %doc ChangeLog README LICENSE TODO
  122. %{_libdir}/lib*.so.*
  123. %{_datadir}/libtextcat
  124. %files devel
  125. %defattr(-,root,root,-)
  126. %{_bindir}/createfp
  127. %{_libdir}/*.so
  128. %{_includedir}/%{name}/
  129. %clean
  130. rm -r $RPM_BUILD_ROOT
  131. %changelog
  132. * Sun Jul 27 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2-1
  133. - initial build for Vine Linux
  134. * Mon Feb 04 2008 Caolan McNamara <caolanm@redhat.com> 2.2-5
  135. - rebuild for stricter headers
  136. * Wed Aug 29 2007 Caolan McNamara <caolanm@redhat.com> 2.2-4
  137. - rebuild
  138. * Wed Aug 08 2007 Caolan McNamara <caolanm@redhat.com> 2.2-3
  139. - package fingerprints
  140. * Wed Jul 25 2007 Caolan McNamara <caolanm@redhat.com> 2.2-2
  141. - fiddle with api for OOo 2.3
  142. * Wed Jun 27 2007 Caolan McNamara <caolanm@redhat.com> 2.2-1
  143. - Initial version