| @@ -1,138 +1,138 @@ | | | @@ -1,138 +1,138 @@ |
1 | # $NetBSD: pgsql.buildlink3.mk,v 1.58 2022/04/24 17:46:24 tnn Exp $ | | 1 | # $NetBSD: pgsql.buildlink3.mk,v 1.59 2022/06/28 09:38:38 nia 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 | # PGSQL_VERSION | | 16 | # PGSQL_VERSION |
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?= 13 | | 28 | PGSQL_VERSION_DEFAULT?= 14 |
29 | PGSQL_VERSIONS_ACCEPTED?= 14 13 12 11 10 | | 29 | PGSQL_VERSIONS_ACCEPTED?= 14 13 12 11 10 |
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 ${SHLIB_TYPE} == "dylib" | | 36 | .if ${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.14.dylib) | | 44 | . if exists(${LOCALBASE}/lib/libecpg.6.14.dylib) |
45 | _PGSQL_VERSION_14_INSTALLED= yes | | 45 | _PGSQL_VERSION_14_INSTALLED= yes |
46 | . endif | | 46 | . endif |
47 | . if exists(${LOCALBASE}/lib/libecpg.6.13.dylib) | | 47 | . if exists(${LOCALBASE}/lib/libecpg.6.13.dylib) |
48 | _PGSQL_VERSION_13_INSTALLED= yes | | 48 | _PGSQL_VERSION_13_INSTALLED= yes |
49 | . endif | | 49 | . endif |
50 | . if exists(${LOCALBASE}/lib/libecpg.6.12.dylib) | | 50 | . if exists(${LOCALBASE}/lib/libecpg.6.12.dylib) |
51 | _PGSQL_VERSION_12_INSTALLED= yes | | 51 | _PGSQL_VERSION_12_INSTALLED= yes |
52 | . endif | | 52 | . endif |
53 | . if exists(${LOCALBASE}/lib/libecpg.6.11.dylib) | | 53 | . if exists(${LOCALBASE}/lib/libecpg.6.11.dylib) |
54 | _PGSQL_VERSION_11_INSTALLED= yes | | 54 | _PGSQL_VERSION_11_INSTALLED= yes |
55 | . endif | | 55 | . endif |
56 | . if exists(${LOCALBASE}/lib/libecpg.6.10.dylib) | | 56 | . if exists(${LOCALBASE}/lib/libecpg.6.10.dylib) |
57 | _PGSQL_VERSION_10_INSTALLED= yes | | 57 | _PGSQL_VERSION_10_INSTALLED= yes |
58 | . endif | | 58 | . endif |
59 | .else | | 59 | .else |
60 | . if exists(${LOCALBASE}/lib/libecpg.so.6.14) | | 60 | . if exists(${LOCALBASE}/lib/libecpg.so.6.14) |
61 | _PGSQL_VERSION_14_INSTALLED= yes | | 61 | _PGSQL_VERSION_14_INSTALLED= yes |
62 | . endif | | 62 | . endif |
63 | . if exists(${LOCALBASE}/lib/libecpg.so.6.13) | | 63 | . if exists(${LOCALBASE}/lib/libecpg.so.6.13) |
64 | _PGSQL_VERSION_13_INSTALLED= yes | | 64 | _PGSQL_VERSION_13_INSTALLED= yes |
65 | . endif | | 65 | . endif |
66 | . if exists(${LOCALBASE}/lib/libecpg.so.6.12) | | 66 | . if exists(${LOCALBASE}/lib/libecpg.so.6.12) |
67 | _PGSQL_VERSION_12_INSTALLED= yes | | 67 | _PGSQL_VERSION_12_INSTALLED= yes |
68 | . endif | | 68 | . endif |
69 | . if exists(${LOCALBASE}/lib/libecpg.so.6.11) | | 69 | . if exists(${LOCALBASE}/lib/libecpg.so.6.11) |
70 | _PGSQL_VERSION_11_INSTALLED= yes | | 70 | _PGSQL_VERSION_11_INSTALLED= yes |
71 | . endif | | 71 | . endif |
72 | . if exists(${LOCALBASE}/lib/libecpg.so.6.10) | | 72 | . if exists(${LOCALBASE}/lib/libecpg.so.6.10) |
73 | _PGSQL_VERSION_10_INSTALLED= yes | | 73 | _PGSQL_VERSION_10_INSTALLED= yes |
74 | . endif | | 74 | . endif |
75 | .endif | | 75 | .endif |
76 | | | 76 | |
77 | # if a version is explicitely required, take it | | 77 | # if a version is explicitely required, take it |
78 | .if defined(PGSQL_VERSION_REQD) | | 78 | .if defined(PGSQL_VERSION_REQD) |
79 | _PGSQL_VERSION= ${PGSQL_VERSION_REQD} | | 79 | _PGSQL_VERSION= ${PGSQL_VERSION_REQD} |
80 | .endif | | 80 | .endif |
81 | # if the default is already installed, it is first choice | | 81 | # if the default is already installed, it is first choice |
82 | .if !defined(_PGSQL_VERSION) | | 82 | .if !defined(_PGSQL_VERSION) |
83 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) | | 83 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) |
84 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED) | | 84 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED) |
85 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} | | 85 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} |
86 | .endif | | 86 | .endif |
87 | .endif | | 87 | .endif |
88 | .endif | | 88 | .endif |
89 | # prefer an already installed version, in order of "accepted" | | 89 | # prefer an already installed version, in order of "accepted" |
90 | .if !defined(_PGSQL_VERSION) | | 90 | .if !defined(_PGSQL_VERSION) |
91 | .for pv in ${PGSQL_VERSIONS_ACCEPTED} | | 91 | .for pv in ${PGSQL_VERSIONS_ACCEPTED} |
92 | .if defined(_PGSQL_VERSION_${pv}_INSTALLED) | | 92 | .if defined(_PGSQL_VERSION_${pv}_INSTALLED) |
93 | _PGSQL_VERSION?= ${pv} | | 93 | _PGSQL_VERSION?= ${pv} |
94 | .else | | 94 | .else |
95 | # keep information as last resort - see below | | 95 | # keep information as last resort - see below |
96 | _PGSQL_VERSION_FIRSTACCEPTED?= ${pv} | | 96 | _PGSQL_VERSION_FIRSTACCEPTED?= ${pv} |
97 | .endif | | 97 | .endif |
98 | .endfor | | 98 | .endfor |
99 | .endif | | 99 | .endif |
100 | # if the default is OK for the addon pkg, take this | | 100 | # if the default is OK for the addon pkg, take this |
101 | .if !defined(_PGSQL_VERSION) | | 101 | .if !defined(_PGSQL_VERSION) |
102 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) | | 102 | .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK) |
103 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} | | 103 | _PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT} |
104 | .endif | | 104 | .endif |
105 | .endif | | 105 | .endif |
106 | # take the first one accepted by the package | | 106 | # take the first one accepted by the package |
107 | .if !defined(_PGSQL_VERSION) | | 107 | .if !defined(_PGSQL_VERSION) |
108 | _PGSQL_VERSION= ${_PGSQL_VERSION_FIRSTACCEPTED} | | 108 | _PGSQL_VERSION= ${_PGSQL_VERSION_FIRSTACCEPTED} |
109 | .endif | | 109 | .endif |
110 | | | 110 | |
111 | # set variables for the version we decided to use: | | 111 | # set variables for the version we decided to use: |
112 | .if ${_PGSQL_VERSION} == "14" | | 112 | .if ${_PGSQL_VERSION} == "14" |
113 | PGSQL_TYPE= postgresql14-client | | 113 | PGSQL_TYPE= postgresql14-client |
114 | PGPKGSRCDIR= ../../databases/postgresql14-client | | 114 | PGPKGSRCDIR= ../../databases/postgresql14-client |
115 | .elif ${_PGSQL_VERSION} == "13" | | 115 | .elif ${_PGSQL_VERSION} == "13" |
116 | PGSQL_TYPE= postgresql13-client | | 116 | PGSQL_TYPE= postgresql13-client |
117 | PGPKGSRCDIR= ../../databases/postgresql13-client | | 117 | PGPKGSRCDIR= ../../databases/postgresql13-client |
118 | .elif ${_PGSQL_VERSION} == "12" | | 118 | .elif ${_PGSQL_VERSION} == "12" |
119 | PGSQL_TYPE= postgresql12-client | | 119 | PGSQL_TYPE= postgresql12-client |
120 | PGPKGSRCDIR= ../../databases/postgresql12-client | | 120 | PGPKGSRCDIR= ../../databases/postgresql12-client |
121 | .elif ${_PGSQL_VERSION} == "11" | | 121 | .elif ${_PGSQL_VERSION} == "11" |
122 | PGSQL_TYPE= postgresql11-client | | 122 | PGSQL_TYPE= postgresql11-client |
123 | PGPKGSRCDIR= ../../databases/postgresql11-client | | 123 | PGPKGSRCDIR= ../../databases/postgresql11-client |
124 | .elif ${_PGSQL_VERSION} == "10" | | 124 | .elif ${_PGSQL_VERSION} == "10" |
125 | PGSQL_TYPE= postgresql10-client | | 125 | PGSQL_TYPE= postgresql10-client |
126 | PGPKGSRCDIR= ../../databases/postgresql10-client | | 126 | PGPKGSRCDIR= ../../databases/postgresql10-client |
127 | .else | | 127 | .else |
128 | # force an error | | 128 | # force an error |
129 | PGSQL_TYPE= none | | 129 | PGSQL_TYPE= none |
130 | PKG_FAIL_REASON+= "${_PGSQL_VERSION} is not a valid package" | | 130 | PKG_FAIL_REASON+= "${_PGSQL_VERSION} is not a valid package" |
131 | .endif | | 131 | .endif |
132 | | | 132 | |
133 | .include "${PGPKGSRCDIR}/buildlink3.mk" | | 133 | .include "${PGPKGSRCDIR}/buildlink3.mk" |
134 | PGSQL_PREFIX= ${BUILDLINK_PREFIX.${PGSQL_TYPE}} | | 134 | PGSQL_PREFIX= ${BUILDLINK_PREFIX.${PGSQL_TYPE}} |
135 | | | 135 | |
136 | PGSQL_VERSION= ${_PGSQL_VERSION} | | 136 | PGSQL_VERSION= ${_PGSQL_VERSION} |
137 | | | 137 | |
138 | .endif # PGVERSION_MK | | 138 | .endif # PGVERSION_MK |