mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] mariadb: new package
@ 2017-05-22  9:01 Bastian Stender
  0 siblings, 0 replies; only message in thread
From: Bastian Stender @ 2017-05-22  9:01 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Stender

MariaDB is a MySQL fork. Therefore the MySQL rule was adapted to fit
MariaDB.

As MariaDB uses the same binary names as MySQL the packages conflict.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
 projectroot/etc/group                              |   1 +
 projectroot/etc/mariadb/my.cnf                     |  73 ++++++
 projectroot/etc/passwd                             |   1 +
 .../usr/lib/systemd/system/mariadb-init.service    |  39 ++++
 projectroot/usr/lib/systemd/system/mariadb.service | 148 ++++++++++++
 rules/host-mariadb.in                              |  11 +
 rules/host-mariadb.make                            |  45 ++++
 rules/mariadb.in                                   |  31 +++
 rules/mariadb.make                                 | 247 +++++++++++++++++++++
 9 files changed, 596 insertions(+)
 create mode 100644 projectroot/etc/mariadb/my.cnf
 create mode 100644 projectroot/usr/lib/systemd/system/mariadb-init.service
 create mode 100644 projectroot/usr/lib/systemd/system/mariadb.service
 create mode 100644 rules/host-mariadb.in
 create mode 100644 rules/host-mariadb.make
 create mode 100644 rules/mariadb.in
 create mode 100644 rules/mariadb.make

diff --git a/projectroot/etc/group b/projectroot/etc/group
index 452be04a2..821abdc6e 100644
--- a/projectroot/etc/group
+++ b/projectroot/etc/group
@@ -20,6 +20,7 @@ lock:x:114:
 audio:x:115:
 input:x:116:
 mysql:x:117:
+mariadb:x:119:
 systemd-journal:x:201:
 systemd-network:x:202:
 systemd-journal-gateway:x:206:
diff --git a/projectroot/etc/mariadb/my.cnf b/projectroot/etc/mariadb/my.cnf
new file mode 100644
index 000000000..10a75d168
--- /dev/null
+++ b/projectroot/etc/mariadb/my.cnf
@@ -0,0 +1,73 @@
+# Example MySQL config file for small systems.
+#
+# This is for a system with little memory (<= 64M) where MySQL is only used
+# from time to time and it's important that the mysqld daemon
+# doesn't use much resources.
+#
+# MySQL programs look for option files in a set of
+# locations which depend on the deployment platform.
+# You can copy this option file to one of those
+# locations. For information about these locations, see:
+# http://dev.mysql.com/doc/mysql/en/option-files.html
+#
+# In this file, you can use all long options that a program supports.
+# If you want to know which options a program supports, run the program
+# with the "--help" option.
+
+# Here follows entries for some specific programs
+
+# The MySQL server
+[mysqld]
+# These are commonly set, remove the # and set as required.
+#port = .....
+#socket = .....
+
+skip-external-locking
+key_buffer_size = 16K
+max_allowed_packet = 1M
+table_open_cache = 4
+sort_buffer_size = 64K
+read_buffer_size = 256K
+read_rnd_buffer_size = 256K
+net_buffer_length = 2K
+thread_stack = 240K
+
+# Don't listen on a TCP/IP port at all. This can be a security enhancement,
+# if all processes that need to connect to mysqld run on the same host.
+# All interaction with mysqld must be made via Unix sockets or named pipes.
+# Note that using this option without enabling named pipes on Windows
+# (using the "enable-named-pipe" option) will render mysqld useless!
+# 
+#skip-networking
+#server-id	= 1
+
+# Uncomment the following if you want to log updates
+#log-bin=mysql-bin
+
+# binary logging format - mixed recommended
+#binlog_format=mixed
+
+# Causes updates to non-transactional engines using statement format to be
+# written directly to binary log. Before using this option make sure that
+# there are no dependencies between transactional and non-transactional
+# tables such as in the statement INSERT INTO t_myisam SELECT * FROM
+# t_innodb; otherwise, slaves may diverge from the master.
+#binlog_direct_non_transactional_updates=TRUE
+
+# Uncomment the following if you are using InnoDB tables
+#innodb_data_home_dir = @localstatedir@
+#innodb_data_file_path = ibdata1:10M:autoextend
+#innodb_log_group_home_dir = @localstatedir@
+# You can set .._buffer_pool_size up to 50 - 80 %
+# of RAM but beware of setting memory usage too high
+#innodb_buffer_pool_size = 8M
+#innodb_additional_mem_pool_size = 2M
+# Set .._log_file_size to 25 % of buffer pool size
+#innodb_log_file_size = 5M
+#innodb_log_buffer_size = 8M
+#innodb_flush_log_at_trx_commit = 1
+#innodb_lock_wait_timeout = 50
+
+# we have a read-only filesystem with one persistent writeable area only
+# so point to this single writeable location
+datadir = /var/lib/mysql/data
diff --git a/projectroot/etc/passwd b/projectroot/etc/passwd
index 65653c044..078d77808 100644
--- a/projectroot/etc/passwd
+++ b/projectroot/etc/passwd
@@ -4,6 +4,7 @@ ftp:x:11:101:ftp user:/home:/bin/false
 www:x:12:102:www user:/home:/bin/false
 sshd:x:100:65534:SSH Server:/var/run/sshd:/bin/false
 mysql:x:101:117:mySQL Server:/var/run/mysql:/bin/false
+mariadb:x:118:119:mariaDB Server:/var/run/mysql:/bin/false
 messagebus:x:103:104:messagebus:/dev/null:/bin/false
 systemd-network:x:202:202:systemd-network:/dev/null:/bin/false
 systemd-resolve:x:203:65534:systemd-resolve:/dev/null:/bin/false
diff --git a/projectroot/usr/lib/systemd/system/mariadb-init.service b/projectroot/usr/lib/systemd/system/mariadb-init.service
new file mode 100644
index 000000000..7d420cc24
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/mariadb-init.service
@@ -0,0 +1,39 @@
+# Copyright (c) 2017, Pengutronix
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# MariaDB run-time preparation
+#
+# Preparation must be run once if the "data" (=working directory) does not
+# exist yet.
+# Since we expect a read-only root filesystem, we need one writeable filesystem
+# part at "/var/lib/mysql".
+#
+# Since we change some permissions, the script itself must run as user 'root'
+#
+
+[Unit]
+Description=MariaDB Server Initialization Service
+RequiresMountsFor=/var/lib/mysql
+ConditionPathExists=!/var/lib/mysql/data
+
+[Service]
+User=root
+Group=root
+Type=oneshot
+RemainAfterExit=yes
+
+ExecStart=/bin/chown -R mariadb:mariadb /var/lib/mysql
+ExecStart=/bin/chmod 0755 /var/lib/mysql
+
+ExecStart=/usr/scripts/mysql_install_db --basedir=/usr --datadir=/var/lib/mysql/data --user=mariadb
+
+[Install]
+WantedBy=multi-user.target
diff --git a/projectroot/usr/lib/systemd/system/mariadb.service b/projectroot/usr/lib/systemd/system/mariadb.service
new file mode 100644
index 000000000..2759a7bea
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/mariadb.service
@@ -0,0 +1,148 @@
+#
+# /usr/lib/systemd/system/mariadb.service
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# Thanks to:
+# Daniel Black
+# Erkan Yanar
+# David Strauss
+# and probably others
+
+[Unit]
+Description=MariaDB database server
+Requires=mariadb-init.service
+After=mariadb-init.service
+
+[Install]
+WantedBy=multi-user.target
+Alias=mysql.service
+Alias=mysqld.service
+
+[Service]
+
+##############################################################################
+## Core requirements
+##
+
+# Setting this to true can break replication settings
+# See also bind-address mysqld option.
+PrivateNetwork=false
+
+##############################################################################
+## Package maintainers
+##
+
+User=mariadb
+Group=mariadb
+
+# To allow memlock to be used as non-root user if set in configuration
+CapabilityBoundingSet=CAP_IPC_LOCK
+
+# Prevent writes to /usr, /boot, and /etc
+ProtectSystem=full
+
+# Doesn't yet work properly with SELinux enabled
+# NoNewPrivileges=true
+
+PrivateDevices=true
+
+# Prevent accessing /home, /root and /run/user
+ProtectHome=true
+
+# Execute pre and post scripts as root, otherwise it does it as User=
+PermissionsStartOnly=true
+
+
+
+# Perform automatic wsrep recovery. When server is started without wsrep,
+# galera_recovery simply returns an empty string. In any case, however,
+# the script is not expected to return with a non-zero status.
+# It is always safe to unset _WSREP_START_POSITION environment variable.
+# Do not panic if galera_recovery script is not available. (MDEV-10538)
+ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
+ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
+ VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
+ && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
+
+# Needed to create system tables etc.
+# ExecStartPre=/usr/scripts/mysql_install_db -u mariadb
+
+# Start main service
+# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
+# Use the [service] section and Environment="MYSQLD_OPTS=...".
+# This isn't a replacement for my.cnf.
+# _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster
+ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
+
+
+# Unset _WSREP_START_POSITION environment variable.
+ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
+
+KillMode=process
+KillSignal=SIGTERM
+
+# Don't want to see an automated SIGKILL ever
+SendSIGKILL=no
+
+# Restart crashed server only, on-failure would also restart, for example, when
+# my.cnf contains unknown option
+Restart=on-abort
+RestartSec=5s
+
+UMask=007
+
+##############################################################################
+## USERs can override
+##
+##
+## by creating a file in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
+## and adding/setting the following will override this file's settings.
+
+# Useful options not previously available in [mysqld_safe]
+
+# Kernels like killing mysqld when out of memory because its big.
+# Lets temper that preference a little.
+# OOMScoreAdjust=-600
+
+# Explicitly start with high IO priority
+# BlockIOWeight=1000
+
+# If you don't use the /tmp directory for SELECT ... OUTFILE and
+# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
+PrivateTmp=false
+
+##
+## Options previously available to be set via [mysqld_safe]
+## that now needs to be set by systemd config files as mysqld_safe
+## isn't executed.
+##
+
+# Number of files limit. previously [mysqld_safe] open-file-limit
+LimitNOFILE=5000
+
+# Maximium core size. previously [mysqld_safe] core-file-size
+# LimitCore=
+
+# Nice priority. previously [mysqld_safe] nice
+# Nice=-5
+
+# Timezone. previously [mysqld_safe] timezone
+# Environment="TZ=UTC"
+
+# Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
+# (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
+# Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=
+
+# Flush caches. previously [mysqld_safe] flush-caches=1
+# ExecStartPre=sync
+# ExecStartPre=sysctl -q -w vm.drop_caches=3
+
+# numa-interleave=1 equalivant
+# Change ExecStart=numactl --interleave=all /usr/bin/mysqld......
+
+# crash-script equalivent
+# FailureAction=
diff --git a/rules/host-mariadb.in b/rules/host-mariadb.in
new file mode 100644
index 000000000..17fbf16cf
--- /dev/null
+++ b/rules/host-mariadb.in
@@ -0,0 +1,11 @@
+## SECTION=hosttools_noprompt
+
+config HOST_MARIADB
+	tristate
+	default ALLYES
+	select HOST_LIBAIO
+	select HOST_NCURSES
+	select HOST_CMAKE
+	select HOST_SYSTEMD
+	help
+	  Required host part of the MariaDB build system
diff --git a/rules/host-mariadb.make b/rules/host-mariadb.make
new file mode 100644
index 000000000..6cf7b04d7
--- /dev/null
+++ b/rules/host-mariadb.make
@@ -0,0 +1,45 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Bastian Stender <bst@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_MARIADB) += host-mariadb
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/host-mariadb.extract:
+	@$(call targetinfo)
+	@$(call clean, $(HOST_MARIADB_DIR))
+	@$(call extract, HOST_MARIADB)
+	@$(call patchin, HOST_MARIADB)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare + Compile
+# ----------------------------------------------------------------------------
+
+#
+# cmake
+#
+HOST_MARIADB_CONF_TOOL	:= cmake
+HOST_MARIADB_CONF_OPT	:= \
+	$(HOST_CMAKE_OPT) \
+	-DCMAKE_INSTALL_PREFIX:PATH=/usr \
+	-DSTACK_DIRECTION=1 \
+	-DHAVE_LLVM_LIBCPP_EXITCODE=no \
+	-DHAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE_EXITCODE=no \
+	-DWITH_ZLIB="bundled"
+
+HOST_MARIADB_CXXFLAGS := -std=c++98
+
+# vim: syntax=make
diff --git a/rules/mariadb.in b/rules/mariadb.in
new file mode 100644
index 000000000..e3197da7d
--- /dev/null
+++ b/rules/mariadb.in
@@ -0,0 +1,31 @@
+## SECTION=applications
+
+menuconfig MARIADB
+	tristate
+	depends on !MYSQL
+	select HOST_CMAKE
+	select HOST_MARIADB
+	select LIBAIO
+	select ZLIB
+	select LIBC_PTHREAD
+	select LIBC_RT
+	select LIBC_M
+	select LIBC_CRYPT
+	select LIBC_DL
+	select GCCLIBS_CXX
+	select GCCLIBS_GCC_S
+	select NCURSES
+	select SYSTEMD		if MARIADB_SYSTEMD
+	prompt "mariadb                       "
+	help
+	  MariaDB, a SQL database engine
+
+if MARIADB
+
+config MARIADB_SYSTEMD
+	bool
+	depends on INITMETHOD_SYSTEMD
+	default y
+	prompt "systemd support"
+
+endif
diff --git a/rules/mariadb.make b/rules/mariadb.make
new file mode 100644
index 000000000..4d2c7d3a4
--- /dev/null
+++ b/rules/mariadb.make
@@ -0,0 +1,247 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Bastian Stender <bst@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_MARIADB) += mariadb
+
+#
+# Paths and names
+#
+MARIADB_VERSION	:= 10.1.23
+MARIADB_MD5	:= 1a7392cc05c7c249acd4495022719ca8
+MARIADB		:= mariadb-$(MARIADB_VERSION)
+MARIADB_SUFFIX	:= tar.gz
+MARIADB_URL	:= https://downloads.mariadb.com/MariaDB/$(MARIADB)/source/$(MARIADB).$(MARIADB_SUFFIX)
+MARIADB_SOURCE	:= $(SRCDIR)/$(MARIADB).$(MARIADB_SUFFIX)
+MARIADB_DIR	:= $(BUILDDIR)/$(MARIADB)
+MARIADB_LICENSE	:= GPL-2.0
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/mariadb.extract:
+	@$(call targetinfo)
+	@$(call clean, $(MARIADB_DIR))
+	@$(call extract, MARIADB)
+	@$(call patchin, MARIADB)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+# MARIADB_PLUGINS_ENABLED-y builds plugin dynamically
+# MARIADB_PLUGINS_ENABLES-y builds plugin statically
+# MARIADB_PLUGINS_ENABLE- disables plugin
+MARIADB_PLUGINS_ENABLE- += ARCHIVE
+MARIADB_PLUGINS_ENABLE- += ARIA
+MARIADB_PLUGINS_ENABLE- += AUDIT_NULL
+MARIADB_PLUGINS_ENABLE- += AUTH_0X0100
+MARIADB_PLUGINS_ENABLE- += AUTH_ED25519
+MARIADB_PLUGINS_ENABLE- += AUTH_SOCKET
+MARIADB_PLUGINS_ENABLE- += AUTH_TEST_PLUGIN
+MARIADB_PLUGINS_ENABLE- += AWS_KEY_MANAGEMENT
+MARIADB_PLUGINS_ENABLE- += BLACKHOLE
+MARIADB_PLUGINS_ENABLE- += CLIENT_ED25519
+MARIADB_PLUGINS_ENABLE- += CONNECT
+MARIADB_PLUGINS_ENABLE- += DAEMON_EXAMPLE
+MARIADB_PLUGINS_ENABLE- += DEBUG_KEY_MANAGEMENT
+MARIADB_PLUGINS_ENABLE- += DIALOG
+MARIADB_PLUGINS_ENABLE- += DIALOG_EXAMPLES
+MARIADB_PLUGINS_ENABLE- += EXAMPLE
+MARIADB_PLUGINS_ENABLE- += EXAMPLE_KEY_MANAGEMENT
+MARIADB_PLUGINS_ENABLE- += FEDERATED
+MARIADB_PLUGINS_ENABLE- += FEDERATEDX
+MARIADB_PLUGINS_ENABLE- += FEEDBACK
+MARIADB_PLUGINS_ENABLE- += FILE_KEY_MANAGEMENT
+MARIADB_PLUGINS_ENABLE- += FTEXAMPLE
+MARIADB_PLUGINS_ENABLE- += HANDLERSOCKET
+MARIADB_PLUGINS_ENABLE- += INNOBASE
+MARIADB_PLUGINS_ENABLE- += LOCALES
+MARIADB_PLUGINS_ENABLE- += METADATA_LOCK_INFO
+MARIADB_PLUGINS_ENABLE- += MROONGA
+MARIADB_PLUGINS_ENABLE- += MYSQL_CLEAR_PASSWORD
+# some plugins depend on static build PARTITION
+MARIADB_PLUGINS_ENABLE- += PARTITION
+MARIADB_PLUGINS_ENABLE- += PERFSCHEMA
+MARIADB_PLUGINS_ENABLE- += QA_AUTH_CLIENT
+MARIADB_PLUGINS_ENABLE- += QA_AUTH_INTERFACE
+MARIADB_PLUGINS_ENABLE- += QA_AUTH_SERVER
+MARIADB_PLUGINS_ENABLE- += QUERY_CACHE_INFO
+MARIADB_PLUGINS_ENABLE- += QUERY_RESPONSE_TIME
+MARIADB_PLUGINS_ENABLE- += SEMISYNC_MASTER
+MARIADB_PLUGINS_ENABLE- += SEMISYNC_SLAVE
+MARIADB_PLUGINS_ENABLE- += SEQUENCE
+MARIADB_PLUGINS_ENABLE- += SERVER_AUDIT
+MARIADB_PLUGINS_ENABLE- += SIMPLE_PASSWORD_CHECK
+MARIADB_PLUGINS_ENABLE- += SPHINX
+MARIADB_PLUGINS_ENABLE- += SPIDER
+MARIADB_PLUGINS_ENABLE- += SQL_ERRLOG
+MARIADB_PLUGINS_ENABLE- += TEST_SQL_DISCOVERY
+MARIADB_PLUGINS_ENABLE- += TOKUDB
+MARIADB_PLUGINS_ENABLE- += WSREP_INFO
+MARIADB_PLUGINS_ENABLE- += XTRADB
+
+#
+# cmake
+#
+MARIADB_CONF_TOOL	:= cmake
+
+# 10.1.23 does not build with CONNECT_WITH_ZIP=OFF
+MARIADB_CONF_OPT	:= \
+	$(CROSS_CMAKE_USR) \
+	-DSTACK_DIRECTION=1 \
+	-DIMPORT_EXECUTABLES=$(HOST_MARIADB_DIR)-build/import_executables.cmake \
+	-DHAVE_LLVM_LIBCPP_EXITCODE=no \
+	-DCMAKE_INSTALL_PREFIX:PATH=/usr \
+	-DCOMMUNITY_BUILD=ON \
+	-DCONNECT_WITH_JDBC=OFF \
+	-DCONNECT_WITH_LIBXML2=OFF \
+	-DCONNECT_WITH_ODBC=OFF \
+	-DCONNECT_WITH_VCT=OFF \
+	-DCONNECT_WITH_XMAP=OFF \
+	-DCONNECT_WITH_ZIP=ON \
+	-DDISABLE_SHARED=OFF \
+	-DENABLED_LOCAL_INFILE=OFF \
+	-DENABLED_PROFILING=OFF \
+	-DENABLE_GCOV=OFF \
+	-DINSTALL_LAYOUT=STANDALONE \
+	-DMRN_GROONGA_EMBED=OFF \
+	-DMYSQL_DATADIR=/var/lib/mysql/data \
+	-DMYSQL_MAINTAINER_MODE=OFF \
+	-DNOT_FOR_DISTRIBUTION=OFF \
+	-DSECURITY_HARDENED=ON \
+	-DTMPDIR=/tmp \
+	-DUSE_ARIA_FOR_TMP_TABLES=ON \
+	-DUSE_GCOV=OFF \
+	-DWITHOUT_SERVER=OFF \
+	-DWITH_ASAN=OFF \
+	-DWITH_EMBEDDED_SERVER=OFF \
+	-DWITH_EXTRA_CHARSETS=all \
+	-DWITH_INNODB_BZIP2=OFF \
+	-DWITH_INNODB_DISALLOW_WRITES=ON \
+	-DWITH_INNODB_LZ4=OFF \
+	-DWITH_INNODB_LZMA=OFF \
+	-DWITH_INNODB_LZO=OFF \
+	-DWITH_INNODB_SNAPPY=OFF \
+	-DWITH_JEMALLOC=no \
+	-DWITH_LIBARCHIVE=OFF \
+	-DWITH_LIBWRAP=OFF \
+	-DWITH_MARIABACKUP=OFF \
+	-DWITH_PCRE=bundled \
+	-DWITH_READLINE=OFF \
+	-DWITH_SAFEMALLOC=OFF \
+	-DWITH_SYSTEMD=$(call ptx/onoff, PTXCONF_MARIADB_SYSTEMD) \
+	-DWITH_UNIT_TESTS=OFF \
+	-DWITH_VALGRIND=OFF \
+	-DWITH_WSREP=OFF \
+	-DWITH_ZLIB=system \
+	-DWITH_SSL=bundled \
+	-DWITH_LZ4=bundled \
+	-DSYSCONFDIR=/etc/mariadb \
+	-DCOMPILATION_COMMENT=PTXdist \
+	-DDEFAULT_CHARSET=latin1
+
+ifneq ($(strip $(MARIADB_PLUGINS_ENABLES-y)),)
+MARIADB_CONF_OPT += $(foreach plugin,$(MARIADB_PLUGINS_ENABLES-y),$(addprefix -DPLUGIN_,$(addsuffix =STATIC, $(plugin))))
+endif
+
+ifneq ($(strip $(MARIADB_PLUGINS_ENABLED-y)),)
+MARIADB_CONF_OPT += $(foreach plugin,$(MARIADB_PLUGINS_ENABLED-y),$(addprefix -DPLUGIN_,$(addsuffix =DYNAMIC, $(plugin))))
+endif
+
+ifneq ($(strip $(MARIADB_PLUGINS_ENABLE-)),)
+MARIADB_CONF_OPT += $(foreach plugin,$(MARIADB_PLUGINS_ENABLE-),$(addprefix -DPLUGIN_,$(addsuffix =NO, $(plugin))))
+endif
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/mariadb.compile:
+	@$(call targetinfo)
+	# we must copy it twice: once for the buildsystem, once for runtime
+	cp $(HOST_MARIADB_DIR)-build/sql/gen_lex_hash $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MARIADB_DIR)-build/sql/gen_lex_hash $(MARIADB_DIR)/sql
+	cp $(HOST_MARIADB_DIR)-build/sql/gen_lex_token $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MARIADB_DIR)-build/sql/gen_lex_token $(MARIADB_DIR)/sql
+	cp $(HOST_MARIADB_DIR)-build/extra/comp_err $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MARIADB_DIR)-build/extra/comp_err $(MARIADB_DIR)/extra
+	cp $(HOST_MARIADB_DIR)-build/scripts/comp_sql $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MARIADB_DIR)-build/scripts/comp_sql $(MARIADB_DIR)/scripts
+
+	@$(call world/compile, MARIADB)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/mariadb.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, mariadb)
+	@$(call install_fixup, mariadb, PRIORITY, optional)
+	@$(call install_fixup, mariadb, SECTION, base)
+	@$(call install_fixup, mariadb, AUTHOR, "Bastian Stender <bst@pengutronix.de>")
+	@$(call install_fixup, mariadb, DESCRIPTION, "MariaDB")
+
+#	# server stuff
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/mysqld)
+
+ifdef PTXCONF_MARIADB_SYSTEMD
+	@$(call install_alternative, mariadb, 0, 0, 0644, /usr/lib/systemd/system/mariadb.service)
+	@$(call install_link, mariadb, ../mariadb.service, \
+		/usr/lib/systemd/system/multi-user.target.wants/mariadb.service)
+
+	@$(call install_alternative, mariadb, 0, 0, 0644, /usr/lib/systemd/system/mariadb-init.service)
+	@$(call install_link, mariadb, ../mariadb-init.service, \
+		/usr/lib/systemd/system/multi-user.target.wants/mariadb-init.service)
+endif
+	@$(call install_alternative, mariadb, 0, 0, 0644, /etc/mariadb/my.cnf)
+
+#	# TODO: do we need more languages?
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/share/english/errmsg.sys)
+
+#	# TODO: do we need more charsets?
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/share/charsets/latin1.xml)
+
+#	# client stuff
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/mysql)
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/mysqladmin)
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/mysql_upgrade)
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/mysqlcheck)
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/mysqldump)
+
+#	# bootstrap script + dependencies
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/scripts/mysql_install_db)
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/my_print_defaults)
+	@$(call install_copy, mariadb, 0, 0, 0755, -, /usr/bin/resolveip)
+
+#	# bootstrap data required for mysql_install_db
+	@$(call install_copy, mariadb, 0, 0, 0644, -, /usr/share/mysql_system_tables.sql)
+	@$(call install_copy, mariadb, 0, 0, 0644, -, /usr/share/mysql_system_tables_data.sql)
+	@$(call install_copy, mariadb, 0, 0, 0644, -, /usr/share/mysql_performance_tables.sql)
+	@$(call install_copy, mariadb, 0, 0, 0644, -, /usr/share/fill_help_tables.sql)
+	@$(call install_copy, mariadb, 0, 0, 0644, -, /usr/share/maria_add_gis_sp_bootstrap.sql)
+
+	@$(call install_lib, mariadb, 0, 0, 0644, libmysqlclient)
+
+#	# create a working directory which is writeable
+	@$(call install_copy, mariadb, mariadb, mariadb, 0755, /var/lib/mysql)
+
+	@$(call install_finish, mariadb)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-22  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22  9:01 [ptxdist] [PATCH] mariadb: new package Bastian Stender

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox