Version bump to 8.0.13 for bug #175791 (CVE-2007-2138 privilege escalation in SECURIT...
authorAndrew Ross <aross@gentoo.org>
Tue, 1 May 2007 05:59:46 +0000 (05:59 +0000)
committerAndrew Ross <aross@gentoo.org>
Tue, 1 May 2007 05:59:46 +0000 (05:59 +0000)
Package-Manager: portage-2.1.2.2

dev-db/postgresql/ChangeLog
dev-db/postgresql/Manifest
dev-db/postgresql/files/digest-postgresql-8.0.13 [new file with mode: 0644]
dev-db/postgresql/files/postgresql-8.0.13-sh.patch [new file with mode: 0644]
dev-db/postgresql/postgresql-8.0.13.ebuild [new file with mode: 0644]

index c2af7782749c93d25bdda1b959c7dbbdef1d4d9e..c92c95b24b34a4e1f318ed3044d6af4cf91d8a94 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for dev-db/postgresql
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.331 2007/04/28 22:04:20 tove Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.332 2007/05/01 05:59:46 aross Exp $
+
+*postgresql-8.0.13 (01 May 2007)
+
+  01 May 2007; Andrew Ross <aross@gentoo.org>
+  +files/postgresql-8.0.13-sh.patch, +postgresql-8.0.13.ebuild:
+  Version bump for bug #175791 (CVE-2007-2138 privilege escalation in SECURITY
+  DEFINER functions).
 
   28 Apr 2007; Torsten Veller <tove@gentoo.org> postgresql-7.3.15-r1.ebuild,
   postgresql-7.4.13.ebuild, postgresql-8.0.8.ebuild:
index 297fbd740ab22652a1de5fad3018fec4aa751c65..0cad97e5d552b3c72228dfaf47cb7caa1852bfcf 100644 (file)
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
 AUX pg_autovacuum.conf-7.4 503 RMD160 ee3da3918e26113918a47cc6e2da544f97879bc2 SHA1 b47f6f3698ce12cbe955490b80ec98ac4cdd8afb SHA256 8141a1ab17a74e3916b4ba834f10eaf0bd925de374ead972d3d2f5e78078e090
 MD5 3e0310e00bfe34e77bb8c39903e16d6c files/pg_autovacuum.conf-7.4 503
 RMD160 ee3da3918e26113918a47cc6e2da544f97879bc2 files/pg_autovacuum.conf-7.4 503
@@ -85,6 +82,10 @@ AUX postgresql-8.0.12-sh.patch 617 RMD160 d826fbb45265d09880000ea33ac3323beabb0f
 MD5 0616d8126fb38e59b56f2922654e4724 files/postgresql-8.0.12-sh.patch 617
 RMD160 d826fbb45265d09880000ea33ac3323beabb0f50 files/postgresql-8.0.12-sh.patch 617
 SHA256 420023f4789c650189da203d43b134d511ff1b976d17a3948774b0c7bf72d683 files/postgresql-8.0.12-sh.patch 617
+AUX postgresql-8.0.13-sh.patch 617 RMD160 d826fbb45265d09880000ea33ac3323beabb0f50 SHA1 e9a271f0fae2bad9150dbb8579615c90253e538b SHA256 420023f4789c650189da203d43b134d511ff1b976d17a3948774b0c7bf72d683
+MD5 0616d8126fb38e59b56f2922654e4724 files/postgresql-8.0.13-sh.patch 617
+RMD160 d826fbb45265d09880000ea33ac3323beabb0f50 files/postgresql-8.0.13-sh.patch 617
+SHA256 420023f4789c650189da203d43b134d511ff1b976d17a3948774b0c7bf72d683 files/postgresql-8.0.13-sh.patch 617
 AUX postgresql-8.0.9-gentoo.patch 1690 RMD160 7ffb80d6d8929208e8f200b96828d79b3fdccba7 SHA1 f72f8378ba5574e84183c5003ce13da73dd25dc3 SHA256 f6e53a979737a36934310c011e3377ebd6502cabdfde67e3dfa10f1e62dbda8e
 MD5 dfff1d8d131a79d76b48ec9da90c621a files/postgresql-8.0.9-gentoo.patch 1690
 RMD160 7ffb80d6d8929208e8f200b96828d79b3fdccba7 files/postgresql-8.0.9-gentoo.patch 1690
