[Maria-developers] how to build mariadb RPMs

How do you build the mariadb RPMs? Are you using rpmbuild or cpack? Is there a top level script that uses rpmbuild or cpack that I should use? Thanks Rich Prohaska

Hi, Rich! On Jan 21, Rich Prohaska wrote:
How do you build the mariadb RPMs? Are you using rpmbuild or cpack? Is there a top level script that uses rpmbuild or cpack that I should use?
We use cpack. Generally, everything related to how do we build, can be seen in buildbot. Go to http://buildbot.askmonty.org/ choose a tree, click on a specific build, and then you'll see the build log, with all commands that were used. But, anyway, for rpm it's cmake -DRPM=xxx make package You can configure your build as you like, but we build our releases with cmake . -DBUILD_CONFIG=mysql_release -DRPM=fedora17 (this was on Fedora 17). The value of RPM define is used to construct file names of the generated rpm packages. Regards, Sergei

Thanks for the pointer. I will try it out. On Mon, Jan 21, 2013 at 12:01 PM, Sergei Golubchik <serg@askmonty.org> wrote:
Hi, Rich!
On Jan 21, Rich Prohaska wrote:
How do you build the mariadb RPMs? Are you using rpmbuild or cpack? Is there a top level script that uses rpmbuild or cpack that I should use?
We use cpack. Generally, everything related to how do we build, can be seen in buildbot. Go to http://buildbot.askmonty.org/ choose a tree, click on a specific build, and then you'll see the build log, with all commands that were used.
But, anyway, for rpm it's
cmake -DRPM=xxx make package
You can configure your build as you like, but we build our releases with
cmake . -DBUILD_CONFIG=mysql_release -DRPM=fedora17
(this was on Fedora 17). The value of RPM define is used to construct file names of the generated rpm packages.
Regards, Sergei

It worked very nicely. How hard to you think it is to port to MySQL? Yes, we support MySQL. On Mon, Jan 21, 2013 at 12:01 PM, Sergei Golubchik <serg@askmonty.org> wrote:
Hi, Rich!
On Jan 21, Rich Prohaska wrote:
How do you build the mariadb RPMs? Are you using rpmbuild or cpack? Is there a top level script that uses rpmbuild or cpack that I should use?
We use cpack. Generally, everything related to how do we build, can be seen in buildbot. Go to http://buildbot.askmonty.org/ choose a tree, click on a specific build, and then you'll see the build log, with all commands that were used.
But, anyway, for rpm it's
cmake -DRPM=xxx make package
You can configure your build as you like, but we build our releases with
cmake . -DBUILD_CONFIG=mysql_release -DRPM=fedora17
(this was on Fedora 17). The value of RPM define is used to construct file names of the generated rpm packages.
Regards, Sergei
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp

Hi, Rich! On Jan 22, Rich Prohaska wrote:
It worked very nicely. How hard to you think it is to port to MySQL? Yes, we support MySQL.
Not very difficult. There're changes in various CMakeLists.txt - to set correct components for files. in the main CMakeLists.txt - to read in this cpack_rpm.cmake, and in the install_layout.cmake. But generally, MySQL uses a hand-crafted mysql.spec, sometimes with extra patches on top. And invoke rpmbuild directly.
But, anyway, for rpm it's
cmake -DRPM=xxx make package
Regards, Sergei

Is it possible to change the MariaDB RPM install directory to be something like /opt/someotherplace? I tried using CMAKE_INSTALL_PREFIX but it seemed to be ignored. On Thu, Jan 24, 2013 at 9:49 AM, Sergei Golubchik <serg@askmonty.org> wrote:
Hi, Rich!
On Jan 22, Rich Prohaska wrote:
It worked very nicely. How hard to you think it is to port to MySQL? Yes, we support MySQL.
Not very difficult. There're changes in various CMakeLists.txt - to set correct components for files. in the main CMakeLists.txt - to read in this cpack_rpm.cmake, and in the install_layout.cmake.
But generally, MySQL uses a hand-crafted mysql.spec, sometimes with extra patches on top. And invoke rpmbuild directly.
But, anyway, for rpm it's
cmake -DRPM=xxx make package
Regards, Sergei

Hi, Rich! On Jan 24, Rich Prohaska wrote:
Is it possible to change the MariaDB RPM install directory to be something like /opt/someotherplace? I tried using CMAKE_INSTALL_PREFIX but it seemed to be ignored.
Set CPACK_PACKAGING_INSTALL_PREFIX, that works. It doesn't move /etc (because /etc is specified in the install_layout.cmake as an absolute path), but everything else will be under your ${CPACK_PACKAGING_INSTALL_PREFIX} path. Regards, Sergei

