Files

69 lines
2.7 KiB
Bash

# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
echo "You may remove this function if you do not intend to use it"
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
cmake -B build \
-DCOMPILATION_COMMENT="Tide Linux" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-Wno-dev \
-DINSTALL_UNIX_ADDRDIR=/run/mariadb/mariadb.sock \
-DCMAKE_INSTALL_PREFIX=/usr \
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_SBINDIR=sbin \
-DINSTALL_INCLUDEDIR=include/mariadb \
-DINSTALL_PLUGINDIR=lib/mariadb/plugin \
-DINSTALL_SYSTEMD_UNITDIR=no \
-DINSTALL_SHAREDIR=share \
-DINSTALL_SUPPORTFILESDIR=share/mariadb \
-DINSTALL_MYSQLSHAREDIR=share/mariadb \
-DINSTALL_DOCREADMEDIR=share/doc/mariadb \
-DINSTALL_DOCDIR=share/doc/mariadb \
-DINSTALL_MANDIR=share/man \
-DMYSQL_DATADIR=/srv/mariadb \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_unicode_ci \
-DENABLED_LOCAL_INFILE=ON \
-DPLUGIN_EXAMPLE=NO \
-DPLUGIN_FEDERATED=NO \
-DPLUGIN_FEEDBACK=NO \
-DWITH_EMBEDDED_SERVER=ON \
-DWITH_EXTRA_CHARSETS=complex \
-DWITH_JEMALLOC=ON \
-DWITH_LIBWRAP=OFF \
-DWITH_PCRE2=system \
-DWITH_READLINE=ON \
-DWITH_SSL=system \
-DWITH_SYSTEMD=no \
-DWITH_UNIT_TESTS=OFF \
-DWITH_ZLIB=system
cmake --build build
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
DESTDIR="$BPM_OUTPUT" cmake --install build
# Remove static libraries
rm -r "$BPM_OUTPUT"/usr/lib/*.a
# Install esvm service
install -Dm755 "$BPM_WORKDIR"/mariadb.sh "$BPM_OUTPUT"/etc/esvm/scripts/mariadb.sh
install -Dm644 "$BPM_WORKDIR"/mariadb.esv "$BPM_OUTPUT"/etc/esvm/services/mariadb.esv
# Install sysusers file
install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/mariadb.conf
# Install package license
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/mariadb/COPYING
}