# $Id: Portfile,v 1.1 2003/10/27 11:36:47 mww Exp $ PortSystem 1.0 name unixODBC version 2.2.6 categories databases platforms darwin maintainers simon@cotsworth.com description Provides ODBC 3 connectivity for Unix long_description The unixODBC project provides UNIX applications with the same ODBC 3.51 API \ and facilities available under Windows. It provides a Driver Manager that \ supports the full ODBC API and performs the ODBC 3 to ODBC 2 translations \ with UNICODE to ANSI conversion. It also includes a set of graphical utilities \ that allow users to specify connections to DBMSes to be used by applications, \ a collection of ODBC drivers including a simple text based driver, an NNTP \ driver, a Postgres driver and others, and a selection of templates and \ libraries that to aid in the construction of ODBC drivers. It works with \ MySQL, Postgres, StarOffice, Applixware, iHTML, PHP, Perl DBD::ODBC, \ Paradox 9, and many other applications and drivers. Connection pooling is \ also provided to increase performance with applications such as PHP. homepage http://www.unixodbc.org/ master_sites ${homepage} \ ftp://ftp.easysoft.com/pub/beta/unixODBC/ checksums md5 748ce54e34b2b339c99a8b1ddaee54f5 depends_lib lib:libdl.1:dlcompat \ lib:libiconv.2:libiconv \ lib:readline:readline patchfiles patch-configure \ patch-ltmain.sh \ patch-SQLManageDataSources.c set share_path "${prefix}/share/${name}" set doc_dest "${destroot}${prefix}/share/doc/${name}" configure.env LDFLAGS=-L${prefix}/lib \ CPPFLAGS=-I${prefix}/include configure.args --with-libiconv-prefix=${prefix} \ --disable-stats \ --enable-gui=no post-destroot { file mkdir ${destroot}${share_path} system "install -m 644 ${portpath}/${filedir}/*.template \ ${destroot}${share_path}" reinplace "s|DarwinPortsDirectory|${prefix}|g" \ "${destroot}${share_path}/postgresql.driver.template" # ODBCDataSources Directory & empty directory hack file mkdir ${destroot}${prefix}/etc/ODBCDataSources system "touch ${destroot}${prefix}/etc/ODBCDataSources/.turd" # Install Documentation file mkdir ${doc_dest} system "cd ${worksrcpath}/doc && \ tar -cf - * | tar -xf - -C ${doc_dest}" system "find ${doc_dest} -name 'Makefile*' | xargs rm" system "chown -R `id -u`:`id -g` ${doc_dest}" # Create .so system "cd ${destroot}${prefix}/lib/ && \ /usr/bin/gcc -bundle -undefined error -o libodbc.1.0.0.so libodbc.1.0.0.dylib && \ ln -s libodbc.1.0.0.so libodbc.1.so && \ ln -s libodbc.1.0.0.so libodbc.so" } post-install { system "${prefix}/bin/odbcinst -i -d -f \ ${share_path}/postgresql.driver.template" system "${prefix}/bin/odbcinst -i -s -f \ ${share_path}/postgresql.data.template" }