Ticket #24552: Portfile

File Portfile, 4.3 KB (added by loic.nageleisen@…, 14 years ago)

Altered 0.82 Portfile to build 0.82-patched (aka 0.82.1)

Line 
1# -*- 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
2# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                freetds
7version             0.82
8categories          databases
9platforms           darwin
10maintainers         nomaintainer
11
12description         A set of libraries for Unix and Linux that allows your programs to natively \
13                    talk to Microsoft SQL Server and Sybase databases
14
15long_description    FreeTDS is an open source implementation of the TDS (Tabular DataStream) \
16                    protocol used by these databases for their own clients. It supports many \
17                    different flavors of the protocol and supports several APIs to access it. \
18                    Additionally FreeTDS works with other software such as Perl and PHP, \
19                    providing access from those languages as well. There is also a native (type 4) \
20                    JDBC driver available for platform-independent Java clients (including Java \
21                    Server Pages applications), with support for most of the JDBC 1 API and \
22                    portions of the JDBC 2 API.
23
24homepage            http://www.freetds.org/
25master_sites        ftp://ftp.ibiblio.org/pub/Linux/ALPHA/${name}/stable/ \
26                    http://ibiblio.org/pub/Linux/ALPHA/${name}/stable/ \
27                    http://ibiblio.org/pub/Linux/ALPHA/${name}/old/${version}/
28
29distfiles           ${name}-patched.tgz
30worksrcdir          freetds-0.82.1.dev.20100304
31checksums           md5     15c4645f5ae14be4d29b5b51221d19f0 \
32                    sha1    ee95b36ae905dfded6c284c220c3e8ce4c6e5e13
33
34depends_build       port:libtool
35
36depends_lib         port:libiconv \
37                    port:ncurses \
38                    port:readline
39
40#patchfiles          patch-cspublic.h
41
42configure.args      --mandir=${prefix}/share/man \
43                    --includedir=${prefix}/include/${name} \
44                    --sysconfdir=${prefix}/etc/${name} \
45                    --with-libiconv-prefix=${prefix}
46
47post-patch {
48    reinplace "s|../replacements/libreplacements.la||g" \
49        ${worksrcpath}/src/server/Makefile.in \
50        ${worksrcpath}/src/ctlib/Makefile.in \
51        ${worksrcpath}/src/odbc/Makefile.in \
52        ${worksrcpath}/src/dblib/Makefile.in \
53        ${worksrcpath}/src/apps/Makefile.in
54   
55    reinplace "s|../../replacements/libreplacements.la||g" \
56        ${worksrcpath}/src/apps/fisql/Makefile.in \
57        ${worksrcpath}/src/dblib/unittests/Makefile.in \
58        ${worksrcpath}/src/tds/unittests/Makefile.in
59}
60
61use_parallel_build  yes
62
63pre-build {
64    ln -sf ${prefix}/bin/glibtool ${worksrcpath}/libtool
65}
66
67post-destroot {
68    # rename the freetds conf files so we don't clobber any existing ones
69    foreach file [list "freetds.conf" "locales.conf" "pool.conf"] {
70        file rename ${destroot}${prefix}/etc/freetds/${file} ${destroot}${prefix}/etc/freetds/${file}.sample
71    }
72   
73    file rename ${destroot}${prefix}/share/doc/${worksrcdir} \
74        ${destroot}${prefix}/share/doc/${name}
75}
76
77post-activate {
78    # copy over freetds sample files if none exists
79    ui_msg "\n****************************************************************"
80    foreach file [list "freetds.conf" "locales.conf" "pool.conf"] {
81        if {![file exists ${prefix}/etc/freetds/${file}]} {
82            ui_msg "Configuration file ${file} does not exist and has been created using"
83            ui_msg "    ${prefix}/etc/freetds/${file}.sample"
84            file copy ${prefix}/etc/freetds/${file}.sample ${prefix}/etc/freetds/${file}
85        } else {
86            ui_msg "Configuration file ${file} exists and has has been retained."
87            ui_msg "(The distribution's version has been installed to ${prefix}/etc/freetds/${file}.sample)"
88        }
89    }
90    ui_msg "****************************************************************"
91}
92
93variant mssql description {Use MS style dblib} {
94    configure.args-append --enable-msdblib --with-tdsver=8.0
95}
96
97variant odbc description {Build odbc driver against unixODBC} {
98    depends_lib-append port:unixODBC
99    configure.args-append --with-unixodbc=${prefix}
100}
101
102livecheck.type  regex
103livecheck.url   ftp://ftp.ibiblio.org/pub/Linux/ALPHA/${name}/stable/
104livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"