null+****@clear*****
null+****@clear*****
2010年 9月 3日 (金) 18:21:28 JST
Kouhei Sutou 2010-09-03 09:21:28 +0000 (Fri, 03 Sep 2010)
New Revision: 1ef980fefbda78a6d9007189c89f2f4874d7d3e2
Log:
support CentOS with the official MySQL package.
Added files:
rpm/centos/Makefile.am
rpm/centos/mysql-groonga.spec.in
Modified files:
configure.ac
rpm/Makefile.am
rpm/fedora/mysql-groonga.spec.in
yum/build-in-chroot.sh
yum/build-rpm.sh
yum/mysql-groonga-depended-packages
Modified: configure.ac (+2 -0)
===================================================================
--- configure.ac 2010-09-03 08:30:36 +0000 (f4b8ab8)
+++ configure.ac 2010-09-03 09:21:28 +0000 (3739b6b)
@@ -218,9 +218,11 @@ AC_CONFIG_FILES([
test/unit/Makefile
apt/Makefile
rpm/Makefile
+ rpm/centos/Makefile
rpm/fedora/Makefile
yum/Makefile
])
AC_OUTPUT([
+ rpm/centos/mysql-groonga.spec
rpm/fedora/mysql-groonga.spec
])
Modified: rpm/Makefile.am (+1 -0)
===================================================================
--- rpm/Makefile.am 2010-09-03 08:30:36 +0000 (abd8fa5)
+++ rpm/Makefile.am 2010-09-03 09:21:28 +0000 (471ea98)
@@ -1,2 +1,3 @@
SUBDIRS = \
+ centos \
fedora
Added: rpm/centos/Makefile.am (+2 -0) 100644
===================================================================
--- /dev/null
+++ rpm/centos/Makefile.am 2010-09-03 09:21:28 +0000 (4db5682)
@@ -0,0 +1,2 @@
+EXTRA_DIST = mysql-groonga.spec.in
+noinst_DATA = mysql-groonga.spec
Added: rpm/centos/mysql-groonga.spec.in (+70 -0) 100644
===================================================================
--- /dev/null
+++ rpm/centos/mysql-groonga.spec.in 2010-09-03 09:21:28 +0000 (60e81cc)
@@ -0,0 +1,70 @@
+%define mysql_version 5.1.50
+%define mysql_release 1
+%define mysql_dist rhel5
+
+Name: mysql-groonga
+Version: @VERSION@
+Release: 1%{?dist}
+Summary: A MySQL storage engine powered by groonga.
+
+Group: Applications/Databases
+License: BSD
+URL: http://mroonga.github.com/
+Source0: http://github.com/downloads/mroonga/mroonga/groonga-storage-engine-@VERSION@.tar.gz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
+BuildRequires: groonga-devel
+BuildRequires: wget
+Requires: groonga-libs
+Requires: mysql-server
+
+%description
+Groonga storage engine is a MySQL storage plugin.
+
+%prep
+%setup -q -n groonga-storage-engine- @ VERSION@
+srpm=MySQL-community-%{mysql_version}-%{mysql_release}.%{mysql_dist}.src.rpm
+if [ ! -f ../../SRPMS/$srpm ]; then
+ mysql_download_base=http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.1
+ wget -O ../../SRPMS/$srpm $mysql_download_base/$srpm
+ rpm -Uvh ../../SRPMS/$srpm
+ for package in client devel embedded server shared test; do
+ rpm=MySQL-${package}-community-%{mysql_version}-%{mysql_release}.%{mysql_dist}.%{_arch}.rpm
+ mkdir -p ../../RPMS/%{_arch}
+ if [ ! -f ../../RPMS/%{_arch}/$rpm ]; then
+ wget -O ../../RPMS/%{_arch}/$rpm $mysql_download_base/$rpm
+ fi
+ done
+fi
+
+%build
+if [ ! -d ../mysql-%{mysql_version} ]; then
+ MYSQL_RPMBUILD_TEST=no rpmbuild -bc --define 'community 1' \
+ ../../SPECS/mysql-%{mysql_version}.%{mysql_dist}.spec
+fi
+%configure --with-mysql=../mysql-%{mysql_version}
+make %{?_smp_mflags}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
+rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/ha_groonga.a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" | mysql -u root mysql
+
+%postun
+echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" | mysql -u root mysql
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/mysql/plugin/
+
+%changelog
+* Fri Sep 03 2010 Kouhei Sutou <kou****@clear*****> - 0.1-1
+- initial packaging for Fedora
Modified: rpm/fedora/mysql-groonga.spec.in (+8 -9)
===================================================================
--- rpm/fedora/mysql-groonga.spec.in 2010-09-03 08:30:36 +0000 (44b0ed3)
+++ rpm/fedora/mysql-groonga.spec.in 2010-09-03 09:21:28 +0000 (e1b2b32)
@@ -1,4 +1,5 @@
%define mysql_version 5.1.45
+%define mysql_release 2%{?dist}
Name: mysql-groonga
Version: @VERSION@
@@ -19,11 +20,11 @@ Groonga storage engine is a MySQL storage plugin.
%prep
%setup -q -n groonga-storage-engine- @ VERSION@
-srpm=mysql-%{mysql_version}-2.fc13.src.rpm
-if [ ! -f ../../SOURCES/$srpm ]; then
- curl --output ../../SOURCES/$srpm \
+srpm=mysql-%{mysql_version}-%{mysql_release}.src.rpm
+if [ ! -f ../../SRPMS/$srpm ]; then
+ curl --output ../../SRPMS/$srpm \
http://ftp.iij.ad.jp/pub/linux/fedora/releases/13/Everything/source/SRPMS/$srpm
- rpm -Uvh ../../SOURCES/$srpm
+ rpm -Uvh ../../SRPMS/$srpm
fi
%build
@@ -44,17 +45,15 @@ rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/ha_groonga.a
rm -rf $RPM_BUILD_ROOT
%post
-echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" |
- mysql --defaults-file=/etc/mysql/debian.cnf
+echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" | mysql -u root mysql
%postun
-echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" |
- mysql --defaults-file=/etc/mysql/debian.cnf
+echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" | mysql -u root mysql
%files
%defattr(-,root,root,-)
%{_libdir}/mysql/plugin/
%changelog
-* Fri Sep 03 2010 Kouhei Sutou <kou****@clear*****> - 0.0.1-1
+* Fri Sep 03 2010 Kouhei Sutou <kou****@clear*****> - 0.1-1
- initial packaging for Fedora
Modified: yum/build-in-chroot.sh (+1 -1)
===================================================================
--- yum/build-in-chroot.sh 2010-09-03 08:30:36 +0000 (a63a95c)
+++ yum/build-in-chroot.sh 2010-09-03 09:21:28 +0000 (c0977eb)
@@ -108,7 +108,7 @@ build()
${CHROOT_BASE}/$target/tmp/depended-packages
run cp ${script_base_dir}/build-rpm.sh \
${CHROOT_BASE}/$target/tmp/
- run_sudo rm -rf $rpm_dir $srpm_dir
+ # run_sudo rm -rf $rpm_dir $srpm_dir
run_sudo su -c "chroot ${CHROOT_BASE}/$target /tmp/build-rpm.sh"
run mkdir -p $binary_pool_dir
run mkdir -p $source_pool_dir
Modified: yum/build-rpm.sh (+1 -48)
===================================================================
--- yum/build-rpm.sh 2010-09-03 08:30:36 +0000 (f0697d8)
+++ yum/build-rpm.sh 2010-09-03 09:21:28 +0000 (714c7d5)
@@ -31,53 +31,6 @@ if ! rpm -q groonga-repository > /dev/null 2>&1; then
fi
run yum update -y
-if [ "$distribution" = "centos" ] && ! rpm -q mysql-server > /dev/null 2>&1; then
- run yum install -y wget libtool gcc make
-
- cat <<EOF > $BUILD_SCRIPT
-#!/bin/sh
-
-base=http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.1
-srpm=\$1
-
-if [ ! -f ~/.rpmmacros ]; then
- cat <<EOM > ~/.rpmmacros
-%_topdir \$HOME/rpm
-EOM
-fi
-
-rm -rf rpm
-
-mkdir -p rpm/BUILD
-mkdir -p rpm/RPMS
-mkdir -p rpm/SRPMS
-mkdir -p rpm/SOURCES
-mkdir -p rpm/SPECS
-
-mkdir -p dependencies/RPMS
-mkdir -p dependencies/SRPMS
-
-mkdir -p tmp
-cd tmp
-wget \$base/\$srpm
-rpm2cpio \$srpm | cpio -id
-rm \$srpm
-mv *.spec ~/rpm/SPECS/
-mv * ~/rpm/SOURCES/
-cd ..
-rm -rf tmp
-rpmbuild -ba rpm/SPECS/*.spec
-
-cp -p rpm/RPMS/*/*.rpm dependencies/RPMS/
-cp -p rpm/SRPMS/*.rpm dependencies/SRPMS/
-EOF
-
- run chmod +x $BUILD_SCRIPT
- for rpm in MySQL-community-5.1.50-1.rhel5.src.rpm; do
- run su - $USER_NAME $BUILD_SCRIPT $rpm
- run rpm -Uvh /home/$USER_NAME/rpm/RPMS/*/*.rpm
- done
-fi
run yum install -y rpm-build tar ${DEPENDED_PACKAGES}
run yum clean packages
@@ -94,7 +47,7 @@ if [ ! -f ~/.rpmmacros ]; then
EOM
fi
-rm -rf rpm
+# rm -rf rpm
mkdir -p rpm/SOURCES
mkdir -p rpm/SPECS
mkdir -p rpm/BUILD
Modified: yum/mysql-groonga-depended-packages (+2 -0)
===================================================================
--- yum/mysql-groonga-depended-packages 2010-09-03 08:30:36 +0000 (91023bd)
+++ yum/mysql-groonga-depended-packages 2010-09-03 09:21:28 +0000 (09c9b73)
@@ -7,3 +7,5 @@ gperf
readline-devel
openssl-devel
time
+wget
+ncurses-devel