Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[DIY mysql + sphinx ebuild] a step-by-step guide
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
SkyLeach
Apprentice
Apprentice


Joined: 05 Nov 2002
Posts: 177
Location: Knoxville, TN

PostPosted: Thu Mar 26, 2009 3:48 pm    Post subject: [DIY mysql + sphinx ebuild] a step-by-step guide Reply with quote

obvioulsy you could avoid this entirely if you just wanted to patch and install mysql + sphinx. It is, however, ever-so-slightly simpler to do it this way for you gentoo-users that, like I, found the need for sphinx and wanted to keep your gentoo system as close to stable as possible. I am fully aware that this is marginally hackish but I didn't feel like modifying the mysql-specific portage stuff that isn't included in the actual mysql ebuild (only imported). If it was a bit easier, I might actually propose a patch for a sphinx USE flag.

assumptions:
you have gentoolkit and gentoolkit-dev installed.
you know what sphinx is and have used an overlay before
you have /usr/local/portage set up in your make.conf either through a source or PORTDIR_OVERLAY variable.
you have the mysql use flag enabled (if not, then simply 'euse -E mysql'). I also suggest stemmer for those of you doing heavy FTI.

so, without futher discussion, here's how to do it:

install sphinx if it is not already installed:
Code:
emerge -qNa app-misc/sphinx

here are the necessary steps to set up the overlay:
Code:

cd /usr/src
tar xzvf /usr/portage/distfiles/mysql-5.0.70.tar.gz
cp -Rv mysql-5.0.70 mysql-5.0.70-orig
tar xzvf /usr/portage/distfiles/sphinx-0.9.8.1.tar.gz
cd mysql-5.0.70
patch -p1 < /usr/src/sphinx/mysqlse/sphinx-5.0.37.diff
cp -Rv /usr/src/sphinx/mysqlse ./sql/sphinx
cd sql/sphinx/
rm -fv *.diff *.php *.txt
cd /usr/src
tar xjvf /usr/portage/distfiles/mysql-extras-20081129-1041Z.tar.bz2
mv mysql-extras-20081129-1041Z/ mysql-extras-20081129-1042Z

#select the following block of code (including the blank line) before following the next step
Code:


@patch 723_all_sphinx_engine-5.0.70.patch
@ver 5.00.70.00 to 5.00.89.99
@pn mysql
@@ add sphinx engine


now, continue:

Code:
cat >> mysql-extras-20081129-1042Z/000_index.txt
#here, paste the text from above and then hit return and then ctrl+D to end the output stream, this will append to that file the name of the patch you are about to create...
diff -urN mysql-5.0.70-orig mysql-5.0.70 > mysql-extras-20081129-1042Z/723_all_sphinx_engine-5.0.70.patch
tar cjvf mysql-extras-20081129-1042Z.tar.bz2 mysql-extras-20081129-1042Z
mv -v mysql-extras-20081129-1042Z.tar.bz2 /usr/portage/distfiles/
cd /usr/local/portage
mkdir -p dev-db/mysql
cd dev-db/mysql
cp -v /usr/portage/dev-db/mysql/mysql-5.0.70-r1.ebuild ./mysql-5.0.70-r2.ebuild
cp -Rv /usr/portage/dev-db/mysql/files ./
sed -i -e "s/20081129-1041Z/20081129-1042Z/" mysql-5.0.70-r2.ebuild
ebuild mysql-5.0.70-r2.ebuild digest

Ok now that all the patching and tweaking is done, you should be ready to build, run this command:


Code:
EXTRA_ECONF="--with-sphinx-storage-engine" emerge -uDqNa dev-db/mysql


you should see this:

Code:
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild U ] dev-db/mysql-5.0.70-r2 [5.0.38-r1] USE=”berkdb big-tables extraengine perl ssl -cluster -debug -embedded -latin1 -max-idx-128 -minimal (-selinux) -static” 0 kB [?=>1]

