mariadb-mroonga-vl.spec 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. %{!?use_system_mysql:%define use_system_mysql 0}
  2. %define mysql_base_version %{__mariadb_base_version}
  3. %define mysql_version %{__mariadb_version}
  4. %define mysql_release %{__mariadb_release}
  5. %define groonga_required_version 4.0.1
  6. Name: mariadb-mroonga
  7. Version: 4.01
  8. Release: 2%{?_dist_release}
  9. Summary: A fast fulltext searchable storage engine for MariaDB.
  10. Group: Applications/Databases
  11. License: LGPLv2.1
  12. URL: http://mroonga.github.com/
  13. Source0: http://github.com/downloads/mroonga/mroonga/mroonga-%{version}.tar.gz
  14. ### the next release may include the follwing patches.
  15. Patch0: 4a3d6c77a9.patch
  16. Patch1: 171fa019d4.patch
  17. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
  18. BuildRequires: groonga-devel >= %{groonga_required_version}
  19. BuildRequires: groonga-normalizer-mysql-devel pcre-devel
  20. BuildRequires: mariadb-source
  21. %if "%{?mysql_version}" != ""
  22. Requires: mariadbserver-%{mysql_base_version}
  23. Requires: mariadbclient-%{mysql_base_version}
  24. %endif
  25. Requires: groonga-libs >= %{groonga_required_version}
  26. Requires: groonga-normalizer-mysql
  27. Obsoletes: MySQL-mroonga < 4.00
  28. Vendor: Project Vine
  29. Distribution: Vine Linux
  30. Packager: tomop
  31. %description
  32. Mroonga is a fast fulltext searchable storage plugin for MariaDB.
  33. It is based on groonga that is a fast fulltext search engine and
  34. column store. Groonga is good at real-time update.
  35. %package doc
  36. Summary: Documentation for mroonga
  37. Group: Documentation
  38. License: LGPLv2.1
  39. %description doc
  40. Documentation for mroonga
  41. %prep
  42. %setup -q -n mroonga-%{version}
  43. %patch0 -p1 -b .private
  44. %patch1 -p1 -b .LOCK_open
  45. %build
  46. mysql_source=%{_datadir}/mariadb-source/mariadb-%{mysql_version}
  47. %configure --disable-static --with-mysql-source=${mysql_source} \
  48. %{?mroonga_configure_options}
  49. make %{?_smp_mflags}
  50. %install
  51. rm -rf %{buildroot}
  52. make install DESTDIR=%{buildroot}
  53. rm -f %{buildroot}%{_libdir}/mysql/plugin/*.la
  54. mv -f %{buildroot}%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
  55. %clean
  56. rm -rf %{buildroot}
  57. %post
  58. if [ "$1" = 2 ] ; then
  59. sql="
  60. USE mysql;
  61. DROP FUNCTION IF EXISTS mroonga_snippet;
  62. DROP FUNCTION IF EXISTS last_insert_grn_id;
  63. DROP FUNCTION IF EXISTS mroonga_command;
  64. DROP FUNCTION IF EXISTS mroonga_escape;
  65. UNINSTALL PLUGIN mroonga;
  66. FLUSH TABLES;
  67. "
  68. command="/usr/bin/mysql -u root -e \"$sql\""
  69. echo $command
  70. eval $command || \
  71. (echo "run the following command to unregister mroonga:"; \
  72. echo " $command")
  73. fi
  74. sql="
  75. DELETE IGNORE FROM mysql.plugin WHERE name = 'mroonga';
  76. INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so';
  77. CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME 'ha_mroonga.so';
  78. CREATE FUNCTION mroonga_snippet RETURNS STRING SONAME 'ha_mroonga.so';
  79. CREATE FUNCTION mroonga_command RETURNS STRING SONAME 'ha_mroonga.so';
  80. CREATE FUNCTION mroonga_escape RETURNS STRING SONAME 'ha_mroonga.so';
  81. "
  82. command="/usr/bin/mysql -u root -e \"$sql\""
  83. echo $command
  84. eval $command || \
  85. (echo "run the following command to register mroonga:"; \
  86. echo " $command")
  87. %preun
  88. if [ "$1" = 0 ]; then
  89. sql="
  90. USE mysql;
  91. DROP FUNCTION IF EXISTS mroonga_snippet;
  92. DROP FUNCTION IF EXISTS last_insert_grn_id;
  93. DROP FUNCTION IF EXISTS mroonga_command;
  94. DROP FUNCTION IF EXISTS mroonga_escape;
  95. UNINSTALL PLUGIN mroonga;
  96. FLUSH TABLES;
  97. "
  98. command="/usr/bin/mysql -u root -e \"$sql\""
  99. echo $command
  100. eval $command || \
  101. (echo "run the following command to unregister mroonga:"; \
  102. echo " $command")
  103. fi
  104. %files
  105. %defattr(-,root,root,-)
  106. %{_libdir}/mysql/plugin/*
  107. %{_datadir}/man/man1/*
  108. %{_datadir}/man/*/man1/*
  109. %files doc
  110. %defattr(-,root,root,-)
  111. %doc README COPYING
  112. %doc mysql-mroonga-doc/*
  113. %changelog
  114. * Sun Apr 13 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.01-2
  115. - fixed %%post and %%preun scripts.
  116. * Fri Apr 11 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.01-1
  117. - new upstream release.
  118. - added Patch0 and Patch1.
  119. * Mon Mar 24 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.00-2
  120. - rebuilt with mariadb-10.0.9.
  121. * Tue Feb 11 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.00-1
  122. - new upstream release.
  123. * Wed Dec 18 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.10-2
  124. - added "BR: groonga-normalizer-mysql-devel".
  125. * Wed Dec 04 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.10-1
  126. - new upstream release.
  127. - built with MariaDB.
  128. * Wed Feb 20 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.00-1
  129. - new upstream release.
  130. - fixed dates of old %%changelog.
  131. * Fri Nov 16 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.08-1
  132. - new upstream release.
  133. * Sat Sep 15 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.06-1
  134. - initial build for Vine Linux.
  135. * Wed Aug 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.06-0
  136. - new upstream release.
  137. - make MySQL spec file name customizable.
  138. - make mroonga configure options customizable.
  139. - add missing mysql-devel BuildRequires. Reported by wing. Thanks!!!
  140. - use MySQL 5.5.27.
  141. * Sun Jul 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.05-0
  142. - new upstream release.
  143. - use MySQL 5.5.25a.
  144. * Fri Jun 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.04-0
  145. - new upstream release.
  146. - ensure deleting mroonga plugin before install.
  147. Suggested by Kazuhiro Isobe. Thanks!!!
  148. - use MySQL 5.5.25.
  149. * Tue May 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.03-0
  150. - new upstream release.
  151. - use MySQL 5.5.24.
  152. - make mysql_* variables customizable
  153. - require groonga 2.0.3 or later.
  154. * Sun Apr 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.02-0
  155. - new upstream release.
  156. - use MySQL 5.5.23.
  157. - require groonga 2.0.2 or later.
  158. * Thu Mar 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.01-0
  159. - new upstream release.
  160. - ensure plugin is uninstalled by closing all tables use mroonga.
  161. * Wed Feb 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.00-0
  162. - new upstream release.
  163. - always install/uninstall plugin.
  164. - use MySQL 5.1.61 and 5.5.21.
  165. - require groonga 2.0.0 or later.
  166. * Sun Jan 29 2012 Kouhei Sutou <kou@clear-code.com> - 1.20-0
  167. - new upstream release.
  168. - require groonga 1.3.0.
  169. - groonga -> mroonga.
  170. - use MySQL 5.5.20.
  171. * Thu Dec 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.11-0
  172. - new upstream release.
  173. * Sat Oct 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.10-0
  174. - new upstream release.
  175. - groonga storage engine -> mroonga.
  176. * Thu Sep 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.0-0
  177. - new upstream release.
  178. * Mon Aug 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.9-0
  179. - new upstream release.
  180. * Fri Jul 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.8-0
  181. - new upstream release.
  182. * Wed Jun 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.7-0
  183. - new upstream release.
  184. * Sun May 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.6-0
  185. - new upstream release.
  186. * Tue May 17 2011 Kouhei Sutou <kou@clear-code.com> - 0.5-2
  187. - use MySQL 5.5.12.
  188. * Tue Mar 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.5-1
  189. - new upstream release.
  190. * Sat Jan 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.4-4
  191. - do not remove plugin on upgrade.
  192. * Wed Jan 12 2011 Kouhei Sutou <kou@clear-code.com> - 0.4-3
  193. - rebuild without debug symbol.
  194. * Thu Dec 30 2010 Kouhei Sutou <kou@clear-code.com> - 0.4-2
  195. - use MySQL 5.5.8-1.
  196. - fix SQL literal notation.
  197. * Mon Nov 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.4-1
  198. - use the latest MySQL.
  199. - new upstream release.
  200. * Sun Nov 21 2010 Kouhei Sutou <kou@clear-code.com> - 0.3-2
  201. - install user define function.
  202. * Fri Oct 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.3-1
  203. - new upstream release.
  204. * Fri Oct 08 2010 Kouhei Sutou <kou@clear-code.com> - 0.2-2
  205. - specify target MySQL version.
  206. - use %{version}.
  207. * Wed Sep 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.2-1
  208. - new upstream release.
  209. * Sun Sep 12 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-3
  210. - require MySQL-client-community.
  211. * Fri Sep 10 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-2
  212. - use MySQL-devel-community.
  213. * Fri Sep 03 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-1
  214. - initial packaging for CentOS.