Skip to content

Commit d9f49a6

Browse files
bkandasaMyDanny
authored andcommitted
Added sles11 repo packages
1 parent c5dfdec commit d9f49a6

File tree

11 files changed

+2099
-0
lines changed

11 files changed

+2099
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ IF(NOT WITHOUT_SERVER)
411411
ADD_SUBDIRECTORY(internal)
412412
ENDIF()
413413
ADD_SUBDIRECTORY(packaging/rpm-oel)
414+
ADD_SUBDIRECTORY(packaging/rpm-sles)
414415
ENDIF()
415416

416417
INCLUDE(cmake/abi_check.cmake)

packaging/rpm-sles/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
17+
IF(UNIX)
18+
SET(prefix ${CMAKE_INSTALL_PREFIX})
19+
SET(SPECFILENAME "mysql.spec")
20+
# Left in current directory, to be taken during build
21+
CONFIGURE_FILE(mysql.spec.in ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY)
22+
FOREACH(fedfile my.cnf my_config.h mysql.init
23+
mysqld.service mysql-systemd-start mysql.conf
24+
filter-requires.sh filter-provides.sh)
25+
CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
26+
ENDFOREACH()
27+
ENDIF()
28+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /bin/bash
2+
#
3+
4+
/usr/lib/rpm/perl.prov $* |
5+
sed -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d'
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /bin/bash
2+
#
3+
4+
/usr/lib/rpm/perl.req $* |
5+
sed -e '/perl(GD)/d' -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d'
6+

packaging/rpm-sles/my.cnf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# For advice on how to change settings please see
2+
# http://dev.mysql.com/doc/refman/5.5/en/server-configuration-defaults.html
3+
4+
[mysqld]
5+
#
6+
# Remove leading # and set to the amount of RAM for the most important data
7+
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
8+
# innodb_buffer_pool_size = 128M
9+
#
10+
# Remove leading # to turn on a very important data integrity option: logging
11+
# changes to the binary log between backups.
12+
# log_bin
13+
#
14+
# Remove leading # to set options mainly useful for reporting servers.
15+
# The server defaults are faster for transactions and fast SELECTs.
16+
# Adjust sizes as needed, experiment to find the optimal values.
17+
# join_buffer_size = 128M
18+
# sort_buffer_size = 2M
19+
# read_rnd_buffer_size = 2M
20+
datadir=/var/lib/mysql
21+
socket=/var/lib/mysql/mysql.sock
22+
23+
# Disabling symbolic-links is recommended to prevent assorted security risks
24+
symbolic-links=0
25+
26+
# Recommended in standard MySQL setup
27+
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
28+
29+
[mysqld_safe]
30+
log-error=/var/log/mysql/mysqld.log
31+
pid-file=/var/run/mysql/mysqld.pid

packaging/rpm-sles/my_config.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Fedora supports multi arch: having 32 and 64 versions of MySQL
3+
* installed at the same time. my_config.h will differ due arch
4+
* dependent defs creating a file conflict. We move arch specific
5+
* headers to arch specific file names and include the correct arch
6+
* specific file by installing this generic file.
7+
*
8+
*/
9+
10+
#if defined(__i386__)
11+
#include "my_config_i386.h"
12+
#elif defined(__ia64__)
13+
#include "my_config_ia64.h"
14+
#elif defined(__powerpc__)
15+
#include "my_config_ppc.h"
16+
#elif defined(__powerpc64__)
17+
#include "my_config_ppc64.h"
18+
#elif defined(__s390x__)
19+
#include "my_config_s390x.h"
20+
#elif defined(__s390__)
21+
#include "my_config_s390.h"
22+
#elif defined(__sparc__) && defined(__arch64__)
23+
#include "my_config_sparc64.h"
24+
#elif defined(__sparc__)
25+
#include "my_config_sparc.h"
26+
#elif defined(__x86_64__)
27+
#include "my_config_x86_64.h"
28+
#else
29+
#error "This MySQL devel package does not work your architecture?"
30+
#endif
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#! /bin/bash
2+
#
3+
# Scripts to run by MySQL systemd service
4+
#
5+
# Needed argument: pre | post
6+
#
7+
# pre mode : try to run mysql_install_db and fix perms and SELinux contexts
8+
# post mode : ping server until answer is received
9+
#
10+
11+
install_db () {
12+
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
13+
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
14+
15+
# Restore log, dir, perms and SELinux contexts
16+
[ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
17+
log=/var/log/mysqld.log
18+
[ -e $log ] || touch $log
19+
chmod 0640 $log
20+
chown mysql:mysql $log || exit 1
21+
if [ -x /usr/sbin/restorecon ]; then
22+
/usr/sbin/restorecon "$datadir"
23+
/usr/sbin/restorecon $log
24+
fi
25+
26+
# If special mysql dir is in place, skip db install
27+
[ -d "$datadir/mysql" ] && exit 0
28+
29+
# Create initial db
30+
/usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
31+
32+
# Create a file to trigger execution of mysql_secure_installation
33+
# after server has started
34+
touch "$datadir"/.phase_two_required
35+
36+
exit 0
37+
}
38+
39+
pinger () {
40+
# Wait for ping to answer to signal startup completed,
41+
# might take a while in case of e.g. crash recovery
42+
# MySQL systemd service will timeout script if no answer
43+
ret=1
44+
while /bin/true ; do
45+
sleep 1
46+
mysqladmin ping >/dev/null 2>&1 && ret=0 && break
47+
done
48+
49+
# If server has been started successfully and file created in
50+
# install_db step is present we run mysql_secure_installation
51+
if [ $ret -eq 0 -a -e "$datadir"/.phase_two_required -a -x /usr/bin/mysql_secure_installation ] ; then
52+
/usr/bin/mysql_secure_installation --use-default --defaults-file=/etc/my.cnf
53+
rm -f "$datadir"/.phase_two_required
54+
fi
55+
56+
exit 0
57+
}
58+
59+
# main
60+
case $1 in
61+
"pre") install_db ;;
62+
"post") pinger ;;
63+
esac
64+
65+
exit 0
66+

packaging/rpm-sles/mysql.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d /var/run/mysqld 0755 mysql mysql -

0 commit comments

Comments
 (0)