Files

259 lines
9.9 KiB
Tcl
Raw Permalink Normal View History

2012-03-17 17:13:21 +00:00
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup deprecated 1.0
# Support ended 2018-12
deprecated.eol_version yes
2012-03-17 17:13:21 +00:00
name mysql55
2012-04-26 18:55:16 +00:00
set name_mysql ${name}
2019-05-16 07:27:05 -05:00
version 5.5.62
2013-08-04 21:44:46 +00:00
# Set revision_client and revision_server to 0 if you bump version.
2019-09-07 00:39:10 +08:00
set revision_client 3
2019-01-20 08:01:18 -07:00
set revision_server 1
2013-08-04 21:44:46 +00:00
set version_branch [join [lrange [split ${version} .] 0 1] .]
2012-03-17 17:13:21 +00:00
categories databases
2012-04-26 18:55:16 +00:00
license GPL-2
2019-02-06 12:39:42 -07:00
maintainers nomaintainer
2019-06-22 00:19:06 -05:00
homepage https://www.mysql.com/
2012-03-17 17:13:21 +00:00
2015-04-03 01:58:43 +00:00
if {$subport eq $name} {
2012-03-17 17:13:21 +00:00
PortGroup cmake 1.0
PortGroup select 1.0
2012-05-18 04:49:37 +00:00
2012-05-19 19:17:13 +00:00
revision ${revision_client}
2012-03-17 17:13:21 +00:00
license GPL-2
description Multithreaded SQL database server
2013-06-24 00:33:32 +00:00
long_description MySQL is an open-source, multi-threaded SQL database.
2012-05-18 04:49:37 +00:00
2013-09-24 16:13:42 +00:00
master_sites mysql:MySQL-${version_branch}
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
distname mysql-${version}
2015-04-03 01:58:43 +00:00
cmake.out_of_source yes
2012-03-17 17:13:21 +00:00
use_parallel_build yes
2012-05-18 04:49:37 +00:00
2025-10-07 20:22:40 -05:00
# Will not compile with C++17; force earlier standard
configure.args-append -DCMAKE_CXX_STANDARD=98
patch.pre_args-replace -p0 -p1
2012-06-28 14:55:30 +00:00
patchfiles patch-cmake-install_layout.cmake.diff
2012-05-17 15:10:43 +00:00
2025-10-07 20:22:40 -05:00
patchfiles-append Ventura-and-arm64.patch
2019-05-16 07:27:05 -05:00
checksums rmd160 4b6fdfc37dc87fdabb2b944b695d5b9e687e22f2 \
sha256 b1e7853bc1f04aabf6771e0ad947f35ac8d237f4b35d0706d1095c9526ff99d7 \
size 21111902
2012-05-18 04:49:37 +00:00
2019-04-23 21:51:57 -07:00
depends_lib-append port:zlib port:tcp_wrappers port:ncurses
2012-06-28 14:55:30 +00:00
depends_run-append port:mysql_select
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
select.group mysql
2012-05-25 16:12:14 +00:00
select.file ${filespath}/${name_mysql}
2012-05-18 04:49:37 +00:00
2012-06-28 14:55:30 +00:00
post-extract {
2015-06-04 03:49:33 +00:00
file mkdir ${cmake.build_dir}/macports
2012-06-28 14:55:30 +00:00
copy ${filespath}/macports-default.cnf \
${filespath}/my.cnf \
2015-06-04 03:49:33 +00:00
${cmake.build_dir}/macports/
2012-03-17 17:13:21 +00:00
}
2012-05-18 04:49:37 +00:00
2012-06-28 14:55:30 +00:00
post-patch {
reinplace "s|@NAME@|${name_mysql}|g" \
${worksrcpath}/cmake/install_layout.cmake
reinplace "s|@NAME@|${name_mysql}|g" \
2015-06-04 03:49:33 +00:00
${cmake.build_dir}/macports/macports-default.cnf \
${cmake.build_dir}/macports/my.cnf
2012-06-28 14:55:30 +00:00
reinplace "s|@PREFIX@|${prefix}|g" \
2015-06-04 03:49:33 +00:00
${cmake.build_dir}/macports/macports-default.cnf \
${cmake.build_dir}/macports/my.cnf
2025-10-17 16:33:21 -05:00
# don't force /usr/bin/libtool -- allow cctools' version to be used
reinplace "s|/usr/bin/libtool|libtool|g" \
${worksrcpath}/cmake/libutils.cmake
2012-06-28 14:55:30 +00:00
}
2012-03-17 17:13:21 +00:00
configure.args-delete \
-DCMAKE_INSTALL_NAME_DIR=${prefix}/lib
configure.args-append \
2012-05-25 16:12:14 +00:00
-DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${name_mysql}/mysql \
2012-05-19 19:17:13 +00:00
-DINSTALL_LAYOUT:STRING=MACPORTS \
2012-05-25 16:12:14 +00:00
-DSYSCONFDIR:PATH=${prefix}/etc/${name_mysql} \
-DMYSQL_UNIX_ADDR:PATH=${prefix}/var/run/${name_mysql}/mysqld.sock \
-DMYSQL_DATADIR:PATH=${prefix}/var/db/${name_mysql} \
2012-03-17 17:13:21 +00:00
-DDEFAULT_CHARSET:STRING=utf8 \
-DDEFAULT_COLLATION:STRING=utf8_general_ci \
2012-11-30 22:12:48 +00:00
-DWITH_EMBEDDED_SERVER:BOOL=ON \
2012-03-17 17:13:21 +00:00
-DWITH_ZLIB:STRING=system \
2012-06-28 14:55:30 +00:00
-DWITH_UNIT_TESTS:BOOL=ON \
2012-03-17 17:13:21 +00:00
-DENABLE_GCOV:BOOL=OFF \
2012-05-25 16:12:14 +00:00
-DENABLE_DTRACE:BOOL=OFF \
-DWITH_READLINE:BOOL=ON \
-DWITH_LIBEDIT:BOOL=OFF \
2012-06-28 14:55:30 +00:00
-DWITH_LIBWRAP:BOOL=ON \
-DWITH_SSL:STRING=bundled
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
post-build {
2015-06-04 03:49:33 +00:00
set dirs ${cmake.build_dir}
foreach dir ${dirs} {
2012-03-17 17:13:21 +00:00
reinplace -E {s|-arch [a-z0-9_]+||g} \
${dir}/scripts/mysql_config \
${dir}/scripts/mysqlbug
}
}
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
post-destroot {
2012-03-17 21:35:27 +00:00
# proc portdestroot::destroot_finish fails to find and compress our man pages
# so borrow the compress command and run on our files now.
set manpath "${destroot}${prefix}/share/man"
set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
2012-05-25 16:12:14 +00:00
foreach manpage [glob -type f ${destroot}${prefix}/share/man/${name_mysql}/man\[1-9\]/*] {
2012-03-17 21:35:27 +00:00
# Fix paths in manpages
2018-02-28 08:52:34 -06:00
reinplace -q "s|/etc/|${prefix}/etc/${name_mysql}/|g" ${manpage}
2012-03-17 21:35:27 +00:00
# Compress all manpages with gzip
system "$gzip -9vf ${manpage}"
2012-03-17 17:13:21 +00:00
}
2012-05-25 16:12:14 +00:00
foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${name_mysql}/support-files/my-*.cnf] {
2012-03-17 21:35:27 +00:00
# Fix paths in sample configuration files
2018-02-28 08:52:34 -06:00
reinplace -q "s|/etc/my.cnf|${prefix}/etc/${name_mysql}/my.cnf|g" ${samp_conffile}
2012-03-17 17:13:21 +00:00
}
2012-06-28 14:55:30 +00:00
xinstall -m 755 -o root -d \
${destroot}${prefix}/etc/${name_mysql}
2015-06-04 03:49:33 +00:00
copy ${cmake.build_dir}/macports/macports-default.cnf \
2012-06-28 14:55:30 +00:00
${destroot}${prefix}/etc/${name_mysql}/
xinstall -m 755 -o root -d \
${destroot}${prefix}/share/${name_mysql}/support-files/macports
2015-06-04 03:49:33 +00:00
copy ${cmake.build_dir}/macports/my.cnf \
2012-06-28 14:55:30 +00:00
${destroot}${prefix}/share/${name_mysql}/support-files/macports/
2012-03-17 17:13:21 +00:00
}
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
post-install {
2012-05-25 16:12:14 +00:00
if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${name_mysql}/org.macports.${name_mysql}-server.plist]} {
ui_msg "The ${name_mysql} client has been installed."
ui_msg "To install the ${name_mysql} server, install the ${name_mysql}-server port."
2012-03-17 17:13:21 +00:00
}
}
2012-05-18 04:49:37 +00:00
2012-06-28 14:55:30 +00:00
post-activate {
if {![file exists ${prefix}/etc/${name_mysql}/my.cnf]} {
copy ${prefix}/share/${name_mysql}/support-files/macports/my.cnf \
${prefix}/etc/${name_mysql}/
}
}
2012-03-17 17:13:21 +00:00
variant openssl description {Enable OpenSSL support} {
2025-10-20 11:26:37 -05:00
PortGroup openssl 1.0
2012-05-18 04:49:37 +00:00
2025-10-20 11:26:37 -05:00
openssl.branch 1.0
configure.args-delete -DWITH_SSL:STRING=bundled
2025-10-20 11:26:37 -05:00
# MySQL 5.5 does not understand -DWITH_SSL=/path/to/installation from openssl PG
# Override in post_args
configure.post_args-append -DWITH_SSL:STRING=system
2012-03-17 17:13:21 +00:00
}
2012-05-18 04:49:37 +00:00
2012-05-19 19:17:13 +00:00
variant system_readline description {Use system readline instead of bundled readline} {
# Add readline support.
2012-05-25 16:12:14 +00:00
# "-DWITH_READLINE:BOOL=OFF" has the peculiar meaning "do not use the bundled copy
2012-05-19 19:17:13 +00:00
# of readline but use the system's (i.e. MacPorts') copy of readline"
depends_lib-append port:readline
2012-05-25 16:12:14 +00:00
configure.args-delete -DWITH_READLINE:BOOL=ON
configure.args-append -DWITH_READLINE:BOOL=OFF
2012-05-19 19:17:13 +00:00
}
2013-09-24 16:13:42 +00:00
notes "
On activation if no ${prefix}/etc/${name_mysql}/my.cnf file exists one
will be created which loads
${prefix}/etc/${name_mysql}/macports-default.cnf.
If a ${prefix}/etc/${name_mysql}/my.cnf file exists MacPorts does not
touch it and any changes you make to ${prefix}/etc/${name_mysql}/my.cnf
2013-09-24 16:25:53 +00:00
will be preserved (e.g., during port upgrades, deactivations or
activations). ${prefix}/etc/${name_mysql}/my.cnf is a good place to
customize your ${name_mysql} installation.
2013-09-24 16:13:42 +00:00
Any changes made to ${prefix}/etc/${name_mysql}/macports-default.cnf
will be lost during port upgrades, deactivations or activations so you
are advised to not make changes here. Currently
${prefix}/etc/${name_mysql}/macports-default.cnf contains only one
directive; to disable networking. With disabled networking it is
possible to install and have running all the MacPorts mysql ports
simultaneously.
"
livecheck.type none
2012-03-17 17:13:21 +00:00
}
2012-04-26 18:55:16 +00:00
subport ${name_mysql}-server {
2012-05-19 19:17:13 +00:00
revision ${revision_server}
2012-04-26 18:55:16 +00:00
license BSD
description Run ${name_mysql} as server
long_description {*}${description}
2012-05-18 04:49:37 +00:00
2012-04-26 18:55:16 +00:00
supported_archs noarch
2012-03-17 17:13:21 +00:00
distfiles
2012-05-18 04:49:37 +00:00
2012-04-26 18:55:16 +00:00
depends_run port:${name_mysql}
2012-05-18 04:49:37 +00:00
2013-08-04 21:44:46 +00:00
if {"darwin" eq ${os.platform} && ${os.major} > 8} {
2012-03-17 17:13:21 +00:00
set mysqluser _mysql
} else {
set mysqluser mysql
}
add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server
2012-05-18 04:49:37 +00:00
pre-extract {
copy ${filespath}/org.macports.mysql-server.plist ${workpath}/org.macports.${subport}.plist
}
2012-05-18 04:49:37 +00:00
post-patch {
reinplace "s|@NAME@|${subport}|g" \
${workpath}/org.macports.${subport}.plist
reinplace "s|@NAMEMYSQL@|${name_mysql}|g" \
${workpath}/org.macports.${subport}.plist
reinplace "s|@PREFIX@|${prefix}|g" \
${workpath}/org.macports.${subport}.plist
reinplace "s|@SUBPORT@|${subport}|g" \
${workpath}/org.macports.${subport}.plist
reinplace "s|@USER@|${mysqluser}|g" \
${workpath}/org.macports.${subport}.plist
reinplace "s|@GROUP@|${mysqluser}|g" \
${workpath}/org.macports.${subport}.plist
}
2012-04-26 18:55:16 +00:00
use_configure no
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
build {}
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
destroot {
xinstall -d -m 755 ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${subport}
xinstall -m 0644 -o root -W ${workpath} \
org.macports.${subport}.plist \
${destroot}${prefix}/etc/LaunchDaemons/org.macports.${subport}
xinstall -d -m 755 ${destroot}/Library/LaunchDaemons
ln -s ${prefix}/etc/LaunchDaemons/org.macports.${subport}/org.macports.${subport}.plist \
${destroot}/Library/LaunchDaemons/org.macports.${subport}.plist
2012-06-28 14:55:30 +00:00
xinstall -m 755 -o root -d \
${destroot}${prefix}/var/run
2012-03-17 17:13:21 +00:00
xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
2012-04-26 18:55:16 +00:00
${destroot}${prefix}/etc/${name_mysql} \
${destroot}${prefix}/var/db/${name_mysql} \
${destroot}${prefix}/var/log/${name_mysql} \
${destroot}${prefix}/var/run/${name_mysql}
2012-03-17 17:13:21 +00:00
destroot.keepdirs-append \
2012-04-26 18:55:16 +00:00
${destroot}${prefix}/var/db/${name_mysql} \
${destroot}${prefix}/var/log/${name_mysql} \
${destroot}${prefix}/var/run/${name_mysql}
}
2012-03-17 17:13:21 +00:00
notes "
2012-05-11 18:14:56 +00:00
If this is a new install you might want to run:
2012-05-19 20:41:08 +00:00
\$ sudo -u ${mysqluser} ${prefix}/lib/${name_mysql}/bin/mysql_install_db
2012-05-11 18:14:56 +00:00
"
2012-05-18 04:49:37 +00:00
2012-03-17 17:13:21 +00:00
livecheck.type none
}