@@ -174,6 +175,7 @@ DIST postgresql-base-7.4.13.tar.bz2 6576973 RMD160 5f90ed85fdceb06fe15e324620e93
 DIST postgresql-base-7.4.14.tar.bz2 6575201 RMD160 c5b8ecd20ad2783c3f254f0e7402aab9ad722d0a SHA1 b737a35070bf13f478e8bca346a32243b9599b89 SHA256 5a34fcd56d2d8eebcd2728e5971c0d39d2971dc25e49d88bfeb84d69b5e8ebc9
 DIST postgresql-base-7.4.16.tar.bz2 6586435 RMD160 8536d5f6f26a101240c64084e6adeb260efef891 SHA1 d3f36c6ace31d3725828aa9d86f4c08f266e33e3 SHA256 d8e7df2f06f248e66023452fa9cf565640b93ae43433dade7515f54e643f5c21
 DIST postgresql-base-8.0.12.tar.bz2 7846737 RMD160 e359f574020ef73a1f8f03ebffdc157114b1a454 SHA1 f43277c0463233f7deec434374a3799c372107b6 SHA256 2aec1d7129794fb29546e76bb0594f0c8ee6e37e8a155b201c15504af0740628
+DIST postgresql-base-8.0.13.tar.bz2 7848290 RMD160 de34ef01b76d777e9b22bcd16dd29328a11d35cf SHA1 aaee4e481644645f3ba66dd7a66377ef3b22cd9c SHA256 5627ad76e6a6c8eb85c1debe5fce2c12b42611434dabe0fd5763b8a72c7ac49d
 DIST postgresql-base-8.0.8.tar.bz2 7823046 RMD160 2c60dc22f714bc0182051a94c3c1f513b30f574e SHA1 a5e5147497f0c2b548762d232d297b48d6e97d02 SHA256 906d86f2477309b9c2531d12fe720761fdffd73243a83ae31892bd7a0a618183
 DIST postgresql-base-8.0.9.tar.bz2 7824961 RMD160 40cbea0b0a3a0f67670dfbe1670e08b48dbb1999 SHA1 d11bb58349b3e42fd0a19ceb732e9381bba89b16 SHA256 8ed190ee5468f3685a1edbc5279490819ffa6fe64f1b6f0139bdbec365852417
 DIST postgresql-base-8.1.5.tar.bz2 8044522 RMD160 3460f38b720ce3a9687052d5523bcbd027655d6e SHA1 7d6cc07ca1cb8cb57a366a7860310a892fe6a2ba SHA256 cb878499848aa8abb82f1ae79574923174851b0396a5befa31f49089a3abb4df
@@ -185,6 +187,7 @@ DIST postgresql-docs-7.4.13.tar.bz2 2426721 RMD160 4500c150a1638279394bf6f688268
 DIST postgresql-docs-7.4.14.tar.bz2 2427724 RMD160 dd67ae2c4552986ced80d1ba52df50a5ae63db9b SHA1 47296643429237d81a0565aac819ded106cca36b SHA256 6739dcb6876e1f76933f88feae0b7d0a5e528e9677dac4175e3223ef379ed789
 DIST postgresql-docs-7.4.16.tar.bz2 2429657 RMD160 f6b50b3b7c1c5bad00b9a33694eef46634bd95f1 SHA1 4b49280188e269d87579004795c7063b58797cbc SHA256 7478f43e5071756434526259895f16ffeffa4c8a11dbd9af2df34250a7f463be
 DIST postgresql-docs-8.0.12.tar.bz2 2266536 RMD160 7716e772348a21b98dcf78d670464b4a0e7fe832 SHA1 be869e88a1abfc7e577335ff0ad90b7040df5ab9 SHA256 04d233b68be2f4549a8a470166e7f6f175c5165722763c515e7230de0efa63d3
+DIST postgresql-docs-8.0.13.tar.bz2 2271196 RMD160 fdb9775d082da9c10aebb9394d84c55cfea3f4d7 SHA1 b9d23b6c70fc3dc365a397d8eef3bd38b9ea1820 SHA256 a703a22b11288eb20b5c4f28e34cfeeed11c730cebf51671049ad37ace5e204d
 DIST postgresql-docs-8.0.8.tar.bz2 2260219 RMD160 e3dbde03b553000d5a263a93713c434e88dd4fe1 SHA1 2f845d6740c7ed88d0b9240b274a75d479658f7c SHA256 60a93ee5b2b80f517696328d85f4db24791cb1099d89a0adc375ee740201dc54
 DIST postgresql-docs-8.0.9.tar.bz2 2262698 RMD160 55df79bfc347147c33db925a1138c2341043f887 SHA1 f7c7acb292c2bc6256fc29b18ce7b4e9b7a1fafb SHA256 b55d4a77c0c3b0f42c7233c08112b884e1463157160007efd70a63806ede632b
 DIST postgresql-docs-8.1.5.tar.bz2 2489400 RMD160 a29a5d1738f6f776597d162d9fc6d69805c74943 SHA1 69a06691cae02ade3888c9c7f813ae5394be070a SHA256 01c0a848b0016598adfcebea74960340edf80fc037051d106b62bea14e1cd0c9
