1 | # $Id: $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | name MyODBC |
---|
5 | version 3.51.06 |
---|
6 | categories databases |
---|
7 | platforms darwin |
---|
8 | |
---|
9 | maintainers simon@cotsworth.com |
---|
10 | |
---|
11 | description MySQL Connector/ODBC |
---|
12 | |
---|
13 | long_description MySQL Connector/ODBC (also known as MyODBC) allows you to connect to a MySQL \ |
---|
14 | database server using the ODBC database API on all Microsoft Windows and most \ |
---|
15 | Unix platforms, including through such applications and programming environments \ |
---|
16 | such as Microsoft Access, Microsoft Excel, and Borland Delphi. |
---|
17 | |
---|
18 | homepage http://www.mysql.com/ |
---|
19 | master_sites http://mysql.mirror.anlx.net/Downloads/MyODBC3/ \ |
---|
20 | http://gd.tuwien.ac.at/db/mysql/Downloads/MyODBC3/ |
---|
21 | |
---|
22 | checksums md5 5a59b4f01592fc9ec96e985bc7d6aada |
---|
23 | |
---|
24 | depends_lib lib:libdl.1:dlcompat \ |
---|
25 | lib:libiconv.2:libiconv \ |
---|
26 | lib:readline:readline \ |
---|
27 | lib:mysql:mysql \ |
---|
28 | lib:libodbc.1:unixODBC |
---|
29 | |
---|
30 | configure.env CFLAGS=-no-cpp-precomp \ |
---|
31 | LDFLAGS=-L${prefix}/lib \ |
---|
32 | CPPFLAGS=-I${prefix}/include |
---|
33 | |
---|
34 | configure.args --with-unixODBC=${prefix} \ |
---|
35 | --with-unixODBC-libs=${prefix}/lib \ |
---|
36 | --with-unixODBC-includes=${prefix}/include \ |
---|
37 | --with-odbc-ini=${prefix}/etc/odbc.ini \ |
---|
38 | --with-mysql-libs=${prefix}/lib/mysql \ |
---|
39 | --with-mysql-includes=${prefix}/include/mysql \ |
---|
40 | --with-docs \ |
---|
41 | --enable-shared |
---|
42 | |
---|
43 | set odbc "unixODBC" |
---|
44 | set doc_dest "${destroot}${prefix}/share/doc/${name}" |
---|
45 | set share_dest "${destroot}${prefix}/share/${name}" |
---|
46 | set odbc_share "${prefix}/share/${odbc}" |
---|
47 | |
---|
48 | post-destroot { system "cd ${worksrcpath}/driver && \ |
---|
49 | /usr/bin/gcc -bundle -flat_namespace -undefined error -o \ |
---|
50 | .libs/libmyodbc3-${version}.so *.o -L${prefix}/lib/mysql -L${prefix}/lib \ |
---|
51 | -lodbcinst -lmysqlclient -lz -lc" |
---|
52 | |
---|
53 | # Install libmyodbc3.so and create symbolic links |
---|
54 | system "install -m 755 ${worksrcpath}/driver/.libs/libmyodbc3-${version}.so \ |
---|
55 | ${destroot}${prefix}/lib/libmyodbc3-${version}.so" |
---|
56 | system "cd ${destroot}${prefix}/lib && \ |
---|
57 | ln -s libmyodbc3-${version}.so libmyodbc3.so" |
---|
58 | |
---|
59 | # Install documentation |
---|
60 | file mkdir ${doc_dest} |
---|
61 | system "cd ${worksrcpath} && \ |
---|
62 | tar -cf - COPYING INSTALL INSTALL-BINARY README | \ |
---|
63 | tar -xf - -C ${doc_dest}" |
---|
64 | system "install -m 644 ${worksrcpath}/RELEASE-NOTES \ |
---|
65 | ${doc_dest}/RELEASE-NOTES-${version}" |
---|
66 | system "chown -R `id -u`:`id -g` ${doc_dest}" |
---|
67 | |
---|
68 | # Install samples and myodbc example .ini |
---|
69 | file mkdir ${share_dest} ${share_dest}/samples |
---|
70 | system "install -m 755 ${worksrcpath}/samples/.libs/my_* \ |
---|
71 | ${share_dest}/samples" |
---|
72 | system "install -m 644 ${worksrcpath}/odbc.ini \ |
---|
73 | ${share_dest}/odbc.ini.default" |
---|
74 | reinplace "s|/usr/local|${prefix}|g" \ |
---|
75 | "${share_dest}/odbc.ini.default" |
---|
76 | |
---|
77 | # Install odbc mysql templates |
---|
78 | file mkdir ${destroot}${odbc_share} |
---|
79 | system "install -m 755 ${portpath}/${filedir}/*.template \ |
---|
80 | ${destroot}${odbc_share}" |
---|
81 | reinplace "s|DarwinPortsDirectory|${prefix}|g" \ |
---|
82 | "${destroot}${odbc_share}/mysql.driver.template" } |
---|
83 | |
---|
84 | post-install { system "${prefix}/bin/odbcinst -i -d -f \ |
---|
85 | ${odbc_share}/mysql.driver.template" |
---|
86 | system "${prefix}/bin/odbcinst -i -s -f \ |
---|
87 | ${odbc_share}/mysql.data.template" } |
---|