source: trunk/dports/databases/mysql/Portfile @ 3173

Last change on this file since 3173 was 3173, checked in by jkh, 17 years ago

Mass-merge of destroot target changes. Before committing this, I also
laid down a PRE_DESTROOT_TARGET so we can easily compare the before and
after photos (or, in extremis, revert this change). I doubt that will be
necessary, however, since things appear to be working quite well with this
change and it's better to do it sooner rather than later since it changes the
rules about what commands/variables to use in new ports.

Approved by: fkr

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1# $Id: Portfile,v 1.29 2003/08/05 09:28:59 jkh Exp $
2
3PortSystem 1.0
4name                    mysql
5version                 3.23.52
6categories              databases
7maintainers             eric@opendarwin.org
8description             Multithreaded SQL database server
9long_description        MySQL is an open-source, multi-threaded SQL database \
10                        with a command syntax very similar to mSQL.
11homepage                http://www.mysql.com/
12platforms               darwin
13master_sites            ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-3.23/ \
14                        ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles/ \
15                        http://distfiles.opendarwin.org/:lt
16
17set filename            ${portname}-${portversion}${extract.sufx}
18distfiles               ${filename} ltconfig13:lt ltmain13:lt
19extract.only            ${filename}
20depends_lib             lib:libdl.1:dlcompat
21
22checksums               mysql-3.23.52.tar.gz md5 \
23                        88705b7f38e64b5c21ebb68c77b75e5a \
24                        ltconfig13 md5 ea53f42a550c9f9e653758a8ed91574e \
25                        ltmain13 md5 e094ae92724c4015dbab97de151c2525
26
27post-patch {            system "cp ${distpath}/ltconfig13 ${worksrcpath}/ltconfig"
28                        system "cp ${distpath}/ltmain13 ${worksrcpath}/ltmain.sh"
29}
30
31set dbdir               ${prefix}/var/db/mysql
32
33configure.env           LDFLAGS=-L${prefix}/lib\\ -lncurses \
34                        CPPFLAGS=-I${prefix}/include
35
36configure.args          --localstatedir=${dbdir} \
37                        --without-bench
38
39pre-destroot            { system "install -o root -m 755 -d ${dbdir}" }
40
41variant server  {
42        depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
43
44        post-destroot {
45                addgroup mysql
46                set gid [existsgroup mysql]
47                adduser mysql gid=${gid} realname=MySQL\ Server
48
49                #system "${destroot}${prefix}/bin/mysql_install_db"
50                #system "chown -R mysql:mysql ${dbdir}"
51               
52                system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d"
53                set script [open ${destroot}${prefix}/etc/rc.d/mysql.sh w 0755]
54                puts $script "#!/bin/sh"
55                puts $script "${prefix}/bin/safe_mysqld --user=mysql &"
56                close $script
57        }
58}
Note: See TracBrowser for help on using the repository browser.