1 |
commit: 58e35b7d3e7862892692e29bd2ad3ec5222b9ff4 |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 15 12:32:01 2015 +0000 |
4 |
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 15 12:32:01 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58e35b7d |
7 |
|
8 |
Remove Old |
9 |
|
10 |
Package-Manager: portage-2.2.20.1 |
11 |
|
12 |
dev-db/postgis/Manifest | 5 - |
13 |
dev-db/postgis/postgis-2.1.0.ebuild | 293 ------------------------------------ |
14 |
dev-db/postgis/postgis-2.1.4.ebuild | 291 ----------------------------------- |
15 |
dev-db/postgis/postgis-2.1.5.ebuild | 291 ----------------------------------- |
16 |
dev-db/postgis/postgis-2.1.6.ebuild | 287 ----------------------------------- |
17 |
dev-db/postgis/postgis-2.1.7.ebuild | 287 ----------------------------------- |
18 |
6 files changed, 1454 deletions(-) |
19 |
|
20 |
diff --git a/dev-db/postgis/Manifest b/dev-db/postgis/Manifest |
21 |
index 06cc042..99052b1 100644 |
22 |
--- a/dev-db/postgis/Manifest |
23 |
+++ b/dev-db/postgis/Manifest |
24 |
@@ -1,10 +1,5 @@ |
25 |
DIST postgis-2.0.3.tar.gz 5581619 SHA256 7f865a6fdf19afed7d2f3e7178cd504f7254a9e96f2ce6a07d0ea19edc1668a0 SHA512 e49232a0aebd202a053e2f6cb741551e932e49a8c535fadd22fe15c654e3823c2f43a4c78dc0340cddbbc7f9298651dc16e1737be3bfe0779cc4feede032facc WHIRLPOOL 9c7985ab6d50a4a8ffa4e8fa5ea69c7e365aae8d90a3ea70c978149e5a9efe4a29a29d11db5d2a6b5c830dcd5ba458a3263288f32a5af54665f5d1cab3357415 |
26 |
DIST postgis-2.0.6.tar.gz 5651448 SHA256 438fc9cf8d008c537ed2d6776bc30e726eb1f9a85247df945c2beccc42f33489 SHA512 c838b68b03d08bfd427d8a78c67754697a9409d6333e23e4bf8b63efc4320369258f14a03ba9e21ca4bd967fbfdf99d02720fa370170d4d34c20e31ad47bbf0c WHIRLPOOL 5795385bd146d280c0a8108ccb704417bf206ed80bfa9383c793d1313a3029186d26799438e21b3d6920e92d8859de947e61c1cd55cd0cc275ad800ef128f542 |
27 |
-DIST postgis-2.1.0.tar.gz 6518378 SHA256 fc00481aec904661f3eb11da4305b1666f2040c28b0651de7eac6c22f217b26c SHA512 ed5140aef0e68cb075fc06eaa91733c46d38ce4e01cbf1d97d14ff1a4d447f7cfcaf32924150946c7bb388d334bd5bc9f97753c47c84c16068b9dff6438e8493 WHIRLPOOL a52000a334dd2bb246b665ec7bcd743833c4699cb0cabdd1d9bab3538ee18df6e7b766c06728a97274647f63da1cc130f79902a32cf0621d9a3b8190c8fe596e |
28 |
DIST postgis-2.1.1.tar.gz 6717940 SHA256 f55acf056362e7e78766bec7a403e02a3b6b087a6d18b4222647b6a932d5c945 SHA512 f85c4d1db32802b3acbda3f4c391ca961bf1301c699a00682265c7a984fbc74ee7b9fbfc5580fc04dff0491921eb6dbe4d8bd73dded216794a4b7f90c3ed650f WHIRLPOOL 807d0ce975b72315a72d4c2ecd192c612b00530a7e542b18429fed0c69cf6cb95285554c34be58e3d2a2c513f436289449dfbe82c7430fba87e901a4bea49c2d |
29 |
-DIST postgis-2.1.4.tar.gz 6854492 SHA256 cd73c2a38428c8736f6cae73b955aee0bd42f9ca4fd8d93c1af464524cb100fc SHA512 1d7dd2547fe9819addea0c9dfb4f4c78f30593af21f7cf05c4e40c2684ea3e04ad50c1937ba72172c69df713384c866e6a336b6cab733c9dd0f273f41df568d2 WHIRLPOOL f685cb2e991319b1a2f7a54ce050217d8ea636c02491fca2dafb1a2f66fe3548d4daff6d3de67925a700d9de42af29dfc4af0d26727e77f969a100a1fe964567 |
30 |
-DIST postgis-2.1.5.tar.gz 6827999 SHA256 0d0e27f72f12b8dba456fbde25ed0f6913f42baf57332a7f1b9bbc6f29fddbf4 SHA512 c1d186b237114c951feb78e97dc7d69896dcb0884c02e49d93e8602590e82d34a808eb12c127c7dc78db3237ac619709f8bd7febb4670909b03615f8278aede2 WHIRLPOOL c203aa2034e899647139445ce0b1e6e7637a0e2ad3c1f6d4ee1f303d9734b219b68d18fb6d6e7da6c9df53f90e8dfd30ce8d4ab8a6c942b96db7e8b55d632417 |
31 |
-DIST postgis-2.1.6.tar.gz 6803831 SHA256 6ffdf655bc4fca2b5495dd96f44b266e84111912d5c3f91b832023c4fec5c222 SHA512 a6c1263d64f2c1828656d5613840d721fb70ecbdfab3e28099c8f6b80d5404d46a9376913c0ab46c7f1109517c04430800b8c3be0c94d964421c6681afb2f997 WHIRLPOOL 98bfcae992f444b63840a28ef90077c01473ea528aa72ae5fd283b4fdcf7b7e37732afeac1a29fc87e330f687ca491d5afbed44b0792fb00763dc682501d37a3 |
32 |
-DIST postgis-2.1.7.tar.gz 6804372 SHA256 00ab79a3f609d7ea458f6fc358032ad059cb720baf88285243d6436a597a7ec2 SHA512 021fcb73c2109dafb67cb9d459eb08e0da7e55cf1a5fab81115aad3b0a61809b8f83d7a278aa04e41ecd633164e4257a90d5dfc0e81339b0c322e7d41d3c5eae WHIRLPOOL 938cacf1af4ba8a2f0f3bbefe11c0014a31cd331186cd7fc7fc0a242528094efb617326a484bdad76704bfb98fd065a7f280ab663088440af0555fc69862e36b |
33 |
DIST postgis-2.1.8.tar.gz 6811272 SHA256 7c2380b895fe7bda34c2e70deab3fcf4c12b13ab40d7501cdaa6fa36f1a6c662 SHA512 e8aeb739a1ecf95b224a3908d2af3aa38933b56c63713af30d14243653745436165b418a3368601a699b744f6fe61ce645c980319eb159395d68166a3815c5f4 WHIRLPOOL b6675fecbb922379bd50c351abe1553fdbda53543fce56451c688e25a3fa2e9d0813d8f3a349b623b85fcb4016fc4710f6746a224ba7673ec0d2106c7635d3d1 |
34 |
DIST postgis-2.2.0.tar.gz 10164837 SHA256 66f0f8480d535959b8bb9abb5ee5d602d1001413ca770df120baf3de627f9e91 SHA512 e9954d5c4aa381536ae87c32bb37b166a7ede0f9b9fc96cfb300dc2350b9351f40870429f64e755c3371be692a1956f5f8ea21733b64aab490f42d2232ae5d8f WHIRLPOOL 639c6b278dd6e5c3a11ed1d8de179ee72a4e6e9c54ba1e74e585e9233167a3c2cdca0704c47966cf757db22221ebbc8970a68375894a6179970ab6c0e6c637a2 |
35 |
|
36 |
diff --git a/dev-db/postgis/postgis-2.1.0.ebuild b/dev-db/postgis/postgis-2.1.0.ebuild |
37 |
deleted file mode 100644 |
38 |
index 10c8d48..0000000 |
39 |
--- a/dev-db/postgis/postgis-2.1.0.ebuild |
40 |
+++ /dev/null |
41 |
@@ -1,293 +0,0 @@ |
42 |
-# Copyright 1999-2014 Gentoo Foundation |
43 |
-# Distributed under the terms of the GNU General Public License v2 |
44 |
-# $Id$ |
45 |
- |
46 |
-EAPI="5" |
47 |
-POSTGRES_COMPAT=( 9.{0,1,2,3} ) |
48 |
- |
49 |
-inherit autotools eutils versionator |
50 |
- |
51 |
-MY_PV=$(replace_version_separator 3 '') |
52 |
-MY_P="${PN}-${MY_PV}" |
53 |
-S="${WORKDIR}/${MY_P}" |
54 |
- |
55 |
-DESCRIPTION="Geographic Objects for PostgreSQL" |
56 |
-HOMEPAGE="http://postgis.net" |
57 |
-SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" |
58 |
-LICENSE="GPL-2" |
59 |
-SLOT="0" |
60 |
-KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" |
61 |
-IUSE="doc gtk" |
62 |
- |
63 |
-RDEPEND=" |
64 |
- || ( |
65 |
- dev-db/postgresql:9.3[server] |
66 |
- dev-db/postgresql:9.2[server] |
67 |
- dev-db/postgresql:9.1[server] |
68 |
- dev-db/postgresql:9.0[server] |
69 |
- ) |
70 |
- dev-libs/json-c |
71 |
- dev-libs/libxml2:2 |
72 |
- >=sci-libs/geos-3.3.8 |
73 |
- >=sci-libs/proj-4.6.0 |
74 |
- >=sci-libs/gdal-1.10.0 |
75 |
- gtk? ( x11-libs/gtk+:2 ) |
76 |
-" |
77 |
- |
78 |
-DEPEND="${RDEPEND} |
79 |
- doc? ( |
80 |
- app-text/docbook-xsl-stylesheets |
81 |
- app-text/docbook-xml-dtd:4.3 |
82 |
- dev-libs/libxslt |
83 |
- || ( |
84 |
- media-gfx/imagemagick[png] |
85 |
- media-gfx/graphicsmagick[imagemagick,png] |
86 |
- ) |
87 |
- ) |
88 |
- virtual/pkgconfig |
89 |
-" |
90 |
- |
91 |
-PGIS="$(get_version_component_range 1-2)" |
92 |
- |
93 |
-RESTRICT="test" |
94 |
- |
95 |
-# These modules are built using the same *FLAGS that were used to build |
96 |
-# dev-db/postgresql. The right thing to do is to ignore the current |
97 |
-# *FLAGS settings. |
98 |
-QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" |
99 |
- |
100 |
-# Because developers have been fooled into thinking recursive make is a |
101 |
-# good thing. |
102 |
-MAKEOPTS="-j1" |
103 |
- |
104 |
-postgres_check_slot() { |
105 |
- if ! declare -p POSTGRES_COMPAT &>/dev/null; then |
106 |
- die 'POSTGRES_COMPAT not declared.' |
107 |
- fi |
108 |
- |
109 |
-# Don't die because we can't run postgresql-config during pretend. |
110 |
-[[ "$EBUILD_PHASE" = "pretend" \ |
111 |
- && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0 |
112 |
- |
113 |
- local res=$(echo ${POSTGRES_COMPAT[@]} \ |
114 |
- | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null) |
115 |
- |
116 |
- if [[ "$res" -eq "0" ]] ; then |
117 |
- eerror "PostgreSQL slot must be set to one of: " |
118 |
- eerror " ${POSTGRES_COMPAT[@]}" |
119 |
- return 1 |
120 |
- fi |
121 |
- |
122 |
- return 0 |
123 |
-} |
124 |
- |
125 |
-pkg_pretend() { |
126 |
- postgres_check_slot || die |
127 |
-} |
128 |
- |
129 |
-pkg_setup() { |
130 |
- postgres_check_slot || die |
131 |
- export PGSLOT="$(postgresql-config show)" |
132 |
-} |
133 |
- |
134 |
-src_prepare() { |
135 |
- epatch "${FILESDIR}/${PN}-2.1-ldflags.patch" \ |
136 |
- "${FILESDIR}/${PN}-2.0-arflags.patch" \ |
137 |
- "${FILESDIR}/${PN}-2.1-pkgconfig-json.patch" |
138 |
- |
139 |
- local AT_M4DIR="macros" |
140 |
- eautoreconf |
141 |
-} |
142 |
- |
143 |
-src_configure() { |
144 |
- local myargs="" |
145 |
- use gtk && myargs+=" --with-gui" |
146 |
- econf \ |
147 |
- --with-pgconfig="/usr/lib/postgresql-${PGSLOT}/bin/pg_config" \ |
148 |
- ${myargs} |
149 |
-} |
150 |
- |
151 |
-src_compile() { |
152 |
- # Occasionally, builds fail because of out of order compilation. |
153 |
- # Otherwise, it'd be fine. |
154 |
- emake |
155 |
- emake -C topology |
156 |
- |
157 |
- if use doc ; then |
158 |
- emake comments |
159 |
- emake cheatsheets |
160 |
- emake -C doc html |
161 |
- fi |
162 |
-} |
163 |
- |
164 |
-src_install() { |
165 |
- emake DESTDIR="${D}" install |
166 |
- use doc && emake DESTDIR="${D}" comments-install |
167 |
- emake -C topology DESTDIR="${D}" install |
168 |
- dobin ./utils/postgis_restore.pl |
169 |
- |
170 |
- dodoc CREDITS TODO loader/README.* doc/*txt |
171 |
- |
172 |
- use doc && dohtml -r doc/html/* |
173 |
- |
174 |
- docinto topology |
175 |
- dodoc topology/{TODO,README} |
176 |
- |
177 |
- insinto /etc |
178 |
- doins "${FILESDIR}/postgis_dbs" |
179 |
-} |
180 |
- |
181 |
-pkg_postinst() { |
182 |
- postgresql-config update |
183 |
- |
184 |
- elog "To finish installing or updating PostGIS edit:" |
185 |
- elog " ${EROOT%/}/etc/postgis_dbs" |
186 |
- elog |
187 |
- elog "Then, run:" |
188 |
- elog " emerge --config =${CATEGORY}/${PF}" |
189 |
-} |
190 |
- |
191 |
-pkg_config(){ |
192 |
- source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}" |
193 |
- source "${EROOT%/}/etc/postgis_dbs" |
194 |
- local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}" |
195 |
- |
196 |
- if [[ -n ${configured} ]] ; then |
197 |
- einfon "Password for PostgreSQL user '${pguser}': " |
198 |
- read -s PGPASSWORD |
199 |
- export PGPASSWORD |
200 |
- echo |
201 |
- else |
202 |
- eerror "You must edit:" |
203 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
204 |
- eerror "Before running 'emerge --config =${CATEGORY}/${PF}'" |
205 |
- eerror |
206 |
- die "Edit postgis_dbs" |
207 |
- fi |
208 |
- |
209 |
- # The server we work with must be the same slot we built against. |
210 |
- local server_version |
211 |
- server_version=$(psql -U ${pguser} -d postgres -p ${PGPORT} \ |
212 |
- -Aqwtc 'SELECT version()' 2> /dev/null) |
213 |
- if [[ $? = 0 ]] ; then |
214 |
- server_version=$(echo ${server_version} | cut -d " " -f 2 | \ |
215 |
- cut -d "." -f -2 | tr -d .) |
216 |
- if [[ $server_version != ${PGSLOT//.} ]] ; then |
217 |
- unset PGPASSWORD |
218 |
- eerror "Server version must be ${PGSLOT}.x" |
219 |
- die "Server version isn't ${PGSLOT}.x" |
220 |
- fi |
221 |
- else |
222 |
- unset PGPASSWORD |
223 |
- eerror "Is the server running?" |
224 |
- die "Couldn't connect to server." |
225 |
- fi |
226 |
- |
227 |
- local retval |
228 |
- safe_exit() { |
229 |
- unset PGPASSWORD |
230 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
231 |
- eend $retval |
232 |
- eerror "All actions could not be performed." |
233 |
- eerror "Read above to see what failed." |
234 |
- eerror "Once you fix the issue, you'll need to edit:" |
235 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
236 |
- eerror "As some things may have succeeded." |
237 |
- eerror |
238 |
- die "All actions could not be performed" |
239 |
- } |
240 |
- |
241 |
- local db |
242 |
- for db in ${databases[@]} ; do |
243 |
- ebegin "Performing CREATE LANGUAGE on ${db}" |
244 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
245 |
- retval=$? |
246 |
- # In this case, only error code 1 is fatal |
247 |
- [[ $retval == 1 ]] && safe_exit || eend 0 |
248 |
- |
249 |
- ebegin "Enabling PostGIS on ${db}" |
250 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
251 |
- -f "${postgis_path}/postgis.sql" |
252 |
- retval=$? |
253 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
254 |
- done |
255 |
- |
256 |
- for db in ${templates[@]} ; do |
257 |
- ebegin "Creating template database '${db}'" |
258 |
- createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \ |
259 |
- ${db} "PostGIS Template" |
260 |
- retval=$? |
261 |
- [[ $retval != 0 ]] && safe_exit |
262 |
- |
263 |
- psql -q -U ${pguser} -p ${PGPORT} -c \ |
264 |
- "UPDATE pg_database \ |
265 |
- SET datistemplate = TRUE, datallowconn = TRUE \ |
266 |
- WHERE datname = '${db}'" |
267 |
- retval=$? |
268 |
- [[ $retval != 0 ]] && safe_exit |
269 |
- |
270 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
271 |
- retval=$? |
272 |
- # In this case, only error code 1 is fatal |
273 |
- [[ $retval == 1 ]] && safe_exit |
274 |
- |
275 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
276 |
- -f "${postgis_path}/postgis.sql" |
277 |
- retval=$? |
278 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
279 |
- done |
280 |
- |
281 |
- for db in ${epsg_databases[@]} ; do |
282 |
- ebegin "Adding EPSG to ${db}" |
283 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
284 |
- -f "${postgis_path}/spatial_ref_sys.sql" |
285 |
- retval=$? |
286 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
287 |
- done |
288 |
- |
289 |
- for db in ${comment_databases[@]} ; do |
290 |
- ebegin "Adding comments on ${db}" |
291 |
- local comment_file |
292 |
- for comment_file in "${postgis_path}"/*_comments.sql ; do |
293 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}" |
294 |
- retval=$? |
295 |
- [[ $retval == 0 ]] && continue || safe_exit |
296 |
- done |
297 |
- eend 0 |
298 |
- done |
299 |
- |
300 |
- for db in ${upgrade_from_1_3[@]} ; do |
301 |
- ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}" |
302 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
303 |
- -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql" |
304 |
- retval=$? |
305 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
306 |
- done |
307 |
- |
308 |
- for db in ${upgrade_from_1_4[@]} ; do |
309 |
- ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}" |
310 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
311 |
- -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql" |
312 |
- retval=$? |
313 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
314 |
- done |
315 |
- |
316 |
- for db in ${upgrade_from_1_5[@]} ; do |
317 |
- ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}" |
318 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
319 |
- -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql" |
320 |
- retval=$? |
321 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
322 |
- done |
323 |
- |
324 |
- # Clean up and make it so the user has to edit postgis_dbs again that |
325 |
- # way this script won't step on any toes due to user error. |
326 |
- unset PGPASSWORD |
327 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
328 |
- einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled." |
329 |
- einfo |
330 |
- einfo "To enable other databases, change the default slot:" |
331 |
- einfo " postgresql-config set <slot>" |
332 |
- einfo "Then, emerge this package again:" |
333 |
- einfo " emerge -av =${CATEGORY}/${PF}" |
334 |
-} |
335 |
|
336 |
diff --git a/dev-db/postgis/postgis-2.1.4.ebuild b/dev-db/postgis/postgis-2.1.4.ebuild |
337 |
deleted file mode 100644 |
338 |
index 6d7fa20..0000000 |
339 |
--- a/dev-db/postgis/postgis-2.1.4.ebuild |
340 |
+++ /dev/null |
341 |
@@ -1,291 +0,0 @@ |
342 |
-# Copyright 1999-2014 Gentoo Foundation |
343 |
-# Distributed under the terms of the GNU General Public License v2 |
344 |
-# $Id$ |
345 |
- |
346 |
-EAPI="5" |
347 |
-POSTGRES_COMPAT=( 9.{0,1,2,3,4} ) |
348 |
- |
349 |
-inherit autotools eutils versionator |
350 |
- |
351 |
-MY_PV=$(replace_version_separator 3 '') |
352 |
-MY_P="${PN}-${MY_PV}" |
353 |
-S="${WORKDIR}/${MY_P}" |
354 |
- |
355 |
-DESCRIPTION="Geographic Objects for PostgreSQL" |
356 |
-HOMEPAGE="http://postgis.net" |
357 |
-SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" |
358 |
-LICENSE="GPL-2" |
359 |
-SLOT="0" |
360 |
-KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" |
361 |
-IUSE="doc gtk static-libs test" |
362 |
- |
363 |
-RDEPEND=" |
364 |
- || ( |
365 |
- dev-db/postgresql:9.4[server] |
366 |
- dev-db/postgresql:9.3[server] |
367 |
- dev-db/postgresql:9.2[server] |
368 |
- dev-db/postgresql:9.1[server] |
369 |
- dev-db/postgresql:9.0[server] |
370 |
- ) |
371 |
- dev-libs/json-c |
372 |
- dev-libs/libxml2:2 |
373 |
- >=sci-libs/geos-3.4.2 |
374 |
- >=sci-libs/proj-4.6.0 |
375 |
- >=sci-libs/gdal-1.10.0 |
376 |
- gtk? ( x11-libs/gtk+:2 ) |
377 |
-" |
378 |
- |
379 |
-DEPEND="${RDEPEND} |
380 |
- doc? ( |
381 |
- app-text/docbook-xsl-stylesheets |
382 |
- app-text/docbook-xml-dtd:4.5 |
383 |
- dev-libs/libxslt |
384 |
- || ( |
385 |
- media-gfx/imagemagick[png] |
386 |
- media-gfx/graphicsmagick[imagemagick,png] |
387 |
- ) |
388 |
- ) |
389 |
- virtual/pkgconfig |
390 |
- test? ( dev-util/cunit ) |
391 |
-" |
392 |
- |
393 |
-PGIS="$(get_version_component_range 1-2)" |
394 |
- |
395 |
-REQUIRED_USE="test? ( doc )" |
396 |
- |
397 |
-# Needs a running psql instance, doesn't work out of the box |
398 |
-RESTRICT="test" |
399 |
- |
400 |
-MAKEOPTS+=' -j1' |
401 |
- |
402 |
-# These modules are built using the same *FLAGS that were used to build |
403 |
-# dev-db/postgresql. The right thing to do is to ignore the current |
404 |
-# *FLAGS settings. |
405 |
-QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" |
406 |
- |
407 |
-postgres_check_slot() { |
408 |
- if ! declare -p POSTGRES_COMPAT &>/dev/null; then |
409 |
- die 'POSTGRES_COMPAT not declared.' |
410 |
- fi |
411 |
- |
412 |
-# Don't die because we can't run postgresql-config during pretend. |
413 |
-[[ "$EBUILD_PHASE" = "pretend" \ |
414 |
- && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0 |
415 |
- |
416 |
- local res=$(echo ${POSTGRES_COMPAT[@]} \ |
417 |
- | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null) |
418 |
- |
419 |
- if [[ "$res" -eq "0" ]] ; then |
420 |
- eerror "PostgreSQL slot must be set to one of: " |
421 |
- eerror " ${POSTGRES_COMPAT[@]}" |
422 |
- return 1 |
423 |
- fi |
424 |
- |
425 |
- return 0 |
426 |
-} |
427 |
- |
428 |
-pkg_pretend() { |
429 |
- postgres_check_slot || die |
430 |
-} |
431 |
- |
432 |
-pkg_setup() { |
433 |
- postgres_check_slot || die |
434 |
- export PGSLOT="$(postgresql-config show)" |
435 |
-} |
436 |
- |
437 |
-src_prepare() { |
438 |
- epatch "${FILESDIR}/${PN}-2.1-ldflags.patch" \ |
439 |
- "${FILESDIR}/${PN}-2.0-arflags.patch" \ |
440 |
- "${FILESDIR}/${PN}-2.1.4-pkgconfig-json.patch" |
441 |
- |
442 |
- local AT_M4DIR="macros" |
443 |
- eautoreconf |
444 |
-} |
445 |
- |
446 |
-src_configure() { |
447 |
- local myargs="" |
448 |
- use gtk && myargs+=" --with-gui" |
449 |
- econf \ |
450 |
- --with-pgconfig="/usr/lib/postgresql-${PGSLOT}/bin/pg_config" \ |
451 |
- ${myargs} |
452 |
-} |
453 |
- |
454 |
-src_compile() { |
455 |
- emake |
456 |
- emake -C topology |
457 |
- |
458 |
- if use doc ; then |
459 |
- emake comments |
460 |
- emake cheatsheets |
461 |
- emake -C doc html |
462 |
- fi |
463 |
-} |
464 |
- |
465 |
-src_install() { |
466 |
- emake DESTDIR="${D}" install |
467 |
- use doc && emake DESTDIR="${D}" comments-install |
468 |
- emake -C topology DESTDIR="${D}" install |
469 |
- dobin ./utils/postgis_restore.pl |
470 |
- |
471 |
- dodoc CREDITS TODO loader/README.* doc/*txt |
472 |
- |
473 |
- use doc && dohtml -r doc/html/* |
474 |
- |
475 |
- docinto topology |
476 |
- dodoc topology/{TODO,README} |
477 |
- |
478 |
- insinto /etc |
479 |
- doins "${FILESDIR}/postgis_dbs" |
480 |
- |
481 |
- use static-libs || find "${ED}" -name '*.a' -delete |
482 |
-} |
483 |
- |
484 |
-pkg_postinst() { |
485 |
- postgresql-config update |
486 |
- |
487 |
- elog "To finish installing or updating PostGIS edit:" |
488 |
- elog " ${EROOT%/}/etc/postgis_dbs" |
489 |
- elog |
490 |
- elog "Then, run:" |
491 |
- elog " emerge --config =${CATEGORY}/${PF}" |
492 |
-} |
493 |
- |
494 |
-pkg_config(){ |
495 |
- source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}" |
496 |
- source "${EROOT%/}/etc/postgis_dbs" |
497 |
- local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}" |
498 |
- |
499 |
- if [[ -n ${configured} ]] ; then |
500 |
- einfon "Password for PostgreSQL user '${pguser}': " |
501 |
- read -s PGPASSWORD |
502 |
- export PGPASSWORD |
503 |
- echo |
504 |
- else |
505 |
- eerror "You must edit:" |
506 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
507 |
- eerror "Before running 'emerge --config =${CATEGORY}/${PF}'" |
508 |
- eerror |
509 |
- die "Edit postgis_dbs" |
510 |
- fi |
511 |
- |
512 |
- # The server we work with must be the same slot we built against. |
513 |
- local server_match |
514 |
- server_match=$(psql -U ${pguser} -d postgres -p ${PGPORT} \ |
515 |
- -Aqwtc 'SELECT version()' 2> /dev/null | grep -c "PostgreSQL ${PGSLOT}") |
516 |
- if [[ $? = 0 ]] ; then |
517 |
- if [[ $server_match -ne 1 ]] ; then |
518 |
- unset PGPASSWORD |
519 |
- eerror "Server version must be ${PGSLOT}.x" |
520 |
- die "Server version isn't ${PGSLOT}.x" |
521 |
- fi |
522 |
- else |
523 |
- unset PGPASSWORD |
524 |
- eerror "Is the server running?" |
525 |
- die "Couldn't connect to server." |
526 |
- fi |
527 |
- |
528 |
- local retval |
529 |
- safe_exit() { |
530 |
- unset PGPASSWORD |
531 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
532 |
- eend $retval |
533 |
- eerror "All actions could not be performed." |
534 |
- eerror "Read above to see what failed." |
535 |
- eerror "Once you fix the issue, you'll need to edit:" |
536 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
537 |
- eerror "As some things may have succeeded." |
538 |
- eerror |
539 |
- die "All actions could not be performed" |
540 |
- } |
541 |
- |
542 |
- local db |
543 |
- for db in ${databases[@]} ; do |
544 |
- ebegin "Performing CREATE LANGUAGE on ${db}" |
545 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
546 |
- retval=$? |
547 |
- # In this case, only error code 1 is fatal |
548 |
- [[ $retval == 1 ]] && safe_exit || eend 0 |
549 |
- |
550 |
- ebegin "Enabling PostGIS on ${db}" |
551 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
552 |
- -f "${postgis_path}/postgis.sql" |
553 |
- retval=$? |
554 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
555 |
- done |
556 |
- |
557 |
- for db in ${templates[@]} ; do |
558 |
- ebegin "Creating template database '${db}'" |
559 |
- createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \ |
560 |
- ${db} "PostGIS Template" |
561 |
- retval=$? |
562 |
- [[ $retval != 0 ]] && safe_exit |
563 |
- |
564 |
- psql -q -U ${pguser} -p ${PGPORT} -c \ |
565 |
- "UPDATE pg_database \ |
566 |
- SET datistemplate = TRUE, datallowconn = TRUE \ |
567 |
- WHERE datname = '${db}'" |
568 |
- retval=$? |
569 |
- [[ $retval != 0 ]] && safe_exit |
570 |
- |
571 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
572 |
- retval=$? |
573 |
- # In this case, only error code 1 is fatal |
574 |
- [[ $retval == 1 ]] && safe_exit |
575 |
- |
576 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
577 |
- -f "${postgis_path}/postgis.sql" |
578 |
- retval=$? |
579 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
580 |
- done |
581 |
- |
582 |
- for db in ${epsg_databases[@]} ; do |
583 |
- ebegin "Adding EPSG to ${db}" |
584 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
585 |
- -f "${postgis_path}/spatial_ref_sys.sql" |
586 |
- retval=$? |
587 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
588 |
- done |
589 |
- |
590 |
- for db in ${comment_databases[@]} ; do |
591 |
- ebegin "Adding comments on ${db}" |
592 |
- local comment_file |
593 |
- for comment_file in "${postgis_path}"/*_comments.sql ; do |
594 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}" |
595 |
- retval=$? |
596 |
- [[ $retval == 0 ]] && continue || safe_exit |
597 |
- done |
598 |
- eend 0 |
599 |
- done |
600 |
- |
601 |
- for db in ${upgrade_from_1_3[@]} ; do |
602 |
- ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}" |
603 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
604 |
- -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql" |
605 |
- retval=$? |
606 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
607 |
- done |
608 |
- |
609 |
- for db in ${upgrade_from_1_4[@]} ; do |
610 |
- ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}" |
611 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
612 |
- -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql" |
613 |
- retval=$? |
614 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
615 |
- done |
616 |
- |
617 |
- for db in ${upgrade_from_1_5[@]} ; do |
618 |
- ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}" |
619 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
620 |
- -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql" |
621 |
- retval=$? |
622 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
623 |
- done |
624 |
- |
625 |
- # Clean up and make it so the user has to edit postgis_dbs again that |
626 |
- # way this script won't step on any toes due to user error. |
627 |
- unset PGPASSWORD |
628 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
629 |
- einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled." |
630 |
- einfo |
631 |
- einfo "Currently, only one PostgreSQL slot at a time can be PostGIS enabled." |
632 |
-} |
633 |
|
634 |
diff --git a/dev-db/postgis/postgis-2.1.5.ebuild b/dev-db/postgis/postgis-2.1.5.ebuild |
635 |
deleted file mode 100644 |
636 |
index 6d7fa20..0000000 |
637 |
--- a/dev-db/postgis/postgis-2.1.5.ebuild |
638 |
+++ /dev/null |
639 |
@@ -1,291 +0,0 @@ |
640 |
-# Copyright 1999-2014 Gentoo Foundation |
641 |
-# Distributed under the terms of the GNU General Public License v2 |
642 |
-# $Id$ |
643 |
- |
644 |
-EAPI="5" |
645 |
-POSTGRES_COMPAT=( 9.{0,1,2,3,4} ) |
646 |
- |
647 |
-inherit autotools eutils versionator |
648 |
- |
649 |
-MY_PV=$(replace_version_separator 3 '') |
650 |
-MY_P="${PN}-${MY_PV}" |
651 |
-S="${WORKDIR}/${MY_P}" |
652 |
- |
653 |
-DESCRIPTION="Geographic Objects for PostgreSQL" |
654 |
-HOMEPAGE="http://postgis.net" |
655 |
-SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" |
656 |
-LICENSE="GPL-2" |
657 |
-SLOT="0" |
658 |
-KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" |
659 |
-IUSE="doc gtk static-libs test" |
660 |
- |
661 |
-RDEPEND=" |
662 |
- || ( |
663 |
- dev-db/postgresql:9.4[server] |
664 |
- dev-db/postgresql:9.3[server] |
665 |
- dev-db/postgresql:9.2[server] |
666 |
- dev-db/postgresql:9.1[server] |
667 |
- dev-db/postgresql:9.0[server] |
668 |
- ) |
669 |
- dev-libs/json-c |
670 |
- dev-libs/libxml2:2 |
671 |
- >=sci-libs/geos-3.4.2 |
672 |
- >=sci-libs/proj-4.6.0 |
673 |
- >=sci-libs/gdal-1.10.0 |
674 |
- gtk? ( x11-libs/gtk+:2 ) |
675 |
-" |
676 |
- |
677 |
-DEPEND="${RDEPEND} |
678 |
- doc? ( |
679 |
- app-text/docbook-xsl-stylesheets |
680 |
- app-text/docbook-xml-dtd:4.5 |
681 |
- dev-libs/libxslt |
682 |
- || ( |
683 |
- media-gfx/imagemagick[png] |
684 |
- media-gfx/graphicsmagick[imagemagick,png] |
685 |
- ) |
686 |
- ) |
687 |
- virtual/pkgconfig |
688 |
- test? ( dev-util/cunit ) |
689 |
-" |
690 |
- |
691 |
-PGIS="$(get_version_component_range 1-2)" |
692 |
- |
693 |
-REQUIRED_USE="test? ( doc )" |
694 |
- |
695 |
-# Needs a running psql instance, doesn't work out of the box |
696 |
-RESTRICT="test" |
697 |
- |
698 |
-MAKEOPTS+=' -j1' |
699 |
- |
700 |
-# These modules are built using the same *FLAGS that were used to build |
701 |
-# dev-db/postgresql. The right thing to do is to ignore the current |
702 |
-# *FLAGS settings. |
703 |
-QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" |
704 |
- |
705 |
-postgres_check_slot() { |
706 |
- if ! declare -p POSTGRES_COMPAT &>/dev/null; then |
707 |
- die 'POSTGRES_COMPAT not declared.' |
708 |
- fi |
709 |
- |
710 |
-# Don't die because we can't run postgresql-config during pretend. |
711 |
-[[ "$EBUILD_PHASE" = "pretend" \ |
712 |
- && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0 |
713 |
- |
714 |
- local res=$(echo ${POSTGRES_COMPAT[@]} \ |
715 |
- | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null) |
716 |
- |
717 |
- if [[ "$res" -eq "0" ]] ; then |
718 |
- eerror "PostgreSQL slot must be set to one of: " |
719 |
- eerror " ${POSTGRES_COMPAT[@]}" |
720 |
- return 1 |
721 |
- fi |
722 |
- |
723 |
- return 0 |
724 |
-} |
725 |
- |
726 |
-pkg_pretend() { |
727 |
- postgres_check_slot || die |
728 |
-} |
729 |
- |
730 |
-pkg_setup() { |
731 |
- postgres_check_slot || die |
732 |
- export PGSLOT="$(postgresql-config show)" |
733 |
-} |
734 |
- |
735 |
-src_prepare() { |
736 |
- epatch "${FILESDIR}/${PN}-2.1-ldflags.patch" \ |
737 |
- "${FILESDIR}/${PN}-2.0-arflags.patch" \ |
738 |
- "${FILESDIR}/${PN}-2.1.4-pkgconfig-json.patch" |
739 |
- |
740 |
- local AT_M4DIR="macros" |
741 |
- eautoreconf |
742 |
-} |
743 |
- |
744 |
-src_configure() { |
745 |
- local myargs="" |
746 |
- use gtk && myargs+=" --with-gui" |
747 |
- econf \ |
748 |
- --with-pgconfig="/usr/lib/postgresql-${PGSLOT}/bin/pg_config" \ |
749 |
- ${myargs} |
750 |
-} |
751 |
- |
752 |
-src_compile() { |
753 |
- emake |
754 |
- emake -C topology |
755 |
- |
756 |
- if use doc ; then |
757 |
- emake comments |
758 |
- emake cheatsheets |
759 |
- emake -C doc html |
760 |
- fi |
761 |
-} |
762 |
- |
763 |
-src_install() { |
764 |
- emake DESTDIR="${D}" install |
765 |
- use doc && emake DESTDIR="${D}" comments-install |
766 |
- emake -C topology DESTDIR="${D}" install |
767 |
- dobin ./utils/postgis_restore.pl |
768 |
- |
769 |
- dodoc CREDITS TODO loader/README.* doc/*txt |
770 |
- |
771 |
- use doc && dohtml -r doc/html/* |
772 |
- |
773 |
- docinto topology |
774 |
- dodoc topology/{TODO,README} |
775 |
- |
776 |
- insinto /etc |
777 |
- doins "${FILESDIR}/postgis_dbs" |
778 |
- |
779 |
- use static-libs || find "${ED}" -name '*.a' -delete |
780 |
-} |
781 |
- |
782 |
-pkg_postinst() { |
783 |
- postgresql-config update |
784 |
- |
785 |
- elog "To finish installing or updating PostGIS edit:" |
786 |
- elog " ${EROOT%/}/etc/postgis_dbs" |
787 |
- elog |
788 |
- elog "Then, run:" |
789 |
- elog " emerge --config =${CATEGORY}/${PF}" |
790 |
-} |
791 |
- |
792 |
-pkg_config(){ |
793 |
- source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}" |
794 |
- source "${EROOT%/}/etc/postgis_dbs" |
795 |
- local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}" |
796 |
- |
797 |
- if [[ -n ${configured} ]] ; then |
798 |
- einfon "Password for PostgreSQL user '${pguser}': " |
799 |
- read -s PGPASSWORD |
800 |
- export PGPASSWORD |
801 |
- echo |
802 |
- else |
803 |
- eerror "You must edit:" |
804 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
805 |
- eerror "Before running 'emerge --config =${CATEGORY}/${PF}'" |
806 |
- eerror |
807 |
- die "Edit postgis_dbs" |
808 |
- fi |
809 |
- |
810 |
- # The server we work with must be the same slot we built against. |
811 |
- local server_match |
812 |
- server_match=$(psql -U ${pguser} -d postgres -p ${PGPORT} \ |
813 |
- -Aqwtc 'SELECT version()' 2> /dev/null | grep -c "PostgreSQL ${PGSLOT}") |
814 |
- if [[ $? = 0 ]] ; then |
815 |
- if [[ $server_match -ne 1 ]] ; then |
816 |
- unset PGPASSWORD |
817 |
- eerror "Server version must be ${PGSLOT}.x" |
818 |
- die "Server version isn't ${PGSLOT}.x" |
819 |
- fi |
820 |
- else |
821 |
- unset PGPASSWORD |
822 |
- eerror "Is the server running?" |
823 |
- die "Couldn't connect to server." |
824 |
- fi |
825 |
- |
826 |
- local retval |
827 |
- safe_exit() { |
828 |
- unset PGPASSWORD |
829 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
830 |
- eend $retval |
831 |
- eerror "All actions could not be performed." |
832 |
- eerror "Read above to see what failed." |
833 |
- eerror "Once you fix the issue, you'll need to edit:" |
834 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
835 |
- eerror "As some things may have succeeded." |
836 |
- eerror |
837 |
- die "All actions could not be performed" |
838 |
- } |
839 |
- |
840 |
- local db |
841 |
- for db in ${databases[@]} ; do |
842 |
- ebegin "Performing CREATE LANGUAGE on ${db}" |
843 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
844 |
- retval=$? |
845 |
- # In this case, only error code 1 is fatal |
846 |
- [[ $retval == 1 ]] && safe_exit || eend 0 |
847 |
- |
848 |
- ebegin "Enabling PostGIS on ${db}" |
849 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
850 |
- -f "${postgis_path}/postgis.sql" |
851 |
- retval=$? |
852 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
853 |
- done |
854 |
- |
855 |
- for db in ${templates[@]} ; do |
856 |
- ebegin "Creating template database '${db}'" |
857 |
- createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \ |
858 |
- ${db} "PostGIS Template" |
859 |
- retval=$? |
860 |
- [[ $retval != 0 ]] && safe_exit |
861 |
- |
862 |
- psql -q -U ${pguser} -p ${PGPORT} -c \ |
863 |
- "UPDATE pg_database \ |
864 |
- SET datistemplate = TRUE, datallowconn = TRUE \ |
865 |
- WHERE datname = '${db}'" |
866 |
- retval=$? |
867 |
- [[ $retval != 0 ]] && safe_exit |
868 |
- |
869 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
870 |
- retval=$? |
871 |
- # In this case, only error code 1 is fatal |
872 |
- [[ $retval == 1 ]] && safe_exit |
873 |
- |
874 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
875 |
- -f "${postgis_path}/postgis.sql" |
876 |
- retval=$? |
877 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
878 |
- done |
879 |
- |
880 |
- for db in ${epsg_databases[@]} ; do |
881 |
- ebegin "Adding EPSG to ${db}" |
882 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
883 |
- -f "${postgis_path}/spatial_ref_sys.sql" |
884 |
- retval=$? |
885 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
886 |
- done |
887 |
- |
888 |
- for db in ${comment_databases[@]} ; do |
889 |
- ebegin "Adding comments on ${db}" |
890 |
- local comment_file |
891 |
- for comment_file in "${postgis_path}"/*_comments.sql ; do |
892 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}" |
893 |
- retval=$? |
894 |
- [[ $retval == 0 ]] && continue || safe_exit |
895 |
- done |
896 |
- eend 0 |
897 |
- done |
898 |
- |
899 |
- for db in ${upgrade_from_1_3[@]} ; do |
900 |
- ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}" |
901 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
902 |
- -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql" |
903 |
- retval=$? |
904 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
905 |
- done |
906 |
- |
907 |
- for db in ${upgrade_from_1_4[@]} ; do |
908 |
- ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}" |
909 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
910 |
- -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql" |
911 |
- retval=$? |
912 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
913 |
- done |
914 |
- |
915 |
- for db in ${upgrade_from_1_5[@]} ; do |
916 |
- ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}" |
917 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
918 |
- -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql" |
919 |
- retval=$? |
920 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
921 |
- done |
922 |
- |
923 |
- # Clean up and make it so the user has to edit postgis_dbs again that |
924 |
- # way this script won't step on any toes due to user error. |
925 |
- unset PGPASSWORD |
926 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
927 |
- einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled." |
928 |
- einfo |
929 |
- einfo "Currently, only one PostgreSQL slot at a time can be PostGIS enabled." |
930 |
-} |
931 |
|
932 |
diff --git a/dev-db/postgis/postgis-2.1.6.ebuild b/dev-db/postgis/postgis-2.1.6.ebuild |
933 |
deleted file mode 100644 |
934 |
index d332459..0000000 |
935 |
--- a/dev-db/postgis/postgis-2.1.6.ebuild |
936 |
+++ /dev/null |
937 |
@@ -1,287 +0,0 @@ |
938 |
-# Copyright 1999-2015 Gentoo Foundation |
939 |
-# Distributed under the terms of the GNU General Public License v2 |
940 |
-# $Id$ |
941 |
- |
942 |
-EAPI="5" |
943 |
-POSTGRES_COMPAT=( 9.{0,1,2,3,4} ) |
944 |
- |
945 |
-inherit autotools eutils versionator |
946 |
- |
947 |
-MY_PV=$(replace_version_separator 3 '') |
948 |
-MY_P="${PN}-${MY_PV}" |
949 |
-S="${WORKDIR}/${MY_P}" |
950 |
- |
951 |
-DESCRIPTION="Geographic Objects for PostgreSQL" |
952 |
-HOMEPAGE="http://postgis.net" |
953 |
-SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" |
954 |
-LICENSE="GPL-2" |
955 |
-SLOT="0" |
956 |
-KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" |
957 |
-IUSE="doc gtk static-libs test" |
958 |
- |
959 |
-RDEPEND=" |
960 |
- || ( |
961 |
- dev-db/postgresql:9.4[server] |
962 |
- dev-db/postgresql:9.3[server] |
963 |
- dev-db/postgresql:9.2[server] |
964 |
- dev-db/postgresql:9.1[server] |
965 |
- dev-db/postgresql:9.0[server] |
966 |
- ) |
967 |
- dev-libs/json-c |
968 |
- dev-libs/libxml2:2 |
969 |
- >=sci-libs/geos-3.4.2 |
970 |
- >=sci-libs/proj-4.6.0 |
971 |
- >=sci-libs/gdal-1.10.0 |
972 |
- gtk? ( x11-libs/gtk+:2 ) |
973 |
-" |
974 |
- |
975 |
-DEPEND="${RDEPEND} |
976 |
- doc? ( |
977 |
- app-text/docbook-xsl-stylesheets |
978 |
- app-text/docbook-xml-dtd:4.5 |
979 |
- dev-libs/libxslt |
980 |
- || ( |
981 |
- media-gfx/imagemagick[png] |
982 |
- media-gfx/graphicsmagick[imagemagick,png] |
983 |
- ) |
984 |
- ) |
985 |
- virtual/pkgconfig |
986 |
- test? ( dev-util/cunit ) |
987 |
-" |
988 |
- |
989 |
-PGIS="$(get_version_component_range 1-2)" |
990 |
- |
991 |
-REQUIRED_USE="test? ( doc )" |
992 |
- |
993 |
-# Needs a running psql instance, doesn't work out of the box |
994 |
-RESTRICT="test" |
995 |
- |
996 |
-MAKEOPTS+=' -j1' |
997 |
- |
998 |
-# These modules are built using the same *FLAGS that were used to build |
999 |
-# dev-db/postgresql. The right thing to do is to ignore the current |
1000 |
-# *FLAGS settings. |
1001 |
-QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" |
1002 |
- |
1003 |
-postgres_check_slot() { |
1004 |
- if ! declare -p POSTGRES_COMPAT &>/dev/null; then |
1005 |
- die 'POSTGRES_COMPAT not declared.' |
1006 |
- fi |
1007 |
- |
1008 |
-# Don't die because we can't run postgresql-config during pretend. |
1009 |
-[[ "$EBUILD_PHASE" = "pretend" \ |
1010 |
- && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0 |
1011 |
- |
1012 |
- local res=$(echo ${POSTGRES_COMPAT[@]} \ |
1013 |
- | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null) |
1014 |
- |
1015 |
- if [[ "$res" -eq "0" ]] ; then |
1016 |
- eerror "PostgreSQL slot must be set to one of: " |
1017 |
- eerror " ${POSTGRES_COMPAT[@]}" |
1018 |
- return 1 |
1019 |
- fi |
1020 |
- |
1021 |
- return 0 |
1022 |
-} |
1023 |
- |
1024 |
-pkg_setup() { |
1025 |
- postgres_check_slot || die |
1026 |
- export PGSLOT="$(postgresql-config show)" |
1027 |
-} |
1028 |
- |
1029 |
-src_prepare() { |
1030 |
- epatch "${FILESDIR}/${PN}-2.1-ldflags.patch" \ |
1031 |
- "${FILESDIR}/${PN}-2.0-arflags.patch" \ |
1032 |
- "${FILESDIR}/${PN}-2.1.4-pkgconfig-json.patch" |
1033 |
- |
1034 |
- local AT_M4DIR="macros" |
1035 |
- eautoreconf |
1036 |
-} |
1037 |
- |
1038 |
-src_configure() { |
1039 |
- local myargs="" |
1040 |
- use gtk && myargs+=" --with-gui" |
1041 |
- econf \ |
1042 |
- --with-pgconfig="/usr/lib/postgresql-${PGSLOT}/bin/pg_config" \ |
1043 |
- ${myargs} |
1044 |
-} |
1045 |
- |
1046 |
-src_compile() { |
1047 |
- emake |
1048 |
- emake -C topology |
1049 |
- |
1050 |
- if use doc ; then |
1051 |
- emake comments |
1052 |
- emake cheatsheets |
1053 |
- emake -C doc html |
1054 |
- fi |
1055 |
-} |
1056 |
- |
1057 |
-src_install() { |
1058 |
- emake DESTDIR="${D}" install |
1059 |
- use doc && emake DESTDIR="${D}" comments-install |
1060 |
- emake -C topology DESTDIR="${D}" install |
1061 |
- dobin ./utils/postgis_restore.pl |
1062 |
- |
1063 |
- dodoc CREDITS TODO loader/README.* doc/*txt |
1064 |
- |
1065 |
- use doc && dohtml -r doc/html/* |
1066 |
- |
1067 |
- docinto topology |
1068 |
- dodoc topology/{TODO,README} |
1069 |
- |
1070 |
- insinto /etc |
1071 |
- doins "${FILESDIR}/postgis_dbs" |
1072 |
- |
1073 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1074 |
-} |
1075 |
- |
1076 |
-pkg_postinst() { |
1077 |
- postgresql-config update |
1078 |
- |
1079 |
- elog "To finish installing or updating PostGIS edit:" |
1080 |
- elog " ${EROOT%/}/etc/postgis_dbs" |
1081 |
- elog |
1082 |
- elog "Then, run:" |
1083 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1084 |
-} |
1085 |
- |
1086 |
-pkg_config(){ |
1087 |
- source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}" |
1088 |
- source "${EROOT%/}/etc/postgis_dbs" |
1089 |
- local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}" |
1090 |
- |
1091 |
- if [[ -n ${configured} ]] ; then |
1092 |
- einfon "Password for PostgreSQL user '${pguser}': " |
1093 |
- read -s PGPASSWORD |
1094 |
- export PGPASSWORD |
1095 |
- echo |
1096 |
- else |
1097 |
- eerror "You must edit:" |
1098 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
1099 |
- eerror "Before running 'emerge --config =${CATEGORY}/${PF}'" |
1100 |
- eerror |
1101 |
- die "Edit postgis_dbs" |
1102 |
- fi |
1103 |
- |
1104 |
- # The server we work with must be the same slot we built against. |
1105 |
- local server_match |
1106 |
- server_match=$(psql -U ${pguser} -d postgres -p ${PGPORT} \ |
1107 |
- -Aqwtc 'SELECT version()' 2> /dev/null | grep -c "PostgreSQL ${PGSLOT}") |
1108 |
- if [[ $? = 0 ]] ; then |
1109 |
- if [[ $server_match -ne 1 ]] ; then |
1110 |
- unset PGPASSWORD |
1111 |
- eerror "Server version must be ${PGSLOT}.x" |
1112 |
- die "Server version isn't ${PGSLOT}.x" |
1113 |
- fi |
1114 |
- else |
1115 |
- unset PGPASSWORD |
1116 |
- eerror "Is the server running?" |
1117 |
- die "Couldn't connect to server." |
1118 |
- fi |
1119 |
- |
1120 |
- local retval |
1121 |
- safe_exit() { |
1122 |
- unset PGPASSWORD |
1123 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
1124 |
- eend $retval |
1125 |
- eerror "All actions could not be performed." |
1126 |
- eerror "Read above to see what failed." |
1127 |
- eerror "Once you fix the issue, you'll need to edit:" |
1128 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
1129 |
- eerror "As some things may have succeeded." |
1130 |
- eerror |
1131 |
- die "All actions could not be performed" |
1132 |
- } |
1133 |
- |
1134 |
- local db |
1135 |
- for db in ${databases[@]} ; do |
1136 |
- ebegin "Performing CREATE LANGUAGE on ${db}" |
1137 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
1138 |
- retval=$? |
1139 |
- # In this case, only error code 1 is fatal |
1140 |
- [[ $retval == 1 ]] && safe_exit || eend 0 |
1141 |
- |
1142 |
- ebegin "Enabling PostGIS on ${db}" |
1143 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1144 |
- -f "${postgis_path}/postgis.sql" |
1145 |
- retval=$? |
1146 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1147 |
- done |
1148 |
- |
1149 |
- for db in ${templates[@]} ; do |
1150 |
- ebegin "Creating template database '${db}'" |
1151 |
- createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \ |
1152 |
- ${db} "PostGIS Template" |
1153 |
- retval=$? |
1154 |
- [[ $retval != 0 ]] && safe_exit |
1155 |
- |
1156 |
- psql -q -U ${pguser} -p ${PGPORT} -c \ |
1157 |
- "UPDATE pg_database \ |
1158 |
- SET datistemplate = TRUE, datallowconn = TRUE \ |
1159 |
- WHERE datname = '${db}'" |
1160 |
- retval=$? |
1161 |
- [[ $retval != 0 ]] && safe_exit |
1162 |
- |
1163 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
1164 |
- retval=$? |
1165 |
- # In this case, only error code 1 is fatal |
1166 |
- [[ $retval == 1 ]] && safe_exit |
1167 |
- |
1168 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1169 |
- -f "${postgis_path}/postgis.sql" |
1170 |
- retval=$? |
1171 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1172 |
- done |
1173 |
- |
1174 |
- for db in ${epsg_databases[@]} ; do |
1175 |
- ebegin "Adding EPSG to ${db}" |
1176 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1177 |
- -f "${postgis_path}/spatial_ref_sys.sql" |
1178 |
- retval=$? |
1179 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1180 |
- done |
1181 |
- |
1182 |
- for db in ${comment_databases[@]} ; do |
1183 |
- ebegin "Adding comments on ${db}" |
1184 |
- local comment_file |
1185 |
- for comment_file in "${postgis_path}"/*_comments.sql ; do |
1186 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}" |
1187 |
- retval=$? |
1188 |
- [[ $retval == 0 ]] && continue || safe_exit |
1189 |
- done |
1190 |
- eend 0 |
1191 |
- done |
1192 |
- |
1193 |
- for db in ${upgrade_from_1_3[@]} ; do |
1194 |
- ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}" |
1195 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1196 |
- -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql" |
1197 |
- retval=$? |
1198 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1199 |
- done |
1200 |
- |
1201 |
- for db in ${upgrade_from_1_4[@]} ; do |
1202 |
- ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}" |
1203 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1204 |
- -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql" |
1205 |
- retval=$? |
1206 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1207 |
- done |
1208 |
- |
1209 |
- for db in ${upgrade_from_1_5[@]} ; do |
1210 |
- ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}" |
1211 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1212 |
- -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql" |
1213 |
- retval=$? |
1214 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1215 |
- done |
1216 |
- |
1217 |
- # Clean up and make it so the user has to edit postgis_dbs again that |
1218 |
- # way this script won't step on any toes due to user error. |
1219 |
- unset PGPASSWORD |
1220 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
1221 |
- einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled." |
1222 |
- einfo |
1223 |
- einfo "Currently, only one PostgreSQL slot at a time can be PostGIS enabled." |
1224 |
-} |
1225 |
|
1226 |
diff --git a/dev-db/postgis/postgis-2.1.7.ebuild b/dev-db/postgis/postgis-2.1.7.ebuild |
1227 |
deleted file mode 100644 |
1228 |
index 1397b5b..0000000 |
1229 |
--- a/dev-db/postgis/postgis-2.1.7.ebuild |
1230 |
+++ /dev/null |
1231 |
@@ -1,287 +0,0 @@ |
1232 |
-# Copyright 1999-2015 Gentoo Foundation |
1233 |
-# Distributed under the terms of the GNU General Public License v2 |
1234 |
-# $Id$ |
1235 |
- |
1236 |
-EAPI="5" |
1237 |
-POSTGRES_COMPAT=( 9.{0,1,2,3,4,5} ) |
1238 |
- |
1239 |
-inherit autotools eutils versionator |
1240 |
- |
1241 |
-MY_PV=$(replace_version_separator 3 '') |
1242 |
-MY_P="${PN}-${MY_PV}" |
1243 |
-S="${WORKDIR}/${MY_P}" |
1244 |
- |
1245 |
-DESCRIPTION="Geographic Objects for PostgreSQL" |
1246 |
-HOMEPAGE="http://postgis.net" |
1247 |
-SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz" |
1248 |
-LICENSE="GPL-2" |
1249 |
-SLOT="0" |
1250 |
-KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" |
1251 |
-IUSE="doc gtk static-libs test" |
1252 |
- |
1253 |
-RDEPEND=" |
1254 |
- || ( |
1255 |
- dev-db/postgresql:9.4[server] |
1256 |
- dev-db/postgresql:9.3[server] |
1257 |
- dev-db/postgresql:9.2[server] |
1258 |
- dev-db/postgresql:9.1[server] |
1259 |
- dev-db/postgresql:9.0[server] |
1260 |
- ) |
1261 |
- dev-libs/json-c |
1262 |
- dev-libs/libxml2:2 |
1263 |
- >=sci-libs/geos-3.4.2 |
1264 |
- >=sci-libs/proj-4.6.0 |
1265 |
- >=sci-libs/gdal-1.10.0 |
1266 |
- gtk? ( x11-libs/gtk+:2 ) |
1267 |
-" |
1268 |
- |
1269 |
-DEPEND="${RDEPEND} |
1270 |
- doc? ( |
1271 |
- app-text/docbook-xsl-stylesheets |
1272 |
- app-text/docbook-xml-dtd:4.5 |
1273 |
- dev-libs/libxslt |
1274 |
- || ( |
1275 |
- media-gfx/imagemagick[png] |
1276 |
- media-gfx/graphicsmagick[imagemagick,png] |
1277 |
- ) |
1278 |
- ) |
1279 |
- virtual/pkgconfig |
1280 |
- test? ( dev-util/cunit ) |
1281 |
-" |
1282 |
- |
1283 |
-PGIS="$(get_version_component_range 1-2)" |
1284 |
- |
1285 |
-REQUIRED_USE="test? ( doc )" |
1286 |
- |
1287 |
-# Needs a running psql instance, doesn't work out of the box |
1288 |
-RESTRICT="test" |
1289 |
- |
1290 |
-MAKEOPTS+=' -j1' |
1291 |
- |
1292 |
-# These modules are built using the same *FLAGS that were used to build |
1293 |
-# dev-db/postgresql. The right thing to do is to ignore the current |
1294 |
-# *FLAGS settings. |
1295 |
-QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so" |
1296 |
- |
1297 |
-postgres_check_slot() { |
1298 |
- if ! declare -p POSTGRES_COMPAT &>/dev/null; then |
1299 |
- die 'POSTGRES_COMPAT not declared.' |
1300 |
- fi |
1301 |
- |
1302 |
-# Don't die because we can't run postgresql-config during pretend. |
1303 |
-[[ "$EBUILD_PHASE" = "pretend" \ |
1304 |
- && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0 |
1305 |
- |
1306 |
- local res=$(echo ${POSTGRES_COMPAT[@]} \ |
1307 |
- | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null) |
1308 |
- |
1309 |
- if [[ "$res" -eq "0" ]] ; then |
1310 |
- eerror "PostgreSQL slot must be set to one of: " |
1311 |
- eerror " ${POSTGRES_COMPAT[@]}" |
1312 |
- return 1 |
1313 |
- fi |
1314 |
- |
1315 |
- return 0 |
1316 |
-} |
1317 |
- |
1318 |
-pkg_setup() { |
1319 |
- postgres_check_slot || die |
1320 |
- export PGSLOT="$(postgresql-config show)" |
1321 |
-} |
1322 |
- |
1323 |
-src_prepare() { |
1324 |
- epatch "${FILESDIR}/${PN}-2.1-ldflags.patch" \ |
1325 |
- "${FILESDIR}/${PN}-2.0-arflags.patch" \ |
1326 |
- "${FILESDIR}/${PN}-2.1.4-pkgconfig-json.patch" |
1327 |
- |
1328 |
- local AT_M4DIR="macros" |
1329 |
- eautoreconf |
1330 |
-} |
1331 |
- |
1332 |
-src_configure() { |
1333 |
- local myargs="" |
1334 |
- use gtk && myargs+=" --with-gui" |
1335 |
- econf \ |
1336 |
- --with-pgconfig="/usr/lib/postgresql-${PGSLOT}/bin/pg_config" \ |
1337 |
- ${myargs} |
1338 |
-} |
1339 |
- |
1340 |
-src_compile() { |
1341 |
- emake |
1342 |
- emake -C topology |
1343 |
- |
1344 |
- if use doc ; then |
1345 |
- emake comments |
1346 |
- emake cheatsheets |
1347 |
- emake -C doc html |
1348 |
- fi |
1349 |
-} |
1350 |
- |
1351 |
-src_install() { |
1352 |
- emake DESTDIR="${D}" install |
1353 |
- use doc && emake DESTDIR="${D}" comments-install |
1354 |
- emake -C topology DESTDIR="${D}" install |
1355 |
- dobin ./utils/postgis_restore.pl |
1356 |
- |
1357 |
- dodoc CREDITS TODO loader/README.* doc/*txt |
1358 |
- |
1359 |
- use doc && dohtml -r doc/html/* |
1360 |
- |
1361 |
- docinto topology |
1362 |
- dodoc topology/{TODO,README} |
1363 |
- |
1364 |
- insinto /etc |
1365 |
- doins "${FILESDIR}/postgis_dbs" |
1366 |
- |
1367 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1368 |
-} |
1369 |
- |
1370 |
-pkg_postinst() { |
1371 |
- postgresql-config update |
1372 |
- |
1373 |
- elog "To finish installing or updating PostGIS edit:" |
1374 |
- elog " ${EROOT%/}/etc/postgis_dbs" |
1375 |
- elog |
1376 |
- elog "Then, run:" |
1377 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1378 |
-} |
1379 |
- |
1380 |
-pkg_config(){ |
1381 |
- source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}" |
1382 |
- source "${EROOT%/}/etc/postgis_dbs" |
1383 |
- local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}" |
1384 |
- |
1385 |
- if [[ -n ${configured} ]] ; then |
1386 |
- einfon "Password for PostgreSQL user '${pguser}': " |
1387 |
- read -s PGPASSWORD |
1388 |
- export PGPASSWORD |
1389 |
- echo |
1390 |
- else |
1391 |
- eerror "You must edit:" |
1392 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
1393 |
- eerror "Before running 'emerge --config =${CATEGORY}/${PF}'" |
1394 |
- eerror |
1395 |
- die "Edit postgis_dbs" |
1396 |
- fi |
1397 |
- |
1398 |
- # The server we work with must be the same slot we built against. |
1399 |
- local server_match |
1400 |
- server_match=$(psql -U ${pguser} -d postgres -p ${PGPORT} \ |
1401 |
- -Aqwtc 'SELECT version()' 2> /dev/null | grep -c "PostgreSQL ${PGSLOT}") |
1402 |
- if [[ $? = 0 ]] ; then |
1403 |
- if [[ $server_match -ne 1 ]] ; then |
1404 |
- unset PGPASSWORD |
1405 |
- eerror "Server version must be ${PGSLOT}.x" |
1406 |
- die "Server version isn't ${PGSLOT}.x" |
1407 |
- fi |
1408 |
- else |
1409 |
- unset PGPASSWORD |
1410 |
- eerror "Is the server running?" |
1411 |
- die "Couldn't connect to server." |
1412 |
- fi |
1413 |
- |
1414 |
- local retval |
1415 |
- safe_exit() { |
1416 |
- unset PGPASSWORD |
1417 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
1418 |
- eend $retval |
1419 |
- eerror "All actions could not be performed." |
1420 |
- eerror "Read above to see what failed." |
1421 |
- eerror "Once you fix the issue, you'll need to edit:" |
1422 |
- eerror " ${EROOT%/}/etc/postgis_dbs" |
1423 |
- eerror "As some things may have succeeded." |
1424 |
- eerror |
1425 |
- die "All actions could not be performed" |
1426 |
- } |
1427 |
- |
1428 |
- local db |
1429 |
- for db in ${databases[@]} ; do |
1430 |
- ebegin "Performing CREATE LANGUAGE on ${db}" |
1431 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
1432 |
- retval=$? |
1433 |
- # In this case, only error code 1 is fatal |
1434 |
- [[ $retval == 1 ]] && safe_exit || eend 0 |
1435 |
- |
1436 |
- ebegin "Enabling PostGIS on ${db}" |
1437 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1438 |
- -f "${postgis_path}/postgis.sql" |
1439 |
- retval=$? |
1440 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1441 |
- done |
1442 |
- |
1443 |
- for db in ${templates[@]} ; do |
1444 |
- ebegin "Creating template database '${db}'" |
1445 |
- createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \ |
1446 |
- ${db} "PostGIS Template" |
1447 |
- retval=$? |
1448 |
- [[ $retval != 0 ]] && safe_exit |
1449 |
- |
1450 |
- psql -q -U ${pguser} -p ${PGPORT} -c \ |
1451 |
- "UPDATE pg_database \ |
1452 |
- SET datistemplate = TRUE, datallowconn = TRUE \ |
1453 |
- WHERE datname = '${db}'" |
1454 |
- retval=$? |
1455 |
- [[ $retval != 0 ]] && safe_exit |
1456 |
- |
1457 |
- createlang -U ${pguser} -p ${PGPORT} plpgsql ${db} |
1458 |
- retval=$? |
1459 |
- # In this case, only error code 1 is fatal |
1460 |
- [[ $retval == 1 ]] && safe_exit |
1461 |
- |
1462 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1463 |
- -f "${postgis_path}/postgis.sql" |
1464 |
- retval=$? |
1465 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1466 |
- done |
1467 |
- |
1468 |
- for db in ${epsg_databases[@]} ; do |
1469 |
- ebegin "Adding EPSG to ${db}" |
1470 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1471 |
- -f "${postgis_path}/spatial_ref_sys.sql" |
1472 |
- retval=$? |
1473 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1474 |
- done |
1475 |
- |
1476 |
- for db in ${comment_databases[@]} ; do |
1477 |
- ebegin "Adding comments on ${db}" |
1478 |
- local comment_file |
1479 |
- for comment_file in "${postgis_path}"/*_comments.sql ; do |
1480 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}" |
1481 |
- retval=$? |
1482 |
- [[ $retval == 0 ]] && continue || safe_exit |
1483 |
- done |
1484 |
- eend 0 |
1485 |
- done |
1486 |
- |
1487 |
- for db in ${upgrade_from_1_3[@]} ; do |
1488 |
- ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}" |
1489 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1490 |
- -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql" |
1491 |
- retval=$? |
1492 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1493 |
- done |
1494 |
- |
1495 |
- for db in ${upgrade_from_1_4[@]} ; do |
1496 |
- ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}" |
1497 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1498 |
- -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql" |
1499 |
- retval=$? |
1500 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1501 |
- done |
1502 |
- |
1503 |
- for db in ${upgrade_from_1_5[@]} ; do |
1504 |
- ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}" |
1505 |
- psql -q -U ${pguser} -p ${PGPORT} -d ${db} \ |
1506 |
- -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql" |
1507 |
- retval=$? |
1508 |
- [[ $retval == 0 ]] && eend 0 || safe_exit |
1509 |
- done |
1510 |
- |
1511 |
- # Clean up and make it so the user has to edit postgis_dbs again that |
1512 |
- # way this script won't step on any toes due to user error. |
1513 |
- unset PGPASSWORD |
1514 |
- sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs" |
1515 |
- einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled." |
1516 |
- einfo |
1517 |
- einfo "Currently, only one PostgreSQL slot at a time can be PostGIS enabled." |
1518 |
-} |