File build.include of Package mysql-community-server-55
1
%if 0%{?suse_version} < 1120 && 0%{?suse_version} > 0
2
%define socketpath /var/lib/mysql
3
%else
4
%define socketpath /var/run/mysql
5
%endif
6
export CFLAGS="$RPM_OPT_FLAGS -DPIC -fPIC -DUNDEF_HAVE_INITGROUPS -DFORCE_INIT_OF_VARS -fno-strict-aliasing -Wno-unused-parameter"
7
export CXXFLAGS="$CFLAGS -fno-exceptions -fno-rtti"
8
9
%if 0%{use_cmake} < 1
10
autoreconf -f -i
11
# Make the compile a function, since we do multiple builds
12
BuildMySQL() {
13
# The --enable-assembler simply does nothing on systems that do not
14
# support assembler speedups.
15
suffix="$1"; shift
16
mkdir _build$suffix
17
pushd _build$suffix
18
../configure \
19
--enable-assembler \
20
--without-readline \
21
--infodir=%{_infodir} \
22
--libdir=%{_libdir} \
23
--libexecdir=/usr/sbin \
24
--localstatedir=/var/lib/mysql \
25
--mandir=%{_mandir} \
26
--prefix=%{_prefix} \
27
--sysconfdir=/etc \
28
--with-mysqld-user=mysql \
29
--with-mysqld-group=mysql \
30
--without-debug \
31
--datadir=/usr/share \
32
--includedir=/usr/include \
33
--with-charset=utf8 \
34
--with-collation=utf8_unicode_ci \
35
--with-extra-charsets=all \
36
--with-unix-socket-path=%{socketpath}/mysql.sock \
37
--enable-thread-safe-client \
38
--with-comment="SUSE MySQL RPM" \
39
--with-libwrap \
40
--with-server-suffix=$suffix \
41
%ifarch s390 s390x
42
--with-atomic-ops=rwlocks \
43
%else
44
--with-atomic-ops=smp \
45
%endif
46
--with-ssl=/usr \
47
--with-plugins=%{builtin_plugins} \
48
HOSTNAME="/bin/hostname -f" \
49
"$@"
50
# Add this for MyISAM RAID support:
51
# --with-raid
52
# benchdir does not fit in above model. Fix when we make a separate package
53
make %{?jobs:-j%jobs}
54
nm --numeric-sort sql/mysqld > sql/mysqld.sym
55
# needed for make check, which is not VPATH aware
56
# copy the files unconditionally so that manual 'make check' after
57
# the build works, too
58
cp -a ../mysql-test/* mysql-test/
59
for i in ../sql/share/{english,charsets}; do
60
[ -d $i ] && cp -a $i sql/share/
61
done
62
cp -a ../scripts/*.sql scripts/
63
%if %{?_with_testsuite:1}0
64
pushd mysql-test; perl ./mysql-test-run.pl --force; popd
65
%endif
66
popd
67
}
68
# Build the client, extra tools, libraries
69
BuildMySQL "" --with-embedded-server
70
# build mysqld-debug
71
BuildMySQL "-debug" --with-debug --without-embedded-server
72
73
%if 0%{?prefered} > 0
74
mkdir -p _buildlibmysqld/tmp
75
cd _buildlibmysqld/tmp
76
ar -x ../../_build/libmysqld/libmysqld.a
77
gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.0 -o ../libmysqld.so.0.0.1 \
78
*.o \
79
-lpthread -lcrypt -lnsl -lssl -lcrypto -lz -lrt -lstdc++ -lm -lc
80
cd ..
81
rm -rf tmp
82
cd ..
83
%endif
84
85
%else # cmake build
86
87
BuildMySQL() {
88
mkdir _build$1
89
pushd _build$1
90
shift
91
cmake -DWITH_SSL=system \
92
-DWITH_ZLIB=system \
93
-DWITH_READLINE=0 \
94
-DWITH_LIBEDIT=0 \
95
-DINSTALL_LAYOUT=RPM \
96
-DMYSQL_UNIX_ADDR=%{socketpath}/mysql.sock \
97
-DWITH_COMMENT="openSUSE MySQL rpm" \
98
-DWITH_EXTRA_CHARSET=all \
99
-DDEFAULT_CHARSET=utf-8 -DDEFAULT_COLLATION=utf8_unicode_ci \
100
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
101
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
102
-DWITH_EMBEDDED_SERVER=true \
103
-DDENABLE_DOWNLOADS=false \
104
"$@" ..
105
make %{?jobs:-j%jobs}
106
nm --numeric-sort sql/mysqld > sql/mysqld.sym
107
popd
108
}
109
110
BuildMySQL "" -DCMAKE_BUILD_TYPE=Release -DINSTALL_SQLBENCHDIR=share
111
BuildMySQL "-debug" -DCMAKE_BUILD_TYPE=Debug
112
%endif
113