@@ -196,6 +199,7 @@ DIST postgresql-opt-7.4.13.tar.bz2 333860 RMD160 9fd1caacd6d842a473725450a097317
 DIST postgresql-opt-7.4.14.tar.bz2 333417 RMD160 a6279f5b9d52f72ce786bc468c114befb5a1f29a SHA1 becc575260128261dc7f8ed46f166f54f48b8732 SHA256 e670d22812c50512807edd692d867e2b62c6b79f9d7b84cad56ef038cc12475d
 DIST postgresql-opt-7.4.16.tar.bz2 333683 RMD160 fec0e9b68c4868f4e2b85c002103089fbdbedf6f SHA1 657fe7c4ae1ba3020de4594117a1ab5db45f61bc SHA256 13a3063570c27ecc8ae163c86439b3c0b95d21bd55cac2506b105a486d410469
 DIST postgresql-opt-8.0.12.tar.bz2 134790 RMD160 be0d57de5000296bfd5b64685f4d4ef81edea347 SHA1 bd26e2cce6ea7b486e29bc983ee76cfb0551f32b SHA256 ceaf90195860694487918032c19e0a11f991d74c77838cac2ea827d6c85f54da
+DIST postgresql-opt-8.0.13.tar.bz2 134769 RMD160 f3fb741c5dcff23045a58baf57f4386099e3c563 SHA1 ccdc23eb12b19c6d88633125b9e0c2feeda5f93e SHA256 9f63fc12ede1a605934cdc462ff45c0e924288284f411ae38dec1c5b6e87ce25
 DIST postgresql-opt-8.0.8.tar.bz2 134600 RMD160 352f07aa25d0dcf1d2e3502f5cec7295c40bc3d5 SHA1 081d0b8d755a49395001b46ca0585c4e2b5ecf4f SHA256 427e82253b068b35e47235a1b78c521c89a9774b80dcc2433946f86220a34926
 DIST postgresql-opt-8.0.9.tar.bz2 134706 RMD160 be148e079c20c13aec1767180d993933b91c2116 SHA1 a1263b4ec563ec24165db4657dcc4faab567ef90 SHA256 007d5cded329dfbcc91b4f1d1ddb9473efb4316b1621294446ee611065393020
 DIST postgresql-opt-8.1.5.tar.bz2 144784 RMD160 5ac9b1ffdf1357316ceb1736f7b9be3ee339be3b SHA1 6d62463d6bcadcef1e515d740c15489ab4e428e7 SHA256 4fe0dc14e02d65516348ec0e90633be2a3ada002c151fca8f2e7eba6556c8b1c
@@ -205,6 +209,7 @@ DIST postgresql-test-7.3.18.tar.bz2 891032 RMD160 f18fa7025a37bf85936ba78f5cdbb4
 DIST postgresql-test-7.4.14.tar.bz2 902074 RMD160 c6e1f57c77815b5395882cd482ef8bc952adabbf SHA1 3b15dbebe4232f66a253ff03729ee4ec3ffbd877 SHA256 39c87c0227f8c757d29141bb8c24e2a95d3a06d9bc459667fdee4d0028d6d12d
 DIST postgresql-test-7.4.16.tar.bz2 901854 RMD160 37a1ca493bd35534636dd82c1dd2468c4e37cf6c SHA1 565cfcfce7aae3e09ed1ecf0d7bc573ec0d31f96 SHA256 851d5de0f66e3a13a57acffc50f15288a2d367160902e08d0bd1a0deb72b0f39
 DIST postgresql-test-8.0.12.tar.bz2 931028 RMD160 e8527c571f727c14eedc8551cce75f6565d516af SHA1 31046252ff7e9cfde68e14f623d054342c9150ad SHA256 54da2084d7ac970155836b5cf1d278b357df8a67d2a5af101f3390f866de18ac
