Initial import (#1083232)

This commit is contained in:
Ryan O'Hara 2014-04-28 08:56:12 -05:00
parent 74a7acb879
commit 5e1c8efb9d
6 changed files with 181 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/galera-25.3.5-src.tar.gz

26
galera-verify.patch Normal file
View File

@ -0,0 +1,26 @@
diff -up galera-25.3.5-src/galera/src/ist.cpp.verify galera-25.3.5-src/galera/src/ist.cpp
--- galera-25.3.5-src/galera/src/ist.cpp.verify 2014-04-23 20:26:54.965034827 +0200
+++ galera-25.3.5-src/galera/src/ist.cpp 2014-04-23 20:27:35.397161536 +0200
@@ -93,7 +93,8 @@ namespace
{
// Here we blindly assume that ssl globals have been initialized
// by gcomm.
- ctx.set_verify_mode(asio::ssl::context::verify_peer);
+ ctx.set_verify_mode(asio::ssl::context::verify_peer
+ | asio::ssl::context::verify_fail_if_no_peer_cert);
SSLPasswordCallback cb(conf);
ctx.set_password_callback(
boost::bind(&SSLPasswordCallback::get_password, &cb));
diff -up galera-25.3.5-src/gcomm/src/asio_protonet.cpp.verify galera-25.3.5-src/gcomm/src/asio_protonet.cpp
--- galera-25.3.5-src/gcomm/src/asio_protonet.cpp.verify 2014-04-23 20:27:02.436058241 +0200
+++ galera-25.3.5-src/gcomm/src/asio_protonet.cpp 2014-04-23 20:28:15.762287927 +0200
@@ -118,7 +118,8 @@ gcomm::AsioProtonet::AsioProtonet(gu::Co
log_info << "initializing ssl context";
set_compression(conf_);
set_cipher_list(ssl_context_.impl(), conf_);
- ssl_context_.set_verify_mode(asio::ssl::context::verify_peer);
+ ssl_context_.set_verify_mode(asio::ssl::context::verify_peer
+ | asio::ssl::context::verify_fail_if_no_peer_cert);
ssl_context_.set_password_callback(
boost::bind(&gcomm::AsioProtonet::get_ssl_password, this));

105
galera.spec Normal file
View File

@ -0,0 +1,105 @@
Name: galera
Version: 25.3.5
Release: 4%{?dist}
Summary: Synchronous multi-master wsrep provider (replication engine)
License: GPLv2
URL: http://www.codership.com/
Source0: https://launchpad.net/%{name}/3.x/%{version}/+download/%{name}-%{version}-src.tar.gz
Source1: garbd.service
Source2: garbd-wrapper
Patch1: galera-verify.patch
BuildRequires: boost-devel check-devel openssl-devel scons systemd
Requires: nmap-ncat
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
Galera is a fast synchronous multi-master wsrep provider (replication engine)
for transactional databases and similar applications. For more information
about wsrep API see http://launchpad.net/wsrep. For a description of Galera
replication engine see http://www.codership.com.
%prep
%setup -q -n %{name}-%{version}-src
%patch1 -p1
%build
export CPPFLAGS="%{optflags}"
scons %{?_smp_mflags} strict_build_flags=0
%install
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/garbd.service
install -D -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/garbd-wrapper
install -D -m 755 garb/garbd %{buildroot}%{_sbindir}/garbd
install -D -m 755 libgalera_smm.so %{buildroot}%{_libdir}/galera/libgalera_smm.so
install -D -m 644 garb/files/garb.cnf %{buildroot}%{_sysconfdir}/sysconfig/garb
install -D -m 644 COPYING %{buildroot}%{_docdir}/galera/COPYING
install -D -m 644 chromium/LICENSE %{buildroot}%{_docdir}/galera/LICENSE.chromium
install -D -m 644 asio/LICENSE_1_0.txt %{buildroot}%{_docdir}/galera/LICENSE.asio
install -D -m 644 www.evanjones.ca/LICENSE %{buildroot}%{_docdir}/galera/LICENSE.crc32
install -D -m 644 scripts/packages/README %{buildroot}%{_docdir}/galera/README
install -D -m 644 scripts/packages/README-MySQL %{buildroot}%{_docdir}/galera/README-MySQL
%post
/sbin/ldconfig
%systemd_post garbd.service
%preun
%systemd_preun garbd.service
%postun
/sbin/ldconfig
%systemd_postun_with_restart garbd.service
%files
%defattr(-,root,root,-)
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb
%dir %{_docdir}/galera
%dir %{_libdir}/galera
%{_sbindir}/garbd
%{_sbindir}/garbd-wrapper
%{_unitdir}/garbd.service
%{_libdir}/galera/libgalera_smm.so
%doc %{_docdir}/galera/COPYING
%doc %{_docdir}/galera/LICENSE.asio
%doc %{_docdir}/galera/LICENSE.crc32
%doc %{_docdir}/galera/LICENSE.chromium
%doc %{_docdir}/galera/README
%doc %{_docdir}/galera/README-MySQL
%changelog
* Thu Apr 24 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-4
- Use strict_build_flags=0 to avoid -Werror
- Remove unnecessary %clean section
* Thu Apr 24 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-3
- Include galera directories in file list
- Set CPPFLAGS to optflags
* Wed Apr 23 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-2
- Fix client certificate verification (#1090604)
* Thu Mar 27 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-1
- Update to version 25.3.5
* Mon Mar 24 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.3-2
- Add systemd service
* Sun Mar 09 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.3-1
- Initial build

38
garbd-wrapper Executable file
View File

@ -0,0 +1,38 @@
#!/usr/bin/sh
# This script is simple wrapper around garbd, that parses startup configuration.
# Its main purpose is to bridge the differences between initscript and systemd unit file.
CONFIG_FILE=/etc/sysconfig/garb
source $CONFIG_FILE
# Check that node addresses and group name are configured
if [ -z "$GALERA_NODES" ]; then
echo "List of GALERA_NODES is not configured" >&2
exit 1
fi
if [ -z "$GALERA_GROUP" ]; then
echo "GALERA_GROUP name is not configured" >&2
exit 1
fi
GALERA_PORT=${GALERA_PORT:-4567}
# Find a working node
for ADDRESS in ${GALERA_NODES} 0; do
HOST=$(echo $ADDRESS | cut -d \: -f 1)
PORT=$(echo $ADDRESS | cut -s -d \: -f 2)
PORT=${PORT:-$GALERA_PORT}
ncat --send-only --recv-only $HOST $PORT >/dev/null && break
done
if [ ${ADDRESS} == "0" ]; then
echo "None of the nodes in GALERA_NODES is accessible" >&2
exit 1
fi
OPTIONS="-a gcomm://$ADDRESS"
[ -n "$GALERA_GROUP" ] && OPTIONS="$OPTIONS -g $GALERA_GROUP"
[ -n "$GALERA_OPTIONS" ] && OPTIONS="$OPTIONS -o $GALERA_OPTIONS"
[ -n "$LOG_FILE" ] && OPTIONS="$OPTIONS -l $LOG_FILE"
exec /usr/sbin/garbd $OPTIONS

10
garbd.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Galera Arbitrator Daemon
Documentation=http://www.codership.com/wiki/doku.php?id=galera_arbitrator
[Service]
ExecStart=/usr/sbin/garbd-wrapper
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
173e91a48fc13bd341e90d67375aeed8 galera-25.3.5-src.tar.gz