summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. Swenson <titanofold@gentoo.org>2017-08-10 11:16:20 -0400
committerAaron W. Swenson <titanofold@gentoo.org>2017-08-10 11:16:20 -0400
commit24455ca948572a132da179a8ee8f18402467aadb (patch)
tree06a81f31087401b96c48897ce4b1136a5aed3bb0
parentdev-db/postgresql: Security Version Bump (diff)
downloadgentoo-24455ca948572a132da179a8ee8f18402467aadb.tar.gz
gentoo-24455ca948572a132da179a8ee8f18402467aadb.tar.bz2
gentoo-24455ca948572a132da179a8ee8f18402467aadb.zip
dev-db/postgresql: Clean out old and unused
Package-Manager: Portage-2.3.6, Repoman-2.3.1
-rw-r--r--dev-db/postgresql/Manifest8
-rw-r--r--dev-db/postgresql/files/postgresql-9.0-no-server.patch135
-rw-r--r--dev-db/postgresql/files/postgresql-9.4-no-server.patch151
-rw-r--r--dev-db/postgresql/files/postgresql.init-pre_9.2139
-rw-r--r--dev-db/postgresql/postgresql-10_beta2.ebuild469
-rw-r--r--dev-db/postgresql/postgresql-9.1.24.ebuild384
-rw-r--r--dev-db/postgresql/postgresql-9.2.20-r1.ebuild435
-rw-r--r--dev-db/postgresql/postgresql-9.2.20.ebuild394
-rw-r--r--dev-db/postgresql/postgresql-9.2.21-r1.ebuild435
-rw-r--r--dev-db/postgresql/postgresql-9.3.16-r1.ebuild440
-rw-r--r--dev-db/postgresql/postgresql-9.3.16.ebuild399
-rw-r--r--dev-db/postgresql/postgresql-9.3.17-r1.ebuild440
-rw-r--r--dev-db/postgresql/postgresql-9.4.11-r1.ebuild472
-rw-r--r--dev-db/postgresql/postgresql-9.4.11.ebuild431
-rw-r--r--dev-db/postgresql/postgresql-9.4.12-r1.ebuild472
-rw-r--r--dev-db/postgresql/postgresql-9.5.6-r1.ebuild478
-rw-r--r--dev-db/postgresql/postgresql-9.5.6.ebuild441
-rw-r--r--dev-db/postgresql/postgresql-9.6.1-r1.ebuild438
-rw-r--r--dev-db/postgresql/postgresql-9.6.2-r1.ebuild475
-rw-r--r--dev-db/postgresql/postgresql-9.6.2.ebuild438
-rw-r--r--dev-db/postgresql/postgresql-9.6.3.ebuild475
21 files changed, 0 insertions, 7949 deletions
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
index 8fe58158126a..1f6e3ba7512e 100644
--- a/dev-db/postgresql/Manifest
+++ b/dev-db/postgresql/Manifest
@@ -1,23 +1,15 @@
-DIST postgresql-10beta2.tar.bz2 19790809 SHA256 0d6b50236039fc92e8784bd908b452c38ef63c0f9029f34e7115fbc30e17b195 SHA512 58abb8e38252ddf50d975588c9d43bf28d1169b499d068ace9324c6380ac1916975ca9a9a708dffb499e333e8b85c381efe8821166e2071236d6c8c4498f97a0 WHIRLPOOL 920fbc7459f0f9a9a3b72200ab2a4042672f351dc5b63dc7b63e2fafe0a74838fff1da0d814c37d81d28dc07e85bd4f14330ac367df2fb61f1ed0f56927e2131
DIST postgresql-10beta3.tar.bz2 19914123 SHA256 6722546739f8e2dd379e8031784e86c5c588638df6c477046ebdd479586bcb3e SHA512 cdbda1c17d58f2999ad71a208d6aa3b18b82bfc8f185eb4ce36496b27ae23bca03f76925e4b242a4c3c2eec96ca0b135e696f55b59282b208ecfe7f8b642f24f WHIRLPOOL 5db99df6c8d0b455a3e6c8d4a734be52bb5dc6b3225cb0f3d547ea22e87e4eae45709667bad71bc1fe8e7f024345c1b9e186b07faf9c23a9db046c9bfc01e8af
-DIST postgresql-9.1.24.tar.bz2 15863767 SHA256 de0d84e9f32af145fcd66d8d324f6ef1a0b17944ea344b7bbe9d99fff68ae5d3 SHA512 a9ad0d62846598afee317eeda83406b5f85a658bfe7eb78aff6c59c904223dd165adbd5870598b74aa0e012878489f0c285e6ac7b07ebddf3cf8d81ba70bea7e WHIRLPOOL f58d79df5562c3fc22dae96ba064e19a4c83f42358911575f854cb2e062457f9331547cb19f9970003a2e15b7e8c609b9aab2a1e17099a446c89786581ccb13b
DIST postgresql-9.2.19.tar.bz2 16466698 SHA256 1d29d73a4f590fcc348280f13ac2ff6a0f72c94908c54e3c20b7ab1560e8dbad SHA512 d3b4c5578bf6d6580028e775bff81a921258cb53b6b06567d96a352d14f3b63063adb480b2f5e2029baf8a034e14b5cd75eebc04f1ed7b16c849e1a5ec1f4867 WHIRLPOOL c13b45fd7aee08ea472557c9f40d79c45abd572fefcc215002b562b8046b1937bf522f6f7f6e280ff1e434c9698734cda9f1c3dacd3c8fee5f33dad0da21f75f
-DIST postgresql-9.2.20.tar.bz2 16480653 SHA256 0b8abdae8400cabea5587a726003c9dd71c73c049bdae523abc35f9312dd8f26 SHA512 16f7861e0372481dbc5c69ac977bab46f592045f32951a245f3677121261640fcc169a75e730d592e36c15c9a120e7d06755550bdabf121ad89d76a17535d0f9 WHIRLPOOL af5005564056185fa240fd97bec862738f9951bb57082485beba3eacf5d8bf709c58d01f8bde656a391eee173d592d9cf792be87de04a09869aa3d82c8719320
DIST postgresql-9.2.21.tar.bz2 16508040 SHA256 0697e843523ee60c563f987f9c65bc4201294b18525d6e5e4b2c50c6d4058ef9 SHA512 c548cd1ba34ad71dd3f1acde5775ba2e71121f004324fac44dbe123a91d599ced0f1b8be675ed07b77712e8c23f376ff6221349385c19a88c4edbbb186f17861 WHIRLPOOL c46fd4909e2d534b98c8a97f0f5410ab40285c118517a36ee73d0e1234483144d1f58785a59df53fdbfab7c2876a60d000bf574dff0be3030f8c909509b1bfe6
DIST postgresql-9.2.22.tar.bz2 16531224 SHA256 a70e94fa58776b559a8f7b5301371ac4922c9e3ed313ccbef20862514de7c192 SHA512 3e5ab04c2be2719579b2ebbf64b220522acfd9ea74029dd2ed699f60230da224bdc99de4ee5529b513e5586de0377764c4e54deb3dd93d5c53c4d666dce2b6b7 WHIRLPOOL ff1817463b488f4793cd0851df846b961d5510b7c1cf4a560717755ca47c363eb782bc1f2cd7a5d8cbc49727dea64394c6b30038105fc584749157157948964d
DIST postgresql-9.3.15.tar.bz2 17059932 SHA256 a9fcba1446a93aa95e3e1b6535756f0472d10b0f267a0845f8b2b29f89de5c4f SHA512 35c30cdb5599f99c94ab921f9f5e7671a8c0b7bca8fe3b616630ae13d6eda8d329e77e7e802da6a83cb09c3c9ca10fa8ce0de8a184e6fff471130e1cd68ce762 WHIRLPOOL 7a627b2da1dc3671df7edfe58420f81ce24202c1251225054674d79e431bc36e1a70c84aaacb76c59e9eefb26429cbbb9ea80c45a989e3564b69e334d3dd4d84
-DIST postgresql-9.3.16.tar.bz2 17108969 SHA256 845f5e4ac8cf026b6a77c5a180a2fe869f51e9d06acf8d0365b05505a2c66873 SHA512 2e379aca5db79ab5795e6f1e4ff8b21b1aa284cfb0d34655430d8b959cebac7982ee6eda66833a1fb208a36a51251c946565982cd5dff619ab334603ded530e7 WHIRLPOOL fea45fb6563fc4c56a1853baf83bbdd59991871176aa00a4fcdda5e95a9277d187ddd2fc5d0c3c76f090e7a359d2d5af140e8af3f6a964897beb41ef8435483e
DIST postgresql-9.3.17.tar.bz2 17158802 SHA256 9c03e5f280cfe9bd202fa01af773eb146abd8ab3065f7279d574c568f6948dbe SHA512 4b6fc079c2bb728b13b72eb2f7d92183ffb1a9b32110d99dfce674032ac499963b75a021265ba08dc95c34ae35a7edac65ef1e658e66ee2da41c1ce646a702dc WHIRLPOOL f573aaa6acf6d542ed647f392bdb42cd60f650e66174c603f0344d64e2962f2fbb46f0233226188ee9a3a75b2de6532738aac28876bd097556eb4f6c0de21667
DIST postgresql-9.3.18.tar.bz2 17194269 SHA256 ad60d12a5a3dd0f6f5904c41b87e43eff49d3f74e45129fe52c5744366ff2fe0 SHA512 df3f2e0bb396cac74021fcc1a989d04515c12e73846b7392ae859c32668d73ae0027607426072672b6228d7533cc512f72b5729bf5c8f7b0e8d0270727784455 WHIRLPOOL c5b3db88e01c507556b354acb1ecf2bbf43246d023c5d9e1d8479ce4aa9944beca518abbd3e810830af1d75356272b4df3eb58358edfdd265cdc395f62ac8c33
DIST postgresql-9.4.10.tar.bz2 17802812 SHA256 7061678bed1981c681ce54c76b98b6ec17743f090a9775104a45e7e1a8826ecf SHA512 2fcf47769b22c69bc82c9d6edc317e18dfcb4a96534e012bae4355e5088afa83da98b21e08a07766794f0a166888acbd16705a806464ea11711ed97c3b4012fb WHIRLPOOL e6ed3c209043cbbacb0698e1be367f20028d649d4cff62b5d6edd162c6ad629a3ec5f55854bd12334a3d3165462fecb34188bd62cd398cfc242a3579810b5b85
-DIST postgresql-9.4.11.tar.bz2 17832915 SHA256 e3eb51d045c180b03d2de1f0c3af9356e10be49448e966ca01dfc2c6d1cc9d23 SHA512 a3ed866d82ab4b90c2a7ec2abec0308015845947f42b76e420cce8f268e1c374806a9fab00ba0563d742a53014a30fa0eaa90804a09fd162b76fcbfbeff6b70f WHIRLPOOL cb53a9e1ee518b43c8be135e3b09005314c8dd108eacd37e6a5be45b2391b31a4acf8427c7aac86524f0ef0e264b46329c97aa5b01e6c4d0b63cd6f7e081697c
DIST postgresql-9.4.12.tar.bz2 17833119 SHA256 fca055481875d1c49e31c28443f56472a1474b3fbe25b7ae64440c6118f82e64 SHA512 69951f9e66069aad1049a0ea9fdcd7bf2f84b42e7c6e0f761d78ab22131a39cf56448ef0ddc28170b66970bf53edf2d2355530fcfc0a2dca92b66d69686b7ecb WHIRLPOOL ca023aab29d7993e236c52df58d6fae6f9bd1649cf20f1e1b118ff232dc41674001d3dc9bc945e3f9dd61779dde27cb93265b89d3615e47f49ea46751d8e97c3
DIST postgresql-9.4.13.tar.bz2 17867502 SHA256 0080f55d65194de8b96a2dab153443f8248ff2b2b10e6ab4cda2dcadcac7f2ab SHA512 98e5721ab1ebc88070a5c2c9ef10e4fc21825de495db71f011577aa15fdd31c2dc0429d48e1624f7161c9d31dd75de4d8cf4ed2e34006ed6d1852f04a948e932 WHIRLPOOL 4f963b81dca21a2f3f5e047b5cfd1796d103c0648c4af0250ffe2274ed71011634dfc1e8387fe6dfa6589585a8fcb5accc9878c461978b9abd483b85f6ea3e68
DIST postgresql-9.5.5.tar.bz2 18525082 SHA256 02c65290be74de6604c3fed87c9fd3e6b32e949f0ab8105a75bd7ed5aa71f394 SHA512 727ab57796cd393ec3755e9aabf515ebbdc3152b4062c20e64511e866a7e7038ba5c5e2843f13f3a79e2263296451f0e93108346b6f638611fba2449394e338e WHIRLPOOL ec5262fd8cecea20fd12bcec8e6e015817ae8181d9e9ff6d8aca6ed43cadedac1bd5006c3d04262b99b9a79aa02c409920ab3392136f3ff3dc480fe1155cade8
-DIST postgresql-9.5.6.tar.bz2 18598551 SHA256 bb9e5f6d34e20783e96e10c1d6c0c09c31749e802aaa46b793ce2522725ae12f SHA512 fabaeb2d4841ca2f2fd7b0f9c90368debc91f569ade5ad4dc9250c27d790a97ed58a670319f0fe59404fce7e986e8dafb1408edbe6fc149531bdb230b1b913fe WHIRLPOOL 257aa2d2a71b12b13da958563197b9bd0acc6c4a0d3b96787ad2d202414d074629f4b39c8291cae4770b2d867a4b331214f404eaef84a37278d3aa90147d14de
DIST postgresql-9.5.7.tar.bz2 18639775 SHA256 8b1e936f82109325decc0f5575e846b93fb4fd384e8c4bde83ff5e7f87fc6cad SHA512 0f879a8d7587739aa9a696d60f909f819d567c67dff7c730d5e856639ed78ebc35beeb3cdaf782573d7e62c7056560a934f64cf11ccac6e309f58bb82d1ca78f WHIRLPOOL d58fb5bc378a58efaf2be8d689bd6d511170c3de18e5300ed46be51e272654d52807fd9a783b6a3ec30a022a44577edb19d6627e5153b5e14259de5571ba15bb
DIST postgresql-9.5.8.tar.bz2 18670910 SHA256 ade57068f134f36710fa953e1ef79185abd96572f8098741413132f79ed37202 SHA512 4a11f0a16df460391c8250122ca8bf1ab76e49672a8c003ed09718bb4ce2aa57757e7aaec6e41b53d0d1ada293172b974761606647fcc8b4fce8807490b6ef10 WHIRLPOOL 7688ddeea69449d2e2a518017d306f6c17a08becb258297cbf4bde9f3734c5ba2129a9660b448df458963a7cdc796bbb72f2798c20abd3d50d1be8d4f3f94ec1
-DIST postgresql-9.6.1.tar.bz2 19260568 SHA256 e5101e0a49141fc12a7018c6dad594694d3a3325f5ab71e93e0e51bd94e51fcd SHA512 f27af67f9a96f6327150330bf091a803e10eabbac4e488cf5e4d72907e2eb1dbde7282fe0b89fd75711fd8bdcdb3688b5a9eac1e4d6871f4e8681c9c8b0e7c45 WHIRLPOOL 1ea7933817895ec4ddd531b60eead2c0c3324b90fe48224bd49748d11e76313bb7699670edaf5c8f41b8424026bed59d29aab69208c5ced5161196a4827c78f8
-DIST postgresql-9.6.2.tar.bz2 19478040 SHA256 0187b5184be1c09034e74e44761505e52357248451b0c854dddec6c231fe50c9 SHA512 7c9d61a591408e29d7dc70d6b28ecdf06edf7f8fbf4e014e60a1e4f841fd5734c74a820094f6153e10ef633d48ea73f2a85194f6d2cd519a8f7087a261e9e02b WHIRLPOOL 0d3981d2990186967ad61c84a02cadf680015e4dc41ff6bb9bb0ed0936979abe6561f2a730ef000173ee8635a6859361b6ce174afbda837defb50300e1cfc909
DIST postgresql-9.6.3.tar.bz2 19534323 SHA256 1645b3736901f6d854e695a937389e68ff2066ce0cde9d73919d6ab7c995b9c6 SHA512 97141972e154e6b0e756ee6a4e20f26e82022a9fd4c56305314a3a5567a79ece638e4ac3d513b46138737ae6bd27a098f30013a94767db151181aac9c01290a1 WHIRLPOOL 774146faf5795796812e541d3c7a2ad9ce8125afdc64c0bfa599a733904f4efd3c73dfb907dbb66b6482b2d6efdbd9f2c0dcedffcc4e23bd6030e968a51db658
DIST postgresql-9.6.4.tar.bz2 19566875 SHA256 2b3ab16d82e21cead54c08b95ce3ac480696944a68603b6c11b3205b7376ce13 SHA512 b0527efacce6efc09340b68c8c56483cd884676e01cb6bfb4f9ce63226a394bdb0bcf3d832f84e4dff5ceecf09ef4cf93e9fbd0ac453ec85efb11ac50a7dff39 WHIRLPOOL 6296114c2a6f690428754278d11fb93f2142c28bc36e0a17b4b075b60ee90bf708d73d68ff6e8118253ef22e54cd5e325094e3675eccb7f060e32af2572a65b0
diff --git a/dev-db/postgresql/files/postgresql-9.0-no-server.patch b/dev-db/postgresql/files/postgresql-9.0-no-server.patch
deleted file mode 100644
index 1b45cd954c5e..000000000000
--- a/dev-db/postgresql/files/postgresql-9.0-no-server.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-diff -Naur a/contrib/Makefile b/contrib/Makefile
---- a/contrib/Makefile 2011-02-02 07:37:16.654175660 -0500
-+++ b/contrib/Makefile 2011-02-08 05:54:00.145582001 -0500
-@@ -5,51 +5,10 @@
- include $(top_builddir)/src/Makefile.global
-
- SUBDIRS = \
-- adminpack \
-- auto_explain \
-- btree_gin \
-- btree_gist \
-- chkpass \
-- citext \
-- cube \
-- dblink \
-- dict_int \
-- dict_xsyn \
-- earthdistance \
-- fuzzystrmatch \
-- hstore \
-- intagg \
-- intarray \
-- isn \
-- lo \
-- ltree \
- oid2name \
-- pageinspect \
-- passwordcheck \
-- pg_archivecleanup \
-- pg_buffercache \
-- pg_freespacemap \
-- pg_standby \
-- pg_stat_statements \
-- pg_trgm \
-- pg_upgrade \
-- pg_upgrade_support \
- pgbench \
-- pgcrypto \
-- pgrowlocks \
-- pgstattuple \
-- seg \
-- spi \
-- tablefunc \
-- test_parser \
-- tsearch2 \
-- unaccent \
- vacuumlo
-
--ifeq ($(with_openssl),yes)
--SUBDIRS += sslinfo
--endif
--
- ifeq ($(with_ossp_uuid),yes)
- SUBDIRS += uuid-ossp
- endif
-diff -Naur a/src/backend/Makefile b/src/backend/Makefile
---- a/src/backend/Makefile 2011-02-02 07:37:56.403870592 -0500
-+++ b/src/backend/Makefile 2011-02-08 05:57:26.078497002 -0500
-@@ -45,7 +45,7 @@
-
- ##########################################################################
-
--all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
-+all: someheaders
-
- ifneq ($(PORTNAME), cygwin)
- ifneq ($(PORTNAME), win32)
-@@ -114,7 +114,7 @@
- endif # aix
-
- # Update the commonly used headers before building the subdirectories
--$(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
-+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
-
- # run this unconditionally to avoid needing to know its dependencies here:
- submake-schemapg:
-@@ -191,23 +191,7 @@
-
- ##########################################################################
-
--install: all installdirs install-bin
--ifeq ($(PORTNAME), cygwin)
--ifeq ($(MAKE_DLL), true)
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
--endif
--endif
--ifeq ($(PORTNAME), win32)
--ifeq ($(MAKE_DLL), true)
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
--endif
--endif
-- $(MAKE) -C catalog install-data
-- $(MAKE) -C tsearch install-data
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
-- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
-- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample'
-+install:
-
- install-bin: postgres $(POSTGRES_IMP) installdirs
- $(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
-diff -Naur a/src/bin/Makefile b/src/bin/Makefile
---- a/src/bin/Makefile 2011-02-02 07:38:35.133570047 -0500
-+++ b/src/bin/Makefile 2011-02-08 05:58:48.819847001 -0500
-@@ -13,8 +13,7 @@
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
-
--SUBDIRS = initdb pg_ctl pg_dump \
-- psql scripts pg_config pg_controldata pg_resetxlog
-+SUBDIRS = pg_dump psql scripts pg_config
- ifeq ($(PORTNAME), win32)
- SUBDIRS+=pgevent
- endif
-diff -Naur a/src/Makefile b/src/Makefile
---- a/src/Makefile 2011-02-02 07:37:56.283870942 -0500
-+++ b/src/Makefile 2011-02-08 06:00:51.591202002 -0500
-@@ -15,17 +15,11 @@
-
- all install installdirs uninstall distprep:
- $(MAKE) -C port $@
-- $(MAKE) -C timezone $@
- $(MAKE) -C backend $@
-- $(MAKE) -C backend/utils/mb/conversion_procs $@
-- $(MAKE) -C backend/snowball $@
- $(MAKE) -C include $@
- $(MAKE) -C interfaces $@
-- $(MAKE) -C backend/replication/libpqwalreceiver $@
- $(MAKE) -C bin $@
-- $(MAKE) -C pl $@
- $(MAKE) -C makefiles $@
-- $(MAKE) -C test/regress $@
-
- install: install-local
-
diff --git a/dev-db/postgresql/files/postgresql-9.4-no-server.patch b/dev-db/postgresql/files/postgresql-9.4-no-server.patch
deleted file mode 100644
index c46146e5ec9e..000000000000
--- a/dev-db/postgresql/files/postgresql-9.4-no-server.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-diff -Naur a/contrib/Makefile b/contrib/Makefile
---- a/contrib/Makefile 2013-05-06 20:57:06.000000000 +0000
-+++ b/contrib/Makefile 2013-06-09 01:48:22.351874929 +0000
-@@ -5,64 +5,10 @@
- include $(top_builddir)/src/Makefile.global
-
- SUBDIRS = \
-- adminpack \
-- auth_delay \
-- auto_explain \
-- btree_gin \
-- btree_gist \
-- chkpass \
-- citext \
-- cube \
-- dblink \
-- dict_int \
-- dict_xsyn \
-- dummy_seclabel \
-- earthdistance \
-- file_fdw \
-- fuzzystrmatch \
-- hstore \
-- intagg \
-- intarray \
-- isn \
-- lo \
-- ltree \
- oid2name \
-- pageinspect \
-- passwordcheck \
-- pg_archivecleanup \
-- pg_buffercache \
-- pg_freespacemap \
-- pg_prewarm \
-- pg_standby \
-- pg_stat_statements \
-- pg_test_fsync \
-- pg_test_timing \
-- pg_trgm \
-- pg_upgrade \
-- pg_upgrade_support \
- pgbench \
-- pgcrypto \
-- pgrowlocks \
-- pgstattuple \
-- pg_xlogdump \
-- postgres_fdw \
-- seg \
-- spi \
-- tablefunc \
-- tcn \
-- test_decoding \
-- test_parser \
-- test_shm_mq \
-- tsearch2 \
-- unaccent \
-- vacuumlo \
-- worker_spi
-+ vacuumlo
-
--ifeq ($(with_openssl),yes)
--SUBDIRS += sslinfo
--else
--ALWAYS_SUBDIRS += sslinfo
--endif
-
- ifeq ($(with_ossp_uuid),yes)
- SUBDIRS += uuid-ossp
-diff -Naur a/src/backend/Makefile b/src/backend/Makefile
---- a/src/backend/Makefile 2013-05-06 20:57:06.000000000 +0000
-+++ b/src/backend/Makefile 2013-06-09 01:50:19.655864258 +0000
-@@ -47,7 +47,7 @@
-
- ##########################################################################
-
--all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
-+all: someheaders
-
- ifneq ($(PORTNAME), cygwin)
- ifneq ($(PORTNAME), win32)
-@@ -116,7 +116,7 @@
- endif # aix
-
- # Update the commonly used headers before building the subdirectories
--$(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
-+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
-
- # run this unconditionally to avoid needing to know its dependencies here:
- submake-schemapg:
-@@ -209,23 +209,8 @@
-
- ##########################################################################
-
--install: all installdirs install-bin
--ifeq ($(PORTNAME), cygwin)
--ifeq ($(MAKE_DLL), true)
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
--endif
--endif
--ifeq ($(PORTNAME), win32)
--ifeq ($(MAKE_DLL), true)
-- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
--endif
--endif
-- $(MAKE) -C catalog install-data
-- $(MAKE) -C tsearch install-data
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
-- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
-- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
-- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample'
-+install:
-+
-
- install-bin: postgres $(POSTGRES_IMP) installdirs
- $(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
-diff -Naur a/src/bin/Makefile b/src/bin/Makefile
---- a/src/bin/Makefile 2013-05-06 20:57:06.000000000 +0000
-+++ b/src/bin/Makefile 2013-06-09 01:51:56.143824442 +0000
-@@ -13,8 +13,7 @@
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
-
--SUBDIRS = initdb pg_ctl pg_dump \
-- psql scripts pg_config pg_controldata pg_resetxlog pg_basebackup
-+SUBDIRS = pg_dump psql scripts pg_config
-
- ifeq ($(PORTNAME), win32)
- SUBDIRS += pgevent
-diff -Naur a/src/Makefile b/src/Makefile
---- a/src/Makefile 2013-05-06 20:57:06.000000000 +0000
-+++ b/src/Makefile 2013-06-09 01:54:30.479704228 +0000
-@@ -15,17 +15,11 @@
- SUBDIRS = \
- common \
- port \
-- timezone \
- backend \
-- backend/utils/mb/conversion_procs \
-- backend/snowball \
- include \
- interfaces \
-- backend/replication/libpqwalreceiver \
- bin \
-- pl \
-- makefiles \
-- test/regress
-+ makefiles
-
- # There are too many interdependencies between the subdirectories, so
- # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql.init-pre_9.2 b/dev-db/postgresql/files/postgresql.init-pre_9.2
deleted file mode 100644
index 0973087b315d..000000000000
--- a/dev-db/postgresql/files/postgresql.init-pre_9.2
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-extra_started_commands="reload"
-
-get_config() {
- [ -f ${PGDATA%/}/postgresql.conf ] || return 1
-
- eval echo $(sed -e 's:#.*::' ${PGDATA%/}/postgresql.conf \
- | awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }')
-}
-
-depend() {
- use net
- provide postgresql
-
- if [ "$(get_config log_destination)" = "syslog" ]; then
- use logger
- fi
-}
-
-configured_port=$(get_config port)
-: ${configured_port:=${PGPORT}}
-socket_path=$(get_config unix_socket_directory)
-: ${socket_path:=/run/postgresql}
-
-checkconfig() {
- # Check that DATA_DIR has been set
- if [ -z ${DATA_DIR} ] ; then
- eerror "DATA_DIR not set"
- eerror "HINT: Perhaps you need to update /etc/conf.d/postgresql-@SLOT@"
- return 1
- fi
-
- # Check that DATA_DIR exists
- if [ ! -d ${DATA_DIR} ] ; then
- eerror "Directory not found: ${DATA_DIR}"
- eerror "HINT: Ensure that DATA_DIR points to the right path."
- eerror "HINT: Or perhaps you need to create the database cluster:"
- eerror " emerge --config dev-db/postgresql:@SLOT@"
- return 1
- fi
-
- # Check for the existence of PostgreSQL's config files, and set the
- # proper mode and ownership.
- # Only three files should be checked as potentially other files
- # may be in PGDATA that should not be touched.
- local file
- for file in postgresql pg_hba pg_ident ; do
- file="${PGDATA%/}/${file}.conf"
- if [ -f ${file} ] ; then
- checkpath -f -m 0600 -o postgres:postgres ${file}
- else
- eerror "${file} not found"
- eerror "HINT: mv ${DATA_DIR%/}/*.conf ${PGDATA}"
- return 1
- fi
- done
-
- # Set the proper permission for the socket path and create it if
- # it doesn't exist.
- checkpath -d -m 1775 -o postgres:postgres ${socket_path}
- if [ -e ${socket_path%/}/.s.PGSQL.${configured_port} ] ; then
- eerror "Socket conflict."
- eerror "A server is already listening on:"
- eerror " ${socket_path%/}/.s.PGSQL.${configured_port}"
- eerror "HINT: Change PGPORT to listen on a different socket."
- return 1
- fi
-}
-
-start() {
- checkconfig || return 1
-
- ebegin "Starting PostgreSQL"
-
- rm -f ${DATA_DIR%/}/postmaster.pid
-
- local extraenv
- local x
- for x in ${PG_EXTRA_ENV} ; do
- extraenv="${extraenv} --env ${x}"
- done
-
- start-stop-daemon --start \
- --user postgres \
- --env "PGPORT=${configured_port}" \
- ${extraenv} \
- --pidfile ${DATA_DIR%/}/postmaster.pid \
- --wait $((${START_TIMEOUT}*1000)) \
- --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres \
- -- -D ${PGDATA} --data-directory=${DATA_DIR} --silent-mode=true \
- ${PGOPTS}
-
- local retval=$?
-
- if [ $retval -ne 0 ] ; then
- eerror "Check the log for a possible explanation of the above error. The log may be"
- eerror " ${DATA_DIR%/}/postmaster.log"
- eerror "Or wherever you configured PostgreSQL @SLOT@ log messages to be sent."
- eend $retval
- return $retval
- fi
-
- eend $retval
-}
-
-stop() {
- local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} ))
- ebegin "Stopping PostgreSQL (this can take up to ${seconds} seconds)"
-
- local retval
- local retries=SIGTERM/${NICE_TIMEOUT}
-
- if [ "${RUDE_QUIT}" != "NO" ] ; then
- einfo "RUDE_QUIT enabled."
- retries="${retries}/SIGINT/${RUDE_TIMEOUT}"
- fi
- if [ "${FORCE_QUIT}" = "YES" ] ; then
- einfo "FORCE_QUIT enabled."
- ewarn "A recover-run might be executed on next startup."
- retries="${retries}/SIGQUIT/${FORCE_TIMEOUT}"
- fi
-
- # Loops through nice, rude, and force quit in one go.
- start-stop-daemon --stop \
- --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres \
- --retry ${retries} \
- --pidfile ${DATA_DIR%/}/postmaster.pid
-
- eend
-}
-
-reload() {
- ebegin "Reloading PostgreSQL configuration"
- kill -HUP $(head -n1 ${DATA_DIR%/}/postmaster.pid)
- eend $?
-}
diff --git a/dev-db/postgresql/postgresql-10_beta2.ebuild b/dev-db/postgresql/postgresql-10_beta2.ebuild
deleted file mode 100644
index 6560be4d50a6..000000000000
--- a/dev-db/postgresql/postgresql-10_beta2.ebuild
+++ /dev/null
@@ -1,469 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT=$(get_major_version)
-
-MY_PV=${PV/_/}
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
- zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp
- python +readline selinux +server systemd ssl static-libs tcl threads uuid
- xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-server? ( systemd? ( sys-apps/systemd ) )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || eapply "${FILESDIR}/${PN}-${SLOT}beta2-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- #eapply "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- eapply_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !alpha spinlocks) \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(usex server "$(use_with systemd)" '--without-systemd') \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- serverman=(
- initdb
- pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
- pg_{test_{fsync,timing},upgrade,waldump}
- post{gres,master}
- )
- for m in ${serverman[@]} ; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- # Create slot specific man pages
- local bn f mansec slotted_name
- for mansec in 1 3 7 ; do
- local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
-
- mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
- pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
-
- for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
- bn=$(basename "${f}")
- slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
- case ${bn} in
- TABLE.7|WITH.7)
- echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
- ;;
- *)
- echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
- ;;
- esac
- done
-
- popd > /dev/null
- done
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}"
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- if use systemd; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service-9.6" | \
- systemd_newunit - ${PN}-${SLOT}.service
- fi
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- if ! use systemd; then
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- fi
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- elif use systemd; then
- einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.1.24.ebuild b/dev-db/postgresql/postgresql-9.1.24.ebuild
deleted file mode 100644
index d75c9142d267..000000000000
--- a/dev-db/postgresql/postgresql-9.1.24.ebuild
+++ /dev/null
@@ -1,384 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-# Testing within Portage's environment is broken, and the patch no
-# longer applies cleanly.
-RESTRICT="test"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- epatch "${FILESDIR}/pg_ctl-exit-status.patch"
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.2.20-r1.ebuild b/dev-db/postgresql/postgresql-9.2.20-r1.ebuild
deleted file mode 100644
index 63786e00878c..000000000000
--- a/dev-db/postgresql/postgresql-9.2.20-r1.ebuild
+++ /dev/null
@@ -1,435 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.2" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.2" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directory/d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.2.20.ebuild b/dev-db/postgresql/postgresql-9.2.20.ebuild
deleted file mode 100644
index ea2a0341512b..000000000000
--- a/dev-db/postgresql/postgresql-9.2.20.ebuild
+++ /dev/null
@@ -1,394 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.2.21-r1.ebuild b/dev-db/postgresql/postgresql-9.2.21-r1.ebuild
deleted file mode 100644
index 004acf03857c..000000000000
--- a/dev-db/postgresql/postgresql-9.2.21-r1.ebuild
+++ /dev/null
@@ -1,435 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.2" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.2" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directory/d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.3.16-r1.ebuild b/dev-db/postgresql/postgresql-9.3.16-r1.ebuild
deleted file mode 100644
index bf27a126ce09..000000000000
--- a/dev-db/postgresql/postgresql-9.3.16-r1.ebuild
+++ /dev/null
@@ -1,440 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.3.16.ebuild b/dev-db/postgresql/postgresql-9.3.16.ebuild
deleted file mode 100644
index 8d5aa3f04daa..000000000000
--- a/dev-db/postgresql/postgresql-9.3.16.ebuild
+++ /dev/null
@@ -1,399 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.3.17-r1.ebuild b/dev-db/postgresql/postgresql-9.3.17-r1.ebuild
deleted file mode 100644
index 32606fb69ed0..000000000000
--- a/dev-db/postgresql/postgresql-9.3.17-r1.ebuild
+++ /dev/null
@@ -1,440 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-uuid? ( dev-libs/ossp-uuid )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- $(use_with uuid ossp-uuid) \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.4.11-r1.ebuild b/dev-db/postgresql/postgresql-9.4.11-r1.ebuild
deleted file mode 100644
index c59e32ab3aec..000000000000
--- a/dev-db/postgresql/postgresql-9.4.11-r1.ebuild
+++ /dev/null
@@ -1,472 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-9.4.10-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.4.11.ebuild b/dev-db/postgresql/postgresql-9.4.11.ebuild
deleted file mode 100644
index 771987a18c95..000000000000
--- a/dev-db/postgresql/postgresql-9.4.11.ebuild
+++ /dev/null
@@ -1,431 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-9.4.10-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.4.12-r1.ebuild b/dev-db/postgresql/postgresql-9.4.12-r1.ebuild
deleted file mode 100644
index e46feae18647..000000000000
--- a/dev-db/postgresql/postgresql-9.4.12-r1.ebuild
+++ /dev/null
@@ -1,472 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-9.4.10-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.5.6-r1.ebuild b/dev-db/postgresql/postgresql-9.5.6-r1.ebuild
deleted file mode 100644
index 71af0ab2c5af..000000000000
--- a/dev-db/postgresql/postgresql-9.5.6-r1.ebuild
+++ /dev/null
@@ -1,478 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-9.5.5-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !alpha spinlocks) \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- if use alpha && use server ; then
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
- ewarn "As a result, performance will be extremely degraded."
- fi
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.5.6.ebuild b/dev-db/postgresql/postgresql-9.5.6.ebuild
deleted file mode 100644
index 43e8649b9c32..000000000000
--- a/dev-db/postgresql/postgresql-9.5.6.ebuild
+++ /dev/null
@@ -1,441 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-9.5.5-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !alpha spinlocks) \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- if use alpha && use server ; then
- ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
- ewarn "As a result, performance will be extremely degraded."
- fi
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- if [ -z "$PG_AUTOCONFIG" ] ; then
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
- else
- einfo "PG_AUTOCONFIG set, not prompting"
- fi
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.6.1-r1.ebuild b/dev-db/postgresql/postgresql-9.6.1-r1.ebuild
deleted file mode 100644
index e453d379b995..000000000000
--- a/dev-db/postgresql/postgresql-9.6.1-r1.ebuild
+++ /dev/null
@@ -1,438 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-MY_PV=${PV/_/}
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}.1-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- if [ -z "$PG_AUTOCONFIG" ] ; then
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
- else
- einfo "PG_AUTOCONFIG set, not prompting"
- fi
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.6.2-r1.ebuild b/dev-db/postgresql/postgresql-9.6.2-r1.ebuild
deleted file mode 100644
index 80cb4316fd9b..000000000000
--- a/dev-db/postgresql/postgresql-9.6.2-r1.ebuild
+++ /dev/null
@@ -1,475 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-MY_PV=${PV/_/}
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}.1-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.6.2.ebuild b/dev-db/postgresql/postgresql-9.6.2.ebuild
deleted file mode 100644
index e453d379b995..000000000000
--- a/dev-db/postgresql/postgresql-9.6.2.ebuild
+++ /dev/null
@@ -1,438 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-MY_PV=${PV/_/}
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-1.2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}.1-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- dodir /etc/eselect/postgresql/slots/${SLOT}
- echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
- "${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if [[ -z ${REPLACING_VERSIONS} ]] ; then
- elog
- elog "It looks like this is your first time installing PostgreSQL. Run the"
- elog "following command in all active shells to pick up changes to the default"
- elog "environment:"
- elog " source /etc/profile"
- fi
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
- if [ -z "$PG_AUTOCONFIG" ] ; then
- while [ "$correct" != "true" ] ; do
- einfo "Are you ready to continue? (y/n)"
- read answer
- if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
- correct="true"
- elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
- die "Aborting initialization."
- else
- echo "Answer not recognized"
- fi
- done
- else
- einfo "PG_AUTOCONFIG set, not prompting"
- fi
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}
diff --git a/dev-db/postgresql/postgresql-9.6.3.ebuild b/dev-db/postgresql/postgresql-9.6.3.ebuild
deleted file mode 100644
index 80cb4316fd9b..000000000000
--- a/dev-db/postgresql/postgresql-9.6.3.ebuild
+++ /dev/null
@@ -1,475 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-
-inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
- systemd user versionator
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
-
-SLOT="$(get_version_component_range 1-2)"
-
-MY_PV=${PV/_/}
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
-
-LICENSE="POSTGRESQL GPL-2"
-DESCRIPTION="PostgreSQL RDBMS"
-HOMEPAGE="http://www.postgresql.org/"
-
-LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
- zh_CN zh_TW"
-IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
- +readline selinux +server ssl static-libs tcl threads uuid xml zlib"
-
-for lingua in ${LINGUAS}; do
- IUSE+=" linguas_${lingua}"
-done
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-wanted_languages() {
- local enable_langs
-
- for lingua in ${LINGUAS} ; do
- use linguas_${lingua} && enable_langs+="${lingua} "
- done
-
- echo -n ${enable_langs}
-}
-
-CDEPEND="
->=app-eselect/eselect-postgresql-2.0
-sys-apps/less
-virtual/libintl
-kerberos? ( virtual/krb5 )
-ldap? ( net-nds/openldap )
-pam? ( virtual/pam )
-perl? ( >=dev-lang/perl-5.8:= )
-python? ( ${PYTHON_DEPS} )
-readline? ( sys-libs/readline:0= )
-ssl? (
- !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
- libressl? ( dev-libs/libressl:= )
-)
-tcl? ( >=dev-lang/tcl-8:0= )
-xml? ( dev-libs/libxml2 dev-libs/libxslt )
-zlib? ( sys-libs/zlib )
-"
-
-# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
-# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
-# the libc includes UUID functions.
-UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
-BSD_LIBC=( elibc_{Free,Net,Open}BSD )
-
-nest_usedep() {
- local front back
- while [[ ${#} -gt 1 ]]; do
- front+="${1}? ( "
- back+=" )"
- shift
- done
- echo "${front}${1}${back}"
-}
-
-IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
-CDEPEND+="
-uuid? (
- ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
- $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
-)"
-
-DEPEND="${CDEPEND}
-!!<sys-apps/sandbox-2.0
-sys-devel/bison
-sys-devel/flex
-nls? ( sys-devel/gettext )
-xml? ( virtual/pkgconfig )
-"
-
-RDEPEND="${CDEPEND}
-!dev-db/postgresql-docs:${SLOT}
-!dev-db/postgresql-base:${SLOT}
-!dev-db/postgresql-server:${SLOT}
-selinux? ( sec-policy/selinux-postgresql )
-"
-
-pkg_setup() {
- use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
-
- enewgroup postgres 70
- enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # Work around PPC{,64} compilation bug where bool is already defined
- sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
-
- # Set proper run directory
- sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
- -i src/include/pg_config_manual.h || die
-
- # Rely on $PATH being in the proper order so that the correct
- # install program is used for modules utilizing PGXS in both
- # hardened and non-hardened environments. (Bug #528786)
- sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
-
- use server || epatch "${FILESDIR}/${PN}-${SLOT}.1-no-server.patch"
-
- # Fix bug 486556 where the server would crash at start up because of
- # an infinite loop caused by a self-referencing symlink.
- epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
-
- if use pam ; then
- sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
- -i src/backend/libpq/auth.c || \
- die 'PGSQL_PAM_SERVICE rename failed.'
- fi
-
- epatch_user
-}
-
-src_configure() {
- case ${CHOST} in
- *-darwin*|*-solaris*)
- use nls && append-libs intl
- ;;
- esac
-
- export LDFLAGS_SL="${LDFLAGS}"
- export LDFLAGS_EX="${LDFLAGS}"
-
- local PO="${EPREFIX%/}"
-
- local i uuid_config=""
- if use uuid; then
- for i in ${UTIL_LINUX_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=e2fs"
- done
- for i in ${BSD_LIBC[@]}; do
- use ${i} && uuid_config="--with-uuid=bsd"
- done
- [[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
- fi
-
- econf \
- --prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
- --datadir="${PO}/usr/share/postgresql-${SLOT}" \
- --docdir="${PO}/usr/share/doc/${PF}" \
- --includedir="${PO}/usr/include/postgresql-${SLOT}" \
- --mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
- --sysconfdir="${PO}/etc/postgresql-${SLOT}" \
- --with-system-tzdata="${PO}/usr/share/zoneinfo" \
- $(use_enable !pg_legacytimestamp integer-datetimes) \
- $(use_enable threads thread-safety) \
- $(use_with kerberos gssapi) \
- $(use_with ldap) \
- $(use_with pam) \
- $(use_with perl) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with ssl openssl) \
- $(use_with tcl) \
- ${uuid_config} \
- $(use_with xml libxml) \
- $(use_with xml libxslt) \
- $(use_with zlib) \
- "$(use_enable nls nls "$(wanted_languages)")"
-}
-
-src_compile() {
- emake
- emake -C contrib
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- emake DESTDIR="${D}" install -C contrib
-
- dodoc README HISTORY doc/{TODO,bug.template}
-
- # man pages are already built, but if we have the target make them,
- # they'll be generated from source before being installed so we
- # manually install man pages.
- # We use ${SLOT} instead of doman for postgresql.eselect
- insinto /usr/share/postgresql-${SLOT}/man/
- doins -r doc/src/sgml/man{1,3,7}
- if ! use server; then
- # Remove man pages for non-existent binaries
- for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
- rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
- done
- fi
- docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
-
- insinto /etc/postgresql-${SLOT}
- newins src/bin/psql/psqlrc.sample psqlrc
-
- use static-libs || find "${ED}" -name '*.a' -delete
-
- local f bn
- for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
- -mindepth 1 -maxdepth 1)
- do
- bn=$(basename "${f}")
- # Temporarily tack on tmp to workaround a file collision
- # issue. This is only necessary for 9.7 and earlier. 10 never
- # had this issue.
- dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
- "/usr/bin/${bn}${SLOT/.}tmp"
- done
-
- local linkname mansec
- for mansec in {1,3,7} ; do
- for f in "${ED}"/usr/share/postgresql-${SLOT}/man/man${mansec}/* ; do
- bn=$(basename "${f}")
- linkname=${bn/%.${mansec}/${SLOT/.}.${mansec}}
- dosym ../../postgresql-${SLOT}/man/man${mansec}/$bn \
- /usr/share/man/man${mansec}/${linkname}
- done
- done
-
- if use doc ; then
- docinto html
- dodoc doc/src/sgml/html/*
-
- docinto sgml
- dodoc doc/src/sgml/*.{sgml,dsl}
- fi
-
- if use server; then
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
-
- sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
- "${FILESDIR}/${PN}.service" | \
- systemd_newunit - ${PN}-${SLOT}.service
-
- newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
-
- use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
-
- if use prefix ; then
- keepdir /run/postgresql
- fperms 0775 /run/postgresql
- fi
- fi
-}
-
-pkg_preinst() {
- # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
- # /usr/bin/psql96). They may have been created by the
- # postgresql.eselect module, but they're handled within this ebuild
- # now. It's alright if we momentarily delete /usr/bin/psql as it
- # will be recreated by the eselect module in pkg_ppostinst(). This
- # is only necessary for 9.7 and earlier. 10 and later were never
- # handled in this manner.
- local canonicalise
- if type -p realpath > /dev/null; then
- canonicalise=realpath
- elif type -p readlink > /dev/null; then
- canonicalise='readlink -f'
- else
- # can't die, subshell
- die "No readlink nor realpath found, cannot canonicalise"
- fi
-
- local l
- # First remove any symlinks in /usr/bin that may have been created
- # by the old eselect
- for l in $(find "${ROOT%/}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
- if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then
- rm "${l}" || ewarn "Couldn't remove ${l}"
- fi
- done
-
- # Then move the symlinks created by the ebuild to their proper place.
- for l in "${ED}"/usr/bin/*tmp ; do
- mv "${l}" "${l%tmp}" \
- || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
- done
-}
-
-pkg_postinst() {
- postgresql-config update
-
- elog "If you need a global psqlrc-file, you can place it in:"
- elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
-
- if use server ; then
- elog
- elog "Gentoo specific documentation:"
- elog "https://wiki.gentoo.org/wiki/PostgreSQL"
- elog
- elog "Official documentation:"
- elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
- elog
- elog "The default location of the Unix-domain socket is:"
- elog " ${EROOT%/}/run/postgresql/"
- elog
- elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
- elog "so that it contains your preferred locale in:"
- elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- elog
- elog "Then, execute the following command to setup the initial database"
- elog "environment:"
- elog " emerge --config =${CATEGORY}/${PF}"
- fi
-}
-
-pkg_prerm() {
- if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
- ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
- ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
-
- ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
- sleep 10
- eend 0
- fi
-}
-
-pkg_postrm() {
- postgresql-config update
-}
-
-pkg_config() {
- use server || die "USE flag 'server' not enabled. Nothing to configure."
-
- [[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
- && source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- [[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
- [[ -z "${DATA_DIR}" ]] \
- && DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
-
- # environment.bz2 may not contain the same locale as the current system
- # locale. Unset and source from the current system locale.
- if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
- unset LANG
- unset LC_CTYPE
- unset LC_NUMERIC
- unset LC_TIME
- unset LC_COLLATE
- unset LC_MONETARY
- unset LC_MESSAGES
- unset LC_ALL
- source "${EROOT%/}/etc/env.d/02locale"
- [ -n "${LANG}" ] && export LANG
- [ -n "${LC_CTYPE}" ] && export LC_CTYPE
- [ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
- [ -n "${LC_TIME}" ] && export LC_TIME
- [ -n "${LC_COLLATE}" ] && export LC_COLLATE
- [ -n "${LC_MONETARY}" ] && export LC_MONETARY
- [ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
- [ -n "${LC_ALL}" ] && export LC_ALL
- fi
-
- einfo "You can modify the paths and options passed to initdb by editing:"
- einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
- einfo
- einfo "Information on options that can be passed to initdb are found at:"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
- einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
- einfo
- einfo "PG_INITDB_OPTS is currently set to:"
- if [[ -z "${PG_INITDB_OPTS}" ]] ; then
- einfo " (none)"
- else
- einfo " ${PG_INITDB_OPTS}"
- fi
- einfo
- einfo "Configuration files will be installed to:"
- einfo " ${PGDATA}"
- einfo
- einfo "The database cluster will be created in:"
- einfo " ${DATA_DIR}"
- einfo
-
- ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
- sleep 5
- eend 0
-
- if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
- eerror "The given directory, '${DATA_DIR}', is not empty."
- eerror "Modify DATA_DIR to point to an empty directory."
- die "${DATA_DIR} is not empty."
- fi
-
- einfo "Creating the data directory ..."
- if [[ ${EUID} == 0 ]] ; then
- mkdir -p "${DATA_DIR}"
- chown -Rf postgres:postgres "${DATA_DIR}"
- chmod 0700 "${DATA_DIR}"
- fi
-
- einfo "Initializing the database ..."
-
- if [[ ${EUID} == 0 ]] ; then
- su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
- else
- "${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
- fi
-
- if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
- mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
- ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
- fi
-
- # unix_socket_directory has no effect in postgresql.conf as it's
- # overridden in the initscript
- sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
-
- cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
- # This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
- # On the off-chance that you might need to work with UTF-8 encoded
- # characters in PL/Perl
- plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
- EOF
-
- einfo "The autovacuum function, which was in contrib, has been moved to the main"
- einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
- einfo "by default. You can disable it in the cluster's:"
- einfo " ${PGDATA%/}/postgresql.conf"
- einfo
- einfo "The PostgreSQL server, by default, will log events to:"
- einfo " ${DATA_DIR%/}/postmaster.log"
- einfo
- if use prefix ; then
- einfo "The location of the configuration files have moved to:"
- einfo " ${PGDATA}"
- einfo "To start the server:"
- einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
- einfo "To stop:"
- einfo " pg_ctl stop -D ${DATA_DIR}"
- einfo
- einfo "Or move the configuration files back:"
- einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
- else
- einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
- einfo "instead of 'pg_ctl'."
- fi
-}
-
-src_test() {
- if use server && [[ ${UID} -ne 0 ]] ; then
- emake check
-
- einfo "If you think other tests besides the regression tests are necessary, please"
- einfo "submit a bug including a patch for this ebuild to enable them."
- else
- use server || \
- ewarn 'Tests cannot be run without the "server" use flag enabled.'
- [[ ${UID} -eq 0 ]] || \
- ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
-
- ewarn 'Skipping.'
- fi
-}