Total: 1 package (1 upgrade), Size of downloads: 0 kB
Portage tree and overlays:
[0] /usr/portage
[1] /usr/local/portage
[?] indicates that the source repository could not be determined

Would you like to merge these packages? [Yes/No]

The important parts are the following:


  • the version to be installed needs to be dev-db/mysql-5.0.70-r2
  • it should be selected from the /usr/local/portage overlay. Check the Portage tree and overlays: list and there should be a 1 next to that overlay, if not check your PORTDIR_OVERLAY setting in /etc/make.conf

cross your fingers and hope you followed the steps ok, and simply press return to build the binary and/or type “yes” and hit return.

I hope this helps others. :-)
_________________
-SL

http://www.skyleach.org
Back to top
View user's profile Send private message
EddieOfTheRocks
n00b
n00b


Joined: 01 Feb 2007
Posts: 35
Location: Edmonton, Alberta, Canada

PostPosted: Mon Jun 08, 2009 3:36 am    Post subject: Reply with quote

So I tried this without much luck. I pasted all l that stuff into a script and ran it. The emerge successfully completed but a SHOW ENGINES has no sphinx. I ran it in a non-quiet mode and noticed that the patch IS being applied properly and the ./configure script IS getting the --with-sphinx-storage-engine but nothing in the SHOW ENGINES. Is there some additional stuff that needs to be put into the my.cnf file or something?
_________________
Eddie Carle
Back to top
View user's profile Send private message
EddieOfTheRocks
n00b
n00b


Joined: 01 Feb 2007
Posts: 35
Location: Edmonton, Alberta, Canada

PostPosted: Mon Jun 08, 2009 4:01 am    Post subject: Reply with quote

K, I figured out the issues. I few oddities with the script is all. I've made a newish script with some fixes and changes that might make things a little easier.

Code:
cd /usr/src &&
tar xzf /usr/portage/distfiles/mysql-5.0.70.tar.gz &&
cp -Rv mysql-5.0.70 mysql-5.0.70-orig &&
tar xzf /usr/portage/distfiles/sphinx-0.9.8.1.tar.gz &&
cd mysql-5.0.70 &&
patch -p1 < /usr/src/sphinx-0.9.8.1/mysqlse/sphinx.5.0.37.diff &&
cp -Rv /usr/src/sphinx-0.9.8.1/mysqlse ./sql/sphinx &&
cd sql/sphinx/ &&
rm -fv *.diff *.php *.txt &&
cd /usr/src &&
tar xjf /usr/portage/distfiles/mysql-extras-20081129-1041Z.tar.bz2 &&
mv mysql-extras-20081129-1041Z/ mysql-extras-20081129-1042Z &&
cat >> mysql-extras-20081129-1042Z/000_index.txt << EOF &&
@patch 723_all_sphinx_engine-5.0.70.patch
@ver 5.00.70.00 to 5.00.89.99
@pn mysql
@@ add sphinx engine
EOF
diff -urN mysql-5.0.70-orig mysql-5.0.70 > mysql-extras-20081129-1042Z/723_all_sphinx_engine-5.0.70.patch &&
tar cjf mysql-extras-20081129-1042Z.tar.bz2 mysql-extras-20081129-1042Z &&
mv -v mysql-extras-20081129-1042Z.tar.bz2 /usr/portage/distfiles/ &&
cd /usr/local/portage &&
mkdir -p dev-db/mysql &&
cd dev-db/mysql &&
cp -v /usr/portage/dev-db/mysql/mysql-5.0.70-r1.ebuild ./mysql-5.0.70-r2.ebuild &&
cp -Rv /usr/portage/dev-db/mysql/files ./ &&
sed -i -e "s/20081129-1041Z/20081129-1042Z/" mysql-5.0.70-r2.ebuild &&
ebuild mysql-5.0.70-r2.ebuild digest

_________________
Eddie Carle
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum