# Buildsheet autogenerated by ravenadm tool -- Do not edit.

NAMEBASE=		mariadb105
VERSION=		10.5.28
REVISION=		2
KEYWORDS=		databases
VARIANTS=		std
SDESC[std]=		Fast SQL database server, derived from MySQL
HOMEPAGE=		https://mariadb.org/
CONTACT=		nobody

DOWNLOAD_GROUPS=	main
SITES[main]=		https://downloads.mariadb.com/MariaDB/mariadb-10.5.28/source/
DISTFILE[1]=		mariadb-10.5.28.tar.gz:main
DF_INDEX=		1
SPKGS[std]=		set
			server
			client
			dev
			man
			docs

OPTIONS_AVAILABLE=	ROCKSDB
OPTIONS_STANDARD=	ROCKSDB

BUILD_DEPENDS=		bison:primary:std
			msgpack:dev:std
			snappy:dev:std
			boost-libraries:dev:std
			krb5:dev:std
			judy:dev:std
			openpam:dev:std
BUILDRUN_DEPENDS=	boost-libraries:primary:std
			snappy:primary:std
			msgpack:primary:std
			judy:primary:std
			krb5:primary:std
			openpam:primary:std
EXRUN[server]=		client

USERS=			mysql
GROUPS=			mysql
USERGROUP_SPKG=		server

USES=			cmake zlib readline ncurses pcre2 shebangfix cpe
			python:build perl:build pkgconfig iconv:translit
			curl zstd lz4 lzo bz2 execinfo ssl:openssl30
GNOME_COMPONENTS=	libxml2

DISTNAME=		mariadb-10.5.28

LICENSE=		GPLv2:server
LICENSE_TERMS=		server:{{WRKDIR}}/TERMS
LICENSE_FILE=		GPLv2:{{WRKSRC}}/COPYING
LICENSE_AWK=		TERMS:"^\#include"
LICENSE_SOURCE=		TERMS:{{WRKSRC}}/libmysqld/libmysqld.c
LICENSE_SCHEME=		solo

CPE_PRODUCT=		mariadb
CPE_VENDOR=		mariadb
FPC_EQUIVALENT=		databases/mariadb105-server
SHEBANG_FILES=		scripts/*.sh

INSTALL_REQ_TOOLCHAIN=	yes
PLIST_SUB=		AUTHSOCKET={{AUTHSOCKET}}
			MARIADB_USER="mysql"
			MARIADB_GROUP="mysql"
			MARIADB_LOGDIR="/var/log/mysql"
RC_SUBR=		mysql:server
SUB_FILES=		my.cnf.sample
			client.cnf.sample
			server.cnf.sample
SUB_LIST=		MARIADB_DBDIR="/var/db/mysql"
			MARIADB_RUNDIR="/var/run/mysql"
			MARIADB_LOGDIR="/var/log/mysql"
			MARIADB_SOCK="mysql.sock"
			MARIADB_USER="mysql"
			OPSYS="{{OPSYS}}"

CMAKE_ARGS=		-DCOMPILATION_COMMENT="Ravenports"
			-DINSTALL_INCLUDEDIR=include/mysql
			-DINSTALL_PLUGINDIR=lib/mysql/plugin
			-DINSTALL_SHAREDIR=share
			-DINSTALL_SUPPORTFILESDIR=share/mysql
			-DINSTALL_MYSQLSHAREDIR=share/mysql
			-DINSTALL_DOCREADMEDIR=share/doc/mariadb105
			-DINSTALL_DOCDIR=share/doc/mariadb105
			-DINSTALL_LIBDIR=lib/mysql
			-DINSTALL_MANDIR=share/man
			-DINSTALL_SCRIPTDIR=bin
			-DINSTALL_MYSQLTESTDIR=
			-DINSTALL_SQLBENCHDIR=
			-DINSTALL_UNIX_ADDRDIR="/var/run/mysql/mysql.sock"
			-DINSTALL_SYSCONFDIR="etc/mysql"
			-DINSTALL_SYSCONF2DIR="etc/mysql/conf.d"
			-DINSTALL_MYSQLDATADIR="/var/db/mysql"
			-DINSTALL_PAMDATADIR="etc/mysql"
			-DINSTALL_SBINDIR=libexec
			-DDEFAULT_CHARSET=utf8mb4
			-DDEFAULT_COLLATION=utf8mb4_unicode_ci
			-DENABLED_LOCAL_INFILE=ON
			-DPLUGIN_EXAMPLE=NO
			-DPLUGIN_FEEDBACK=NO
			-DPLUGIN_TOKUDB=NO
			-DWITH_EMBEDDED_SERVER=ON
			-DWITH_EXTRA_CHARSETS=complex
			-DWITH_JEMALLOC=NO
			-DWITH_SYSTEMD=no
			-DWITH_LIBWRAP=OFF
			-DWITH_UNIT_TESTS=OFF
			-DWITH_READLINE=system
			-DWITH_SSL="{{OPENSSLBASE}}"
			-DWITH_ZLIB=system
			-DWITH_PCRE=system
			-DCMAKE_POLICY_VERSION_MINIMUM=3.5
			-Wno-dev
VAR_OPSYS[freebsd]=	CXXFLAGS=-DHAVE_POSIX_MEMALIGN=1
VAR_OPSYS[netbsd]=	MAKEFILE_LINE=AUTHSOCKET="@comment "

[ROCKSDB].DESCRIPTION=			Build RocksDB LSM Engine
[ROCKSDB].CMAKE_ARGS_OFF=		-DPLUGIN_ROCKSDB=NO
[ROCKSDB].CMAKE_ARGS_ON=		-DPLUGIN_ROCKSDB=DYNAMIC

post-patch:
	${CP} ${WRKSRC}/cmake/os/FreeBSD.cmake \
		${WRKSRC}/cmake/os/DragonFly.cmake

post-install:
	${MV} ${STAGEDIR}${PREFIX}/lib/mysql/pkgconfig/mariadb.pc \
		${STAGEDIR}${PREFIX}/lib/pkgconfig/
	${RMDIR} ${STAGEDIR}${PREFIX}/lib/mysql/pkgconfig
	${RM} ${STAGEDIR}${STD_DOCDIR}/COPYING
	${RM} ${STAGEDIR}${PREFIX}/libexec/rcmysql
	${RM} -r ${STAGEDIR}${PREFIX}/etc/mysql/init.d
	${RM} -r ${STAGEDIR}${PREFIX}/etc/mysql/logrotate.d
	${RM} -r ${STAGEDIR}/suite
	${MKDIR} ${STAGEDIR}/var/log/mysql
	# strip plugins and libraries
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/mysql/libmariadb.so
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/mysql/libmariadbd.so
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/mysql/*/*.so
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
	# strip binaries
	@flist=$$(${FIND} ${STAGEDIR}${PREFIX}/bin -type f -perm /111 -print) ;\
	for f in $$flist; do \
		(${FILE} $$f | ${GREP} -Fq ", not stripped")\
		&& ${ECHO_CMD} "Auto-stripping $$f"\
		&& ${STRIP_CMD} $$f || ${TRUE} ;\
	done
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/mariadbd
	# sample installation
	${RM} ${STAGEDIR}${PREFIX}/etc/mysql/conf.d/server.cnf
	${RM} ${STAGEDIR}${PREFIX}/etc/mysql/my.cnf
	${INSTALL_DATA} ${WRKDIR}/server.cnf.sample \
		${STAGEDIR}${PREFIX}/etc/mysql/conf.d/server.cnf.sample
	${INSTALL_DATA} ${WRKDIR}/my.cnf.sample \
		${STAGEDIR}${PREFIX}/etc/mysql/my.cnf.sample
	${INSTALL_DATA} ${WRKDIR}/client.cnf.sample \
		${STAGEDIR}${PREFIX}/etc/mysql/conf.d/client.cnf.sample
	${MV} ${STAGEDIR}${PREFIX}/etc/mysql/user_map.conf \
		${STAGEDIR}${PREFIX}/etc/mysql/user_map.conf.sample

pre-configure:
	${REINPLACE_CMD} 's|/usr/bin/env python|${PYTHON_CMD}|' \
		${WRKSRC}/CMakeLists.txt
	${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' \
		${WRKSRC}/mysys/my_default.c
	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' \
		${WRKSRC}/scripts/mysql_config.sh \
		${WRKSRC}/scripts/CMakeLists.txt

post-configure:
	${REINPLACE_CMD} -Ee 's|(#define INCLUDE.*)"$$|\1 -I${PREFIX}/include"|' \
		-e 's|(#define LIBS .*)"$$|\1 -L${PREFIX}/lib"|' \
		${BUILD_WRKSRC}/libmariadb/mariadb_config/mariadb_config.c
	# Fix build failure in mbstream, see https://jira.mariadb.org/browse/MDEV-14072
	${REINPLACE_CMD} -e 's| ${PREFIX}/lib/liblz4.so\(.* ${PREFIX}/lib/liblz4.so.*\)|\1|' \
		-e 's| ${PREFIX}/lib/liblzo2.so\(.* ${PREFIX}/lib/liblzo2.so.*\)|\1|' \
		-e 's| ${PREFIX}/lib/libsnappy.so\(.* ${PREFIX}/lib/libsnappy.so\)|\1|' \
		-e 's| -llzma\(.* -llzma\)|\1|;s| -lbz2\(.* -lbz2\)|\1|;' \
		${BUILD_WRKSRC}/extra/mariabackup/CMakeFiles/mbstream.dir/link.txt

[FILE:807:descriptions/desc.server]
MariaDB Server is one of the most popular database servers in the world.
It's made by the original developers of MySQL and guaranteed to stay open
source. Notable users include Wikipedia, WordPress.com and Google.

MariaDB turns data into structured information in a wide array of
applications, ranging from banking to websites. It is an enhanced, drop-in
replacement for MySQL. MariaDB is used because it is fast, scalable and
robust, with a rich ecosystem of storage engines, plugins and many other
tools make it very versatile for a wide variety of use cases.

MariaDB is developed as open source software and as a relational database
it provides an SQL interface for accessing data. The latest versions of
MariaDB also include GIS and JSON features.

This package contains the server and related files.


[FILE:267:descriptions/desc.client]
MariaDB Server is one of the most popular database servers in the world.
It's made by the original developers of MySQL and guaranteed to stay open
source. Notable users include Wikipedia, WordPress.com and Google.

This package contains the client and related files.


[FILE:101:distinfo]
0b5070208da0116640f20bd085f1136527f998cc23268715bcbf352e7b7f3cc1    117755203 mariadb-10.5.28.tar.gz


[FILE:4125:manifests/plist.server]
@sample etc/mysql/conf.d/server.cnf.sample
@sample etc/mysql/user_map.conf.sample
%%ROCKSDB-ON%%bin/
 mariadb-ldb
 myrocks_hotbackup
 mysql_ldb
 sst_dump
%%ROCKSDB-ON%%lib/mysql/plugin/ha_rocksdb.so
bin/
 aria_chk
 aria_dump_log
 aria_ftdump
 aria_pack
 aria_read_log
 aria_s3_copy
 innochecksum
 mariabackup
 mariadb-backup
 mariadb-client-test
 mariadb-client-test-embedded
 mariadb-config
 mariadb-conv
 mariadb-dumpslow
 mariadb-embedded
 mariadb-fix-extensions
 mariadb-install-db
 mariadb-secure-installation
 mariadb-test
 mariadb-test-embedded
 mariadb-tzinfo-to-sql
 mariadb-upgrade
 mariadb-waitpid
 mariadbd-multi
 mariadbd-safe
 mariadbd-safe-helper
 mbstream
 my_print_defaults
 myisam_ftdump
 myisamchk
 myisamlog
 myisampack
 mysql_client_test
 mysql_client_test_embedded
 mysql_embedded
 mysql_fix_extensions
 mysql_install_db
 mysql_plugin
 mysql_secure_installation
 mysql_tzinfo_to_sql
 mysql_upgrade
 mysql_waitpid
 mysqld_multi
 mysqld_safe
 mysqld_safe_helper
 mysqldumpslow
 mysqltest
 mysqltest_embedded
 perror
 resolve_stack_dump
 resolveip
 test-connect-t
 wsrep_sst_backup
 wsrep_sst_common
 wsrep_sst_mariabackup
 wsrep_sst_mysqldump
 wsrep_sst_rsync
 wsrep_sst_rsync_wan
etc/mysql/conf.d/
 client.cnf
 enable_encryption.preset
 mysql-clients.cnf
 s3.cnf
 spider.cnf
lib/mysql/
 libmariadbd.so.19
 libmysqld.so
lib/mysql/plugin/
 adt_null.so
 auth_0x0100.so
 auth_ed25519.so
 auth_gssapi.so
 auth_gssapi_client.so
 auth_pam.so
 auth_pam_v1.so
 auth_test_plugin.so
 caching_sha2_password.so
 debug_key_management.so
 dialog_examples.so
 disks.so
 example_key_management.so
 file_key_management.so
 func_test.so
 ha_archive.so
 ha_blackhole.so
 ha_connect.so
 ha_federated.so
 ha_federatedx.so
 ha_mroonga.so
 ha_oqgraph.so
 ha_s3.so
 ha_sphinx.so
 ha_spider.so
 ha_test_sql_discovery.so
 handlersocket.so
 libdaemon_example.so
 locales.so
 metadata_lock_info.so
 mypluglib.so
 qa_auth_client.so
 qa_auth_interface.so
 qa_auth_server.so
 query_cache_info.so
 query_response_time.so
 server_audit.so
 simple_password_check.so
 sql_errlog.so
 test_sql_service.so
 test_versioning.so
 type_mysql_json.so
 type_test.so
 wsrep_info.so
lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
lib/mysql/security/pam_user_map.so
libexec/
 mariadbd
 mysqld
share/groonga/
 COPYING
 README.md
share/groonga-normalizer-mysql/
 README.md
 lgpl-2.0.txt
share/mysql/
 binary-configure
 errmsg-utf8.txt
 fill_help_tables.sql
 magic
 maria_add_gis_sp.sql
 maria_add_gis_sp_bootstrap.sql
 mysql-log-rotate
 mysql.server
 mysql_performance_tables.sql
 mysql_system_tables.sql
 mysql_system_tables_data.sql
 mysql_test_data_timezone.sql
 mysql_test_db.sql
 mysqld_multi.server
 wsrep.cnf
 wsrep_notify
share/mysql/bulgarian/errmsg.sys
share/mysql/charsets/
 Index.xml
 README
 armscii8.xml
 ascii.xml
 cp1250.xml
 cp1251.xml
 cp1256.xml
 cp1257.xml
 cp850.xml
 cp852.xml
 cp866.xml
 dec8.xml
 geostd8.xml
 greek.xml
 hebrew.xml
 hp8.xml
 keybcs2.xml
 koi8r.xml
 koi8u.xml
 latin1.xml
 latin2.xml
 latin5.xml
 latin7.xml
 macce.xml
 macroman.xml
 swe7.xml
share/mysql/chinese/errmsg.sys
share/mysql/czech/errmsg.sys
share/mysql/danish/errmsg.sys
share/mysql/dutch/errmsg.sys
share/mysql/english/errmsg.sys
share/mysql/estonian/errmsg.sys
share/mysql/french/errmsg.sys
share/mysql/german/errmsg.sys
share/mysql/greek/errmsg.sys
share/mysql/hindi/errmsg.sys
share/mysql/hungarian/errmsg.sys
share/mysql/italian/errmsg.sys
share/mysql/japanese/errmsg.sys
share/mysql/korean/errmsg.sys
share/mysql/mroonga/
 AUTHORS
 COPYING
 install.sql
 uninstall.sql
share/mysql/norwegian/errmsg.sys
share/mysql/norwegian-ny/errmsg.sys
share/mysql/policy/apparmor/
 README
 usr.sbin.mysqld
 usr.sbin.mysqld.local
share/mysql/policy/selinux/
 README
 mariadb-server.fc
 mariadb-server.te
 mariadb.te
share/mysql/polish/errmsg.sys
share/mysql/portuguese/errmsg.sys
share/mysql/romanian/errmsg.sys
share/mysql/russian/errmsg.sys
share/mysql/serbian/errmsg.sys
share/mysql/slovak/errmsg.sys
share/mysql/spanish/errmsg.sys
share/mysql/swedish/errmsg.sys
share/mysql/ukrainian/errmsg.sys
@dir(%%MARIADB_USER%%,%%MARIADB_GROUP%%,) %%MARIADB_LOGDIR%%


[FILE:756:manifests/plist.client]
@sample etc/mysql/conf.d/client.cnf.sample
@sample etc/mysql/my.cnf.sample
bin/
 mariadb
 mariadb-access
 mariadb-admin
 mariadb-binlog
 mariadb-check
 mariadb-convert-table-format
 mariadb-dump
 mariadb-find-rows
 mariadb-hotcopy
 mariadb-import
 mariadb-plugin
 mariadb-setpermission
 mariadb-show
 mariadb-slap
 mariadb_config
 msql2mysql
 mysql
 mysql_config
 mysql_convert_table_format
 mysql_find_rows
 mysql_setpermission
 mysqlaccess
 mysqladmin
 mysqlbinlog
 mysqlcheck
 mysqldump
 mysqlhotcopy
 mysqlimport
 mysqlshow
 mysqlslap
 mytop
 replace
lib/mysql/
 libmariadb.so.3
 libmysqlclient.so
 libmysqlclient_r.so
 libmysqlservices.a
lib/mysql/plugin/
 client_ed25519.so
 daemon_example.ini
 dialog.so
 mysql_clear_password.so
 sha256_password.so


[FILE:7169:manifests/plist.dev]
include/mysql/
 errmsg.h
 ma_list.h
 ma_pvio.h
 ma_tls.h
 mariadb_com.h
 mariadb_ctype.h
 mariadb_dyncol.h
 mariadb_rpl.h
 mariadb_stmt.h
 mariadb_version.h
 my_alloca.h
 my_config.h
 my_global.h
 my_sys.h
 mysql.h
 mysql_com.h
 mysql_version.h
 mysqld_error.h
include/mysql/mariadb/ma_io.h
include/mysql/mysql/
 client_plugin.h
 plugin_auth.h
 plugin_auth_common.h
include/mysql/server/
 big_endian.h
 byte_order_generic.h
 byte_order_generic_x86.h
 byte_order_generic_x86_64.h
 decimal.h
 errmsg.h
 handler_ername.h
 handler_state.h
 json_lib.h
 keycache.h
 little_endian.h
 m_ctype.h
 m_string.h
 ma_dyncol.h
 mariadb_capi_rename.h
 my_alloc.h
 my_alloca.h
 my_attribute.h
 my_byteorder.h
 my_cmp.h
 my_compiler.h
 my_config.h
 my_dbug.h
 my_decimal_limits.h
 my_dir.h
 my_getopt.h
 my_global.h
 my_list.h
 my_net.h
 my_pthread.h
 my_sys.h
 my_valgrind.h
 my_xml.h
 mysql.h
 mysql_com.h
 mysql_com_server.h
 mysql_embed.h
 mysql_time.h
 mysql_version.h
 mysqld_ername.h
 mysqld_error.h
 pack.h
 sql_common.h
 sql_state.h
 sslopt-case.h
 sslopt-longopts.h
 sslopt-vars.h
 typelib.h
include/mysql/server/mysql/
 auth_dialog_client.h
 client_plugin.h
 plugin.h
 plugin_audit.h
 plugin_auth.h
 plugin_auth_common.h
 plugin_data_type.h
 plugin_encryption.h
 plugin_ftparser.h
 plugin_function.h
 plugin_password_validation.h
 service_base64.h
 service_debug_sync.h
 service_encryption.h
 service_encryption_scheme.h
 service_json.h
 service_kill_statement.h
 service_logger.h
 service_md5.h
 service_my_crypt.h
 service_my_print_error.h
 service_my_snprintf.h
 service_print_check_msg.h
 service_progress_report.h
 service_sha1.h
 service_sha2.h
 service_sql.h
 service_thd_alloc.h
 service_thd_autoinc.h
 service_thd_error_context.h
 service_thd_mdl.h
 service_thd_rnd.h
 service_thd_specifics.h
 service_thd_timezone.h
 service_thd_wait.h
 service_wsrep.h
 services.h
include/mysql/server/mysql/psi/
 mysql_file.h
 mysql_idle.h
 mysql_mdl.h
 mysql_memory.h
 mysql_ps.h
 mysql_socket.h
 mysql_sp.h
 mysql_stage.h
 mysql_statement.h
 mysql_table.h
 mysql_thread.h
 mysql_transaction.h
 psi.h
 psi_abi_v0.h
 psi_abi_v1.h
 psi_abi_v2.h
 psi_base.h
 psi_memory.h
include/mysql/server/private/
 aria_backup.h
 assume_aligned.h
 authors.h
 backup.h
 bounded_queue.h
 client_settings.h
 compat56.h
 config.h
 contributors.h
 create_options.h
 custom_conf.h
 datadict.h
 debug_sync.h
 derived_handler.h
 derror.h
 des_key_file.h
 discover.h
 dur_prop.h
 embedded_priv.h
 event_data_objects.h
 event_db_repository.h
 event_parse_data.h
 event_queue.h
 event_scheduler.h
 events.h
 field.h
 field_comp.h
 filesort.h
 filesort_utils.h
 ft_global.h
 gcalc_slicescan.h
 gcalc_tools.h
 grant.h
 group_by_handler.h
 gstream.h
 ha_partition.h
 ha_sequence.h
 handle_connections_win.h
 handler.h
 hash.h
 hash_filo.h
 heap.h
 hostname.h
 ilist.h
 init.h
 innodb_priv.h
 item.h
 item_cmpfunc.h
 item_create.h
 item_func.h
 item_geofunc.h
 item_jsonfunc.h
 item_row.h
 item_strfunc.h
 item_subselect.h
 item_sum.h
 item_timefunc.h
 item_vers.h
 item_windowfunc.h
 item_xmlfunc.h
 key.h
 keycaches.h
 lex.h
 lex_ident.h
 lex_string.h
 lex_symbol.h
 lf.h
 lock.h
 log.h
 log_event.h
 log_event_data_type.h
 log_event_old.h
 log_slow.h
 maria.h
 mariadb.h
 mdl.h
 mem_root_array.h
 message.h
 multi_range_read.h
 my_alarm.h
 my_apc.h
 my_atomic.h
 my_atomic_wrapper.h
 my_base.h
 my_bit.h
 my_bitmap.h
 my_check_opt.h
 my_compare.h
 my_context.h
 my_counter.h
 my_cpu.h
 my_crypt.h
 my_decimal.h
 my_default.h
 my_handler_errors.h
 my_json_writer.h
 my_libwrap.h
 my_md5.h
 my_minidump.h
 my_nosys.h
 my_rdtsc.h
 my_rnd.h
 my_service_manager.h
 my_stack_alloc.h
 my_stacktrace.h
 my_time.h
 my_tree.h
 my_uctype.h
 my_user.h
 myisam.h
 myisamchk.h
 myisammrg.h
 myisampack.h
 mysql_async.h
 mysqld.h
 mysqld_default_groups.h
 mysqld_suffix.h
 mysys_err.h
 nt_servc.h
 opt_range.h
 opt_subselect.h
 opt_trace.h
 opt_trace_context.h
 parse_file.h
 partition_element.h
 partition_info.h
 password.h
 pfs_file_provider.h
 pfs_idle_provider.h
 pfs_memory_provider.h
 pfs_metadata_provider.h
 pfs_socket_provider.h
 pfs_stage_provider.h
 pfs_statement_provider.h
 pfs_table_provider.h
 pfs_thread_provider.h
 pfs_transaction_provider.h
 privilege.h
 probes_mysql.h
 probes_mysql_nodtrace.h
 procedure.h
 protocol.h
 proxy_protocol.h
 queues.h
 records.h
 repl_failsafe.h
 replication.h
 rijndael.h
 rowid_filter.h
 rpl_constants.h
 rpl_filter.h
 rpl_gtid.h
 rpl_injector.h
 rpl_mi.h
 rpl_parallel.h
 rpl_record.h
 rpl_record_old.h
 rpl_reporting.h
 rpl_rli.h
 rpl_tblmap.h
 rpl_utility.h
 scheduler.h
 scope.h
 select_handler.h
 semisync.h
 semisync_master.h
 semisync_master_ack_receiver.h
 semisync_slave.h
 service_versions.h
 session_tracker.h
 set_var.h
 slave.h
 source_revision.h
 sp.h
 sp_cache.h
 sp_head.h
 sp_pcontext.h
 sp_rcontext.h
 span.h
 spatial.h
 sql_acl.h
 sql_admin.h
 sql_alloc.h
 sql_alter.h
 sql_analyse.h
 sql_analyze_stmt.h
 sql_array.h
 sql_audit.h
 sql_base.h
 sql_basic_types.h
 sql_binlog.h
 sql_bitmap.h
 sql_bootstrap.h
 sql_cache.h
 sql_callback.h
 sql_class.h
 sql_cmd.h
 sql_connect.h
 sql_const.h
 sql_crypt.h
 sql_cte.h
 sql_cursor.h
 sql_db.h
 sql_debug.h
 sql_delete.h
 sql_derived.h
 sql_digest.h
 sql_digest_stream.h
 sql_do.h
 sql_error.h
 sql_explain.h
 sql_expression_cache.h
 sql_get_diagnostics.h
 sql_handler.h
 sql_help.h
 sql_hset.h
 sql_i_s.h
 sql_insert.h
 sql_join_cache.h
 sql_lex.h
 sql_lifo_buffer.h
 sql_limit.h
 sql_list.h
 sql_load.h
 sql_locale.h
 sql_manager.h
 sql_mode.h
 sql_parse.h
 sql_partition.h
 sql_partition_admin.h
 sql_plist.h
 sql_plugin.h
 sql_plugin_compat.h
 sql_prepare.h
 sql_priv.h
 sql_profile.h
 sql_reload.h
 sql_rename.h
 sql_repl.h
 sql_schema.h
 sql_select.h
 sql_sequence.h
 sql_servers.h
 sql_show.h
 sql_signal.h
 sql_sort.h
 sql_statistics.h
 sql_string.h
 sql_table.h
 sql_tablespace.h
 sql_test.h
 sql_time.h
 sql_trigger.h
 sql_truncate.h
 sql_tvc.h
 sql_type.h
 sql_type_geom.h
 sql_type_int.h
 sql_type_json.h
 sql_type_real.h
 sql_type_string.h
 sql_udf.h
 sql_union.h
 sql_update.h
 sql_view.h
 sql_window.h
 ssl_compat.h
 strfunc.h
 structs.h
 sys_vars_shared.h
 t_ctype.h
 table.h
 table_cache.h
 thr_alarm.h
 thr_lock.h
 thr_malloc.h
 thr_timer.h
 thread_cache.h
 thread_pool_priv.h
 threadpool.h
 threadpool_generic.h
 transaction.h
 tzfile.h
 tztime.h
 uniques.h
 unireg.h
 vers_string.h
 violite.h
 waiting_threads.h
 welcome_copyright_notice.h
 win_tzname_data.h
 winservice.h
 wqueue.h
 wsrep.h
 wsrep_applier.h
 wsrep_binlog.h
 wsrep_client_service.h
 wsrep_client_state.h
 wsrep_condition_variable.h
 wsrep_high_priority_service.h
 wsrep_mutex.h
 wsrep_mysqld.h
 wsrep_mysqld_c.h
 wsrep_on.h
 wsrep_priv.h
 wsrep_schema.h
 wsrep_server_service.h
 wsrep_server_state.h
 wsrep_sst.h
 wsrep_storage_service.h
 wsrep_thd.h
 wsrep_trans_observer.h
 wsrep_types.h
 wsrep_utils.h
 wsrep_var.h
 wsrep_xid.h
 xa.h
include/mysql/server/private/atomic/
 gcc_builtins.h
 generic-msvc.h
 solaris.h
lib/mysql/
 libmariadb.a
 libmariadb.so
 libmariadbclient.a
 libmariadbd.a
 libmariadbd.so
 libmysqlclient.a
 libmysqlclient_r.a
 libmysqld.a
lib/pkgconfig/
 libmariadb.pc
 mariadb.pc
share/aclocal/mysql.m4


[FILE:1867:manifests/plist.man]
share/man/man1/
 aria_chk.1
 aria_dump_log.1
 aria_ftdump.1
 aria_pack.1
 aria_read_log.1
 aria_s3_copy.1
 galera_new_cluster.1
 galera_recovery.1
 innochecksum.1
 mariabackup.1
 mariadb-access.1
 mariadb-admin.1
 mariadb-backup.1
 mariadb-binlog.1
 mariadb-check.1
 mariadb-client-test-embedded.1
 mariadb-client-test.1
 mariadb-conv.1
 mariadb-convert-table-format.1
 mariadb-dump.1
 mariadb-dumpslow.1
 mariadb-embedded.1
 mariadb-find-rows.1
 mariadb-fix-extensions.1
 mariadb-hotcopy.1
 mariadb-import.1
 mariadb-install-db.1
 mariadb-ldb.1
 mariadb-plugin.1
 mariadb-secure-installation.1
 mariadb-service-convert.1
 mariadb-setpermission.1
 mariadb-show.1
 mariadb-slap.1
 mariadb-test-embedded.1
 mariadb-test.1
 mariadb-tzinfo-to-sql.1
 mariadb-upgrade.1
 mariadb-waitpid.1
 mariadb.1
 mariadb_config.1
 mariadbd-multi.1
 mariadbd-safe-helper.1
 mariadbd-safe.1
 mbstream.1
 msql2mysql.1
 my_print_defaults.1
 my_safe_process.1
 myisam_ftdump.1
 myisamchk.1
 myisamlog.1
 myisampack.1
 myrocks_hotbackup.1
 mysql-stress-test.pl.1
 mysql-test-run.pl.1
 mysql.1
 mysql.server.1
 mysql_client_test.1
 mysql_client_test_embedded.1
 mysql_config.1
 mysql_convert_table_format.1
 mysql_embedded.1
 mysql_find_rows.1
 mysql_fix_extensions.1
 mysql_install_db.1
 mysql_ldb.1
 mysql_plugin.1
 mysql_secure_installation.1
 mysql_setpermission.1
 mysql_tzinfo_to_sql.1
 mysql_upgrade.1
 mysql_waitpid.1
 mysqlaccess.1
 mysqladmin.1
 mysqlbinlog.1
 mysqlcheck.1
 mysqld_multi.1
 mysqld_safe.1
 mysqld_safe_helper.1
 mysqldump.1
 mysqldumpslow.1
 mysqlhotcopy.1
 mysqlimport.1
 mysqlshow.1
 mysqlslap.1
 mysqltest.1
 mysqltest_embedded.1
 mytop.1
 perror.1
 replace.1
 resolve_stack_dump.1
 resolveip.1
 wsrep_sst_backup.1
 wsrep_sst_common.1
 wsrep_sst_mariabackup.1
 wsrep_sst_mysqldump.1
 wsrep_sst_rsync.1
 wsrep_sst_rsync_wan.1
share/man/man8/
 mariadbd.8
 mysqld.8


[FILE:84:manifests/plist.docs]
share/doc/mariadb105/
 CREDITS
 INSTALL-BINARY
 README-wsrep
 README.md
 THIRDPARTY


[FILE:572:patches/patch-client_mysql.cc]
--- client/mysql.cc.orig	2025-01-28 18:36:04 UTC
+++ client/mysql.cc
@@ -62,8 +62,8 @@ static char *server_version= NULL;
 
 extern "C" {
 #if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
-#include <curses.h>
-#include <term.h>
+#include <ncurses/curses.h>
+#include <ncurses/term.h>
 #else
 #if defined(HAVE_TERMIOS_H)
 #include <termios.h>
@@ -82,7 +82,7 @@ extern "C" {
 #endif
 #undef SYSV				// hack to avoid syntax error
 #ifdef HAVE_TERM_H
-#include <term.h>
+#include <ncurses/term.h>
 #endif
 #endif
 #endif /* defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) */


[FILE:312:patches/patch-client_mysqltest.cc]
--- client/mysqltest.cc.orig	2025-01-28 18:36:04 UTC
+++ client/mysqltest.cc
@@ -46,6 +46,7 @@
 #include <stdarg.h>
 #include <violite.h>
 #define PCRE2_STATIC 1  /* Important on Windows */
+#include "pcre2.h"
 #include "pcre2posix.h" /* pcreposix regex library */
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>


[FILE:500:patches/patch-cmake_install__layout.cmake]
--- cmake/install_layout.cmake.orig	2025-01-28 18:36:04 UTC
+++ cmake/install_layout.cmake
@@ -126,8 +126,8 @@ SET(INSTALL_SUPPORTFILESDIR_STANDALONE
 SET(INSTALL_MYSQLDATADIR_STANDALONE     "data")
 
 SET(INSTALL_UNIX_ADDRDIR_STANDALONE     "/tmp/mysql.sock")
-SET(INSTALL_PAMDIR_STANDALONE           "share")
-SET(INSTALL_PAMDATADIR_STANDALONE       "share")
+SET(INSTALL_PAMDIR_STANDALONE           "lib/mysql/security")
+SET(INSTALL_PAMDATADIR_STANDALONE       "etc/mariadb")
 #
 # RPM layout
 #


[FILE:1968:patches/patch-cmake_readline.cmake]
--- cmake/readline.cmake.orig	2025-01-28 18:36:04 UTC
+++ cmake/readline.cmake
@@ -52,40 +52,17 @@ MACRO (MYSQL_CHECK_MULTIBYTE)
 ENDMACRO()
 
 MACRO (FIND_CURSES)
+ SET(CURSES_NEED_NCURSES True)
  FIND_PACKAGE(Curses REQUIRED)
  MARK_AS_ADVANCED(CURSES_CURSES_H_PATH CURSES_FORM_LIBRARY CURSES_HAVE_CURSES_H)
  IF(NOT CURSES_FOUND)
    SET(ERRORMSG "Curses library not found. Please install appropriate package,
     remove CMakeCache.txt and rerun cmake.")
-   IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-    SET(ERRORMSG ${ERRORMSG} 
-    "On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivatives " 
-    "it is ncurses-devel.")
-   ENDIF()
    MESSAGE(FATAL_ERROR ${ERRORMSG})
  ENDIF()
 
- IF(CURSES_HAVE_CURSES_H)
-   SET(HAVE_CURSES_H 1 CACHE INTERNAL "")
- ENDIF()
- IF(CMAKE_SYSTEM_NAME MATCHES "HP")
-   # CMake uses full path to library /lib/libcurses.sl 
-   # On Itanium, it results into architecture mismatch+
-   # the library is for  PA-RISC
-   SET(CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE)
- ENDIF()
+ SET(HAVE_CURSES_H 1 CACHE INTERNAL "")
 
- IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-   # -Wl,--as-needed breaks linking with -lcurses, e.g on Fedora 
-   # Lower-level libcurses calls are exposed by libtinfo
-   CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} tputs "" HAVE_TPUTS_IN_CURSES)
-   IF(NOT HAVE_TPUTS_IN_CURSES)
-     CHECK_LIBRARY_EXISTS(tinfo tputs "" HAVE_TPUTS_IN_TINFO)
-     IF(HAVE_TPUTS_IN_TINFO)
-       SET(CURSES_LIBRARY tinfo)
-     ENDIF()
-   ENDIF() 
- ENDIF()
  CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} setupterm "" HAVE_SETUPTERM)
  CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} vidattr "" HAVE_VIDATTR)
 ENDMACRO()
@@ -223,6 +200,8 @@ MACRO (MYSQL_CHECK_READLINE)
     SET(CMAKE_REQUIRED_LIBRARIES)
     SET(CMAKE_REQUIRED_INCLUDES)
   ENDIF(NOT WIN32)
+  SET(CMAKE_REQUIRED_INCLUDES ${CURSES_INCLUDE_DIR}/ncurses)
   CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H)
+  SET(CMAKE_REQUIRED_INCLUDES)
 ENDMACRO()
 


[FILE:349:patches/patch-extra_readline_CMakeLists.txt]
--- extra/readline/CMakeLists.txt.orig	2025-01-28 18:36:04 UTC
+++ extra/readline/CMakeLists.txt
@@ -56,4 +56,4 @@ ADD_LIBRARY(readline STATIC
 
 # Declare dependency
 # so every executable that links with readline links with curses as well
-TARGET_LINK_LIBRARIES(readline ${CURSES_LIBRARY})
+TARGET_LINK_LIBRARIES(readline ${CURSES_LIBRARY} tinfo)


[FILE:353:patches/patch-libmariadb_libmariadb_secure_openssl__crypt.c]
--- libmariadb/libmariadb/secure/openssl_crypt.c.orig	2025-01-28 18:36:08 UTC
+++ libmariadb/libmariadb/secure/openssl_crypt.c
@@ -36,8 +36,6 @@ static const EVP_MD *ma_hash_get_algorit
     return EVP_sha384();
   case MA_HASH_SHA512:
     return EVP_sha512();
-  case MA_HASH_RIPEMD160:
-    return EVP_ripemd160();
   default:
     return NULL;
   }


[FILE:1625:patches/patch-mysys_my__default.c]
--- mysys/my_default.c.orig	2025-01-28 18:36:05 UTC
+++ mysys/my_default.c
@@ -624,7 +624,7 @@ static int search_default_file_with_ext(
   {
     MY_STAT stat_info;
     if (!my_stat(name,&stat_info,MYF(0)))
-      return 1;
+      return 0;
     /*
       Ignore world-writable regular files (exceptions apply).
       This is mainly done to protect us to not read a file that may be
@@ -662,6 +662,14 @@ static int search_default_file_with_ext(
         add_option(ctx, name))
       goto err;
 
+  if (strstr(name, "/etc") == name)
+  {
+    fprintf(stderr,
+             "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
+             name,name);
+      goto err;
+  }
+
   while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
   {
     line++;
@@ -929,7 +937,8 @@ void my_print_default_files(const char *
           if (name[0] == FN_HOMELIB)	/* Add . to filenames in home */
             *end++= '.';
           strxmov(end, conf_file, *ext, " ", NullS);
-          fputs(name, stdout);
+          if (strstr(name, "/etc") != name)
+            fputs(name, stdout);
         }
       }
     }
@@ -1056,13 +1065,10 @@ static const char **init_default_directo
 
 #else
 
-#if defined(DEFAULT_SYSCONFDIR)
-  if (DEFAULT_SYSCONFDIR[0])
-    errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-#else
   errors += add_directory(alloc, "/etc/", dirs);
   errors += add_directory(alloc, "/etc/mysql/", dirs);
-#endif /* DEFAULT_SYSCONFDIR */
+  errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
+  errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
 
 #endif
 


[FILE:1167:patches/patch-oqgraph-MDEV-15291]
--- storage/oqgraph/oqgraph_judy.cc.orig	2025-01-28 18:36:06 UTC
+++ storage/oqgraph/oqgraph_judy.cc
@@ -27,7 +27,7 @@
 /*
   Currently the only active code that can return error is:
     judy_bitset::reset()/J1U()
-    judy_bitset::setbit()/J1S()
+    judy_bitset::jsetbit()/J1S()
 
   In most cases errors are either about wrong parameters passed to Judy
   functions or internal structures corruption. These definitely deserve
@@ -60,7 +60,7 @@ bool open_query::judy_bitset::test(size_
   return rc == 1;
 }
 
-open_query::judy_bitset& open_query::judy_bitset::setbit(size_type n)
+open_query::judy_bitset& open_query::judy_bitset::jsetbit(size_type n)
 {
   int rc;
   J1S(rc, array, n);
--- storage/oqgraph/oqgraph_judy.h.orig	2025-01-28 18:36:06 UTC
+++ storage/oqgraph/oqgraph_judy.h
@@ -63,7 +63,7 @@ namespace open_query
       if (!val)
         return reset(n);
       else
-        return setbit(n);
+        return jsetbit(n);
     }
 
     judy_bitset& set(const judy_bitset& src);
@@ -114,7 +114,7 @@ namespace open_query
   private:
     mutable void* array;
 
-    judy_bitset& setbit(size_type n);
+    judy_bitset& jsetbit(size_type n);
   };
 }
 


[FILE:757:patches/patch-scripts_CMakeLists.txt]
--- scripts/CMakeLists.txt.orig	2025-01-28 18:36:05 UTC
+++ scripts/CMakeLists.txt
@@ -131,11 +131,7 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles|Ni
   ENDFOREACH()
 ENDIF()
 
-IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-  SET (PERL_PATH "/usr/local/bin/perl")
-ELSE()
-  SET (PERL_PATH "/usr/bin/perl")
-ENDIF()
+SET (PERL_PATH "%%LOCALBASE%%/bin/perl")
 
 IF(UNIX)
   # FIND_PROC and CHECK_PID are used by mysqld_safe
@@ -150,8 +146,7 @@ ENDIF()
 
 IF(NOT FIND_PROC)
   # BSD style
-  EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
-  IF(result MATCHES 0)
+  IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|DragonFly")
      SET( FIND_PROC
        "ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
   ENDIF()


[FILE:403:patches/patch-scripts_mysql__config.sh]
--- scripts/mysql_config.sh.orig	2025-01-28 18:36:05 UTC
+++ scripts/mysql_config.sh
@@ -87,7 +87,9 @@ fi
 
 # Create options 
 libs="-L$pkglibdir @RPATH_OPTION@ @LIBS_FOR_CLIENTS@"
+libs="$libs -L%%LOCALBASE%%/lib "
 embedded_libs="-L$pkglibdir @RPATH_OPTION@ @EMB_LIBS_FOR_CLIENTS@"
+embedded_libs="$embedded_libs -L%%LOCALBASE%%/lib "
 
 include="-I$pkgincludedir"
 if [ "$basedir" != "/usr" ]; then


[FILE:445:patches/patch-scripts_mysqld__safe.sh]
--- scripts/mysqld_safe.sh.orig	2025-01-28 18:36:05 UTC
+++ scripts/mysqld_safe.sh
@@ -559,11 +559,11 @@ fi
 
 if test -z "$MYSQL_HOME"
 then
-  if test -r "$DATADIR/my.cnf"
+  if test -r "$DATADIR/etc/my.cnf"
   then
     log_error "WARNING: Found $DATADIR/my.cnf
 The data directory is not a valid location for my.cnf, please move it to
-$MY_BASEDIR_VERSION/my.cnf"
+$MY_BASEDIR_VERSION/etc/my.cnf"
   fi
   MYSQL_HOME=$MY_BASEDIR_VERSION
 fi


[FILE:516:patches/patch-scripts_wsrep__sst__mariabackup.sh]
--- scripts/wsrep_sst_mariabackup.sh.orig	2025-01-28 18:36:05 UTC
+++ scripts/wsrep_sst_mariabackup.sh
@@ -823,8 +823,7 @@ recv_joiner()
     if [ $tmt -gt 0 ]; then
         if [ -n "$(commandex timeout)" ]; then
             local koption=0
-            if [ "$OS" = 'FreeBSD' -o "$OS" = 'NetBSD' -o "$OS" = 'OpenBSD' -o \
-                 "$OS" = 'DragonFly' ]; then
+            if [ 1 eq 1 ]; then
                 if timeout 2>&1 | grep -qw -F -- '-k'; then
                     koption=1
                 fi


[FILE:250:patches/patch-sql_mysqld.cc]
--- sql/mysqld.cc.orig	2025-01-28 18:36:06 UTC
+++ sql/mysqld.cc
@@ -4446,8 +4446,9 @@ static void init_ssl()
         sql_print_warning("SSL error: %s",buf);
       }
     }
-    else
+    else {
       ERR_remove_state(0);
+    }
   }
   else
   {


[FILE:1559:patches/patch-storage_innobase_lz4.cmake]
--- storage/innobase/lz4.cmake.orig	2025-01-28 18:36:06 UTC
+++ storage/innobase/lz4.cmake
@@ -17,9 +17,16 @@ SET(WITH_INNODB_LZ4 AUTO CACHE STRING
 
 MACRO (MYSQL_CHECK_LZ4)
   IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
-    CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
-    CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB)
-    CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
+    find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
+    find_library(LZ4_LIBRARY NAMES lz4)
+    IF (LZ4_LIBRARY)
+    get_filename_component(LZ4_LIBDIR ${LZ4_LIBRARY} DIRECTORY)
+#MESSAGE(STATUS "LZ4_INCLUDE_DIR=${LZ4_INCLUDE_DIR} LZ4_LIBRARY=${LZ4_LIBRARY} LZ4_LIBDIR=${LZ4_LIBDIR}")
+    IF (LZ4_INCLUDE_DIR)
+      SET(HAVE_LZ4_H YES)
+    ENDIF()
+    CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput ${LZ4_LIBDIR} HAVE_LZ4_SHARED_LIB)
+    CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default ${LZ4_LIBDIR} HAVE_LZ4_COMPRESS_DEFAULT)
 
     IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
       SET(HAVE_INNODB_LZ4 TRUE)
@@ -27,12 +34,13 @@ MACRO (MYSQL_CHECK_LZ4)
       IF (HAVE_LZ4_COMPRESS_DEFAULT)
         ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
       ENDIF()
-      LINK_LIBRARIES(lz4)
+      LINK_LIBRARIES(${LZ4_LIBRARY})
     ELSE()
       IF (WITH_INNODB_LZ4 STREQUAL "ON")
         MESSAGE(FATAL_ERROR "Required lz4 library is not found")
       ENDIF()
     ENDIF()
+    ENDIF()
   ENDIF()
   ADD_FEATURE_INFO(INNODB_LZ4 HAVE_INNODB_LZ4 "LZ4 compression in the InnoDB storage engine")
 ENDMACRO()


[FILE:968:patches/patch-storage_innobase_lzo.cmake]
--- storage/innobase/lzo.cmake.orig	2025-01-28 18:36:06 UTC
+++ storage/innobase/lzo.cmake
@@ -17,13 +17,17 @@ SET(WITH_INNODB_LZO AUTO CACHE STRING
 
 MACRO (MYSQL_CHECK_LZO)
   IF (WITH_INNODB_LZO STREQUAL "ON" OR WITH_INNODB_LZO STREQUAL "AUTO")
-    CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
-    CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB)
-
+    find_path(LZO_INCLUDE NAMES lzo/lzo1x.h)
+    find_library(LZO_LIBRARY NAMES lzo2)
+    get_filename_component(LZO_LIBDIR ${LZO_LIBRARY} DIRECTORY)
+    IF (LZO_INCLUDE)
+      SET(HAVE_LZO_H 1)
+    ENDIF()
+    CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress ${LZO_LIBDIR} HAVE_LZO_SHARED_LIB)
     IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H)
       SET(HAVE_INNODB_LZO TRUE)
       ADD_DEFINITIONS(-DHAVE_LZO=1)
-      LINK_LIBRARIES(lzo2)
+      LINK_LIBRARIES(${LZO_LIBRARY})
     ELSE()
       IF (WITH_INNODB_LZO STREQUAL "ON")
         MESSAGE(FATAL_ERROR "Required lzo library is not found")


[FILE:262:patches/patch-storage_perfschema_pfs__global.cc]
--- storage/perfschema/pfs_global.cc.orig	2025-01-28 18:36:06 UTC
+++ storage/perfschema/pfs_global.cc
@@ -49,6 +49,9 @@
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
 #endif
+#ifdef __MidnightBSD__
+#include <malloc_np.h>
+#endif
 
 bool pfs_initialized= false;
 


[FILE:486:patches/patch-storage_rocksdb_build__rocksdb.cmake]
--- storage/rocksdb/build_rocksdb.cmake.orig	2025-01-28 18:36:06 UTC
+++ storage/rocksdb/build_rocksdb.cmake
@@ -90,7 +90,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux"
   add_definitions(-DOS_LINUX)
 elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
   add_definitions(-DOS_SOLARIS)
-elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|MidnightBSD")
   add_definitions(-DOS_FREEBSD)
 elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   add_definitions(-DOS_NETBSD)


[FILE:2105:patches/patch-storage_rocksdb_ha__rocksdb.cc]
--- storage/rocksdb/ha_rocksdb.cc.orig	2025-01-28 18:36:06 UTC
+++ storage/rocksdb/ha_rocksdb.cc
@@ -260,7 +260,7 @@ Rdb_cf_manager cf_manager;
 Rdb_ddl_manager ddl_manager;
 Rdb_binlog_manager binlog_manager;
 
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
+#if defined(HAVE_TIMER_DELETE) && !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
 Rdb_io_watchdog *io_watchdog = nullptr;
 #endif
 /**
@@ -844,7 +844,7 @@ static void rocksdb_set_io_write_timeout
     void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) {
   DBUG_ASSERT(save != nullptr);
   DBUG_ASSERT(rdb != nullptr);
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
+#if defined(HAVE_TIMER_DELETE) && !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
   DBUG_ASSERT(io_watchdog != nullptr);
 #endif
 
@@ -853,7 +853,7 @@ static void rocksdb_set_io_write_timeout
   const uint32_t new_val = *static_cast<const uint32_t *>(save);
 
   rocksdb_io_write_timeout_secs = new_val;
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
+#if defined(HAVE_TIMER_DELETE) && !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
   io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
 #endif
   RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
@@ -5778,7 +5778,7 @@ static int rocksdb_init_func(void *const
     directories.push_back(myrocks::rocksdb_wal_dir);
   }
 
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
+#if defined(HAVE_TIMER_DELETE) && !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
   io_watchdog = new Rdb_io_watchdog(std::move(directories));
   io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
 #endif
@@ -5885,7 +5885,7 @@ static int rocksdb_done_func(void *const
   delete commit_latency_stats;
   commit_latency_stats = nullptr;
 
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
+#if defined(HAVE_TIMER_DELETE) && !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
   delete io_watchdog;
   io_watchdog = nullptr;
 #endif


[FILE:249:patches/patch-storage_rocksdb_rdb__buff.h]
--- storage/rocksdb/rdb_buff.h.orig	2025-01-28 18:36:06 UTC
+++ storage/rocksdb/rdb_buff.h
@@ -40,6 +40,8 @@
 #define be16toh(x) OSSwapBigToHostInt16(x)
 #endif
 
+#include "port/port_posix.h"
+
 /* MySQL header files */
 #include "./my_global.h"
 


