Debian Codegraph @

storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in

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