source: trunk/dports/databases/mysql55-lib_mysqludf_fproj4/Portfile

Last change on this file was 98508, checked in by pixilla@…, 5 years ago

databases/mysql55-lib_mysqludf_fproj4:

  • New port, user defined function fproj4.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 98508 2012-10-07 18:46:27Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6set package.name    lib_mysqludf_fPROJ4
7version             0.1.0
8revision            1
9set mysql.name      mysql55
10name                ${mysql.name}-${package.name}
11
12set mysql.ports     {mysql5 mysql51 mysql55 mariadb percona}
13foreach mysql.port ${mysql.ports} {
14
15    lappend mysql.extension.ports "${mysql.port}-${package.name}"
16}
17foreach mysql.extension.port ${mysql.extension.ports} {
18
19    set idx [lsearch ${mysql.extension.ports} ${mysql.extension.port}]
20    set mysql.port [lindex ${mysql.ports} $idx]
21    if {${mysql.extension.port} == ${name} == ${subport}} {
22
23        depends_lib-append  port:${mysql.port}
24    } else {
25
26        subport ${mysql.port}-${package.name} {
27   
28            set mysql.name      ${mysql.port}
29            depends_lib-append  port:${mysql.port}
30        }
31    }
32}
33
34categories          databases lang
35maintainers         pixilla
36platforms           darwin
37
38description         Based on program PROJ.4, ${package.name} converts geographic longitude and \
39                    latitude coordinates into cartesian coordinates.
40long_description    This library is based on program PROJ.4 which is a standard Unix filter \
41                    function which converts geographic longitude and latitude coordinates \
42                    into cartesian coordinates, by means of a wide variety of cartographic \
43                    projection functions.
44
45homepage            http://www.mysqludf.org/${package.name}/
46master_sites        ${homepage}
47
48dist_subdir         lib_mysqludf
49distname            ${package.name}-${version}
50worksrcdir          ${distname}-src
51
52checksums           rmd160  062aabb5764d9c0d6bf3803faa7a5e0d0116d90a \
53                    sha256  22ec139f1652040828da18a4b3a469355486d459f8000d25381422b9c9e45cdd
54
55depends_lib-append  port:proj
56
57use_configure       no
58
59configure.cflags-append \
60                    -I${prefix}/include/${mysql.name} \
61                    -I${prefix}/include/${mysql.name}/mysql \
62                    -lproj \
63                    -bundle \
64                    -undefined dynamic_lookup
65
66build {
67    set cmd "${configure.cpp} ${configure.ldflags} ${configure.cflags} ${configure.cppflags}"
68    if [variant_isset universal] {
69
70        set  "${cmd} ${configure.universal_cflags}"
71    }
72    system "cd ${worksrcpath} && ${cmd} ${package.name}.c -o ${package.name}.so"
73
74    xinstall -d ${worksrcpath}/macports
75    set fp [open ${worksrcpath}/macports/installdb.sql w]
76    puts $fp "USE mysql;"
77    puts $fp "DROP FUNCTION IF EXISTS lib_mysqludf_fPROJ4_info;"
78    puts $fp "DROP FUNCTION IF EXISTS fPROJ4_transform;"
79    puts $fp "DROP FUNCTION IF EXISTS fPROJ4_Geo2UTM;"
80    puts $fp "DROP FUNCTION IF EXISTS fPROJ4_UTM2Geo;"
81    puts $fp "CREATE FUNCTION lib_mysqludf_fPROJ4_info RETURNS STRING SONAME '${package.name}.so';"
82    puts $fp "CREATE FUNCTION fPROJ4_transform RETURNS REAL SONAME '${package.name}.so';"
83    puts $fp "CREATE FUNCTION fPROJ4_Geo2UTM RETURNS REAL SONAME '${package.name}.so';"
84    puts $fp "CREATE FUNCTION fPROJ4_UTM2Geo RETURNS REAL SONAME '${package.name}.so';"
85    close $fp
86
87    set fp [open ${worksrcpath}/macports/uninstalldb.sql w]
88    puts $fp "USE mysql;"
89    puts $fp "DROP FUNCTION IF EXISTS lib_mysqludf_fPROJ4_info;"
90    puts $fp "DROP FUNCTION IF EXISTS fPROJ4_transform;"
91    puts $fp "DROP FUNCTION IF EXISTS fPROJ4_Geo2UTM;"
92    puts $fp "DROP FUNCTION IF EXISTS fPROJ4_UTM2Geo;"
93    close $fp
94}
95
96destroot {
97    xinstall -m 755 -d ${destroot}${prefix}/lib/${mysql.name}/plugin
98    xinstall -m 644 -W ${worksrcpath} \
99        ${package.name}.so \
100        ${destroot}${prefix}/lib/${mysql.name}/plugin
101    xinstall -m 755 -d ${destroot}${prefix}/share/${mysql.name}/${package.name}
102    xinstall -m 644 -W ${worksrcpath}/macports \
103        installdb.sql uninstalldb.sql \
104        ${destroot}${prefix}/share/${mysql.name}/${package.name}
105}
106
107livecheck.url       [lindex ${master_sites} 0]
108livecheck.type      regex
109livecheck.regex     "${package.name}-(\\d+\\.\\d+(\[\\drc.\]+)?)${extract.suffix}"
110
111notes "
112
113    This port installs two mysql scripts to simplify the install/uninstall of the ${package.name}
114    UDFs (user-defined-functions).
115   
116    Install:
117    \$ ${prefix}/lib/${mysql.name}/bin/mysql -uroot -p < ${prefix}/share/${mysql.name}/${package.name}/installdb.sql
118
119    Uninstall:
120    \$ ${prefix}/lib/${mysql.name}/bin/mysql -uroot -p < ${prefix}/share/${mysql.name}/${package.name}/uninstalldb.sql
121    "
Note: See TracBrowser for help on using the repository browser.