+DIST postgresql-test-8.0.13.tar.bz2 932945 RMD160 d1a1c5e05337d82fb1fc2a7249e98ce8df375978 SHA1 07924ea198ce2654b65ecce6cd05025f24b62b86 SHA256 ea7e45aa8d9d8f127704e659575a0e860fd53abdaefa7c0f256f246c283ff1cf
 DIST postgresql-test-8.0.9.tar.bz2 931363 RMD160 ae38c2225daff32449ebe6b483096f2f35aa8067 SHA1 1a32090f302542daa92558a3f78129cd39782b98 SHA256 f2b81b3cf7ade17a748fa84570c295817d82fd05b53d2e0fb9d9e922b0c613ea
 DIST postgresql-test-8.1.5.tar.bz2 947271 RMD160 644b352354743eb5250bf422c62e1f2c340c1ed2 SHA1 8371da286f43e689b5bd84999185565cb7c37d19 SHA256 60ed8d466a66dfe72994f7c8e45324e81e8ce6b91343eee07df5939f10559166
 DIST postgresql-test-8.1.8.tar.bz2 946918 RMD160 5f8e591e29ffd4adec8d130a73c1a916e7ea63fd SHA1 a500d39cd77ce5a2d7e61b6d116ad502fe4af947 SHA256 3dd46fea627951cf85cd6b5f0318cc4f1f04ed19814fdaf0f919868699f656dc
@@ -236,6 +241,10 @@ EBUILD postgresql-8.0.12.ebuild 9581 RMD160 f7a40d5f7878bfb7cc36416597c0907a9cf1
 MD5 83799f7417ffc5a903cd20c27b17c673 postgresql-8.0.12.ebuild 9581
 RMD160 f7a40d5f7878bfb7cc36416597c0907a9cf14617 postgresql-8.0.12.ebuild 9581
 SHA256 2e5d0799f4cf7af516c0d7782b13d95d8f8abf939f543231ab1373f64159eb30 postgresql-8.0.12.ebuild 9581
+EBUILD postgresql-8.0.13.ebuild 9806 RMD160 5f6bc7a018b9417fcfa455f565253089c5f099a4 SHA1 e1dcb68d45da04cd200bff658a9afd430819a99c SHA256 885808002999b4f34c756920fe8b17deb13989f6904d024515b9d18d29b6ba98
+MD5 2a014a1b960aaeb83862be3fa92587fe postgresql-8.0.13.ebuild 9806
+RMD160 5f6bc7a018b9417fcfa455f565253089c5f099a4 postgresql-8.0.13.ebuild 9806
+SHA256 885808002999b4f34c756920fe8b17deb13989f6904d024515b9d18d29b6ba98 postgresql-8.0.13.ebuild 9806
 EBUILD postgresql-8.0.8.ebuild 7633 RMD160 88cb665a3b9586a5c0347f8bce37c7d04a3bc417 SHA1 b5e71552efa058469095cbe865c03141539819a8 SHA256 db2ece8127e1f7868727a45207d04d420010e4164c13fbafd59d05cffcd83396
 MD5 34c300f902f3ced5ee0d3400079bf11e postgresql-8.0.8.ebuild 7633
 RMD160 88cb665a3b9586a5c0347f8bce37c7d04a3bc417 postgresql-8.0.8.ebuild 7633
@@ -252,10 +261,10 @@ EBUILD postgresql-8.1.8.ebuild 8493 RMD160 290e30b324e2b3209759f36ad41cb72ed21bf
 MD5 b0acb25dd51ae186d646914cf4b1b140 postgresql-8.1.8.ebuild 8493
 RMD160 290e30b324e2b3209759f36ad41cb72ed21bfb20 postgresql-8.1.8.ebuild 8493
 SHA256 b1dc7fb975cfd1653d677e4e15e103703e0492701397b52099eefc2569d12ab0 postgresql-8.1.8.ebuild 8493
