# $Id: Portfile,v 1.4 2004/01/22 11:01:30 jkh Exp $ PortSystem 1.0 name MyODBC version 3.51.06 categories databases platforms darwin maintainers simon@cotsworth.com description MySQL Connector/ODBC long_description MySQL Connector/ODBC (also known as MyODBC) allows you \ to connect to a MySQL database server using the ODBC database \ API on all Microsoft Windows and most Unix platforms, \ including through such applications and programming \ environments such as Microsoft Access, Microsoft Excel, and \ Borland Delphi. homepage http://www.mysql.com/ master_sites http://mysql.mirror.anlx.net/Downloads/MyODBC3/ \ http://gd.tuwien.ac.at/db/mysql/Downloads/MyODBC3/ checksums md5 5a59b4f01592fc9ec96e985bc7d6aada depends_lib lib:libdl:dlcompat \ lib:libiconv.2:libiconv \ lib:readline:readline \ lib:mysql:mysql \ lib:libodbc.1:unixODBC configure.env CFLAGS=-no-cpp-precomp \ LDFLAGS=-L${prefix}/lib \ CPPFLAGS=-I${prefix}/include configure.args --with-unixODBC=${prefix} \ --with-unixODBC-libs=${prefix}/lib \ --with-unixODBC-includes=${prefix}/include \ --with-odbc-ini=${prefix}/etc/odbc.ini \ --with-mysql-libs=${prefix}/lib/mysql \ --with-mysql-includes=${prefix}/include/mysql \ --with-docs \ --enable-shared set odbc "unixODBC" set doc_dest "${destroot}${prefix}/share/doc/${name}" set share_dest "${destroot}${prefix}/share/${name}" set odbc_share "${prefix}/share/${odbc}" post-destroot { system "cd ${worksrcpath}/driver && \ /usr/bin/gcc -bundle -flat_namespace -undefined error -o \ .libs/libmyodbc3-${version}.so *.o -L${prefix}/lib/mysql \ -L${prefix}/lib -lodbcinst -lmysqlclient -lz -lc" # Install libmyodbc3.so and create symbolic links system "install -m 755 \ ${worksrcpath}/driver/.libs/libmyodbc3-${version}.so \ ${destroot}${prefix}/lib/libmyodbc3-${version}.so" system "cd ${destroot}${prefix}/lib && \ ln -fs libmyodbc3-${version}.so libmyodbc3.so" # Install documentation file mkdir ${doc_dest} system "cd ${worksrcpath} && \ tar -cf - COPYING INSTALL INSTALL-BINARY README | \ tar -xf - -C ${doc_dest}" system "install -m 644 ${worksrcpath}/RELEASE-NOTES \ ${doc_dest}/RELEASE-NOTES-${version}" system "chown -R `id -u`:`id -g` ${doc_dest}" # Install samples and myodbc example .ini file mkdir ${share_dest} ${share_dest}/samples system "install -m 755 ${worksrcpath}/samples/.libs/my_* \ ${share_dest}/samples" system "install -m 644 ${worksrcpath}/odbc.ini \ ${share_dest}/odbc.ini.default" reinplace "s|/usr/local|${prefix}|g" \ "${share_dest}/odbc.ini.default" # Install odbc mysql templates file mkdir ${destroot}${odbc_share} system "install -m 755 ${portpath}/${filesdir}/*.template \ ${destroot}${odbc_share}" reinplace "s|DarwinPortsDirectory|${prefix}|g" \ "${destroot}${odbc_share}/mysql.driver.template" } post-install { system "${prefix}/bin/odbcinst -i -d -f \ ${odbc_share}/mysql.driver.template" system "${prefix}/bin/odbcinst -i -s -f \ ${odbc_share}/mysql.data.template" }