| @@ -1,122 +1,122 @@ | | | @@ -1,122 +1,122 @@ |
1 | # $NetBSD: pgsql.buildlink3.mk,v 1.27 2009/08/14 19:40:48 joerg Exp $ | | 1 | # $NetBSD: pgsql.buildlink3.mk,v 1.28 2010/02/10 19:33:54 joerg Exp $ |
2 | # | | 2 | # |
3 | # User-settable variables: | | 3 | # User-settable variables: |
4 | # | | 4 | # |
5 | # PGSQL_VERSION_DEFAULT | | 5 | # PGSQL_VERSION_DEFAULT |
6 | # | | 6 | # |
7 | # Package-settable variables: | | 7 | # Package-settable variables: |
8 | # | | 8 | # |
9 | # PGSQL_VERSIONS_ACCEPTED | | 9 | # PGSQL_VERSIONS_ACCEPTED |
10 | # | | 10 | # |
11 | # Variables set by this file: | | 11 | # Variables set by this file: |
12 | # | | 12 | # |
13 | # PG_LIB_EXT | | 13 | # PG_LIB_EXT |
14 | # PGSQL_TYPE | | 14 | # PGSQL_TYPE |
15 | # PGPKGSRCDIR | | 15 | # PGPKGSRCDIR |
16 | # | | 16 | # |
17 | | | 17 | |
18 | .if !defined(PGVERSION_MK) | | 18 | .if !defined(PGVERSION_MK) |
19 | PGVERSION_MK= defined | | 19 | PGVERSION_MK= defined |
20 | | | 20 | |
21 | _VARGROUPS+= pgsql | | 21 | _VARGROUPS+= pgsql |
22 | _USER_VARS.pgsql= PGSQL_VERSION_DEFAULT | | 22 | _USER_VARS.pgsql= PGSQL_VERSION_DEFAULT |
23 | _PKG_VARS.pgsql= PGSQL_VERSIONS_ACCEPTED | | 23 | _PKG_VARS.pgsql= PGSQL_VERSIONS_ACCEPTED |
24 | _SYS_VARS.pgsql= PG_LIB_EXT PGSQL_TYPE PGPKGSRCDIR | | 24 | _SYS_VARS.pgsql= PG_LIB_EXT PGSQL_TYPE PGPKGSRCDIR |
25 | | | 25 | |
26 | .include "../../mk/bsd.prefs.mk" | | 26 | .include "../../mk/bsd.prefs.mk" |
27 | | | 27 | |
28 | PGSQL_VERSION_DEFAULT?= 82 | | 28 | PGSQL_VERSION_DEFAULT?= 84 |
29 | PGSQL_VERSIONS_ACCEPTED?= 84 83 82 | | 29 | PGSQL_VERSIONS_ACCEPTED?= 84 83 82 |
30 | | | 30 | |
31 | # transform the list into individual variables | | 31 | # transform the list into individual variables |
32 | .for pv in ${PGSQL_VERSIONS_ACCEPTED} | | 32 | .for pv in ${PGSQL_VERSIONS_ACCEPTED} |
33 | _PGSQL_VERSION_${pv}_OK= yes | | 33 | _PGSQL_VERSION_${pv}_OK= yes |
34 | .endfor | | 34 | .endfor |
35 | | | 35 | |
36 | .if ${_OPSYS_SHLIB_TYPE} == "dylib" | | 36 | .if ${_OPSYS_SHLIB_TYPE} == "dylib" |
37 | PG_LIB_EXT=dylib | | 37 | PG_LIB_EXT=dylib |
38 | .else | | 38 | .else |
39 | PG_LIB_EXT=so | | 39 | PG_LIB_EXT=so |
40 | .endif | | 40 | .endif |
41 | | | 41 | |
42 | # check what is installed | | 42 | # check what is installed |
43 | .if ${OPSYS} == "Darwin" | | 43 | .if ${OPSYS} == "Darwin" |
44 | .if exists(${LOCALBASE}/lib/libecpg.6.0.1.dylib) | | 44 | .if exists(${LOCALBASE}/lib/libecpg.6.0.1.dylib) |
45 | _PGSQL_VERSION_84_INSTALLED= yes | | 45 | _PGSQL_VERSION_84_INSTALLED= yes |
46 | .endif | | 46 | .endif |
47 | .if exists(${LOCALBASE}/lib/libecpg.6.0.0.dylib) | | 47 | .if exists(${LOCALBASE}/lib/libecpg.6.0.0.dylib) |
48 | _PGSQL_VERSION_83_INSTALLED= yes | | 48 | _PGSQL_VERSION_83_INSTALLED= yes |
49 | .endif | | 49 | .endif |
50 | .if exists(${LOCALBASE}/lib/libecpg.5.0.2.dylib) | | 50 | .if exists(${LOCALBASE}/lib/libecpg.5.0.2.dylib) |
51 | _PGSQL_VERSION_82_INSTALLED= yes | | 51 | _PGSQL_VERSION_82_INSTALLED= yes |
52 | .endif | | 52 | .endif |
53 | .else | | 53 | .else |
54 | .if exists(${LOCALBASE}/lib/libecpg.so.6.0.1) | | 54 | .if exists(${LOCALBASE}/lib/libecpg.so.6.0.1) |
55 | _PGSQL_VERSION_84_INSTALLED= yes | | 55 | _PGSQL_VERSION_84_INSTALLED= yes |
56 | .endif | | 56 | .endif |
57 | .if exists(${LOCALBASE}/lib/libecpg.so.6.0.0) | | 57 | .if exists(${LOCALBASE}/lib/libecpg.so.6.0.0) |
58 | _PGSQL_VERSION_83_INSTALLED= yes | | 58 | _PGSQL_VERSION_83_INSTALLED= yes |
59 | .endif | | 59 | .endif |
60 | .if exists(${LOCALBASE}/lib/libecpg.so.5.0.2) | | 60 | .if exists(${LOCALBASE}/lib/libecpg.so.5.0.2) |
61 | _PGSQL_VERSION_82_INSTALLED= yes | | 61 | _PGSQL_VERSION_82_INSTALLED= yes |
62 | .endif | | 62 | .endif |
63 | .endif | | 63 | .endif |
64 | | | 64 | |
65 | # if a version is explicitely required, take it | | 65 | # if a version is explicitely required, take it |
66 | .if defined(PGSQL_VERSION_REQD) | | 66 | .if defined(PGSQL_VERSION_REQD) |
67 | _PGSQL_VERSION= ${PGSQL_VERSION_REQD} | | 67 | _PGSQL_VERSION= ${PGSQL_VERSION_REQD} |
68 | .endif | | 68 | .endif |
69 | # if the default is already installed, it is first choice | | 69 | # if the default is already installed, it is first choice |
70 | .if !defined(_PGSQL_VERSION) | | 70 | .if !defined(_PGSQL_VERSION) |
71 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) | | 71 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) |
72 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED) | | 72 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED) |
73 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} | | 73 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} |
74 | .endif | | 74 | .endif |
75 | .endif | | 75 | .endif |
76 | .endif | | 76 | .endif |
77 | # prefer an already installed version, in order of "accepted" | | 77 | # prefer an already installed version, in order of "accepted" |
78 | .if !defined(_PGSQL_VERSION) | | 78 | .if !defined(_PGSQL_VERSION) |
79 | .for pv in ${PGSQL_VERSIONS_ACCEPTED} | | 79 | .for pv in ${PGSQL_VERSIONS_ACCEPTED} |
80 | .if defined(_PGSQL_VERSION_${pv}_INSTALLED) | | 80 | .if defined(_PGSQL_VERSION_${pv}_INSTALLED) |
81 | _PGSQL_VERSION?= ${pv} | | 81 | _PGSQL_VERSION?= ${pv} |
82 | .else | | 82 | .else |
83 | # keep information as last resort - see below | | 83 | # keep information as last resort - see below |
84 | _PGSQL_VERSION_FIRSTACCEPTED?= ${pv} | | 84 | _PGSQL_VERSION_FIRSTACCEPTED?= ${pv} |
85 | .endif | | 85 | .endif |
86 | .endfor | | 86 | .endfor |
87 | .endif | | 87 | .endif |
88 | # if the default is OK for the addon pkg, take this | | 88 | # if the default is OK for the addon pkg, take this |
89 | .if !defined(_PGSQL_VERSION) | | 89 | .if !defined(_PGSQL_VERSION) |
90 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) | | 90 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) |
91 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} | | 91 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} |
92 | .endif | | 92 | .endif |
93 | .endif | | 93 | .endif |
94 | # take the first one accepted by the package | | 94 | # take the first one accepted by the package |
95 | .if !defined(_PGSQL_VERSION) | | 95 | .if !defined(_PGSQL_VERSION) |
96 | _PGSQL_VERSION= ${_PGSQL_VERSION_FIRSTACCEPTED} | | 96 | _PGSQL_VERSION= ${_PGSQL_VERSION_FIRSTACCEPTED} |
97 | .endif | | 97 | .endif |
98 | | | 98 | |
99 | # | | 99 | # |
100 | # set variables for the version we decided to use: | | 100 | # set variables for the version we decided to use: |
101 | # | | 101 | # |
102 | .if ${_PGSQL_VERSION} == "84" | | 102 | .if ${_PGSQL_VERSION} == "84" |
103 | PGSQL_TYPE= postgresql84-client | | 103 | PGSQL_TYPE= postgresql84-client |
104 | PGPKGSRCDIR= ../../databases/postgresql84-client | | 104 | PGPKGSRCDIR= ../../databases/postgresql84-client |
105 | .elif ${_PGSQL_VERSION} == "83" | | 105 | .elif ${_PGSQL_VERSION} == "83" |
106 | PGSQL_TYPE= postgresql83-client | | 106 | PGSQL_TYPE= postgresql83-client |
107 | PGPKGSRCDIR= ../../databases/postgresql83-client | | 107 | PGPKGSRCDIR= ../../databases/postgresql83-client |
108 | .elif ${_PGSQL_VERSION} == "82" | | 108 | .elif ${_PGSQL_VERSION} == "82" |
109 | PGSQL_TYPE= postgresql82-client | | 109 | PGSQL_TYPE= postgresql82-client |
110 | PGPKGSRCDIR= ../../databases/postgresql82-client | | 110 | PGPKGSRCDIR= ../../databases/postgresql82-client |
111 | .else | | 111 | .else |
112 | # force an error | | 112 | # force an error |
113 | PGSQL_TYPE= none | | 113 | PGSQL_TYPE= none |
114 | PKG_FAIL_REASON+= "${_PGSQL_VERSION} is not a valid package" | | 114 | PKG_FAIL_REASON+= "${_PGSQL_VERSION} is not a valid package" |
115 | .endif | | 115 | .endif |
116 | | | 116 | |
117 | .include "${PGPKGSRCDIR}/buildlink3.mk" | | 117 | .include "${PGPKGSRCDIR}/buildlink3.mk" |
118 | PGSQL_PREFIX= ${BUILDLINK_PREFIX.${PGSQL_TYPE}} | | 118 | PGSQL_PREFIX= ${BUILDLINK_PREFIX.${PGSQL_TYPE}} |
119 | | | 119 | |
120 | PGSQL_VERSION= ${_PGSQL_VERSION} | | 120 | PGSQL_VERSION= ${_PGSQL_VERSION} |
121 | | | 121 | |
122 | .endif # PGVERSION_MK | | 122 | .endif # PGVERSION_MK |