| 1 |
%define _centos_ver %{?centos_ver:%{centos_ver}}%{!?centos_ver:5} |
| 2 |
|
| 3 |
%if %{_centos_ver} == 7 |
| 4 |
%define mysql_version_default 5.6.37 |
| 5 |
%define mysql_release_default 2 |
| 6 |
%define mysql_dist_default el7 |
| 7 |
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/7/SRPMS |
| 8 |
%define mysql_spec_file_default mysql.spec |
| 9 |
%else |
| 10 |
%define mysql_version_default 5.6.37 |
| 11 |
%define mysql_release_default 2 |
| 12 |
%define mysql_dist_default el6 |
| 13 |
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/6/SRPMS |
| 14 |
%define mysql_spec_file_default mysql.spec |
| 15 |
%endif |
| 16 |
|
| 17 |
%define _mysql_version %{?mysql_version:%{mysql_version}}%{!?mysql_version:%{mysql_version_default}} |
| 18 |
%define _mysql_release %{?mysql_release:%{mysql_release}}%{!?mysql_release:%{mysql_release_default}} |
| 19 |
%define _mysql_dist %{?mysql_dist:%{mysql_dist}}%{!?mysql_dist:%{mysql_dist_default}} |
| 20 |
%define _mysql_download_base_url %{?mysql_download_base_url:%{mysql_download_base_url}}%{!?mysql_download_base_url:%{mysql_download_base_url_default}} |
| 21 |
%define _mysql_spec_file %{?mysql_spec_file:%{mysql_spec_file}}%{!?mysql_spec_file:%{mysql_spec_file_default}} |
| 22 |
|
| 23 |
%define groonga_required_version @REQUIRED_GROONGA_VERSION@ |
| 24 |
|
| 25 |
Name: mysql-community-mroonga |
| 26 |
Version: @VERSION@ |
| 27 |
Release: 1%{?dist} |
| 28 |
Summary: A fast fulltext searchable storage engine for MySQL |
| 29 |
|
| 30 |
Group: Applications/Databases |
| 31 |
License: LGPLv2.1 |
| 32 |
URL: http://mroonga.org/ |
| 33 |
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz |
| 34 |
|
| 35 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) |
| 36 |
BuildRequires: groonga-devel >= %{groonga_required_version} |
| 37 |
BuildRequires: groonga-normalizer-mysql-devel |
| 38 |
BuildRequires: wget |
| 39 |
BuildRequires: which |
| 40 |
BuildRequires: gcc, gcc-c++ |
| 41 |
BuildRequires: numactl-devel |
| 42 |
BuildRequires: mysql-community-devel = %{_mysql_version}-%{_mysql_release}.%{_mysql_dist} |
| 43 |
Requires: mysql-community-server = %{_mysql_version}-%{_mysql_release}.%{_mysql_dist} |
| 44 |
Requires: mysql-community-client = %{_mysql_version}-%{_mysql_release}.%{_mysql_dist} |
| 45 |
Requires: groonga-libs >= %{groonga_required_version} |
| 46 |
Requires: groonga-normalizer-mysql |
| 47 |
|
| 48 |
%description |
| 49 |
Mroonga is a fast fulltext searchable storage plugin for MySQL. |
| 50 |
It is based on Groonga that is a fast fulltext search engine and |
| 51 |
column store. Groonga is good at real-time update. |
| 52 |
|
| 53 |
%package doc |
| 54 |
Summary: Documentation for Mroonga |
| 55 |
Group: Documentation |
| 56 |
License: LGPLv2.1 |
| 57 |
|
| 58 |
%description doc |
| 59 |
Documentation for Mroonga |
| 60 |
|
| 61 |
|
| 62 |
%prep |
| 63 |
%setup -q -n mroonga-%{version} |
| 64 |
|
| 65 |
mysql_full_version=%{_mysql_version}-%{_mysql_release}.%{_mysql_dist} |
| 66 |
srpm=mysql-community-${mysql_full_version}.src.rpm |
| 67 |
if [ ! -f ../../SRPMS/$srpm ]; then |
| 68 |
wget --continue -O ../../SRPMS/$srpm %{_mysql_download_base_url}/$srpm |
| 69 |
rpm -Uvh ../../SRPMS/$srpm |
| 70 |
fi |
| 71 |
|
| 72 |
%build |
| 73 |
mysql_source=../mysql-%{_mysql_version}/mysql-%{_mysql_version} |
| 74 |
if [ ! -d ${mysql_source} ]; then |
| 75 |
specs_dir= |
| 76 |
MYSQL_RPMBUILD_TEST=no rpmbuild -bp \ |
| 77 |
--define 'runselftest 0' \ |
| 78 |
--define 'optflags -O0' \ |
| 79 |
../../SPECS/%{_mysql_spec_file} |
| 80 |
fi |
| 81 |
%configure \ |
| 82 |
--disable-static \ |
| 83 |
--with-mysql-source=${mysql_source} \ |
| 84 |
--enable-fast-mutexes \ |
| 85 |
%{?mroonga_configure_options} |
| 86 |
make %{?_smp_mflags} |
| 87 |
|
| 88 |
%install |
| 89 |
rm -rf $RPM_BUILD_ROOT |
| 90 |
make install DESTDIR=$RPM_BUILD_ROOT |
| 91 |
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la |
| 92 |
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/ |
| 93 |
|
| 94 |
%clean |
| 95 |
rm -rf $RPM_BUILD_ROOT |
| 96 |
|
| 97 |
%post |
| 98 |
if ! /sbin/service mysqld status > /dev/null; then |
| 99 |
/sbin/service mysqld start |
| 100 |
stop_after_installation=1 |
| 101 |
else |
| 102 |
stop_after_installation=0 |
| 103 |
fi |
| 104 |
|
| 105 |
mysql_command=`which mysql` |
| 106 |
if $mysql_command -u root -e "quit" > /dev/null 2>&1; then |
| 107 |
password_option="" |
| 108 |
else |
| 109 |
password_option="-p" |
| 110 |
fi |
| 111 |
current_version=0 |
| 112 |
version=`echo %{groonga_required_version} | sed -e 's/\.//g'` |
| 113 |
required_version=`expr $version` |
| 114 |
version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \ |
| 115 |
grep mroonga | cut -f 2 | sed -e 's/\.//g'` |
| 116 |
if [ -n "$version" ]; then |
| 117 |
current_version=`expr $version` |
| 118 |
fi |
| 119 |
install_sql=%{_datadir}/mroonga/install.sql |
| 120 |
uninstall_sql=%{_datadir}/mroonga/uninstall.sql |
| 121 |
|
| 122 |
if [ "$1" = 2 ] ; then |
| 123 |
if [ $current_version -lt $required_version ]; then |
| 124 |
command="$mysql_command -u root $password_option" |
| 125 |
echo "run the following command after restarting MySQL server:"; |
| 126 |
echo " $command < ${uninstall_sql}" |
| 127 |
echo " $command < ${install_sql}" |
| 128 |
exit 0 |
| 129 |
else |
| 130 |
command="$mysql_command -u root $password_option < ${uninstall_sql}" |
| 131 |
echo $command |
| 132 |
eval $command || \ |
| 133 |
(echo "run the following command to unregister Mroonga:"; \ |
| 134 |
echo " $command") |
| 135 |
fi |
| 136 |
fi |
| 137 |
command="$mysql_command -u root $password_option < ${install_sql}" |
| 138 |
echo $command |
| 139 |
eval $command || \ |
| 140 |
(echo "run the following command to register Mroonga:"; \ |
| 141 |
echo " $command") |
| 142 |
|
| 143 |
if [ "$stop_after_installation" = "1" ]; then |
| 144 |
/sbin/service mysqld stop |
| 145 |
fi |
| 146 |
|
| 147 |
%preun |
| 148 |
if ! /sbin/service mysqld status > /dev/null; then |
| 149 |
/sbin/service mysqld start |
| 150 |
stop_after_uninstallation=1 |
| 151 |
else |
| 152 |
stop_after_uninstallation=0 |
| 153 |
fi |
| 154 |
|
| 155 |
uninstall_sql=%{_datadir}/mroonga/uninstall.sql |
| 156 |
mysql_command=`which mysql` |
| 157 |
if $mysql_command -u root -e "quit" > /dev/null 2>&1; then |
| 158 |
password_option="" |
| 159 |
else |
| 160 |
password_option="-p" |
| 161 |
fi |
| 162 |
if [ "$1" = 0 ]; then |
| 163 |
command="$mysql_command -u root $password_option < ${uninstall_sql}" |
| 164 |
echo $command |
| 165 |
eval $command || \ |
| 166 |
(echo "run the following command to unregister Mroonga:"; \ |
| 167 |
echo " $command") |
| 168 |
fi |
| 169 |
|
| 170 |
if [ "$stop_after_uninstallation" = "1" ]; then |
| 171 |
/sbin/service mysqld stop |
| 172 |
fi |
| 173 |
|
| 174 |
%files |
| 175 |
%defattr(-,root,root,-) |
| 176 |
%{_libdir}/mysql/plugin/ |
| 177 |
%{_datadir}/mroonga/* |
| 178 |
%{_datadir}/man/man1/* |
| 179 |
%{_datadir}/man/*/man1/* |
| 180 |
|
| 181 |
%files doc |
| 182 |
%defattr(-,root,root,-) |
| 183 |
%doc README COPYING |
| 184 |
%doc mysql-mroonga-doc/* |
| 185 |
|
| 186 |
%changelog |
| 187 |
* Thu Oct 12 2017 Kentaro Hayashi <[email protected]> - 7.07-1 |
| 188 |
- new upstream release. |
| 189 |
|
| 190 |
* Tue Aug 29 2017 Kentaro Hayashi <[email protected]> - 7.06-1 |
| 191 |
- new upstream release. |
| 192 |
|
| 193 |
* Wed Aug 23 2017 Kentaro Hayashi <[email protected]> - 7.05-2 |
| 194 |
- build against MySQL 5.6.37 on CentOS 7. Reported by Hiroshi Kagami. Thanks!!! |
| 195 |
|
| 196 |
* Sat Jul 29 2017 Kentaro Hayashi <[email protected]> - 7.05-1 |
| 197 |
- new upstream release. |
| 198 |
|
| 199 |
* Fri Jul 21 2017 Kentaro Hayashi <[email protected]> - 7.04-2 |
| 200 |
- build against MySQL 5.6.37 on CentOS 6. Reported by Hiroshi Kagami. Thanks!!! |
| 201 |
|
| 202 |
* Thu Jun 29 2017 Kentaro Hayashi <[email protected]> - 7.04-1 |
| 203 |
- new upstream release. |
| 204 |
|
| 205 |
* Mon May 29 2017 Kentaro Hayashi <[email protected]> - 7.03-1 |
| 206 |
- new upstream release. |
| 207 |
|
| 208 |
* Sat Apr 29 2017 Kentaro Hayashi <[email protected]> - 7.02-1 |
| 209 |
- new upstream release. |
| 210 |
|
| 211 |
* Wed Apr 12 2017 Kentaro Hayashi <[email protected]> - 7.01-2 |
| 212 |
- build against MySQL 5.6.36 Reported by @tigersun2000. Thanks!!! |
| 213 |
|
| 214 |
* Wed Mar 29 2017 Kentaro Hayashi <[email protected]> - 7.01-1 |
| 215 |
- new upstream release. |
| 216 |
|
| 217 |
* Thu Feb 09 2017 Kentaro Hayashi <[email protected]> - 7.00-1 |
| 218 |
- new upstream release. |
| 219 |
|
| 220 |
* Fri Jan 13 2017 Kouhei Sutou <[email protected]> - 6.13-1 |
| 221 |
- new upstream release. |
| 222 |
|
| 223 |
* Thu Dec 29 2016 Kentaro Hayashi <[email protected]> - 6.12-1 |
| 224 |
- new upstream release. |
| 225 |
|
| 226 |
* Tue Nov 29 2016 Kentaro Hayashi <[email protected]> - 6.11-1 |
| 227 |
- new upstream release. |
| 228 |
|
| 229 |
* Sat Oct 29 2016 Kentaro Hayashi <[email protected]> - 6.10-1 |
| 230 |
- new upstream release. |
| 231 |
|
| 232 |
* Mon Oct 24 2016 Kouhei Sutou <[email protected]> - 6.09-2 |
| 233 |
- build against MySQL 5.6.34. Reported by Hiroshi Kagami. Thanks!!! |
| 234 |
|
| 235 |
* Thu Sep 29 2016 Kentaro Hayashi <[email protected]> - 6.09-1 |
| 236 |
- new upstream release. |
| 237 |
|
| 238 |
* Wed Sep 14 2016 Kentaro Hayashi <[email protected]> - 6.08-2 |
| 239 |
- build against MySQL 5.6.33. |
| 240 |
|
| 241 |
* Mon Aug 29 2016 Kentaro Hayashi <[email protected]> - 6.08-1 |
| 242 |
- new upstream release. |
| 243 |
|
| 244 |
* Fri Jul 29 2016 Kentaro Hayashi <[email protected]> - 6.07-1 |
| 245 |
- new upstream release. |
| 246 |
|
| 247 |
* Thu Jun 30 2016 Masafumi Yokoyama <[email protected]> - 6.06-1 |
| 248 |
- new upstream release. |
| 249 |
|
| 250 |
* Wed Jun 29 2016 Kentaro Hayashi <[email protected]> - 6.05-1 |
| 251 |
- new upstream release. |
| 252 |
|
| 253 |
* Mon Jun 06 2016 Kouhei Sutou <[email protected]> - 6.03-2 |
| 254 |
- build against MySQL 5.6.30. |
| 255 |
|
| 256 |
* Sun May 29 2016 Kentaro Hayashi <[email protected]> - 6.03-1 |
| 257 |
- new upstream release. |
| 258 |
|
| 259 |
* Fri Apr 29 2016 HAYASHI Kentaro <[email protected]> - 6.02-1 |
| 260 |
- new upstream release. |
| 261 |
|
| 262 |
* Tue Mar 29 2016 Masafumi Yokoyama <[email protected]> - 6.01-1 |
| 263 |
- new upstream release. |
| 264 |
|
| 265 |
* Mon Feb 29 2016 Kouhei Sutou <[email protected]> - 6.00-1 |
| 266 |
- new upstream release. |
| 267 |
|
| 268 |
* Fri Jan 29 2016 Kouhei Sutou <[email protected]> - 5.12-1 |
| 269 |
- new upstream release. |
| 270 |
|
| 271 |
* Tue Dec 29 2015 Kouhei Sutou <[email protected]> - 5.11-1 |
| 272 |
- new upstream release. |
| 273 |
|
| 274 |
* Wed Dec 09 2015 Kouhei Sutou <[email protected]> - 5.10-2 |
| 275 |
- build against MySQL 5.6.28. Reported by @stealthinu. Thanks!!! |
| 276 |
|
| 277 |
* Sun Nov 29 2015 Kouhei Sutou <[email protected]> - 5.10-1 |
| 278 |
- new upstream release. |
| 279 |
|
| 280 |
* Thu Oct 29 2015 Kouhei Sutou <[email protected]> - 5.09-1 |
| 281 |
- new upstream release. |
| 282 |
|
| 283 |
* Sat Oct 03 2015 Kouhei Sutou <[email protected]> - 5.08-2 |
| 284 |
- build against MySQL 5.6.27. Reported by @star_orihime. Thanks!!! |
| 285 |
|
| 286 |
* Tue Sep 29 2015 Kouhei Sutou <[email protected]> - 5.08-1 |
| 287 |
- new upstream release. |
| 288 |
|
| 289 |
* Mon Aug 31 2015 Kouhei Sutou <[email protected]> - 5.06-1 |
| 290 |
- new upstream release. |
| 291 |
|
| 292 |
* Wed Jul 29 2015 Masafumi Yokoyama <[email protected]> - 5.05-1 |
| 293 |
- new upstream release. |
| 294 |
|
| 295 |
* Mon Jun 29 2015 Masafumi Yokoyama <[email protected]> - 5.04-1 |
| 296 |
- new upstream release. |
| 297 |
|
| 298 |
* Tue Jun 02 2015 Masafumi Yokoyama <[email protected]> - 5.03-2 |
| 299 |
- build against MySQL 5.6.25. |
| 300 |
|
| 301 |
* Fri May 29 2015 HAYASHI Kentaro <[email protected]> - 5.03-1 |
| 302 |
- new upstream release. |
| 303 |
|
| 304 |
* Wed Apr 29 2015 HAYASHI Kentaro <[email protected]> - 5.02-1 |
| 305 |
- new upstream release. |
| 306 |
|
| 307 |
* Fri Apr 10 2015 Kouhei Sutou <[email protected]> - 5.01-2 |
| 308 |
- build against MySQL 5.6.24. |
| 309 |
|
| 310 |
* Sun Mar 29 2015 HAYASHI Kentaro <[email protected]> - 5.01-1 |
| 311 |
- new upstream release. |
| 312 |
|
| 313 |
* Mon Feb 09 2015 HAYASHI Kentaro <[email protected]> - 5.00-1 |
| 314 |
- new upstream release. |
| 315 |
|
| 316 |
* Wed Feb 04 2015 HAYASHI Kentaro <[email protected]> - 4.10-2 |
| 317 |
- build against MySQL 5.6.23-2 on MySQL yum repository. |
| 318 |
|
| 319 |
* Thu Jan 29 2015 HAYASHI Kentaro <[email protected]> - 4.10-1 |
| 320 |
- new upstream release. |
| 321 |
|
| 322 |
* Mon Dec 29 2014 Kouhei Sutou <[email protected]> - 4.09-1 |
| 323 |
- new upstream release. |
| 324 |
|
| 325 |
* Sat Nov 29 2014 HAYASHI Kentaro <[email protected]> - 4.08-1 |
| 326 |
- new upstream release. |
| 327 |
|
| 328 |
* Wed Oct 29 2014 Kouhei Sutou <[email protected]> - 4.07-1 |
| 329 |
- new upstream release. |
| 330 |
|
| 331 |
* Mon Sep 29 2014 Kouhei Sutou <[email protected]> - 4.06-1 |
| 332 |
- new upstream release. |
| 333 |
|
| 334 |
* Sat Sep 27 2014 Eiichi Sato <[email protected]> - 4.05-2 |
| 335 |
- build against MySQL 5.6.21-2 on MySQL yum repository. |
| 336 |
|
| 337 |
* Fri Aug 29 2014 Kouhei Sutou <[email protected]> - 4.05-1 |
| 338 |
- new upstream release. |
| 339 |
|
| 340 |
* Sat Aug 09 2014 Eiichi Sato <[email protected]> - 4.04-2 |
| 341 |
- build against MySQL 5.6.20-4 on MySQL yum repository. |
| 342 |
|
| 343 |
* Tue Jul 29 2014 HAYASHI Kentaro <[email protected]> - 4.04-1 |
| 344 |
- new upstream release. |
| 345 |
|
| 346 |
* Thu May 29 2014 Kouhei Sutou <[email protected]> - 4.03-2 |
| 347 |
- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!! |
| 348 |
|
| 349 |
* Thu May 29 2014 Kouhei Sutou <[email protected]> - 4.03-1 |
| 350 |
- new upstream release. |
| 351 |
|
| 352 |
* Tue Apr 29 2014 Kouhei Sutou <[email protected]> - 4.02-1 |
| 353 |
- new upstream release. |
| 354 |
|
| 355 |
* Sat Mar 29 2014 HAYASHI Kentaro <[email protected]> - 4.01-1 |
| 356 |
- new upstream release. |
| 357 |
|
| 358 |
* Thu Mar 06 2014 HAYASHI Kentaro <[email protected]> - 4.00-2 |
| 359 |
- use MySQL 5.5.36 on CentOS 5. |
| 360 |
|
| 361 |
* Sun Feb 09 2014 HAYASHI Kentaro <[email protected]> - 4.00-1 |
| 362 |
- new upstream release. |
| 363 |
|
| 364 |
* Wed Jan 29 2014 HAYASHI Kentaro <[email protected]> - 3.12-1 |
| 365 |
- new upstream release. |
| 366 |
|
| 367 |
* Sun Dec 29 2013 HAYASHI Kentaro <[email protected]> - 3.11-1 |
| 368 |
- new upstream release. |
| 369 |
|
| 370 |
* Fri Nov 29 2013 HAYASHI Kentaro <[email protected]> - 3.10-1 |
| 371 |
- new upstream release. |
| 372 |
|
| 373 |
* Tue Oct 29 2013 HAYASHI Kentaro <[email protected]> - 3.09-1 |
| 374 |
- initial packaging for MySQL 5.5 on CentOS 5. |