Adds mysql-dev and mariadb-dev elements

It have to be separate elements because installation differs depending
whether mysql or mariadb is used.

Change-Id: I9299b8e21a5ea2ff13ab9f11d851703a67c6b130
This commit is contained in:
Jan Provaznik 2014-03-26 04:21:23 -04:00
parent 06668bb32c
commit 195ad9d595
9 changed files with 89 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Installs mariadb devel package
This is a separate element because different devel packages are installed for
mysql and for mariadb.

View File

@ -0,0 +1 @@
mysql-dev

View File

@ -0,0 +1,9 @@
#!/bin/bash
# The mariadb download url arch values are not the same as ours
if [ $ARCH = "i386" ]; then
MARIADB_ARCH=x86
else
MARIADB_ARCH=$ARCH
fi
export MARIADB_ARCH

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -eux
install-packages libmariadb-dev
# TODO: fedora mysql_config has to be tweaked to exclude probes_mysql lib
# https://mariadb.atlassian.net/browse/MDEV-5793
FILE=$(which mysql_config)
if $FILE --libs_r | grep probes_mysql;then
sed -i.orig "s/-lprobes_mysql//" $FILE
fi

View File

@ -0,0 +1,53 @@
#!/bin/bash
set -e
set -o xtrace
# repo urls
# 5.5 version is used instead of 10.0 (which is already out) because of
# dependency issues - python-mysql depends on mariadb-libs which conflicts
# with mysql-galera-server pkg
# http://yum.mariadb.org/5.5/fedora20-amd64
# http://yum.mariadb.org/5.5/fedora20-x86
# http://yum.mariadb.org/5.5/rhel6-amd64
# http://yum.mariadb.org/5.5/rhel6-x86
# http://mirror.jmu.edu/pub/mariadb/repo/5.5/ubuntu saucy main
# http://mirror.jmu.edu/pub/mariadb/repo/5.5/debian wheezy main
DISTRO=`lsb_release -si` || true
if [ "$DISTRO" == "RedHatEnterpriseServer" ];then
DIST_DIR="rhel"
else
DIST_DIR=$(echo "$DISTRO"|tr A-Z a-z)
fi
function add_yum_repo() {
ver=`lsb_release -sr`
cat > /etc/yum.repos.d/mariadb.repo <<eof
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/$DIST_DIR$ver-$MARIADB_ARCH
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
eof
rpmkeys --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
}
function add_apt_repo() {
local codename=`lsb_release -sc`
# http://keyserver.ubuntu.com is used both for debian and ubuntu
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository "deb http://mariadb.mirror.iweb.com//repo/5.5/$DIST_DIR $codename main"
apt-get update
}
if [[ "RedHatEnterpriseServer CentOS Fedora" =~ "$DISTRO" ]]; then
add_yum_repo
elif [[ "Ubuntu Debian" =~ "$DISTRO" ]]; then
add_apt_repo
else
echo "Distribution '$DISTRO' is not supported"
exit 1
fi

View File

@ -0,0 +1,4 @@
Installs mysql devel package
This is a separate element because different devel packages are installed for
mysql and for mariadb.

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
install-packages libmysqlclient-dev

View File

@ -1,2 +1,3 @@
mysql-dev
pip-and-virtualenv
pip-manifest

View File

@ -1,9 +1,6 @@
#!/bin/bash
set -eux
# Mysqlclient-dev is needed for MySQL-python which os-svc-install installs.
install-packages libmysqlclient-dev
install -m 0755 -o root -g root $(dirname $0)/../bin/os-svc-install /usr/local/bin/os-svc-install
install -m 0755 -o root -g root $(dirname $0)/../bin/os-svc-daemon /usr/local/bin/os-svc-daemon
install -m 0755 -o root -g root $(dirname $0)/../bin/os-db-create /usr/local/bin/os-db-create