Gentoo Archives: gentoo-commits

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