-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMariaDB.spec
144 lines (114 loc) · 5.26 KB
/
MariaDB.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Restore old style debuginfo creation for rpm >= 4.14.
%undefine _debugsource_packages
%undefine _debuginfo_subpackages
%global libmariadb_commit 51b2a62
%global wolfssl_commit 8970ff4
# -*- rpm-spec -*-
Summary: MariaDB: a very fast and robust SQL database server
Name: MariaDB
%if "0%{?_version}" == "0"
Version: 10.4.34
%else
Version: %{_version}
%endif
%if "0%{?_release}" == "0"
Release: 4%{?dist}
%else
Release: %{_release}%{?dist}
%endif
License: GPLv2
Group: Applications/Databases
Vendor: MariaDB Foundation
BuildRoot: %_topdir/mariadb-%{version}
Source0: https://github.com/MariaDB/server/archive/mariadb-%{version}/server-mariadb-%{version}.tar.gz
Source1: https://github.com/MariaDB/mariadb-connector-c/archive/%{libmariadb_commit}/mariadb-connector-c-%{libmariadb_commit}.tar.gz
Source2: https://github.com/wolfSSL/wolfssl/archive/%{wolfssl_commit}/wolfssl-%{wolfssl_commit}.tar.gz
Patch1: 0001-Allow-building-with-flto-flag.patch
BuildRequires: bison boost-devel coreutils checkpolicy binutils cmake make libcurl-devel ncurses-devel systemtap-sdt-devel libevent-devel libaio-devel cracklib-devel glibc-devel zlib-devel xz-devel systemd-devel libxcrypt-devel java-1.8.0-openjdk java-1.8.0-openjdk-headless Judy-devel krb5-devel libxml2-devel libxml2 unixODBC-devel unixODBC openssl-devel pam-devel pkgconf-pkg-config readline-devel policycoreutils libzstd-devel snappy-devel lz4-devel gnutls-devel llvm lld clang gperftools-devel procps-ng
%define debug_package %{nil}
%define _rpmdir %_topdir/RPMS
%define _srcrpmdir %_topdir/SRPMS
%define _unpackaged_files_terminate_build 0
%define mysql_vendor MariaDB Foundation
%define mysqlversion %{version}
%define mysqlbasedir /usr
%define mysqldatadir /var/lib/mysql
%define mysqld_user mysql
%define mysqld_group mysql
%define _bindir /usr/bin
%define _sbindir /usr/sbin
%define _sysconfdir /etc
%define restart_flag_dir %{_localstatedir}/lib/rpm-state/mariadb
%define restart_flag %{restart_flag_dir}/need-restart
%define pretrans %{nil}
%{?filter_setup:
%filter_provides_in \.\(test\|result\|h\|cc\|c\|inc\|opt\|ic\|cnf\|rdiff\|cpp\)$
%filter_requires_in \.\(test\|result\|h\|cc\|c\|inc\|opt\|ic\|cnf\|rdiff\|cpp\)$
%filter_from_provides /perl(\(mtr\|My::\)/d
%filter_from_requires /\(lib\(ft\|lzma\|tokuportability\)\)\|\(perl(\(.*mtr\|My::\|.*HandlerSocket\|Mysql\)\)/d
%filter_setup
}
%define ignore #
%description
MariaDB: a very fast and robust SQL database server
It is GPL v2 licensed, which means you can use the it free of charge under the
conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
MariaDB documentation can be found at https://mariadb.com/kb
MariaDB bug reports should be submitted through https://jira.mariadb.org
# This is a shortcutted spec file generated by CMake RPM generator
# we skip _install step because CPack does that for us.
# We do only save CPack installed tree in _prepr
# and then restore it in build.
%prep
%setup -q -c
%setup -q -T -D -a 1
mv -fT mariadb-connector-c-%{libmariadb_commit}* server-mariadb-%{version}/libmariadb
%setup -q -T -D -a 2
mv -fT wolfssl-%{wolfssl_commit}* server-mariadb-%{version}/extra/wolfssl/wolfssl
%patch1 -p1 -d server-mariadb-%{version}/
%build
mkdir cpack_rpm_build_dir
cd cpack_rpm_build_dir
export CPPFLAGS='-ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--strip-all -Wno-unused-command-line-argument -fuse-ld=lld -fvectorize -fslp-vectorize -fwhole-program-vtables -flto'
export LDFLAGS='-Wl,--gc-sections -Wl,--strip-all'
%ifarch x86_64
export CPPFLAGS="${CPPFLAGS} -march=x86-64-v2 -mtune=westmere"
%endif
'/usr/bin/cmake' -DRPM=rh%{suffix:%dist} \
-DLZ4_LIBS=%{_libdir}/liblz4.so \
-DWITH_INNODB_LZ4=ON \
-DWITH_ROCKSDB_LZ4=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_LINKER=/usr/bin/lld \
-DCMAKE_AR=/usr/bin/llvm-ar \
-DCMAKE_C_FLAGS="$CPPFLAGS" \
-DCMAKE_CXX_FLAGS="$CPPFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="-ltcmalloc_minimal $LD_FLAGS" \
-DBUILD_CONFIG=mysql_release \
-DWITH_EMBEDDED_SERVER=no \
-DWITH_SAFEMALLOC=OFF \
-DWITH_SSL=bundled \
-DWITH_JEMALLOC=no \
-DWITH_WSREP=no \
-DWITH_UNIT_TESTS=no \
-DPLUGIN_TOKUDB=NO \
-DPLUGIN_SPIDER=NO \
-DPLUGIN_SPHINX=NO \
-DCPACK_PACKAGING_INSTALL_PREFIX=/ ../server-mariadb-%{version}
make %{?_smp_mflags}
%install
cd cpack_rpm_build_dir
cpack -D CPACK_RPM_PACKAGE_RELEASE=%{release} -G RPM
mv *.rpm %_rpmdir
%clean
%changelog
* Fri Jan 19 2024 Gordan Bobic <gordan@shatteredsilicon.net> - 10.4.32-4
Build time optimisations
* Wed Nov 15 2023 Gordan Bobic <gordan@shatteredsilicon.net> - 10.4.32-3
Update to 10.4.32
* Fri Oct 27 2023 Gordan Bobic <gordan@shatteredsilicon.net> - 10.4.31-3
Optimization to reduce binary and package sizes
* Sun Jul 4 2010 Eric Noulard <eric.noulard@gmail.com> - 10.4.31-1
Generated by CPack RPM (no Changelog file were provided)