-MISC ChangeLog 69671 RMD160 3efab0f11149843f2ad149646fc18c673b400e9b SHA1 c3df2e4249858eca302dd49eba7a9eee2cbd1b33 SHA256 50c43fd1a8bbeb70763651d310a2787b367299bebe0a2d02fd8d543086e4b979
-MD5 daa802b2e0dc58e5e0a81fc42fffad90 ChangeLog 69671
-RMD160 3efab0f11149843f2ad149646fc18c673b400e9b ChangeLog 69671
-SHA256 50c43fd1a8bbeb70763651d310a2787b367299bebe0a2d02fd8d543086e4b979 ChangeLog 69671
+MISC ChangeLog 69918 RMD160 1878e1601b81868fe0c308541c7be1daa95cc711 SHA1 3010680713feff5d94758675b4733465df5a7d0f SHA256 323d52402a421407a0a9d1e1887905ac41fa8bf9b279d8bb3477b758c7d6304d
+MD5 eab00090aa8b182da0a8c385b65100c0 ChangeLog 69918
+RMD160 1878e1601b81868fe0c308541c7be1daa95cc711 ChangeLog 69918
+SHA256 323d52402a421407a0a9d1e1887905ac41fa8bf9b279d8bb3477b758c7d6304d ChangeLog 69918
 MISC metadata.xml 164 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc SHA1 f67b7ac1c5e6e65ef5a19a589d4759c84918f86c SHA256 7e8e8126bc8701c4a42c7dfed8bb755ac6040fe3d0e3f994d888f8b2b4fa7d8b
 MD5 6fe52df942ef15801d56449cd8299604 metadata.xml 164
 RMD160 becfe652663bd65719dd11fa6ffb588b3d5b4ecc metadata.xml 164
@@ -281,6 +290,9 @@ SHA256 cdcf54028993acd7d4c1f8d31f2ebc3d095193c516fbdc99aa8638fe49499ea7 files/di
 MD5 f86efabfb6164185a3240e1320b6585f files/digest-postgresql-8.0.12 1087
 RMD160 22e7de689c6b143166a109916c2f3028b7831f7b files/digest-postgresql-8.0.12 1087
 SHA256 f114d4173578e4e0304d60e40ad8d406e984bc7a9235a7b7a7d749b0ef2bb47c files/digest-postgresql-8.0.12 1087
+MD5 cacd8257d8fc0d524abc6e5f2dfcdb42 files/digest-postgresql-8.0.13 1087
+RMD160 8da664bd5067ebe6957f407f6020dc3f4056cc6a files/digest-postgresql-8.0.13 1087
+SHA256 b307557da314dd1a813501cfbf1054e18221024f2dc5b8410f62ee37030ffe72 files/digest-postgresql-8.0.13 1087
 MD5 4dd90d685497cfc29caef97a786fbfc6 files/digest-postgresql-8.0.8 1063
 RMD160 c27fbdc33e77854dda297a5466e1854a9e52f0f4 files/digest-postgresql-8.0.8 1063
 SHA256 b47e1cde8cc579e0334c598c8798e6d02bdc0cf4436281949d10cf750ffb6360 files/digest-postgresql-8.0.8 1063