[FILE:474:patches/patch-storage_rocksdb_rdb__io__watchdog.cc]
If timer_t is an integer type, setting it to nullptr fails.

--- storage/rocksdb/rdb_io_watchdog.cc.orig	2025-01-28 18:36:06 UTC
+++ storage/rocksdb/rdb_io_watchdog.cc
@@ -111,7 +111,11 @@ void Rdb_io_watchdog::io_check_callback(
     sql_print_warning("Deleting the watchdog I/O timer failed with %d.", errno);
   }
 
+#ifdef __NetBSD__
+  m_io_check_watchdog_timer = 0;
+#else
   m_io_check_watchdog_timer = nullptr;
+#endif
 
   RDB_MUTEX_UNLOCK_CHECK(m_reset_mutex);
 }


[FILE:1227:patches/patch-storage_rocksdb_rdb__io__watchdog.h]
If timer_t is an integer type, setting it to nullptr fails.

--- storage/rocksdb/rdb_io_watchdog.h.orig	2025-01-28 18:36:06 UTC
+++ storage/rocksdb/rdb_io_watchdog.h
@@ -32,6 +32,12 @@
 /* MyRocks header files */
 #include "./rdb_utils.h"
 
+#ifdef __NetBSD__
+#define NULLTIMER	0
+#else
+#define NULLTIMER	nullptr
+#endif
+
 namespace myrocks {
 
 // Rdb_io_watchdog does not support Windows ATM.
@@ -60,7 +66,7 @@ class Rdb_io_watchdog {
       ret = timer_delete(m_io_check_watchdog_timer);
 
       if (!ret) {
-        m_io_check_watchdog_timer = nullptr;
+        m_io_check_watchdog_timer = NULLTIMER;
       }
     }
 
@@ -68,7 +74,7 @@ class Rdb_io_watchdog {
       ret = timer_delete(m_io_check_timer);
 
       if (!ret) {
-        m_io_check_timer = nullptr;
+        m_io_check_timer = NULLTIMER;
       }
     }
 
@@ -93,8 +99,8 @@ class Rdb_io_watchdog {
 
  public:
   explicit Rdb_io_watchdog(std::vector<std::string> &&directories)
-      : m_io_check_timer(nullptr),
-        m_io_check_watchdog_timer(nullptr),
+      : m_io_check_timer(NULLTIMER),
+        m_io_check_watchdog_timer(NULLTIMER),
         m_io_in_progress(false),
         m_dirs_to_check(std::move(directories)),
         m_buf(nullptr) {


[FILE:494:patches/patch-storage_rocksdb_rocksdb_CMakeLists.txt]
--- storage/rocksdb/rocksdb/CMakeLists.txt.orig	2025-01-28 18:36:08 UTC
+++ storage/rocksdb/rocksdb/CMakeLists.txt
@@ -413,7 +413,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux"
   add_definitions(-DOS_LINUX)
 elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
   add_definitions(-DOS_SOLARIS)
-elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|MidnightBSD")
   add_definitions(-DOS_FREEBSD)
 elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   add_definitions(-DOS_NETBSD)


[FILE:328:patches/patch-storage_rocksdb_rocksdb_port_jemalloc__helper.h]
--- storage/rocksdb/rocksdb/port/jemalloc_helper.h.orig	2025-01-28 18:36:08 UTC
+++ storage/rocksdb/rocksdb/port/jemalloc_helper.h
@@ -26,6 +26,10 @@
 #include <jemalloc/jemalloc.h>
 #endif
 
+#ifdef __FreeBSD__
+#define JEMALLOC_USABLE_SIZE_CONST const
+#endif
+
 #ifndef JEMALLOC_CXX_THROW
 #define JEMALLOC_CXX_THROW
 #endif


[FILE:493:patches/patch-storage_rocksdb_ut0counter.h]
--- storage/rocksdb/ut0counter.h.orig	2025-01-28 18:36:06 UTC
+++ storage/rocksdb/ut0counter.h
@@ -30,6 +30,12 @@ Created 2012/04/12 by Sunny Bains
 
 #ifdef __WIN__
 #define get_curr_thread_id() GetCurrentThreadId()
+#elif defined __FreeBSD__
+#include <pthread_np.h>
+#define get_curr_thread_id() pthread_getthreadid_np()
+#elif defined __DragonFly__
+#include <sys/syscall.h>
+#define get_curr_thread_id() syscall(SYS_lwp_gettid)
 #else
 #define get_curr_thread_id() pthread_self()
 #endif


[FILE:1433:files/client.cnf.sample.in]
# Options specific to client applications, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#client-option-groups

# Options specific to all client programs
[client]
# port			= 3306 # inherited from %%PREFIX%%/etc/mysql/my.cnf
# socket		= %%MARIADB_RUNDIR%%/%%MARIADB_SOCK%% # inherited from %%PREFIX%%/etc/mysql/my.cnf

# Options specific to MariaDB client programs
[client-mariadb]

#
## Options for specific client Tools
#

# Options read by `mysql`
# Renamed from [mysql] starting with MariaDB 10.4.6.
[mariadb-client]	Options read by mysql. Available starting with MariaDB 10.4.6.
prompt			= \u@\h [\d]>\_
no_auto_rehash

# Options read by `mysqldump`
# Renamed from [mysqldump] starting with MariaDB 10.4.6.
[mariadb-dump]
max_allowed_packet	= 256M
quote_names
quick

# Options read by `mysqladmin`
# Renamed from [mysqladmin] starting with MariaDB 10.4.6.
[mariadb-admin]

# Options read by `mysqlbinlog` 
# Renamed from [mysqlbinlog] starting with MariaDB 10.4.6.
[mariadb-binlog]

# Options read by `mysqlcheck`
# Renamed from [mysqlcheck] starting with MariaDB 10.4.6.
[mariadb-check]

# Options read by `mysqlimport`
# Renamed from [mysqlimport] starting with MariaDB 10.4.6.
[mariadb-import]

# Options read by `mysqlshow`
# Renamed from [mysqlshow] starting with MariaDB 10.4.6.
[mariadb-show]

# Options read by `mysqlslap`
# Renamed from [mysqlslap]  starting with MariaDB 10.4.6.
[mariadb-slap]



[FILE:350:files/my.cnf.sample.in]
#
# This group is read both by the client and the server
# use it for options that affect everything, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#option-groups
#
[client-server]
port	= 3306
socket	= %%MARIADB_RUNDIR%%/%%MARIADB_SOCK%%

#
# include *.cnf from the config directory
#
!includedir %%PREFIX%%/etc/mysql/conf.d/


[FILE:4940:files/mysql.in]
#!/bin/sh

# PROVIDE: mysql
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable mysql:
# mysql_(instance_)?enable (bool):	Set to "NO" by default.
#			Set it to "YES" to enable MySQL.
# mysql_(instance_)?dbdir (str):	Default to "%%MARIADB_DBDIR%%"
#			Base database directory.
# mysql_(instance_)?args (str):	Custom additional arguments to be passed
#			to mysqld_safe (default empty).
# mysql_(instance_)?pidfile (str): Custom PID file path and name.
#			Default to "${mysql_dbdir}/${hostname}.pid".
# mysql_(instance_)?user (str): User to run mysqld as
#			Default to "%%MARIADB_USER%%" created by the port
# mysql_(instance_)?optfile (str): Server-specific option file.
#			Default to "${mysql_dbdir}/my.cnf".
# mysql_(instance)?rundir (str):	Default to "%%MARIADB_RUNDIR%%"
# mysql_instances (str): Set to "" by default. 
#			If defined, list of instances to enable
# ======================== EXCEPT FREEBSD ========================
# mysql_(instance_)?limits (bool):	Set to "NO" by default.
#			Set it to yes to run `limits -e -U mysql`
#			just before mysql starts.
# ================================================================

. /etc/rc.subr

name="mysql"
rcvar=mysql_enable

load_rc_config $name

: ${mysql_enable="NO"}
: ${mysql_user="%%MARIADB_USER%%"}
: ${mysql_dbdir="%%MARIADB_DBDIR%%"}
: ${mysql_optfile="%%PREFIX%%/etc/mysql/my.cnf"}
: ${mysql_rundir="%%MARIADB_RUNDIR%%"}
: ${mysql_limits="NO"}
mysql_limits_args="-e -U ${mysql_user}"

command="/usr/sbin/daemon"
procname="%%PREFIX%%/libexec/mariadbd"
start_precmd="${name}_prestart"
start_postcmd="${name}_poststart"

if [ -n "$2" ]; then
	instance="$2"
	load_rc_config ${name}_${instance}
	case "$mysql_instances" in
	"$2 "*|*" $2 "*|*" $2"|"$2")
		eval mysql_args="\${mysql_${instance}_args:-\"${mysql_args}\"}"
		eval mysql_dbdir="\${mysql_${instance}_dbdir:-\"%%MARIADB_DBDIR%%_${instance}\"}"
		eval mysql_user="\${mysql_${instance}_user:-\"${mysql_user}\"}"
		eval mysql_socket="\${mysql_${instance}_socket:-\"%%MARIADB_RUNDIR%%_${instance}/%%MARIADB_SOCK%%\"}"
		eval mysql_optfile="\${mysql_${instance}_optfile:-\"%%PREFIX%%/etc/mysql_${instance}/my.cnf\"}"
		eval mysql_pidfile="\${mysql_${instance}_pidfile:-\"%%MARIADB_RUNDIR%%_${instance}/mysqld.pid\"}"
		eval mysql_limits="\${mysql_${instance}_limits:-\"${mysql_limits}\"}"
		eval mysql_limits_args="\${mysql_${instance}_limits_args:-\"-e -U $mysql_user\"}"
	;;
	*)
		err 1 "$2 not found in mysql_instances" ;;
	esac
else
	if [ -n "${mysql_instances}" -a -n "$1" ]; then
		for instance in ${mysql_instances}; do
			eval _enable="\${mysql_${instance}_enable}"
			case "${_enable:-${mysql_enable}}" in
			[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
				continue
			;;
			[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
			;;
			*)
				if [ -z "$_enable" ]; then
					_var=mysql_enable
				else
					_var=mysql_${instance}_enable
				fi
				warn "Bad value" \
					"'${_enable:-${mysql_enable}}'" \
					"for ${_var}. " \
					"Instance ${instance} skipped."
				continue
			;;
			esac
			echo "===> mysql instance: ${instance}"
			if %%PREFIX%%/etc/rc.d/mysql-server $1 ${instance}; then
				success="${instance} ${success}"
			else
				failed="${instance} (${retcode}) ${failed}"
			fi
		done
		exit 0
	else
		mysql_pidfile=${mysql_pidfile:-"%%MARIADB_RUNDIR%%/mysqld.pid"}
	fi
fi

pidfile=$mysql_pidfile
mysql_install_db="%%PREFIX%%/bin/mariadb-install-db"
mysql_install_db_args="--basedir=%%PREFIX%% --datadir=${mysql_dbdir} --force"
command_args="-c -f %%PREFIX%%/bin/mariadbd-safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_socket:+--socket=${mysql_socket}} ${mysql_args}"

mysql_create_auth_tables()
{
	eval $mysql_install_db $mysql_install_db_args
        [ $? -eq 0 ] && chown -R ${mysql_user}:$(id -gn $mysql_user) ${mysql_dbdir}
}

mysql_prestart()
{
	local dir
	for dir in /etc /usr/local/etc /etc/mysql /var/db/mysql; do
		if [ -f "${dir}/my.cnf" ]; then
			echo "Please merge existing ${dir}/my.cnf file with %%PREFIX%%/etc/mysql/conf.d/server.cnf"
			return 1
		fi
	done
	if [ ! -d "${mysql_dbdir}/mysql/." ]; then
		mysql_create_auth_tables || return 1
	fi
	mysql_group="`/usr/bin/id -gn ${mysql_user}`"
	[ "${mysql_socket}" = "" ] && mysql_rundir="%%MARIADB_RUNDIR%%" || mysql_rundir="`/usr/bin/dirname ${mysql_socket}`"
	if [ ! -d "${mysql_rundir}" ]; then
		install -d -o ${mysql_user} -g ${mysql_group} "${mysql_rundir}"
	fi
if [ "%%OPSYS%%" = "FreeBSD" ]; then
	return 0
else
	if checkyesno mysql_limits; then
		eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null
	else
		return 0
	fi
	if [ ! -d "${mysql_rundir}" ]; then
		install -d -u${mysql_user} -g$(id -gn $mysql_user) -m755 ${mysql_rundir}
	fi
fi
}

mysql_poststart()
{
	local timeout=15
	while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do
		timeout=$(( timeout - 1 ))
		sleep 1
	done
	return 0
}

run_rc_command "$1"


[FILE:1622:files/server.cnf.sample.in]
# Options specific to server applications, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#server-option-groups

# Options specific to all server programs
[server]

# Options specific to MariaDB server programs
[server-mariadb]

#
# Options for specific server tools
#

[mysqld]
user				= %%MARIADB_USER%%
# port				= 3306 # inherited from %%PREFIX%%/etc/mysql/my.cnf
# socket			= %%MARIADB_RUNDIR%%/mysql.sock # inherited from %%PREFIX%%/etc/mysql/my.cnf
bind-address			= 127.0.0.1
basedir				= %%PREFIX%%
# datadir			= %%MARIADB_DBDIR%% # set with --db_dir from rc-script
net_retry_count			= 16384
log_error			= %%MARIADB_LOGDIR%%/mysqld.err
# [mysqld] configuration for ZFS
# From https://www.percona.com/resources/technical-presentations/zfs-mysql-percona-technical-webinar
# Create separate datasets for data and logs, eg
# zroot/mysql      compression=on recordsize=128k atime=off
# zroot/mysql/data recordsize=16k
# zroot/mysql/logs
# datadir 			= %%MARIADB_DBDIR%%/data
# innodb_log_group_home_dir	= %%MARIADB_DBDIR%%/log
# audit_log_file		= %%MARIADB_DBDIR%%/log/audit.log
# general_log_file		= %%MARIADB_DBDIR%%/log/general.log
# log_bin			= %%MARIADB_DBDIR%%/log/mysql-bin
# relay_log			= %%MARIADB_DBDIR%%/log/relay-log
# slow_query_log_file		= %%MARIADB_DBDIR%%/log/slow.log
# innodb_doublewrite		= 0
# innodb_flush_method		= O_DSYNC

# Options read by `mariadb-safe` (and `mysql_safe`)
[mariadb-safe]

# Options read my `mariabackup`
[mariabackup]

# Options read by mariadb-upgrade (and `mysql_upgrade`)
[mariadb-upgrade]

# Specific options read by the mariabackup SST method
[sst]