=== Portfile
==================================================================
|
|
|
5 | 5 | |
6 | 6 | name py-bsddb |
7 | 7 | version 2.4.3 |
| 8 | revision 1 |
8 | 9 | categories python databases |
9 | 10 | platforms darwin |
10 | 11 | maintainers mww@opendarwin.org |
… |
… |
|
26 | 27 | file copy ${filespath}/setup.py ${worksrcpath} |
27 | 28 | } |
28 | 29 | |
29 | | set db_version 4 |
30 | | depends_lib-append lib:libdb-4:db4 |
| 30 | set libdir ${prefix}/lib/db44 |
| 31 | set incdir ${prefix}/include/db44 |
| 32 | depends_lib-append port:db44 |
31 | 33 | |
32 | 34 | variant db3 { |
33 | | set db_version 3 |
34 | | depends_lib-delete lib:libdb-4:db4 |
35 | | depends_lib-append lib:libdb-3:db3 |
| 35 | set libdir ${prefix}/lib |
| 36 | set incdir ${prefix}/include/db3 |
| 37 | depends_lib-delete port:db44 |
| 38 | depends_lib-append port:db3 |
36 | 39 | } |
37 | 40 | |
38 | 41 | post-patch { |
39 | 42 | cd ${worksrcpath} |
40 | 43 | reinplace "s|__VERSION__|${version}|g" setup.py |
41 | | reinplace "s|__PREFIX__|${prefix}|g" setup.py |
42 | | reinplace "s|<db.h>|<db${db_version}/db.h>|g" _bsddb.c |
| 44 | reinplace "s|__LIBDIR__|${libdir}|g" setup.py |
| 45 | reinplace "s|__INCDIR__|${incdir}|g" setup.py |
43 | 46 | } |
44 | 47 | |
=== files/setup.py
==================================================================
|
|
|
6 | 6 | except: |
7 | 7 | raise SystemExit, "Distutils problem" |
8 | 8 | |
9 | | prefix = "__PREFIX__" |
10 | | inc_dirs = [prefix + "/include"] |
11 | | lib_dirs = [prefix + "/lib"] |
12 | | libs = ["db-4"] |
| 9 | inc_dirs = ["__INCDIR__"] |
| 10 | lib_dirs = ["__LIBDIR__"] |
| 11 | libs = ["db"] |
13 | 12 | |
14 | 13 | setup(name = "_bsddb", |
15 | 14 | version = "__VERSION__", |