1 |
commit: e1b883f50e5ffc50bf3f0e7c377b21a425b84167 |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 7 17:19:01 2016 +0000 |
4 |
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 7 17:19:01 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1b883f5 |
7 |
|
8 |
dev-db/postgresql: Clean Up |
9 |
|
10 |
Clean out old and insecure. |
11 |
|
12 |
Package-Manager: portage-2.2.28 |
13 |
|
14 |
dev-db/postgresql/Manifest | 15 - |
15 |
dev-db/postgresql/postgresql-9.0.23-r1.ebuild | 380 ---------------------- |
16 |
dev-db/postgresql/postgresql-9.1.19-r1.ebuild | 384 ---------------------- |
17 |
dev-db/postgresql/postgresql-9.1.20.ebuild | 384 ---------------------- |
18 |
dev-db/postgresql/postgresql-9.1.22.ebuild | 384 ---------------------- |
19 |
dev-db/postgresql/postgresql-9.2.14-r1.ebuild | 394 ----------------------- |
20 |
dev-db/postgresql/postgresql-9.2.15.ebuild | 394 ----------------------- |
21 |
dev-db/postgresql/postgresql-9.2.17.ebuild | 394 ----------------------- |
22 |
dev-db/postgresql/postgresql-9.3.10-r1.ebuild | 394 ----------------------- |
23 |
dev-db/postgresql/postgresql-9.3.10-r2.ebuild | 399 ----------------------- |
24 |
dev-db/postgresql/postgresql-9.3.11.ebuild | 399 ----------------------- |
25 |
dev-db/postgresql/postgresql-9.3.13.ebuild | 399 ----------------------- |
26 |
dev-db/postgresql/postgresql-9.4.5-r1.ebuild | 426 ------------------------- |
27 |
dev-db/postgresql/postgresql-9.4.5-r2.ebuild | 431 ------------------------- |
28 |
dev-db/postgresql/postgresql-9.4.6.ebuild | 431 ------------------------- |
29 |
dev-db/postgresql/postgresql-9.4.8.ebuild | 431 ------------------------- |
30 |
dev-db/postgresql/postgresql-9.5.1.ebuild | 431 ------------------------- |
31 |
dev-db/postgresql/postgresql-9.5.3.ebuild | 437 -------------------------- |
32 |
18 files changed, 6907 deletions(-) |
33 |
|
34 |
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest |
35 |
index 6a33db9..34f2505 100644 |
36 |
--- a/dev-db/postgresql/Manifest |
37 |
+++ b/dev-db/postgresql/Manifest |
38 |
@@ -1,26 +1,11 @@ |
39 |
-DIST postgresql-9.0.23.tar.bz2 15045569 SHA256 3dbcbe19c814139a3f4be8bc6b49db804753cbc49979f345083e835c52b4d7de SHA512 db8fe64a5a5a1caae97e792ee5b8bcc375c6d6e10ef9c35f1003f174745568854dc5a7a58dbaf46794dcd35dee5a13f6eb1ba356f9618134b601b7759c753c9f WHIRLPOOL 5177facff628271a0d57d1f2925cfc04796020492c4102f0b0c6fa34149da9ddd9ccb0a38629e320521fe82163bdd4aa56f74af3a887ff4389cd9f62e921c53a |
40 |
-DIST postgresql-9.1.19.tar.bz2 15843978 SHA256 cbd5057451147dd63a1e764176a4e17a7795773be1e4266ea9faa951064c0ec6 SHA512 23dd4108556edcc667f599c5663356a1106bc239a1c5337d153c13a1e1871d52316825b84802bbc1d79612dfa4c9c77f4c4b96d59d23d7338988bdf370e956d4 WHIRLPOOL 6845fd8071032e987ab65a642ca04adbc8b464332bac8c346f01e011411947aa4341ea596fd910342124fcbae4cc25410c25ab695894b0b68d20441df5424722 |
41 |
-DIST postgresql-9.1.20.tar.bz2 15844360 SHA256 6d1e6c4334c265a85f0f96407b7a9aafff0f26cb62db2d8d03a32ba0c2872937 SHA512 ebec6aae593058276dda2404812d89f3df637ceac24d96de1a774da03cf58ea9ce44819e18549040b6f6d811f2c8203462e13788df7158d45a0fe9dfb72d0fd9 WHIRLPOOL de990c029949c8ef372d3440c4cbb870739bf5b83c438ba2b012004cabcb077bab1258b2115ceb239eafefe73f282ea729384085e3f682240cb40ed662f350e5 |
42 |
DIST postgresql-9.1.21.tar.bz2 15850128 SHA256 d66ee9076f3149a4cab4be3c6f47e13bc047138d17dfcb531ad01f78cfdeb393 SHA512 75a96ce2c080b2e657b6f591e18c4778635a9f8c74870bbe7c99cb82bf1dfaad124942214ab6e3079b565c41b7fc77af1a4a49672e7ddba075374402c8832a5b WHIRLPOOL 4de012763b985d1fa675e151d68988f4dd4de4ae8860d67fab3818666b3e135849465a0a41bc1f073eb4d679415fb18871f8156c99376c7860c51258e607771e |
43 |
-DIST postgresql-9.1.22.tar.bz2 15860904 SHA256 f619664b0dde4e1a75fdc00c35afb4517002984a462d70967ffcdedfeee5e16e SHA512 a2ed0a1f0d0920f6151d128a206c557b14832ab296dbf51c665309434a851b83eefd12a5a36c870ee0281371350b6b86ac6e81188c164c72407847cf9e70d691 WHIRLPOOL d95f142e149fec8311502bff6cfabf33aadc1ccc400d9b0d77e4b5000beec88b60ff6de59fbc625b4696626e9b626dc887dd8c96a3c02a66019dc6d0e214994c |
44 |
DIST postgresql-9.1.23.tar.bz2 15856178 SHA256 7f7471e8b3b369726f1c1df0e6a163dde63b6546c4bba985c1f36a574c75f6d5 SHA512 192f48ed8db510663c85c217afee8eff732d467fe10f600c9be834371ccb6a788acd380c582d80f0096a0b7d7ee0daa378d1fb8177281bf4e6e2fcc39fffdc67 WHIRLPOOL 55a60cdc6a0c1e570d2a1f7fce9c160637101cf77c7dda3d1a2ccd31350d16678f07949c8bd7519f54bc6008e18074d0d57f1201c870b044e765c8057a358441 |
45 |
-DIST postgresql-9.2.14.tar.bz2 16451398 SHA256 54c20b3f320a48c38487f2711e98b2fa3f9ce4305905a294ad0449e8b4fb292e SHA512 268015d9e397ee62eebbbc9abf1ee25d0d4aa6bf5943b404009b3aab31f485b8523353c679beed34cc00304b9d4c7aca9de0ba841d9841dbf885d05d1a5692a1 WHIRLPOOL 4f6d5d6989a67d14082ddb215411b55d0dc0be29772e6a593b4df133489ff4a7e6c265d0830adba64d4c6be47e17a949cbc21d6570dceb9362399649af2be88e |
46 |
-DIST postgresql-9.2.15.tar.bz2 16480973 SHA256 7ced4807589899e83c64dd0803cf1f9782b6a20077ab545c66e868ef26543e60 SHA512 4a0e52beaffc9f0b004c761a5ca107a019d6265877d36cd7be46912807da6fa6824ce469c8d59fb24092440646d3f0872b8aa62941b4b3ba657edc2f5678b2b1 WHIRLPOOL 58607fcd1adc474f6a78741527b4192e30ac8e87d83a80fa71b6660ac1665a9ab5ee062ae19c919b288df607854ab55866e00e0228ffc6bd1b71dd59c18d83bd |
47 |
DIST postgresql-9.2.16.tar.bz2 16490199 SHA256 d2164cb8706bf828161871c195299841c5be1fbd9bc85d7866704e54f0741b11 SHA512 0f0b317473b4b42ae4261993c704a7c6cd28c7e6bd83e77a81850695655baa473d7d52e97441ee5500d646d405c84145a54f42b9bae89a0ddfebb0418d608820 WHIRLPOOL 8dfdca52555889d20e857ecc01ee75a14fd18bb7fa1ac50f5d54415a423d62223d0d389d43b143ae927446946aaff06b68cbf8214e26e2f432c39a50c0296b08 |
48 |
-DIST postgresql-9.2.17.tar.bz2 16497200 SHA256 c660cc0ee42c221ebedc2c75ad0d4b30ec8da488a954df9987a3fc83bcb7363f SHA512 a771c98c0de4e6c5790b9ee698ee8d259533d372b82ff3c9900c00cf79706ef29af6204de4292ff8ca4a3f3a13fec1991c4441c352c309bbf9cdd397579677b4 WHIRLPOOL c522b5bb4baa06624d67dac5c50e7d33bdd03a78a34e9c96df850285ab3b491f3502a94abb7604abf0716672c207340f05c23d4b110f8f51c8bd278c848dd389 |
49 |
DIST postgresql-9.2.18.tar.bz2 16448429 SHA256 d7aa37d586ae4d46d07a4fac417ff966e45a9dd99bac8b3cd149be8df9ea35f4 SHA512 c311f621ac38e2dfaf5fd57a4500430333dcbb2d7f1719bc7d99fef54e06a22f93aea595391c3607d44c89c372d0e89daf18f8f295b33e3b21e5285fbbb87d5b WHIRLPOOL 08664a3378eca1a509066a6a841c1489d7cf8cbda60cd836ad67b0cb2bf112b58191d0a1170f97aec09ef5a0984916263c754bc108de2cec6945417e97ce0e66 |
50 |
-DIST postgresql-9.3.10.tar.bz2 16995860 SHA256 e5444f0f76aff98a251400b7c28bc361d65e3d72d8d6cb9bb5d8361a69541531 SHA512 6b048fd1d0b38f72bab6ea70e40f10e7b805b94fc4c6fd865e0ec5e86da3c54043f20059dbf716d29eb4ca787dc50da561b1c7b48ab9f3096ebc651300855672 WHIRLPOOL b8ea15a04d18535662832d444b556aedffaa8c954b52dcd42d548f53f93b8a9dbfbe9298f63c26d44c8b757e8c10d76711c303cd83c84d9c86bf23c2837e74ce |
51 |
-DIST postgresql-9.3.11.tar.bz2 17047707 SHA256 3d222a90c941d3a6c02c7c749fc9eb54ff20a1166570459d09c5476743496a21 SHA512 8da91e11e0a6502c185931b6e47ba8e583d3360009f26ad703552be9a216b2c37a688894d4ea867c529c4135b6c36da26e9d7ef52a411b0c68ad50a53ff3cdb3 WHIRLPOOL cc1251553ec902dc1998c2bad11460206064c0d55140601b96293d98774f9622d38fa49f758e2f69ed6cb27ee14dd0a20f6ec41f655a4793b255168dfd430815 |
52 |
DIST postgresql-9.3.12.tar.bz2 17052755 SHA256 f3339ea23f86d07f3730adc878b2e5d433087ff44aad65a5ec9c22c32b112e67 SHA512 d88cb167ca78bd8588e3ff9b3f13b77f661e3ddec7e5b726cc0a46512db2584b15ce5f691fe7e4ab84855f102cb88014245921a38f5da41ad19e762a88968883 WHIRLPOOL 8738e18f8534f70ddbfa7c0c0ae1ab585330cb9df2d2da3a3e5f5c15a2e5070aebd38124b7295214e0105c482a79011d00c8cbe2a9061edc90bfd5ed07000dcb |
53 |
-DIST postgresql-9.3.13.tar.bz2 17061824 SHA256 5544e1d29bfdb9a815d3533400ae242b8763c399285e5d4020ffdb49c362a72b SHA512 04658f95d723563c08249faf674f2119358059808c42045e05adaa28264b9ae054d4e81ae2bb6639995e007caa65d21d935ff988d5b0473dc517107ddd8c6ca3 WHIRLPOOL 4d3e05220fea08111d75f613d3af93b8a6dd320861c99ecf993ab515447077d4991e36d02fb5a3f2963f7d1d2f0ac48cb000b5922156ad7af10482f929ca8694 |
54 |
DIST postgresql-9.3.14.tar.bz2 17042199 SHA256 5c4322f1c42ba1ff4b28383069c56663b46160bb08e85d41fa2ab9a5009d039d SHA512 97bd92ffdd661f7428c47a8bc87fde88a2b150e7d08bd577a7159ac65aec319d358495b883b95dff2069d24a8d15d1e7c10c3fae81fc76186bfef0127f257ac4 WHIRLPOOL d603e2016cba37fd0ea68b00c1493d23588aeeb334cceeb7fce521ed66618ffa70b4eb281e8a37650e30151cd4f1353879c63fe4076caa144d085ac96e8b5a79 |
55 |
-DIST postgresql-9.4.5.tar.bz2 17660960 SHA256 b87c50c66b6ea42a9712b5f6284794fabad0616e6ae420cf0f10523be6d94a39 SHA512 01ad4b5a097efa70f74a9e96b764c32953a9df57d6bf81b893a1e552475f6aba0381580dcd1f27b2c443ce89fecc429eeeb0219af60a0b2f84798f76eb1757f5 WHIRLPOOL 8ea0e9a40cefa53568071f2137bac996898f9bd486cfb5cfcf8bb49590816833f37878f10caabffb9d3127e047f00c916b8830594a485ebe16fb9fe6fc834c95 |
56 |
-DIST postgresql-9.4.6.tar.bz2 17734946 SHA256 cbce1f4d01a6142c5d8bebe125623c5198ec04f363da7dd3d3b3a4100b4140a6 SHA512 03e2c68ec7fb40b4886885136692e96ed5d7e50ead8ebd094ede402eeb8ed94a791357e8eff2776a2e4a537ced3d900e032779a33c1fbd920588d89f8b6705ee WHIRLPOOL d25073985dc9974064175bf8b90f7a18368882c8d62fdb403183121452624bfb50c10c181bdc4b6a076d515dc29e081cf913793653f04ced98a48640dab9b3ff |
57 |
DIST postgresql-9.4.7.tar.bz2 17746987 SHA256 cc795e6c35b30e697e5891e3056376af685f848a4e67fab1702e74a2385f81e0 SHA512 e61d74a4a9caeb7d4a3fb9509b37aaeb5bd563d61d20739edd777ec990c92011286a7485f275178f9f8c1ebb8c84a98290e2b5351b11e0f9a1baa781f323e374 WHIRLPOOL 2ae25affc35e12fd250161585bc5cf318930d9864c9fccbf44c9bd697933aa75860467256b811501947c0fad8c6cdc0622889e9991904a4db9fda2d19efa2b37 |
58 |
-DIST postgresql-9.4.8.tar.bz2 17740626 SHA256 4a10640e180e0d9adb587bc25a82dcce6bf507b033637e7fb9d4eeffa33a6b4c SHA512 d1cc8a02ed7eb0af365479cee43b3cd33fade69e07eb82343cd562efda5a460e405836e1fb2492a8cb22a71d14038216868cb48694400b3c31a56c4aee0bcac4 WHIRLPOOL f799c60ed6b753b0db197796718c4508669bf7cc64c34d97fe023c38e09c5e38801da5bac91c3392d690e0e8829beff6b4d3b3fa610119ce0a24a1e8fe9486f7 |
59 |
DIST postgresql-9.4.9.tar.bz2 17763281 SHA256 c120a62e90214c20d9160da3ca3fbaec97d5f1656f1dd033f60e7297b7a1e1c9 SHA512 980b1a8828d07151e67793367ea0ee08e4231cd76d9b20b4f4bca08a7976ee82a3aea51ce801a4107680c8203f8ebdb4cf5a0a6aaf93d580c9f337658d50819b WHIRLPOOL f5c9922bd12008a87a6ed0b8efaf8280d1a3ce8ef47fc853efd4d4d1a754e878f9cb27a4049cfb6d7c50968083e1286670a9b79588e29e127bd3f96b927f4999 |
60 |
-DIST postgresql-9.5.1.tar.bz2 18441638 SHA256 6b309d8506a39773a752ff074f47656e5424576ea090b04a24fe1725958c5bd2 SHA512 fcb2b3bde51c4152b3a72764de1f9b4e607cb591571ed5bc1187b2c6938c33e21bdd512694a969a03c046e4889a129bb0e75fa676d55a1a1e77142da1e984192 WHIRLPOOL 2fdbae2c58ce4255b514055ada220b25269a01719c202e1d1ae86d408fd56b523f1a4e16ef5abd675b0fbf0675c1eabca7d0f5f2e8fdb9cdc3a3d98e7b755aeb |
61 |
DIST postgresql-9.5.2.tar.bz2 18446616 SHA256 f8d132e464506b551ef498719f18cfe9d777709c7a1589dc360afc0b20e47c41 SHA512 ba31dddee8a960a4b1a97394eae5ea7efaa5e74e21c755882efcef90404676c6052dff55f40b585932e4f752cbcda5ceac0e29d601ea6651cfbab7a49190381a WHIRLPOOL 0b9abe3a5b3933485e5d0b2c08daa20d421e5920ae5b4640b36971463915d7e7b2767575564d80bb5dfa3a353c646c9c4ca8e483dfd64df39370774e76fa1cee |
62 |
-DIST postgresql-9.5.3.tar.bz2 18455394 SHA256 7385c01dc58acba8d7ac4e6ad42782bd7c0b59272862a3a3d5fe378d4503a0b4 SHA512 7275dbde0c1b795f3a491d45464c69a97fbfd0e66a7fe62ba00e97747908df0df19bf65e104e10e049e31a8cf484c9d9f29eb75ff6a3875cb087559e25744c29 WHIRLPOOL 60536e8e244ecdd1e307a8daa1bcd5728bd070b5c08063bf48fbcb93673c012497e257fe3c4f15019b0674e82724e48105d2799926572910370efb17dbbd6e21 |
63 |
DIST postgresql-9.5.4.tar.bz2 18496299 SHA256 cf5e571164ad66028ecd7dd8819e3765470d45bcd440d258b686be7e69c76ed0 SHA512 e5220bc967443d54b9dcff7ba5aefccedbe1c219f953eb0d67254c709d52b0e647d1dc473446640804165b596fc5b75fa4ff8d63696123b87d8096c3a7795c34 WHIRLPOOL d429d853062b2d2f8e999db1733b3206020f2d521401e0510376213ecaa2049b6d87987b9ee999ab81faacf6ce65ddfdcf43b0922fc23e91961594956c556e0d |
64 |
DIST postgresql-9.6.0.tar.bz2 19157472 SHA256 3b5fe9634b80a4511aac1832a087586a7caa8c3413619562bdda009a015863ce SHA512 46ec903eed13bf5fb5510d56e4814405ba4510c9e5f43c533189b6ed07c7955dba326107ae0dbeebb5abdd00b7007971ca5d7213274bd653d8d4295f93e6cbf8 WHIRLPOOL aa5d30d41aca14eee3a00d5f3805b28187278a538c0f00b9cb70fad9e2c401dedc797512b9851a04c67f21e7b8cfbcf6d2f85c1486795803840b7111cccb2b19 |
65 |
|
66 |
diff --git a/dev-db/postgresql/postgresql-9.0.23-r1.ebuild b/dev-db/postgresql/postgresql-9.0.23-r1.ebuild |
67 |
deleted file mode 100644 |
68 |
index 508707d..00000000 |
69 |
--- a/dev-db/postgresql/postgresql-9.0.23-r1.ebuild |
70 |
+++ /dev/null |
71 |
@@ -1,380 +0,0 @@ |
72 |
-# Copyright 1999-2016 Gentoo Foundation |
73 |
-# Distributed under the terms of the GNU General Public License v2 |
74 |
-# $Id$ |
75 |
- |
76 |
-EAPI="5" |
77 |
- |
78 |
-# Testing within Portage's environment is broken, and the patch no |
79 |
-# longer applies cleanly. |
80 |
-RESTRICT="test" |
81 |
- |
82 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
83 |
- |
84 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
85 |
- systemd user versionator |
86 |
- |
87 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
88 |
- |
89 |
-SLOT="$(get_version_component_range 1-2)" |
90 |
- |
91 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
92 |
- |
93 |
-LICENSE="POSTGRESQL GPL-2" |
94 |
-DESCRIPTION="PostgreSQL RDBMS" |
95 |
-HOMEPAGE="http://www.postgresql.org/" |
96 |
- |
97 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
98 |
- zh_CN zh_TW" |
99 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
100 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
101 |
- |
102 |
-for lingua in ${LINGUAS}; do |
103 |
- IUSE+=" linguas_${lingua}" |
104 |
-done |
105 |
- |
106 |
-wanted_languages() { |
107 |
- local enable_langs |
108 |
- |
109 |
- for lingua in ${LINGUAS} ; do |
110 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
111 |
- done |
112 |
- |
113 |
- echo -n ${enable_langs} |
114 |
-} |
115 |
- |
116 |
-CDEPEND=" |
117 |
->=app-eselect/eselect-postgresql-1.2.0 |
118 |
-sys-apps/less |
119 |
-virtual/libintl |
120 |
-kerberos? ( virtual/krb5 ) |
121 |
-ldap? ( net-nds/openldap ) |
122 |
-pam? ( virtual/pam ) |
123 |
-perl? ( >=dev-lang/perl-5.8:= ) |
124 |
-python? ( ${PYTHON_DEPS} ) |
125 |
-readline? ( sys-libs/readline:0= ) |
126 |
-ssl? ( |
127 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
128 |
- libressl? ( dev-libs/libressl:= ) |
129 |
-) |
130 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
131 |
-uuid? ( dev-libs/ossp-uuid ) |
132 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
133 |
-zlib? ( sys-libs/zlib ) |
134 |
-" |
135 |
- |
136 |
-DEPEND="${CDEPEND} |
137 |
-!!<sys-apps/sandbox-2.0 |
138 |
-sys-devel/bison |
139 |
-sys-devel/flex |
140 |
-nls? ( sys-devel/gettext ) |
141 |
-xml? ( virtual/pkgconfig ) |
142 |
-" |
143 |
- |
144 |
-RDEPEND="${CDEPEND} |
145 |
-!dev-db/postgresql-docs:${SLOT} |
146 |
-!dev-db/postgresql-base:${SLOT} |
147 |
-!dev-db/postgresql-server:${SLOT} |
148 |
-selinux? ( sec-policy/selinux-postgresql ) |
149 |
-" |
150 |
- |
151 |
-pkg_setup() { |
152 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
153 |
- |
154 |
- enewgroup postgres 70 |
155 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
156 |
- |
157 |
- use python && python-single-r1_pkg_setup |
158 |
-} |
159 |
- |
160 |
-src_prepare() { |
161 |
- # Work around PPC{,64} compilation bug where bool is already defined |
162 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
163 |
- |
164 |
- # Set proper run directory |
165 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
166 |
- -i src/include/pg_config_manual.h || die |
167 |
- |
168 |
- epatch "${FILESDIR}/pg_ctl-exit-status.patch" |
169 |
- |
170 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
171 |
- |
172 |
- if use pam ; then |
173 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
174 |
- -i src/backend/libpq/auth.c || \ |
175 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
176 |
- fi |
177 |
- |
178 |
- epatch_user |
179 |
-} |
180 |
- |
181 |
-src_configure() { |
182 |
- case ${CHOST} in |
183 |
- *-darwin*|*-solaris*) |
184 |
- use nls && append-libs intl |
185 |
- ;; |
186 |
- esac |
187 |
- |
188 |
- export LDFLAGS_SL="${LDFLAGS}" |
189 |
- export LDFLAGS_EX="${LDFLAGS}" |
190 |
- |
191 |
- local PO="${EPREFIX%/}" |
192 |
- |
193 |
- econf \ |
194 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
195 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
196 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
197 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
198 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
199 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
200 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
201 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
202 |
- $(use_enable threads thread-safety) \ |
203 |
- $(use_with kerberos gssapi) \ |
204 |
- $(use_with kerberos krb5) \ |
205 |
- $(use_with ldap) \ |
206 |
- $(use_with pam) \ |
207 |
- $(use_with perl) \ |
208 |
- $(use_with python) \ |
209 |
- $(use_with readline) \ |
210 |
- $(use_with ssl openssl) \ |
211 |
- $(use_with tcl) \ |
212 |
- $(use_with uuid ossp-uuid) \ |
213 |
- $(use_with xml libxml) \ |
214 |
- $(use_with xml libxslt) \ |
215 |
- $(use_with zlib) \ |
216 |
- "$(use_enable nls nls "$(wanted_languages)")" |
217 |
-} |
218 |
- |
219 |
-src_compile() { |
220 |
- emake |
221 |
- emake -C contrib |
222 |
-} |
223 |
- |
224 |
-src_install() { |
225 |
- emake DESTDIR="${D}" install |
226 |
- emake DESTDIR="${D}" install -C contrib |
227 |
- |
228 |
- dodoc README HISTORY doc/{TODO,bug.template} |
229 |
- |
230 |
- # man pages are already built, but if we have the target make them, |
231 |
- # they'll be generated from source before being installed so we |
232 |
- # manually install man pages. |
233 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
234 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
235 |
- doins -r doc/src/sgml/man{1,3,7} |
236 |
- if ! use server; then |
237 |
- # Remove man pages for non-existent binaries |
238 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
239 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
240 |
- done |
241 |
- fi |
242 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
243 |
- |
244 |
- insinto /etc/postgresql-${SLOT} |
245 |
- newins src/bin/psql/psqlrc.sample psqlrc |
246 |
- |
247 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
248 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
249 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
250 |
- |
251 |
- use static-libs || find "${ED}" -name '*.a' -delete |
252 |
- |
253 |
- if use doc ; then |
254 |
- docinto html |
255 |
- dodoc doc/src/sgml/html/* |
256 |
- |
257 |
- docinto sgml |
258 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
259 |
- fi |
260 |
- |
261 |
- if use server; then |
262 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
263 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
264 |
- |
265 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
266 |
- "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT} |
267 |
- |
268 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
269 |
- "${FILESDIR}/${PN}.service" | \ |
270 |
- systemd_newunit - ${PN}-${SLOT}.service |
271 |
- |
272 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
273 |
- |
274 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
275 |
- |
276 |
- if use prefix ; then |
277 |
- keepdir /run/postgresql |
278 |
- fperms 0775 /run/postgresql |
279 |
- fi |
280 |
- fi |
281 |
-} |
282 |
- |
283 |
-pkg_postinst() { |
284 |
- postgresql-config update |
285 |
- |
286 |
- elog "If you need a global psqlrc-file, you can place it in:" |
287 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
288 |
- |
289 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
290 |
- elog |
291 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
292 |
- elog "following command in all active shells to pick up changes to the default" |
293 |
- elog "environment:" |
294 |
- elog " source /etc/profile" |
295 |
- fi |
296 |
- |
297 |
- if use server ; then |
298 |
- elog |
299 |
- elog "Gentoo specific documentation:" |
300 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
301 |
- elog |
302 |
- elog "Official documentation:" |
303 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
304 |
- elog |
305 |
- elog "The default location of the Unix-domain socket is:" |
306 |
- elog " ${EROOT%/}/run/postgresql/" |
307 |
- elog |
308 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
309 |
- elog "so that it contains your preferred locale in:" |
310 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
311 |
- elog |
312 |
- elog "Then, execute the following command to setup the initial database" |
313 |
- elog "environment:" |
314 |
- elog " emerge --config =${CATEGORY}/${PF}" |
315 |
- fi |
316 |
-} |
317 |
- |
318 |
-pkg_prerm() { |
319 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
320 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
321 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
322 |
- |
323 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
324 |
- sleep 10 |
325 |
- eend 0 |
326 |
- fi |
327 |
-} |
328 |
- |
329 |
-pkg_postrm() { |
330 |
- postgresql-config update |
331 |
-} |
332 |
- |
333 |
-pkg_config() { |
334 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
335 |
- |
336 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
337 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
338 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
339 |
- [[ -z "${DATA_DIR}" ]] \ |
340 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
341 |
- |
342 |
- # environment.bz2 may not contain the same locale as the current system |
343 |
- # locale. Unset and source from the current system locale. |
344 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
345 |
- unset LANG |
346 |
- unset LC_CTYPE |
347 |
- unset LC_NUMERIC |
348 |
- unset LC_TIME |
349 |
- unset LC_COLLATE |
350 |
- unset LC_MONETARY |
351 |
- unset LC_MESSAGES |
352 |
- unset LC_ALL |
353 |
- source "${EROOT%/}/etc/env.d/02locale" |
354 |
- [ -n "${LANG}" ] && export LANG |
355 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
356 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
357 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
358 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
359 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
360 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
361 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
362 |
- fi |
363 |
- |
364 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
365 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
366 |
- einfo |
367 |
- einfo "Information on options that can be passed to initdb are found at:" |
368 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
369 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
370 |
- einfo |
371 |
- einfo "PG_INITDB_OPTS is currently set to:" |
372 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
373 |
- einfo " (none)" |
374 |
- else |
375 |
- einfo " ${PG_INITDB_OPTS}" |
376 |
- fi |
377 |
- einfo |
378 |
- einfo "Configuration files will be installed to:" |
379 |
- einfo " ${PGDATA}" |
380 |
- einfo |
381 |
- einfo "The database cluster will be created in:" |
382 |
- einfo " ${DATA_DIR}" |
383 |
- einfo |
384 |
- while [ "$correct" != "true" ] ; do |
385 |
- einfo "Are you ready to continue? (y/n)" |
386 |
- read answer |
387 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
388 |
- correct="true" |
389 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
390 |
- die "Aborting initialization." |
391 |
- else |
392 |
- echo "Answer not recognized" |
393 |
- fi |
394 |
- done |
395 |
- |
396 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
397 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
398 |
- eerror "Modify DATA_DIR to point to an empty directory." |
399 |
- die "${DATA_DIR} is not empty." |
400 |
- fi |
401 |
- |
402 |
- einfo "Creating the data directory ..." |
403 |
- if [[ ${EUID} == 0 ]] ; then |
404 |
- mkdir -p "${DATA_DIR}" |
405 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
406 |
- chmod 0700 "${DATA_DIR}" |
407 |
- fi |
408 |
- |
409 |
- einfo "Initializing the database ..." |
410 |
- |
411 |
- if [[ ${EUID} == 0 ]] ; then |
412 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
413 |
- else |
414 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
415 |
- fi |
416 |
- |
417 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
418 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
419 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
420 |
- fi |
421 |
- |
422 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
423 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
424 |
- # On the off-chance that you might need to work with UTF-8 encoded |
425 |
- # characters in PL/Perl |
426 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
427 |
- EOF |
428 |
- |
429 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
430 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
431 |
- einfo "by default. You can disable it in the cluster's:" |
432 |
- einfo " ${PGDATA%/}/postgresql.conf" |
433 |
- einfo |
434 |
- einfo "The PostgreSQL server, by default, will log events to:" |
435 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
436 |
- einfo |
437 |
- if use prefix ; then |
438 |
- einfo "The location of the configuration files have moved to:" |
439 |
- einfo " ${PGDATA}" |
440 |
- einfo "To start the server:" |
441 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
442 |
- einfo "To stop:" |
443 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
444 |
- einfo |
445 |
- einfo "Or move the configuration files back:" |
446 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
447 |
- else |
448 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
449 |
- einfo "instead of 'pg_ctl'." |
450 |
- fi |
451 |
-} |
452 |
|
453 |
diff --git a/dev-db/postgresql/postgresql-9.1.19-r1.ebuild b/dev-db/postgresql/postgresql-9.1.19-r1.ebuild |
454 |
deleted file mode 100644 |
455 |
index aeb559b..00000000 |
456 |
--- a/dev-db/postgresql/postgresql-9.1.19-r1.ebuild |
457 |
+++ /dev/null |
458 |
@@ -1,384 +0,0 @@ |
459 |
-# Copyright 1999-2016 Gentoo Foundation |
460 |
-# Distributed under the terms of the GNU General Public License v2 |
461 |
-# $Id$ |
462 |
- |
463 |
-EAPI="5" |
464 |
- |
465 |
-# Testing within Portage's environment is broken, and the patch no |
466 |
-# longer applies cleanly. |
467 |
-RESTRICT="test" |
468 |
- |
469 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
470 |
- |
471 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
472 |
- systemd user versionator |
473 |
- |
474 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
475 |
- |
476 |
-SLOT="$(get_version_component_range 1-2)" |
477 |
- |
478 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
479 |
- |
480 |
-LICENSE="POSTGRESQL GPL-2" |
481 |
-DESCRIPTION="PostgreSQL RDBMS" |
482 |
-HOMEPAGE="http://www.postgresql.org/" |
483 |
- |
484 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
485 |
- zh_CN zh_TW" |
486 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
487 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
488 |
- |
489 |
-for lingua in ${LINGUAS}; do |
490 |
- IUSE+=" linguas_${lingua}" |
491 |
-done |
492 |
- |
493 |
-wanted_languages() { |
494 |
- local enable_langs |
495 |
- |
496 |
- for lingua in ${LINGUAS} ; do |
497 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
498 |
- done |
499 |
- |
500 |
- echo -n ${enable_langs} |
501 |
-} |
502 |
- |
503 |
-CDEPEND=" |
504 |
->=app-eselect/eselect-postgresql-1.2.0 |
505 |
-sys-apps/less |
506 |
-virtual/libintl |
507 |
-kerberos? ( virtual/krb5 ) |
508 |
-ldap? ( net-nds/openldap ) |
509 |
-pam? ( virtual/pam ) |
510 |
-perl? ( >=dev-lang/perl-5.8:= ) |
511 |
-python? ( ${PYTHON_DEPS} ) |
512 |
-readline? ( sys-libs/readline:0= ) |
513 |
-ssl? ( |
514 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
515 |
- libressl? ( dev-libs/libressl:= ) |
516 |
-) |
517 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
518 |
-uuid? ( dev-libs/ossp-uuid ) |
519 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
520 |
-zlib? ( sys-libs/zlib ) |
521 |
-" |
522 |
- |
523 |
-DEPEND="${CDEPEND} |
524 |
-!!<sys-apps/sandbox-2.0 |
525 |
-sys-devel/bison |
526 |
-sys-devel/flex |
527 |
-nls? ( sys-devel/gettext ) |
528 |
-xml? ( virtual/pkgconfig ) |
529 |
-" |
530 |
- |
531 |
-RDEPEND="${CDEPEND} |
532 |
-!dev-db/postgresql-docs:${SLOT} |
533 |
-!dev-db/postgresql-base:${SLOT} |
534 |
-!dev-db/postgresql-server:${SLOT} |
535 |
-selinux? ( sec-policy/selinux-postgresql ) |
536 |
-" |
537 |
- |
538 |
-pkg_setup() { |
539 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
540 |
- |
541 |
- enewgroup postgres 70 |
542 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
543 |
- |
544 |
- use python && python-single-r1_pkg_setup |
545 |
-} |
546 |
- |
547 |
-src_prepare() { |
548 |
- # Work around PPC{,64} compilation bug where bool is already defined |
549 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
550 |
- |
551 |
- # Set proper run directory |
552 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
553 |
- -i src/include/pg_config_manual.h || die |
554 |
- |
555 |
- epatch "${FILESDIR}/pg_ctl-exit-status.patch" |
556 |
- |
557 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
558 |
- |
559 |
- # Fix bug 486556 where the server would crash at start up because of |
560 |
- # an infinite loop caused by a self-referencing symlink. |
561 |
- epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch" |
562 |
- |
563 |
- if use pam ; then |
564 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
565 |
- -i src/backend/libpq/auth.c || \ |
566 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
567 |
- fi |
568 |
- |
569 |
- epatch_user |
570 |
-} |
571 |
- |
572 |
-src_configure() { |
573 |
- case ${CHOST} in |
574 |
- *-darwin*|*-solaris*) |
575 |
- use nls && append-libs intl |
576 |
- ;; |
577 |
- esac |
578 |
- |
579 |
- export LDFLAGS_SL="${LDFLAGS}" |
580 |
- export LDFLAGS_EX="${LDFLAGS}" |
581 |
- |
582 |
- local PO="${EPREFIX%/}" |
583 |
- |
584 |
- econf \ |
585 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
586 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
587 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
588 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
589 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
590 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
591 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
592 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
593 |
- $(use_enable threads thread-safety) \ |
594 |
- $(use_with kerberos gssapi) \ |
595 |
- $(use_with kerberos krb5) \ |
596 |
- $(use_with ldap) \ |
597 |
- $(use_with pam) \ |
598 |
- $(use_with perl) \ |
599 |
- $(use_with python) \ |
600 |
- $(use_with readline) \ |
601 |
- $(use_with ssl openssl) \ |
602 |
- $(use_with tcl) \ |
603 |
- $(use_with uuid ossp-uuid) \ |
604 |
- $(use_with xml libxml) \ |
605 |
- $(use_with xml libxslt) \ |
606 |
- $(use_with zlib) \ |
607 |
- "$(use_enable nls nls "$(wanted_languages)")" |
608 |
-} |
609 |
- |
610 |
-src_compile() { |
611 |
- emake |
612 |
- emake -C contrib |
613 |
-} |
614 |
- |
615 |
-src_install() { |
616 |
- emake DESTDIR="${D}" install |
617 |
- emake DESTDIR="${D}" install -C contrib |
618 |
- |
619 |
- dodoc README HISTORY doc/{TODO,bug.template} |
620 |
- |
621 |
- # man pages are already built, but if we have the target make them, |
622 |
- # they'll be generated from source before being installed so we |
623 |
- # manually install man pages. |
624 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
625 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
626 |
- doins -r doc/src/sgml/man{1,3,7} |
627 |
- if ! use server; then |
628 |
- # Remove man pages for non-existent binaries |
629 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
630 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
631 |
- done |
632 |
- fi |
633 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
634 |
- |
635 |
- insinto /etc/postgresql-${SLOT} |
636 |
- newins src/bin/psql/psqlrc.sample psqlrc |
637 |
- |
638 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
639 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
640 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
641 |
- |
642 |
- use static-libs || find "${ED}" -name '*.a' -delete |
643 |
- |
644 |
- if use doc ; then |
645 |
- docinto html |
646 |
- dodoc doc/src/sgml/html/* |
647 |
- |
648 |
- docinto sgml |
649 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
650 |
- fi |
651 |
- |
652 |
- if use server; then |
653 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
654 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
655 |
- |
656 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
657 |
- "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT} |
658 |
- |
659 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
660 |
- "${FILESDIR}/${PN}.service" | \ |
661 |
- systemd_newunit - ${PN}-${SLOT}.service |
662 |
- |
663 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
664 |
- |
665 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
666 |
- |
667 |
- if use prefix ; then |
668 |
- keepdir /run/postgresql |
669 |
- fperms 0775 /run/postgresql |
670 |
- fi |
671 |
- fi |
672 |
-} |
673 |
- |
674 |
-pkg_postinst() { |
675 |
- postgresql-config update |
676 |
- |
677 |
- elog "If you need a global psqlrc-file, you can place it in:" |
678 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
679 |
- |
680 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
681 |
- elog |
682 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
683 |
- elog "following command in all active shells to pick up changes to the default" |
684 |
- elog "environment:" |
685 |
- elog " source /etc/profile" |
686 |
- fi |
687 |
- |
688 |
- if use server ; then |
689 |
- elog |
690 |
- elog "Gentoo specific documentation:" |
691 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
692 |
- elog |
693 |
- elog "Official documentation:" |
694 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
695 |
- elog |
696 |
- elog "The default location of the Unix-domain socket is:" |
697 |
- elog " ${EROOT%/}/run/postgresql/" |
698 |
- elog |
699 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
700 |
- elog "so that it contains your preferred locale in:" |
701 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
702 |
- elog |
703 |
- elog "Then, execute the following command to setup the initial database" |
704 |
- elog "environment:" |
705 |
- elog " emerge --config =${CATEGORY}/${PF}" |
706 |
- fi |
707 |
-} |
708 |
- |
709 |
-pkg_prerm() { |
710 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
711 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
712 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
713 |
- |
714 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
715 |
- sleep 10 |
716 |
- eend 0 |
717 |
- fi |
718 |
-} |
719 |
- |
720 |
-pkg_postrm() { |
721 |
- postgresql-config update |
722 |
-} |
723 |
- |
724 |
-pkg_config() { |
725 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
726 |
- |
727 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
728 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
729 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
730 |
- [[ -z "${DATA_DIR}" ]] \ |
731 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
732 |
- |
733 |
- # environment.bz2 may not contain the same locale as the current system |
734 |
- # locale. Unset and source from the current system locale. |
735 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
736 |
- unset LANG |
737 |
- unset LC_CTYPE |
738 |
- unset LC_NUMERIC |
739 |
- unset LC_TIME |
740 |
- unset LC_COLLATE |
741 |
- unset LC_MONETARY |
742 |
- unset LC_MESSAGES |
743 |
- unset LC_ALL |
744 |
- source "${EROOT%/}/etc/env.d/02locale" |
745 |
- [ -n "${LANG}" ] && export LANG |
746 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
747 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
748 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
749 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
750 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
751 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
752 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
753 |
- fi |
754 |
- |
755 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
756 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
757 |
- einfo |
758 |
- einfo "Information on options that can be passed to initdb are found at:" |
759 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
760 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
761 |
- einfo |
762 |
- einfo "PG_INITDB_OPTS is currently set to:" |
763 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
764 |
- einfo " (none)" |
765 |
- else |
766 |
- einfo " ${PG_INITDB_OPTS}" |
767 |
- fi |
768 |
- einfo |
769 |
- einfo "Configuration files will be installed to:" |
770 |
- einfo " ${PGDATA}" |
771 |
- einfo |
772 |
- einfo "The database cluster will be created in:" |
773 |
- einfo " ${DATA_DIR}" |
774 |
- einfo |
775 |
- while [ "$correct" != "true" ] ; do |
776 |
- einfo "Are you ready to continue? (y/n)" |
777 |
- read answer |
778 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
779 |
- correct="true" |
780 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
781 |
- die "Aborting initialization." |
782 |
- else |
783 |
- echo "Answer not recognized" |
784 |
- fi |
785 |
- done |
786 |
- |
787 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
788 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
789 |
- eerror "Modify DATA_DIR to point to an empty directory." |
790 |
- die "${DATA_DIR} is not empty." |
791 |
- fi |
792 |
- |
793 |
- einfo "Creating the data directory ..." |
794 |
- if [[ ${EUID} == 0 ]] ; then |
795 |
- mkdir -p "${DATA_DIR}" |
796 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
797 |
- chmod 0700 "${DATA_DIR}" |
798 |
- fi |
799 |
- |
800 |
- einfo "Initializing the database ..." |
801 |
- |
802 |
- if [[ ${EUID} == 0 ]] ; then |
803 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
804 |
- else |
805 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
806 |
- fi |
807 |
- |
808 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
809 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
810 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
811 |
- fi |
812 |
- |
813 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
814 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
815 |
- # On the off-chance that you might need to work with UTF-8 encoded |
816 |
- # characters in PL/Perl |
817 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
818 |
- EOF |
819 |
- |
820 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
821 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
822 |
- einfo "by default. You can disable it in the cluster's:" |
823 |
- einfo " ${PGDATA%/}/postgresql.conf" |
824 |
- einfo |
825 |
- einfo "The PostgreSQL server, by default, will log events to:" |
826 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
827 |
- einfo |
828 |
- if use prefix ; then |
829 |
- einfo "The location of the configuration files have moved to:" |
830 |
- einfo " ${PGDATA}" |
831 |
- einfo "To start the server:" |
832 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
833 |
- einfo "To stop:" |
834 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
835 |
- einfo |
836 |
- einfo "Or move the configuration files back:" |
837 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
838 |
- else |
839 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
840 |
- einfo "instead of 'pg_ctl'." |
841 |
- fi |
842 |
-} |
843 |
|
844 |
diff --git a/dev-db/postgresql/postgresql-9.1.20.ebuild b/dev-db/postgresql/postgresql-9.1.20.ebuild |
845 |
deleted file mode 100644 |
846 |
index aeb559b..00000000 |
847 |
--- a/dev-db/postgresql/postgresql-9.1.20.ebuild |
848 |
+++ /dev/null |
849 |
@@ -1,384 +0,0 @@ |
850 |
-# Copyright 1999-2016 Gentoo Foundation |
851 |
-# Distributed under the terms of the GNU General Public License v2 |
852 |
-# $Id$ |
853 |
- |
854 |
-EAPI="5" |
855 |
- |
856 |
-# Testing within Portage's environment is broken, and the patch no |
857 |
-# longer applies cleanly. |
858 |
-RESTRICT="test" |
859 |
- |
860 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
861 |
- |
862 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
863 |
- systemd user versionator |
864 |
- |
865 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
866 |
- |
867 |
-SLOT="$(get_version_component_range 1-2)" |
868 |
- |
869 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
870 |
- |
871 |
-LICENSE="POSTGRESQL GPL-2" |
872 |
-DESCRIPTION="PostgreSQL RDBMS" |
873 |
-HOMEPAGE="http://www.postgresql.org/" |
874 |
- |
875 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
876 |
- zh_CN zh_TW" |
877 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
878 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
879 |
- |
880 |
-for lingua in ${LINGUAS}; do |
881 |
- IUSE+=" linguas_${lingua}" |
882 |
-done |
883 |
- |
884 |
-wanted_languages() { |
885 |
- local enable_langs |
886 |
- |
887 |
- for lingua in ${LINGUAS} ; do |
888 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
889 |
- done |
890 |
- |
891 |
- echo -n ${enable_langs} |
892 |
-} |
893 |
- |
894 |
-CDEPEND=" |
895 |
->=app-eselect/eselect-postgresql-1.2.0 |
896 |
-sys-apps/less |
897 |
-virtual/libintl |
898 |
-kerberos? ( virtual/krb5 ) |
899 |
-ldap? ( net-nds/openldap ) |
900 |
-pam? ( virtual/pam ) |
901 |
-perl? ( >=dev-lang/perl-5.8:= ) |
902 |
-python? ( ${PYTHON_DEPS} ) |
903 |
-readline? ( sys-libs/readline:0= ) |
904 |
-ssl? ( |
905 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
906 |
- libressl? ( dev-libs/libressl:= ) |
907 |
-) |
908 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
909 |
-uuid? ( dev-libs/ossp-uuid ) |
910 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
911 |
-zlib? ( sys-libs/zlib ) |
912 |
-" |
913 |
- |
914 |
-DEPEND="${CDEPEND} |
915 |
-!!<sys-apps/sandbox-2.0 |
916 |
-sys-devel/bison |
917 |
-sys-devel/flex |
918 |
-nls? ( sys-devel/gettext ) |
919 |
-xml? ( virtual/pkgconfig ) |
920 |
-" |
921 |
- |
922 |
-RDEPEND="${CDEPEND} |
923 |
-!dev-db/postgresql-docs:${SLOT} |
924 |
-!dev-db/postgresql-base:${SLOT} |
925 |
-!dev-db/postgresql-server:${SLOT} |
926 |
-selinux? ( sec-policy/selinux-postgresql ) |
927 |
-" |
928 |
- |
929 |
-pkg_setup() { |
930 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
931 |
- |
932 |
- enewgroup postgres 70 |
933 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
934 |
- |
935 |
- use python && python-single-r1_pkg_setup |
936 |
-} |
937 |
- |
938 |
-src_prepare() { |
939 |
- # Work around PPC{,64} compilation bug where bool is already defined |
940 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
941 |
- |
942 |
- # Set proper run directory |
943 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
944 |
- -i src/include/pg_config_manual.h || die |
945 |
- |
946 |
- epatch "${FILESDIR}/pg_ctl-exit-status.patch" |
947 |
- |
948 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
949 |
- |
950 |
- # Fix bug 486556 where the server would crash at start up because of |
951 |
- # an infinite loop caused by a self-referencing symlink. |
952 |
- epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch" |
953 |
- |
954 |
- if use pam ; then |
955 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
956 |
- -i src/backend/libpq/auth.c || \ |
957 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
958 |
- fi |
959 |
- |
960 |
- epatch_user |
961 |
-} |
962 |
- |
963 |
-src_configure() { |
964 |
- case ${CHOST} in |
965 |
- *-darwin*|*-solaris*) |
966 |
- use nls && append-libs intl |
967 |
- ;; |
968 |
- esac |
969 |
- |
970 |
- export LDFLAGS_SL="${LDFLAGS}" |
971 |
- export LDFLAGS_EX="${LDFLAGS}" |
972 |
- |
973 |
- local PO="${EPREFIX%/}" |
974 |
- |
975 |
- econf \ |
976 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
977 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
978 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
979 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
980 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
981 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
982 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
983 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
984 |
- $(use_enable threads thread-safety) \ |
985 |
- $(use_with kerberos gssapi) \ |
986 |
- $(use_with kerberos krb5) \ |
987 |
- $(use_with ldap) \ |
988 |
- $(use_with pam) \ |
989 |
- $(use_with perl) \ |
990 |
- $(use_with python) \ |
991 |
- $(use_with readline) \ |
992 |
- $(use_with ssl openssl) \ |
993 |
- $(use_with tcl) \ |
994 |
- $(use_with uuid ossp-uuid) \ |
995 |
- $(use_with xml libxml) \ |
996 |
- $(use_with xml libxslt) \ |
997 |
- $(use_with zlib) \ |
998 |
- "$(use_enable nls nls "$(wanted_languages)")" |
999 |
-} |
1000 |
- |
1001 |
-src_compile() { |
1002 |
- emake |
1003 |
- emake -C contrib |
1004 |
-} |
1005 |
- |
1006 |
-src_install() { |
1007 |
- emake DESTDIR="${D}" install |
1008 |
- emake DESTDIR="${D}" install -C contrib |
1009 |
- |
1010 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1011 |
- |
1012 |
- # man pages are already built, but if we have the target make them, |
1013 |
- # they'll be generated from source before being installed so we |
1014 |
- # manually install man pages. |
1015 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1016 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1017 |
- doins -r doc/src/sgml/man{1,3,7} |
1018 |
- if ! use server; then |
1019 |
- # Remove man pages for non-existent binaries |
1020 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
1021 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1022 |
- done |
1023 |
- fi |
1024 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1025 |
- |
1026 |
- insinto /etc/postgresql-${SLOT} |
1027 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1028 |
- |
1029 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
1030 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
1031 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
1032 |
- |
1033 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1034 |
- |
1035 |
- if use doc ; then |
1036 |
- docinto html |
1037 |
- dodoc doc/src/sgml/html/* |
1038 |
- |
1039 |
- docinto sgml |
1040 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
1041 |
- fi |
1042 |
- |
1043 |
- if use server; then |
1044 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1045 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
1046 |
- |
1047 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1048 |
- "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT} |
1049 |
- |
1050 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1051 |
- "${FILESDIR}/${PN}.service" | \ |
1052 |
- systemd_newunit - ${PN}-${SLOT}.service |
1053 |
- |
1054 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1055 |
- |
1056 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1057 |
- |
1058 |
- if use prefix ; then |
1059 |
- keepdir /run/postgresql |
1060 |
- fperms 0775 /run/postgresql |
1061 |
- fi |
1062 |
- fi |
1063 |
-} |
1064 |
- |
1065 |
-pkg_postinst() { |
1066 |
- postgresql-config update |
1067 |
- |
1068 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1069 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
1070 |
- |
1071 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
1072 |
- elog |
1073 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
1074 |
- elog "following command in all active shells to pick up changes to the default" |
1075 |
- elog "environment:" |
1076 |
- elog " source /etc/profile" |
1077 |
- fi |
1078 |
- |
1079 |
- if use server ; then |
1080 |
- elog |
1081 |
- elog "Gentoo specific documentation:" |
1082 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1083 |
- elog |
1084 |
- elog "Official documentation:" |
1085 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
1086 |
- elog |
1087 |
- elog "The default location of the Unix-domain socket is:" |
1088 |
- elog " ${EROOT%/}/run/postgresql/" |
1089 |
- elog |
1090 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1091 |
- elog "so that it contains your preferred locale in:" |
1092 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1093 |
- elog |
1094 |
- elog "Then, execute the following command to setup the initial database" |
1095 |
- elog "environment:" |
1096 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1097 |
- fi |
1098 |
-} |
1099 |
- |
1100 |
-pkg_prerm() { |
1101 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1102 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1103 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1104 |
- |
1105 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1106 |
- sleep 10 |
1107 |
- eend 0 |
1108 |
- fi |
1109 |
-} |
1110 |
- |
1111 |
-pkg_postrm() { |
1112 |
- postgresql-config update |
1113 |
-} |
1114 |
- |
1115 |
-pkg_config() { |
1116 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1117 |
- |
1118 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1119 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1120 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
1121 |
- [[ -z "${DATA_DIR}" ]] \ |
1122 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
1123 |
- |
1124 |
- # environment.bz2 may not contain the same locale as the current system |
1125 |
- # locale. Unset and source from the current system locale. |
1126 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
1127 |
- unset LANG |
1128 |
- unset LC_CTYPE |
1129 |
- unset LC_NUMERIC |
1130 |
- unset LC_TIME |
1131 |
- unset LC_COLLATE |
1132 |
- unset LC_MONETARY |
1133 |
- unset LC_MESSAGES |
1134 |
- unset LC_ALL |
1135 |
- source "${EROOT%/}/etc/env.d/02locale" |
1136 |
- [ -n "${LANG}" ] && export LANG |
1137 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1138 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1139 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1140 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1141 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1142 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1143 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1144 |
- fi |
1145 |
- |
1146 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1147 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1148 |
- einfo |
1149 |
- einfo "Information on options that can be passed to initdb are found at:" |
1150 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1151 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1152 |
- einfo |
1153 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1154 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1155 |
- einfo " (none)" |
1156 |
- else |
1157 |
- einfo " ${PG_INITDB_OPTS}" |
1158 |
- fi |
1159 |
- einfo |
1160 |
- einfo "Configuration files will be installed to:" |
1161 |
- einfo " ${PGDATA}" |
1162 |
- einfo |
1163 |
- einfo "The database cluster will be created in:" |
1164 |
- einfo " ${DATA_DIR}" |
1165 |
- einfo |
1166 |
- while [ "$correct" != "true" ] ; do |
1167 |
- einfo "Are you ready to continue? (y/n)" |
1168 |
- read answer |
1169 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
1170 |
- correct="true" |
1171 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
1172 |
- die "Aborting initialization." |
1173 |
- else |
1174 |
- echo "Answer not recognized" |
1175 |
- fi |
1176 |
- done |
1177 |
- |
1178 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1179 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1180 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1181 |
- die "${DATA_DIR} is not empty." |
1182 |
- fi |
1183 |
- |
1184 |
- einfo "Creating the data directory ..." |
1185 |
- if [[ ${EUID} == 0 ]] ; then |
1186 |
- mkdir -p "${DATA_DIR}" |
1187 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1188 |
- chmod 0700 "${DATA_DIR}" |
1189 |
- fi |
1190 |
- |
1191 |
- einfo "Initializing the database ..." |
1192 |
- |
1193 |
- if [[ ${EUID} == 0 ]] ; then |
1194 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1195 |
- else |
1196 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1197 |
- fi |
1198 |
- |
1199 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1200 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1201 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1202 |
- fi |
1203 |
- |
1204 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1205 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1206 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1207 |
- # characters in PL/Perl |
1208 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1209 |
- EOF |
1210 |
- |
1211 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1212 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1213 |
- einfo "by default. You can disable it in the cluster's:" |
1214 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1215 |
- einfo |
1216 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1217 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1218 |
- einfo |
1219 |
- if use prefix ; then |
1220 |
- einfo "The location of the configuration files have moved to:" |
1221 |
- einfo " ${PGDATA}" |
1222 |
- einfo "To start the server:" |
1223 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1224 |
- einfo "To stop:" |
1225 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1226 |
- einfo |
1227 |
- einfo "Or move the configuration files back:" |
1228 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1229 |
- else |
1230 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1231 |
- einfo "instead of 'pg_ctl'." |
1232 |
- fi |
1233 |
-} |
1234 |
|
1235 |
diff --git a/dev-db/postgresql/postgresql-9.1.22.ebuild b/dev-db/postgresql/postgresql-9.1.22.ebuild |
1236 |
deleted file mode 100644 |
1237 |
index 6e1262f..00000000 |
1238 |
--- a/dev-db/postgresql/postgresql-9.1.22.ebuild |
1239 |
+++ /dev/null |
1240 |
@@ -1,384 +0,0 @@ |
1241 |
-# Copyright 1999-2016 Gentoo Foundation |
1242 |
-# Distributed under the terms of the GNU General Public License v2 |
1243 |
-# $Id$ |
1244 |
- |
1245 |
-EAPI="5" |
1246 |
- |
1247 |
-# Testing within Portage's environment is broken, and the patch no |
1248 |
-# longer applies cleanly. |
1249 |
-RESTRICT="test" |
1250 |
- |
1251 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
1252 |
- |
1253 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
1254 |
- systemd user versionator |
1255 |
- |
1256 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
1257 |
- |
1258 |
-SLOT="$(get_version_component_range 1-2)" |
1259 |
- |
1260 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
1261 |
- |
1262 |
-LICENSE="POSTGRESQL GPL-2" |
1263 |
-DESCRIPTION="PostgreSQL RDBMS" |
1264 |
-HOMEPAGE="http://www.postgresql.org/" |
1265 |
- |
1266 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
1267 |
- zh_CN zh_TW" |
1268 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
1269 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
1270 |
- |
1271 |
-for lingua in ${LINGUAS}; do |
1272 |
- IUSE+=" linguas_${lingua}" |
1273 |
-done |
1274 |
- |
1275 |
-wanted_languages() { |
1276 |
- local enable_langs |
1277 |
- |
1278 |
- for lingua in ${LINGUAS} ; do |
1279 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
1280 |
- done |
1281 |
- |
1282 |
- echo -n ${enable_langs} |
1283 |
-} |
1284 |
- |
1285 |
-CDEPEND=" |
1286 |
->=app-eselect/eselect-postgresql-1.2.0 |
1287 |
-sys-apps/less |
1288 |
-virtual/libintl |
1289 |
-kerberos? ( virtual/krb5 ) |
1290 |
-ldap? ( net-nds/openldap ) |
1291 |
-pam? ( virtual/pam ) |
1292 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1293 |
-python? ( ${PYTHON_DEPS} ) |
1294 |
-readline? ( sys-libs/readline:0= ) |
1295 |
-ssl? ( |
1296 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1297 |
- libressl? ( dev-libs/libressl:= ) |
1298 |
-) |
1299 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1300 |
-uuid? ( dev-libs/ossp-uuid ) |
1301 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1302 |
-zlib? ( sys-libs/zlib ) |
1303 |
-" |
1304 |
- |
1305 |
-DEPEND="${CDEPEND} |
1306 |
-!!<sys-apps/sandbox-2.0 |
1307 |
-sys-devel/bison |
1308 |
-sys-devel/flex |
1309 |
-nls? ( sys-devel/gettext ) |
1310 |
-xml? ( virtual/pkgconfig ) |
1311 |
-" |
1312 |
- |
1313 |
-RDEPEND="${CDEPEND} |
1314 |
-!dev-db/postgresql-docs:${SLOT} |
1315 |
-!dev-db/postgresql-base:${SLOT} |
1316 |
-!dev-db/postgresql-server:${SLOT} |
1317 |
-selinux? ( sec-policy/selinux-postgresql ) |
1318 |
-" |
1319 |
- |
1320 |
-pkg_setup() { |
1321 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1322 |
- |
1323 |
- enewgroup postgres 70 |
1324 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
1325 |
- |
1326 |
- use python && python-single-r1_pkg_setup |
1327 |
-} |
1328 |
- |
1329 |
-src_prepare() { |
1330 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1331 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1332 |
- |
1333 |
- # Set proper run directory |
1334 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1335 |
- -i src/include/pg_config_manual.h || die |
1336 |
- |
1337 |
- epatch "${FILESDIR}/pg_ctl-exit-status.patch" |
1338 |
- |
1339 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
1340 |
- |
1341 |
- # Fix bug 486556 where the server would crash at start up because of |
1342 |
- # an infinite loop caused by a self-referencing symlink. |
1343 |
- epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch" |
1344 |
- |
1345 |
- if use pam ; then |
1346 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1347 |
- -i src/backend/libpq/auth.c || \ |
1348 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1349 |
- fi |
1350 |
- |
1351 |
- epatch_user |
1352 |
-} |
1353 |
- |
1354 |
-src_configure() { |
1355 |
- case ${CHOST} in |
1356 |
- *-darwin*|*-solaris*) |
1357 |
- use nls && append-libs intl |
1358 |
- ;; |
1359 |
- esac |
1360 |
- |
1361 |
- export LDFLAGS_SL="${LDFLAGS}" |
1362 |
- export LDFLAGS_EX="${LDFLAGS}" |
1363 |
- |
1364 |
- local PO="${EPREFIX%/}" |
1365 |
- |
1366 |
- econf \ |
1367 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1368 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1369 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
1370 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1371 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1372 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1373 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1374 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
1375 |
- $(use_enable threads thread-safety) \ |
1376 |
- $(use_with kerberos gssapi) \ |
1377 |
- $(use_with kerberos krb5) \ |
1378 |
- $(use_with ldap) \ |
1379 |
- $(use_with pam) \ |
1380 |
- $(use_with perl) \ |
1381 |
- $(use_with python) \ |
1382 |
- $(use_with readline) \ |
1383 |
- $(use_with ssl openssl) \ |
1384 |
- $(use_with tcl) \ |
1385 |
- $(use_with uuid ossp-uuid) \ |
1386 |
- $(use_with xml libxml) \ |
1387 |
- $(use_with xml libxslt) \ |
1388 |
- $(use_with zlib) \ |
1389 |
- "$(use_enable nls nls "$(wanted_languages)")" |
1390 |
-} |
1391 |
- |
1392 |
-src_compile() { |
1393 |
- emake |
1394 |
- emake -C contrib |
1395 |
-} |
1396 |
- |
1397 |
-src_install() { |
1398 |
- emake DESTDIR="${D}" install |
1399 |
- emake DESTDIR="${D}" install -C contrib |
1400 |
- |
1401 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1402 |
- |
1403 |
- # man pages are already built, but if we have the target make them, |
1404 |
- # they'll be generated from source before being installed so we |
1405 |
- # manually install man pages. |
1406 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1407 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1408 |
- doins -r doc/src/sgml/man{1,3,7} |
1409 |
- if ! use server; then |
1410 |
- # Remove man pages for non-existent binaries |
1411 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
1412 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1413 |
- done |
1414 |
- fi |
1415 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1416 |
- |
1417 |
- insinto /etc/postgresql-${SLOT} |
1418 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1419 |
- |
1420 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
1421 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
1422 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
1423 |
- |
1424 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1425 |
- |
1426 |
- if use doc ; then |
1427 |
- docinto html |
1428 |
- dodoc doc/src/sgml/html/* |
1429 |
- |
1430 |
- docinto sgml |
1431 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
1432 |
- fi |
1433 |
- |
1434 |
- if use server; then |
1435 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1436 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
1437 |
- |
1438 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1439 |
- "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT} |
1440 |
- |
1441 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1442 |
- "${FILESDIR}/${PN}.service" | \ |
1443 |
- systemd_newunit - ${PN}-${SLOT}.service |
1444 |
- |
1445 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1446 |
- |
1447 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1448 |
- |
1449 |
- if use prefix ; then |
1450 |
- keepdir /run/postgresql |
1451 |
- fperms 0775 /run/postgresql |
1452 |
- fi |
1453 |
- fi |
1454 |
-} |
1455 |
- |
1456 |
-pkg_postinst() { |
1457 |
- postgresql-config update |
1458 |
- |
1459 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1460 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
1461 |
- |
1462 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
1463 |
- elog |
1464 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
1465 |
- elog "following command in all active shells to pick up changes to the default" |
1466 |
- elog "environment:" |
1467 |
- elog " source /etc/profile" |
1468 |
- fi |
1469 |
- |
1470 |
- if use server ; then |
1471 |
- elog |
1472 |
- elog "Gentoo specific documentation:" |
1473 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1474 |
- elog |
1475 |
- elog "Official documentation:" |
1476 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
1477 |
- elog |
1478 |
- elog "The default location of the Unix-domain socket is:" |
1479 |
- elog " ${EROOT%/}/run/postgresql/" |
1480 |
- elog |
1481 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1482 |
- elog "so that it contains your preferred locale in:" |
1483 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1484 |
- elog |
1485 |
- elog "Then, execute the following command to setup the initial database" |
1486 |
- elog "environment:" |
1487 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1488 |
- fi |
1489 |
-} |
1490 |
- |
1491 |
-pkg_prerm() { |
1492 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1493 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1494 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1495 |
- |
1496 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1497 |
- sleep 10 |
1498 |
- eend 0 |
1499 |
- fi |
1500 |
-} |
1501 |
- |
1502 |
-pkg_postrm() { |
1503 |
- postgresql-config update |
1504 |
-} |
1505 |
- |
1506 |
-pkg_config() { |
1507 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1508 |
- |
1509 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1510 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1511 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
1512 |
- [[ -z "${DATA_DIR}" ]] \ |
1513 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
1514 |
- |
1515 |
- # environment.bz2 may not contain the same locale as the current system |
1516 |
- # locale. Unset and source from the current system locale. |
1517 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
1518 |
- unset LANG |
1519 |
- unset LC_CTYPE |
1520 |
- unset LC_NUMERIC |
1521 |
- unset LC_TIME |
1522 |
- unset LC_COLLATE |
1523 |
- unset LC_MONETARY |
1524 |
- unset LC_MESSAGES |
1525 |
- unset LC_ALL |
1526 |
- source "${EROOT%/}/etc/env.d/02locale" |
1527 |
- [ -n "${LANG}" ] && export LANG |
1528 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1529 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1530 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1531 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1532 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1533 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1534 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1535 |
- fi |
1536 |
- |
1537 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1538 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1539 |
- einfo |
1540 |
- einfo "Information on options that can be passed to initdb are found at:" |
1541 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1542 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1543 |
- einfo |
1544 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1545 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1546 |
- einfo " (none)" |
1547 |
- else |
1548 |
- einfo " ${PG_INITDB_OPTS}" |
1549 |
- fi |
1550 |
- einfo |
1551 |
- einfo "Configuration files will be installed to:" |
1552 |
- einfo " ${PGDATA}" |
1553 |
- einfo |
1554 |
- einfo "The database cluster will be created in:" |
1555 |
- einfo " ${DATA_DIR}" |
1556 |
- einfo |
1557 |
- while [ "$correct" != "true" ] ; do |
1558 |
- einfo "Are you ready to continue? (y/n)" |
1559 |
- read answer |
1560 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
1561 |
- correct="true" |
1562 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
1563 |
- die "Aborting initialization." |
1564 |
- else |
1565 |
- echo "Answer not recognized" |
1566 |
- fi |
1567 |
- done |
1568 |
- |
1569 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1570 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1571 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1572 |
- die "${DATA_DIR} is not empty." |
1573 |
- fi |
1574 |
- |
1575 |
- einfo "Creating the data directory ..." |
1576 |
- if [[ ${EUID} == 0 ]] ; then |
1577 |
- mkdir -p "${DATA_DIR}" |
1578 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1579 |
- chmod 0700 "${DATA_DIR}" |
1580 |
- fi |
1581 |
- |
1582 |
- einfo "Initializing the database ..." |
1583 |
- |
1584 |
- if [[ ${EUID} == 0 ]] ; then |
1585 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1586 |
- else |
1587 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1588 |
- fi |
1589 |
- |
1590 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1591 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1592 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1593 |
- fi |
1594 |
- |
1595 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1596 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1597 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1598 |
- # characters in PL/Perl |
1599 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1600 |
- EOF |
1601 |
- |
1602 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1603 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1604 |
- einfo "by default. You can disable it in the cluster's:" |
1605 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1606 |
- einfo |
1607 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1608 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1609 |
- einfo |
1610 |
- if use prefix ; then |
1611 |
- einfo "The location of the configuration files have moved to:" |
1612 |
- einfo " ${PGDATA}" |
1613 |
- einfo "To start the server:" |
1614 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
1615 |
- einfo "To stop:" |
1616 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
1617 |
- einfo |
1618 |
- einfo "Or move the configuration files back:" |
1619 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
1620 |
- else |
1621 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
1622 |
- einfo "instead of 'pg_ctl'." |
1623 |
- fi |
1624 |
-} |
1625 |
|
1626 |
diff --git a/dev-db/postgresql/postgresql-9.2.14-r1.ebuild b/dev-db/postgresql/postgresql-9.2.14-r1.ebuild |
1627 |
deleted file mode 100644 |
1628 |
index f76e1e3..00000000 |
1629 |
--- a/dev-db/postgresql/postgresql-9.2.14-r1.ebuild |
1630 |
+++ /dev/null |
1631 |
@@ -1,394 +0,0 @@ |
1632 |
-# Copyright 1999-2016 Gentoo Foundation |
1633 |
-# Distributed under the terms of the GNU General Public License v2 |
1634 |
-# $Id$ |
1635 |
- |
1636 |
-EAPI="5" |
1637 |
- |
1638 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
1639 |
- |
1640 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
1641 |
- systemd user versionator |
1642 |
- |
1643 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
1644 |
- |
1645 |
-SLOT="$(get_version_component_range 1-2)" |
1646 |
- |
1647 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
1648 |
- |
1649 |
-LICENSE="POSTGRESQL GPL-2" |
1650 |
-DESCRIPTION="PostgreSQL RDBMS" |
1651 |
-HOMEPAGE="http://www.postgresql.org/" |
1652 |
- |
1653 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
1654 |
- zh_CN zh_TW" |
1655 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
1656 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
1657 |
- |
1658 |
-for lingua in ${LINGUAS}; do |
1659 |
- IUSE+=" linguas_${lingua}" |
1660 |
-done |
1661 |
- |
1662 |
-wanted_languages() { |
1663 |
- local enable_langs |
1664 |
- |
1665 |
- for lingua in ${LINGUAS} ; do |
1666 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
1667 |
- done |
1668 |
- |
1669 |
- echo -n ${enable_langs} |
1670 |
-} |
1671 |
- |
1672 |
-CDEPEND=" |
1673 |
->=app-eselect/eselect-postgresql-1.2.0 |
1674 |
-sys-apps/less |
1675 |
-virtual/libintl |
1676 |
-kerberos? ( virtual/krb5 ) |
1677 |
-ldap? ( net-nds/openldap ) |
1678 |
-pam? ( virtual/pam ) |
1679 |
-perl? ( >=dev-lang/perl-5.8:= ) |
1680 |
-python? ( ${PYTHON_DEPS} ) |
1681 |
-readline? ( sys-libs/readline:0= ) |
1682 |
-ssl? ( |
1683 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
1684 |
- libressl? ( dev-libs/libressl:= ) |
1685 |
-) |
1686 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
1687 |
-uuid? ( dev-libs/ossp-uuid ) |
1688 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
1689 |
-zlib? ( sys-libs/zlib ) |
1690 |
-" |
1691 |
- |
1692 |
-DEPEND="${CDEPEND} |
1693 |
-!!<sys-apps/sandbox-2.0 |
1694 |
-sys-devel/bison |
1695 |
-sys-devel/flex |
1696 |
-nls? ( sys-devel/gettext ) |
1697 |
-xml? ( virtual/pkgconfig ) |
1698 |
-" |
1699 |
- |
1700 |
-RDEPEND="${CDEPEND} |
1701 |
-!dev-db/postgresql-docs:${SLOT} |
1702 |
-!dev-db/postgresql-base:${SLOT} |
1703 |
-!dev-db/postgresql-server:${SLOT} |
1704 |
-selinux? ( sec-policy/selinux-postgresql ) |
1705 |
-" |
1706 |
- |
1707 |
-pkg_setup() { |
1708 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
1709 |
- |
1710 |
- enewgroup postgres 70 |
1711 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
1712 |
- |
1713 |
- use python && python-single-r1_pkg_setup |
1714 |
-} |
1715 |
- |
1716 |
-src_prepare() { |
1717 |
- # Work around PPC{,64} compilation bug where bool is already defined |
1718 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
1719 |
- |
1720 |
- # Set proper run directory |
1721 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
1722 |
- -i src/include/pg_config_manual.h || die |
1723 |
- |
1724 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
1725 |
- |
1726 |
- # Fix bug 486556 where the server would crash at start up because of |
1727 |
- # an infinite loop caused by a self-referencing symlink. |
1728 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
1729 |
- |
1730 |
- if use pam ; then |
1731 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
1732 |
- -i src/backend/libpq/auth.c || \ |
1733 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
1734 |
- fi |
1735 |
- |
1736 |
- epatch_user |
1737 |
-} |
1738 |
- |
1739 |
-src_configure() { |
1740 |
- case ${CHOST} in |
1741 |
- *-darwin*|*-solaris*) |
1742 |
- use nls && append-libs intl |
1743 |
- ;; |
1744 |
- esac |
1745 |
- |
1746 |
- export LDFLAGS_SL="${LDFLAGS}" |
1747 |
- export LDFLAGS_EX="${LDFLAGS}" |
1748 |
- |
1749 |
- local PO="${EPREFIX%/}" |
1750 |
- |
1751 |
- econf \ |
1752 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
1753 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
1754 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
1755 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
1756 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
1757 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
1758 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
1759 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
1760 |
- $(use_enable threads thread-safety) \ |
1761 |
- $(use_with kerberos gssapi) \ |
1762 |
- $(use_with kerberos krb5) \ |
1763 |
- $(use_with ldap) \ |
1764 |
- $(use_with pam) \ |
1765 |
- $(use_with perl) \ |
1766 |
- $(use_with python) \ |
1767 |
- $(use_with readline) \ |
1768 |
- $(use_with ssl openssl) \ |
1769 |
- $(use_with tcl) \ |
1770 |
- $(use_with uuid ossp-uuid) \ |
1771 |
- $(use_with xml libxml) \ |
1772 |
- $(use_with xml libxslt) \ |
1773 |
- $(use_with zlib) \ |
1774 |
- "$(use_enable nls nls "$(wanted_languages)")" |
1775 |
-} |
1776 |
- |
1777 |
-src_compile() { |
1778 |
- emake |
1779 |
- emake -C contrib |
1780 |
-} |
1781 |
- |
1782 |
-src_install() { |
1783 |
- emake DESTDIR="${D}" install |
1784 |
- emake DESTDIR="${D}" install -C contrib |
1785 |
- |
1786 |
- dodoc README HISTORY doc/{TODO,bug.template} |
1787 |
- |
1788 |
- # man pages are already built, but if we have the target make them, |
1789 |
- # they'll be generated from source before being installed so we |
1790 |
- # manually install man pages. |
1791 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
1792 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
1793 |
- doins -r doc/src/sgml/man{1,3,7} |
1794 |
- if ! use server; then |
1795 |
- # Remove man pages for non-existent binaries |
1796 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
1797 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
1798 |
- done |
1799 |
- fi |
1800 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
1801 |
- |
1802 |
- insinto /etc/postgresql-${SLOT} |
1803 |
- newins src/bin/psql/psqlrc.sample psqlrc |
1804 |
- |
1805 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
1806 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
1807 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
1808 |
- |
1809 |
- use static-libs || find "${ED}" -name '*.a' -delete |
1810 |
- |
1811 |
- if use doc ; then |
1812 |
- docinto html |
1813 |
- dodoc doc/src/sgml/html/* |
1814 |
- |
1815 |
- docinto sgml |
1816 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
1817 |
- fi |
1818 |
- |
1819 |
- if use server; then |
1820 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1821 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
1822 |
- |
1823 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1824 |
- "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} |
1825 |
- |
1826 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
1827 |
- "${FILESDIR}/${PN}.service" | \ |
1828 |
- systemd_newunit - ${PN}-${SLOT}.service |
1829 |
- |
1830 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
1831 |
- |
1832 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
1833 |
- |
1834 |
- if use prefix ; then |
1835 |
- keepdir /run/postgresql |
1836 |
- fperms 0775 /run/postgresql |
1837 |
- fi |
1838 |
- fi |
1839 |
-} |
1840 |
- |
1841 |
-pkg_postinst() { |
1842 |
- postgresql-config update |
1843 |
- |
1844 |
- elog "If you need a global psqlrc-file, you can place it in:" |
1845 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
1846 |
- |
1847 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
1848 |
- elog |
1849 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
1850 |
- elog "following command in all active shells to pick up changes to the default" |
1851 |
- elog "environment:" |
1852 |
- elog " source /etc/profile" |
1853 |
- fi |
1854 |
- |
1855 |
- if use server ; then |
1856 |
- elog |
1857 |
- elog "Gentoo specific documentation:" |
1858 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
1859 |
- elog |
1860 |
- elog "Official documentation:" |
1861 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
1862 |
- elog |
1863 |
- elog "The default location of the Unix-domain socket is:" |
1864 |
- elog " ${EROOT%/}/run/postgresql/" |
1865 |
- elog |
1866 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
1867 |
- elog "so that it contains your preferred locale in:" |
1868 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1869 |
- elog |
1870 |
- elog "Then, execute the following command to setup the initial database" |
1871 |
- elog "environment:" |
1872 |
- elog " emerge --config =${CATEGORY}/${PF}" |
1873 |
- fi |
1874 |
-} |
1875 |
- |
1876 |
-pkg_prerm() { |
1877 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
1878 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
1879 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
1880 |
- |
1881 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
1882 |
- sleep 10 |
1883 |
- eend 0 |
1884 |
- fi |
1885 |
-} |
1886 |
- |
1887 |
-pkg_postrm() { |
1888 |
- postgresql-config update |
1889 |
-} |
1890 |
- |
1891 |
-pkg_config() { |
1892 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
1893 |
- |
1894 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
1895 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1896 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
1897 |
- [[ -z "${DATA_DIR}" ]] \ |
1898 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
1899 |
- |
1900 |
- # environment.bz2 may not contain the same locale as the current system |
1901 |
- # locale. Unset and source from the current system locale. |
1902 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
1903 |
- unset LANG |
1904 |
- unset LC_CTYPE |
1905 |
- unset LC_NUMERIC |
1906 |
- unset LC_TIME |
1907 |
- unset LC_COLLATE |
1908 |
- unset LC_MONETARY |
1909 |
- unset LC_MESSAGES |
1910 |
- unset LC_ALL |
1911 |
- source "${EROOT%/}/etc/env.d/02locale" |
1912 |
- [ -n "${LANG}" ] && export LANG |
1913 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
1914 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
1915 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
1916 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
1917 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
1918 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
1919 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
1920 |
- fi |
1921 |
- |
1922 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
1923 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
1924 |
- einfo |
1925 |
- einfo "Information on options that can be passed to initdb are found at:" |
1926 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
1927 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
1928 |
- einfo |
1929 |
- einfo "PG_INITDB_OPTS is currently set to:" |
1930 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
1931 |
- einfo " (none)" |
1932 |
- else |
1933 |
- einfo " ${PG_INITDB_OPTS}" |
1934 |
- fi |
1935 |
- einfo |
1936 |
- einfo "Configuration files will be installed to:" |
1937 |
- einfo " ${PGDATA}" |
1938 |
- einfo |
1939 |
- einfo "The database cluster will be created in:" |
1940 |
- einfo " ${DATA_DIR}" |
1941 |
- einfo |
1942 |
- while [ "$correct" != "true" ] ; do |
1943 |
- einfo "Are you ready to continue? (y/n)" |
1944 |
- read answer |
1945 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
1946 |
- correct="true" |
1947 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
1948 |
- die "Aborting initialization." |
1949 |
- else |
1950 |
- echo "Answer not recognized" |
1951 |
- fi |
1952 |
- done |
1953 |
- |
1954 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
1955 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
1956 |
- eerror "Modify DATA_DIR to point to an empty directory." |
1957 |
- die "${DATA_DIR} is not empty." |
1958 |
- fi |
1959 |
- |
1960 |
- einfo "Creating the data directory ..." |
1961 |
- if [[ ${EUID} == 0 ]] ; then |
1962 |
- mkdir -p "${DATA_DIR}" |
1963 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
1964 |
- chmod 0700 "${DATA_DIR}" |
1965 |
- fi |
1966 |
- |
1967 |
- einfo "Initializing the database ..." |
1968 |
- |
1969 |
- if [[ ${EUID} == 0 ]] ; then |
1970 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
1971 |
- else |
1972 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
1973 |
- fi |
1974 |
- |
1975 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
1976 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
1977 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
1978 |
- fi |
1979 |
- |
1980 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
1981 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
1982 |
- # On the off-chance that you might need to work with UTF-8 encoded |
1983 |
- # characters in PL/Perl |
1984 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
1985 |
- EOF |
1986 |
- |
1987 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
1988 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
1989 |
- einfo "by default. You can disable it in the cluster's:" |
1990 |
- einfo " ${PGDATA%/}/postgresql.conf" |
1991 |
- einfo |
1992 |
- einfo "The PostgreSQL server, by default, will log events to:" |
1993 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
1994 |
- einfo |
1995 |
- if use prefix ; then |
1996 |
- einfo "The location of the configuration files have moved to:" |
1997 |
- einfo " ${PGDATA}" |
1998 |
- einfo "To start the server:" |
1999 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2000 |
- einfo "To stop:" |
2001 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2002 |
- einfo |
2003 |
- einfo "Or move the configuration files back:" |
2004 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2005 |
- else |
2006 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2007 |
- einfo "instead of 'pg_ctl'." |
2008 |
- fi |
2009 |
-} |
2010 |
- |
2011 |
-src_test() { |
2012 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2013 |
- emake check |
2014 |
- |
2015 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2016 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2017 |
- else |
2018 |
- use server || \ |
2019 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2020 |
- [[ ${UID} -eq 0 ]] || \ |
2021 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2022 |
- |
2023 |
- ewarn 'Skipping.' |
2024 |
- fi |
2025 |
-} |
2026 |
|
2027 |
diff --git a/dev-db/postgresql/postgresql-9.2.15.ebuild b/dev-db/postgresql/postgresql-9.2.15.ebuild |
2028 |
deleted file mode 100644 |
2029 |
index f76e1e3..00000000 |
2030 |
--- a/dev-db/postgresql/postgresql-9.2.15.ebuild |
2031 |
+++ /dev/null |
2032 |
@@ -1,394 +0,0 @@ |
2033 |
-# Copyright 1999-2016 Gentoo Foundation |
2034 |
-# Distributed under the terms of the GNU General Public License v2 |
2035 |
-# $Id$ |
2036 |
- |
2037 |
-EAPI="5" |
2038 |
- |
2039 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
2040 |
- |
2041 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
2042 |
- systemd user versionator |
2043 |
- |
2044 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
2045 |
- |
2046 |
-SLOT="$(get_version_component_range 1-2)" |
2047 |
- |
2048 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
2049 |
- |
2050 |
-LICENSE="POSTGRESQL GPL-2" |
2051 |
-DESCRIPTION="PostgreSQL RDBMS" |
2052 |
-HOMEPAGE="http://www.postgresql.org/" |
2053 |
- |
2054 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
2055 |
- zh_CN zh_TW" |
2056 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
2057 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
2058 |
- |
2059 |
-for lingua in ${LINGUAS}; do |
2060 |
- IUSE+=" linguas_${lingua}" |
2061 |
-done |
2062 |
- |
2063 |
-wanted_languages() { |
2064 |
- local enable_langs |
2065 |
- |
2066 |
- for lingua in ${LINGUAS} ; do |
2067 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
2068 |
- done |
2069 |
- |
2070 |
- echo -n ${enable_langs} |
2071 |
-} |
2072 |
- |
2073 |
-CDEPEND=" |
2074 |
->=app-eselect/eselect-postgresql-1.2.0 |
2075 |
-sys-apps/less |
2076 |
-virtual/libintl |
2077 |
-kerberos? ( virtual/krb5 ) |
2078 |
-ldap? ( net-nds/openldap ) |
2079 |
-pam? ( virtual/pam ) |
2080 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2081 |
-python? ( ${PYTHON_DEPS} ) |
2082 |
-readline? ( sys-libs/readline:0= ) |
2083 |
-ssl? ( |
2084 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2085 |
- libressl? ( dev-libs/libressl:= ) |
2086 |
-) |
2087 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2088 |
-uuid? ( dev-libs/ossp-uuid ) |
2089 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2090 |
-zlib? ( sys-libs/zlib ) |
2091 |
-" |
2092 |
- |
2093 |
-DEPEND="${CDEPEND} |
2094 |
-!!<sys-apps/sandbox-2.0 |
2095 |
-sys-devel/bison |
2096 |
-sys-devel/flex |
2097 |
-nls? ( sys-devel/gettext ) |
2098 |
-xml? ( virtual/pkgconfig ) |
2099 |
-" |
2100 |
- |
2101 |
-RDEPEND="${CDEPEND} |
2102 |
-!dev-db/postgresql-docs:${SLOT} |
2103 |
-!dev-db/postgresql-base:${SLOT} |
2104 |
-!dev-db/postgresql-server:${SLOT} |
2105 |
-selinux? ( sec-policy/selinux-postgresql ) |
2106 |
-" |
2107 |
- |
2108 |
-pkg_setup() { |
2109 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2110 |
- |
2111 |
- enewgroup postgres 70 |
2112 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
2113 |
- |
2114 |
- use python && python-single-r1_pkg_setup |
2115 |
-} |
2116 |
- |
2117 |
-src_prepare() { |
2118 |
- # Work around PPC{,64} compilation bug where bool is already defined |
2119 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
2120 |
- |
2121 |
- # Set proper run directory |
2122 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2123 |
- -i src/include/pg_config_manual.h || die |
2124 |
- |
2125 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
2126 |
- |
2127 |
- # Fix bug 486556 where the server would crash at start up because of |
2128 |
- # an infinite loop caused by a self-referencing symlink. |
2129 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
2130 |
- |
2131 |
- if use pam ; then |
2132 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2133 |
- -i src/backend/libpq/auth.c || \ |
2134 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2135 |
- fi |
2136 |
- |
2137 |
- epatch_user |
2138 |
-} |
2139 |
- |
2140 |
-src_configure() { |
2141 |
- case ${CHOST} in |
2142 |
- *-darwin*|*-solaris*) |
2143 |
- use nls && append-libs intl |
2144 |
- ;; |
2145 |
- esac |
2146 |
- |
2147 |
- export LDFLAGS_SL="${LDFLAGS}" |
2148 |
- export LDFLAGS_EX="${LDFLAGS}" |
2149 |
- |
2150 |
- local PO="${EPREFIX%/}" |
2151 |
- |
2152 |
- econf \ |
2153 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2154 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2155 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
2156 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2157 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2158 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2159 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2160 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
2161 |
- $(use_enable threads thread-safety) \ |
2162 |
- $(use_with kerberos gssapi) \ |
2163 |
- $(use_with kerberos krb5) \ |
2164 |
- $(use_with ldap) \ |
2165 |
- $(use_with pam) \ |
2166 |
- $(use_with perl) \ |
2167 |
- $(use_with python) \ |
2168 |
- $(use_with readline) \ |
2169 |
- $(use_with ssl openssl) \ |
2170 |
- $(use_with tcl) \ |
2171 |
- $(use_with uuid ossp-uuid) \ |
2172 |
- $(use_with xml libxml) \ |
2173 |
- $(use_with xml libxslt) \ |
2174 |
- $(use_with zlib) \ |
2175 |
- "$(use_enable nls nls "$(wanted_languages)")" |
2176 |
-} |
2177 |
- |
2178 |
-src_compile() { |
2179 |
- emake |
2180 |
- emake -C contrib |
2181 |
-} |
2182 |
- |
2183 |
-src_install() { |
2184 |
- emake DESTDIR="${D}" install |
2185 |
- emake DESTDIR="${D}" install -C contrib |
2186 |
- |
2187 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2188 |
- |
2189 |
- # man pages are already built, but if we have the target make them, |
2190 |
- # they'll be generated from source before being installed so we |
2191 |
- # manually install man pages. |
2192 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2193 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2194 |
- doins -r doc/src/sgml/man{1,3,7} |
2195 |
- if ! use server; then |
2196 |
- # Remove man pages for non-existent binaries |
2197 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
2198 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2199 |
- done |
2200 |
- fi |
2201 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2202 |
- |
2203 |
- insinto /etc/postgresql-${SLOT} |
2204 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2205 |
- |
2206 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
2207 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
2208 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
2209 |
- |
2210 |
- use static-libs || find "${ED}" -name '*.a' -delete |
2211 |
- |
2212 |
- if use doc ; then |
2213 |
- docinto html |
2214 |
- dodoc doc/src/sgml/html/* |
2215 |
- |
2216 |
- docinto sgml |
2217 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
2218 |
- fi |
2219 |
- |
2220 |
- if use server; then |
2221 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2222 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
2223 |
- |
2224 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2225 |
- "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} |
2226 |
- |
2227 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2228 |
- "${FILESDIR}/${PN}.service" | \ |
2229 |
- systemd_newunit - ${PN}-${SLOT}.service |
2230 |
- |
2231 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2232 |
- |
2233 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2234 |
- |
2235 |
- if use prefix ; then |
2236 |
- keepdir /run/postgresql |
2237 |
- fperms 0775 /run/postgresql |
2238 |
- fi |
2239 |
- fi |
2240 |
-} |
2241 |
- |
2242 |
-pkg_postinst() { |
2243 |
- postgresql-config update |
2244 |
- |
2245 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2246 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
2247 |
- |
2248 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
2249 |
- elog |
2250 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
2251 |
- elog "following command in all active shells to pick up changes to the default" |
2252 |
- elog "environment:" |
2253 |
- elog " source /etc/profile" |
2254 |
- fi |
2255 |
- |
2256 |
- if use server ; then |
2257 |
- elog |
2258 |
- elog "Gentoo specific documentation:" |
2259 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2260 |
- elog |
2261 |
- elog "Official documentation:" |
2262 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
2263 |
- elog |
2264 |
- elog "The default location of the Unix-domain socket is:" |
2265 |
- elog " ${EROOT%/}/run/postgresql/" |
2266 |
- elog |
2267 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2268 |
- elog "so that it contains your preferred locale in:" |
2269 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2270 |
- elog |
2271 |
- elog "Then, execute the following command to setup the initial database" |
2272 |
- elog "environment:" |
2273 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2274 |
- fi |
2275 |
-} |
2276 |
- |
2277 |
-pkg_prerm() { |
2278 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2279 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2280 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2281 |
- |
2282 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2283 |
- sleep 10 |
2284 |
- eend 0 |
2285 |
- fi |
2286 |
-} |
2287 |
- |
2288 |
-pkg_postrm() { |
2289 |
- postgresql-config update |
2290 |
-} |
2291 |
- |
2292 |
-pkg_config() { |
2293 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2294 |
- |
2295 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2296 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2297 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
2298 |
- [[ -z "${DATA_DIR}" ]] \ |
2299 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
2300 |
- |
2301 |
- # environment.bz2 may not contain the same locale as the current system |
2302 |
- # locale. Unset and source from the current system locale. |
2303 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
2304 |
- unset LANG |
2305 |
- unset LC_CTYPE |
2306 |
- unset LC_NUMERIC |
2307 |
- unset LC_TIME |
2308 |
- unset LC_COLLATE |
2309 |
- unset LC_MONETARY |
2310 |
- unset LC_MESSAGES |
2311 |
- unset LC_ALL |
2312 |
- source "${EROOT%/}/etc/env.d/02locale" |
2313 |
- [ -n "${LANG}" ] && export LANG |
2314 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2315 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2316 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2317 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2318 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2319 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2320 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2321 |
- fi |
2322 |
- |
2323 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2324 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2325 |
- einfo |
2326 |
- einfo "Information on options that can be passed to initdb are found at:" |
2327 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2328 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2329 |
- einfo |
2330 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2331 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2332 |
- einfo " (none)" |
2333 |
- else |
2334 |
- einfo " ${PG_INITDB_OPTS}" |
2335 |
- fi |
2336 |
- einfo |
2337 |
- einfo "Configuration files will be installed to:" |
2338 |
- einfo " ${PGDATA}" |
2339 |
- einfo |
2340 |
- einfo "The database cluster will be created in:" |
2341 |
- einfo " ${DATA_DIR}" |
2342 |
- einfo |
2343 |
- while [ "$correct" != "true" ] ; do |
2344 |
- einfo "Are you ready to continue? (y/n)" |
2345 |
- read answer |
2346 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
2347 |
- correct="true" |
2348 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
2349 |
- die "Aborting initialization." |
2350 |
- else |
2351 |
- echo "Answer not recognized" |
2352 |
- fi |
2353 |
- done |
2354 |
- |
2355 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2356 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2357 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2358 |
- die "${DATA_DIR} is not empty." |
2359 |
- fi |
2360 |
- |
2361 |
- einfo "Creating the data directory ..." |
2362 |
- if [[ ${EUID} == 0 ]] ; then |
2363 |
- mkdir -p "${DATA_DIR}" |
2364 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
2365 |
- chmod 0700 "${DATA_DIR}" |
2366 |
- fi |
2367 |
- |
2368 |
- einfo "Initializing the database ..." |
2369 |
- |
2370 |
- if [[ ${EUID} == 0 ]] ; then |
2371 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2372 |
- else |
2373 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2374 |
- fi |
2375 |
- |
2376 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2377 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2378 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2379 |
- fi |
2380 |
- |
2381 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2382 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2383 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2384 |
- # characters in PL/Perl |
2385 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2386 |
- EOF |
2387 |
- |
2388 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2389 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2390 |
- einfo "by default. You can disable it in the cluster's:" |
2391 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2392 |
- einfo |
2393 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2394 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2395 |
- einfo |
2396 |
- if use prefix ; then |
2397 |
- einfo "The location of the configuration files have moved to:" |
2398 |
- einfo " ${PGDATA}" |
2399 |
- einfo "To start the server:" |
2400 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2401 |
- einfo "To stop:" |
2402 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2403 |
- einfo |
2404 |
- einfo "Or move the configuration files back:" |
2405 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2406 |
- else |
2407 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2408 |
- einfo "instead of 'pg_ctl'." |
2409 |
- fi |
2410 |
-} |
2411 |
- |
2412 |
-src_test() { |
2413 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2414 |
- emake check |
2415 |
- |
2416 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2417 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2418 |
- else |
2419 |
- use server || \ |
2420 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2421 |
- [[ ${UID} -eq 0 ]] || \ |
2422 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2423 |
- |
2424 |
- ewarn 'Skipping.' |
2425 |
- fi |
2426 |
-} |
2427 |
|
2428 |
diff --git a/dev-db/postgresql/postgresql-9.2.17.ebuild b/dev-db/postgresql/postgresql-9.2.17.ebuild |
2429 |
deleted file mode 100644 |
2430 |
index 73fdad1..00000000 |
2431 |
--- a/dev-db/postgresql/postgresql-9.2.17.ebuild |
2432 |
+++ /dev/null |
2433 |
@@ -1,394 +0,0 @@ |
2434 |
-# Copyright 1999-2016 Gentoo Foundation |
2435 |
-# Distributed under the terms of the GNU General Public License v2 |
2436 |
-# $Id$ |
2437 |
- |
2438 |
-EAPI="5" |
2439 |
- |
2440 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
2441 |
- |
2442 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
2443 |
- systemd user versionator |
2444 |
- |
2445 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
2446 |
- |
2447 |
-SLOT="$(get_version_component_range 1-2)" |
2448 |
- |
2449 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
2450 |
- |
2451 |
-LICENSE="POSTGRESQL GPL-2" |
2452 |
-DESCRIPTION="PostgreSQL RDBMS" |
2453 |
-HOMEPAGE="http://www.postgresql.org/" |
2454 |
- |
2455 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
2456 |
- zh_CN zh_TW" |
2457 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
2458 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
2459 |
- |
2460 |
-for lingua in ${LINGUAS}; do |
2461 |
- IUSE+=" linguas_${lingua}" |
2462 |
-done |
2463 |
- |
2464 |
-wanted_languages() { |
2465 |
- local enable_langs |
2466 |
- |
2467 |
- for lingua in ${LINGUAS} ; do |
2468 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
2469 |
- done |
2470 |
- |
2471 |
- echo -n ${enable_langs} |
2472 |
-} |
2473 |
- |
2474 |
-CDEPEND=" |
2475 |
->=app-eselect/eselect-postgresql-1.2.0 |
2476 |
-sys-apps/less |
2477 |
-virtual/libintl |
2478 |
-kerberos? ( virtual/krb5 ) |
2479 |
-ldap? ( net-nds/openldap ) |
2480 |
-pam? ( virtual/pam ) |
2481 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2482 |
-python? ( ${PYTHON_DEPS} ) |
2483 |
-readline? ( sys-libs/readline:0= ) |
2484 |
-ssl? ( |
2485 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2486 |
- libressl? ( dev-libs/libressl:= ) |
2487 |
-) |
2488 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2489 |
-uuid? ( dev-libs/ossp-uuid ) |
2490 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2491 |
-zlib? ( sys-libs/zlib ) |
2492 |
-" |
2493 |
- |
2494 |
-DEPEND="${CDEPEND} |
2495 |
-!!<sys-apps/sandbox-2.0 |
2496 |
-sys-devel/bison |
2497 |
-sys-devel/flex |
2498 |
-nls? ( sys-devel/gettext ) |
2499 |
-xml? ( virtual/pkgconfig ) |
2500 |
-" |
2501 |
- |
2502 |
-RDEPEND="${CDEPEND} |
2503 |
-!dev-db/postgresql-docs:${SLOT} |
2504 |
-!dev-db/postgresql-base:${SLOT} |
2505 |
-!dev-db/postgresql-server:${SLOT} |
2506 |
-selinux? ( sec-policy/selinux-postgresql ) |
2507 |
-" |
2508 |
- |
2509 |
-pkg_setup() { |
2510 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2511 |
- |
2512 |
- enewgroup postgres 70 |
2513 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
2514 |
- |
2515 |
- use python && python-single-r1_pkg_setup |
2516 |
-} |
2517 |
- |
2518 |
-src_prepare() { |
2519 |
- # Work around PPC{,64} compilation bug where bool is already defined |
2520 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
2521 |
- |
2522 |
- # Set proper run directory |
2523 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2524 |
- -i src/include/pg_config_manual.h || die |
2525 |
- |
2526 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
2527 |
- |
2528 |
- # Fix bug 486556 where the server would crash at start up because of |
2529 |
- # an infinite loop caused by a self-referencing symlink. |
2530 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
2531 |
- |
2532 |
- if use pam ; then |
2533 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2534 |
- -i src/backend/libpq/auth.c || \ |
2535 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2536 |
- fi |
2537 |
- |
2538 |
- epatch_user |
2539 |
-} |
2540 |
- |
2541 |
-src_configure() { |
2542 |
- case ${CHOST} in |
2543 |
- *-darwin*|*-solaris*) |
2544 |
- use nls && append-libs intl |
2545 |
- ;; |
2546 |
- esac |
2547 |
- |
2548 |
- export LDFLAGS_SL="${LDFLAGS}" |
2549 |
- export LDFLAGS_EX="${LDFLAGS}" |
2550 |
- |
2551 |
- local PO="${EPREFIX%/}" |
2552 |
- |
2553 |
- econf \ |
2554 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2555 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2556 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
2557 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2558 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2559 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2560 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2561 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
2562 |
- $(use_enable threads thread-safety) \ |
2563 |
- $(use_with kerberos gssapi) \ |
2564 |
- $(use_with kerberos krb5) \ |
2565 |
- $(use_with ldap) \ |
2566 |
- $(use_with pam) \ |
2567 |
- $(use_with perl) \ |
2568 |
- $(use_with python) \ |
2569 |
- $(use_with readline) \ |
2570 |
- $(use_with ssl openssl) \ |
2571 |
- $(use_with tcl) \ |
2572 |
- $(use_with uuid ossp-uuid) \ |
2573 |
- $(use_with xml libxml) \ |
2574 |
- $(use_with xml libxslt) \ |
2575 |
- $(use_with zlib) \ |
2576 |
- "$(use_enable nls nls "$(wanted_languages)")" |
2577 |
-} |
2578 |
- |
2579 |
-src_compile() { |
2580 |
- emake |
2581 |
- emake -C contrib |
2582 |
-} |
2583 |
- |
2584 |
-src_install() { |
2585 |
- emake DESTDIR="${D}" install |
2586 |
- emake DESTDIR="${D}" install -C contrib |
2587 |
- |
2588 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2589 |
- |
2590 |
- # man pages are already built, but if we have the target make them, |
2591 |
- # they'll be generated from source before being installed so we |
2592 |
- # manually install man pages. |
2593 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2594 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2595 |
- doins -r doc/src/sgml/man{1,3,7} |
2596 |
- if ! use server; then |
2597 |
- # Remove man pages for non-existent binaries |
2598 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
2599 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
2600 |
- done |
2601 |
- fi |
2602 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
2603 |
- |
2604 |
- insinto /etc/postgresql-${SLOT} |
2605 |
- newins src/bin/psql/psqlrc.sample psqlrc |
2606 |
- |
2607 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
2608 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
2609 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
2610 |
- |
2611 |
- use static-libs || find "${ED}" -name '*.a' -delete |
2612 |
- |
2613 |
- if use doc ; then |
2614 |
- docinto html |
2615 |
- dodoc doc/src/sgml/html/* |
2616 |
- |
2617 |
- docinto sgml |
2618 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
2619 |
- fi |
2620 |
- |
2621 |
- if use server; then |
2622 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2623 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
2624 |
- |
2625 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2626 |
- "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT} |
2627 |
- |
2628 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
2629 |
- "${FILESDIR}/${PN}.service" | \ |
2630 |
- systemd_newunit - ${PN}-${SLOT}.service |
2631 |
- |
2632 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
2633 |
- |
2634 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
2635 |
- |
2636 |
- if use prefix ; then |
2637 |
- keepdir /run/postgresql |
2638 |
- fperms 0775 /run/postgresql |
2639 |
- fi |
2640 |
- fi |
2641 |
-} |
2642 |
- |
2643 |
-pkg_postinst() { |
2644 |
- postgresql-config update |
2645 |
- |
2646 |
- elog "If you need a global psqlrc-file, you can place it in:" |
2647 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
2648 |
- |
2649 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
2650 |
- elog |
2651 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
2652 |
- elog "following command in all active shells to pick up changes to the default" |
2653 |
- elog "environment:" |
2654 |
- elog " source /etc/profile" |
2655 |
- fi |
2656 |
- |
2657 |
- if use server ; then |
2658 |
- elog |
2659 |
- elog "Gentoo specific documentation:" |
2660 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
2661 |
- elog |
2662 |
- elog "Official documentation:" |
2663 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
2664 |
- elog |
2665 |
- elog "The default location of the Unix-domain socket is:" |
2666 |
- elog " ${EROOT%/}/run/postgresql/" |
2667 |
- elog |
2668 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
2669 |
- elog "so that it contains your preferred locale in:" |
2670 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2671 |
- elog |
2672 |
- elog "Then, execute the following command to setup the initial database" |
2673 |
- elog "environment:" |
2674 |
- elog " emerge --config =${CATEGORY}/${PF}" |
2675 |
- fi |
2676 |
-} |
2677 |
- |
2678 |
-pkg_prerm() { |
2679 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
2680 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
2681 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
2682 |
- |
2683 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
2684 |
- sleep 10 |
2685 |
- eend 0 |
2686 |
- fi |
2687 |
-} |
2688 |
- |
2689 |
-pkg_postrm() { |
2690 |
- postgresql-config update |
2691 |
-} |
2692 |
- |
2693 |
-pkg_config() { |
2694 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
2695 |
- |
2696 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
2697 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2698 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
2699 |
- [[ -z "${DATA_DIR}" ]] \ |
2700 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
2701 |
- |
2702 |
- # environment.bz2 may not contain the same locale as the current system |
2703 |
- # locale. Unset and source from the current system locale. |
2704 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
2705 |
- unset LANG |
2706 |
- unset LC_CTYPE |
2707 |
- unset LC_NUMERIC |
2708 |
- unset LC_TIME |
2709 |
- unset LC_COLLATE |
2710 |
- unset LC_MONETARY |
2711 |
- unset LC_MESSAGES |
2712 |
- unset LC_ALL |
2713 |
- source "${EROOT%/}/etc/env.d/02locale" |
2714 |
- [ -n "${LANG}" ] && export LANG |
2715 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
2716 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
2717 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
2718 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
2719 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
2720 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
2721 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
2722 |
- fi |
2723 |
- |
2724 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
2725 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
2726 |
- einfo |
2727 |
- einfo "Information on options that can be passed to initdb are found at:" |
2728 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
2729 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
2730 |
- einfo |
2731 |
- einfo "PG_INITDB_OPTS is currently set to:" |
2732 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
2733 |
- einfo " (none)" |
2734 |
- else |
2735 |
- einfo " ${PG_INITDB_OPTS}" |
2736 |
- fi |
2737 |
- einfo |
2738 |
- einfo "Configuration files will be installed to:" |
2739 |
- einfo " ${PGDATA}" |
2740 |
- einfo |
2741 |
- einfo "The database cluster will be created in:" |
2742 |
- einfo " ${DATA_DIR}" |
2743 |
- einfo |
2744 |
- while [ "$correct" != "true" ] ; do |
2745 |
- einfo "Are you ready to continue? (y/n)" |
2746 |
- read answer |
2747 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
2748 |
- correct="true" |
2749 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
2750 |
- die "Aborting initialization." |
2751 |
- else |
2752 |
- echo "Answer not recognized" |
2753 |
- fi |
2754 |
- done |
2755 |
- |
2756 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
2757 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
2758 |
- eerror "Modify DATA_DIR to point to an empty directory." |
2759 |
- die "${DATA_DIR} is not empty." |
2760 |
- fi |
2761 |
- |
2762 |
- einfo "Creating the data directory ..." |
2763 |
- if [[ ${EUID} == 0 ]] ; then |
2764 |
- mkdir -p "${DATA_DIR}" |
2765 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
2766 |
- chmod 0700 "${DATA_DIR}" |
2767 |
- fi |
2768 |
- |
2769 |
- einfo "Initializing the database ..." |
2770 |
- |
2771 |
- if [[ ${EUID} == 0 ]] ; then |
2772 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
2773 |
- else |
2774 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
2775 |
- fi |
2776 |
- |
2777 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
2778 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
2779 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
2780 |
- fi |
2781 |
- |
2782 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
2783 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
2784 |
- # On the off-chance that you might need to work with UTF-8 encoded |
2785 |
- # characters in PL/Perl |
2786 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
2787 |
- EOF |
2788 |
- |
2789 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
2790 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
2791 |
- einfo "by default. You can disable it in the cluster's:" |
2792 |
- einfo " ${PGDATA%/}/postgresql.conf" |
2793 |
- einfo |
2794 |
- einfo "The PostgreSQL server, by default, will log events to:" |
2795 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
2796 |
- einfo |
2797 |
- if use prefix ; then |
2798 |
- einfo "The location of the configuration files have moved to:" |
2799 |
- einfo " ${PGDATA}" |
2800 |
- einfo "To start the server:" |
2801 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
2802 |
- einfo "To stop:" |
2803 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
2804 |
- einfo |
2805 |
- einfo "Or move the configuration files back:" |
2806 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
2807 |
- else |
2808 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
2809 |
- einfo "instead of 'pg_ctl'." |
2810 |
- fi |
2811 |
-} |
2812 |
- |
2813 |
-src_test() { |
2814 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
2815 |
- emake check |
2816 |
- |
2817 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
2818 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
2819 |
- else |
2820 |
- use server || \ |
2821 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
2822 |
- [[ ${UID} -eq 0 ]] || \ |
2823 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
2824 |
- |
2825 |
- ewarn 'Skipping.' |
2826 |
- fi |
2827 |
-} |
2828 |
|
2829 |
diff --git a/dev-db/postgresql/postgresql-9.3.10-r1.ebuild b/dev-db/postgresql/postgresql-9.3.10-r1.ebuild |
2830 |
deleted file mode 100644 |
2831 |
index 660f1a4..00000000 |
2832 |
--- a/dev-db/postgresql/postgresql-9.3.10-r1.ebuild |
2833 |
+++ /dev/null |
2834 |
@@ -1,394 +0,0 @@ |
2835 |
-# Copyright 1999-2016 Gentoo Foundation |
2836 |
-# Distributed under the terms of the GNU General Public License v2 |
2837 |
-# $Id$ |
2838 |
- |
2839 |
-EAPI="5" |
2840 |
- |
2841 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
2842 |
- |
2843 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
2844 |
- systemd user versionator |
2845 |
- |
2846 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
2847 |
- |
2848 |
-SLOT="$(get_version_component_range 1-2)" |
2849 |
- |
2850 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
2851 |
- |
2852 |
-LICENSE="POSTGRESQL GPL-2" |
2853 |
-DESCRIPTION="PostgreSQL RDBMS" |
2854 |
-HOMEPAGE="http://www.postgresql.org/" |
2855 |
- |
2856 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
2857 |
- zh_CN zh_TW" |
2858 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
2859 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
2860 |
- |
2861 |
-for lingua in ${LINGUAS}; do |
2862 |
- IUSE+=" linguas_${lingua}" |
2863 |
-done |
2864 |
- |
2865 |
-wanted_languages() { |
2866 |
- local enable_langs |
2867 |
- |
2868 |
- for lingua in ${LINGUAS} ; do |
2869 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
2870 |
- done |
2871 |
- |
2872 |
- echo -n ${enable_langs} |
2873 |
-} |
2874 |
- |
2875 |
-CDEPEND=" |
2876 |
->=app-eselect/eselect-postgresql-1.2.0 |
2877 |
-sys-apps/less |
2878 |
-virtual/libintl |
2879 |
-kerberos? ( virtual/krb5 ) |
2880 |
-ldap? ( net-nds/openldap ) |
2881 |
-pam? ( virtual/pam ) |
2882 |
-perl? ( >=dev-lang/perl-5.8:= ) |
2883 |
-python? ( ${PYTHON_DEPS} ) |
2884 |
-readline? ( sys-libs/readline:0= ) |
2885 |
-ssl? ( |
2886 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
2887 |
- libressl? ( dev-libs/libressl:= ) |
2888 |
-) |
2889 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
2890 |
-uuid? ( dev-libs/ossp-uuid ) |
2891 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
2892 |
-zlib? ( sys-libs/zlib ) |
2893 |
-" |
2894 |
- |
2895 |
-DEPEND="${CDEPEND} |
2896 |
-!!<sys-apps/sandbox-2.0 |
2897 |
-sys-devel/bison |
2898 |
-sys-devel/flex |
2899 |
-nls? ( sys-devel/gettext ) |
2900 |
-xml? ( virtual/pkgconfig ) |
2901 |
-" |
2902 |
- |
2903 |
-RDEPEND="${CDEPEND} |
2904 |
-!dev-db/postgresql-docs:${SLOT} |
2905 |
-!dev-db/postgresql-base:${SLOT} |
2906 |
-!dev-db/postgresql-server:${SLOT} |
2907 |
-selinux? ( sec-policy/selinux-postgresql ) |
2908 |
-" |
2909 |
- |
2910 |
-pkg_setup() { |
2911 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
2912 |
- |
2913 |
- enewgroup postgres 70 |
2914 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
2915 |
- |
2916 |
- use python && python-single-r1_pkg_setup |
2917 |
-} |
2918 |
- |
2919 |
-src_prepare() { |
2920 |
- # Work around PPC{,64} compilation bug where bool is already defined |
2921 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
2922 |
- |
2923 |
- # Set proper run directory |
2924 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
2925 |
- -i src/include/pg_config_manual.h || die |
2926 |
- |
2927 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
2928 |
- |
2929 |
- # Fix bug 486556 where the server would crash at start up because of |
2930 |
- # an infinite loop caused by a self-referencing symlink. |
2931 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
2932 |
- |
2933 |
- if use pam ; then |
2934 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
2935 |
- -i src/backend/libpq/auth.c || \ |
2936 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
2937 |
- fi |
2938 |
- |
2939 |
- epatch_user |
2940 |
-} |
2941 |
- |
2942 |
-src_configure() { |
2943 |
- case ${CHOST} in |
2944 |
- *-darwin*|*-solaris*) |
2945 |
- use nls && append-libs intl |
2946 |
- ;; |
2947 |
- esac |
2948 |
- |
2949 |
- export LDFLAGS_SL="${LDFLAGS}" |
2950 |
- export LDFLAGS_EX="${LDFLAGS}" |
2951 |
- |
2952 |
- local PO="${EPREFIX%/}" |
2953 |
- |
2954 |
- econf \ |
2955 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
2956 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
2957 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
2958 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
2959 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
2960 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
2961 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
2962 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
2963 |
- $(use_enable threads thread-safety) \ |
2964 |
- $(use_with kerberos gssapi) \ |
2965 |
- $(use_with kerberos krb5) \ |
2966 |
- $(use_with ldap) \ |
2967 |
- $(use_with pam) \ |
2968 |
- $(use_with perl) \ |
2969 |
- $(use_with python) \ |
2970 |
- $(use_with readline) \ |
2971 |
- $(use_with ssl openssl) \ |
2972 |
- $(use_with tcl) \ |
2973 |
- $(use_with uuid ossp-uuid) \ |
2974 |
- $(use_with xml libxml) \ |
2975 |
- $(use_with xml libxslt) \ |
2976 |
- $(use_with zlib) \ |
2977 |
- "$(use_enable nls nls "$(wanted_languages)")" |
2978 |
-} |
2979 |
- |
2980 |
-src_compile() { |
2981 |
- emake |
2982 |
- emake -C contrib |
2983 |
-} |
2984 |
- |
2985 |
-src_install() { |
2986 |
- emake DESTDIR="${D}" install |
2987 |
- emake DESTDIR="${D}" install -C contrib |
2988 |
- |
2989 |
- dodoc README HISTORY doc/{TODO,bug.template} |
2990 |
- |
2991 |
- # man pages are already built, but if we have the target make them, |
2992 |
- # they'll be generated from source before being installed so we |
2993 |
- # manually install man pages. |
2994 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
2995 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
2996 |
- doins -r doc/src/sgml/man{1,3,7} |
2997 |
- if ! use server; then |
2998 |
- # Remove man pages for non-existent binaries |
2999 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
3000 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3001 |
- done |
3002 |
- fi |
3003 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3004 |
- |
3005 |
- insinto /etc/postgresql-${SLOT} |
3006 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3007 |
- |
3008 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
3009 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
3010 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
3011 |
- |
3012 |
- use static-libs || find "${ED}" -name '*.a' -delete |
3013 |
- |
3014 |
- if use doc ; then |
3015 |
- docinto html |
3016 |
- dodoc doc/src/sgml/html/* |
3017 |
- |
3018 |
- docinto sgml |
3019 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
3020 |
- fi |
3021 |
- |
3022 |
- if use server; then |
3023 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3024 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
3025 |
- |
3026 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3027 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
3028 |
- |
3029 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3030 |
- "${FILESDIR}/${PN}.service" | \ |
3031 |
- systemd_newunit - ${PN}-${SLOT}.service |
3032 |
- |
3033 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3034 |
- |
3035 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3036 |
- |
3037 |
- if use prefix ; then |
3038 |
- keepdir /run/postgresql |
3039 |
- fperms 0775 /run/postgresql |
3040 |
- fi |
3041 |
- fi |
3042 |
-} |
3043 |
- |
3044 |
-pkg_postinst() { |
3045 |
- postgresql-config update |
3046 |
- |
3047 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3048 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
3049 |
- |
3050 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
3051 |
- elog |
3052 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
3053 |
- elog "following command in all active shells to pick up changes to the default" |
3054 |
- elog "environment:" |
3055 |
- elog " source /etc/profile" |
3056 |
- fi |
3057 |
- |
3058 |
- if use server ; then |
3059 |
- elog |
3060 |
- elog "Gentoo specific documentation:" |
3061 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3062 |
- elog |
3063 |
- elog "Official documentation:" |
3064 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
3065 |
- elog |
3066 |
- elog "The default location of the Unix-domain socket is:" |
3067 |
- elog " ${EROOT%/}/run/postgresql/" |
3068 |
- elog |
3069 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3070 |
- elog "so that it contains your preferred locale in:" |
3071 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3072 |
- elog |
3073 |
- elog "Then, execute the following command to setup the initial database" |
3074 |
- elog "environment:" |
3075 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3076 |
- fi |
3077 |
-} |
3078 |
- |
3079 |
-pkg_prerm() { |
3080 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3081 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3082 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3083 |
- |
3084 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3085 |
- sleep 10 |
3086 |
- eend 0 |
3087 |
- fi |
3088 |
-} |
3089 |
- |
3090 |
-pkg_postrm() { |
3091 |
- postgresql-config update |
3092 |
-} |
3093 |
- |
3094 |
-pkg_config() { |
3095 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3096 |
- |
3097 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3098 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3099 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
3100 |
- [[ -z "${DATA_DIR}" ]] \ |
3101 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
3102 |
- |
3103 |
- # environment.bz2 may not contain the same locale as the current system |
3104 |
- # locale. Unset and source from the current system locale. |
3105 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
3106 |
- unset LANG |
3107 |
- unset LC_CTYPE |
3108 |
- unset LC_NUMERIC |
3109 |
- unset LC_TIME |
3110 |
- unset LC_COLLATE |
3111 |
- unset LC_MONETARY |
3112 |
- unset LC_MESSAGES |
3113 |
- unset LC_ALL |
3114 |
- source "${EROOT%/}/etc/env.d/02locale" |
3115 |
- [ -n "${LANG}" ] && export LANG |
3116 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3117 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3118 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3119 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3120 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3121 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3122 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3123 |
- fi |
3124 |
- |
3125 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3126 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3127 |
- einfo |
3128 |
- einfo "Information on options that can be passed to initdb are found at:" |
3129 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3130 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3131 |
- einfo |
3132 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3133 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3134 |
- einfo " (none)" |
3135 |
- else |
3136 |
- einfo " ${PG_INITDB_OPTS}" |
3137 |
- fi |
3138 |
- einfo |
3139 |
- einfo "Configuration files will be installed to:" |
3140 |
- einfo " ${PGDATA}" |
3141 |
- einfo |
3142 |
- einfo "The database cluster will be created in:" |
3143 |
- einfo " ${DATA_DIR}" |
3144 |
- einfo |
3145 |
- while [ "$correct" != "true" ] ; do |
3146 |
- einfo "Are you ready to continue? (y/n)" |
3147 |
- read answer |
3148 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
3149 |
- correct="true" |
3150 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
3151 |
- die "Aborting initialization." |
3152 |
- else |
3153 |
- echo "Answer not recognized" |
3154 |
- fi |
3155 |
- done |
3156 |
- |
3157 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3158 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3159 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3160 |
- die "${DATA_DIR} is not empty." |
3161 |
- fi |
3162 |
- |
3163 |
- einfo "Creating the data directory ..." |
3164 |
- if [[ ${EUID} == 0 ]] ; then |
3165 |
- mkdir -p "${DATA_DIR}" |
3166 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
3167 |
- chmod 0700 "${DATA_DIR}" |
3168 |
- fi |
3169 |
- |
3170 |
- einfo "Initializing the database ..." |
3171 |
- |
3172 |
- if [[ ${EUID} == 0 ]] ; then |
3173 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3174 |
- else |
3175 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3176 |
- fi |
3177 |
- |
3178 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3179 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3180 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3181 |
- fi |
3182 |
- |
3183 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3184 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3185 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3186 |
- # characters in PL/Perl |
3187 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3188 |
- EOF |
3189 |
- |
3190 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3191 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3192 |
- einfo "by default. You can disable it in the cluster's:" |
3193 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3194 |
- einfo |
3195 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3196 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3197 |
- einfo |
3198 |
- if use prefix ; then |
3199 |
- einfo "The location of the configuration files have moved to:" |
3200 |
- einfo " ${PGDATA}" |
3201 |
- einfo "To start the server:" |
3202 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3203 |
- einfo "To stop:" |
3204 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3205 |
- einfo |
3206 |
- einfo "Or move the configuration files back:" |
3207 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3208 |
- else |
3209 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3210 |
- einfo "instead of 'pg_ctl'." |
3211 |
- fi |
3212 |
-} |
3213 |
- |
3214 |
-src_test() { |
3215 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3216 |
- emake check |
3217 |
- |
3218 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3219 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3220 |
- else |
3221 |
- use server || \ |
3222 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3223 |
- [[ ${UID} -eq 0 ]] || \ |
3224 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3225 |
- |
3226 |
- ewarn 'Skipping.' |
3227 |
- fi |
3228 |
-} |
3229 |
|
3230 |
diff --git a/dev-db/postgresql/postgresql-9.3.10-r2.ebuild b/dev-db/postgresql/postgresql-9.3.10-r2.ebuild |
3231 |
deleted file mode 100644 |
3232 |
index 7c60105..00000000 |
3233 |
--- a/dev-db/postgresql/postgresql-9.3.10-r2.ebuild |
3234 |
+++ /dev/null |
3235 |
@@ -1,399 +0,0 @@ |
3236 |
-# Copyright 1999-2016 Gentoo Foundation |
3237 |
-# Distributed under the terms of the GNU General Public License v2 |
3238 |
-# $Id$ |
3239 |
- |
3240 |
-EAPI="5" |
3241 |
- |
3242 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
3243 |
- |
3244 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
3245 |
- systemd user versionator |
3246 |
- |
3247 |
-KEYWORDS="alpha amd64 arm hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
3248 |
- |
3249 |
-SLOT="$(get_version_component_range 1-2)" |
3250 |
- |
3251 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
3252 |
- |
3253 |
-LICENSE="POSTGRESQL GPL-2" |
3254 |
-DESCRIPTION="PostgreSQL RDBMS" |
3255 |
-HOMEPAGE="http://www.postgresql.org/" |
3256 |
- |
3257 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
3258 |
- zh_CN zh_TW" |
3259 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
3260 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
3261 |
- |
3262 |
-for lingua in ${LINGUAS}; do |
3263 |
- IUSE+=" linguas_${lingua}" |
3264 |
-done |
3265 |
- |
3266 |
-wanted_languages() { |
3267 |
- local enable_langs |
3268 |
- |
3269 |
- for lingua in ${LINGUAS} ; do |
3270 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
3271 |
- done |
3272 |
- |
3273 |
- echo -n ${enable_langs} |
3274 |
-} |
3275 |
- |
3276 |
-CDEPEND=" |
3277 |
->=app-eselect/eselect-postgresql-1.2.0 |
3278 |
-sys-apps/less |
3279 |
-virtual/libintl |
3280 |
-kerberos? ( virtual/krb5 ) |
3281 |
-ldap? ( net-nds/openldap ) |
3282 |
-pam? ( virtual/pam ) |
3283 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3284 |
-python? ( ${PYTHON_DEPS} ) |
3285 |
-readline? ( sys-libs/readline:0= ) |
3286 |
-ssl? ( |
3287 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3288 |
- libressl? ( dev-libs/libressl:= ) |
3289 |
-) |
3290 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3291 |
-uuid? ( dev-libs/ossp-uuid ) |
3292 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3293 |
-zlib? ( sys-libs/zlib ) |
3294 |
-" |
3295 |
- |
3296 |
-DEPEND="${CDEPEND} |
3297 |
-!!<sys-apps/sandbox-2.0 |
3298 |
-sys-devel/bison |
3299 |
-sys-devel/flex |
3300 |
-nls? ( sys-devel/gettext ) |
3301 |
-xml? ( virtual/pkgconfig ) |
3302 |
-" |
3303 |
- |
3304 |
-RDEPEND="${CDEPEND} |
3305 |
-!dev-db/postgresql-docs:${SLOT} |
3306 |
-!dev-db/postgresql-base:${SLOT} |
3307 |
-!dev-db/postgresql-server:${SLOT} |
3308 |
-selinux? ( sec-policy/selinux-postgresql ) |
3309 |
-" |
3310 |
- |
3311 |
-pkg_setup() { |
3312 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3313 |
- |
3314 |
- enewgroup postgres 70 |
3315 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
3316 |
- |
3317 |
- use python && python-single-r1_pkg_setup |
3318 |
-} |
3319 |
- |
3320 |
-src_prepare() { |
3321 |
- # Work around PPC{,64} compilation bug where bool is already defined |
3322 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
3323 |
- |
3324 |
- # Set proper run directory |
3325 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3326 |
- -i src/include/pg_config_manual.h || die |
3327 |
- |
3328 |
- # Rely on $PATH being in the proper order so that the correct |
3329 |
- # install program is used for modules utilizing PGXS in both |
3330 |
- # hardened and non-hardened environments. (Bug #528786) |
3331 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3332 |
- |
3333 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
3334 |
- |
3335 |
- # Fix bug 486556 where the server would crash at start up because of |
3336 |
- # an infinite loop caused by a self-referencing symlink. |
3337 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
3338 |
- |
3339 |
- if use pam ; then |
3340 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3341 |
- -i src/backend/libpq/auth.c || \ |
3342 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3343 |
- fi |
3344 |
- |
3345 |
- epatch_user |
3346 |
-} |
3347 |
- |
3348 |
-src_configure() { |
3349 |
- case ${CHOST} in |
3350 |
- *-darwin*|*-solaris*) |
3351 |
- use nls && append-libs intl |
3352 |
- ;; |
3353 |
- esac |
3354 |
- |
3355 |
- export LDFLAGS_SL="${LDFLAGS}" |
3356 |
- export LDFLAGS_EX="${LDFLAGS}" |
3357 |
- |
3358 |
- local PO="${EPREFIX%/}" |
3359 |
- |
3360 |
- econf \ |
3361 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3362 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3363 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
3364 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3365 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3366 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3367 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3368 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
3369 |
- $(use_enable threads thread-safety) \ |
3370 |
- $(use_with kerberos gssapi) \ |
3371 |
- $(use_with kerberos krb5) \ |
3372 |
- $(use_with ldap) \ |
3373 |
- $(use_with pam) \ |
3374 |
- $(use_with perl) \ |
3375 |
- $(use_with python) \ |
3376 |
- $(use_with readline) \ |
3377 |
- $(use_with ssl openssl) \ |
3378 |
- $(use_with tcl) \ |
3379 |
- $(use_with uuid ossp-uuid) \ |
3380 |
- $(use_with xml libxml) \ |
3381 |
- $(use_with xml libxslt) \ |
3382 |
- $(use_with zlib) \ |
3383 |
- "$(use_enable nls nls "$(wanted_languages)")" |
3384 |
-} |
3385 |
- |
3386 |
-src_compile() { |
3387 |
- emake |
3388 |
- emake -C contrib |
3389 |
-} |
3390 |
- |
3391 |
-src_install() { |
3392 |
- emake DESTDIR="${D}" install |
3393 |
- emake DESTDIR="${D}" install -C contrib |
3394 |
- |
3395 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3396 |
- |
3397 |
- # man pages are already built, but if we have the target make them, |
3398 |
- # they'll be generated from source before being installed so we |
3399 |
- # manually install man pages. |
3400 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3401 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3402 |
- doins -r doc/src/sgml/man{1,3,7} |
3403 |
- if ! use server; then |
3404 |
- # Remove man pages for non-existent binaries |
3405 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
3406 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3407 |
- done |
3408 |
- fi |
3409 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3410 |
- |
3411 |
- insinto /etc/postgresql-${SLOT} |
3412 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3413 |
- |
3414 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
3415 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
3416 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
3417 |
- |
3418 |
- use static-libs || find "${ED}" -name '*.a' -delete |
3419 |
- |
3420 |
- if use doc ; then |
3421 |
- docinto html |
3422 |
- dodoc doc/src/sgml/html/* |
3423 |
- |
3424 |
- docinto sgml |
3425 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
3426 |
- fi |
3427 |
- |
3428 |
- if use server; then |
3429 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3430 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
3431 |
- |
3432 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3433 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
3434 |
- |
3435 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3436 |
- "${FILESDIR}/${PN}.service" | \ |
3437 |
- systemd_newunit - ${PN}-${SLOT}.service |
3438 |
- |
3439 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3440 |
- |
3441 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3442 |
- |
3443 |
- if use prefix ; then |
3444 |
- keepdir /run/postgresql |
3445 |
- fperms 0775 /run/postgresql |
3446 |
- fi |
3447 |
- fi |
3448 |
-} |
3449 |
- |
3450 |
-pkg_postinst() { |
3451 |
- postgresql-config update |
3452 |
- |
3453 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3454 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
3455 |
- |
3456 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
3457 |
- elog |
3458 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
3459 |
- elog "following command in all active shells to pick up changes to the default" |
3460 |
- elog "environment:" |
3461 |
- elog " source /etc/profile" |
3462 |
- fi |
3463 |
- |
3464 |
- if use server ; then |
3465 |
- elog |
3466 |
- elog "Gentoo specific documentation:" |
3467 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3468 |
- elog |
3469 |
- elog "Official documentation:" |
3470 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
3471 |
- elog |
3472 |
- elog "The default location of the Unix-domain socket is:" |
3473 |
- elog " ${EROOT%/}/run/postgresql/" |
3474 |
- elog |
3475 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3476 |
- elog "so that it contains your preferred locale in:" |
3477 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3478 |
- elog |
3479 |
- elog "Then, execute the following command to setup the initial database" |
3480 |
- elog "environment:" |
3481 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3482 |
- fi |
3483 |
-} |
3484 |
- |
3485 |
-pkg_prerm() { |
3486 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3487 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3488 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3489 |
- |
3490 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3491 |
- sleep 10 |
3492 |
- eend 0 |
3493 |
- fi |
3494 |
-} |
3495 |
- |
3496 |
-pkg_postrm() { |
3497 |
- postgresql-config update |
3498 |
-} |
3499 |
- |
3500 |
-pkg_config() { |
3501 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3502 |
- |
3503 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3504 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3505 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
3506 |
- [[ -z "${DATA_DIR}" ]] \ |
3507 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
3508 |
- |
3509 |
- # environment.bz2 may not contain the same locale as the current system |
3510 |
- # locale. Unset and source from the current system locale. |
3511 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
3512 |
- unset LANG |
3513 |
- unset LC_CTYPE |
3514 |
- unset LC_NUMERIC |
3515 |
- unset LC_TIME |
3516 |
- unset LC_COLLATE |
3517 |
- unset LC_MONETARY |
3518 |
- unset LC_MESSAGES |
3519 |
- unset LC_ALL |
3520 |
- source "${EROOT%/}/etc/env.d/02locale" |
3521 |
- [ -n "${LANG}" ] && export LANG |
3522 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3523 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3524 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3525 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3526 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3527 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3528 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3529 |
- fi |
3530 |
- |
3531 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3532 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3533 |
- einfo |
3534 |
- einfo "Information on options that can be passed to initdb are found at:" |
3535 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3536 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3537 |
- einfo |
3538 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3539 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3540 |
- einfo " (none)" |
3541 |
- else |
3542 |
- einfo " ${PG_INITDB_OPTS}" |
3543 |
- fi |
3544 |
- einfo |
3545 |
- einfo "Configuration files will be installed to:" |
3546 |
- einfo " ${PGDATA}" |
3547 |
- einfo |
3548 |
- einfo "The database cluster will be created in:" |
3549 |
- einfo " ${DATA_DIR}" |
3550 |
- einfo |
3551 |
- while [ "$correct" != "true" ] ; do |
3552 |
- einfo "Are you ready to continue? (y/n)" |
3553 |
- read answer |
3554 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
3555 |
- correct="true" |
3556 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
3557 |
- die "Aborting initialization." |
3558 |
- else |
3559 |
- echo "Answer not recognized" |
3560 |
- fi |
3561 |
- done |
3562 |
- |
3563 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3564 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3565 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3566 |
- die "${DATA_DIR} is not empty." |
3567 |
- fi |
3568 |
- |
3569 |
- einfo "Creating the data directory ..." |
3570 |
- if [[ ${EUID} == 0 ]] ; then |
3571 |
- mkdir -p "${DATA_DIR}" |
3572 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
3573 |
- chmod 0700 "${DATA_DIR}" |
3574 |
- fi |
3575 |
- |
3576 |
- einfo "Initializing the database ..." |
3577 |
- |
3578 |
- if [[ ${EUID} == 0 ]] ; then |
3579 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3580 |
- else |
3581 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3582 |
- fi |
3583 |
- |
3584 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3585 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3586 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3587 |
- fi |
3588 |
- |
3589 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3590 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3591 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3592 |
- # characters in PL/Perl |
3593 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
3594 |
- EOF |
3595 |
- |
3596 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
3597 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
3598 |
- einfo "by default. You can disable it in the cluster's:" |
3599 |
- einfo " ${PGDATA%/}/postgresql.conf" |
3600 |
- einfo |
3601 |
- einfo "The PostgreSQL server, by default, will log events to:" |
3602 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
3603 |
- einfo |
3604 |
- if use prefix ; then |
3605 |
- einfo "The location of the configuration files have moved to:" |
3606 |
- einfo " ${PGDATA}" |
3607 |
- einfo "To start the server:" |
3608 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
3609 |
- einfo "To stop:" |
3610 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
3611 |
- einfo |
3612 |
- einfo "Or move the configuration files back:" |
3613 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
3614 |
- else |
3615 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
3616 |
- einfo "instead of 'pg_ctl'." |
3617 |
- fi |
3618 |
-} |
3619 |
- |
3620 |
-src_test() { |
3621 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
3622 |
- emake check |
3623 |
- |
3624 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
3625 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
3626 |
- else |
3627 |
- use server || \ |
3628 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
3629 |
- [[ ${UID} -eq 0 ]] || \ |
3630 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
3631 |
- |
3632 |
- ewarn 'Skipping.' |
3633 |
- fi |
3634 |
-} |
3635 |
|
3636 |
diff --git a/dev-db/postgresql/postgresql-9.3.11.ebuild b/dev-db/postgresql/postgresql-9.3.11.ebuild |
3637 |
deleted file mode 100644 |
3638 |
index eb7411a..00000000 |
3639 |
--- a/dev-db/postgresql/postgresql-9.3.11.ebuild |
3640 |
+++ /dev/null |
3641 |
@@ -1,399 +0,0 @@ |
3642 |
-# Copyright 1999-2016 Gentoo Foundation |
3643 |
-# Distributed under the terms of the GNU General Public License v2 |
3644 |
-# $Id$ |
3645 |
- |
3646 |
-EAPI="5" |
3647 |
- |
3648 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
3649 |
- |
3650 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
3651 |
- systemd user versionator |
3652 |
- |
3653 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
3654 |
- |
3655 |
-SLOT="$(get_version_component_range 1-2)" |
3656 |
- |
3657 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
3658 |
- |
3659 |
-LICENSE="POSTGRESQL GPL-2" |
3660 |
-DESCRIPTION="PostgreSQL RDBMS" |
3661 |
-HOMEPAGE="http://www.postgresql.org/" |
3662 |
- |
3663 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
3664 |
- zh_CN zh_TW" |
3665 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
3666 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
3667 |
- |
3668 |
-for lingua in ${LINGUAS}; do |
3669 |
- IUSE+=" linguas_${lingua}" |
3670 |
-done |
3671 |
- |
3672 |
-wanted_languages() { |
3673 |
- local enable_langs |
3674 |
- |
3675 |
- for lingua in ${LINGUAS} ; do |
3676 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
3677 |
- done |
3678 |
- |
3679 |
- echo -n ${enable_langs} |
3680 |
-} |
3681 |
- |
3682 |
-CDEPEND=" |
3683 |
->=app-eselect/eselect-postgresql-1.2.0 |
3684 |
-sys-apps/less |
3685 |
-virtual/libintl |
3686 |
-kerberos? ( virtual/krb5 ) |
3687 |
-ldap? ( net-nds/openldap ) |
3688 |
-pam? ( virtual/pam ) |
3689 |
-perl? ( >=dev-lang/perl-5.8:= ) |
3690 |
-python? ( ${PYTHON_DEPS} ) |
3691 |
-readline? ( sys-libs/readline:0= ) |
3692 |
-ssl? ( |
3693 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
3694 |
- libressl? ( dev-libs/libressl:= ) |
3695 |
-) |
3696 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
3697 |
-uuid? ( dev-libs/ossp-uuid ) |
3698 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
3699 |
-zlib? ( sys-libs/zlib ) |
3700 |
-" |
3701 |
- |
3702 |
-DEPEND="${CDEPEND} |
3703 |
-!!<sys-apps/sandbox-2.0 |
3704 |
-sys-devel/bison |
3705 |
-sys-devel/flex |
3706 |
-nls? ( sys-devel/gettext ) |
3707 |
-xml? ( virtual/pkgconfig ) |
3708 |
-" |
3709 |
- |
3710 |
-RDEPEND="${CDEPEND} |
3711 |
-!dev-db/postgresql-docs:${SLOT} |
3712 |
-!dev-db/postgresql-base:${SLOT} |
3713 |
-!dev-db/postgresql-server:${SLOT} |
3714 |
-selinux? ( sec-policy/selinux-postgresql ) |
3715 |
-" |
3716 |
- |
3717 |
-pkg_setup() { |
3718 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
3719 |
- |
3720 |
- enewgroup postgres 70 |
3721 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
3722 |
- |
3723 |
- use python && python-single-r1_pkg_setup |
3724 |
-} |
3725 |
- |
3726 |
-src_prepare() { |
3727 |
- # Work around PPC{,64} compilation bug where bool is already defined |
3728 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
3729 |
- |
3730 |
- # Set proper run directory |
3731 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
3732 |
- -i src/include/pg_config_manual.h || die |
3733 |
- |
3734 |
- # Rely on $PATH being in the proper order so that the correct |
3735 |
- # install program is used for modules utilizing PGXS in both |
3736 |
- # hardened and non-hardened environments. (Bug #528786) |
3737 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
3738 |
- |
3739 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
3740 |
- |
3741 |
- # Fix bug 486556 where the server would crash at start up because of |
3742 |
- # an infinite loop caused by a self-referencing symlink. |
3743 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
3744 |
- |
3745 |
- if use pam ; then |
3746 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
3747 |
- -i src/backend/libpq/auth.c || \ |
3748 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
3749 |
- fi |
3750 |
- |
3751 |
- epatch_user |
3752 |
-} |
3753 |
- |
3754 |
-src_configure() { |
3755 |
- case ${CHOST} in |
3756 |
- *-darwin*|*-solaris*) |
3757 |
- use nls && append-libs intl |
3758 |
- ;; |
3759 |
- esac |
3760 |
- |
3761 |
- export LDFLAGS_SL="${LDFLAGS}" |
3762 |
- export LDFLAGS_EX="${LDFLAGS}" |
3763 |
- |
3764 |
- local PO="${EPREFIX%/}" |
3765 |
- |
3766 |
- econf \ |
3767 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
3768 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
3769 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
3770 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
3771 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
3772 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
3773 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
3774 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
3775 |
- $(use_enable threads thread-safety) \ |
3776 |
- $(use_with kerberos gssapi) \ |
3777 |
- $(use_with kerberos krb5) \ |
3778 |
- $(use_with ldap) \ |
3779 |
- $(use_with pam) \ |
3780 |
- $(use_with perl) \ |
3781 |
- $(use_with python) \ |
3782 |
- $(use_with readline) \ |
3783 |
- $(use_with ssl openssl) \ |
3784 |
- $(use_with tcl) \ |
3785 |
- $(use_with uuid ossp-uuid) \ |
3786 |
- $(use_with xml libxml) \ |
3787 |
- $(use_with xml libxslt) \ |
3788 |
- $(use_with zlib) \ |
3789 |
- "$(use_enable nls nls "$(wanted_languages)")" |
3790 |
-} |
3791 |
- |
3792 |
-src_compile() { |
3793 |
- emake |
3794 |
- emake -C contrib |
3795 |
-} |
3796 |
- |
3797 |
-src_install() { |
3798 |
- emake DESTDIR="${D}" install |
3799 |
- emake DESTDIR="${D}" install -C contrib |
3800 |
- |
3801 |
- dodoc README HISTORY doc/{TODO,bug.template} |
3802 |
- |
3803 |
- # man pages are already built, but if we have the target make them, |
3804 |
- # they'll be generated from source before being installed so we |
3805 |
- # manually install man pages. |
3806 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
3807 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
3808 |
- doins -r doc/src/sgml/man{1,3,7} |
3809 |
- if ! use server; then |
3810 |
- # Remove man pages for non-existent binaries |
3811 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
3812 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
3813 |
- done |
3814 |
- fi |
3815 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
3816 |
- |
3817 |
- insinto /etc/postgresql-${SLOT} |
3818 |
- newins src/bin/psql/psqlrc.sample psqlrc |
3819 |
- |
3820 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
3821 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
3822 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
3823 |
- |
3824 |
- use static-libs || find "${ED}" -name '*.a' -delete |
3825 |
- |
3826 |
- if use doc ; then |
3827 |
- docinto html |
3828 |
- dodoc doc/src/sgml/html/* |
3829 |
- |
3830 |
- docinto sgml |
3831 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
3832 |
- fi |
3833 |
- |
3834 |
- if use server; then |
3835 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3836 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
3837 |
- |
3838 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3839 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
3840 |
- |
3841 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
3842 |
- "${FILESDIR}/${PN}.service" | \ |
3843 |
- systemd_newunit - ${PN}-${SLOT}.service |
3844 |
- |
3845 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
3846 |
- |
3847 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
3848 |
- |
3849 |
- if use prefix ; then |
3850 |
- keepdir /run/postgresql |
3851 |
- fperms 0775 /run/postgresql |
3852 |
- fi |
3853 |
- fi |
3854 |
-} |
3855 |
- |
3856 |
-pkg_postinst() { |
3857 |
- postgresql-config update |
3858 |
- |
3859 |
- elog "If you need a global psqlrc-file, you can place it in:" |
3860 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
3861 |
- |
3862 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
3863 |
- elog |
3864 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
3865 |
- elog "following command in all active shells to pick up changes to the default" |
3866 |
- elog "environment:" |
3867 |
- elog " source /etc/profile" |
3868 |
- fi |
3869 |
- |
3870 |
- if use server ; then |
3871 |
- elog |
3872 |
- elog "Gentoo specific documentation:" |
3873 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
3874 |
- elog |
3875 |
- elog "Official documentation:" |
3876 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
3877 |
- elog |
3878 |
- elog "The default location of the Unix-domain socket is:" |
3879 |
- elog " ${EROOT%/}/run/postgresql/" |
3880 |
- elog |
3881 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
3882 |
- elog "so that it contains your preferred locale in:" |
3883 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3884 |
- elog |
3885 |
- elog "Then, execute the following command to setup the initial database" |
3886 |
- elog "environment:" |
3887 |
- elog " emerge --config =${CATEGORY}/${PF}" |
3888 |
- fi |
3889 |
-} |
3890 |
- |
3891 |
-pkg_prerm() { |
3892 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
3893 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
3894 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
3895 |
- |
3896 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
3897 |
- sleep 10 |
3898 |
- eend 0 |
3899 |
- fi |
3900 |
-} |
3901 |
- |
3902 |
-pkg_postrm() { |
3903 |
- postgresql-config update |
3904 |
-} |
3905 |
- |
3906 |
-pkg_config() { |
3907 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
3908 |
- |
3909 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
3910 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3911 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
3912 |
- [[ -z "${DATA_DIR}" ]] \ |
3913 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
3914 |
- |
3915 |
- # environment.bz2 may not contain the same locale as the current system |
3916 |
- # locale. Unset and source from the current system locale. |
3917 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
3918 |
- unset LANG |
3919 |
- unset LC_CTYPE |
3920 |
- unset LC_NUMERIC |
3921 |
- unset LC_TIME |
3922 |
- unset LC_COLLATE |
3923 |
- unset LC_MONETARY |
3924 |
- unset LC_MESSAGES |
3925 |
- unset LC_ALL |
3926 |
- source "${EROOT%/}/etc/env.d/02locale" |
3927 |
- [ -n "${LANG}" ] && export LANG |
3928 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
3929 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
3930 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
3931 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
3932 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
3933 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
3934 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
3935 |
- fi |
3936 |
- |
3937 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
3938 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
3939 |
- einfo |
3940 |
- einfo "Information on options that can be passed to initdb are found at:" |
3941 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
3942 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
3943 |
- einfo |
3944 |
- einfo "PG_INITDB_OPTS is currently set to:" |
3945 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
3946 |
- einfo " (none)" |
3947 |
- else |
3948 |
- einfo " ${PG_INITDB_OPTS}" |
3949 |
- fi |
3950 |
- einfo |
3951 |
- einfo "Configuration files will be installed to:" |
3952 |
- einfo " ${PGDATA}" |
3953 |
- einfo |
3954 |
- einfo "The database cluster will be created in:" |
3955 |
- einfo " ${DATA_DIR}" |
3956 |
- einfo |
3957 |
- while [ "$correct" != "true" ] ; do |
3958 |
- einfo "Are you ready to continue? (y/n)" |
3959 |
- read answer |
3960 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
3961 |
- correct="true" |
3962 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
3963 |
- die "Aborting initialization." |
3964 |
- else |
3965 |
- echo "Answer not recognized" |
3966 |
- fi |
3967 |
- done |
3968 |
- |
3969 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
3970 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
3971 |
- eerror "Modify DATA_DIR to point to an empty directory." |
3972 |
- die "${DATA_DIR} is not empty." |
3973 |
- fi |
3974 |
- |
3975 |
- einfo "Creating the data directory ..." |
3976 |
- if [[ ${EUID} == 0 ]] ; then |
3977 |
- mkdir -p "${DATA_DIR}" |
3978 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
3979 |
- chmod 0700 "${DATA_DIR}" |
3980 |
- fi |
3981 |
- |
3982 |
- einfo "Initializing the database ..." |
3983 |
- |
3984 |
- if [[ ${EUID} == 0 ]] ; then |
3985 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
3986 |
- else |
3987 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
3988 |
- fi |
3989 |
- |
3990 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
3991 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
3992 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
3993 |
- fi |
3994 |
- |
3995 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
3996 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
3997 |
- # On the off-chance that you might need to work with UTF-8 encoded |
3998 |
- # characters in PL/Perl |
3999 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4000 |
- EOF |
4001 |
- |
4002 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4003 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4004 |
- einfo "by default. You can disable it in the cluster's:" |
4005 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4006 |
- einfo |
4007 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4008 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4009 |
- einfo |
4010 |
- if use prefix ; then |
4011 |
- einfo "The location of the configuration files have moved to:" |
4012 |
- einfo " ${PGDATA}" |
4013 |
- einfo "To start the server:" |
4014 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4015 |
- einfo "To stop:" |
4016 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4017 |
- einfo |
4018 |
- einfo "Or move the configuration files back:" |
4019 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4020 |
- else |
4021 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4022 |
- einfo "instead of 'pg_ctl'." |
4023 |
- fi |
4024 |
-} |
4025 |
- |
4026 |
-src_test() { |
4027 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4028 |
- emake check |
4029 |
- |
4030 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4031 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4032 |
- else |
4033 |
- use server || \ |
4034 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4035 |
- [[ ${UID} -eq 0 ]] || \ |
4036 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4037 |
- |
4038 |
- ewarn 'Skipping.' |
4039 |
- fi |
4040 |
-} |
4041 |
|
4042 |
diff --git a/dev-db/postgresql/postgresql-9.3.13.ebuild b/dev-db/postgresql/postgresql-9.3.13.ebuild |
4043 |
deleted file mode 100644 |
4044 |
index bc1ce93..00000000 |
4045 |
--- a/dev-db/postgresql/postgresql-9.3.13.ebuild |
4046 |
+++ /dev/null |
4047 |
@@ -1,399 +0,0 @@ |
4048 |
-# Copyright 1999-2016 Gentoo Foundation |
4049 |
-# Distributed under the terms of the GNU General Public License v2 |
4050 |
-# $Id$ |
4051 |
- |
4052 |
-EAPI="5" |
4053 |
- |
4054 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
4055 |
- |
4056 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
4057 |
- systemd user versionator |
4058 |
- |
4059 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
4060 |
- |
4061 |
-SLOT="$(get_version_component_range 1-2)" |
4062 |
- |
4063 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
4064 |
- |
4065 |
-LICENSE="POSTGRESQL GPL-2" |
4066 |
-DESCRIPTION="PostgreSQL RDBMS" |
4067 |
-HOMEPAGE="http://www.postgresql.org/" |
4068 |
- |
4069 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
4070 |
- zh_CN zh_TW" |
4071 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
4072 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
4073 |
- |
4074 |
-for lingua in ${LINGUAS}; do |
4075 |
- IUSE+=" linguas_${lingua}" |
4076 |
-done |
4077 |
- |
4078 |
-wanted_languages() { |
4079 |
- local enable_langs |
4080 |
- |
4081 |
- for lingua in ${LINGUAS} ; do |
4082 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
4083 |
- done |
4084 |
- |
4085 |
- echo -n ${enable_langs} |
4086 |
-} |
4087 |
- |
4088 |
-CDEPEND=" |
4089 |
->=app-eselect/eselect-postgresql-1.2.0 |
4090 |
-sys-apps/less |
4091 |
-virtual/libintl |
4092 |
-kerberos? ( virtual/krb5 ) |
4093 |
-ldap? ( net-nds/openldap ) |
4094 |
-pam? ( virtual/pam ) |
4095 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4096 |
-python? ( ${PYTHON_DEPS} ) |
4097 |
-readline? ( sys-libs/readline:0= ) |
4098 |
-ssl? ( |
4099 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4100 |
- libressl? ( dev-libs/libressl:= ) |
4101 |
-) |
4102 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4103 |
-uuid? ( dev-libs/ossp-uuid ) |
4104 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4105 |
-zlib? ( sys-libs/zlib ) |
4106 |
-" |
4107 |
- |
4108 |
-DEPEND="${CDEPEND} |
4109 |
-!!<sys-apps/sandbox-2.0 |
4110 |
-sys-devel/bison |
4111 |
-sys-devel/flex |
4112 |
-nls? ( sys-devel/gettext ) |
4113 |
-xml? ( virtual/pkgconfig ) |
4114 |
-" |
4115 |
- |
4116 |
-RDEPEND="${CDEPEND} |
4117 |
-!dev-db/postgresql-docs:${SLOT} |
4118 |
-!dev-db/postgresql-base:${SLOT} |
4119 |
-!dev-db/postgresql-server:${SLOT} |
4120 |
-selinux? ( sec-policy/selinux-postgresql ) |
4121 |
-" |
4122 |
- |
4123 |
-pkg_setup() { |
4124 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4125 |
- |
4126 |
- enewgroup postgres 70 |
4127 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
4128 |
- |
4129 |
- use python && python-single-r1_pkg_setup |
4130 |
-} |
4131 |
- |
4132 |
-src_prepare() { |
4133 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4134 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4135 |
- |
4136 |
- # Set proper run directory |
4137 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4138 |
- -i src/include/pg_config_manual.h || die |
4139 |
- |
4140 |
- # Rely on $PATH being in the proper order so that the correct |
4141 |
- # install program is used for modules utilizing PGXS in both |
4142 |
- # hardened and non-hardened environments. (Bug #528786) |
4143 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
4144 |
- |
4145 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
4146 |
- |
4147 |
- # Fix bug 486556 where the server would crash at start up because of |
4148 |
- # an infinite loop caused by a self-referencing symlink. |
4149 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
4150 |
- |
4151 |
- if use pam ; then |
4152 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4153 |
- -i src/backend/libpq/auth.c || \ |
4154 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4155 |
- fi |
4156 |
- |
4157 |
- epatch_user |
4158 |
-} |
4159 |
- |
4160 |
-src_configure() { |
4161 |
- case ${CHOST} in |
4162 |
- *-darwin*|*-solaris*) |
4163 |
- use nls && append-libs intl |
4164 |
- ;; |
4165 |
- esac |
4166 |
- |
4167 |
- export LDFLAGS_SL="${LDFLAGS}" |
4168 |
- export LDFLAGS_EX="${LDFLAGS}" |
4169 |
- |
4170 |
- local PO="${EPREFIX%/}" |
4171 |
- |
4172 |
- econf \ |
4173 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4174 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4175 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
4176 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4177 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4178 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4179 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4180 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
4181 |
- $(use_enable threads thread-safety) \ |
4182 |
- $(use_with kerberos gssapi) \ |
4183 |
- $(use_with kerberos krb5) \ |
4184 |
- $(use_with ldap) \ |
4185 |
- $(use_with pam) \ |
4186 |
- $(use_with perl) \ |
4187 |
- $(use_with python) \ |
4188 |
- $(use_with readline) \ |
4189 |
- $(use_with ssl openssl) \ |
4190 |
- $(use_with tcl) \ |
4191 |
- $(use_with uuid ossp-uuid) \ |
4192 |
- $(use_with xml libxml) \ |
4193 |
- $(use_with xml libxslt) \ |
4194 |
- $(use_with zlib) \ |
4195 |
- "$(use_enable nls nls "$(wanted_languages)")" |
4196 |
-} |
4197 |
- |
4198 |
-src_compile() { |
4199 |
- emake |
4200 |
- emake -C contrib |
4201 |
-} |
4202 |
- |
4203 |
-src_install() { |
4204 |
- emake DESTDIR="${D}" install |
4205 |
- emake DESTDIR="${D}" install -C contrib |
4206 |
- |
4207 |
- dodoc README HISTORY doc/{TODO,bug.template} |
4208 |
- |
4209 |
- # man pages are already built, but if we have the target make them, |
4210 |
- # they'll be generated from source before being installed so we |
4211 |
- # manually install man pages. |
4212 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4213 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4214 |
- doins -r doc/src/sgml/man{1,3,7} |
4215 |
- if ! use server; then |
4216 |
- # Remove man pages for non-existent binaries |
4217 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4218 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4219 |
- done |
4220 |
- fi |
4221 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4222 |
- |
4223 |
- insinto /etc/postgresql-${SLOT} |
4224 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4225 |
- |
4226 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
4227 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
4228 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
4229 |
- |
4230 |
- use static-libs || find "${ED}" -name '*.a' -delete |
4231 |
- |
4232 |
- if use doc ; then |
4233 |
- docinto html |
4234 |
- dodoc doc/src/sgml/html/* |
4235 |
- |
4236 |
- docinto sgml |
4237 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
4238 |
- fi |
4239 |
- |
4240 |
- if use server; then |
4241 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4242 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
4243 |
- |
4244 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4245 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
4246 |
- |
4247 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4248 |
- "${FILESDIR}/${PN}.service" | \ |
4249 |
- systemd_newunit - ${PN}-${SLOT}.service |
4250 |
- |
4251 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4252 |
- |
4253 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4254 |
- |
4255 |
- if use prefix ; then |
4256 |
- keepdir /run/postgresql |
4257 |
- fperms 0775 /run/postgresql |
4258 |
- fi |
4259 |
- fi |
4260 |
-} |
4261 |
- |
4262 |
-pkg_postinst() { |
4263 |
- postgresql-config update |
4264 |
- |
4265 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4266 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
4267 |
- |
4268 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
4269 |
- elog |
4270 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
4271 |
- elog "following command in all active shells to pick up changes to the default" |
4272 |
- elog "environment:" |
4273 |
- elog " source /etc/profile" |
4274 |
- fi |
4275 |
- |
4276 |
- if use server ; then |
4277 |
- elog |
4278 |
- elog "Gentoo specific documentation:" |
4279 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4280 |
- elog |
4281 |
- elog "Official documentation:" |
4282 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
4283 |
- elog |
4284 |
- elog "The default location of the Unix-domain socket is:" |
4285 |
- elog " ${EROOT%/}/run/postgresql/" |
4286 |
- elog |
4287 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4288 |
- elog "so that it contains your preferred locale in:" |
4289 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4290 |
- elog |
4291 |
- elog "Then, execute the following command to setup the initial database" |
4292 |
- elog "environment:" |
4293 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4294 |
- fi |
4295 |
-} |
4296 |
- |
4297 |
-pkg_prerm() { |
4298 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4299 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4300 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4301 |
- |
4302 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4303 |
- sleep 10 |
4304 |
- eend 0 |
4305 |
- fi |
4306 |
-} |
4307 |
- |
4308 |
-pkg_postrm() { |
4309 |
- postgresql-config update |
4310 |
-} |
4311 |
- |
4312 |
-pkg_config() { |
4313 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4314 |
- |
4315 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4316 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4317 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
4318 |
- [[ -z "${DATA_DIR}" ]] \ |
4319 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
4320 |
- |
4321 |
- # environment.bz2 may not contain the same locale as the current system |
4322 |
- # locale. Unset and source from the current system locale. |
4323 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
4324 |
- unset LANG |
4325 |
- unset LC_CTYPE |
4326 |
- unset LC_NUMERIC |
4327 |
- unset LC_TIME |
4328 |
- unset LC_COLLATE |
4329 |
- unset LC_MONETARY |
4330 |
- unset LC_MESSAGES |
4331 |
- unset LC_ALL |
4332 |
- source "${EROOT%/}/etc/env.d/02locale" |
4333 |
- [ -n "${LANG}" ] && export LANG |
4334 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4335 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4336 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4337 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4338 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4339 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4340 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4341 |
- fi |
4342 |
- |
4343 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4344 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4345 |
- einfo |
4346 |
- einfo "Information on options that can be passed to initdb are found at:" |
4347 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4348 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4349 |
- einfo |
4350 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4351 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4352 |
- einfo " (none)" |
4353 |
- else |
4354 |
- einfo " ${PG_INITDB_OPTS}" |
4355 |
- fi |
4356 |
- einfo |
4357 |
- einfo "Configuration files will be installed to:" |
4358 |
- einfo " ${PGDATA}" |
4359 |
- einfo |
4360 |
- einfo "The database cluster will be created in:" |
4361 |
- einfo " ${DATA_DIR}" |
4362 |
- einfo |
4363 |
- while [ "$correct" != "true" ] ; do |
4364 |
- einfo "Are you ready to continue? (y/n)" |
4365 |
- read answer |
4366 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
4367 |
- correct="true" |
4368 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
4369 |
- die "Aborting initialization." |
4370 |
- else |
4371 |
- echo "Answer not recognized" |
4372 |
- fi |
4373 |
- done |
4374 |
- |
4375 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4376 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4377 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4378 |
- die "${DATA_DIR} is not empty." |
4379 |
- fi |
4380 |
- |
4381 |
- einfo "Creating the data directory ..." |
4382 |
- if [[ ${EUID} == 0 ]] ; then |
4383 |
- mkdir -p "${DATA_DIR}" |
4384 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4385 |
- chmod 0700 "${DATA_DIR}" |
4386 |
- fi |
4387 |
- |
4388 |
- einfo "Initializing the database ..." |
4389 |
- |
4390 |
- if [[ ${EUID} == 0 ]] ; then |
4391 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4392 |
- else |
4393 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4394 |
- fi |
4395 |
- |
4396 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4397 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4398 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4399 |
- fi |
4400 |
- |
4401 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4402 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4403 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4404 |
- # characters in PL/Perl |
4405 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4406 |
- EOF |
4407 |
- |
4408 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4409 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4410 |
- einfo "by default. You can disable it in the cluster's:" |
4411 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4412 |
- einfo |
4413 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4414 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4415 |
- einfo |
4416 |
- if use prefix ; then |
4417 |
- einfo "The location of the configuration files have moved to:" |
4418 |
- einfo " ${PGDATA}" |
4419 |
- einfo "To start the server:" |
4420 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4421 |
- einfo "To stop:" |
4422 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4423 |
- einfo |
4424 |
- einfo "Or move the configuration files back:" |
4425 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4426 |
- else |
4427 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4428 |
- einfo "instead of 'pg_ctl'." |
4429 |
- fi |
4430 |
-} |
4431 |
- |
4432 |
-src_test() { |
4433 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4434 |
- emake check |
4435 |
- |
4436 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4437 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4438 |
- else |
4439 |
- use server || \ |
4440 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4441 |
- [[ ${UID} -eq 0 ]] || \ |
4442 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4443 |
- |
4444 |
- ewarn 'Skipping.' |
4445 |
- fi |
4446 |
-} |
4447 |
|
4448 |
diff --git a/dev-db/postgresql/postgresql-9.4.5-r1.ebuild b/dev-db/postgresql/postgresql-9.4.5-r1.ebuild |
4449 |
deleted file mode 100644 |
4450 |
index 787d029..00000000 |
4451 |
--- a/dev-db/postgresql/postgresql-9.4.5-r1.ebuild |
4452 |
+++ /dev/null |
4453 |
@@ -1,426 +0,0 @@ |
4454 |
-# Copyright 1999-2016 Gentoo Foundation |
4455 |
-# Distributed under the terms of the GNU General Public License v2 |
4456 |
-# $Id$ |
4457 |
- |
4458 |
-EAPI="5" |
4459 |
- |
4460 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
4461 |
- |
4462 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
4463 |
- systemd user versionator |
4464 |
- |
4465 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
4466 |
- |
4467 |
-SLOT="$(get_version_component_range 1-2)" |
4468 |
- |
4469 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
4470 |
- |
4471 |
-LICENSE="POSTGRESQL GPL-2" |
4472 |
-DESCRIPTION="PostgreSQL RDBMS" |
4473 |
-HOMEPAGE="http://www.postgresql.org/" |
4474 |
- |
4475 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
4476 |
- zh_CN zh_TW" |
4477 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
4478 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
4479 |
- |
4480 |
-for lingua in ${LINGUAS}; do |
4481 |
- IUSE+=" linguas_${lingua}" |
4482 |
-done |
4483 |
- |
4484 |
-wanted_languages() { |
4485 |
- local enable_langs |
4486 |
- |
4487 |
- for lingua in ${LINGUAS} ; do |
4488 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
4489 |
- done |
4490 |
- |
4491 |
- echo -n ${enable_langs} |
4492 |
-} |
4493 |
- |
4494 |
-CDEPEND=" |
4495 |
->=app-eselect/eselect-postgresql-1.2.0 |
4496 |
-sys-apps/less |
4497 |
-virtual/libintl |
4498 |
-kerberos? ( virtual/krb5 ) |
4499 |
-ldap? ( net-nds/openldap ) |
4500 |
-pam? ( virtual/pam ) |
4501 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4502 |
-python? ( ${PYTHON_DEPS} ) |
4503 |
-readline? ( sys-libs/readline:0= ) |
4504 |
-ssl? ( |
4505 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4506 |
- libressl? ( dev-libs/libressl:= ) |
4507 |
-) |
4508 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4509 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4510 |
-zlib? ( sys-libs/zlib ) |
4511 |
-" |
4512 |
- |
4513 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4514 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4515 |
-# the libc includes UUID functions. |
4516 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
4517 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
4518 |
- |
4519 |
-nest_usedep() { |
4520 |
- local front back |
4521 |
- while [[ ${#} -gt 1 ]]; do |
4522 |
- front+="${1}? ( " |
4523 |
- back+=" )" |
4524 |
- shift |
4525 |
- done |
4526 |
- echo "${front}${1}${back}" |
4527 |
-} |
4528 |
- |
4529 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
4530 |
-CDEPEND+=" |
4531 |
-uuid? ( |
4532 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4533 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4534 |
-)" |
4535 |
- |
4536 |
-DEPEND="${CDEPEND} |
4537 |
-!!<sys-apps/sandbox-2.0 |
4538 |
-sys-devel/bison |
4539 |
-sys-devel/flex |
4540 |
-nls? ( sys-devel/gettext ) |
4541 |
-xml? ( virtual/pkgconfig ) |
4542 |
-" |
4543 |
- |
4544 |
-RDEPEND="${CDEPEND} |
4545 |
-!dev-db/postgresql-docs:${SLOT} |
4546 |
-!dev-db/postgresql-base:${SLOT} |
4547 |
-!dev-db/postgresql-server:${SLOT} |
4548 |
-selinux? ( sec-policy/selinux-postgresql ) |
4549 |
-" |
4550 |
- |
4551 |
-pkg_setup() { |
4552 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4553 |
- |
4554 |
- enewgroup postgres 70 |
4555 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
4556 |
- |
4557 |
- use python && python-single-r1_pkg_setup |
4558 |
-} |
4559 |
- |
4560 |
-src_prepare() { |
4561 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4562 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4563 |
- |
4564 |
- # Set proper run directory |
4565 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4566 |
- -i src/include/pg_config_manual.h || die |
4567 |
- |
4568 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
4569 |
- |
4570 |
- # Fix bug 486556 where the server would crash at start up because of |
4571 |
- # an infinite loop caused by a self-referencing symlink. |
4572 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
4573 |
- |
4574 |
- if use pam ; then |
4575 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
4576 |
- -i src/backend/libpq/auth.c || \ |
4577 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
4578 |
- fi |
4579 |
- |
4580 |
- epatch_user |
4581 |
-} |
4582 |
- |
4583 |
-src_configure() { |
4584 |
- case ${CHOST} in |
4585 |
- *-darwin*|*-solaris*) |
4586 |
- use nls && append-libs intl |
4587 |
- ;; |
4588 |
- esac |
4589 |
- |
4590 |
- export LDFLAGS_SL="${LDFLAGS}" |
4591 |
- export LDFLAGS_EX="${LDFLAGS}" |
4592 |
- |
4593 |
- local PO="${EPREFIX%/}" |
4594 |
- |
4595 |
- local i uuid_config="" |
4596 |
- if use uuid; then |
4597 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
4598 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
4599 |
- done |
4600 |
- for i in ${BSD_LIBC[@]}; do |
4601 |
- use ${i} && uuid_config="--with-uuid=bsd" |
4602 |
- done |
4603 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
4604 |
- fi |
4605 |
- |
4606 |
- econf \ |
4607 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
4608 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
4609 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
4610 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
4611 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
4612 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
4613 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
4614 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
4615 |
- $(use_enable threads thread-safety) \ |
4616 |
- $(use_with kerberos gssapi) \ |
4617 |
- $(use_with ldap) \ |
4618 |
- $(use_with pam) \ |
4619 |
- $(use_with perl) \ |
4620 |
- $(use_with python) \ |
4621 |
- $(use_with readline) \ |
4622 |
- $(use_with ssl openssl) \ |
4623 |
- $(use_with tcl) \ |
4624 |
- ${uuid_config} \ |
4625 |
- $(use_with xml libxml) \ |
4626 |
- $(use_with xml libxslt) \ |
4627 |
- $(use_with zlib) \ |
4628 |
- "$(use_enable nls nls "$(wanted_languages)")" |
4629 |
-} |
4630 |
- |
4631 |
-src_compile() { |
4632 |
- emake |
4633 |
- emake -C contrib |
4634 |
-} |
4635 |
- |
4636 |
-src_install() { |
4637 |
- emake DESTDIR="${D}" install |
4638 |
- emake DESTDIR="${D}" install -C contrib |
4639 |
- |
4640 |
- dodoc README HISTORY doc/{TODO,bug.template} |
4641 |
- |
4642 |
- # man pages are already built, but if we have the target make them, |
4643 |
- # they'll be generated from source before being installed so we |
4644 |
- # manually install man pages. |
4645 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
4646 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
4647 |
- doins -r doc/src/sgml/man{1,3,7} |
4648 |
- if ! use server; then |
4649 |
- # Remove man pages for non-existent binaries |
4650 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
4651 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
4652 |
- done |
4653 |
- fi |
4654 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
4655 |
- |
4656 |
- insinto /etc/postgresql-${SLOT} |
4657 |
- newins src/bin/psql/psqlrc.sample psqlrc |
4658 |
- |
4659 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
4660 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
4661 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
4662 |
- |
4663 |
- use static-libs || find "${ED}" -name '*.a' -delete |
4664 |
- |
4665 |
- if use doc ; then |
4666 |
- docinto html |
4667 |
- dodoc doc/src/sgml/html/* |
4668 |
- |
4669 |
- docinto sgml |
4670 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
4671 |
- fi |
4672 |
- |
4673 |
- if use server; then |
4674 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4675 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
4676 |
- |
4677 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4678 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
4679 |
- |
4680 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
4681 |
- "${FILESDIR}/${PN}.service" | \ |
4682 |
- systemd_newunit - ${PN}-${SLOT}.service |
4683 |
- |
4684 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
4685 |
- |
4686 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
4687 |
- |
4688 |
- if use prefix ; then |
4689 |
- keepdir /run/postgresql |
4690 |
- fperms 0775 /run/postgresql |
4691 |
- fi |
4692 |
- fi |
4693 |
-} |
4694 |
- |
4695 |
-pkg_postinst() { |
4696 |
- postgresql-config update |
4697 |
- |
4698 |
- elog "If you need a global psqlrc-file, you can place it in:" |
4699 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
4700 |
- |
4701 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
4702 |
- elog |
4703 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
4704 |
- elog "following command in all active shells to pick up changes to the default" |
4705 |
- elog "environment:" |
4706 |
- elog " source /etc/profile" |
4707 |
- fi |
4708 |
- |
4709 |
- if use server ; then |
4710 |
- elog |
4711 |
- elog "Gentoo specific documentation:" |
4712 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
4713 |
- elog |
4714 |
- elog "Official documentation:" |
4715 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
4716 |
- elog |
4717 |
- elog "The default location of the Unix-domain socket is:" |
4718 |
- elog " ${EROOT%/}/run/postgresql/" |
4719 |
- elog |
4720 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
4721 |
- elog "so that it contains your preferred locale in:" |
4722 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4723 |
- elog |
4724 |
- elog "Then, execute the following command to setup the initial database" |
4725 |
- elog "environment:" |
4726 |
- elog " emerge --config =${CATEGORY}/${PF}" |
4727 |
- fi |
4728 |
-} |
4729 |
- |
4730 |
-pkg_prerm() { |
4731 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
4732 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
4733 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
4734 |
- |
4735 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
4736 |
- sleep 10 |
4737 |
- eend 0 |
4738 |
- fi |
4739 |
-} |
4740 |
- |
4741 |
-pkg_postrm() { |
4742 |
- postgresql-config update |
4743 |
-} |
4744 |
- |
4745 |
-pkg_config() { |
4746 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
4747 |
- |
4748 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
4749 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4750 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
4751 |
- [[ -z "${DATA_DIR}" ]] \ |
4752 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
4753 |
- |
4754 |
- # environment.bz2 may not contain the same locale as the current system |
4755 |
- # locale. Unset and source from the current system locale. |
4756 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
4757 |
- unset LANG |
4758 |
- unset LC_CTYPE |
4759 |
- unset LC_NUMERIC |
4760 |
- unset LC_TIME |
4761 |
- unset LC_COLLATE |
4762 |
- unset LC_MONETARY |
4763 |
- unset LC_MESSAGES |
4764 |
- unset LC_ALL |
4765 |
- source "${EROOT%/}/etc/env.d/02locale" |
4766 |
- [ -n "${LANG}" ] && export LANG |
4767 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
4768 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
4769 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
4770 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
4771 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
4772 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
4773 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
4774 |
- fi |
4775 |
- |
4776 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
4777 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
4778 |
- einfo |
4779 |
- einfo "Information on options that can be passed to initdb are found at:" |
4780 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
4781 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
4782 |
- einfo |
4783 |
- einfo "PG_INITDB_OPTS is currently set to:" |
4784 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
4785 |
- einfo " (none)" |
4786 |
- else |
4787 |
- einfo " ${PG_INITDB_OPTS}" |
4788 |
- fi |
4789 |
- einfo |
4790 |
- einfo "Configuration files will be installed to:" |
4791 |
- einfo " ${PGDATA}" |
4792 |
- einfo |
4793 |
- einfo "The database cluster will be created in:" |
4794 |
- einfo " ${DATA_DIR}" |
4795 |
- einfo |
4796 |
- while [ "$correct" != "true" ] ; do |
4797 |
- einfo "Are you ready to continue? (y/n)" |
4798 |
- read answer |
4799 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
4800 |
- correct="true" |
4801 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
4802 |
- die "Aborting initialization." |
4803 |
- else |
4804 |
- echo "Answer not recognized" |
4805 |
- fi |
4806 |
- done |
4807 |
- |
4808 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
4809 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
4810 |
- eerror "Modify DATA_DIR to point to an empty directory." |
4811 |
- die "${DATA_DIR} is not empty." |
4812 |
- fi |
4813 |
- |
4814 |
- einfo "Creating the data directory ..." |
4815 |
- if [[ ${EUID} == 0 ]] ; then |
4816 |
- mkdir -p "${DATA_DIR}" |
4817 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
4818 |
- chmod 0700 "${DATA_DIR}" |
4819 |
- fi |
4820 |
- |
4821 |
- einfo "Initializing the database ..." |
4822 |
- |
4823 |
- if [[ ${EUID} == 0 ]] ; then |
4824 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
4825 |
- else |
4826 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
4827 |
- fi |
4828 |
- |
4829 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
4830 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
4831 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
4832 |
- fi |
4833 |
- |
4834 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
4835 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
4836 |
- # On the off-chance that you might need to work with UTF-8 encoded |
4837 |
- # characters in PL/Perl |
4838 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
4839 |
- EOF |
4840 |
- |
4841 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
4842 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
4843 |
- einfo "by default. You can disable it in the cluster's:" |
4844 |
- einfo " ${PGDATA%/}/postgresql.conf" |
4845 |
- einfo |
4846 |
- einfo "The PostgreSQL server, by default, will log events to:" |
4847 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
4848 |
- einfo |
4849 |
- if use prefix ; then |
4850 |
- einfo "The location of the configuration files have moved to:" |
4851 |
- einfo " ${PGDATA}" |
4852 |
- einfo "To start the server:" |
4853 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
4854 |
- einfo "To stop:" |
4855 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
4856 |
- einfo |
4857 |
- einfo "Or move the configuration files back:" |
4858 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
4859 |
- else |
4860 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
4861 |
- einfo "instead of 'pg_ctl'." |
4862 |
- fi |
4863 |
-} |
4864 |
- |
4865 |
-src_test() { |
4866 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
4867 |
- emake check |
4868 |
- |
4869 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
4870 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
4871 |
- else |
4872 |
- use server || \ |
4873 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
4874 |
- [[ ${UID} -eq 0 ]] || \ |
4875 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
4876 |
- |
4877 |
- ewarn 'Skipping.' |
4878 |
- fi |
4879 |
-} |
4880 |
|
4881 |
diff --git a/dev-db/postgresql/postgresql-9.4.5-r2.ebuild b/dev-db/postgresql/postgresql-9.4.5-r2.ebuild |
4882 |
deleted file mode 100644 |
4883 |
index 1db7047..00000000 |
4884 |
--- a/dev-db/postgresql/postgresql-9.4.5-r2.ebuild |
4885 |
+++ /dev/null |
4886 |
@@ -1,431 +0,0 @@ |
4887 |
-# Copyright 1999-2016 Gentoo Foundation |
4888 |
-# Distributed under the terms of the GNU General Public License v2 |
4889 |
-# $Id$ |
4890 |
- |
4891 |
-EAPI="5" |
4892 |
- |
4893 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
4894 |
- |
4895 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
4896 |
- systemd user versionator |
4897 |
- |
4898 |
-KEYWORDS="alpha amd64 arm hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
4899 |
- |
4900 |
-SLOT="$(get_version_component_range 1-2)" |
4901 |
- |
4902 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
4903 |
- |
4904 |
-LICENSE="POSTGRESQL GPL-2" |
4905 |
-DESCRIPTION="PostgreSQL RDBMS" |
4906 |
-HOMEPAGE="http://www.postgresql.org/" |
4907 |
- |
4908 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
4909 |
- zh_CN zh_TW" |
4910 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
4911 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
4912 |
- |
4913 |
-for lingua in ${LINGUAS}; do |
4914 |
- IUSE+=" linguas_${lingua}" |
4915 |
-done |
4916 |
- |
4917 |
-wanted_languages() { |
4918 |
- local enable_langs |
4919 |
- |
4920 |
- for lingua in ${LINGUAS} ; do |
4921 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
4922 |
- done |
4923 |
- |
4924 |
- echo -n ${enable_langs} |
4925 |
-} |
4926 |
- |
4927 |
-CDEPEND=" |
4928 |
->=app-eselect/eselect-postgresql-1.2.0 |
4929 |
-sys-apps/less |
4930 |
-virtual/libintl |
4931 |
-kerberos? ( virtual/krb5 ) |
4932 |
-ldap? ( net-nds/openldap ) |
4933 |
-pam? ( virtual/pam ) |
4934 |
-perl? ( >=dev-lang/perl-5.8:= ) |
4935 |
-python? ( ${PYTHON_DEPS} ) |
4936 |
-readline? ( sys-libs/readline:0= ) |
4937 |
-ssl? ( |
4938 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
4939 |
- libressl? ( dev-libs/libressl:= ) |
4940 |
-) |
4941 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
4942 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
4943 |
-zlib? ( sys-libs/zlib ) |
4944 |
-" |
4945 |
- |
4946 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
4947 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
4948 |
-# the libc includes UUID functions. |
4949 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
4950 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
4951 |
- |
4952 |
-nest_usedep() { |
4953 |
- local front back |
4954 |
- while [[ ${#} -gt 1 ]]; do |
4955 |
- front+="${1}? ( " |
4956 |
- back+=" )" |
4957 |
- shift |
4958 |
- done |
4959 |
- echo "${front}${1}${back}" |
4960 |
-} |
4961 |
- |
4962 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
4963 |
-CDEPEND+=" |
4964 |
-uuid? ( |
4965 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
4966 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
4967 |
-)" |
4968 |
- |
4969 |
-DEPEND="${CDEPEND} |
4970 |
-!!<sys-apps/sandbox-2.0 |
4971 |
-sys-devel/bison |
4972 |
-sys-devel/flex |
4973 |
-nls? ( sys-devel/gettext ) |
4974 |
-xml? ( virtual/pkgconfig ) |
4975 |
-" |
4976 |
- |
4977 |
-RDEPEND="${CDEPEND} |
4978 |
-!dev-db/postgresql-docs:${SLOT} |
4979 |
-!dev-db/postgresql-base:${SLOT} |
4980 |
-!dev-db/postgresql-server:${SLOT} |
4981 |
-selinux? ( sec-policy/selinux-postgresql ) |
4982 |
-" |
4983 |
- |
4984 |
-pkg_setup() { |
4985 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
4986 |
- |
4987 |
- enewgroup postgres 70 |
4988 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
4989 |
- |
4990 |
- use python && python-single-r1_pkg_setup |
4991 |
-} |
4992 |
- |
4993 |
-src_prepare() { |
4994 |
- # Work around PPC{,64} compilation bug where bool is already defined |
4995 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
4996 |
- |
4997 |
- # Set proper run directory |
4998 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
4999 |
- -i src/include/pg_config_manual.h || die |
5000 |
- |
5001 |
- # Rely on $PATH being in the proper order so that the correct |
5002 |
- # install program is used for modules utilizing PGXS in both |
5003 |
- # hardened and non-hardened environments. (Bug #528786) |
5004 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
5005 |
- |
5006 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
5007 |
- |
5008 |
- # Fix bug 486556 where the server would crash at start up because of |
5009 |
- # an infinite loop caused by a self-referencing symlink. |
5010 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
5011 |
- |
5012 |
- if use pam ; then |
5013 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
5014 |
- -i src/backend/libpq/auth.c || \ |
5015 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
5016 |
- fi |
5017 |
- |
5018 |
- epatch_user |
5019 |
-} |
5020 |
- |
5021 |
-src_configure() { |
5022 |
- case ${CHOST} in |
5023 |
- *-darwin*|*-solaris*) |
5024 |
- use nls && append-libs intl |
5025 |
- ;; |
5026 |
- esac |
5027 |
- |
5028 |
- export LDFLAGS_SL="${LDFLAGS}" |
5029 |
- export LDFLAGS_EX="${LDFLAGS}" |
5030 |
- |
5031 |
- local PO="${EPREFIX%/}" |
5032 |
- |
5033 |
- local i uuid_config="" |
5034 |
- if use uuid; then |
5035 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
5036 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
5037 |
- done |
5038 |
- for i in ${BSD_LIBC[@]}; do |
5039 |
- use ${i} && uuid_config="--with-uuid=bsd" |
5040 |
- done |
5041 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
5042 |
- fi |
5043 |
- |
5044 |
- econf \ |
5045 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
5046 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
5047 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
5048 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
5049 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
5050 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
5051 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
5052 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
5053 |
- $(use_enable threads thread-safety) \ |
5054 |
- $(use_with kerberos gssapi) \ |
5055 |
- $(use_with ldap) \ |
5056 |
- $(use_with pam) \ |
5057 |
- $(use_with perl) \ |
5058 |
- $(use_with python) \ |
5059 |
- $(use_with readline) \ |
5060 |
- $(use_with ssl openssl) \ |
5061 |
- $(use_with tcl) \ |
5062 |
- ${uuid_config} \ |
5063 |
- $(use_with xml libxml) \ |
5064 |
- $(use_with xml libxslt) \ |
5065 |
- $(use_with zlib) \ |
5066 |
- "$(use_enable nls nls "$(wanted_languages)")" |
5067 |
-} |
5068 |
- |
5069 |
-src_compile() { |
5070 |
- emake |
5071 |
- emake -C contrib |
5072 |
-} |
5073 |
- |
5074 |
-src_install() { |
5075 |
- emake DESTDIR="${D}" install |
5076 |
- emake DESTDIR="${D}" install -C contrib |
5077 |
- |
5078 |
- dodoc README HISTORY doc/{TODO,bug.template} |
5079 |
- |
5080 |
- # man pages are already built, but if we have the target make them, |
5081 |
- # they'll be generated from source before being installed so we |
5082 |
- # manually install man pages. |
5083 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5084 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5085 |
- doins -r doc/src/sgml/man{1,3,7} |
5086 |
- if ! use server; then |
5087 |
- # Remove man pages for non-existent binaries |
5088 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
5089 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5090 |
- done |
5091 |
- fi |
5092 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5093 |
- |
5094 |
- insinto /etc/postgresql-${SLOT} |
5095 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5096 |
- |
5097 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
5098 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
5099 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
5100 |
- |
5101 |
- use static-libs || find "${ED}" -name '*.a' -delete |
5102 |
- |
5103 |
- if use doc ; then |
5104 |
- docinto html |
5105 |
- dodoc doc/src/sgml/html/* |
5106 |
- |
5107 |
- docinto sgml |
5108 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
5109 |
- fi |
5110 |
- |
5111 |
- if use server; then |
5112 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5113 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
5114 |
- |
5115 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5116 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
5117 |
- |
5118 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5119 |
- "${FILESDIR}/${PN}.service" | \ |
5120 |
- systemd_newunit - ${PN}-${SLOT}.service |
5121 |
- |
5122 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5123 |
- |
5124 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
5125 |
- |
5126 |
- if use prefix ; then |
5127 |
- keepdir /run/postgresql |
5128 |
- fperms 0775 /run/postgresql |
5129 |
- fi |
5130 |
- fi |
5131 |
-} |
5132 |
- |
5133 |
-pkg_postinst() { |
5134 |
- postgresql-config update |
5135 |
- |
5136 |
- elog "If you need a global psqlrc-file, you can place it in:" |
5137 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
5138 |
- |
5139 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
5140 |
- elog |
5141 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
5142 |
- elog "following command in all active shells to pick up changes to the default" |
5143 |
- elog "environment:" |
5144 |
- elog " source /etc/profile" |
5145 |
- fi |
5146 |
- |
5147 |
- if use server ; then |
5148 |
- elog |
5149 |
- elog "Gentoo specific documentation:" |
5150 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
5151 |
- elog |
5152 |
- elog "Official documentation:" |
5153 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
5154 |
- elog |
5155 |
- elog "The default location of the Unix-domain socket is:" |
5156 |
- elog " ${EROOT%/}/run/postgresql/" |
5157 |
- elog |
5158 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
5159 |
- elog "so that it contains your preferred locale in:" |
5160 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5161 |
- elog |
5162 |
- elog "Then, execute the following command to setup the initial database" |
5163 |
- elog "environment:" |
5164 |
- elog " emerge --config =${CATEGORY}/${PF}" |
5165 |
- fi |
5166 |
-} |
5167 |
- |
5168 |
-pkg_prerm() { |
5169 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
5170 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
5171 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
5172 |
- |
5173 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
5174 |
- sleep 10 |
5175 |
- eend 0 |
5176 |
- fi |
5177 |
-} |
5178 |
- |
5179 |
-pkg_postrm() { |
5180 |
- postgresql-config update |
5181 |
-} |
5182 |
- |
5183 |
-pkg_config() { |
5184 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
5185 |
- |
5186 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
5187 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5188 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
5189 |
- [[ -z "${DATA_DIR}" ]] \ |
5190 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
5191 |
- |
5192 |
- # environment.bz2 may not contain the same locale as the current system |
5193 |
- # locale. Unset and source from the current system locale. |
5194 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
5195 |
- unset LANG |
5196 |
- unset LC_CTYPE |
5197 |
- unset LC_NUMERIC |
5198 |
- unset LC_TIME |
5199 |
- unset LC_COLLATE |
5200 |
- unset LC_MONETARY |
5201 |
- unset LC_MESSAGES |
5202 |
- unset LC_ALL |
5203 |
- source "${EROOT%/}/etc/env.d/02locale" |
5204 |
- [ -n "${LANG}" ] && export LANG |
5205 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
5206 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
5207 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
5208 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
5209 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
5210 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
5211 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
5212 |
- fi |
5213 |
- |
5214 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
5215 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5216 |
- einfo |
5217 |
- einfo "Information on options that can be passed to initdb are found at:" |
5218 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
5219 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
5220 |
- einfo |
5221 |
- einfo "PG_INITDB_OPTS is currently set to:" |
5222 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
5223 |
- einfo " (none)" |
5224 |
- else |
5225 |
- einfo " ${PG_INITDB_OPTS}" |
5226 |
- fi |
5227 |
- einfo |
5228 |
- einfo "Configuration files will be installed to:" |
5229 |
- einfo " ${PGDATA}" |
5230 |
- einfo |
5231 |
- einfo "The database cluster will be created in:" |
5232 |
- einfo " ${DATA_DIR}" |
5233 |
- einfo |
5234 |
- while [ "$correct" != "true" ] ; do |
5235 |
- einfo "Are you ready to continue? (y/n)" |
5236 |
- read answer |
5237 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
5238 |
- correct="true" |
5239 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
5240 |
- die "Aborting initialization." |
5241 |
- else |
5242 |
- echo "Answer not recognized" |
5243 |
- fi |
5244 |
- done |
5245 |
- |
5246 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
5247 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
5248 |
- eerror "Modify DATA_DIR to point to an empty directory." |
5249 |
- die "${DATA_DIR} is not empty." |
5250 |
- fi |
5251 |
- |
5252 |
- einfo "Creating the data directory ..." |
5253 |
- if [[ ${EUID} == 0 ]] ; then |
5254 |
- mkdir -p "${DATA_DIR}" |
5255 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
5256 |
- chmod 0700 "${DATA_DIR}" |
5257 |
- fi |
5258 |
- |
5259 |
- einfo "Initializing the database ..." |
5260 |
- |
5261 |
- if [[ ${EUID} == 0 ]] ; then |
5262 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
5263 |
- else |
5264 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
5265 |
- fi |
5266 |
- |
5267 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5268 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5269 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5270 |
- fi |
5271 |
- |
5272 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5273 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5274 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5275 |
- # characters in PL/Perl |
5276 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5277 |
- EOF |
5278 |
- |
5279 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5280 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5281 |
- einfo "by default. You can disable it in the cluster's:" |
5282 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5283 |
- einfo |
5284 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5285 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5286 |
- einfo |
5287 |
- if use prefix ; then |
5288 |
- einfo "The location of the configuration files have moved to:" |
5289 |
- einfo " ${PGDATA}" |
5290 |
- einfo "To start the server:" |
5291 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5292 |
- einfo "To stop:" |
5293 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5294 |
- einfo |
5295 |
- einfo "Or move the configuration files back:" |
5296 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5297 |
- else |
5298 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5299 |
- einfo "instead of 'pg_ctl'." |
5300 |
- fi |
5301 |
-} |
5302 |
- |
5303 |
-src_test() { |
5304 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5305 |
- emake check |
5306 |
- |
5307 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5308 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5309 |
- else |
5310 |
- use server || \ |
5311 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5312 |
- [[ ${UID} -eq 0 ]] || \ |
5313 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5314 |
- |
5315 |
- ewarn 'Skipping.' |
5316 |
- fi |
5317 |
-} |
5318 |
|
5319 |
diff --git a/dev-db/postgresql/postgresql-9.4.6.ebuild b/dev-db/postgresql/postgresql-9.4.6.ebuild |
5320 |
deleted file mode 100644 |
5321 |
index da7c631..00000000 |
5322 |
--- a/dev-db/postgresql/postgresql-9.4.6.ebuild |
5323 |
+++ /dev/null |
5324 |
@@ -1,431 +0,0 @@ |
5325 |
-# Copyright 1999-2016 Gentoo Foundation |
5326 |
-# Distributed under the terms of the GNU General Public License v2 |
5327 |
-# $Id$ |
5328 |
- |
5329 |
-EAPI="5" |
5330 |
- |
5331 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
5332 |
- |
5333 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
5334 |
- systemd user versionator |
5335 |
- |
5336 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
5337 |
- |
5338 |
-SLOT="$(get_version_component_range 1-2)" |
5339 |
- |
5340 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
5341 |
- |
5342 |
-LICENSE="POSTGRESQL GPL-2" |
5343 |
-DESCRIPTION="PostgreSQL RDBMS" |
5344 |
-HOMEPAGE="http://www.postgresql.org/" |
5345 |
- |
5346 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
5347 |
- zh_CN zh_TW" |
5348 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
5349 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
5350 |
- |
5351 |
-for lingua in ${LINGUAS}; do |
5352 |
- IUSE+=" linguas_${lingua}" |
5353 |
-done |
5354 |
- |
5355 |
-wanted_languages() { |
5356 |
- local enable_langs |
5357 |
- |
5358 |
- for lingua in ${LINGUAS} ; do |
5359 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
5360 |
- done |
5361 |
- |
5362 |
- echo -n ${enable_langs} |
5363 |
-} |
5364 |
- |
5365 |
-CDEPEND=" |
5366 |
->=app-eselect/eselect-postgresql-1.2.0 |
5367 |
-sys-apps/less |
5368 |
-virtual/libintl |
5369 |
-kerberos? ( virtual/krb5 ) |
5370 |
-ldap? ( net-nds/openldap ) |
5371 |
-pam? ( virtual/pam ) |
5372 |
-perl? ( >=dev-lang/perl-5.8:= ) |
5373 |
-python? ( ${PYTHON_DEPS} ) |
5374 |
-readline? ( sys-libs/readline:0= ) |
5375 |
-ssl? ( |
5376 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
5377 |
- libressl? ( dev-libs/libressl:= ) |
5378 |
-) |
5379 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
5380 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
5381 |
-zlib? ( sys-libs/zlib ) |
5382 |
-" |
5383 |
- |
5384 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
5385 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
5386 |
-# the libc includes UUID functions. |
5387 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
5388 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
5389 |
- |
5390 |
-nest_usedep() { |
5391 |
- local front back |
5392 |
- while [[ ${#} -gt 1 ]]; do |
5393 |
- front+="${1}? ( " |
5394 |
- back+=" )" |
5395 |
- shift |
5396 |
- done |
5397 |
- echo "${front}${1}${back}" |
5398 |
-} |
5399 |
- |
5400 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
5401 |
-CDEPEND+=" |
5402 |
-uuid? ( |
5403 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
5404 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
5405 |
-)" |
5406 |
- |
5407 |
-DEPEND="${CDEPEND} |
5408 |
-!!<sys-apps/sandbox-2.0 |
5409 |
-sys-devel/bison |
5410 |
-sys-devel/flex |
5411 |
-nls? ( sys-devel/gettext ) |
5412 |
-xml? ( virtual/pkgconfig ) |
5413 |
-" |
5414 |
- |
5415 |
-RDEPEND="${CDEPEND} |
5416 |
-!dev-db/postgresql-docs:${SLOT} |
5417 |
-!dev-db/postgresql-base:${SLOT} |
5418 |
-!dev-db/postgresql-server:${SLOT} |
5419 |
-selinux? ( sec-policy/selinux-postgresql ) |
5420 |
-" |
5421 |
- |
5422 |
-pkg_setup() { |
5423 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
5424 |
- |
5425 |
- enewgroup postgres 70 |
5426 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
5427 |
- |
5428 |
- use python && python-single-r1_pkg_setup |
5429 |
-} |
5430 |
- |
5431 |
-src_prepare() { |
5432 |
- # Work around PPC{,64} compilation bug where bool is already defined |
5433 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
5434 |
- |
5435 |
- # Set proper run directory |
5436 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
5437 |
- -i src/include/pg_config_manual.h || die |
5438 |
- |
5439 |
- # Rely on $PATH being in the proper order so that the correct |
5440 |
- # install program is used for modules utilizing PGXS in both |
5441 |
- # hardened and non-hardened environments. (Bug #528786) |
5442 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
5443 |
- |
5444 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
5445 |
- |
5446 |
- # Fix bug 486556 where the server would crash at start up because of |
5447 |
- # an infinite loop caused by a self-referencing symlink. |
5448 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
5449 |
- |
5450 |
- if use pam ; then |
5451 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
5452 |
- -i src/backend/libpq/auth.c || \ |
5453 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
5454 |
- fi |
5455 |
- |
5456 |
- epatch_user |
5457 |
-} |
5458 |
- |
5459 |
-src_configure() { |
5460 |
- case ${CHOST} in |
5461 |
- *-darwin*|*-solaris*) |
5462 |
- use nls && append-libs intl |
5463 |
- ;; |
5464 |
- esac |
5465 |
- |
5466 |
- export LDFLAGS_SL="${LDFLAGS}" |
5467 |
- export LDFLAGS_EX="${LDFLAGS}" |
5468 |
- |
5469 |
- local PO="${EPREFIX%/}" |
5470 |
- |
5471 |
- local i uuid_config="" |
5472 |
- if use uuid; then |
5473 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
5474 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
5475 |
- done |
5476 |
- for i in ${BSD_LIBC[@]}; do |
5477 |
- use ${i} && uuid_config="--with-uuid=bsd" |
5478 |
- done |
5479 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
5480 |
- fi |
5481 |
- |
5482 |
- econf \ |
5483 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
5484 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
5485 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
5486 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
5487 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
5488 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
5489 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
5490 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
5491 |
- $(use_enable threads thread-safety) \ |
5492 |
- $(use_with kerberos gssapi) \ |
5493 |
- $(use_with ldap) \ |
5494 |
- $(use_with pam) \ |
5495 |
- $(use_with perl) \ |
5496 |
- $(use_with python) \ |
5497 |
- $(use_with readline) \ |
5498 |
- $(use_with ssl openssl) \ |
5499 |
- $(use_with tcl) \ |
5500 |
- ${uuid_config} \ |
5501 |
- $(use_with xml libxml) \ |
5502 |
- $(use_with xml libxslt) \ |
5503 |
- $(use_with zlib) \ |
5504 |
- "$(use_enable nls nls "$(wanted_languages)")" |
5505 |
-} |
5506 |
- |
5507 |
-src_compile() { |
5508 |
- emake |
5509 |
- emake -C contrib |
5510 |
-} |
5511 |
- |
5512 |
-src_install() { |
5513 |
- emake DESTDIR="${D}" install |
5514 |
- emake DESTDIR="${D}" install -C contrib |
5515 |
- |
5516 |
- dodoc README HISTORY doc/{TODO,bug.template} |
5517 |
- |
5518 |
- # man pages are already built, but if we have the target make them, |
5519 |
- # they'll be generated from source before being installed so we |
5520 |
- # manually install man pages. |
5521 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5522 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5523 |
- doins -r doc/src/sgml/man{1,3,7} |
5524 |
- if ! use server; then |
5525 |
- # Remove man pages for non-existent binaries |
5526 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
5527 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5528 |
- done |
5529 |
- fi |
5530 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5531 |
- |
5532 |
- insinto /etc/postgresql-${SLOT} |
5533 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5534 |
- |
5535 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
5536 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
5537 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
5538 |
- |
5539 |
- use static-libs || find "${ED}" -name '*.a' -delete |
5540 |
- |
5541 |
- if use doc ; then |
5542 |
- docinto html |
5543 |
- dodoc doc/src/sgml/html/* |
5544 |
- |
5545 |
- docinto sgml |
5546 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
5547 |
- fi |
5548 |
- |
5549 |
- if use server; then |
5550 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5551 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
5552 |
- |
5553 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5554 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
5555 |
- |
5556 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5557 |
- "${FILESDIR}/${PN}.service" | \ |
5558 |
- systemd_newunit - ${PN}-${SLOT}.service |
5559 |
- |
5560 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5561 |
- |
5562 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
5563 |
- |
5564 |
- if use prefix ; then |
5565 |
- keepdir /run/postgresql |
5566 |
- fperms 0775 /run/postgresql |
5567 |
- fi |
5568 |
- fi |
5569 |
-} |
5570 |
- |
5571 |
-pkg_postinst() { |
5572 |
- postgresql-config update |
5573 |
- |
5574 |
- elog "If you need a global psqlrc-file, you can place it in:" |
5575 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
5576 |
- |
5577 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
5578 |
- elog |
5579 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
5580 |
- elog "following command in all active shells to pick up changes to the default" |
5581 |
- elog "environment:" |
5582 |
- elog " source /etc/profile" |
5583 |
- fi |
5584 |
- |
5585 |
- if use server ; then |
5586 |
- elog |
5587 |
- elog "Gentoo specific documentation:" |
5588 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
5589 |
- elog |
5590 |
- elog "Official documentation:" |
5591 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
5592 |
- elog |
5593 |
- elog "The default location of the Unix-domain socket is:" |
5594 |
- elog " ${EROOT%/}/run/postgresql/" |
5595 |
- elog |
5596 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
5597 |
- elog "so that it contains your preferred locale in:" |
5598 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5599 |
- elog |
5600 |
- elog "Then, execute the following command to setup the initial database" |
5601 |
- elog "environment:" |
5602 |
- elog " emerge --config =${CATEGORY}/${PF}" |
5603 |
- fi |
5604 |
-} |
5605 |
- |
5606 |
-pkg_prerm() { |
5607 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
5608 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
5609 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
5610 |
- |
5611 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
5612 |
- sleep 10 |
5613 |
- eend 0 |
5614 |
- fi |
5615 |
-} |
5616 |
- |
5617 |
-pkg_postrm() { |
5618 |
- postgresql-config update |
5619 |
-} |
5620 |
- |
5621 |
-pkg_config() { |
5622 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
5623 |
- |
5624 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
5625 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5626 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
5627 |
- [[ -z "${DATA_DIR}" ]] \ |
5628 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
5629 |
- |
5630 |
- # environment.bz2 may not contain the same locale as the current system |
5631 |
- # locale. Unset and source from the current system locale. |
5632 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
5633 |
- unset LANG |
5634 |
- unset LC_CTYPE |
5635 |
- unset LC_NUMERIC |
5636 |
- unset LC_TIME |
5637 |
- unset LC_COLLATE |
5638 |
- unset LC_MONETARY |
5639 |
- unset LC_MESSAGES |
5640 |
- unset LC_ALL |
5641 |
- source "${EROOT%/}/etc/env.d/02locale" |
5642 |
- [ -n "${LANG}" ] && export LANG |
5643 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
5644 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
5645 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
5646 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
5647 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
5648 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
5649 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
5650 |
- fi |
5651 |
- |
5652 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
5653 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
5654 |
- einfo |
5655 |
- einfo "Information on options that can be passed to initdb are found at:" |
5656 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
5657 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
5658 |
- einfo |
5659 |
- einfo "PG_INITDB_OPTS is currently set to:" |
5660 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
5661 |
- einfo " (none)" |
5662 |
- else |
5663 |
- einfo " ${PG_INITDB_OPTS}" |
5664 |
- fi |
5665 |
- einfo |
5666 |
- einfo "Configuration files will be installed to:" |
5667 |
- einfo " ${PGDATA}" |
5668 |
- einfo |
5669 |
- einfo "The database cluster will be created in:" |
5670 |
- einfo " ${DATA_DIR}" |
5671 |
- einfo |
5672 |
- while [ "$correct" != "true" ] ; do |
5673 |
- einfo "Are you ready to continue? (y/n)" |
5674 |
- read answer |
5675 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
5676 |
- correct="true" |
5677 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
5678 |
- die "Aborting initialization." |
5679 |
- else |
5680 |
- echo "Answer not recognized" |
5681 |
- fi |
5682 |
- done |
5683 |
- |
5684 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
5685 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
5686 |
- eerror "Modify DATA_DIR to point to an empty directory." |
5687 |
- die "${DATA_DIR} is not empty." |
5688 |
- fi |
5689 |
- |
5690 |
- einfo "Creating the data directory ..." |
5691 |
- if [[ ${EUID} == 0 ]] ; then |
5692 |
- mkdir -p "${DATA_DIR}" |
5693 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
5694 |
- chmod 0700 "${DATA_DIR}" |
5695 |
- fi |
5696 |
- |
5697 |
- einfo "Initializing the database ..." |
5698 |
- |
5699 |
- if [[ ${EUID} == 0 ]] ; then |
5700 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
5701 |
- else |
5702 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
5703 |
- fi |
5704 |
- |
5705 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
5706 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
5707 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
5708 |
- fi |
5709 |
- |
5710 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
5711 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
5712 |
- # On the off-chance that you might need to work with UTF-8 encoded |
5713 |
- # characters in PL/Perl |
5714 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
5715 |
- EOF |
5716 |
- |
5717 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
5718 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
5719 |
- einfo "by default. You can disable it in the cluster's:" |
5720 |
- einfo " ${PGDATA%/}/postgresql.conf" |
5721 |
- einfo |
5722 |
- einfo "The PostgreSQL server, by default, will log events to:" |
5723 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
5724 |
- einfo |
5725 |
- if use prefix ; then |
5726 |
- einfo "The location of the configuration files have moved to:" |
5727 |
- einfo " ${PGDATA}" |
5728 |
- einfo "To start the server:" |
5729 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
5730 |
- einfo "To stop:" |
5731 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
5732 |
- einfo |
5733 |
- einfo "Or move the configuration files back:" |
5734 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
5735 |
- else |
5736 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
5737 |
- einfo "instead of 'pg_ctl'." |
5738 |
- fi |
5739 |
-} |
5740 |
- |
5741 |
-src_test() { |
5742 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
5743 |
- emake check |
5744 |
- |
5745 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
5746 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
5747 |
- else |
5748 |
- use server || \ |
5749 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
5750 |
- [[ ${UID} -eq 0 ]] || \ |
5751 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
5752 |
- |
5753 |
- ewarn 'Skipping.' |
5754 |
- fi |
5755 |
-} |
5756 |
|
5757 |
diff --git a/dev-db/postgresql/postgresql-9.4.8.ebuild b/dev-db/postgresql/postgresql-9.4.8.ebuild |
5758 |
deleted file mode 100644 |
5759 |
index 42b20ad..00000000 |
5760 |
--- a/dev-db/postgresql/postgresql-9.4.8.ebuild |
5761 |
+++ /dev/null |
5762 |
@@ -1,431 +0,0 @@ |
5763 |
-# Copyright 1999-2016 Gentoo Foundation |
5764 |
-# Distributed under the terms of the GNU General Public License v2 |
5765 |
-# $Id$ |
5766 |
- |
5767 |
-EAPI="5" |
5768 |
- |
5769 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
5770 |
- |
5771 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
5772 |
- systemd user versionator |
5773 |
- |
5774 |
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
5775 |
- |
5776 |
-SLOT="$(get_version_component_range 1-2)" |
5777 |
- |
5778 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
5779 |
- |
5780 |
-LICENSE="POSTGRESQL GPL-2" |
5781 |
-DESCRIPTION="PostgreSQL RDBMS" |
5782 |
-HOMEPAGE="http://www.postgresql.org/" |
5783 |
- |
5784 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
5785 |
- zh_CN zh_TW" |
5786 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
5787 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
5788 |
- |
5789 |
-for lingua in ${LINGUAS}; do |
5790 |
- IUSE+=" linguas_${lingua}" |
5791 |
-done |
5792 |
- |
5793 |
-wanted_languages() { |
5794 |
- local enable_langs |
5795 |
- |
5796 |
- for lingua in ${LINGUAS} ; do |
5797 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
5798 |
- done |
5799 |
- |
5800 |
- echo -n ${enable_langs} |
5801 |
-} |
5802 |
- |
5803 |
-CDEPEND=" |
5804 |
->=app-eselect/eselect-postgresql-1.2.0 |
5805 |
-sys-apps/less |
5806 |
-virtual/libintl |
5807 |
-kerberos? ( virtual/krb5 ) |
5808 |
-ldap? ( net-nds/openldap ) |
5809 |
-pam? ( virtual/pam ) |
5810 |
-perl? ( >=dev-lang/perl-5.8:= ) |
5811 |
-python? ( ${PYTHON_DEPS} ) |
5812 |
-readline? ( sys-libs/readline:0= ) |
5813 |
-ssl? ( |
5814 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
5815 |
- libressl? ( dev-libs/libressl:= ) |
5816 |
-) |
5817 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
5818 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
5819 |
-zlib? ( sys-libs/zlib ) |
5820 |
-" |
5821 |
- |
5822 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
5823 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
5824 |
-# the libc includes UUID functions. |
5825 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
5826 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
5827 |
- |
5828 |
-nest_usedep() { |
5829 |
- local front back |
5830 |
- while [[ ${#} -gt 1 ]]; do |
5831 |
- front+="${1}? ( " |
5832 |
- back+=" )" |
5833 |
- shift |
5834 |
- done |
5835 |
- echo "${front}${1}${back}" |
5836 |
-} |
5837 |
- |
5838 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
5839 |
-CDEPEND+=" |
5840 |
-uuid? ( |
5841 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
5842 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
5843 |
-)" |
5844 |
- |
5845 |
-DEPEND="${CDEPEND} |
5846 |
-!!<sys-apps/sandbox-2.0 |
5847 |
-sys-devel/bison |
5848 |
-sys-devel/flex |
5849 |
-nls? ( sys-devel/gettext ) |
5850 |
-xml? ( virtual/pkgconfig ) |
5851 |
-" |
5852 |
- |
5853 |
-RDEPEND="${CDEPEND} |
5854 |
-!dev-db/postgresql-docs:${SLOT} |
5855 |
-!dev-db/postgresql-base:${SLOT} |
5856 |
-!dev-db/postgresql-server:${SLOT} |
5857 |
-selinux? ( sec-policy/selinux-postgresql ) |
5858 |
-" |
5859 |
- |
5860 |
-pkg_setup() { |
5861 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
5862 |
- |
5863 |
- enewgroup postgres 70 |
5864 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
5865 |
- |
5866 |
- use python && python-single-r1_pkg_setup |
5867 |
-} |
5868 |
- |
5869 |
-src_prepare() { |
5870 |
- # Work around PPC{,64} compilation bug where bool is already defined |
5871 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
5872 |
- |
5873 |
- # Set proper run directory |
5874 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
5875 |
- -i src/include/pg_config_manual.h || die |
5876 |
- |
5877 |
- # Rely on $PATH being in the proper order so that the correct |
5878 |
- # install program is used for modules utilizing PGXS in both |
5879 |
- # hardened and non-hardened environments. (Bug #528786) |
5880 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
5881 |
- |
5882 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
5883 |
- |
5884 |
- # Fix bug 486556 where the server would crash at start up because of |
5885 |
- # an infinite loop caused by a self-referencing symlink. |
5886 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
5887 |
- |
5888 |
- if use pam ; then |
5889 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
5890 |
- -i src/backend/libpq/auth.c || \ |
5891 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
5892 |
- fi |
5893 |
- |
5894 |
- epatch_user |
5895 |
-} |
5896 |
- |
5897 |
-src_configure() { |
5898 |
- case ${CHOST} in |
5899 |
- *-darwin*|*-solaris*) |
5900 |
- use nls && append-libs intl |
5901 |
- ;; |
5902 |
- esac |
5903 |
- |
5904 |
- export LDFLAGS_SL="${LDFLAGS}" |
5905 |
- export LDFLAGS_EX="${LDFLAGS}" |
5906 |
- |
5907 |
- local PO="${EPREFIX%/}" |
5908 |
- |
5909 |
- local i uuid_config="" |
5910 |
- if use uuid; then |
5911 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
5912 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
5913 |
- done |
5914 |
- for i in ${BSD_LIBC[@]}; do |
5915 |
- use ${i} && uuid_config="--with-uuid=bsd" |
5916 |
- done |
5917 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
5918 |
- fi |
5919 |
- |
5920 |
- econf \ |
5921 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
5922 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
5923 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
5924 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
5925 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
5926 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
5927 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
5928 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
5929 |
- $(use_enable threads thread-safety) \ |
5930 |
- $(use_with kerberos gssapi) \ |
5931 |
- $(use_with ldap) \ |
5932 |
- $(use_with pam) \ |
5933 |
- $(use_with perl) \ |
5934 |
- $(use_with python) \ |
5935 |
- $(use_with readline) \ |
5936 |
- $(use_with ssl openssl) \ |
5937 |
- $(use_with tcl) \ |
5938 |
- ${uuid_config} \ |
5939 |
- $(use_with xml libxml) \ |
5940 |
- $(use_with xml libxslt) \ |
5941 |
- $(use_with zlib) \ |
5942 |
- "$(use_enable nls nls "$(wanted_languages)")" |
5943 |
-} |
5944 |
- |
5945 |
-src_compile() { |
5946 |
- emake |
5947 |
- emake -C contrib |
5948 |
-} |
5949 |
- |
5950 |
-src_install() { |
5951 |
- emake DESTDIR="${D}" install |
5952 |
- emake DESTDIR="${D}" install -C contrib |
5953 |
- |
5954 |
- dodoc README HISTORY doc/{TODO,bug.template} |
5955 |
- |
5956 |
- # man pages are already built, but if we have the target make them, |
5957 |
- # they'll be generated from source before being installed so we |
5958 |
- # manually install man pages. |
5959 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
5960 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
5961 |
- doins -r doc/src/sgml/man{1,3,7} |
5962 |
- if ! use server; then |
5963 |
- # Remove man pages for non-existent binaries |
5964 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
5965 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
5966 |
- done |
5967 |
- fi |
5968 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
5969 |
- |
5970 |
- insinto /etc/postgresql-${SLOT} |
5971 |
- newins src/bin/psql/psqlrc.sample psqlrc |
5972 |
- |
5973 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
5974 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
5975 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
5976 |
- |
5977 |
- use static-libs || find "${ED}" -name '*.a' -delete |
5978 |
- |
5979 |
- if use doc ; then |
5980 |
- docinto html |
5981 |
- dodoc doc/src/sgml/html/* |
5982 |
- |
5983 |
- docinto sgml |
5984 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
5985 |
- fi |
5986 |
- |
5987 |
- if use server; then |
5988 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5989 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
5990 |
- |
5991 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5992 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
5993 |
- |
5994 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
5995 |
- "${FILESDIR}/${PN}.service" | \ |
5996 |
- systemd_newunit - ${PN}-${SLOT}.service |
5997 |
- |
5998 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
5999 |
- |
6000 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
6001 |
- |
6002 |
- if use prefix ; then |
6003 |
- keepdir /run/postgresql |
6004 |
- fperms 0775 /run/postgresql |
6005 |
- fi |
6006 |
- fi |
6007 |
-} |
6008 |
- |
6009 |
-pkg_postinst() { |
6010 |
- postgresql-config update |
6011 |
- |
6012 |
- elog "If you need a global psqlrc-file, you can place it in:" |
6013 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
6014 |
- |
6015 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
6016 |
- elog |
6017 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
6018 |
- elog "following command in all active shells to pick up changes to the default" |
6019 |
- elog "environment:" |
6020 |
- elog " source /etc/profile" |
6021 |
- fi |
6022 |
- |
6023 |
- if use server ; then |
6024 |
- elog |
6025 |
- elog "Gentoo specific documentation:" |
6026 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
6027 |
- elog |
6028 |
- elog "Official documentation:" |
6029 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
6030 |
- elog |
6031 |
- elog "The default location of the Unix-domain socket is:" |
6032 |
- elog " ${EROOT%/}/run/postgresql/" |
6033 |
- elog |
6034 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
6035 |
- elog "so that it contains your preferred locale in:" |
6036 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6037 |
- elog |
6038 |
- elog "Then, execute the following command to setup the initial database" |
6039 |
- elog "environment:" |
6040 |
- elog " emerge --config =${CATEGORY}/${PF}" |
6041 |
- fi |
6042 |
-} |
6043 |
- |
6044 |
-pkg_prerm() { |
6045 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
6046 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
6047 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
6048 |
- |
6049 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
6050 |
- sleep 10 |
6051 |
- eend 0 |
6052 |
- fi |
6053 |
-} |
6054 |
- |
6055 |
-pkg_postrm() { |
6056 |
- postgresql-config update |
6057 |
-} |
6058 |
- |
6059 |
-pkg_config() { |
6060 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
6061 |
- |
6062 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
6063 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6064 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
6065 |
- [[ -z "${DATA_DIR}" ]] \ |
6066 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
6067 |
- |
6068 |
- # environment.bz2 may not contain the same locale as the current system |
6069 |
- # locale. Unset and source from the current system locale. |
6070 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
6071 |
- unset LANG |
6072 |
- unset LC_CTYPE |
6073 |
- unset LC_NUMERIC |
6074 |
- unset LC_TIME |
6075 |
- unset LC_COLLATE |
6076 |
- unset LC_MONETARY |
6077 |
- unset LC_MESSAGES |
6078 |
- unset LC_ALL |
6079 |
- source "${EROOT%/}/etc/env.d/02locale" |
6080 |
- [ -n "${LANG}" ] && export LANG |
6081 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
6082 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
6083 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
6084 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
6085 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
6086 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
6087 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
6088 |
- fi |
6089 |
- |
6090 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
6091 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6092 |
- einfo |
6093 |
- einfo "Information on options that can be passed to initdb are found at:" |
6094 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
6095 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
6096 |
- einfo |
6097 |
- einfo "PG_INITDB_OPTS is currently set to:" |
6098 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
6099 |
- einfo " (none)" |
6100 |
- else |
6101 |
- einfo " ${PG_INITDB_OPTS}" |
6102 |
- fi |
6103 |
- einfo |
6104 |
- einfo "Configuration files will be installed to:" |
6105 |
- einfo " ${PGDATA}" |
6106 |
- einfo |
6107 |
- einfo "The database cluster will be created in:" |
6108 |
- einfo " ${DATA_DIR}" |
6109 |
- einfo |
6110 |
- while [ "$correct" != "true" ] ; do |
6111 |
- einfo "Are you ready to continue? (y/n)" |
6112 |
- read answer |
6113 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
6114 |
- correct="true" |
6115 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
6116 |
- die "Aborting initialization." |
6117 |
- else |
6118 |
- echo "Answer not recognized" |
6119 |
- fi |
6120 |
- done |
6121 |
- |
6122 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
6123 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
6124 |
- eerror "Modify DATA_DIR to point to an empty directory." |
6125 |
- die "${DATA_DIR} is not empty." |
6126 |
- fi |
6127 |
- |
6128 |
- einfo "Creating the data directory ..." |
6129 |
- if [[ ${EUID} == 0 ]] ; then |
6130 |
- mkdir -p "${DATA_DIR}" |
6131 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
6132 |
- chmod 0700 "${DATA_DIR}" |
6133 |
- fi |
6134 |
- |
6135 |
- einfo "Initializing the database ..." |
6136 |
- |
6137 |
- if [[ ${EUID} == 0 ]] ; then |
6138 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
6139 |
- else |
6140 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
6141 |
- fi |
6142 |
- |
6143 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
6144 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
6145 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
6146 |
- fi |
6147 |
- |
6148 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
6149 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
6150 |
- # On the off-chance that you might need to work with UTF-8 encoded |
6151 |
- # characters in PL/Perl |
6152 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
6153 |
- EOF |
6154 |
- |
6155 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
6156 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
6157 |
- einfo "by default. You can disable it in the cluster's:" |
6158 |
- einfo " ${PGDATA%/}/postgresql.conf" |
6159 |
- einfo |
6160 |
- einfo "The PostgreSQL server, by default, will log events to:" |
6161 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
6162 |
- einfo |
6163 |
- if use prefix ; then |
6164 |
- einfo "The location of the configuration files have moved to:" |
6165 |
- einfo " ${PGDATA}" |
6166 |
- einfo "To start the server:" |
6167 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
6168 |
- einfo "To stop:" |
6169 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
6170 |
- einfo |
6171 |
- einfo "Or move the configuration files back:" |
6172 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
6173 |
- else |
6174 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
6175 |
- einfo "instead of 'pg_ctl'." |
6176 |
- fi |
6177 |
-} |
6178 |
- |
6179 |
-src_test() { |
6180 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
6181 |
- emake check |
6182 |
- |
6183 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
6184 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
6185 |
- else |
6186 |
- use server || \ |
6187 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
6188 |
- [[ ${UID} -eq 0 ]] || \ |
6189 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
6190 |
- |
6191 |
- ewarn 'Skipping.' |
6192 |
- fi |
6193 |
-} |
6194 |
|
6195 |
diff --git a/dev-db/postgresql/postgresql-9.5.1.ebuild b/dev-db/postgresql/postgresql-9.5.1.ebuild |
6196 |
deleted file mode 100644 |
6197 |
index 7fcf423..00000000 |
6198 |
--- a/dev-db/postgresql/postgresql-9.5.1.ebuild |
6199 |
+++ /dev/null |
6200 |
@@ -1,431 +0,0 @@ |
6201 |
-# Copyright 1999-2016 Gentoo Foundation |
6202 |
-# Distributed under the terms of the GNU General Public License v2 |
6203 |
-# $Id$ |
6204 |
- |
6205 |
-EAPI="5" |
6206 |
- |
6207 |
-PYTHON_COMPAT=( python{2_7,3_4} ) |
6208 |
- |
6209 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
6210 |
- systemd user versionator |
6211 |
- |
6212 |
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
6213 |
- |
6214 |
-SLOT="$(get_version_component_range 1-2)" |
6215 |
- |
6216 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
6217 |
- |
6218 |
-LICENSE="POSTGRESQL GPL-2" |
6219 |
-DESCRIPTION="PostgreSQL RDBMS" |
6220 |
-HOMEPAGE="http://www.postgresql.org/" |
6221 |
- |
6222 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
6223 |
- zh_CN zh_TW" |
6224 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
6225 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
6226 |
- |
6227 |
-for lingua in ${LINGUAS}; do |
6228 |
- IUSE+=" linguas_${lingua}" |
6229 |
-done |
6230 |
- |
6231 |
-wanted_languages() { |
6232 |
- local enable_langs |
6233 |
- |
6234 |
- for lingua in ${LINGUAS} ; do |
6235 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
6236 |
- done |
6237 |
- |
6238 |
- echo -n ${enable_langs} |
6239 |
-} |
6240 |
- |
6241 |
-CDEPEND=" |
6242 |
->=app-eselect/eselect-postgresql-1.2.0 |
6243 |
-sys-apps/less |
6244 |
-virtual/libintl |
6245 |
-kerberos? ( virtual/krb5 ) |
6246 |
-ldap? ( net-nds/openldap ) |
6247 |
-pam? ( virtual/pam ) |
6248 |
-perl? ( >=dev-lang/perl-5.8:= ) |
6249 |
-python? ( ${PYTHON_DEPS} ) |
6250 |
-readline? ( sys-libs/readline:0= ) |
6251 |
-ssl? ( |
6252 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
6253 |
- libressl? ( dev-libs/libressl:= ) |
6254 |
-) |
6255 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
6256 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
6257 |
-zlib? ( sys-libs/zlib ) |
6258 |
-" |
6259 |
- |
6260 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
6261 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
6262 |
-# the libc includes UUID functions. |
6263 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
6264 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
6265 |
- |
6266 |
-nest_usedep() { |
6267 |
- local front back |
6268 |
- while [[ ${#} -gt 1 ]]; do |
6269 |
- front+="${1}? ( " |
6270 |
- back+=" )" |
6271 |
- shift |
6272 |
- done |
6273 |
- echo "${front}${1}${back}" |
6274 |
-} |
6275 |
- |
6276 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
6277 |
-CDEPEND+=" |
6278 |
-uuid? ( |
6279 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
6280 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
6281 |
-)" |
6282 |
- |
6283 |
-DEPEND="${CDEPEND} |
6284 |
-!!<sys-apps/sandbox-2.0 |
6285 |
-sys-devel/bison |
6286 |
-sys-devel/flex |
6287 |
-nls? ( sys-devel/gettext ) |
6288 |
-xml? ( virtual/pkgconfig ) |
6289 |
-" |
6290 |
- |
6291 |
-RDEPEND="${CDEPEND} |
6292 |
-!dev-db/postgresql-docs:${SLOT} |
6293 |
-!dev-db/postgresql-base:${SLOT} |
6294 |
-!dev-db/postgresql-server:${SLOT} |
6295 |
-selinux? ( sec-policy/selinux-postgresql ) |
6296 |
-" |
6297 |
- |
6298 |
-pkg_setup() { |
6299 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
6300 |
- |
6301 |
- enewgroup postgres 70 |
6302 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
6303 |
- |
6304 |
- use python && python-single-r1_pkg_setup |
6305 |
-} |
6306 |
- |
6307 |
-src_prepare() { |
6308 |
- # Work around PPC{,64} compilation bug where bool is already defined |
6309 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
6310 |
- |
6311 |
- # Set proper run directory |
6312 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
6313 |
- -i src/include/pg_config_manual.h || die |
6314 |
- |
6315 |
- # Rely on $PATH being in the proper order so that the correct |
6316 |
- # install program is used for modules utilizing PGXS in both |
6317 |
- # hardened and non-hardened environments. (Bug #528786) |
6318 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
6319 |
- |
6320 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
6321 |
- |
6322 |
- # Fix bug 486556 where the server would crash at start up because of |
6323 |
- # an infinite loop caused by a self-referencing symlink. |
6324 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
6325 |
- |
6326 |
- if use pam ; then |
6327 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
6328 |
- -i src/backend/libpq/auth.c || \ |
6329 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
6330 |
- fi |
6331 |
- |
6332 |
- epatch_user |
6333 |
-} |
6334 |
- |
6335 |
-src_configure() { |
6336 |
- case ${CHOST} in |
6337 |
- *-darwin*|*-solaris*) |
6338 |
- use nls && append-libs intl |
6339 |
- ;; |
6340 |
- esac |
6341 |
- |
6342 |
- export LDFLAGS_SL="${LDFLAGS}" |
6343 |
- export LDFLAGS_EX="${LDFLAGS}" |
6344 |
- |
6345 |
- local PO="${EPREFIX%/}" |
6346 |
- |
6347 |
- local i uuid_config="" |
6348 |
- if use uuid; then |
6349 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
6350 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
6351 |
- done |
6352 |
- for i in ${BSD_LIBC[@]}; do |
6353 |
- use ${i} && uuid_config="--with-uuid=bsd" |
6354 |
- done |
6355 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
6356 |
- fi |
6357 |
- |
6358 |
- econf \ |
6359 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
6360 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
6361 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
6362 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
6363 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
6364 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
6365 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
6366 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
6367 |
- $(use_enable threads thread-safety) \ |
6368 |
- $(use_with kerberos gssapi) \ |
6369 |
- $(use_with ldap) \ |
6370 |
- $(use_with pam) \ |
6371 |
- $(use_with perl) \ |
6372 |
- $(use_with python) \ |
6373 |
- $(use_with readline) \ |
6374 |
- $(use_with ssl openssl) \ |
6375 |
- $(use_with tcl) \ |
6376 |
- ${uuid_config} \ |
6377 |
- $(use_with xml libxml) \ |
6378 |
- $(use_with xml libxslt) \ |
6379 |
- $(use_with zlib) \ |
6380 |
- "$(use_enable nls nls "$(wanted_languages)")" |
6381 |
-} |
6382 |
- |
6383 |
-src_compile() { |
6384 |
- emake |
6385 |
- emake -C contrib |
6386 |
-} |
6387 |
- |
6388 |
-src_install() { |
6389 |
- emake DESTDIR="${D}" install |
6390 |
- emake DESTDIR="${D}" install -C contrib |
6391 |
- |
6392 |
- dodoc README HISTORY doc/{TODO,bug.template} |
6393 |
- |
6394 |
- # man pages are already built, but if we have the target make them, |
6395 |
- # they'll be generated from source before being installed so we |
6396 |
- # manually install man pages. |
6397 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
6398 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
6399 |
- doins -r doc/src/sgml/man{1,3,7} |
6400 |
- if ! use server; then |
6401 |
- # Remove man pages for non-existent binaries |
6402 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
6403 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
6404 |
- done |
6405 |
- fi |
6406 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
6407 |
- |
6408 |
- insinto /etc/postgresql-${SLOT} |
6409 |
- newins src/bin/psql/psqlrc.sample psqlrc |
6410 |
- |
6411 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
6412 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
6413 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
6414 |
- |
6415 |
- use static-libs || find "${ED}" -name '*.a' -delete |
6416 |
- |
6417 |
- if use doc ; then |
6418 |
- docinto html |
6419 |
- dodoc doc/src/sgml/html/* |
6420 |
- |
6421 |
- docinto sgml |
6422 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
6423 |
- fi |
6424 |
- |
6425 |
- if use server; then |
6426 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6427 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
6428 |
- |
6429 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6430 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
6431 |
- |
6432 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6433 |
- "${FILESDIR}/${PN}.service" | \ |
6434 |
- systemd_newunit - ${PN}-${SLOT}.service |
6435 |
- |
6436 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
6437 |
- |
6438 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
6439 |
- |
6440 |
- if use prefix ; then |
6441 |
- keepdir /run/postgresql |
6442 |
- fperms 0775 /run/postgresql |
6443 |
- fi |
6444 |
- fi |
6445 |
-} |
6446 |
- |
6447 |
-pkg_postinst() { |
6448 |
- postgresql-config update |
6449 |
- |
6450 |
- elog "If you need a global psqlrc-file, you can place it in:" |
6451 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
6452 |
- |
6453 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
6454 |
- elog |
6455 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
6456 |
- elog "following command in all active shells to pick up changes to the default" |
6457 |
- elog "environment:" |
6458 |
- elog " source /etc/profile" |
6459 |
- fi |
6460 |
- |
6461 |
- if use server ; then |
6462 |
- elog |
6463 |
- elog "Gentoo specific documentation:" |
6464 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
6465 |
- elog |
6466 |
- elog "Official documentation:" |
6467 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
6468 |
- elog |
6469 |
- elog "The default location of the Unix-domain socket is:" |
6470 |
- elog " ${EROOT%/}/run/postgresql/" |
6471 |
- elog |
6472 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
6473 |
- elog "so that it contains your preferred locale in:" |
6474 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6475 |
- elog |
6476 |
- elog "Then, execute the following command to setup the initial database" |
6477 |
- elog "environment:" |
6478 |
- elog " emerge --config =${CATEGORY}/${PF}" |
6479 |
- fi |
6480 |
-} |
6481 |
- |
6482 |
-pkg_prerm() { |
6483 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
6484 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
6485 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
6486 |
- |
6487 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
6488 |
- sleep 10 |
6489 |
- eend 0 |
6490 |
- fi |
6491 |
-} |
6492 |
- |
6493 |
-pkg_postrm() { |
6494 |
- postgresql-config update |
6495 |
-} |
6496 |
- |
6497 |
-pkg_config() { |
6498 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
6499 |
- |
6500 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
6501 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6502 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
6503 |
- [[ -z "${DATA_DIR}" ]] \ |
6504 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
6505 |
- |
6506 |
- # environment.bz2 may not contain the same locale as the current system |
6507 |
- # locale. Unset and source from the current system locale. |
6508 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
6509 |
- unset LANG |
6510 |
- unset LC_CTYPE |
6511 |
- unset LC_NUMERIC |
6512 |
- unset LC_TIME |
6513 |
- unset LC_COLLATE |
6514 |
- unset LC_MONETARY |
6515 |
- unset LC_MESSAGES |
6516 |
- unset LC_ALL |
6517 |
- source "${EROOT%/}/etc/env.d/02locale" |
6518 |
- [ -n "${LANG}" ] && export LANG |
6519 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
6520 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
6521 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
6522 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
6523 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
6524 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
6525 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
6526 |
- fi |
6527 |
- |
6528 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
6529 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6530 |
- einfo |
6531 |
- einfo "Information on options that can be passed to initdb are found at:" |
6532 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
6533 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
6534 |
- einfo |
6535 |
- einfo "PG_INITDB_OPTS is currently set to:" |
6536 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
6537 |
- einfo " (none)" |
6538 |
- else |
6539 |
- einfo " ${PG_INITDB_OPTS}" |
6540 |
- fi |
6541 |
- einfo |
6542 |
- einfo "Configuration files will be installed to:" |
6543 |
- einfo " ${PGDATA}" |
6544 |
- einfo |
6545 |
- einfo "The database cluster will be created in:" |
6546 |
- einfo " ${DATA_DIR}" |
6547 |
- einfo |
6548 |
- while [ "$correct" != "true" ] ; do |
6549 |
- einfo "Are you ready to continue? (y/n)" |
6550 |
- read answer |
6551 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
6552 |
- correct="true" |
6553 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
6554 |
- die "Aborting initialization." |
6555 |
- else |
6556 |
- echo "Answer not recognized" |
6557 |
- fi |
6558 |
- done |
6559 |
- |
6560 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
6561 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
6562 |
- eerror "Modify DATA_DIR to point to an empty directory." |
6563 |
- die "${DATA_DIR} is not empty." |
6564 |
- fi |
6565 |
- |
6566 |
- einfo "Creating the data directory ..." |
6567 |
- if [[ ${EUID} == 0 ]] ; then |
6568 |
- mkdir -p "${DATA_DIR}" |
6569 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
6570 |
- chmod 0700 "${DATA_DIR}" |
6571 |
- fi |
6572 |
- |
6573 |
- einfo "Initializing the database ..." |
6574 |
- |
6575 |
- if [[ ${EUID} == 0 ]] ; then |
6576 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
6577 |
- else |
6578 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
6579 |
- fi |
6580 |
- |
6581 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
6582 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
6583 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
6584 |
- fi |
6585 |
- |
6586 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
6587 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
6588 |
- # On the off-chance that you might need to work with UTF-8 encoded |
6589 |
- # characters in PL/Perl |
6590 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
6591 |
- EOF |
6592 |
- |
6593 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
6594 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
6595 |
- einfo "by default. You can disable it in the cluster's:" |
6596 |
- einfo " ${PGDATA%/}/postgresql.conf" |
6597 |
- einfo |
6598 |
- einfo "The PostgreSQL server, by default, will log events to:" |
6599 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
6600 |
- einfo |
6601 |
- if use prefix ; then |
6602 |
- einfo "The location of the configuration files have moved to:" |
6603 |
- einfo " ${PGDATA}" |
6604 |
- einfo "To start the server:" |
6605 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
6606 |
- einfo "To stop:" |
6607 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
6608 |
- einfo |
6609 |
- einfo "Or move the configuration files back:" |
6610 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
6611 |
- else |
6612 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
6613 |
- einfo "instead of 'pg_ctl'." |
6614 |
- fi |
6615 |
-} |
6616 |
- |
6617 |
-src_test() { |
6618 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
6619 |
- emake check |
6620 |
- |
6621 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
6622 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
6623 |
- else |
6624 |
- use server || \ |
6625 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
6626 |
- [[ ${UID} -eq 0 ]] || \ |
6627 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
6628 |
- |
6629 |
- ewarn 'Skipping.' |
6630 |
- fi |
6631 |
-} |
6632 |
|
6633 |
diff --git a/dev-db/postgresql/postgresql-9.5.3.ebuild b/dev-db/postgresql/postgresql-9.5.3.ebuild |
6634 |
deleted file mode 100644 |
6635 |
index 886d41c..00000000 |
6636 |
--- a/dev-db/postgresql/postgresql-9.5.3.ebuild |
6637 |
+++ /dev/null |
6638 |
@@ -1,437 +0,0 @@ |
6639 |
-# Copyright 1999-2016 Gentoo Foundation |
6640 |
-# Distributed under the terms of the GNU General Public License v2 |
6641 |
-# $Id$ |
6642 |
- |
6643 |
-EAPI="5" |
6644 |
- |
6645 |
-PYTHON_COMPAT=( python{2_7,3_4,3_5} ) |
6646 |
- |
6647 |
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \ |
6648 |
- systemd user versionator |
6649 |
- |
6650 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris" |
6651 |
- |
6652 |
-SLOT="$(get_version_component_range 1-2)" |
6653 |
- |
6654 |
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" |
6655 |
- |
6656 |
-LICENSE="POSTGRESQL GPL-2" |
6657 |
-DESCRIPTION="PostgreSQL RDBMS" |
6658 |
-HOMEPAGE="http://www.postgresql.org/" |
6659 |
- |
6660 |
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr |
6661 |
- zh_CN zh_TW" |
6662 |
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python |
6663 |
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib" |
6664 |
- |
6665 |
-for lingua in ${LINGUAS}; do |
6666 |
- IUSE+=" linguas_${lingua}" |
6667 |
-done |
6668 |
- |
6669 |
-wanted_languages() { |
6670 |
- local enable_langs |
6671 |
- |
6672 |
- for lingua in ${LINGUAS} ; do |
6673 |
- use linguas_${lingua} && enable_langs+="${lingua} " |
6674 |
- done |
6675 |
- |
6676 |
- echo -n ${enable_langs} |
6677 |
-} |
6678 |
- |
6679 |
-CDEPEND=" |
6680 |
->=app-eselect/eselect-postgresql-1.2.0 |
6681 |
-sys-apps/less |
6682 |
-virtual/libintl |
6683 |
-kerberos? ( virtual/krb5 ) |
6684 |
-ldap? ( net-nds/openldap ) |
6685 |
-pam? ( virtual/pam ) |
6686 |
-perl? ( >=dev-lang/perl-5.8:= ) |
6687 |
-python? ( ${PYTHON_DEPS} ) |
6688 |
-readline? ( sys-libs/readline:0= ) |
6689 |
-ssl? ( |
6690 |
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= ) |
6691 |
- libressl? ( dev-libs/libressl:= ) |
6692 |
-) |
6693 |
-tcl? ( >=dev-lang/tcl-8:0= ) |
6694 |
-xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
6695 |
-zlib? ( sys-libs/zlib ) |
6696 |
-" |
6697 |
- |
6698 |
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no |
6699 |
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems, |
6700 |
-# the libc includes UUID functions. |
6701 |
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} ) |
6702 |
-BSD_LIBC=( elibc_{Free,Net,Open}BSD ) |
6703 |
- |
6704 |
-nest_usedep() { |
6705 |
- local front back |
6706 |
- while [[ ${#} -gt 1 ]]; do |
6707 |
- front+="${1}? ( " |
6708 |
- back+=" )" |
6709 |
- shift |
6710 |
- done |
6711 |
- echo "${front}${1}${back}" |
6712 |
-} |
6713 |
- |
6714 |
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" |
6715 |
-CDEPEND+=" |
6716 |
-uuid? ( |
6717 |
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} |
6718 |
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid) |
6719 |
-)" |
6720 |
- |
6721 |
-DEPEND="${CDEPEND} |
6722 |
-!!<sys-apps/sandbox-2.0 |
6723 |
-sys-devel/bison |
6724 |
-sys-devel/flex |
6725 |
-nls? ( sys-devel/gettext ) |
6726 |
-xml? ( virtual/pkgconfig ) |
6727 |
-" |
6728 |
- |
6729 |
-RDEPEND="${CDEPEND} |
6730 |
-!dev-db/postgresql-docs:${SLOT} |
6731 |
-!dev-db/postgresql-base:${SLOT} |
6732 |
-!dev-db/postgresql-server:${SLOT} |
6733 |
-selinux? ( sec-policy/selinux-postgresql ) |
6734 |
-" |
6735 |
- |
6736 |
-pkg_setup() { |
6737 |
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup |
6738 |
- |
6739 |
- enewgroup postgres 70 |
6740 |
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres |
6741 |
- |
6742 |
- use python && python-single-r1_pkg_setup |
6743 |
-} |
6744 |
- |
6745 |
-src_prepare() { |
6746 |
- # Work around PPC{,64} compilation bug where bool is already defined |
6747 |
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die |
6748 |
- |
6749 |
- # Set proper run directory |
6750 |
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \ |
6751 |
- -i src/include/pg_config_manual.h || die |
6752 |
- |
6753 |
- # Rely on $PATH being in the proper order so that the correct |
6754 |
- # install program is used for modules utilizing PGXS in both |
6755 |
- # hardened and non-hardened environments. (Bug #528786) |
6756 |
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die |
6757 |
- |
6758 |
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch" |
6759 |
- |
6760 |
- # Fix bug 486556 where the server would crash at start up because of |
6761 |
- # an infinite loop caused by a self-referencing symlink. |
6762 |
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch" |
6763 |
- |
6764 |
- if use pam ; then |
6765 |
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \ |
6766 |
- -i src/backend/libpq/auth.c || \ |
6767 |
- die 'PGSQL_PAM_SERVICE rename failed.' |
6768 |
- fi |
6769 |
- |
6770 |
- epatch_user |
6771 |
-} |
6772 |
- |
6773 |
-src_configure() { |
6774 |
- case ${CHOST} in |
6775 |
- *-darwin*|*-solaris*) |
6776 |
- use nls && append-libs intl |
6777 |
- ;; |
6778 |
- esac |
6779 |
- |
6780 |
- export LDFLAGS_SL="${LDFLAGS}" |
6781 |
- export LDFLAGS_EX="${LDFLAGS}" |
6782 |
- |
6783 |
- local PO="${EPREFIX%/}" |
6784 |
- |
6785 |
- local i uuid_config="" |
6786 |
- if use uuid; then |
6787 |
- for i in ${UTIL_LINUX_LIBC[@]}; do |
6788 |
- use ${i} && uuid_config="--with-uuid=e2fs" |
6789 |
- done |
6790 |
- for i in ${BSD_LIBC[@]}; do |
6791 |
- use ${i} && uuid_config="--with-uuid=bsd" |
6792 |
- done |
6793 |
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp" |
6794 |
- fi |
6795 |
- |
6796 |
- econf \ |
6797 |
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \ |
6798 |
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \ |
6799 |
- --docdir="${PO}/usr/share/doc/${PF}" \ |
6800 |
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \ |
6801 |
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \ |
6802 |
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \ |
6803 |
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \ |
6804 |
- $(use_enable !alpha spinlocks) \ |
6805 |
- $(use_enable !pg_legacytimestamp integer-datetimes) \ |
6806 |
- $(use_enable threads thread-safety) \ |
6807 |
- $(use_with kerberos gssapi) \ |
6808 |
- $(use_with ldap) \ |
6809 |
- $(use_with pam) \ |
6810 |
- $(use_with perl) \ |
6811 |
- $(use_with python) \ |
6812 |
- $(use_with readline) \ |
6813 |
- $(use_with ssl openssl) \ |
6814 |
- $(use_with tcl) \ |
6815 |
- ${uuid_config} \ |
6816 |
- $(use_with xml libxml) \ |
6817 |
- $(use_with xml libxslt) \ |
6818 |
- $(use_with zlib) \ |
6819 |
- "$(use_enable nls nls "$(wanted_languages)")" |
6820 |
-} |
6821 |
- |
6822 |
-src_compile() { |
6823 |
- emake |
6824 |
- emake -C contrib |
6825 |
-} |
6826 |
- |
6827 |
-src_install() { |
6828 |
- emake DESTDIR="${D}" install |
6829 |
- emake DESTDIR="${D}" install -C contrib |
6830 |
- |
6831 |
- dodoc README HISTORY doc/{TODO,bug.template} |
6832 |
- |
6833 |
- # man pages are already built, but if we have the target make them, |
6834 |
- # they'll be generated from source before being installed so we |
6835 |
- # manually install man pages. |
6836 |
- # We use ${SLOT} instead of doman for postgresql.eselect |
6837 |
- insinto /usr/share/postgresql-${SLOT}/man/ |
6838 |
- doins -r doc/src/sgml/man{1,3,7} |
6839 |
- if ! use server; then |
6840 |
- # Remove man pages for non-existent binaries |
6841 |
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do |
6842 |
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1" |
6843 |
- done |
6844 |
- fi |
6845 |
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7} |
6846 |
- |
6847 |
- insinto /etc/postgresql-${SLOT} |
6848 |
- newins src/bin/psql/psqlrc.sample psqlrc |
6849 |
- |
6850 |
- dodir /etc/eselect/postgresql/slots/${SLOT} |
6851 |
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \ |
6852 |
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base" |
6853 |
- |
6854 |
- use static-libs || find "${ED}" -name '*.a' -delete |
6855 |
- |
6856 |
- if use doc ; then |
6857 |
- docinto html |
6858 |
- dodoc doc/src/sgml/html/* |
6859 |
- |
6860 |
- docinto sgml |
6861 |
- dodoc doc/src/sgml/*.{sgml,dsl} |
6862 |
- fi |
6863 |
- |
6864 |
- if use server; then |
6865 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6866 |
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT} |
6867 |
- |
6868 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6869 |
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT} |
6870 |
- |
6871 |
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \ |
6872 |
- "${FILESDIR}/${PN}.service" | \ |
6873 |
- systemd_newunit - ${PN}-${SLOT}.service |
6874 |
- |
6875 |
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir |
6876 |
- |
6877 |
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session |
6878 |
- |
6879 |
- if use prefix ; then |
6880 |
- keepdir /run/postgresql |
6881 |
- fperms 0775 /run/postgresql |
6882 |
- fi |
6883 |
- fi |
6884 |
-} |
6885 |
- |
6886 |
-pkg_postinst() { |
6887 |
- postgresql-config update |
6888 |
- |
6889 |
- if use alpha && use server ; then |
6890 |
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." |
6891 |
- ewarn "As a result, performance will be extremely degraded." |
6892 |
- fi |
6893 |
- |
6894 |
- elog "If you need a global psqlrc-file, you can place it in:" |
6895 |
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/" |
6896 |
- |
6897 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
6898 |
- elog |
6899 |
- elog "It looks like this is your first time installing PostgreSQL. Run the" |
6900 |
- elog "following command in all active shells to pick up changes to the default" |
6901 |
- elog "environment:" |
6902 |
- elog " source /etc/profile" |
6903 |
- fi |
6904 |
- |
6905 |
- if use server ; then |
6906 |
- elog |
6907 |
- elog "Gentoo specific documentation:" |
6908 |
- elog "https://wiki.gentoo.org/wiki/PostgreSQL" |
6909 |
- elog |
6910 |
- elog "Official documentation:" |
6911 |
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html" |
6912 |
- elog |
6913 |
- elog "The default location of the Unix-domain socket is:" |
6914 |
- elog " ${EROOT%/}/run/postgresql/" |
6915 |
- elog |
6916 |
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS" |
6917 |
- elog "so that it contains your preferred locale in:" |
6918 |
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6919 |
- elog |
6920 |
- elog "Then, execute the following command to setup the initial database" |
6921 |
- elog "environment:" |
6922 |
- elog " emerge --config =${CATEGORY}/${PF}" |
6923 |
- fi |
6924 |
-} |
6925 |
- |
6926 |
-pkg_prerm() { |
6927 |
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then |
6928 |
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?" |
6929 |
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL" |
6930 |
- |
6931 |
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)" |
6932 |
- sleep 10 |
6933 |
- eend 0 |
6934 |
- fi |
6935 |
-} |
6936 |
- |
6937 |
-pkg_postrm() { |
6938 |
- postgresql-config update |
6939 |
-} |
6940 |
- |
6941 |
-pkg_config() { |
6942 |
- use server || die "USE flag 'server' not enabled. Nothing to configure." |
6943 |
- |
6944 |
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \ |
6945 |
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6946 |
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/" |
6947 |
- [[ -z "${DATA_DIR}" ]] \ |
6948 |
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data" |
6949 |
- |
6950 |
- # environment.bz2 may not contain the same locale as the current system |
6951 |
- # locale. Unset and source from the current system locale. |
6952 |
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then |
6953 |
- unset LANG |
6954 |
- unset LC_CTYPE |
6955 |
- unset LC_NUMERIC |
6956 |
- unset LC_TIME |
6957 |
- unset LC_COLLATE |
6958 |
- unset LC_MONETARY |
6959 |
- unset LC_MESSAGES |
6960 |
- unset LC_ALL |
6961 |
- source "${EROOT%/}/etc/env.d/02locale" |
6962 |
- [ -n "${LANG}" ] && export LANG |
6963 |
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE |
6964 |
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC |
6965 |
- [ -n "${LC_TIME}" ] && export LC_TIME |
6966 |
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE |
6967 |
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY |
6968 |
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES |
6969 |
- [ -n "${LC_ALL}" ] && export LC_ALL |
6970 |
- fi |
6971 |
- |
6972 |
- einfo "You can modify the paths and options passed to initdb by editing:" |
6973 |
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}" |
6974 |
- einfo |
6975 |
- einfo "Information on options that can be passed to initdb are found at:" |
6976 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" |
6977 |
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" |
6978 |
- einfo |
6979 |
- einfo "PG_INITDB_OPTS is currently set to:" |
6980 |
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then |
6981 |
- einfo " (none)" |
6982 |
- else |
6983 |
- einfo " ${PG_INITDB_OPTS}" |
6984 |
- fi |
6985 |
- einfo |
6986 |
- einfo "Configuration files will be installed to:" |
6987 |
- einfo " ${PGDATA}" |
6988 |
- einfo |
6989 |
- einfo "The database cluster will be created in:" |
6990 |
- einfo " ${DATA_DIR}" |
6991 |
- einfo |
6992 |
- while [ "$correct" != "true" ] ; do |
6993 |
- einfo "Are you ready to continue? (y/n)" |
6994 |
- read answer |
6995 |
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
6996 |
- correct="true" |
6997 |
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
6998 |
- die "Aborting initialization." |
6999 |
- else |
7000 |
- echo "Answer not recognized" |
7001 |
- fi |
7002 |
- done |
7003 |
- |
7004 |
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then |
7005 |
- eerror "The given directory, '${DATA_DIR}', is not empty." |
7006 |
- eerror "Modify DATA_DIR to point to an empty directory." |
7007 |
- die "${DATA_DIR} is not empty." |
7008 |
- fi |
7009 |
- |
7010 |
- einfo "Creating the data directory ..." |
7011 |
- if [[ ${EUID} == 0 ]] ; then |
7012 |
- mkdir -p "${DATA_DIR}" |
7013 |
- chown -Rf postgres:postgres "${DATA_DIR}" |
7014 |
- chmod 0700 "${DATA_DIR}" |
7015 |
- fi |
7016 |
- |
7017 |
- einfo "Initializing the database ..." |
7018 |
- |
7019 |
- if [[ ${EUID} == 0 ]] ; then |
7020 |
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}" |
7021 |
- else |
7022 |
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS} |
7023 |
- fi |
7024 |
- |
7025 |
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then |
7026 |
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}" |
7027 |
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}" |
7028 |
- fi |
7029 |
- |
7030 |
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf |
7031 |
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522 |
7032 |
- # On the off-chance that you might need to work with UTF-8 encoded |
7033 |
- # characters in PL/Perl |
7034 |
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' |
7035 |
- EOF |
7036 |
- |
7037 |
- einfo "The autovacuum function, which was in contrib, has been moved to the main" |
7038 |
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled" |
7039 |
- einfo "by default. You can disable it in the cluster's:" |
7040 |
- einfo " ${PGDATA%/}/postgresql.conf" |
7041 |
- einfo |
7042 |
- einfo "The PostgreSQL server, by default, will log events to:" |
7043 |
- einfo " ${DATA_DIR%/}/postmaster.log" |
7044 |
- einfo |
7045 |
- if use prefix ; then |
7046 |
- einfo "The location of the configuration files have moved to:" |
7047 |
- einfo " ${PGDATA}" |
7048 |
- einfo "To start the server:" |
7049 |
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'" |
7050 |
- einfo "To stop:" |
7051 |
- einfo " pg_ctl stop -D ${DATA_DIR}" |
7052 |
- einfo |
7053 |
- einfo "Or move the configuration files back:" |
7054 |
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}" |
7055 |
- else |
7056 |
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL" |
7057 |
- einfo "instead of 'pg_ctl'." |
7058 |
- fi |
7059 |
-} |
7060 |
- |
7061 |
-src_test() { |
7062 |
- if use server && [[ ${UID} -ne 0 ]] ; then |
7063 |
- emake check |
7064 |
- |
7065 |
- einfo "If you think other tests besides the regression tests are necessary, please" |
7066 |
- einfo "submit a bug including a patch for this ebuild to enable them." |
7067 |
- else |
7068 |
- use server || \ |
7069 |
- ewarn 'Tests cannot be run without the "server" use flag enabled.' |
7070 |
- [[ ${UID} -eq 0 ]] || \ |
7071 |
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.' |
7072 |
- |
7073 |
- ewarn 'Skipping.' |
7074 |
- fi |
7075 |
-} |