diff options
author | 2015-05-22 14:06:41 +0000 | |
---|---|---|
committer | 2015-05-22 14:06:41 +0000 | |
commit | 6143afa3893003d59117eac066a428d14b3422dd (patch) | |
tree | 967040707f791c6d54d5a3547f1045ce75395be0 | |
parent | x86 stable wrt bug #548756 (diff) | |
download | historical-6143afa3893003d59117eac066a428d14b3422dd.tar.gz historical-6143afa3893003d59117eac066a428d14b3422dd.tar.bz2 historical-6143afa3893003d59117eac066a428d14b3422dd.zip |
Version bump. Fixes multiple vulnerabilities (CVE-2015-{3165,3166,3167}).
Addresses bug 550172. Live ebuild now builds everything unconditionally as
makefiles will change without notice.
Package-Manager: portage-2.2.18/cvs/Linux x86_64
Manifest-Sign-Key: 0xD1BBFDA0
-rw-r--r-- | dev-db/postgresql/ChangeLog | 16 | ||||
-rw-r--r-- | dev-db/postgresql/Manifest | 32 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-9.0.20.ebuild | 371 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-9.1.16.ebuild | 375 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-9.2.11.ebuild | 387 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-9.3.7.ebuild | 387 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-9.4.2.ebuild | 386 | ||||
-rw-r--r-- | dev-db/postgresql/postgresql-9999.ebuild | 122 |
8 files changed, 1984 insertions, 92 deletions
diff --git a/dev-db/postgresql/ChangeLog b/dev-db/postgresql/ChangeLog index a62d97dc6ce3..05dab15e7f10 100644 --- a/dev-db/postgresql/ChangeLog +++ b/dev-db/postgresql/ChangeLog @@ -1,6 +1,20 @@ # ChangeLog for dev-db/postgresql # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.425 2015/04/08 20:26:51 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.426 2015/05/22 14:06:33 titanofold Exp $ + +*postgresql-9.4.2 (22 May 2015) +*postgresql-9.3.7 (22 May 2015) +*postgresql-9.2.11 (22 May 2015) +*postgresql-9.1.16 (22 May 2015) +*postgresql-9.0.20 (22 May 2015) + + 22 May 2015; Aaron W. Swenson <titanofold@gentoo.org> + +postgresql-9.0.20.ebuild, +postgresql-9.1.16.ebuild, + +postgresql-9.2.11.ebuild, +postgresql-9.3.7.ebuild, + +postgresql-9.4.2.ebuild, postgresql-9999.ebuild: + Version bump. Fixes multiple vulnerabilities (CVE-2015-{3165,3166,3167}). + Addresses bug 550172. Live ebuild now builds everything unconditionally as + makefiles will change without notice. 08 Apr 2015; Michał Górny <mgorny@gentoo.org> postgresql-9.0.19-r1.ebuild, postgresql-9.1.15-r1.ebuild, postgresql-9.2.10-r1.ebuild, diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest index e5325e1dc996..5f92d6573198 100644 --- a/dev-db/postgresql/Manifest +++ b/dev-db/postgresql/Manifest @@ -17,39 +17,37 @@ AUX postgresql.init-pre_9.2 4275 SHA256 104291061f7b03f789d345eb8db6c1d599dc9f5f AUX postgresql.service 1666 SHA256 2b1b4a98ce32ae229774c6f303b54ff7a86aa649e2a20563749f84b3334ed1a6 SHA512 8c64b59f1e80096382a7166e1e8f183a5b9cf14c75138c15a39de74b983bfbed2f41cf9b33b2c72c3b9c79130c10104836a3505c96cb18ac1be1297c0fce1af0 WHIRLPOOL c4feda1d51204b87a53fc747f983047955be71ffd3edcd96004edff9ec708466d3c38f84c3898a3b54a828487e84d188897be99b64e73a5b6dae18a53cfe7110 AUX postgresql.tmpfilesd 43 SHA256 a744802238384de29a1ab78a1eba857822be71685ad8d9d8ebf62456417e66f5 SHA512 a35a83d06bd01db5e4251c8d2fed572d62598fbfdddd0167eac918cda4cf520b942e67a54d5cca50d7f753e8b87ca4222024409d0efdb28a3e8ef1a2c5838e70 WHIRLPOOL a787a2c80bc144d88fac860617fd6923aa6fff9f0be8973d83c6ea271cf3f8ed3477de2c928c510903258b034b6d3e2619d1235d0c65b594d7106ad031fd4a74 DIST postgresql-9.0.19.tar.bz2 15019406 SHA256 53ad12bca99ba8ff0e002e39e50634c4dba1035232be1475cb77b3f6579385c0 SHA512 06ab2e9fa155ea9c51626f36c72f0690312405304a2461733435af795158522f1a166c78c03cf18bb9aa51bcb46a255829105bd58e3928fc90168f4afb41dd56 WHIRLPOOL d1b9f324817e3a2bb795a19093b353f5120c5913f1baf3a7ed1fc92b312d3004c3dec170bb27282c8e4ae6b8d38bd4539cd5d6027b47b9fd94a8c973dc690e1e +DIST postgresql-9.0.20.tar.bz2 15043555 SHA256 02fc42026dc3b9440f4626354d30dd505d3fb5a8bb4fc3c8db66c3171a48aa6f SHA512 9642a3e782c84281f7bfc202a78b18858842572fd9bce180201092e18b2b1b812a74bf4456272853c94c70d01118b15baf3a4df77eb59fdbf76b81a2b45d38a9 WHIRLPOOL 36f6ca88d1ed74e8c12112c42af3faa2fc132f0f9a10104fc6494cc2ff437ab3e0ded0d7fcc754a829c28c6f300e9b109bca9711e4ff33c2981450e9a6aec41b DIST postgresql-9.1.15.tar.bz2 15768092 SHA256 67d6deaf15cdc35fcdff2c319234d0577a86bce6f363e4f0e4e987e419e0de5f SHA512 c4ec158713f2398efd7d89cbdd387680da4323d848045639be33b6fb43960f356be651cbbdcf51380ecec4c8c75a181cf216ef5f84b6aa261ea1de19f7d00140 WHIRLPOOL b73723f890eb825a4578a9c0d7d3e1ed6264ac4095f3c517a2192dc9f73611b3119a0aea4633bc0c9b2a623df85017602d302a495d3f6c178d549ad04119e564 +DIST postgresql-9.1.16.tar.bz2 15814306 SHA256 2b65e2f7d6171107b96d3e92f42b869ec21f3b4e920d8941e511111372909456 SHA512 9b0e9202e0a3c4df2d37f3659ac8336db120d82d2f46651e4cace2cdc5303be415e67cd85b606c7be20c774b0732580cb8c81364d10d2257330a27e19df86109 WHIRLPOOL 19a603834d46d767537623f92abce07f770dfdcdaf36f8ae04debf6c299e8b16d9a523e1d3ca1f60fdda0ac059f54bf87bbd74185542af95c9c33bbc53c19182 DIST postgresql-9.2.10.tar.bz2 16353487 SHA256 35545bbfead46f70936a7f3f39ccef13e02cdb79c2b3ef3688888df5b18d73ad SHA512 3af55b9f0e14e4669db7b145e9af5a4729323da7598b580552b4dac016fc643f1d665de3d6d88eaf71aa146f470289f872b232776e0b0db9ffc77b4dd1d4fa03 WHIRLPOOL acf5a93bcd10d283aafda9a8dc8db90df43fb361f63b10fc5cd768409198649c15971d2dc506f97f3eca36d977cd54b9743998ad4ce1f51fb4be561862c9786b +DIST postgresql-9.2.11.tar.bz2 16387018 SHA256 65b2f5f4fe5c1bfc3247dd84cc3f188e2b5ca45406c4fbbf39df631bed38b1cc SHA512 ad343861a366c70af921e8803a4ac1ebdaf6bfd687fb5ee30dfa57ab8561fd32a245c1e66c43b93b554475abf6c9b1e1a5a7d56b82575453c27c62f1dfca4d2c WHIRLPOOL d3c56067bb990e03388394379cdb3f207e5c3a94eb118833c3790e73cc5287f20f22ceb48020f5d4037c11602c2559f37332b3645a9161e6cdfa757ea4711b9f DIST postgresql-9.3.6.tar.bz2 16889913 SHA256 2368cb61e68d9581da7bfdb61bdf39ffbe59d2d95609b0e93adb3b6b8fd6ca14 SHA512 057d8cc43de445cbc31c08fd056fffb049605fc2eb5ade1d2dcbf61fe8ba26597cb9205a1a61e085d6a02a3a2fe6536dc18aab7f2cb7ea5ea83bd30ccdf498fb WHIRLPOOL c786e26f2c46b0c98bd4910d0174e26ea335b5ec184fea2a14f3ce72ea9645c8fba2f1b3c25be3180b36cce05d3e323238495776f289b4337f149edbdaef8e78 +DIST postgresql-9.3.7.tar.bz2 16958172 SHA256 8b746ab3f7e84db9ba0c9fa0d9865f458fe4e43d5ae1d4ff2860db1f5204ff3d SHA512 c7291484dac7a943d381bfd49cdcd841212fd031211416ab234bdf7b50cb9ef00d22c4d4ad62c4289a3a216b93cabb153c3e83f5408eed5fd395c136bde74e4d WHIRLPOOL 2708ec966f991f81a8b0cdd0eb890a3a7f3cb1a5f80d05a02fad54e3fbc0d17c01a4593e40a1ae2b0b5d2be4d4994a6f97dfce588c042c830806ad7acedfcc52 DIST postgresql-9.4.1.tar.bz2 17549976 SHA256 29ddb77c820095b8f52e5455e9c6c6c20cf979b0834ed1986a8857b84888c3a6 SHA512 a97ff354a9c1e8238b8220542d665cee7707370eddedd3d990e17755feadd0e22148b502724ebb0b355496649d5de7efe598b346bc570a1c9ca885314d8fe873 WHIRLPOOL 6126b11b794d2db470308e37e5dfad061291ea8754f49b6d6e0f6d05ac92f7ebacdfbc400283a53325b4fb434e7f2c66c988b60f9b6a3b39c2e56f5277d047ef +DIST postgresql-9.4.2.tar.bz2 17611143 SHA256 81fda191c165ba1d25d75cd0166ece5abdcb4a7f5eca01b349371e279ebb4d11 SHA512 b32e1dc6a7f4ed938dafd4c8bfeb1ff5c40d41cf9ca6a4fddff5dbe74f3e56dddd823445a385bcaba4da1714e087d4f8c17e5daa0adc4e1c2be1ac469c2ec933 WHIRLPOOL de948e763ccd243fb1b43450d29717e3166be8bfe90f5bb18af3863dde4af880f13601ab6eddb6eb30b075d9cdbcfdbebcf8e5cca9138f744b50ca0597cc0fbd EBUILD postgresql-9.0.19-r1.ebuild 11086 SHA256 539c6d8fc147e97548960d7f1040250681eeb2e62e35490d6289d08b31bf92d8 SHA512 97fd888f880d5d205a3a6f95e65be6b5870b2a1b7e22d94099f7fcf51b40808b86cfc9d726cf05aded417ea886cde20296cf0d2b1152b102e478079823ddf657 WHIRLPOOL 7ae41c3eefb9bd162dcc9527369c2e4e538446ebec576d0a80f41e87931140339955f4ae306a5080dd66e6bced7e23cb5c2cf0e82bf6dc51c3d7274b4bf8e9ed EBUILD postgresql-9.0.19.ebuild 11052 SHA256 0c7d753184f28c95cf40df4a2a336cdedb46a892c6e8046986eba3a47e797ee8 SHA512 2af6d783e1ab28ea83e2fa6fae19534e4114a7f0a9f386951fa02e463911bad461d3508003e02ee097da2121ba78a7a5c60a605075ac636aa181d15fc4875436 WHIRLPOOL 9b02d35d474108d52788941fc005d3c2b4137cc3d4440e8cd220f04e8c9e652b196bfa0a2371b5f87de7969cdae84deb5258474e7f29e14f763846af878b779c +EBUILD postgresql-9.0.20.ebuild 11093 SHA256 4bd37e3eec9459eeed4eb042d97754e96b8ee21c2c708670a5daf365853f83dd SHA512 47d1fe77cdd92fb4dc133ca2cc43def8b1ff26cbe8fe9753d6a640ecfbe31de3a9d1d072ce990c87b69946eeea773847fd7ead79ca635fbcbbb2513211c87a3d WHIRLPOOL 8583ce7aec08abb7061ebaa609fe8513b6daf0f00a9bdd9bc17d9ee1f719f6c101d854f29901cc75ff319637099847ae249f38f5c88661a0b570febbdea80e2e EBUILD postgresql-9.1.15-r1.ebuild 11274 SHA256 fdaa2cd11d5e23937abd7a292bd717a1a095ceeabb1f9ff873a3bf6f05c3c694 SHA512 509faec8c56449d3e80c17f70dcc3a61fca24dafad23d1b2a8a53365dac0f3dc66550219eff294060733fb2a7c4efdf886fe50fc1ee5f53857a3958df8a31c6b WHIRLPOOL 7e85b4c73d6b1be63c9bd2093c5335bdd0998d4865c3dde6a0a6ed0be3d4c99950eb9db9e3e5f18b00f17a3418c7cd11d190a9d05c3e8a60ad92069f0ef7f0d0 EBUILD postgresql-9.1.15.ebuild 11052 SHA256 7e4f42f58d6126cb46f63d2a8f534bfba35cbcbd0258eb6d65c725fdc479161c SHA512 5532cc8077535a2e7bfbd0cd4bbc32748fc21fac66b653342b1aee76df3c3b27e20de13a10de28fbb584dc9428b318e026b5f0d79a5d8cbadad5715925d519a5 WHIRLPOOL 583d4207dd79992f2e45d1391083ffe038706dcdbd361fc48ea827f501eb1077f73b98e9e03ab74dc973108414c64d91311fa8a982a6dacf8d5f813537c2823b +EBUILD postgresql-9.1.16.ebuild 11281 SHA256 af51a9212150cc429b61f2e0b39dba4380ac2945823a7ef5c50853eea3cca848 SHA512 ae1baba579c112d759b3706d066c26276a617d8434a340ed253f5811511ab9b0bad27fc537d7612fbffc86e4c973f686bf51521273788c0351f4d5d5c596d7a9 WHIRLPOOL 9ba45b389f82f0cc9ed0d09842f224fe07dd2a0631af86a8cba178959cb351bd3a352976daff6a2fb1c789d4218b16a1d7b83d31bb481c9606a7a458b49d24fa EBUILD postgresql-9.2.10-r1.ebuild 11614 SHA256 1d006a9e10a0d6565c37405c1461b4f04989c84bc1118f79146c137bed3484d1 SHA512 f02c729e42dcd52cd8ee1152dc3edf720ef98af16fe145ba5377e9976f8be983ce6b1e98fc6927caa7853eb49906b2570e3fa0bf48d78efd630b4f642eb7b369 WHIRLPOOL ca66cb2f2951ca358671b3d36032822c6df22fd40c175d621ac0344f2052ecb3d67f8e5d889386463a855c3feb1e02288afec340e733f1c2a48a25e403b7a45a EBUILD postgresql-9.2.10.ebuild 11388 SHA256 3faada08ade10b9a3aab70f49022eb5cb70e1a72acf110b12ad44bf2e54964c7 SHA512 babc40e3c02d317b4231304ae8c6fd04a624343c57cb6ed1fe7a261e1984a7310fbfde04c5ee73e14fdde04c078d2a027e29c7ef58cfdaf3d2e135c3b49b518d WHIRLPOOL c80256e54dc1efc3e12388d8dd084b07cd8ebbbfd8d90a5a8e2e4500ad5ea641474f96feb6926f70b859df5ebb4d183015b244779e4fe2c96fb92ea72c8cab24 +EBUILD postgresql-9.2.11.ebuild 11621 SHA256 3a2c058ad40b1286715fc7eaa178f4c848a7a3c19f353c36f61172d4a80adc6e SHA512 e166f7d44b6243df6d02fb0a97b2ad39ae7b0d5dc3cea1ed8caff93261f48982a9fb05495305b641ae3b449e2d72f634425656b3c3677960a500cf5c4ff72dcf WHIRLPOOL 76dd1fedfdf1b59380233a2d5cf315ace8d0654c6abd4baf745bc716f74243ad05e6dd646116345a12015b1d892d25cd37652394404d8da8f2c9e0ca4e8c9011 EBUILD postgresql-9.3.6-r1.ebuild 11613 SHA256 45e38af4761001ef229ef5f67e0472b5e53a85c732f17804d5af0ce407fc4c7b SHA512 2548f12202ac2555bdb446be09accd7327dd8c066f007177d1a8a8a0012f845c080979ede0ad5cb379860a9be9dbc892ce93ddfdac0986732852f2c7940d2cd7 WHIRLPOOL 7163feac1ac68ec20a734b6e42ba26d2f0a29b819b6322a38c54bc543daad01035085dd46800f875f21e00123fa0ef71437067a524a835d9e2a788d8f55f55d7 EBUILD postgresql-9.3.6.ebuild 11387 SHA256 be0591cbd7ece2b9a3111f362197f7847410fb3e6f3fe197c6b4d4efa552a6ac SHA512 9b9f6bdd48b2c2eeca506dcdb9e65b736bec136a30019a3a2c1a125c9bb08a31388e21882c9e89561cdb2c3463fe0a19aeff868a506f16361820171fe8eca054 WHIRLPOOL 847d213488f96ed14d18ba7bc6b1c61bded1dd1f8c263ca3bcfe5da95114ce79c34f309eab4b37704f8f53339fe74022b48f59865633628d4262dc622d2d39fd +EBUILD postgresql-9.3.7.ebuild 11620 SHA256 4150ced83e74a55f8443443618edae805e14692928f814d70e23476765180616 SHA512 7b84914a6f7b56cdfdd2bed2cd184757b0607924aec4e916902b0cb8b54824f62efbc73febb81bc10b1cf56265060f9ea9ebde52a1b45b7c0f90ddda7dc7ef15 WHIRLPOOL 365b9621da3f1f0ea5d12b5ebc32250186803b6e561629a80a991ed24b2595818c3cfed737366a1540e28b4005aaa29331eff025179e5e942f46bfe27e75d3b7 EBUILD postgresql-9.4.1-r1.ebuild 11583 SHA256 4bd39367ba1159e005c910327bb76fda23dcc9cbbcef0151878b5963dff1cfe8 SHA512 c2d715815e531ee95e34f69ed97df2126c6dd2e20ceed287724d5d4062911bf70e6f64064df547d8e16f90f93c74fb683c1ed42dba742f061ba91bb5a2e62e8c WHIRLPOOL 83039672c079659a75327865cfe977214c56bf435c63760218cc24d3b00d325e396488e4b203ff056bdb7ab4ffd7cf6dfdda7d0203b54afff9d4ac7ae8e5fb89 EBUILD postgresql-9.4.1.ebuild 11357 SHA256 3ac9a1171bf09481d11d4bf5faa2091c16c8a5826d214155704d59800990fb8e SHA512 880fd32cf38ca2491609a0a86aa883b851d1e69f16a5b3087f2ff33be0f98d5a3e2926e4815ed4ab6b1cb485d8c40fef23cbdc1b30f20601a6cb9e063c250062 WHIRLPOOL 51eae1816099d50e3a997421c2a364258b9f8a8d00acc95a9c84693ea12d3049fcb6fcb1c901c790d9405b0a9c59173f28457e20cbcdbefdee695ee8513c3362 -EBUILD postgresql-9999.ebuild 11466 SHA256 06a8c19fdb6702bfca1b29c7615784c997993058858af61a0f8ae3da26b26d59 SHA512 e232b6b194bc657cb948258a251704076e4963b069775e321f0fd64b1aebeb3e18b0ef084ecfa47760d258d8c6c08194d6b014264790f67a5b1e86b9d1d195ba WHIRLPOOL 492a38a06f6c8d770f0b402af02670f3b0fc141385432c0c0dd22b9f9a0d272af6377b57d1c7c38bdf81480840f0ac4f0e8c3b68b3c9f62ee99960779e58e343 -MISC ChangeLog 11517 SHA256 3068a2b7bb4637cdc97e93e2698e73f84bd82ebe3c7233d7250397fee5550db7 SHA512 ff72bd47b8896ead7471b133079d3594d1d0aa7ada708dc7ba1fc242a0528543f0eb47ef0fe2ef06bea7a5ba88ce41f298347e6f6f8d3e0966da782d9ddc1200 WHIRLPOOL cee54a51f64ff16bd06edbfb25e853ad39435ea72cbe98bc31d62599b9eaf95419a743992da6053ae096a7c8177b27f47ed9ddee0c0b11c6101fecf31f12a149 +EBUILD postgresql-9.4.2.ebuild 11590 SHA256 b20266dbd64151e450a39a9c7403be41cdaf514de51b2dba8dc750c6a1cbc189 SHA512 b67bddb65ac1f39aff68592a444184fe20595d8981ab01dff3dcec6a7bc51033218c4a8417842af4bc431d41b285e3251b255ee6bcd7d9f6e848270872e12ee5 WHIRLPOOL 603c678fc50034f3cceefb583fe49bd2428d417f27410abfaf279b6c49ec52b2cd9df1ae5b827abfab9c8af0326b717a53f7b203501faf3a2b55d8648ed4a8ee +EBUILD postgresql-9999.ebuild 10864 SHA256 9d268db4017c973491b420ad3161acf881d495f6c4401e0ea5affa8427feac1b SHA512 c0725042e26133db6a9c24695bca5f5b9376c6ba2206933013313dff85a73f9364b60ecde40116a7b3732cb8088368f40ecb24ebff6093ba5c0ba16da5f7adcc WHIRLPOOL a19cbc58d32a2bf469829c40628791d5f140cf959f921fef9f76006aea3fbfb7a495fbda5acee63baf357d66b8d62414fa38d5e79dc7c422133746ea31c81a06 +MISC ChangeLog 12098 SHA256 04048f0522b1609f04309d3c2e61762e609fa5200606bae4dd45bffef989878f SHA512 e7103567df16c2f67ae9216f508b003f4d0f68352bc321f90a7b0fcf2c41a2e3c2c56680159e8d6d8012d14972506c3b75b463520680e2a1cc0849e98419cfbd WHIRLPOOL 6ae103b2d89038831ef5b7d91afc0211911c953a92437406e491674b9ed1274d0fd496bc1a5d9293ad06087320e291e674d4b6e87a040a54963e8ecb572b066d MISC metadata.xml 620 SHA256 85335fdf06be777d6fa46902094b666ddd7e0a64d12f03b0ba54c181641822c0 SHA512 00a3f52a73add4922a366534f50decb308254a27c64130c9b4fde4f27fbed318ff65a5065a95e0d99219f5f4c439d502b0b0a3951f4589393617385ad656e003 WHIRLPOOL b0a0bf7d88a585d04cdc7acb7aa46d455fff5508100c3a81485ecb9cf221dbbc13f10501652ff084253eacde019d4c79c7b4f997bc8408ade041edb8a23cb1cd -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQJ8BAEBCABmBQJVJY8QXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w -ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC -MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZO6wMQAOBP5OxOEkaC5iak5YtM3G/x -CpX88s1bB/h9YV/GMDSPrRNBMeT00TIwbarZlzdyeKZd7XDx+YyDsqbKrs6nbd/G -+3GZpkufrgOjwNtCBAD8fuo5/PEny81KhJ0C0K7rZc2HzaevEsqvQoWbjaSZe+p4 -upo6wzMb1vzQ3nD173cX3GKGtJNsvimT6Xfx5pKUY5VfBAwasdmlkEsS2E1HlPFz -7OTY+Mh5UoJJ1CQDWmpxIxzHPHK320hymft3Kulpb3P59P2N/7kOAqw9EMuJXQEZ -wV1AAoPQDzzRL9BVgAnssYkKVX1MFpN6jZoGcvQEwQaTHdlOmRGD4wKiUGmNZ/mX -1lWzL80e9PLjmzLYfuPbDk7M1dHw/1wk39qoQBZHbk9kJuC7IHJUP7yTii2lK2A8 -mnM4BJRma4qRWJa2KqXbg5xekmnjd4jbAcwddylT1bG+SqkwaAa2YDAjFffZe9GM -K8g1iKIWUbtEP1AABIamBrThB9ZPURllelSaXh5w7KfGWFmYtKrJkx6hMtFTUUtL -SvXk3RipmgBNr3trd8nzW/oHNi0UqADVjQ+88+SNOrGIu+bUeUpyZSEcZrmKcbSR -LnA9uNZre6U9onn7kfKNxEM8itXpu09R/MWfNMrTTr4IT1zvUBP+1dLX1wJQIxEo -0XGAIV5V6hPve9AwOM66 -=Jp0c +iF4EAREIAAYFAlVfN+wACgkQVxOqA9G7/aD/gAEAjkgkdvLIly1c5G1upumQ6znh +AlEcHmddeGFrCf84uP4A/2ANE/Yx0NoSzSs1jLaZPHDgCSlNNHQMPNuy4kphulPW +=VCVX -----END PGP SIGNATURE----- diff --git a/dev-db/postgresql/postgresql-9.0.20.ebuild b/dev-db/postgresql/postgresql-9.0.20.ebuild new file mode 100644 index 000000000000..4c25613a37b4 --- /dev/null +++ b/dev-db/postgresql/postgresql-9.0.20.ebuild @@ -0,0 +1,371 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9.0.20.ebuild,v 1.1 2015/05/22 14:06:33 titanofold Exp $ + +EAPI="5" + +# Testing within Portage's environment is broken, and the patch no +# longer applies cleanly. +RESTRICT="test" + +PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} ) + +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ + systemd user versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT="$(get_version_component_range 1-2)" + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr + zh_CN zh_TW" +IUSE="doc kerberos kernel_linux ldap nls pam perl -pg_legacytimestamp python + +readline selinux +server ssl static-libs tcl threads uuid xml zlib" + +for lingua in ${LINGUAS}; do + IUSE+=" linguas_${lingua}" +done + +wanted_languages() { + local enable_langs + + for lingua in ${LINGUAS} ; do + use linguas_${lingua} && enable_langs+="${lingua} " + done + + echo -n ${enable_langs} +} + +CDEPEND=" +>=app-eselect/eselect-postgresql-1.2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8 ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +uuid? ( dev-libs/ossp-uuid ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +DEPEND="${CDEPEND} +!!<sys-apps/sandbox-2.0 +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +!dev-db/postgresql-docs:${SLOT} +!dev-db/postgresql-base:${SLOT} +!dev-db/postgresql-server:${SLOT} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Work around PPC{,64} compilation bug where bool is already defined + sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + epatch "${FILESDIR}/pg_ctl-exit-status.patch" + + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" + + if use pam ; then + sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + epatch_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX%/}" + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --docdir="${PO}/usr/share/doc/${PF}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !pg_legacytimestamp integer-datetimes) \ + $(use_enable threads thread-safety) \ + $(use_with kerberos gssapi) \ + $(use_with kerberos krb5) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(use_with tcl) \ + $(use_with uuid ossp-uuid) \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + "$(use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + dodir /etc/eselect/postgresql/slots/${SLOT} + echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ + "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" + + use static-libs || find "${ED}" -name '*.a' -delete + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service" | \ + systemd_newunit - ${PN}-${SLOT}.service + + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 0775 /run/postgresql + fi + fi +} + +pkg_postinst() { + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} diff --git a/dev-db/postgresql/postgresql-9.1.16.ebuild b/dev-db/postgresql/postgresql-9.1.16.ebuild new file mode 100644 index 000000000000..d6046dae267f --- /dev/null +++ b/dev-db/postgresql/postgresql-9.1.16.ebuild @@ -0,0 +1,375 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9.1.16.ebuild,v 1.1 2015/05/22 14:06:33 titanofold Exp $ + +EAPI="5" + +# Testing within Portage's environment is broken, and the patch no +# longer applies cleanly. +RESTRICT="test" + +PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} ) + +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ + systemd user versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT="$(get_version_component_range 1-2)" + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr + zh_CN zh_TW" +IUSE="doc kerberos kernel_linux ldap nls pam perl -pg_legacytimestamp python + +readline selinux +server ssl static-libs tcl threads uuid xml zlib" + +for lingua in ${LINGUAS}; do + IUSE+=" linguas_${lingua}" +done + +wanted_languages() { + local enable_langs + + for lingua in ${LINGUAS} ; do + use linguas_${lingua} && enable_langs+="${lingua} " + done + + echo -n ${enable_langs} +} + +CDEPEND=" +>=app-eselect/eselect-postgresql-1.2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8 ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +uuid? ( dev-libs/ossp-uuid ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +DEPEND="${CDEPEND} +!!<sys-apps/sandbox-2.0 +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +!dev-db/postgresql-docs:${SLOT} +!dev-db/postgresql-base:${SLOT} +!dev-db/postgresql-server:${SLOT} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Work around PPC{,64} compilation bug where bool is already defined + sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + epatch "${FILESDIR}/pg_ctl-exit-status.patch" + + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" + + # Fix bug 486556 where the server would crash at start up because of + # an infinite loop caused by a self-referencing symlink. + epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch" + + if use pam ; then + sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + epatch_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX%/}" + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --docdir="${PO}/usr/share/doc/${PF}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !pg_legacytimestamp integer-datetimes) \ + $(use_enable threads thread-safety) \ + $(use_with kerberos gssapi) \ + $(use_with kerberos krb5) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(use_with tcl) \ + $(use_with uuid ossp-uuid) \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + "$(use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + dodir /etc/eselect/postgresql/slots/${SLOT} + echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ + "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" + + use static-libs || find "${ED}" -name '*.a' -delete + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service" | \ + systemd_newunit - ${PN}-${SLOT}.service + + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 0775 /run/postgresql + fi + fi +} + +pkg_postinst() { + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} diff --git a/dev-db/postgresql/postgresql-9.2.11.ebuild b/dev-db/postgresql/postgresql-9.2.11.ebuild new file mode 100644 index 000000000000..f333cebadd58 --- /dev/null +++ b/dev-db/postgresql/postgresql-9.2.11.ebuild @@ -0,0 +1,387 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9.2.11.ebuild,v 1.1 2015/05/22 14:06:33 titanofold Exp $ + +EAPI="5" + +PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} ) + +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ + systemd user versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT="$(get_version_component_range 1-2)" + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr + zh_CN zh_TW" +IUSE="doc kerberos kernel_linux ldap nls pam perl -pg_legacytimestamp python + +readline selinux +server ssl static-libs tcl threads uuid xml zlib" + +for lingua in ${LINGUAS}; do + IUSE+=" linguas_${lingua}" +done + +wanted_languages() { + local enable_langs + + for lingua in ${LINGUAS} ; do + use linguas_${lingua} && enable_langs+="${lingua} " + done + + echo -n ${enable_langs} +} + +CDEPEND=" +>=app-eselect/eselect-postgresql-1.2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8 ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +uuid? ( dev-libs/ossp-uuid ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +DEPEND="${CDEPEND} +!!<sys-apps/sandbox-2.0 +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +!dev-db/postgresql-docs:${SLOT} +!dev-db/postgresql-base:${SLOT} +!dev-db/postgresql-server:${SLOT} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Work around PPC{,64} compilation bug where bool is already defined + sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" + + # Fix bug 486556 where the server would crash at start up because of + # an infinite loop caused by a self-referencing symlink. + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" + + if use pam ; then + sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + epatch_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX%/}" + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --docdir="${PO}/usr/share/doc/${PF}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !pg_legacytimestamp integer-datetimes) \ + $(use_enable threads thread-safety) \ + $(use_with kerberos gssapi) \ + $(use_with kerberos krb5) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(use_with tcl) \ + $(use_with uuid ossp-uuid) \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + "$(use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + dodir /etc/eselect/postgresql/slots/${SLOT} + echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ + "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" + + use static-libs || find "${ED}" -name '*.a' -delete + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service" | \ + systemd_newunit - ${PN}-${SLOT}.service + + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 0775 /run/postgresql + fi + fi +} + +pkg_postinst() { + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9.3.7.ebuild b/dev-db/postgresql/postgresql-9.3.7.ebuild new file mode 100644 index 000000000000..555025e81669 --- /dev/null +++ b/dev-db/postgresql/postgresql-9.3.7.ebuild @@ -0,0 +1,387 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9.3.7.ebuild,v 1.1 2015/05/22 14:06:33 titanofold Exp $ + +EAPI="5" + +PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} ) + +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ + systemd user versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT="$(get_version_component_range 1-2)" + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr + zh_CN zh_TW" +IUSE="doc kerberos kernel_linux ldap nls pam perl -pg_legacytimestamp python + +readline selinux +server ssl static-libs tcl threads uuid xml zlib" + +for lingua in ${LINGUAS}; do + IUSE+=" linguas_${lingua}" +done + +wanted_languages() { + local enable_langs + + for lingua in ${LINGUAS} ; do + use linguas_${lingua} && enable_langs+="${lingua} " + done + + echo -n ${enable_langs} +} + +CDEPEND=" +>=app-eselect/eselect-postgresql-1.2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8 ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +uuid? ( dev-libs/ossp-uuid ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +DEPEND="${CDEPEND} +!!<sys-apps/sandbox-2.0 +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +!dev-db/postgresql-docs:${SLOT} +!dev-db/postgresql-base:${SLOT} +!dev-db/postgresql-server:${SLOT} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Work around PPC{,64} compilation bug where bool is already defined + sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" + + # Fix bug 486556 where the server would crash at start up because of + # an infinite loop caused by a self-referencing symlink. + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" + + if use pam ; then + sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + epatch_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX%/}" + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --docdir="${PO}/usr/share/doc/${PF}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !pg_legacytimestamp integer-datetimes) \ + $(use_enable threads thread-safety) \ + $(use_with kerberos gssapi) \ + $(use_with kerberos krb5) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(use_with tcl) \ + $(use_with uuid ossp-uuid) \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + "$(use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + dodir /etc/eselect/postgresql/slots/${SLOT} + echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ + "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" + + use static-libs || find "${ED}" -name '*.a' -delete + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service" | \ + systemd_newunit - ${PN}-${SLOT}.service + + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 0775 /run/postgresql + fi + fi +} + +pkg_postinst() { + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9.4.2.ebuild b/dev-db/postgresql/postgresql-9.4.2.ebuild new file mode 100644 index 000000000000..b46171cd259b --- /dev/null +++ b/dev-db/postgresql/postgresql-9.4.2.ebuild @@ -0,0 +1,386 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9.4.2.ebuild,v 1.1 2015/05/22 14:06:33 titanofold Exp $ + +EAPI="5" + +PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} ) + +inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ + systemd user versionator + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" + +SLOT="$(get_version_component_range 1-2)" + +SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="http://www.postgresql.org/" + +LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr + zh_CN zh_TW" +IUSE="doc kerberos kernel_linux ldap nls pam perl -pg_legacytimestamp python + +readline selinux +server ssl static-libs tcl threads uuid xml zlib" + +for lingua in ${LINGUAS}; do + IUSE+=" linguas_${lingua}" +done + +wanted_languages() { + local enable_langs + + for lingua in ${LINGUAS} ; do + use linguas_${lingua} && enable_langs+="${lingua} " + done + + echo -n ${enable_langs} +} + +CDEPEND=" +>=app-eselect/eselect-postgresql-1.2.0 +sys-apps/less +virtual/libintl +kerberos? ( virtual/krb5 ) +ldap? ( net-nds/openldap ) +pam? ( virtual/pam ) +perl? ( >=dev-lang/perl-5.8 ) +python? ( ${PYTHON_DEPS} ) +readline? ( sys-libs/readline:0= ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +tcl? ( >=dev-lang/tcl-8:0= ) +uuid? ( dev-libs/ossp-uuid ) +xml? ( dev-libs/libxml2 dev-libs/libxslt ) +zlib? ( sys-libs/zlib ) +" + +DEPEND="${CDEPEND} +!!<sys-apps/sandbox-2.0 +sys-devel/bison +sys-devel/flex +nls? ( sys-devel/gettext ) +xml? ( virtual/pkgconfig ) +" + +RDEPEND="${CDEPEND} +!dev-db/postgresql-docs:${SLOT} +!dev-db/postgresql-base:${SLOT} +!dev-db/postgresql-server:${SLOT} +selinux? ( sec-policy/selinux-postgresql ) +" + +pkg_setup() { + use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + + enewgroup postgres 70 + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + # Work around PPC{,64} compilation bug where bool is already defined + sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die + + # Set proper run directory + sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ + -i src/include/pg_config_manual.h || die + + use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" + + # Fix bug 486556 where the server would crash at start up because of + # an infinite loop caused by a self-referencing symlink. + epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" + + if use pam ; then + sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ + -i src/backend/libpq/auth.c || \ + die 'PGSQL_PAM_SERVICE rename failed.' + fi + + epatch_user +} + +src_configure() { + case ${CHOST} in + *-darwin*|*-solaris*) + use nls && append-libs intl + ;; + esac + + export LDFLAGS_SL="${LDFLAGS}" + export LDFLAGS_EX="${LDFLAGS}" + + local PO="${EPREFIX%/}" + + econf \ + --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ + --datadir="${PO}/usr/share/postgresql-${SLOT}" \ + --docdir="${PO}/usr/share/doc/${PF}" \ + --includedir="${PO}/usr/include/postgresql-${SLOT}" \ + --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ + --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ + --with-system-tzdata="${PO}/usr/share/zoneinfo" \ + $(use_enable !pg_legacytimestamp integer-datetimes) \ + $(use_enable threads thread-safety) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(use_with tcl) \ + $(use_with uuid ossp-uuid) \ + $(use_with xml libxml) \ + $(use_with xml libxslt) \ + $(use_with zlib) \ + "$(use_enable nls nls "$(wanted_languages)")" +} + +src_compile() { + emake + emake -C contrib +} + +src_install() { + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install -C contrib + + dodoc README HISTORY doc/{TODO,bug.template} + + # man pages are already built, but if we have the target make them, + # they'll be generated from source before being installed so we + # manually install man pages. + # We use ${SLOT} instead of doman for postgresql.eselect + insinto /usr/share/postgresql-${SLOT}/man/ + doins -r doc/src/sgml/man{1,3,7} + if ! use server; then + # Remove man pages for non-existent binaries + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do + rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" + done + fi + docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} + + insinto /etc/postgresql-${SLOT} + newins src/bin/psql/psqlrc.sample psqlrc + + dodir /etc/eselect/postgresql/slots/${SLOT} + echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ + "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" + + use static-libs || find "${ED}" -name '*.a' -delete + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + fi + + if use server; then + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} + + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service" | \ + systemd_newunit - ${PN}-${SLOT}.service + + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session + + if use prefix ; then + keepdir /run/postgresql + fperms 0775 /run/postgresql + fi + fi +} + +pkg_postinst() { + postgresql-config update + + elog "If you need a global psqlrc-file, you can place it in:" + elog " ${EROOT%/}/etc/postgresql-${SLOT}/" + + if use server ; then + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" + fi +} + +pkg_prerm() { + if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" + ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" + + ebegin "Resuming removal in 10 seconds (Control-C to cancel)" + sleep 10 + eend 0 + fi +} + +pkg_postrm() { + postgresql-config update +} + +pkg_config() { + use server || die "USE flag 'server' not enabled. Nothing to configure." + + [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ + && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" + [[ -z "${DATA_DIR}" ]] \ + && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" + + # environment.bz2 may not contain the same locale as the current system + # locale. Unset and source from the current system locale. + if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then + unset LANG + unset LC_CTYPE + unset LC_NUMERIC + unset LC_TIME + unset LC_COLLATE + unset LC_MONETARY + unset LC_MESSAGES + unset LC_ALL + source "${EROOT%/}/etc/env.d/02locale" + [ -n "${LANG}" ] && export LANG + [ -n "${LC_CTYPE}" ] && export LC_CTYPE + [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC + [ -n "${LC_TIME}" ] && export LC_TIME + [ -n "${LC_COLLATE}" ] && export LC_COLLATE + [ -n "${LC_MONETARY}" ] && export LC_MONETARY + [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES + [ -n "${LC_ALL}" ] && export LC_ALL + fi + + einfo "You can modify the paths and options passed to initdb by editing:" + einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + einfo + einfo "Information on options that can be passed to initdb are found at:" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo + einfo "PG_INITDB_OPTS is currently set to:" + if [[ -z "${PG_INITDB_OPTS}" ]] ; then + einfo " (none)" + else + einfo " ${PG_INITDB_OPTS}" + fi + einfo + einfo "Configuration files will be installed to:" + einfo " ${PGDATA}" + einfo + einfo "The database cluster will be created in:" + einfo " ${DATA_DIR}" + einfo + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + + if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then + eerror "The given directory, '${DATA_DIR}', is not empty." + eerror "Modify DATA_DIR to point to an empty directory." + die "${DATA_DIR} is not empty." + fi + + einfo "Creating the data directory ..." + if [[ ${EUID} == 0 ]] ; then + mkdir -p "${DATA_DIR}" + chown -Rf postgres:postgres "${DATA_DIR}" + chmod 0700 "${DATA_DIR}" + fi + + einfo "Initializing the database ..." + + if [[ ${EUID} == 0 ]] ; then + su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" + else + "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} + fi + + if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then + mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" + ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" + fi + + cat <<- EOF >> "${PGDATA%/}"/postgresql.conf + # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 + # On the off-chance that you might need to work with UTF-8 encoded + # characters in PL/Perl + plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' + EOF + + einfo "The autovacuum function, which was in contrib, has been moved to the main" + einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" + einfo "by default. You can disable it in the cluster's:" + einfo " ${PGDATA%/}/postgresql.conf" + einfo + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + if use prefix ; then + einfo "The location of the configuration files have moved to:" + einfo " ${PGDATA}" + einfo "To start the server:" + einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" + einfo "To stop:" + einfo " pg_ctl stop -D ${DATA_DIR}" + einfo + einfo "Or move the configuration files back:" + einfo "mv ${PGDATA}*.conf ${DATA_DIR}" + else + einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" + einfo "instead of 'pg_ctl'." + fi +} + +src_test() { + einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" + + if use server && [[ ${UID} -ne 0 ]] ; then + emake check + + einfo "If you think other tests besides the regression tests are necessary, please" + einfo "submit a bug including a patch for this ebuild to enable them." + else + use server || \ + ewarn 'Tests cannot be run without the "server" use flag enabled.' + [[ ${UID} -eq 0 ]] || \ + ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + + ewarn 'Skipping.' + fi +} diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9999.ebuild index d047ee399f19..efe0c86108e0 100644 --- a/dev-db/postgresql/postgresql-9999.ebuild +++ b/dev-db/postgresql/postgresql-9999.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9999.ebuild,v 1.11 2015/04/08 18:45:26 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-9999.ebuild,v 1.12 2015/05/22 14:06:33 titanofold Exp $ EAPI="5" -PYTHON_COMPAT=( python{2_7,3_{3,4}} ) +PYTHON_COMPAT=( python{2_{6,7},3_{2,3,4}} ) inherit base eutils flag-o-matic git-2 linux-info multilib pam prefix \ python-single-r1 systemd user versionator @@ -83,8 +83,17 @@ RDEPEND="${CDEPEND} selinux? ( sec-policy/selinux-postgresql ) " +pkg_pretend() { + ewarn "You are using a live ebuild that uses the current source code as it is" + ewarn "available from PostgreSQL's Git repository at emerge time. Given such," + ewarn "the GNU Makefiles may be altered by upstream without notice and the" + ewarn "documentation for this live version is not readily available" + ewarn "online. Ergo, the ebuild maintainers will not support building a" + ewarn "client-only and/or document-free version." +} + pkg_setup() { - use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup + CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup enewgroup postgres 70 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres @@ -100,8 +109,6 @@ src_prepare() { sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ -i src/include/pg_config_manual.h || die - use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" - if use pam ; then sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ -i src/backend/libpq/auth.c || \ @@ -149,31 +156,14 @@ src_configure() { } src_compile() { - emake - emake -C contrib - - # If use doc, generate all documentation, otherwise just the - # man pages - #use doc && emake -C doc || emake -C doc man + emake world } src_install() { - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install -C contrib + emake DESTDIR="${D}" install-world dodoc README HISTORY doc/{TODO,bug.template} - # We use ${SLOT} instead of doman for postgresql.eselect - #insinto /usr/share/postgresql-${SLOT}/man/ - #doins -r doc/src/sgml/man{1,3,7} - #if ! use server; then - # # Remove man pages for non-existent binaries - # for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do - # rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" - # done - #fi - #docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} - insinto /etc/postgresql-${SLOT} newins src/bin/psql/psqlrc.sample psqlrc @@ -183,35 +173,25 @@ src_install() { use static-libs || find "${ED}" -name '*.a' -delete - #if use doc ; then - # docinto html - # dodoc doc/src/sgml/html/* - - # docinto sgml - # dodoc doc/src/sgml/*.{sgml,dsl} - #fi + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} - if use server; then - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ - "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ - "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} + sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ + "${FILESDIR}/${PN}.service" | \ + systemd_newunit - ${PN}-${SLOT}.service - sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ - "${FILESDIR}/${PN}.service" | \ - systemd_newunit - ${PN}-${SLOT}.service + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf - systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session - use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session - - if use prefix ; then - keepdir /run/postgresql - fperms 0775 /run/postgresql - fi + if use prefix ; then + keepdir /run/postgresql + fperms 0775 /run/postgresql fi } @@ -221,29 +201,27 @@ pkg_postinst() { elog "If you need a global psqlrc-file, you can place it in:" elog " ${EROOT%/}/etc/postgresql-${SLOT}/" - if use server ; then - elog - elog "Gentoo specific documentation:" - elog "https://wiki.gentoo.org/wiki/PostgreSQL" - elog - elog "Official documentation:" - elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" - elog - elog "The default location of the Unix-domain socket is:" - elog " ${EROOT%/}/run/postgresql/" - elog - elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" - elog "so that it contains your preferred locale in:" - elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" - elog - elog "Then, execute the following command to setup the initial database" - elog "environment:" - elog " emerge --config =${CATEGORY}/${PF}" - fi + elog + elog "Gentoo specific documentation:" + elog "https://wiki.gentoo.org/wiki/PostgreSQL" + elog + elog "Official documentation:" + elog "${EROOT%/}/usr/share/doc/${PF}/html" + elog + elog "The default location of the Unix-domain socket is:" + elog " ${EROOT%/}/run/postgresql/" + elog + elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" + elog "so that it contains your preferred locale, and other options, in:" + elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" + elog + elog "Then, execute the following command to setup the initial database" + elog "environment:" + elog " emerge --config =${CATEGORY}/${PF}" } pkg_prerm() { - if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then + if [[ -z ${REPLACED_BY_VERSION} ]] ; then ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" @@ -258,8 +236,6 @@ pkg_postrm() { } pkg_config() { - use server || die "USE flag 'server' not enabled. Nothing to configure." - [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" @@ -380,17 +356,15 @@ pkg_config() { src_test() { einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" - if use server && [[ ${UID} -ne 0 ]] ; then + if [[ ${UID} -ne 0 ]] ; then emake check einfo "If you think other tests besides the regression tests are necessary, please" einfo "submit a bug including a patch for this ebuild to enable them." else - use server || \ - ewarn 'Tests cannot be run without the "server" use flag enabled.' [[ ${UID} -eq 0 ]] || \ - ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' + ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES." - ewarn 'Skipping.' + ewarn "Skipping." fi } |