Debian Codegraph @

storage/mroonga/packages/rpm/centos/percona-server-56-mroonga.spec.in

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