Hello Sergei, Mixed results when just using CMAKE_PACKAGING_INSTALL_PREFIX to build Mariadb RPMs with a non-default install prefix. Good news: the installed files use the supplied install prefix instead of /usr. Bad news: the server post install script blew up and killed my machine. It did "chown -R mysql /" by mistake. The problem is caused by %{_sbindir} not being set to the new install directory. I hacked the post install script to print some debug info. running expr : / expr: syntax error sbindir=/usr/sbin bindir=/usr/bin basedir= datadir= As you can see, the expr command is run with a null datadir, which happens because /usr/sbin/mysqld does not exist, which happens because the _sbindir variable is "/usr/sbin" rather than CMAKE_PACKAGING_INSTALL_PREFIX/sbin. Any ideas how to fix this? On Fri, Jan 25, 2013 at 11:20 AM, Sergei Golubchik <serg@askmonty.org> wrote:
Hi, Rich!
On Jan 24, Rich Prohaska wrote:
Is it possible to change the MariaDB RPM install directory to be something like /opt/someotherplace? I tried using CMAKE_INSTALL_PREFIX but it seemed to be ignored.
Set CPACK_PACKAGING_INSTALL_PREFIX, that works. It doesn't move /etc (because /etc is specified in the install_layout.cmake as an absolute path), but everything else will be under your ${CPACK_PACKAGING_INSTALL_PREFIX} path.
Regards, Sergei

Hi, Rich! On Jan 28, Rich Prohaska wrote:
Hello Sergei,
Mixed results when just using CMAKE_PACKAGING_INSTALL_PREFIX to build Mariadb RPMs with a non-default install prefix.
Good news: the installed files use the supplied install prefix instead of /usr.
Bad news: the server post install script blew up and killed my
Ouch! Were you able to fix the onwership back?
machine. It did "chown -R mysql /" by mistake. The problem is caused by %{_sbindir} not being set to the new install directory. I hacked the post install script to print some debug info.
running expr : / expr: syntax error sbindir=/usr/sbin bindir=/usr/bin basedir= datadir=
As you can see, the expr command is run with a null datadir, which happens because /usr/sbin/mysqld does not exist, which happens because the _sbindir variable is "/usr/sbin" rather than CMAKE_PACKAGING_INSTALL_PREFIX/sbin. Any ideas how to fix this?
First, it's CPACK_PACKAGING_INSTALL_PREFIX not CMAKE_PACKAGING_INSTALL_PREFIX. I hope that's what you used, and it's a typo in the email. Second, I'll soon fix the postinstall script to have some basic consistency checks on basedir/datadir before chown. It's https://mariadb.atlassian.net/browse/MDEV-4068 And third, I've created a patch that is supposed (as far as I've tested) to fix this issue. I'll push it in a few days. Note that after this patch, you're supposed to set CMAKE_INSTALL_PREFIX, not CMAKE_PACKAGING_INSTALL_PREFIX. Like cmake . -DRPM=toku -DCMAKE_INSTALL_PREFIX=/opt Regards, Sergei

Hello Sergei, I look forward to using the patch. Please let me known when and where to find it. Luckily, I used a test VM on amazon, so I did not try to recover. I just created a new VM. Also, I used CPACK_PACKAGING_INSTALL_PREFIX. On Tue, Jan 29, 2013 at 12:12 PM, Sergei Golubchik <serg@askmonty.org> wrote:
Hi, Rich!
On Jan 28, Rich Prohaska wrote:
Hello Sergei,
Mixed results when just using CMAKE_PACKAGING_INSTALL_PREFIX to build Mariadb RPMs with a non-default install prefix.
Good news: the installed files use the supplied install prefix instead of /usr.
Bad news: the server post install script blew up and killed my
Ouch! Were you able to fix the onwership back?
machine. It did "chown -R mysql /" by mistake. The problem is caused by %{_sbindir} not being set to the new install directory. I hacked the post install script to print some debug info.
running expr : / expr: syntax error sbindir=/usr/sbin bindir=/usr/bin basedir= datadir=
As you can see, the expr command is run with a null datadir, which happens because /usr/sbin/mysqld does not exist, which happens because the _sbindir variable is "/usr/sbin" rather than CMAKE_PACKAGING_INSTALL_PREFIX/sbin. Any ideas how to fix this?
First, it's CPACK_PACKAGING_INSTALL_PREFIX not CMAKE_PACKAGING_INSTALL_PREFIX. I hope that's what you used, and it's a typo in the email.
Second, I'll soon fix the postinstall script to have some basic consistency checks on basedir/datadir before chown. It's https://mariadb.atlassian.net/browse/MDEV-4068
And third, I've created a patch that is supposed (as far as I've tested) to fix this issue. I'll push it in a few days.
Note that after this patch, you're supposed to set CMAKE_INSTALL_PREFIX, not CMAKE_PACKAGING_INSTALL_PREFIX. Like
cmake . -DRPM=toku -DCMAKE_INSTALL_PREFIX=/opt
Regards, Sergei

Hello Sergei, The rpm patch worked great. Thanks On Tue, Jan 29, 2013 at 12:41 PM, Sergei Golubchik <serg@askmonty.org> wrote:
Hi, Rich!
On Jan 29, Rich Prohaska wrote:
Hello Sergei, I look forward to using the patch. Please let me known when and where to find it.
It was attached to my previous emails :)
Regards, Sergei
participants (3)
-
Rich Prohaska
-
Rich Prohaska
-
Sergei Golubchik