[92142] trunk/dports/databases

pixilla at macports.org pixilla at macports.org
Thu Apr 19 17:21:26 PDT 2012


Revision: 92142
          https://trac.macports.org/changeset/92142
Author:   pixilla at macports.org
Date:     2012-04-19 17:21:25 -0700 (Thu, 19 Apr 2012)
Log Message:
-----------
databases/mysql51:
- New mysql51 port based off mysql5. (svn cp)

Modified Paths:
--------------
    trunk/dports/databases/mysql51/Portfile
    trunk/dports/databases/mysql51/files/patch-Makefile.in.diff

Added Paths:
-----------
    trunk/dports/databases/mysql51/
    trunk/dports/databases/mysql51/files/mysql51
    trunk/dports/databases/mysql51/files/patch-scripts-mysql_secure_installation.sh.diff

Removed Paths:
-------------
    trunk/dports/databases/mysql51/files/patch-mysql_secure_installation.sh.diff

Modified: trunk/dports/databases/mysql51/Portfile
===================================================================
--- trunk/dports/databases/mysql5/Portfile	2012-04-08 18:09:25 UTC (rev 91709)
+++ trunk/dports/databases/mysql51/Portfile	2012-04-20 00:21:25 UTC (rev 92142)
@@ -1,153 +1,212 @@
 # -*- 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
 # $Id$
 
-PortSystem              1.0
-PortGroup               archcheck 1.0
+PortSystem          1.0
 
-# http://bugs.mysql.com/bug.php?id=47360
-PortGroup               muniversal 1.0
+name                mysql51
+# Fixme: Subdir mysql5.
+# Conflict due to mysqld_safe finding mysql5 ports ${prefix}/libexec/mysqld.
+conflicts           mysql5
+version             5.1.62
+categories          databases
+platforms           darwin
+maintainers         pixilla openmaintainer
+license             GPL-2
 