@@ -293,10 +305,3 @@ SHA256 89b2b19a00fa3f6b75aa6892b5cfe1f3cd83ec10bb32dcdaf7d8fcde4a18db1e files/di
 MD5 22156ee9cf59a2332a421e1255a5c548 files/digest-postgresql-8.1.8 1075
 RMD160 46bb73512fca95ab1d256746882690418d94d50c files/digest-postgresql-8.1.8 1075
 SHA256 20f7ff4fa5bd7c5b2b2844c31dcb6313bd192705c2e57d3e40ceab57c50ef227 files/digest-postgresql-8.1.8 1075
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.3 (GNU/Linux)
-
-iD8DBQFGM8TsV3J2n04EauwRAqcbAJ99IbGNlLkfAw6g7moBLNtaILLTAACgwNYZ
-brcgIkOsSI3h9l8GYZX2c6g=
-=H83o
------END PGP SIGNATURE-----
diff --git a/dev-db/postgresql/files/digest-postgresql-8.0.13 b/dev-db/postgresql/files/digest-postgresql-8.0.13
new file mode 100644 (file)
index 0000000..1a68a72
--- /dev/null
@@ -0,0 +1,12 @@
+MD5 d3b5185dc6a12f2443f06f83cdee03d0 postgresql-base-8.0.13.tar.bz2 7848290
+RMD160 de34ef01b76d777e9b22bcd16dd29328a11d35cf postgresql-base-8.0.13.tar.bz2 7848290
+SHA256 5627ad76e6a6c8eb85c1debe5fce2c12b42611434dabe0fd5763b8a72c7ac49d postgresql-base-8.0.13.tar.bz2 7848290
+MD5 877fc8417555cff0a889d38013afefd6 postgresql-docs-8.0.13.tar.bz2 2271196
+RMD160 fdb9775d082da9c10aebb9394d84c55cfea3f4d7 postgresql-docs-8.0.13.tar.bz2 2271196
+SHA256 a703a22b11288eb20b5c4f28e34cfeeed11c730cebf51671049ad37ace5e204d postgresql-docs-8.0.13.tar.bz2 2271196
+MD5 824caf8451dec685a0d5886eb4892807 postgresql-opt-8.0.13.tar.bz2 134769
+RMD160 f3fb741c5dcff23045a58baf57f4386099e3c563 postgresql-opt-8.0.13.tar.bz2 134769
+SHA256 9f63fc12ede1a605934cdc462ff45c0e924288284f411ae38dec1c5b6e87ce25 postgresql-opt-8.0.13.tar.bz2 134769
+MD5 e736c9887ca4c66051501ce2b95a88f8 postgresql-test-8.0.13.tar.bz2 932945
+RMD160 d1a1c5e05337d82fb1fc2a7249e98ce8df375978 postgresql-test-8.0.13.tar.bz2 932945
+SHA256 ea7e45aa8d9d8f127704e659575a0e860fd53abdaefa7c0f256f246c283ff1cf postgresql-test-8.0.13.tar.bz2 932945
diff --git a/dev-db/postgresql/files/postgresql-8.0.13-sh.patch b/dev-db/postgresql/files/postgresql-8.0.13-sh.patch
new file mode 100644 (file)
index 0000000..fc1dafe
--- /dev/null
@@ -0,0 +1,34 @@
+--- src/include/storage/s_lock.h       2005-01-01 07:03:42.000000000 +0900
++++ src/include/storage/s_lock.h       2005-08-17 23:09:19.000000000 +0900
+@@ -239,6 +239,31 @@
+ #endif         /* __s390__ || __s390x__ */
++#if defined(__sh__)
++#define HAS_TEST_AND_SET
++
++typedef unsigned char slock_t;
++
++#define TAS(lock) tas(lock)
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++      register int _res = 1;
++
++      __asm__ __volatile__(
++              "tas.b  @%1\n\t"
++              "movt   %0\n\t"
++              "xor    #1,%0"
++:             "=z"(_res)
++:             "r"(lock)
++:             "t","memory");
++      return _res;
++}
++
++#endif         /* __sh__ */
++
++
+ #if defined(__sparc__)
+ #define HAS_TEST_AND_SET
diff --git a/dev-db/postgresql/postgresql-8.0.13.ebuild b/dev-db/postgresql/postgresql-8.0.13.ebuild
new file mode 100644 (file)
index 0000000..6a87811
--- /dev/null
@@ -0,0 +1,271 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.0.13.ebuild,v 1.1 2007/05/01 05:59:46 aross Exp $
+
+inherit eutils gnuconfig flag-o-matic multilib toolchain-funcs versionator
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+DESCRIPTION="Sophisticated and powerful Object-Relational DBMS."
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/source/v${PV}/${PN}-base-${PV}.tar.bz2
+               mirror://postgresql/source/v${PV}/${PN}-opt-${PV}.tar.bz2
+               doc? ( mirror://postgresql/source/v${PV}/${PN}-docs-${PV}.tar.bz2 )
+               test? ( mirror://postgresql/source/v${PV}/${PN}-test-${PV}.tar.bz2 )"
+LICENSE="POSTGRESQL"
+SLOT="0"
+IUSE="doc kerberos nls pam perl pg-intdatetime python readline selinux ssl tcl test xml zlib"
+
+RDEPEND="~dev-db/libpq-${PV}
+               >=sys-libs/ncurses-5.2
+               kerberos? ( virtual/krb5 )
+               pam? ( virtual/pam )
+               perl? ( >=dev-lang/perl-5.6.1-r2 )
+               python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base )
+               readline? ( >=sys-libs/readline-4.1 )
+               selinux? ( sec-policy/selinux-postgresql )
+               ssl? ( >=dev-libs/openssl-0.9.6-r1 )
+               tcl? ( >=dev-lang/tcl-8 )
+               xml? ( dev-libs/libxml2 dev-libs/libxslt )
+               zlib? ( >=sys-libs/zlib-1.1.3 )"
+DEPEND="${RDEPEND}
+               sys-devel/autoconf
+               >=sys-devel/bison-1.875
+               nls? ( sys-devel/gettext )
+               xml? ( dev-util/pkgconfig )"
+
+PG_DIR="/var/lib/postgresql"
+[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
+
+cluster_exists() {
+       [[ -f "${PG_DIR}/data/PG_VERSION" ]] && return 0
+       return 1
+}
+
+pkg_setup() {
+       if hasq pg-hier ${USE} ; then
+               ewarn "Warning: pg-hier USE-flag detected:"
+               ewarn "The hier-patch has been dropped for this version and the pg-hier USE-flag is therefore deprecated."
+               ewarn "If you really used the 'hier' patch in your database with the 'CONNECT BY' statement,"
+               ewarn "you should stop now and reconsider. You will be able to reuse your data, but not"
+               ewarn "any VIEWS or QUERIES based on that statement."
+               ewarn "Please disable the pg-hier USE-flag!"
+               ebeep 3
+               if cluster_exists ; then
+                       eerror "There is already a database in '${PG_DIR}/data' and you have the pg-hier USE-flag set."
+                       eerror "Please read the message above first. If you decide that the warnings there don't"
+                       eerror "apply to your situation, dump the database using pg_dump and move the '${PG_DIR}/data'"
+                       eerror "away. Then restart the merge. After that create a new database cluster and use pg_restore to"
+                       eerror "re-import the previously dumped data."
+                       eerror "Moving '${PG_DIR}/data' temporarely away or just disable the 'pg-hier' USE-flag won't work."
+                       die "Can't update this database."
+               fi
+       fi
+       if cluster_exists ; then
+               local cluster_version=$(cat "${PG_DIR}/data/PG_VERSION")
+               if [[ ${cluster_version} != $(get_version_component_range 1-2) ]] ; then
+                       eerror "There is a database in '${PG_DIR}/data' from PostgreSQL version ${cluster_version}."
+                       eerror "PostgreSQL doesn't support upgrades between major versions, you have to use pg_dump"
+                       eerror "to dump your existing database. Then move your '${PG_DIR}/data' directory away and"
+                       eerror "restart the merge. After that create a new database cluster and use pg_restore to"
+                       eerror "re-import the previously dumped data."
+                       die "Can't update this database."
+               fi
+       fi
+
+       enewgroup postgres 70
+       enewuser postgres 70 /bin/bash /var/lib postgres
+}
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       # libpq is provided separately as dev-db/libpq
+       sed -i -e 's/^DIRS := libpq ecpg/DIRS := ecpg/' src/interfaces/Makefile
+       sed -i -e '/\W\+\$.MAKE. -C include \$/d' src/Makefile
+       sed -i -e '/^\W\+psql scripts pg_config pg_controldata/ s/pg_config //' src/bin/Makefile
+
+       epatch "${FILESDIR}/${P}-sh.patch"
+
+       # Prepare package for future tests
+       if use test ; then
+               # Fix sandbox violation
+               sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source
+
+               # We need to run the tests as a non-root user, portage seems the most fitting here,
+               # so if userpriv is enabled, we use it directly. If userpriv is disabled, well, we
+               # don't support that in this version of PostgreSQL ... :)
+               mkdir -p "${S}/src/test/regress/tmp_check"
+               chown portage "${S}/src/test/regress/tmp_check"
+               einfo "Tests will be run as user portage."
+       fi
+}
+
+src_compile() {
+       filter-flags -ffast-math -feliminate-dwarf2-dups
+
+       # Detect mips systems properly
+       gnuconfig_update
+
+       cd "${S}"
+
+       ./configure --prefix=/usr \
+               --includedir=/usr/include/postgresql/pgsql \
+               --sysconfdir=/etc/postgresql \
+               --mandir=/usr/share/man \
+               --host=${CHOST} \
+               --with-docdir=/usr/share/doc/${PF} \
+               --libdir=/usr/$(get_libdir) \
+               --enable-depend \
+               $(use_with kerberos krb5) \
+               $(use_enable nls ) \
+               $(use_with pam) \
+               $(use_with perl) \
+               $(use_enable pg-intdatetime integer-datetimes ) \
+               $(use_with python) \
+               $(use_with readline) \
+               $(use_with ssl openssl) \
+               $(use_with tcl) \
+               $(use_with zlib) \
+               || die "configure failed"
+
+       emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "main emake failed"
+
+       cd "${S}/contrib"
+       emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib emake failed"
+
+       if use xml ; then
+               cd "${S}/contrib/xml2"
+               emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "contrib/xml2 emake failed"
+       fi
+}
+
+src_install() {
+       if use perl ; then
+               mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig"
+               sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \
+                       "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile"
+       fi
+
+       cd "${S}"
+       emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "main emake install failed"
+
+       cd "${S}/contrib"
+       emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib emake install failed"
+
+       if use xml ; then
+               cd "${S}/contrib/xml2"
+               emake -j1 DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "contrib/xml2 emake install failed"
+       fi
+
+       cd "${S}"
+       dodoc README HISTORY
+       dodoc contrib/adddepend/*
+
+       cd "${S}/doc"
+       dodoc FAQ* README.* TODO bug.template
+
+       if use doc ; then
+               cd "${S}/doc"
+               docinto FAQ_html
+               dodoc src/FAQ/*
+               docinto sgml
+               dodoc src/sgml/*.{sgml,dsl}
+               docinto sgml/ref
+               dodoc src/sgml/ref/*.sgml
+               docinto TODO.detail
+               dodoc TODO.detail/*
+       fi
+
+       newinitd "${FILESDIR}/postgresql.init-${PV%.*}" postgresql || die "Inserting init.d-file failed"
+       newconfd "${FILESDIR}/postgresql.conf-${PV%.*}" postgresql || die "Inserting conf.d-file failed"
+
+       newinitd "${FILESDIR}/pg_autovacuum.init-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum init.d-file failed"
+       newconfd "${FILESDIR}/pg_autovacuum.conf-${PV%.*}" pg_autovacuum || die "Inserting pg_autovacuum conf.d-file failed"
+       dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
+}
+
+pkg_postinst() {
+       elog "Execute the following command to setup the initial database environment:"
+       elog
+       elog "emerge --config =${PF}"
+       elog
+       elog "If you need a global psqlrc-file, you can place it in '${ROOT}/etc/postgresql/'."
+}
+
+pkg_config() {
+       einfo "Creating the data directory ..."
+       mkdir -p "${PG_DIR}/data"
+       chown -Rf postgres:postgres "${PG_DIR}"
+       chmod 0700 "${PG_DIR}/data"
+
+       einfo "Initializing the database ..."
+       if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
+               eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
+               eerror "You must remove your entire database directory to continue."
+               eerror "(database directory = ${PG_DIR})."
+               die "Remove your database directory to continue"
+       else
+               if use kernel_linux ; then
+                       local SEM=`sysctl -n kernel.sem | cut -f-3`
+                       local SEMMNI=`sysctl -n kernel.sem | cut -f4`
+                       local SEMMNI_MIN=`expr \( ${PG_MAX_CONNECTIONS} + 15 \) / 16`
+                       local SHMMAX=`sysctl -n kernel.shmmax`
+                       local SHMMAX_MIN=`expr 500000 + 30600 \* ${PG_MAX_CONNECTIONS}`
+
+                       if [ ${SEMMNI} -lt ${SEMMNI_MIN} ] ; then
+                               eerror "The current value of SEMMNI is too low"
+                               eerror "for PostgreSQL to run ${PG_MAX_CONNECTIONS} connections!"
+                               eerror "Temporary setting this value to ${SEMMNI_MIN} while creating the initial database."
+                               echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
+                       fi
+
+                       su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+
+                       if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
+                               echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
+                               ewarn "Restoring the SEMMNI value to the previous value."
+                               ewarn "Please edit the last value of kernel.sem in /etc/sysctl.conf"
+                               ewarn "and set it to at least ${SEMMNI_MIN}:"
+                               ewarn
+                               ewarn "  kernel.sem = ${SEM} ${SEMMNI_MIN}"
+                               ewarn
+                       fi
+
+                       if [ ${SHMMAX} -lt ${SHMMAX_MIN} ] ; then
+                               eerror "The current value of SHMMAX is too low for postgresql to run."
+                               eerror "Please edit /etc/sysctl.conf and set this value to at least ${SHMMAX_MIN}:"
+                               eerror
+                               eerror "  kernel.shmmax = ${SHMMAX_MIN}"
+                               eerror
+                       fi
+               else
+                       su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
+               fi
+
+               einfo
+               einfo "You can use the '${ROOT}/etc/init.d/postgresql' script to run PostgreSQL instead of 'pg_ctl'."
+               einfo
+       fi
+}
+
+src_test() {
+       cd "${S}"
+
+       einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+       if hasq userpriv ${FEATURES} ; then
+               if ! emake -j1 check ; then
+                       hasq test ${FEATURES} && die "Make check failed. See above for details."
+                       hasq test ${FEATURES} || eerror "Make check failed. See above for details."
+               fi
+       else
+               eerror "Tests won't be run if FEATURES=userpriv is disabled!"
+       fi
+
+       einfo "Yes, there are other tests which could be run."
+       einfo "... and no, we don't plan to add/support them."
+       einfo "For now, the main regressions tests will suffice."
+       einfo "If you think other tests are necessary, please submit a"
+       einfo "bug including a patch for this ebuild to enable them."
+}