null+****@clear*****
null+****@clear*****
2011年 1月 12日 (水) 23:27:01 JST
Kouhei Sutou 2011-01-12 14:27:01 +0000 (Wed, 12 Jan 2011)
New Revision: 7f08e532659d70cb23ea8d986c4124e9380595fc
Log:
support upgrade.
Modified files:
rpm/centos/mysql-groonga.spec.in
rpm/fedora/mysql-groonga.spec.in
Modified: rpm/centos/mysql-groonga.spec.in (+19 -12)
===================================================================
--- rpm/centos/mysql-groonga.spec.in 2011-01-12 14:00:13 +0000 (77ea509)
+++ rpm/centos/mysql-groonga.spec.in 2011-01-12 14:27:01 +0000 (dce2319)
@@ -68,26 +68,30 @@ mv $RPM_BUILD_ROOT%{_datadir}/groonga-storage-engine/ \
rm -rf $RPM_BUILD_ROOT
%post
-sql="
+if [ $1 -eq 1 ]; then
+ sql="
INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_groonga.so';
"
-command="/usr/bin/mysql -u root -e \"$sql\""
-echo $command
-eval $command || \
- (echo "run the following command to register groonga storage engine:"; \
- echo " $command")
+ command="/usr/bin/mysql -u root -e \"$sql\""
+ echo $command
+ eval $command || \
+ (echo "run the following command to register groonga storage engine:"; \
+ echo " $command")
+fi
%postun
-sql="
+if [ $1 -eq 0 ]; then
+ sql="
DROP FUNCTION last_insert_grn_id;
UNINSTALL PLUGIN groonga;
"
-command="/usr/bin/mysql -u root -e \"$sql\""
-echo $command
-eval $command || \
- (echo "run the following command to unregister groonga storage engine:"; \
- echo " $command")
+ command="/usr/bin/mysql -u root -e \"$sql\""
+ echo $command
+ eval $command || \
+ (echo "run the following command to unregister groonga storage engine:"; \
+ echo " $command")
+fi
%files
%defattr(-,root,root,-)
@@ -95,6 +99,9 @@ eval $command || \
%doc %{_datadir}/mysql-groonga/doc/
%changelog
+* Sat Jan 29 2011 Kouhei Sutou <kou****@clear*****> - 0.5-1
+- do not remove plugin on upgrade.
+
* Wed Jan 12 2011 Kouhei Sutou <kou****@clear*****> - 0.4-3
- rebuild without debug symbol.
Modified: rpm/fedora/mysql-groonga.spec.in (+19 -12)
===================================================================
--- rpm/fedora/mysql-groonga.spec.in 2011-01-12 14:00:13 +0000 (e8889b5)
+++ rpm/fedora/mysql-groonga.spec.in 2011-01-12 14:27:01 +0000 (a628cfb)
@@ -50,26 +50,30 @@ mv $RPM_BUILD_ROOT%{_datadir}/groonga-storage-engine/ \
rm -rf $RPM_BUILD_ROOT
%post
-sql="
+if [ $1 -eq 1 ]; then
+ sql="
INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_groonga.so';
"
-command="/usr/bin/mysql -u root -p -e \"$sql\""
-echo $command
-eval $command || \
- (echo "run the following command to register groonga storage engine:"; \
- echo " $command")
+ command="/usr/bin/mysql -u root -e \"$sql\""
+ echo $command
+ eval $command || \
+ (echo "run the following command to register groonga storage engine:"; \
+ echo " $command")
+fi
%postun
-sql="
+if [ $1 -eq 0 ]; then
+ sql="
DROP FUNCTION last_insert_grn_id;
UNINSTALL PLUGIN groonga;
"
-command="/usr/bin/mysql -u root -p -e \"$sql\""
-echo $command
-eval $command || \
- (echo "run the following command to unregister groonga storage engine:"; \
- echo " $command")
+ command="/usr/bin/mysql -u root -e \"$sql\""
+ echo $command
+ eval $command || \
+ (echo "run the following command to unregister groonga storage engine:"; \
+ echo " $command")
+fi
%files
%defattr(-,root,root,-)
@@ -77,6 +81,9 @@ eval $command || \
%doc %{_datadir}/mysql-groonga/doc/
%changelog
+* Sat Jan 29 2011 Kouhei Sutou <kou****@clear*****> - 0.5-1
+- do not remove plugin on upgrade.
+
* Thu Dec 30 2010 Kouhei Sutou <kou****@clear*****> - 0.4-2
- fix SQL literal notation.