-name                    mysql5
-conflicts               mysql5-devel mysql4 mariadb
-version                 5.1.61
-set branch              [join [lrange [split ${version} .] 0 1] .]
-homepage                http://www.mysql.com/
-categories              databases
-platforms               darwin
-maintainers             ryandesign
-license                 GPL-2
-distname                mysql-${version}
-use_parallel_build      yes
-
-description \
-    Multithreaded SQL database server
-
-long_description \
-    MySQL is an open-source, multi-threaded SQL database \
-    with a command syntax very similar to mSQL.
-
-master_sites \
-    http://mysql.mirrors.pair.com/Downloads/MySQL-${branch}/ \
-    http://mysql.he.net/Downloads/MySQL-${branch}/ \
-    http://mirrors.sunsite.dk/mysql/Downloads/MySQL-${branch}/ \
-    http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \
-    http://mirror.facebook.net/mysql/Downloads/MySQL-${branch}/ \
-    http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
-
-checksums               rmd160  392b7394a0f7821134f177a3ba4580a29d60e3f4 \
-                        sha256  879c6424282e38eb1ba9b1910db98b378a5574ceed431a69e344643a5524f918
-
-depends_lib \
-    port:zlib \
-    port:openssl
-
-archcheck.files         lib/libz.dylib \
-                        lib/libssl.dylib
-
-set major_version       [strsed ${version} {s/\..*$//}]
-set mysql               mysql${major_version}
-set libdir              ${prefix}/lib/${mysql}
-set bindir              ${libdir}/bin
-set dbdir               ${prefix}/var/db/${mysql}
-set sysconfdir          ${prefix}/etc/${mysql}
-
 if {"darwin" == ${os.platform} && ${os.major} > 8} {
     set mysqluser       _mysql
 } else {
     set mysqluser       mysql
 }
 
-patchfiles \
-    patch-Makefile.in.diff \
-    patch-mysql_secure_installation.sh.diff
+if {$subport == $name} {
 
-post-patch {
-    reinplace s%@BINDIR@%${bindir}%g ${worksrcpath}/scripts/mysql_secure_installation.sh
-}
+# http://bugs.mysql.com/bug.php?id=47360
+    PortGroup           muniversal 1.0
+    PortGroup           archcheck 1.0
+    PortGroup           select 1.0
+    
+    set branch          [join [lrange [split ${version} .] 0 1] .]
 
-configure.args \
-    --mandir=${prefix}/share/man \
-    --infodir=${prefix}/share/info \
-    --localstatedir=${dbdir} \
-    --libdir=${libdir} \
-    --bindir=${bindir} \
-    --includedir=${prefix}/include/${mysql} \
-    --datadir=${prefix}/share/${mysql} \
-    --sysconfdir=${sysconfdir} \
-    --with-zlib-dir=${prefix} \
-    --with-ssl=${prefix} \
-    --with-extra-charsets=complex \
-    --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
-    --with-mysqld-user=${mysqluser} \
-    --without-docs \
-    --with-plugins=all \
-    --enable-thread-safe-client
-# the following is in store for future
-#    --program-suffix=5
+    license             GPL-2
+    description         Multithreaded SQL database server
+    long_description    MySQL is an open-source, multi-threaded SQL database with a command \
+                        syntax very similar to mSQL.
+    
+    homepage            http://www.mysql.com/
+    master_sites \
+        http://mysql.mirrors.pair.com/Downloads/MySQL-${branch}/ \
+        http://mysql.he.net/Downloads/MySQL-${branch}/ \
+        http://mirrors.sunsite.dk/mysql/Downloads/MySQL-${branch}/ \
+        http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \
+        http://mirror.facebook.net/mysql/Downloads/MySQL-${branch}/ \
+        http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
+    
+    
+    distname            mysql-${version}
+    use_parallel_build  yes
+    
+    patch.pre_args      -p1
+    patchfiles          patch-Makefile.in.diff \
+                        patch-scripts-mysql_secure_installation.sh.diff
 
-# Add readline support.
-# "--without-readline" has the peculiar meaning "do not use the bundled copy
-# of readline but use the system's (i.e. MacPorts') copy of readline"
-depends_lib-append      port:readline
-archcheck.files-append  lib/libreadline.dylib
-configure.args-append   --without-readline
-
-# Build libmysqld embedded server.
-configure.cflags-append -fPIC
-configure.cxxflags-append -fPIC
-configure.args-append --with-embedded-server --with-pic
-
-# BUILD FIX TODO: clang, build system
-# doesn't build with clang as of 2011.06.27
-# This looks like a bug in mysql's build system
-if {${configure.compiler} == "clang"} {
-    configure.compiler llvm-gcc-4.2
-}
-
-post-build {
-    if {[variant_isset universal]} {
-        set dirs {}
-        foreach arch ${universal_archs_to_use} {
-            lappend dirs ${worksrcpath}-${arch}
+    checksums           rmd160  c5720deee2b04a40a20f56a3b305b37fecb343fe \
+                        sha256  97c07b2478e25892fe915b2c46e99083973f541ecdf06672241f0c22f79fead3
+    
+    depends_lib         port:zlib
+    
+    depends_run         port:mysql_select
+    
+    select.group        mysql
+    select.file         ${filespath}/${name}
+    
+    archcheck.files     lib/libz.dylib
+    
+    post-patch {
+        reinplace s%@BINDIR@%${prefix}/lib/${name}/bin%g ${worksrcpath}/scripts/mysql_secure_installation.sh
+    }
+    
+    configure.args \
+        --bindir=${prefix}/lib/${name}/bin \
+        --sbindir=${prefix}/lib/${name}/bin \
+        --libexecdir=${prefix}/lib/${name}/bin \
+        --sysconfdir=${prefix}/etc/${name} \
+        --localstatedir=${prefix}/var/db/${name} \
+        --libdir=${prefix}/lib/${name} \
+        --includedir=${prefix}/include/${name} \
+        --datarootdir=${prefix}/share/${name} \
+        --infodir=${prefix}/share/info/${name} \
+        --mandir=${prefix}/share/man/${name} \
+        --with-zlib-dir=${prefix} \
+        --without-ssl \
+        --with-extra-charsets=complex \
+        --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \
+        --with-mysqld-user=${mysqluser} \
+        --without-docs \
+        --with-plugins=all \
+        --enable-thread-safe-client
+    
+    # Add readline support.
+    # "--without-readline" has the peculiar meaning "do not use the bundled copy
+    # of readline but use the system's (i.e. MacPorts') copy of readline"
+    depends_lib-append      port:readline
+    archcheck.files-append  lib/libreadline.dylib
+    configure.args-append   --without-readline
+    
+    # Build libmysqld embedded server.
+    configure.cflags-append -fPIC
+    configure.cxxflags-append -fPIC
+    configure.args-append --with-embedded-server --with-pic
+    
+    # BUILD FIX TODO: clang, build system
+    # doesn't build with clang as of 2011.06.27
+    # This looks like a bug in mysql's build system
+    if {${configure.compiler} == "clang"} {
+        configure.compiler llvm-gcc-4.2
+    }
+    
+    post-build {
+        if {[variant_isset universal]} {
+            set dirs {}
+            foreach arch ${universal_archs_to_use} {
+                lappend dirs ${worksrcpath}-${arch}
+            }
+        } else {
+            set dirs ${worksrcpath}
         }
-    } else {
-        set dirs ${worksrcpath}
+        foreach dir ${dirs} {
+            reinplace -E {s|-arch [a-z0-9_]+||g} \
+                ${dir}/scripts/mysql_config \
+                ${dir}/scripts/mysqlbug
+        }
     }
-    foreach dir ${dirs} {
-        reinplace -E {s|-arch [a-z0-9_]+||g} \
-            ${dir}/scripts/mysql_config \
-            ${dir}/scripts/mysqlbug
+    
+    pre-destroot {
+        xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
+        destroot.keepdirs-append ${destroot}${prefix}/etc/${name}
     }
-}
-
-pre-destroot {
-    xinstall -m 755 -d ${destroot}${sysconfdir}
-    destroot.keepdirs-append ${destroot}${sysconfdir}
-}
-
-post-destroot {
-    # Fix paths in manpages and sample configuration files
-    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
-        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
+    
+    post-destroot {
+        # 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}]
+        foreach manpage [glob -type f ${destroot}${prefix}/share/man/${name}/man\[1-9\]/*] {
+            # Fix paths in manpages
+            reinplace "s|/etc/|${prefix}/etc/${name}/|g" ${manpage}
+            # Compress all manpages with gzip
+            system "$gzip -9vf ${manpage}"
+        }
+        foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${name}/mysql/my-*.cnf] {
+            # Fix paths in sample configuration files
+            reinplace "s|/etc/my.cnf|${prefix}/etc/${name}/my.cnf|g" ${samp_conffile}
+        }
+        
     }
-    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
-        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
+    
+    post-install {
+        if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${name}/org.macports.${name}.plist]} {
+            ui_msg "The MySQL client has been installed."
+            ui_msg "If you also want a MySQL server, install the mysql5-server port."
+        }
     }
     
-    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
-    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
-        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
+    variant openssl description {Enable OpenSSL support} {
+    
+        license-append          OpenSSL SSLeay
+        depends_lib-append      port:openssl
+        configure.args-delete   --without-ssl
+        configure.args-append   --with-ssl=${prefix}
+        archcheck.files-append  lib/libssl.dylib
     }
+
+    livecheck.type          regex
+    livecheck.version       [lindex [split ${version} -] 0]
+    livecheck.url           http://dev.mysql.com/
+    livecheck.regex         "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>"
 }
+subport mysql51-server {
 
-post-install {
-    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
-        ui_msg "The MySQL client has been installed."
-        ui_msg "If you also want a MySQL server, install the mysql5-server port."
+    license                 BSD
+    description             Multithreaded SQL database server
+    long_description        MySQL is an open-source, multi-threaded SQL database with a command \
+                            syntax very similar to mSQL.
+    
+    homepage                http://www.mysql.com/
+    supported_archs         noarch
+    distfiles
+    
+    depends_run             port:${name}
+    
+    add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server
+    
+    startupitem.create      yes
+    startupitem.name        ${name}
+    startupitem.start       "${prefix}/share/${name}/mysql/mysql.server start"
+    startupitem.stop        "${prefix}/share/${name}/mysql/mysql.server stop"
+    
+    use_configure           no
+    
+    build {}
+    
+    destroot {
+        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
+        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
+            ${destroot}${prefix}/var/db/${name} \
+            ${destroot}${prefix}/var/log/${name} \
+            ${destroot}${prefix}/var/run/${name}
+        destroot.keepdirs-append  \
+            ${destroot}${prefix}/var/db/${name} \
+            ${destroot}${prefix}/var/log/${name} \
+            ${destroot}${prefix}/var/run/${name}
     }
+    
+    notes "
+    
+    If this is a new install you might want to run:
+        \$ sudo -u ${mysqluser} ${prefix}/lib/${name}/bin/mysql_install_db
+    
+    "
+    
+    livecheck.type          none
 }
-
-livecheck.type          regex
-livecheck.version       [lindex [split ${version} -] 0]
-livecheck.url           http://dev.mysql.com/
-livecheck.regex         "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>"

Added: trunk/dports/databases/mysql51/files/mysql51
===================================================================
--- trunk/dports/databases/mysql51/files/mysql51	                        (rev 0)
+++ trunk/dports/databases/mysql51/files/mysql51	2012-04-20 00:21:25 UTC (rev 92142)
@@ -0,0 +1,95 @@
+-
+-
+-
+-
+-
+lib/mysql51/bin/innochecksum
+lib/mysql51/bin/msql2mysql
+lib/mysql51/bin/my_print_defaults
+lib/mysql51/bin/myisam_ftdump
+lib/mysql51/bin/myisamchk
+lib/mysql51/bin/myisamlog
+lib/mysql51/bin/myisampack
+lib/mysql51/bin/mysql
+lib/mysql51/bin/mysql_client_test
+lib/mysql51/bin/mysql_client_test_embedded
+lib/mysql51/bin/mysql_config
+lib/mysql51/bin/mysql_convert_table_format
+lib/mysql51/bin/mysql_find_rows
+lib/mysql51/bin/mysql_fix_extensions
+lib/mysql51/bin/mysql_fix_privilege_tables
+-
+lib/mysql51/bin/mysql_secure_installation
+lib/mysql51/bin/mysql_setpermission
+lib/mysql51/bin/mysql_tzinfo_to_sql
+lib/mysql51/bin/mysql_upgrade
+lib/mysql51/bin/mysql_waitpid
+lib/mysql51/bin/mysql_zap
+lib/mysql51/bin/mysqlaccess
+-
+lib/mysql51/bin/mysqladmin
+lib/mysql51/bin/mysqlbinlog
+lib/mysql51/bin/mysqlbug
+lib/mysql51/bin/mysqlcheck
+lib/mysql51/bin/mysqld_multi
+lib/mysql51/bin/mysqld_safe
+lib/mysql51/bin/mysqldump
+lib/mysql51/bin/mysqldumpslow
+lib/mysql51/bin/mysqlhotcopy
+lib/mysql51/bin/mysqlimport
+lib/mysql51/bin/mysqlshow
+lib/mysql51/bin/mysqlslap
+lib/mysql51/bin/mysqltest
+lib/mysql51/bin/mysqltest_embedded
+lib/mysql51/bin/perror
+lib/mysql51/bin/replace
+lib/mysql51/bin/resolve_stack_dump
+lib/mysql51/bin/resolveip
+-
+share/man/mysql51/man1/comp_err.1.gz
+share/man/mysql51/man1/innochecksum.1.gz
+share/man/mysql51/man1/msql2mysql.1.gz
+share/man/mysql51/man1/my_print_defaults.1.gz
+share/man/mysql51/man1/myisam_ftdump.1.gz
+share/man/mysql51/man1/myisamchk.1.gz
+share/man/mysql51/man1/myisamlog.1.gz
+share/man/mysql51/man1/myisampack.1.gz
+share/man/mysql51/man1/mysql-stress-test.pl.1.gz
+share/man/mysql51/man1/mysql-test-run.pl.1.gz
+share/man/mysql51/man1/mysql.1.gz
+share/man/mysql51/man1/mysql.server.1.gz
+share/man/mysql51/man1/mysql_client_test.1.gz
+share/man/mysql51/man1/mysql_client_test_embedded.1.gz
+share/man/mysql51/man1/mysql_config.1.gz
+share/man/mysql51/man1/mysql_convert_table_format.1.gz
+share/man/mysql51/man1/mysql_find_rows.1.gz
+share/man/mysql51/man1/mysql_fix_extensions.1.gz
+share/man/mysql51/man1/mysql_install_db.1.gz
+-
+share/man/mysql51/man1/mysql_secure_installation.1.gz
+share/man/mysql51/man1/mysql_setpermission.1.gz
+share/man/mysql51/man1/mysql_tzinfo_to_sql.1.gz
+share/man/mysql51/man1/mysql_upgrade.1.gz
+share/man/mysql51/man1/mysql_waitpid.1.gz
+share/man/mysql51/man1/mysql_zap.1.gz
+share/man/mysql51/man1/mysqlaccess.1.gz
+share/man/mysql51/man1/mysqladmin.1.gz
+share/man/mysql51/man1/mysqlbinlog.1.gz
+share/man/mysql51/man1/mysqlbug.1.gz
+share/man/mysql51/man1/mysqlcheck.1.gz
+share/man/mysql51/man1/mysqld_multi.1.gz
+share/man/mysql51/man1/mysqld_safe.1.gz
+share/man/mysql51/man1/mysqldump.1.gz
+share/man/mysql51/man1/mysqldumpslow.1.gz
+share/man/mysql51/man1/mysqlhotcopy.1.gz
+share/man/mysql51/man1/mysqlimport.1.gz
+share/man/mysql51/man1/mysqlman.1.gz
+share/man/mysql51/man1/mysqlshow.1.gz
+share/man/mysql51/man1/mysqlslap.1.gz
+share/man/mysql51/man1/mysqltest.1.gz
+share/man/mysql51/man1/mysqltest_embedded.1.gz
+share/man/mysql51/man1/perror.1.gz
+share/man/mysql51/man1/replace.1.gz
+share/man/mysql51/man1/resolve_stack_dump.1.gz
+share/man/mysql51/man1/resolveip.1.gz
+share/man/mysql51/man8/mysqld.8.gz

Modified: trunk/dports/databases/mysql51/files/patch-Makefile.in.diff
===================================================================
--- trunk/dports/databases/mysql5/files/patch-Makefile.in.diff	2012-04-08 18:09:25 UTC (rev 91709)
+++ trunk/dports/databases/mysql51/files/patch-Makefile.in.diff	2012-04-20 00:21:25 UTC (rev 92142)
@@ -1,6 +1,6 @@
---- Makefile.in.orig	2010-08-03 12:29:19.000000000 -0500
-+++ Makefile.in	2010-09-05 02:53:04.000000000 -0500
-@@ -417,7 +417,7 @@
+--- a/Makefile.in	2012-04-12 09:59:54.000000000 -0700
++++ b/Makefile.in	2012-04-12 09:59:19.000000000 -0700
+@@ -412,7 +412,7 @@
  			@sql_union_dirs@ unittest \
  			@sql_server@ @man_dirs@ tests \
  			netware @libmysqld_dirs@ \

Deleted: trunk/dports/databases/mysql51/files/patch-mysql_secure_installation.sh.diff
===================================================================
--- trunk/dports/databases/mysql5/files/patch-mysql_secure_installation.sh.diff	2012-04-08 18:09:25 UTC (rev 91709)
+++ trunk/dports/databases/mysql51/files/patch-mysql_secure_installation.sh.diff	2012-04-20 00:21:25 UTC (rev 92142)
@@ -1,11 +0,0 @@
---- scripts/mysql_secure_installation.sh.orig	2010-08-03 12:24:30.000000000 -0500
-+++ scripts/mysql_secure_installation.sh	2010-09-05 02:55:31.000000000 -0500
-@@ -40,7 +40,7 @@
- 
- find_mysql_client()
- {
--  for n in ./bin/mysql mysql
-+  for n in @BINDIR@/mysql ./bin/mysql mysql
-   do  
-     $n --no-defaults --help > /dev/null 2>&1
-     status=$?

Added: trunk/dports/databases/mysql51/files/patch-scripts-mysql_secure_installation.sh.diff
===================================================================
--- trunk/dports/databases/mysql51/files/patch-scripts-mysql_secure_installation.sh.diff	                        (rev 0)
+++ trunk/dports/databases/mysql51/files/patch-scripts-mysql_secure_installation.sh.diff	2012-04-20 00:21:25 UTC (rev 92142)
@@ -0,0 +1,11 @@
+--- a/scripts/mysql_secure_installation.sh	2012-04-12 09:59:58.000000000 -0700
++++ b/scripts/mysql_secure_installation.sh	2012-04-12 09:59:22.000000000 -0700
+@@ -40,7 +40,7 @@
+ 
+ find_mysql_client()
+ {
+-  for n in ./bin/mysql mysql
++  for n in @BINDIR@/mysql ./bin/mysql mysql
+   do  
+     $n --no-defaults --help > /dev/null 2>&1
+     status=$?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120419/9592f992/attachment-0001.html>


More information about the macports-changes mailing list