summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-db
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/4store/4store-1.1.5-r1.ebuild63
-rw-r--r--dev-db/4store/Manifest5
-rw-r--r--dev-db/4store/metadata.xml8
-rw-r--r--dev-db/SchemaSync/Manifest7
-rw-r--r--dev-db/SchemaSync/SchemaSync-0.9.2-r1.ebuild24
-rw-r--r--dev-db/SchemaSync/SchemaSync-0.9.4.ebuild23
-rw-r--r--dev-db/SchemaSync/metadata.xml12
-rw-r--r--dev-db/aerospike-server-community/Manifest13
-rw-r--r--dev-db/aerospike-server-community/aerospike-server-community-3.13.0.7.ebuild71
-rw-r--r--dev-db/aerospike-server-community/aerospike-server-community-3.14.1.4.ebuild71
-rw-r--r--dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild86
-rw-r--r--dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch63
-rw-r--r--dev-db/aerospike-server-community/files/aerospike.conf70
-rw-r--r--dev-db/aerospike-server-community/files/aerospike.init53
-rw-r--r--dev-db/aerospike-server-community/files/aerospike.logrotate10
-rw-r--r--dev-db/aerospike-server-community/files/aerospike_mesh.conf73
-rw-r--r--dev-db/aerospike-server-community/files/aerospike_ssd.conf68
-rw-r--r--dev-db/aerospike-server-community/metadata.xml10
-rw-r--r--dev-db/apgdiff/Manifest13
-rw-r--r--dev-db/apgdiff/apgdiff-1.4.ebuild50
-rw-r--r--dev-db/apgdiff/apgdiff-2.2.1.ebuild50
-rw-r--r--dev-db/apgdiff/apgdiff-2.2.2.ebuild50
-rw-r--r--dev-db/apgdiff/apgdiff-2.3.ebuild50
-rw-r--r--dev-db/apgdiff/apgdiff-2.4.ebuild50
-rw-r--r--dev-db/apgdiff/metadata.xml10
-rw-r--r--dev-db/barman/Manifest7
-rw-r--r--dev-db/barman/barman-2.1.ebuild26
-rw-r--r--dev-db/barman/barman-2.3.ebuild26
-rw-r--r--dev-db/barman/metadata.xml11
-rw-r--r--dev-db/bucardo/Manifest11
-rw-r--r--dev-db/bucardo/bucardo-5.1.1-r1.ebuild31
-rw-r--r--dev-db/bucardo/bucardo-5.2.0.ebuild31
-rw-r--r--dev-db/bucardo/bucardo-5.3.1.ebuild31
-rw-r--r--dev-db/bucardo/bucardo-5.4.1.ebuild31
-rw-r--r--dev-db/bucardo/metadata.xml8
-rw-r--r--dev-db/cdb/Manifest7
-rw-r--r--dev-db/cdb/cdb-0.75-r4.ebuild52
-rw-r--r--dev-db/cdb/files/cdb-0.75-errno.diff11
-rw-r--r--dev-db/cdb/files/cdb-0.75-stdint.diff436
-rw-r--r--dev-db/cdb/metadata.xml5
-rw-r--r--dev-db/cockroach/Manifest16
-rw-r--r--dev-db/cockroach/cockroach-1.0-r1.ebuild61
-rw-r--r--dev-db/cockroach/cockroach-1.0.1.ebuild61
-rw-r--r--dev-db/cockroach/cockroach-1.0.3.ebuild61
-rw-r--r--dev-db/cockroach/cockroach-1.0.ebuild61
-rw-r--r--dev-db/cockroach/cockroach-1.0_rc1.ebuild59
-rw-r--r--dev-db/cockroach/files/cockroach-limits.conf4
-rw-r--r--dev-db/cockroach/files/cockroach.confd14
-rw-r--r--dev-db/cockroach/files/cockroach.confd-1.045
-rw-r--r--dev-db/cockroach/files/cockroach.initd23
-rw-r--r--dev-db/cockroach/files/cockroach.initd-1.060
-rw-r--r--dev-db/cockroach/files/cockroach.initd-1.0.170
-rw-r--r--dev-db/cockroach/metadata.xml12
-rw-r--r--dev-db/couchdb/Manifest10
-rw-r--r--dev-db/couchdb/couchdb-1.6.1-r2.ebuild78
-rw-r--r--dev-db/couchdb/couchdb-1.6.1-r3.ebuild79
-rw-r--r--dev-db/couchdb/files/1.6.1-erlang-18.patch99
-rw-r--r--dev-db/couchdb/files/1.6.1-erlang-19.patch105
-rw-r--r--dev-db/couchdb/files/couchdb.conf-29
-rw-r--r--dev-db/couchdb/files/couchdb.init-417
-rw-r--r--dev-db/couchdb/metadata.xml7
-rw-r--r--dev-db/cpp-driver/Manifest4
-rw-r--r--dev-db/cpp-driver/cpp-driver-2.4.3.ebuild28
-rw-r--r--dev-db/cpp-driver/metadata.xml18
-rw-r--r--dev-db/cppdb/Manifest5
-rw-r--r--dev-db/cppdb/cppdb-0.3.1-r1.ebuild49
-rw-r--r--dev-db/cppdb/metadata.xml13
-rw-r--r--dev-db/datadraw/Manifest5
-rw-r--r--dev-db/datadraw/datadraw-3.1.1.ebuild50
-rw-r--r--dev-db/datadraw/metadata.xml18
-rw-r--r--dev-db/db-je/Manifest6
-rw-r--r--dev-db/db-je/db-je-3.3.75.ebuild38
-rw-r--r--dev-db/db-je/files/db-je-3.3.75-optional-test.patch45
-rw-r--r--dev-db/db-je/metadata.xml12
-rw-r--r--dev-db/dbmodel/Manifest5
-rw-r--r--dev-db/dbmodel/dbmodel-0.3.ebuild25
-rw-r--r--dev-db/dbmodel/metadata.xml8
-rw-r--r--dev-db/etcd/Manifest13
-rw-r--r--dev-db/etcd/etcd-2.3.8.ebuild58
-rw-r--r--dev-db/etcd/etcd-3.2.9.ebuild63
-rw-r--r--dev-db/etcd/files/etcd.conf39
-rw-r--r--dev-db/etcd/files/etcd.confd7
-rw-r--r--dev-db/etcd/files/etcd.initd35
-rw-r--r--dev-db/etcd/files/etcd.logrotated7
-rw-r--r--dev-db/etcd/files/etcd.service17
-rw-r--r--dev-db/etcd/files/etcd.tmpfiles.d.conf2
-rw-r--r--dev-db/etcd/metadata.xml17
-rw-r--r--dev-db/firebird/Manifest19
-rw-r--r--dev-db/firebird/files/firebird-2.5.1.26351.0-superclassic.patch12
-rw-r--r--dev-db/firebird/files/firebird-2.5.3.26780.0-deps-flags.patch59
-rw-r--r--dev-db/firebird/files/firebird-3.0.2.32703.0-cloop-compiler.patch15
-rw-r--r--dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch19
-rw-r--r--dev-db/firebird/files/firebird-3.0.2.32703.0-unbundle.patch51
-rw-r--r--dev-db/firebird/files/firebird.conf.d.2.57
-rw-r--r--dev-db/firebird/files/firebird.init.d.2.530
-rw-r--r--dev-db/firebird/files/firebird.init.d.3.022
-rw-r--r--dev-db/firebird/files/firebird.logrotate10
-rw-r--r--dev-db/firebird/files/firebird.xinetd11
-rw-r--r--dev-db/firebird/files/firebird.xinetd.3.011
-rw-r--r--dev-db/firebird/firebird-2.5.7.27050.0.ebuild275
-rw-r--r--dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild235
-rw-r--r--dev-db/firebird/metadata.xml22
-rw-r--r--dev-db/freetds/Manifest11
-rw-r--r--dev-db/freetds/files/without-flags.patch48
-rw-r--r--dev-db/freetds/freetds-0.91.ebuild47
-rw-r--r--dev-db/freetds/freetds-1.00.41.ebuild72
-rw-r--r--dev-db/freetds/freetds-1.00.54-r1.ebuild72
-rw-r--r--dev-db/freetds/freetds-9999.ebuild62
-rw-r--r--dev-db/freetds/metadata.xml5
-rw-r--r--dev-db/gigabase/Manifest8
-rw-r--r--dev-db/gigabase/files/gigabase-3.83-cpp14.patch34
-rw-r--r--dev-db/gigabase/files/gigabase-3.83-fix-build-system.patch63
-rw-r--r--dev-db/gigabase/files/gigabase-3.83-fix-dereferencing.patch182
-rw-r--r--dev-db/gigabase/gigabase-3.83-r2.ebuild58
-rw-r--r--dev-db/gigabase/metadata.xml27
-rw-r--r--dev-db/go-etcd/Manifest8
-rw-r--r--dev-db/go-etcd/go-etcd-0_p20141013-r1.ebuild46
-rw-r--r--dev-db/go-etcd/go-etcd-2.0.0-r1.ebuild46
-rw-r--r--dev-db/go-etcd/go-etcd-2.0.0.ebuild48
-rw-r--r--dev-db/go-etcd/metadata.xml13
-rw-r--r--dev-db/gqlplus/Manifest4
-rw-r--r--dev-db/gqlplus/gqlplus-1.16.ebuild28
-rw-r--r--dev-db/gqlplus/metadata.xml17
-rw-r--r--dev-db/henplus/Manifest8
-rw-r--r--dev-db/henplus/files/0.9.8-build.xml.patch23
-rw-r--r--dev-db/henplus/files/henplus.pre51
-rw-r--r--dev-db/henplus/henplus-0.9.8-r1.ebuild43
-rw-r--r--dev-db/henplus/henplus-0.9.8.ebuild43
-rw-r--r--dev-db/henplus/metadata.xml11
-rw-r--r--dev-db/hsqldb/Manifest12
-rw-r--r--dev-db/hsqldb/files/StringComparator.java53
-rw-r--r--dev-db/hsqldb/files/TestBug1191815.java129
-rw-r--r--dev-db/hsqldb/files/hsqldb19
-rw-r--r--dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch380
-rw-r--r--dev-db/hsqldb/files/resolve-config-softlinks.patch22
-rw-r--r--dev-db/hsqldb/files/server.properties20
-rw-r--r--dev-db/hsqldb/files/sqltool.rc18
-rw-r--r--dev-db/hsqldb/hsqldb-1.8.1.3-r2.ebuild173
-rw-r--r--dev-db/hsqldb/metadata.xml11
-rw-r--r--dev-db/hyperdex/Manifest15
-rw-r--r--dev-db/hyperdex/files/hyperdex.confd4
-rw-r--r--dev-db/hyperdex/files/hyperdex.initd10
-rw-r--r--dev-db/hyperdex/hyperdex-1.6.0-r1.ebuild61
-rw-r--r--dev-db/hyperdex/hyperdex-1.7.1.ebuild61
-rw-r--r--dev-db/hyperdex/hyperdex-1.8.0.ebuild66
-rw-r--r--dev-db/hyperdex/hyperdex-1.8.1.ebuild66
-rw-r--r--dev-db/hyperdex/hyperdex-9999.ebuild59
-rw-r--r--dev-db/hyperdex/metadata.xml8
-rw-r--r--dev-db/innotop/Manifest7
-rw-r--r--dev-db/innotop/innotop-1.11.1.ebuild27
-rw-r--r--dev-db/innotop/innotop-1.11.4.ebuild27
-rw-r--r--dev-db/innotop/metadata.xml13
-rw-r--r--dev-db/kdb/Manifest4
-rw-r--r--dev-db/kdb/kdb-3.0.2.ebuild44
-rw-r--r--dev-db/kdb/metadata.xml8
-rw-r--r--dev-db/kyotocabinet/Manifest9
-rw-r--r--dev-db/kyotocabinet/files/fix_configure-1.2.62.patch51
-rw-r--r--dev-db/kyotocabinet/files/kyotocabinet-1.2.76-configure-8-byte-atomics.patch44
-rw-r--r--dev-db/kyotocabinet/files/kyotocabinet-1.2.76-flags.patch31
-rw-r--r--dev-db/kyotocabinet/files/kyotocabinet-1.2.76-gcc6.patch11
-rw-r--r--dev-db/kyotocabinet/kyotocabinet-1.2.76-r1.ebuild62
-rw-r--r--dev-db/kyotocabinet/metadata.xml8
-rw-r--r--dev-db/lib_mysqludf_fPROJ4/Manifest6
-rw-r--r--dev-db/lib_mysqludf_fPROJ4/files/lib_mysqludf_fPROJ4-warnings.patch35
-rw-r--r--dev-db/lib_mysqludf_fPROJ4/lib_mysqludf_fPROJ4-0.1.0.ebuild63
-rw-r--r--dev-db/lib_mysqludf_fPROJ4/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_json/Manifest5
-rw-r--r--dev-db/lib_mysqludf_json/lib_mysqludf_json-0.0.2.ebuild58
-rw-r--r--dev-db/lib_mysqludf_json/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_log/Manifest6
-rw-r--r--dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch11
-rw-r--r--dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild56
-rw-r--r--dev-db/lib_mysqludf_log/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_preg/Manifest5
-rw-r--r--dev-db/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.ebuild58
-rw-r--r--dev-db/lib_mysqludf_preg/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_stat/Manifest6
-rw-r--r--dev-db/lib_mysqludf_stat/files/lib_mysqludf_stat-warnings.patch20
-rw-r--r--dev-db/lib_mysqludf_stat/lib_mysqludf_stat-0.0.3.ebuild59
-rw-r--r--dev-db/lib_mysqludf_stat/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_stem/Manifest6
-rw-r--r--dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch71
-rw-r--r--dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild68
-rw-r--r--dev-db/lib_mysqludf_stem/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_str/Manifest5
-rw-r--r--dev-db/lib_mysqludf_str/lib_mysqludf_str-0.3.ebuild56
-rw-r--r--dev-db/lib_mysqludf_str/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_sys/Manifest5
-rw-r--r--dev-db/lib_mysqludf_sys/lib_mysqludf_sys-0.0.3.ebuild58
-rw-r--r--dev-db/lib_mysqludf_sys/metadata.xml5
-rw-r--r--dev-db/lib_mysqludf_ta/Manifest5
-rw-r--r--dev-db/lib_mysqludf_ta/lib_mysqludf_ta-0.1.ebuild67
-rw-r--r--dev-db/lib_mysqludf_ta/metadata.xml8
-rw-r--r--dev-db/lib_mysqludf_udf/Manifest5
-rw-r--r--dev-db/lib_mysqludf_udf/lib_mysqludf_udf-0.0.3.ebuild52
-rw-r--r--dev-db/lib_mysqludf_udf/metadata.xml5
-rw-r--r--dev-db/libdbi-drivers/Manifest6
-rw-r--r--dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-doc-build-fix.patch22
-rw-r--r--dev-db/libdbi-drivers/libdbi-drivers-0.9.0.ebuild84
-rw-r--r--dev-db/libdbi-drivers/metadata.xml10
-rw-r--r--dev-db/libdbi/Manifest7
-rw-r--r--dev-db/libdbi/files/dbi.pc.in10
-rw-r--r--dev-db/libdbi/files/libdbi-0.9.0-doc-build-fix.patch22
-rw-r--r--dev-db/libdbi/libdbi-0.9.0.ebuild58
-rw-r--r--dev-db/libdbi/metadata.xml10
-rw-r--r--dev-db/libiodbc/Manifest17
-rw-r--r--dev-db/libiodbc/files/fix-runpaths-r1.patch15
-rw-r--r--dev-db/libiodbc/files/fix-runpaths.patch15
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.12-multilib.patch37
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug501100.patch14
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug508480.patch14
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.7-gtk.patch16
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.7-multilib.patch35
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.7-unicode_includes.patch12
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.8-gtk-parallel-make.patch23
-rw-r--r--dev-db/libiodbc/files/libiodbc-3.52.8-runtime-failures.patch56
-rw-r--r--dev-db/libiodbc/libiodbc-3.52.12.ebuild67
-rw-r--r--dev-db/libiodbc/libiodbc-3.52.8-r2.ebuild67
-rw-r--r--dev-db/libiodbc/metadata.xml8
-rw-r--r--dev-db/libodbc++/Manifest8
-rw-r--r--dev-db/libodbc++/files/libodbc++-0.2.3-doxygen.patch12
-rw-r--r--dev-db/libodbc++/files/libodbc++-0.2.3-gcc41.patch12
-rw-r--r--dev-db/libodbc++/files/libodbc++-0.2.3-gcc44.patch11
-rw-r--r--dev-db/libodbc++/libodbc++-0.2.5-r2.ebuild108
-rw-r--r--dev-db/libodbc++/metadata.xml14
-rw-r--r--dev-db/libzdb/Manifest15
-rw-r--r--dev-db/libzdb/libzdb-2.11.1.ebuild89
-rw-r--r--dev-db/libzdb/libzdb-2.11.2.ebuild89
-rw-r--r--dev-db/libzdb/libzdb-2.11.3.ebuild89
-rw-r--r--dev-db/libzdb/libzdb-2.12.ebuild89
-rw-r--r--dev-db/libzdb/libzdb-3.0.ebuild89
-rw-r--r--dev-db/libzdb/libzdb-3.1.ebuild89
-rw-r--r--dev-db/libzdb/metadata.xml8
-rw-r--r--dev-db/lmdb++/Manifest5
-rw-r--r--dev-db/lmdb++/lmdb++-0.9.14.0.ebuild23
-rw-r--r--dev-db/lmdb++/metadata.xml16
-rw-r--r--dev-db/lmdb/Manifest7
-rw-r--r--dev-db/lmdb/lmdb-0.9.18.ebuild47
-rw-r--r--dev-db/lmdb/lmdb-0.9.19.ebuild56
-rw-r--r--dev-db/lmdb/metadata.xml18
-rw-r--r--dev-db/m17n-contrib/Manifest7
-rw-r--r--dev-db/m17n-contrib/m17n-contrib-1.1.13.ebuild15
-rw-r--r--dev-db/m17n-contrib/m17n-contrib-1.1.14.ebuild15
-rw-r--r--dev-db/m17n-contrib/metadata.xml11
-rw-r--r--dev-db/m17n-db/Manifest9
-rw-r--r--dev-db/m17n-db/m17n-db-1.6.3.ebuild26
-rw-r--r--dev-db/m17n-db/m17n-db-1.6.4.ebuild26
-rw-r--r--dev-db/m17n-db/m17n-db-1.7.0.ebuild27
-rw-r--r--dev-db/m17n-db/metadata.xml8
-rw-r--r--dev-db/maatkit/Manifest5
-rw-r--r--dev-db/maatkit/maatkit-7540-r1.ebuild110
-rw-r--r--dev-db/maatkit/metadata.xml18
-rw-r--r--dev-db/mariadb-galera/Manifest8
-rw-r--r--dev-db/mariadb-galera/files/my.cnf-5.5158
-rw-r--r--dev-db/mariadb-galera/files/my.cnf-5.6158
-rw-r--r--dev-db/mariadb-galera/mariadb-galera-10.0.32.ebuild181
-rw-r--r--dev-db/mariadb-galera/metadata.xml32
-rw-r--r--dev-db/mariadb/Manifest31
-rw-r--r--dev-db/mariadb/files/my.cnf-10.23
-rw-r--r--dev-db/mariadb/files/my.cnf-5.1145
-rw-r--r--dev-db/mariadb/files/my.cnf-5.5149
-rw-r--r--dev-db/mariadb/files/my.cnf-5.6142
-rw-r--r--dev-db/mariadb/files/my.cnf.distro-client21
-rw-r--r--dev-db/mariadb/files/my.cnf.distro-server28
-rw-r--r--dev-db/mariadb/mariadb-10.0.29.ebuild211
-rw-r--r--dev-db/mariadb/mariadb-10.0.30.ebuild212
-rw-r--r--dev-db/mariadb/mariadb-10.0.32.ebuild209
-rw-r--r--dev-db/mariadb/mariadb-10.1.24.ebuild227
-rw-r--r--dev-db/mariadb/mariadb-10.1.26.ebuild228
-rw-r--r--dev-db/mariadb/mariadb-10.1.28.ebuild229
-rw-r--r--dev-db/mariadb/mariadb-10.2.9.ebuild1006
-rw-r--r--dev-db/mariadb/mariadb-5.5.57.ebuild123
-rw-r--r--dev-db/mariadb/metadata.xml41
-rw-r--r--dev-db/maxscale/Manifest6
-rw-r--r--dev-db/maxscale/files/maxscale-1.2.0-rpath.patch48
-rw-r--r--dev-db/maxscale/files/maxscale-init.d21
-rw-r--r--dev-db/maxscale/maxscale-1.2.0.ebuild70
-rw-r--r--dev-db/maxscale/metadata.xml19
-rw-r--r--dev-db/metadata.xml40
-rw-r--r--dev-db/metakit/Manifest7
-rw-r--r--dev-db/metakit/files/metakit-2.4.9.7-linking.patch45
-rw-r--r--dev-db/metakit/files/metakit-2.4.9.7-tcltk86.patch70
-rw-r--r--dev-db/metakit/metadata.xml5
-rw-r--r--dev-db/metakit/metakit-2.4.9.7-r2.ebuild82
-rw-r--r--dev-db/mongodb/Manifest49
-rw-r--r--dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch11
-rw-r--r--dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch13
-rw-r--r--dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch35
-rw-r--r--dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch35
-rw-r--r--dev-db/mongodb/files/mongodb-3.0.14-fix-scons.patch36
-rw-r--r--dev-db/mongodb/files/mongodb-3.0.14-fix-std-string.patch83
-rw-r--r--dev-db/mongodb/files/mongodb-3.2.0-fix-scons.patch49
-rw-r--r--dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch15
-rw-r--r--dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch283
-rw-r--r--dev-db/mongodb/files/mongodb-3.2.4-boost-1.60.patch84
-rw-r--r--dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch35
-rw-r--r--dev-db/mongodb/files/mongodb-3.4.4-Replace-string-with-explicit-std-string.patch302
-rw-r--r--dev-db/mongodb/files/mongodb-3.4.6-no-boost-check.patch11
-rw-r--r--dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch38
-rw-r--r--dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch13
-rw-r--r--dev-db/mongodb/files/mongodb.conf8
-rw-r--r--dev-db/mongodb/files/mongodb.conf-r233
-rw-r--r--dev-db/mongodb/files/mongodb.conf-r334
-rw-r--r--dev-db/mongodb/files/mongodb.confd-r212
-rw-r--r--dev-db/mongodb/files/mongodb.initd-r226
-rw-r--r--dev-db/mongodb/files/mongodb.logrotate13
-rw-r--r--dev-db/mongodb/files/mongodb.service10
-rw-r--r--dev-db/mongodb/files/mongos.conf-r230
-rw-r--r--dev-db/mongodb/files/mongos.confd-r212
-rw-r--r--dev-db/mongodb/files/mongos.initd-r226
-rw-r--r--dev-db/mongodb/metadata.xml29
-rw-r--r--dev-db/mongodb/mongodb-2.6.12.ebuild183
-rw-r--r--dev-db/mongodb/mongodb-3.0.14.ebuild174
-rw-r--r--dev-db/mongodb/mongodb-3.0.15.ebuild174
-rw-r--r--dev-db/mongodb/mongodb-3.2.12.ebuild192
-rw-r--r--dev-db/mongodb/mongodb-3.2.13.ebuild192
-rw-r--r--dev-db/mongodb/mongodb-3.2.16.ebuild191
-rw-r--r--dev-db/mongodb/mongodb-3.4.3.ebuild189
-rw-r--r--dev-db/mongodb/mongodb-3.4.4.ebuild190
-rw-r--r--dev-db/mongodb/mongodb-3.4.6.ebuild191
-rw-r--r--dev-db/mongodb/mongodb-3.4.7.ebuild189
-rw-r--r--dev-db/mtop/Manifest6
-rw-r--r--dev-db/mtop/files/mtop-0.6.6-globalstatusfix.patch12
-rw-r--r--dev-db/mtop/metadata.xml11
-rw-r--r--dev-db/mtop/mtop-0.6.6-r3.ebuild33
-rw-r--r--dev-db/mycli/Manifest7
-rw-r--r--dev-db/mycli/metadata.xml11
-rw-r--r--dev-db/mycli/mycli-1.10.0.ebuild26
-rw-r--r--dev-db/mycli/mycli-1.7.1.ebuild31
-rw-r--r--dev-db/mycli/mycli-9999.ebuild28
-rw-r--r--dev-db/mydumper/Manifest8
-rw-r--r--dev-db/mydumper/files/mydumper-mariadb-include-fix.patch24
-rw-r--r--dev-db/mydumper/metadata.xml15
-rw-r--r--dev-db/mydumper/mydumper-0.6.2.ebuild35
-rw-r--r--dev-db/mydumper/mydumper-0.9.3.ebuild42
-rw-r--r--dev-db/myodbc/Manifest21
-rw-r--r--dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch79
-rw-r--r--dev-db/myodbc/files/5.2.7-my_malloc.patch18
-rw-r--r--dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch40
-rw-r--r--dev-db/myodbc/files/5.3-cmake-doc-path.patch43
-rw-r--r--dev-db/myodbc/files/5.3-cxxlinkage.patch43
-rw-r--r--dev-db/myodbc/files/5.3-mariadb-buffer_length.patch93
-rw-r--r--dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch96
-rw-r--r--dev-db/myodbc/files/cmake-doc-path.patch43
-rw-r--r--dev-db/myodbc/files/odbc.ini.m417
-rw-r--r--dev-db/myodbc/files/odbcinst.ini.m45
-rw-r--r--dev-db/myodbc/metadata.xml8
-rw-r--r--dev-db/myodbc/myodbc-5.2.7-r1.ebuild121
-rw-r--r--dev-db/myodbc/myodbc-5.2.7-r2.ebuild124
-rw-r--r--dev-db/myodbc/myodbc-5.3.8-r1.ebuild115
-rw-r--r--dev-db/myodbc/myodbc-5.3.8.ebuild137
-rw-r--r--dev-db/mysql++/Manifest17
-rw-r--r--dev-db/mysql++/files/mysql++-2.3.2-gcc-4.3.patch11
-rw-r--r--dev-db/mysql++/files/mysql++-3.0-gcc-as-needed.patch130
-rw-r--r--dev-db/mysql++/files/mysql++-3.2.1-gold.patch11
-rw-r--r--dev-db/mysql++/files/mysql++-3.2.3-mariadb-10.2.patch31
-rw-r--r--dev-db/mysql++/metadata.xml8
-rw-r--r--dev-db/mysql++/mysql++-2.3.2.ebuild55
-rw-r--r--dev-db/mysql++/mysql++-3.1.0.ebuild49
-rw-r--r--dev-db/mysql++/mysql++-3.2.1.ebuild37
-rw-r--r--dev-db/mysql++/mysql++-3.2.2.ebuild36
-rw-r--r--dev-db/mysql++/mysql++-3.2.3.ebuild50
-rw-r--r--dev-db/mysql-cluster/Manifest10
-rw-r--r--dev-db/mysql-cluster/files/my.cnf-5.5147
-rw-r--r--dev-db/mysql-cluster/files/my.cnf-5.6139
-rw-r--r--dev-db/mysql-cluster/metadata.xml24
-rw-r--r--dev-db/mysql-cluster/mysql-cluster-7.2.22.ebuild124
-rw-r--r--dev-db/mysql-cluster/mysql-cluster-7.3.11.ebuild143
-rw-r--r--dev-db/mysql-connector-c++/Manifest15
-rw-r--r--dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.3-fix-cmake.patch123
-rw-r--r--dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.5-fix-mariadb.patch45
-rw-r--r--dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.6-fix-cmake.patch23
-rw-r--r--dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch45
-rw-r--r--dev-db/mysql-connector-c++/metadata.xml15
-rw-r--r--dev-db/mysql-connector-c++/mysql-connector-c++-1.1.3.ebuild58
-rw-r--r--dev-db/mysql-connector-c++/mysql-connector-c++-1.1.6.ebuild61
-rw-r--r--dev-db/mysql-connector-c++/mysql-connector-c++-1.1.8.ebuild62
-rw-r--r--dev-db/mysql-connector-c++/mysql-connector-c++-1.1.9.ebuild62
-rw-r--r--dev-db/mysql-connector-c/Manifest14
-rw-r--r--dev-db/mysql-connector-c/files/conn-c-includes.patch15
-rw-r--r--dev-db/mysql-connector-c/files/mysql_com.patch31
-rw-r--r--dev-db/mysql-connector-c/files/openssl-cmake-detection.patch12
-rw-r--r--dev-db/mysql-connector-c/metadata.xml8
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.5.ebuild63
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r1.ebuild68
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r2.ebuild78
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.9-r1.ebuild80
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.9.ebuild73
-rw-r--r--dev-db/mysql-init-scripts/Manifest18
-rw-r--r--dev-db/mysql-init-scripts/files/conf.d-2.078
-rw-r--r--dev-db/mysql-init-scripts/files/init.d-2.0159
-rw-r--r--dev-db/mysql-init-scripts/files/init.d-2.2191
-rw-r--r--dev-db/mysql-init-scripts/files/init.d-s6128
-rw-r--r--dev-db/mysql-init-scripts/files/init.d-s6-2.2163
-rw-r--r--dev-db/mysql-init-scripts/files/init.d-supervise180
-rw-r--r--dev-db/mysql-init-scripts/files/log-s611
-rw-r--r--dev-db/mysql-init-scripts/files/logrotate.mysql14
-rw-r--r--dev-db/mysql-init-scripts/files/mysql.conf1
-rw-r--r--dev-db/mysql-init-scripts/files/mysqld-v2.service47
-rw-r--r--dev-db/mysql-init-scripts/files/mysqld-wait-ready56
-rw-r--r--dev-db/mysql-init-scripts/files/mysqld_at-v2.service45
-rw-r--r--dev-db/mysql-init-scripts/files/run-s66
-rw-r--r--dev-db/mysql-init-scripts/metadata.xml8
-rw-r--r--dev-db/mysql-init-scripts/mysql-init-scripts-2.1-r1.ebuild63
-rw-r--r--dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r1.ebuild64
-rw-r--r--dev-db/mysql-proxy/Manifest9
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.cnf47
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.confd12
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r112
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.initd22
-rw-r--r--dev-db/mysql-proxy/metadata.xml13
-rw-r--r--dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild51
-rw-r--r--dev-db/mysql-super-smack/Manifest10
-rw-r--r--dev-db/mysql-super-smack/files/mysql-super-smack-1.2.destdir.patch13
-rw-r--r--dev-db/mysql-super-smack/files/mysql-super-smack-1.3-automake-1.13.patch256
-rw-r--r--dev-db/mysql-super-smack/files/mysql-super-smack-1.3-gen-data.patch45
-rw-r--r--dev-db/mysql-super-smack/files/mysql-super-smack-1.3.amd64.patch20
-rw-r--r--dev-db/mysql-super-smack/files/mysql-super-smack-1.3.gcc4.3.patch9
-rw-r--r--dev-db/mysql-super-smack/metadata.xml9
-rw-r--r--dev-db/mysql-super-smack/mysql-super-smack-1.3-r3.ebuild58
-rw-r--r--dev-db/mysql-udf-base64/Manifest8
-rw-r--r--dev-db/mysql-udf-base64/files/mysql-udf-base64-signedness.patch29
-rw-r--r--dev-db/mysql-udf-base64/files/mysql-udf-base64.sql5
-rw-r--r--dev-db/mysql-udf-base64/metadata.xml5
-rw-r--r--dev-db/mysql-udf-base64/mysql-udf-base64-20010618.ebuild65
-rw-r--r--dev-db/mysql-udf-http/Manifest6
-rw-r--r--dev-db/mysql-udf-http/files/mysql-udf-http-stdlib.patch10
-rw-r--r--dev-db/mysql-udf-http/metadata.xml8
-rw-r--r--dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild59
-rw-r--r--dev-db/mysql-udf-infusion/Manifest5
-rw-r--r--dev-db/mysql-udf-infusion/metadata.xml8
-rw-r--r--dev-db/mysql-udf-infusion/mysql-udf-infusion-20110109.ebuild67
-rw-r--r--dev-db/mysql-udf-ipv6/Manifest6
-rw-r--r--dev-db/mysql-udf-ipv6/files/mysql-udf-ipv6-warnings.patch28
-rw-r--r--dev-db/mysql-udf-ipv6/metadata.xml8
-rw-r--r--dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild68
-rw-r--r--dev-db/mysql-workbench/Manifest15
-rw-r--r--dev-db/mysql-workbench/files/mysql-workbench-6.2.3-CMakeLists.patch43
-rw-r--r--dev-db/mysql-workbench/files/mysql-workbench-6.2.5-wbcopytables.patch12
-rw-r--r--dev-db/mysql-workbench/files/mysql-workbench-6.3.3-mysql_options4.patch40
-rw-r--r--dev-db/mysql-workbench/files/mysql-workbench-6.3.4-cxx11.patch39
-rw-r--r--dev-db/mysql-workbench/files/mysql-workbench-6.3.4-gtk.patch38
-rw-r--r--dev-db/mysql-workbench/files/mysql-workbench-6.3.9-mariadb-json.patch55
-rw-r--r--dev-db/mysql-workbench/metadata.xml10
-rw-r--r--dev-db/mysql-workbench/mysql-workbench-6.3.4-r1.ebuild107
-rw-r--r--dev-db/mysql-workbench/mysql-workbench-6.3.4-r2.ebuild106
-rw-r--r--dev-db/mysql-workbench/mysql-workbench-6.3.9.ebuild103
-rw-r--r--dev-db/mysql/Manifest19
-rw-r--r--dev-db/mysql/files/my.cnf-5.1144
-rw-r--r--dev-db/mysql/files/my.cnf-5.5147
-rw-r--r--dev-db/mysql/files/my.cnf-5.6139
-rw-r--r--dev-db/mysql/metadata.xml30
-rw-r--r--dev-db/mysql/mysql-5.5.57.ebuild133
-rw-r--r--dev-db/mysql/mysql-5.6.35.ebuild163
-rw-r--r--dev-db/mysql/mysql-5.6.36.ebuild177
-rw-r--r--dev-db/mysql/mysql-5.6.37.ebuild183
-rw-r--r--dev-db/mysqltuner/Manifest9
-rw-r--r--dev-db/mysqltuner/metadata.xml9
-rw-r--r--dev-db/mysqltuner/mysqltuner-1.2.0.ebuild26
-rw-r--r--dev-db/mysqltuner/mysqltuner-1.6.0.ebuild30
-rw-r--r--dev-db/mysqltuner/mysqltuner-1.6.18.ebuild31
-rw-r--r--dev-db/mytop/Manifest12
-rw-r--r--dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch14
-rw-r--r--dev-db/mytop/files/mytop-1.6-global-status.patch103
-rw-r--r--dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch72
-rw-r--r--dev-db/mytop/files/mytop-1.9.1-global-status.patch94
-rw-r--r--dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch73
-rw-r--r--dev-db/mytop/metadata.xml8
-rw-r--r--dev-db/mytop/mytop-1.6-r4.ebuild36
-rw-r--r--dev-db/mytop/mytop-1.9.1.ebuild35
-rw-r--r--dev-db/ocp/Manifest4
-rw-r--r--dev-db/ocp/metadata.xml16
-rw-r--r--dev-db/ocp/ocp-0.2.ebuild41
-rw-r--r--dev-db/ocp/ocp-9999.ebuild34
-rw-r--r--dev-db/odbtp/Manifest6
-rw-r--r--dev-db/odbtp/files/odbtp-1.1.4-amd64.patch11
-rw-r--r--dev-db/odbtp/metadata.xml8
-rw-r--r--dev-db/odbtp/odbtp-1.1.4.ebuild38
-rw-r--r--dev-db/opendbx/Manifest9
-rw-r--r--dev-db/opendbx/metadata.xml8
-rw-r--r--dev-db/opendbx/opendbx-1.4.5-r1.ebuild64
-rw-r--r--dev-db/opendbx/opendbx-1.4.6-r1.ebuild64
-rw-r--r--dev-db/opendbx/opendbx-1.5.0-r1.ebuild69
-rw-r--r--dev-db/oracle-instantclient-basic/Manifest27
-rw-r--r--dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch57
-rw-r--r--dev-db/oracle-instantclient-basic/files/oracle-instantclient-basic-10.2.0.3-makefile.patch11
-rw-r--r--dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample93
-rw-r--r--dev-db/oracle-instantclient-basic/metadata.xml8
-rw-r--r--dev-db/oracle-instantclient-basic/oracle-instantclient-basic-10.2.0.3-r1.ebuild116
-rw-r--r--dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.2.ebuild114
-rw-r--r--dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild197
-rw-r--r--dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild199
-rw-r--r--dev-db/oracle-instantclient-basic/oracle-instantclient-basic-12.ebuild16
-rw-r--r--dev-db/oracle-instantclient-jdbc/Manifest16
-rw-r--r--dev-db/oracle-instantclient-jdbc/metadata.xml8
-rw-r--r--dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-10.2.0.3.ebuild56
-rw-r--r--dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.2.ebuild53
-rw-r--r--dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.3.ebuild109
-rw-r--r--dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.4.ebuild92
-rw-r--r--dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-12.ebuild19
-rw-r--r--dev-db/oracle-instantclient-odbc/Manifest13
-rw-r--r--dev-db/oracle-instantclient-odbc/metadata.xml8
-rw-r--r--dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.2-r1.ebuild67
-rw-r--r--dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.3.ebuild116
-rw-r--r--dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.4.ebuild96
-rw-r--r--dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-12.ebuild19
-rw-r--r--dev-db/oracle-instantclient-sqlplus/Manifest17
-rw-r--r--dev-db/oracle-instantclient-sqlplus/metadata.xml8
-rw-r--r--dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-10.2.0.3.ebuild68
-rw-r--r--dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.2.ebuild67
-rw-r--r--dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3-r1.ebuild71
-rw-r--r--dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3.ebuild69
-rw-r--r--dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.4.ebuild71
-rw-r--r--dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-12.ebuild19
-rw-r--r--dev-db/oracle-instantclient/Manifest31
-rw-r--r--dev-db/oracle-instantclient/files/12.1.0.2-makefile.patch57
-rw-r--r--dev-db/oracle-instantclient/files/tnsnames.ora.sample93
-rw-r--r--dev-db/oracle-instantclient/metadata.xml24
-rw-r--r--dev-db/oracle-instantclient/oracle-instantclient-12.1.0.2.ebuild303
-rw-r--r--dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1-r1.ebuild304
-rw-r--r--dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1.ebuild303
-rw-r--r--dev-db/percona-server/Manifest8
-rw-r--r--dev-db/percona-server/files/my.cnf-5.5148
-rw-r--r--dev-db/percona-server/files/my.cnf-5.6140
-rw-r--r--dev-db/percona-server/metadata.xml24
-rw-r--r--dev-db/percona-server/percona-server-5.6.37.82.2.ebuild219
-rw-r--r--dev-db/percona-toolkit/Manifest15
-rw-r--r--dev-db/percona-toolkit/files/percona-toolkit-2.2.17-fix-package-name.patch35
-rw-r--r--dev-db/percona-toolkit/files/percona-toolkit-2.2.19-fix-package-name.patch13
-rw-r--r--dev-db/percona-toolkit/files/percona-toolkit-2.2.20-fix-package-name.patch13
-rw-r--r--dev-db/percona-toolkit/files/percona-toolkit-2.2.7-no-versioncheck.patch216
-rw-r--r--dev-db/percona-toolkit/metadata.xml23
-rw-r--r--dev-db/percona-toolkit/percona-toolkit-2.2.11.ebuild47
-rw-r--r--dev-db/percona-toolkit/percona-toolkit-2.2.17.ebuild44
-rw-r--r--dev-db/percona-toolkit/percona-toolkit-2.2.19.ebuild44
-rw-r--r--dev-db/percona-toolkit/percona-toolkit-2.2.20.ebuild44
-rw-r--r--dev-db/percona-xtrabackup/Manifest8
-rw-r--r--dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-fix-gcc6-isystem.patch112
-rw-r--r--dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-remove-boost-version-check.patch19
-rw-r--r--dev-db/percona-xtrabackup/metadata.xml19
-rw-r--r--dev-db/percona-xtrabackup/percona-xtrabackup-2.4.7.ebuild75
-rw-r--r--dev-db/percona-xtrabackup/percona-xtrabackup-2.4.8.ebuild82
-rw-r--r--dev-db/pg_activity/Manifest5
-rw-r--r--dev-db/pg_activity/metadata.xml11
-rw-r--r--dev-db/pg_activity/pg_activity-1.2.0.ebuild24
-rw-r--r--dev-db/pg_top/Manifest9
-rw-r--r--dev-db/pg_top/files/pg_top-3.6.2.patch29
-rw-r--r--dev-db/pg_top/files/pg_top-3.7.0.patch29
-rw-r--r--dev-db/pg_top/metadata.xml12
-rw-r--r--dev-db/pg_top/pg_top-3.6.2-r1.ebuild30
-rw-r--r--dev-db/pg_top/pg_top-3.7.0.ebuild30
-rw-r--r--dev-db/pgadmin3/Manifest11
-rw-r--r--dev-db/pgadmin3/files/pgadmin3-desktop-r1.patch15
-rw-r--r--dev-db/pgadmin3/files/pgadmin3-desktop.patch16
-rw-r--r--dev-db/pgadmin3/files/pgadmin3-gcc6-null-pointer.patch11
-rw-r--r--dev-db/pgadmin3/metadata.xml11
-rw-r--r--dev-db/pgadmin3/pgadmin3-1.22.1-r1.ebuild59
-rw-r--r--dev-db/pgadmin3/pgadmin3-1.22.1-r2.ebuild45
-rw-r--r--dev-db/pgadmin3/pgadmin3-1.22.2.ebuild45
-rw-r--r--dev-db/pgadmin4/Manifest5
-rw-r--r--dev-db/pgadmin4/metadata.xml8
-rw-r--r--dev-db/pgadmin4/pgadmin4-1.6.ebuild121
-rw-r--r--dev-db/pgadmin4/pgadmin4-2.0.ebuild121
-rw-r--r--dev-db/pgagent/Manifest14
-rw-r--r--dev-db/pgagent/files/add-log-timestamps.patch535
-rw-r--r--dev-db/pgagent/files/fix-dbconn-getlasterror-crash.patch32
-rw-r--r--dev-db/pgagent/files/fix-job-success-test.patch30
-rw-r--r--dev-db/pgagent/files/pgagent.confd22
-rw-r--r--dev-db/pgagent/files/pgagent.initd24
-rw-r--r--dev-db/pgagent/files/pgagent.initd-r131
-rw-r--r--dev-db/pgagent/files/postgres-10-build-fix.patch52
-rw-r--r--dev-db/pgagent/files/save-stderr-jobstep-output.patch79
-rw-r--r--dev-db/pgagent/metadata.xml8
-rw-r--r--dev-db/pgagent/pgagent-3.4.0-r1.ebuild53
-rw-r--r--dev-db/pgagent/pgagent-3.4.0-r3.ebuild77
-rw-r--r--dev-db/pgbadger/Manifest5
-rw-r--r--dev-db/pgbadger/metadata.xml12
-rw-r--r--dev-db/pgbadger/pgbadger-9.1-r1.ebuild21
-rw-r--r--dev-db/pgbouncer/Manifest9
-rw-r--r--dev-db/pgbouncer/files/logrotate7
-rw-r--r--dev-db/pgbouncer/files/pgbouncer-dirs.patch26
-rw-r--r--dev-db/pgbouncer/files/pgbouncer.confd12
-rw-r--r--dev-db/pgbouncer/files/pgbouncer.initd88
-rw-r--r--dev-db/pgbouncer/metadata.xml25
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.7.2.ebuild82
-rw-r--r--dev-db/pgmemcache/Manifest9
-rw-r--r--dev-db/pgmemcache/metadata.xml19
-rw-r--r--dev-db/pgmemcache/pgmemcache-2.1.2.ebuild19
-rw-r--r--dev-db/pgmemcache/pgmemcache-2.2.0.ebuild23
-rw-r--r--dev-db/pgmemcache/pgmemcache-2.3.0.ebuild23
-rw-r--r--dev-db/pgpool2/Manifest23
-rw-r--r--dev-db/pgpool2/files/pgpool2-3.5.0-path-fix.patch184
-rw-r--r--dev-db/pgpool2/files/pgpool2.confd17
-rw-r--r--dev-db/pgpool2/files/pgpool2.initd82
-rw-r--r--dev-db/pgpool2/files/pgpool_run_paths-3.6.4.patch255
-rw-r--r--dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch268
-rw-r--r--dev-db/pgpool2/files/pgpool_run_paths-9999.patch274
-rw-r--r--dev-db/pgpool2/files/pgpool_run_paths.patch180
-rw-r--r--dev-db/pgpool2/metadata.xml11
-rw-r--r--dev-db/pgpool2/pgpool2-3.5.2.ebuild101
-rw-r--r--dev-db/pgpool2/pgpool2-3.5.5.ebuild101
-rw-r--r--dev-db/pgpool2/pgpool2-3.6.1.ebuild99
-rw-r--r--dev-db/pgpool2/pgpool2-3.6.4.ebuild98
-rw-r--r--dev-db/pgpool2/pgpool2-3.6.5.ebuild97
-rw-r--r--dev-db/pgpool2/pgpool2-3.6.6.ebuild97
-rw-r--r--dev-db/pgpool2/pgpool2-9999.ebuild96
-rw-r--r--dev-db/pgrouting/Manifest8
-rw-r--r--dev-db/pgrouting/files/no-contrib-when-use-extension.patch76
-rw-r--r--dev-db/pgrouting/metadata.xml15
-rw-r--r--dev-db/pgrouting/pgrouting-2.0.0.ebuild100
-rw-r--r--dev-db/pgrouting/pgrouting-2.5.0.ebuild95
-rw-r--r--dev-db/pgtap/Manifest8
-rw-r--r--dev-db/pgtap/files/pgtap-pg_config_override.patch25
-rw-r--r--dev-db/pgtap/metadata.xml16
-rw-r--r--dev-db/pgtap/pgtap-0.93.0.ebuild52
-rw-r--r--dev-db/pgtap/pgtap-0.97.0.ebuild26
-rw-r--r--dev-db/pgxnclient/Manifest7
-rw-r--r--dev-db/pgxnclient/metadata.xml15
-rw-r--r--dev-db/pgxnclient/pgxnclient-1.2-r1.ebuild29
-rw-r--r--dev-db/pgxnclient/pgxnclient-1.2.1.ebuild29
-rw-r--r--dev-db/phpmyadmin/Manifest12
-rw-r--r--dev-db/phpmyadmin/files/postinstall-en-3.1.txt36
-rw-r--r--dev-db/phpmyadmin/metadata.xml23
-rw-r--r--dev-db/phpmyadmin/phpmyadmin-4.0.10.20.ebuild61
-rw-r--r--dev-db/phpmyadmin/phpmyadmin-4.7.0.ebuild61
-rw-r--r--dev-db/phpmyadmin/phpmyadmin-4.7.1.ebuild61
-rw-r--r--dev-db/phpmyadmin/phpmyadmin-4.7.2.ebuild61
-rw-r--r--dev-db/phppgadmin/Manifest7
-rw-r--r--dev-db/phppgadmin/files/postinstall-en.txt4
-rw-r--r--dev-db/phppgadmin/metadata.xml15
-rw-r--r--dev-db/phppgadmin/phppgadmin-5.1.ebuild39
-rw-r--r--dev-db/phppgadmin/phppgadmin-9999.ebuild44
-rw-r--r--dev-db/postgis/Manifest15
-rw-r--r--dev-db/postgis/files/postgis-2.0-arflags.patch18
-rw-r--r--dev-db/postgis/files/postgis-2.1-ldflags.patch26
-rw-r--r--dev-db/postgis/files/postgis-2.1.4-pkgconfig-json.patch122
-rw-r--r--dev-db/postgis/files/postgis-2.2.0-arflags.patch18
-rw-r--r--dev-db/postgis/files/postgis_dbs49
-rw-r--r--dev-db/postgis/metadata.xml15
-rw-r--r--dev-db/postgis/postgis-2.1.8-r1.ebuild281
-rw-r--r--dev-db/postgis/postgis-2.3.3.ebuild116
-rw-r--r--dev-db/postgis/postgis-2.4.0.ebuild116
-rw-r--r--dev-db/postgis/postgis-9999.ebuild114
-rw-r--r--dev-db/postgresql/Manifest66
-rw-r--r--dev-db/postgresql/files/pg_ctl-exit-status.patch12
-rw-r--r--dev-db/postgresql/files/postgresql-10beta2-no-server.patch146
-rw-r--r--dev-db/postgresql/files/postgresql-9.1-no-server.patch141
-rw-r--r--dev-db/postgresql/files/postgresql-9.1-tz-dir-overflow.patch29
-rw-r--r--dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch16
-rw-r--r--dev-db/postgresql/files/postgresql-9.2-no-server.patch143
-rw-r--r--dev-db/postgresql/files/postgresql-9.3-no-server.patch148
-rw-r--r--dev-db/postgresql/files/postgresql-9.4.10-no-server.patch151
-rw-r--r--dev-db/postgresql/files/postgresql-9.5-no-server.patch152
-rw-r--r--dev-db/postgresql/files/postgresql-9.5.5-no-server.patch151
-rw-r--r--dev-db/postgresql/files/postgresql-9.6-no-server.patch110
-rw-r--r--dev-db/postgresql/files/postgresql-9.6.1-no-server.patch130
-rw-r--r--dev-db/postgresql/files/postgresql-9.6.3-no-server.patch145
-rw-r--r--dev-db/postgresql/files/postgresql-check-db-dir35
-rw-r--r--dev-db/postgresql/files/postgresql.confd58
-rw-r--r--dev-db/postgresql/files/postgresql.confd-9.265
-rw-r--r--dev-db/postgresql/files/postgresql.confd-9.365
-rw-r--r--dev-db/postgresql/files/postgresql.init137
-rwxr-xr-xdev-db/postgresql/files/postgresql.init-9.2152
-rw-r--r--dev-db/postgresql/files/postgresql.init-9.3142
-rwxr-xr-xdev-db/postgresql/files/postgresql.init-9.3-r1157
-rw-r--r--dev-db/postgresql/files/postgresql.service55
-rw-r--r--dev-db/postgresql/files/postgresql.service-9.251
-rw-r--r--dev-db/postgresql/files/postgresql.service-9.656
-rw-r--r--dev-db/postgresql/files/postgresql.service-9.6-r152
-rw-r--r--dev-db/postgresql/files/postgresql.tmpfiles1
-rw-r--r--dev-db/postgresql/metadata.xml21
-rw-r--r--dev-db/postgresql/postgresql-10.0-r1.ebuild464
-rw-r--r--dev-db/postgresql/postgresql-10.0.ebuild462
-rw-r--r--dev-db/postgresql/postgresql-9.2.19.ebuild394
-rw-r--r--dev-db/postgresql/postgresql-9.2.22.ebuild445
-rw-r--r--dev-db/postgresql/postgresql-9.2.23-r1.ebuild449
-rw-r--r--dev-db/postgresql/postgresql-9.2.23.ebuild445
-rw-r--r--dev-db/postgresql/postgresql-9.3.15.ebuild399
-rw-r--r--dev-db/postgresql/postgresql-9.3.18.ebuild450
-rw-r--r--dev-db/postgresql/postgresql-9.3.19-r1.ebuild454
-rw-r--r--dev-db/postgresql/postgresql-9.3.19.ebuild450
-rw-r--r--dev-db/postgresql/postgresql-9.4.10.ebuild431
-rw-r--r--dev-db/postgresql/postgresql-9.4.13.ebuild482
-rw-r--r--dev-db/postgresql/postgresql-9.4.14-r1.ebuild486
-rw-r--r--dev-db/postgresql/postgresql-9.4.14.ebuild482
-rw-r--r--dev-db/postgresql/postgresql-9.5.5.ebuild442
-rw-r--r--dev-db/postgresql/postgresql-9.5.8.ebuild488
-rw-r--r--dev-db/postgresql/postgresql-9.5.9-r1.ebuild492
-rw-r--r--dev-db/postgresql/postgresql-9.5.9.ebuild488
-rw-r--r--dev-db/postgresql/postgresql-9.6.4.ebuild495
-rw-r--r--dev-db/postgresql/postgresql-9.6.5-r1.ebuild497
-rw-r--r--dev-db/postgresql/postgresql-9.6.5.ebuild495
-rw-r--r--dev-db/postgresql/postgresql-9999.ebuild446
-rw-r--r--dev-db/psqlodbc/Manifest9
-rw-r--r--dev-db/psqlodbc/metadata.xml11
-rw-r--r--dev-db/psqlodbc/psqlodbc-09.06.0200.ebuild33
-rw-r--r--dev-db/psqlodbc/psqlodbc-09.06.0300.ebuild32
-rw-r--r--dev-db/psqlodbc/psqlodbc-09.06.0310.ebuild32
-rw-r--r--dev-db/qdbm/Manifest9
-rw-r--r--dev-db/qdbm/files/qdbm-configure.patch108
-rw-r--r--dev-db/qdbm/files/qdbm-perl.patch34
-rw-r--r--dev-db/qdbm/files/qdbm-ruby19.patch373
-rw-r--r--dev-db/qdbm/files/qdbm-runpath.patch30
-rw-r--r--dev-db/qdbm/metadata.xml7
-rw-r--r--dev-db/qdbm/qdbm-1.8.78-r1.ebuild178
-rw-r--r--dev-db/redis/Manifest34
-rw-r--r--dev-db/redis/files/configure.ac-2.258
-rw-r--r--dev-db/redis/files/configure.ac-3.266
-rw-r--r--dev-db/redis/files/redis-2.8.17-config.patch46
-rw-r--r--dev-db/redis/files/redis-2.8.3-shared.patch36
-rw-r--r--dev-db/redis/files/redis-3.0.0-sharedlua.patch44
-rw-r--r--dev-db/redis/files/redis-3.2.0-config.patch37
-rw-r--r--dev-db/redis/files/redis-3.2.0-sharedlua.patch36
-rw-r--r--dev-db/redis/files/redis-3.2.3-config.patch40
-rw-r--r--dev-db/redis/files/redis-3.2.3-sharedlua.patch60
-rw-r--r--dev-db/redis/files/redis-3.2.5-shared.patch30
-rw-r--r--dev-db/redis/files/redis-4.0.1-shared.patch32
-rw-r--r--dev-db/redis/files/redis-4.0.1-sharedlua.patch60
-rw-r--r--dev-db/redis/files/redis.confd20
-rw-r--r--dev-db/redis/files/redis.confd-r120
-rw-r--r--dev-db/redis/files/redis.initd-431
-rw-r--r--dev-db/redis/files/redis.initd-523
-rw-r--r--dev-db/redis/files/redis.service-214
-rw-r--r--dev-db/redis/files/redis.tmpfiles2
-rw-r--r--dev-db/redis/metadata.xml19
-rw-r--r--dev-db/redis/redis-3.0.7-r1.ebuild115
-rw-r--r--dev-db/redis/redis-3.0.7.ebuild115
-rw-r--r--dev-db/redis/redis-3.2.5.ebuild123
-rw-r--r--dev-db/redis/redis-3.2.8-r2.ebuild123
-rw-r--r--dev-db/redis/redis-3.2.8-r4.ebuild131
-rw-r--r--dev-db/redis/redis-4.0.1-r1.ebuild128
-rw-r--r--dev-db/redis/redis-4.0.1.ebuild122
-rw-r--r--dev-db/redis/redis-4.0.2.ebuild130
-rw-r--r--dev-db/repmgr/Manifest7
-rw-r--r--dev-db/repmgr/metadata.xml10
-rw-r--r--dev-db/repmgr/repmgr-3.0.1.ebuild40
-rw-r--r--dev-db/repmgr/repmgr-3.3.2.ebuild40
-rw-r--r--dev-db/rethinkdb/Manifest8
-rw-r--r--dev-db/rethinkdb/files/rethinkdb.confd12
-rw-r--r--dev-db/rethinkdb/files/rethinkdb.initd49
-rw-r--r--dev-db/rethinkdb/files/rethinkdb.service13
-rw-r--r--dev-db/rethinkdb/files/rethinkdb.tmpfilesd1
-rw-r--r--dev-db/rethinkdb/metadata.xml19
-rw-r--r--dev-db/rethinkdb/rethinkdb-2.3.5.ebuild134
-rw-r--r--dev-db/rqlite/Manifest30
-rw-r--r--dev-db/rqlite/metadata.xml10
-rw-r--r--dev-db/rqlite/rqlite-4.0.2.ebuild48
-rw-r--r--dev-db/rqlite/rqlite-4.1.0.ebuild48
-rw-r--r--dev-db/sadisplay/Manifest3
-rw-r--r--dev-db/sadisplay/metadata.xml21
-rw-r--r--dev-db/sadisplay/sadisplay-0.4.8.ebuild29
-rw-r--r--dev-db/slony1/Manifest18
-rw-r--r--dev-db/slony1/files/slony1-2.1.2-ldflags.patch17
-rw-r--r--dev-db/slony1/files/slony1.conf11
-rw-r--r--dev-db/slony1/files/slony1.init36
-rw-r--r--dev-db/slony1/metadata.xml8
-rw-r--r--dev-db/slony1/slony1-2.1.3.ebuild70
-rw-r--r--dev-db/slony1/slony1-2.1.4.ebuild72
-rw-r--r--dev-db/slony1/slony1-2.2.5-r1.ebuild62
-rw-r--r--dev-db/slony1/slony1-2.2.6.ebuild62
-rw-r--r--dev-db/soci/Manifest7
-rw-r--r--dev-db/soci/metadata.xml11
-rw-r--r--dev-db/soci/soci-3.2.2.ebuild46
-rw-r--r--dev-db/soci/soci-3.2.3.ebuild46
-rw-r--r--dev-db/spatialite-tools/Manifest5
-rw-r--r--dev-db/spatialite-tools/metadata.xml8
-rw-r--r--dev-db/spatialite-tools/spatialite-tools-4.3.0-r1.ebuild33
-rw-r--r--dev-db/spatialite/Manifest7
-rw-r--r--dev-db/spatialite/metadata.xml13
-rw-r--r--dev-db/spatialite/spatialite-4.3.0-r1.ebuild49
-rw-r--r--dev-db/spatialite/spatialite-4.3.0a.ebuild49
-rw-r--r--dev-db/sqlcipher/Manifest6
-rw-r--r--dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch11
-rw-r--r--dev-db/sqlcipher/metadata.xml11
-rw-r--r--dev-db/sqlcipher/sqlcipher-3.4.1.ebuild59
-rw-r--r--dev-db/sqlcl-bin/Manifest3
-rw-r--r--dev-db/sqlcl-bin/metadata.xml16
-rw-r--r--dev-db/sqlcl-bin/sqlcl-bin-17.2.0.184.1230.ebuild48
-rw-r--r--dev-db/sqldeveloper/Manifest13
-rw-r--r--dev-db/sqldeveloper/files/sqldeveloper9
-rw-r--r--dev-db/sqldeveloper/files/sqldeveloper-r110
-rw-r--r--dev-db/sqldeveloper/metadata.xml9
-rw-r--r--dev-db/sqldeveloper/sqldeveloper-4.0.2.15.21.ebuild88
-rw-r--r--dev-db/sqldeveloper/sqldeveloper-4.1.3.20.78-r1.ebuild97
-rw-r--r--dev-db/sqldeveloper/sqldeveloper-4.1.5.21.78.ebuild97
-rw-r--r--dev-db/sqldeveloper/sqldeveloper-4.2.0.17.089.1709.ebuild97
-rw-r--r--dev-db/sqlite/Manifest37
-rw-r--r--dev-db/sqlite/files/sqlite-3.16.0-full_tarball-build.patch147
-rw-r--r--dev-db/sqlite/files/sqlite-3.16.0-nonfull_tarball-build.patch14
-rw-r--r--dev-db/sqlite/files/sqlite-3.18.0-full_tarball-build.patch158
-rw-r--r--dev-db/sqlite/files/sqlite-3.20.0-full_tarball-build.patch158
-rw-r--r--dev-db/sqlite/files/sqlite-3.20.1-full_tarball-csv-unsigned_char.patch33
-rw-r--r--dev-db/sqlite/files/sqlite-3.20.1-full_tarball-tests-big-endian.patch95
-rw-r--r--dev-db/sqlite/metadata.xml19
-rw-r--r--dev-db/sqlite/sqlite-3.16.2.ebuild260
-rw-r--r--dev-db/sqlite/sqlite-3.17.0.ebuild260
-rw-r--r--dev-db/sqlite/sqlite-3.18.0.ebuild261
-rw-r--r--dev-db/sqlite/sqlite-3.19.2.ebuild265
-rw-r--r--dev-db/sqlite/sqlite-3.19.3.ebuild261
-rw-r--r--dev-db/sqlite/sqlite-3.20.0.ebuild261
-rw-r--r--dev-db/sqlite/sqlite-3.20.1-r1.ebuild275
-rw-r--r--dev-db/sqlitebrowser/Manifest7
-rw-r--r--dev-db/sqlitebrowser/files/sqlitebrowser-3.7.0-unbundle.patch18
-rw-r--r--dev-db/sqlitebrowser/files/sqlitebrowser-3.9.1-cmake.patch24
-rw-r--r--dev-db/sqlitebrowser/metadata.xml18
-rw-r--r--dev-db/sqlitebrowser/sqlitebrowser-3.9.1-r1.ebuild60
-rw-r--r--dev-db/sqliteman/Manifest8
-rw-r--r--dev-db/sqliteman/files/sqliteman-1.2.2-lpthread.patch19
-rw-r--r--dev-db/sqliteman/files/sqliteman-1.2.2-qscintilla-2.10.patch13
-rw-r--r--dev-db/sqliteman/metadata.xml11
-rw-r--r--dev-db/sqliteman/sqliteman-1.2.2-r2.ebuild32
-rw-r--r--dev-db/sqliteman/sqliteman-1.2.2-r3.ebuild34
-rw-r--r--dev-db/sqliteodbc/Manifest8
-rw-r--r--dev-db/sqliteodbc/files/sqliteodbc-0.93-respect_LDFLAGS.patch30
-rw-r--r--dev-db/sqliteodbc/metadata.xml5
-rw-r--r--dev-db/sqliteodbc/sqliteodbc-0.96.ebuild41
-rw-r--r--dev-db/sqliteodbc/sqliteodbc-0.99.ebuild41
-rw-r--r--dev-db/sqlitestudio/Manifest9
-rw-r--r--dev-db/sqlitestudio/files/sqlitestudio-3.0.6-portable.patch11
-rw-r--r--dev-db/sqlitestudio/files/sqlitestudio-3.0.6-qt5_5-QDataStream.patch30
-rw-r--r--dev-db/sqlitestudio/files/sqlitestudio-3.0.7-paths.patch22
-rw-r--r--dev-db/sqlitestudio/metadata.xml15
-rw-r--r--dev-db/sqlitestudio/sqlitestudio-3.0.7.ebuild130
-rw-r--r--dev-db/sqlitestudio/sqlitestudio-3.1.1.ebuild139
-rw-r--r--dev-db/textsearch_ja/Manifest5
-rw-r--r--dev-db/textsearch_ja/metadata.xml8
-rw-r--r--dev-db/textsearch_ja/textsearch_ja-9.0.0.ebuild25
-rw-r--r--dev-db/tinycdb/Manifest8
-rw-r--r--dev-db/tinycdb/files/tinycdb-gentoo.patch28
-rw-r--r--dev-db/tinycdb/files/tinycdb-uclibc.patch15
-rw-r--r--dev-db/tinycdb/files/tinycdb-umask.patch11
-rw-r--r--dev-db/tinycdb/metadata.xml7
-rw-r--r--dev-db/tinycdb/tinycdb-0.77-r2.ebuild52
-rw-r--r--dev-db/tokumx/Manifest12
-rw-r--r--dev-db/tokumx/files/1.5.0-Werror.diff45
-rw-r--r--dev-db/tokumx/files/1.5.0-boost-57.diff11
-rw-r--r--dev-db/tokumx/files/tokumx-2.0.2-boost-57.patch22
-rw-r--r--dev-db/tokumx/files/tokumx-2.0.2-no-werror.patch88
-rw-r--r--dev-db/tokumx/files/tokumx-disable-bundled-libs.patch11
-rw-r--r--dev-db/tokumx/metadata.xml16
-rw-r--r--dev-db/tokumx/tokumx-1.5.0-r2.ebuild77
-rw-r--r--dev-db/tokumx/tokumx-2.0.2.ebuild77
-rw-r--r--dev-db/tokyocabinet/Manifest7
-rw-r--r--dev-db/tokyocabinet/files/fix_rpath.patch56
-rw-r--r--dev-db/tokyocabinet/metadata.xml8
-rw-r--r--dev-db/tokyocabinet/tokyocabinet-1.4.48-r1.ebuild60
-rw-r--r--dev-db/tokyocabinet/tokyocabinet-1.4.48.ebuild55
-rw-r--r--dev-db/tora/Manifest6
-rw-r--r--dev-db/tora/metadata.xml25
-rw-r--r--dev-db/tora/tora-3.0.0_pre20140929-r2.ebuild84
-rw-r--r--dev-db/tora/tora-9999.ebuild91
-rw-r--r--dev-db/unixODBC/Manifest8
-rw-r--r--dev-db/unixODBC/metadata.xml8
-rw-r--r--dev-db/unixODBC/unixODBC-2.3.2-r1.ebuild51
-rw-r--r--dev-db/unixODBC/unixODBC-2.3.4-r1.ebuild57
-rw-r--r--dev-db/unixODBC/unixODBC-2.3.4.ebuild54
-rw-r--r--dev-db/vbisam/Manifest5
-rw-r--r--dev-db/vbisam/metadata.xml8
-rw-r--r--dev-db/vbisam/vbisam-2.0.ebuild20
-rw-r--r--dev-db/vsqlite++/Manifest5
-rw-r--r--dev-db/vsqlite++/metadata.xml10
-rw-r--r--dev-db/vsqlite++/vsqlite++-0.3.13-r1.ebuild39
-rw-r--r--dev-db/wxsqlite3/Manifest6
-rw-r--r--dev-db/wxsqlite3/files/wxsqlite3-3.2.1.pc.in14
-rw-r--r--dev-db/wxsqlite3/metadata.xml11
-rw-r--r--dev-db/wxsqlite3/wxsqlite3-3.2.1-r1.ebuild55
-rw-r--r--dev-db/xbase/Manifest15
-rw-r--r--dev-db/xbase/files/xbase-2.0.0-ppc.patch20
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-fixconfig.patch12
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-gcc-version.patch16
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-gcc44.patch24
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-gcc47.patch21
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-gcc6.patch49
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-gcc7.patch34
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-lesserg.patch294
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-outofsource.patch52
-rw-r--r--dev-db/xbase/files/xbase-3.1.2-xbnode.patch9
-rw-r--r--dev-db/xbase/metadata.xml8
-rw-r--r--dev-db/xbase/xbase-3.1.2.ebuild61
-rw-r--r--dev-db/xbsql/Manifest9
-rw-r--r--dev-db/xbsql/files/xbsql-0.11-autotools.patch18
-rw-r--r--dev-db/xbsql/files/xbsql-0.11-bfr-overflow.patch79
-rw-r--r--dev-db/xbsql/files/xbsql-0.11-ncurses64.patch19
-rw-r--r--dev-db/xbsql/files/xbsql-0.11-xbase64.patch66
-rw-r--r--dev-db/xbsql/metadata.xml5
-rw-r--r--dev-db/xbsql/xbsql-0.11-r2.ebuild40
-rw-r--r--dev-db/xtrabackup-bin/Manifest9
-rw-r--r--dev-db/xtrabackup-bin/metadata.xml8
-rw-r--r--dev-db/xtrabackup-bin/xtrabackup-bin-2.4.4.ebuild61
-rw-r--r--dev-db/xtrabackup-bin/xtrabackup-bin-2.4.6.ebuild61
890 files changed, 57174 insertions, 0 deletions
diff --git a/dev-db/4store/4store-1.1.5-r1.ebuild b/dev-db/4store/4store-1.1.5-r1.ebuild
new file mode 100644
index 000000000000..578726dd607c
--- /dev/null
+++ b/dev-db/4store/4store-1.1.5-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils user
+
+DESCRIPTION="4store is an efficient, scalable and stable RDF database"
+HOMEPAGE="http://4store.org/"
+# http://4store.org/download/4store-v1.0.4.tar.gz
+MY_P="${PN}-v${PV}"
+SRC_URI="http://4store.org/download/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# < http://4store.org/trac/wiki/Dependencies
+DEPEND="media-libs/raptor
+ >=dev-libs/rasqal-0.9.18
+ dev-libs/glib
+ dev-libs/libxml2
+ dev-libs/libpcre
+ sys-libs/readline
+ sys-libs/ncurses
+ dev-libs/expat
+ sys-libs/zlib"
+
+RDEPEND="${DEPEND}"
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup fourstore
+ enewuser fourstore -1 -1 /var/lib/4store fourstore
+}
+
+src_install() {
+
+ # patch the Makefiles to use /usr/ instead of /usr/local/
+ find . -name "Makefile" -execdir sed -e "s#/usr/local/#/usr/#" -i {} \;
+
+ MAKEOPTS="-j1" emake DESTDIR="${D}" install || die "emake install failed"
+
+ dodir /var/log/4store
+ fowners fourstore:fourstore \
+ /var/lib/4store \
+ /var/log/4store
+
+ # fix 1777
+ fperms 755 /var/lib/4store
+
+ # fix 755
+ fperms 644 \
+ /usr/share/man/man1/4s-query.1 \
+ /usr/share/man/man1/4s-backend-setup.1 \
+ /usr/share/man/man1/4s-import.1 \
+ /usr/share/man/man1/4s-cluster-info.1 \
+ /usr/share/man/man1/4s-cluster-start.1 \
+ /usr/share/man/man1/4s-cluster-create.1 \
+ /usr/share/man/man1/4s-cluster-stop.1 \
+ /usr/share/man/man1/4s-cluster-destroy.1
+}
diff --git a/dev-db/4store/Manifest b/dev-db/4store/Manifest
new file mode 100644
index 000000000000..d9e55e526500
--- /dev/null
+++ b/dev-db/4store/Manifest
@@ -0,0 +1,5 @@
+DIST 4store-v1.1.5.tar.gz 5610204 SHA256 2bdd6fb804288802187c5779e365eea2b3ddebce419b3da0609be38edc9e8c5b SHA512 42a7431c7853e1b06a76ed15c205eebd7b334516c14e7dcfeddb2f9249f30f879f8256a1b454be71f79e71205b3efa95efab726fd88b4d455bb0fc4a8092bcf4 WHIRLPOOL 55fd3f725386847c598c80945a01234fb7f3c8ced56f1004f3679d99e7fdf12cb8f92c4f865891491ac0dc66d5194379cbe2022f25bef9134bc041c5f5dd2d92
+EBUILD 4store-1.1.5-r1.ebuild 1496 SHA256 ab826b92cd849ec6b2d36b17daa40d48229ca27db6b4d1c6386d59829092c3b8 SHA512 3f1756190b3adee33e45caadc9e2a7dba16a90ac4f3d3c86efcba9e871f549909ed5b969186f695c2b19d492f74e0bdf150bb6a8ef221ff5107f3e977c450f4d WHIRLPOOL 69abf190325eb26dcacac035dd419bcc20a37a83751afcdc44df0aeb6f099060ea6af879cea1ac71f7edbc13a1b7130abc094935fd54af86715499e7493ab6f1
+MISC ChangeLog 2361 SHA256 4c8be507313be61b0ea457ab0de34f0aa9bb62f6b92235be5ac5c3fb2b6104ba SHA512 b17af8143927dacb5a4a6c396405d42717fb9a435b2d9182881bbeb4319cafdf78853326890f59415cf47bd73fb6c1012ae2410d0bacb606baf0a0f85820387f WHIRLPOOL 7bb3caa310967b7ad2a7b6f4ef63672d611aadaf10ce97b6d85f756ae7c2b78dea5ab76a0cbd005a4b1c525eadd0442c27a7fd383cf174acb2eb4c7c3ef877b3
+MISC ChangeLog-2015 376 SHA256 cd62ea148db180e41006d8acb00fa4b9a25b4c9b980683d894824ee0c7753fad SHA512 67ce3c25528a63f368689023c6b16af12a80d8763917b940f8e8fac5a253694782a85341a7a28fbb96b93d7173c822df67376c7213227c199569c7db9626e55b WHIRLPOOL 9527fde470d3e4e4c42b9faef78c161149af9425c8a366186c101737e75080e2aa7f3cc77f5cba79d5feb6db8b20a4eff0f4245144b6de7f05ccb18952e7fa79
+MISC metadata.xml 247 SHA256 0deec0776f26fb762fdf7711f4589b14f52a2456436ef557eec62a2cf2fb2bb7 SHA512 29cf52c16b0cce69899d9c2da8acd9144b7d760442aa323b854dceadb42459e009545193b1df7911ac2241b59f4819b4a6bb1d206d6f57953f770031433bb6b7 WHIRLPOOL a135fa622e99d3dcdb432bc6b3c366076b3d86b4bfd9a76c852d781b8e9152541c7e7a2c7c6d6a3c4d2200dce792847a08166aaf7c17c22b6299dfe868234dec
diff --git a/dev-db/4store/metadata.xml b/dev-db/4store/metadata.xml
new file mode 100644
index 000000000000..40aa45df2b01
--- /dev/null
+++ b/dev-db/4store/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/SchemaSync/Manifest b/dev-db/SchemaSync/Manifest
new file mode 100644
index 000000000000..814598cacb73
--- /dev/null
+++ b/dev-db/SchemaSync/Manifest
@@ -0,0 +1,7 @@
+DIST SchemaSync-0.9.2.tar.gz 12828 SHA256 3ee4e87e932c41e9fcbc534d662d6dc7be6ac29c2cd5ef3e6fd620fad6c2f3f5 SHA512 4f2522c05e3cf0957fe0d51cc48f3a45fd8eaeb341801bfdeb32bb7e959e8a250a84a162b80853f2010a99a932ef7d1b556579f7c77971f0e9a3e0fa87531599 WHIRLPOOL b532793719bca008a5036fc12f75feb9b136323f7d6d3a1253a4b4521a7699cad082d6fe208ec6fbe6b6c12d80e3e59aa6e77f96c26a56f1dde8d2a31ae610ea
+DIST SchemaSync-0.9.4.tar.gz 13824 SHA256 cc686225a23ca53d9182ddd1d08246e358e621b80ff5b426cba1ebf914bd8027 SHA512 0087f5f634d2374def5e1dd2dd8d6d57d3fca9322bba23aee461487053233dba30ce889a87747ce2c11bd9a7e08418d619e9fd8b910ea303987b57bac7609248 WHIRLPOOL ede7de3d69aa95f6d64e60e86d0df7753d808ff7841914895e95716b39731b164735ac7175ae962808af106e9170a2e349baba061f5d2b7009d10865722c7963
+EBUILD SchemaSync-0.9.2-r1.ebuild 568 SHA256 8d92e478a9b5d33e1e97bc728e30022d2d0f3e0012ace067d9d4a18a3b7d2812 SHA512 6c7501e38ab17d0bfe24f78338e525415aac6f81bce0423e6db1dc2787ef43f82f8788f61cdd6de6d9916348332ca9d9fc4743b1fa15f16903ef6cb63acd84c8 WHIRLPOOL 4462181fdac7687059a32a8907b08240e575779d7c62eda0c1e8abe88b2226e3920ad75318d2d78767d23597886467ac0639ccc26290b531a0a44426da927fb6
+EBUILD SchemaSync-0.9.4.ebuild 550 SHA256 7cad482f024b59c6bc141a4e717fed9dcfe56d70f6caf57f892a86b5752cb40e SHA512 620a7eecfdb121ef9d9076e7978921d07766e2fe3b54b02d2947fa6803be81c1dffcbcf73d9a8a66270320d538ec4194aead79af1d02f1c74d61cf1eb06c490b WHIRLPOOL 7d1806ab14089ff5427605e957a1fd072ce38b79aaf48eecaa936bbe89ba844cb7153d4d811d583cb534b65d83054f2a9ec987f94606c914a154e56f1845cce9
+MISC ChangeLog 2442 SHA256 78ca6351113ccae982d116ed80a12345867e4f52b1069534e1f55ae44de19ab9 SHA512 dbe96b3816530f984bc753a9ec8d558738a5cc6bf6ad858170a8f6763c9cc4769682f4a4e2e84a0912c34b5298c1b9b8938867f170c5433ebcb1257f75522f24 WHIRLPOOL 3d0ee34def22f2c26766c1d5e06d65a6c923fbc635464f90173615cbef54fd29ed351d29225390f58e263fbb8e2c6c420c5af7849326c966ef29cfadec71985d
+MISC ChangeLog-2015 587 SHA256 930f702bb338a93d3d3eaf5de4900eb373b36248cad5a5270b2a513dfbe6c495 SHA512 c6cb57199625ddb6da24095080b23a19eae7a53958d75489534668b3d706c08b3f44be14ba9aa7ba2395c4a0a3f6fe592f224a83f7000995dadfa975f050b9c1 WHIRLPOOL 79dd287362a5628da9d79455d9758c53d0d2a59e32a05e080f34760ee7d1bf535f526e763907726a4b21b1516c79330b37ac31bd1b417542dee0554e0dd8c32b
+MISC metadata.xml 384 SHA256 194d0feab551e0dd436a75e341d47b6e89ba63519d81b2dd038942cb1c715388 SHA512 8b370f82a807086da710e4af1e39a5e6e9b2cc06e89171c91d2516ad96fd5e5f8f96ff745943123368bf9773a0408f6563a5eee38ec36fab38e872ad08120960 WHIRLPOOL 4b6e4a2c0b8d0331d7cb1417f4eea5b703725dcb0518b563c0263a408977caafff72f3f2c7fdd01a5453a2dcef4e15978e1db8cb44d823c80715aec95299edf7
diff --git a/dev-db/SchemaSync/SchemaSync-0.9.2-r1.ebuild b/dev-db/SchemaSync/SchemaSync-0.9.2-r1.ebuild
new file mode 100644
index 000000000000..cd2e1b2955e8
--- /dev/null
+++ b/dev-db/SchemaSync/SchemaSync-0.9.2-r1.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="MySQL Schema Versioning and Migration Utility"
+HOMEPAGE="https://github.com/mmatuson/SchemaSync"
+# old download location is down
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-python/mysql-python[${PYTHON_USEDEP}]
+ dev-python/SchemaObject[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}"
diff --git a/dev-db/SchemaSync/SchemaSync-0.9.4.ebuild b/dev-db/SchemaSync/SchemaSync-0.9.4.ebuild
new file mode 100644
index 000000000000..f11cb9686919
--- /dev/null
+++ b/dev-db/SchemaSync/SchemaSync-0.9.4.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="MySQL Schema Versioning and Migration Utility"
+HOMEPAGE="https://github.com/mmatuson/SchemaSync"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-python/mysql-python[${PYTHON_USEDEP}]
+ dev-python/SchemaObject[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}"
diff --git a/dev-db/SchemaSync/metadata.xml b/dev-db/SchemaSync/metadata.xml
new file mode 100644
index 000000000000..5cddb3363d44
--- /dev/null
+++ b/dev-db/SchemaSync/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mmatuson/SchemaSync</remote-id>
+ <remote-id type="pypi">SchemaSync</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/aerospike-server-community/Manifest b/dev-db/aerospike-server-community/Manifest
new file mode 100644
index 000000000000..8556176ebac8
--- /dev/null
+++ b/dev-db/aerospike-server-community/Manifest
@@ -0,0 +1,13 @@
+AUX 3.5.8-use-system-libs.patch 1755 SHA256 7aca6ecbffb26a15e43af4f63fc96dcaf5c16d6eac2b9e4082ff6264ed12179d SHA512 9124fc14481bc1390a743d2365aa51723445e90db428607aa76d7d59e2c73bc4236da4d1a57c765d4484895147f06254bb269f80b0ff9f7029fcb2f782a418a4 WHIRLPOOL 32bed32f5cb3b75cfe94b8a3e9acff189e71f8f6ac4802dd87fe8bb3834a0be35758a77b25e02e7b1173628af3cc869563cb32fd8c1ba789855b0ce422a34582
+AUX aerospike.conf 1265 SHA256 546cc602656e4889eb9ad201874d54356fdd3058e821a70bb803637a1c1575e2 SHA512 5d2b2a368bb31e8230d2f88073befbf5f1aa33aecc628b669e5714cfde71e83d53143b28c0ee95b52f13e84027283413927abd97470a97e36946cc05605b15ed WHIRLPOOL c67e134dde02d2c04e2fa9f118a84b448d9a8d2ff01d952283b7f14fad590cc0d10c23d0f6432849b37f313e2b52e6d4a9d6bbcb2824bba4c81f0c0aa0a73f9c
+AUX aerospike.init 1194 SHA256 a4cff03bb6108c083c39e8262d2163619c4059b93f07bf2b0f7b9c8013fa337d SHA512 c8d5db18225aa031d152337981430bef413fc30592d162776fab6c1d1c8ea2876233feba7c73f103fc35091255ef7f31da602c6dcb302d9dcac2ce9a67c97837 WHIRLPOOL 24dc13e15c324928d18f3b7d0de7fdc8c3e1be52bb789f4616385b86cc08f3f79f98e2c0d36585bb0508f1ff00d3e034b9193fa354610f4623aa9e8b7fa91553
+AUX aerospike.logrotate 196 SHA256 77682424acea6680a167d24adb6f35a4a79821bb5fad9e094c950a45f9ce2379 SHA512 2810df72e5a570be0d3118b0c3244fb13ae7bb98684219d681f02a1ec1499191e1f7e3455da818a8ca36d36a7d194cf85ee1985930bf6fe63b1723060af05cba WHIRLPOOL 5dba770825d8944135fcb48c56b4011359435e49dc0f7b3dd1d51300c43fe5b2a2582fce6251aff887ad1a78d54aa9bc9705c6a0be7ed180a3286fef20fa5a3e
+AUX aerospike_mesh.conf 1476 SHA256 27cd3b9304c5af4855ca1edea949b471e209d1402a27a15044b59f7329624572 SHA512 a7d5e52738a3153b649cc81d8a9b635b70fe21335802f5c2f348fe71f3b7087ea85aaf926c4ad3ce71514fa1b479f98bc27aadb95995a5bbb8808219bcbe28c4 WHIRLPOOL 27209abe9aae485e8a540dd6b4563d38c43d8e9a19f2c97e41ca7c995349b7c8f1abcef08e0a92f38431d4fe919838eb6442990201bd3506cc5126e37b92f2d1
+AUX aerospike_ssd.conf 1341 SHA256 11dbbffdea382e30d606c4564a577e0657f3ff87f37156f5169806d52acdb711 SHA512 0382842d4e7b20caaa4c39d999da0cd2b67c24bdd9fad6e5d2d393758b6f788decf0039ae9a262a4db7e89b358cbb9954efd082a15549d12e3e244b2c51675c9 WHIRLPOOL 2aa9230d6d1b477aad21b81f6760a915d15bbd51499512a618a1a0dd24342eb9ed0d46cbe0318885a6c446433bd009641adad5fa5e2fdf34e15138ffcabb1f84
+DIST aerospike-server-community-3.13.0.7-debian7.tgz 10658707 SHA256 29715ff1698f69f29daeca80f0f70125aa2e8e1b798a34e8aa1ba23338552c66 SHA512 1dfe2fc52c7870f6c4bfbe26cb718cad7725c1362886c4ed30fed04ac40a692eedab47f03ce70fd2a4bc52a9df92ec08683eec24a1fa62a5674530272c705409 WHIRLPOOL 3780f47eecab4081359c2c41f3ec2fe28045bf55de0fb0889f15e0327522ff7ecdf401a8973a58d65efe575caaad6216e43dc8de695de21fbd71113cb2178a29
+DIST aerospike-server-community-3.14.1.4-debian7.tgz 10451324 SHA256 a7189f7d802b5d805d5d6e432b58de86c4db97bde482be255e58e61ef688362c SHA512 737c8e2e64d4738d97f1abe4199c4fbc5c00f4c967da3cf6ebbe6e77e416d40ec4c431cf3aec1b9dd4d6388efc0268220b5717924c7083631582899a2d3b6402 WHIRLPOOL dd46cabb8c7b6a8b77085d702538c037cb446327be335cef1cacbfa542613341af84ea6acac6038eb2ce7aee822f31bb8dbe0afb8e223212bf77237c28040e1e
+EBUILD aerospike-server-community-3.13.0.7.ebuild 1634 SHA256 954a8f13463c378210c9e0f72b283db37de9826d66f7cc9389055bfbe4a4fb29 SHA512 2d2dcc4f31b77e9c47b8a55e3657907f5b45567d2f44724aad4d8ebec4650a1f8d5bd73cddb916c8fb05489ec4f630f984b5c9c9499cab9e855f4d43e7f47cfd WHIRLPOOL 7ec1c880dd21a8f10fb5b1d0291b59ba04330aa9443d0e447d4c0c24ea541b98af7125667fb4ee4ea24d78f310685b3e0efa220a3fd4ce69c0e8f40f8865cbab
+EBUILD aerospike-server-community-3.14.1.4.ebuild 1634 SHA256 954a8f13463c378210c9e0f72b283db37de9826d66f7cc9389055bfbe4a4fb29 SHA512 2d2dcc4f31b77e9c47b8a55e3657907f5b45567d2f44724aad4d8ebec4650a1f8d5bd73cddb916c8fb05489ec4f630f984b5c9c9499cab9e855f4d43e7f47cfd WHIRLPOOL 7ec1c880dd21a8f10fb5b1d0291b59ba04330aa9443d0e447d4c0c24ea541b98af7125667fb4ee4ea24d78f310685b3e0efa220a3fd4ce69c0e8f40f8865cbab
+EBUILD aerospike-server-community-9999.ebuild 1948 SHA256 849b2a73933091c40e642c3874fb860a9d8d962f20a4e454b5afb131e852a679 SHA512 35a88f0e3a71ee4389604dfcab274de8a7659637fc04b6926e47a410252842b672924ef6775c0eb3329c23131513fbf1cf87a8555c5463d972d45ae965d51fb7 WHIRLPOOL a1c58ed03c7e98d8a2cd3e8e5ef4b7e85ccf74154a3ad505fa720cee0d3173e0b270b398801fd4133cee1906fd35c66be464f50b96c6a71289df61b4d1d64842
+MISC ChangeLog 4364 SHA256 90bbf78c11449834a0fe0c74d0d2c993dae1effe4b6d400cf02a5a18fb8853e3 SHA512 74598ced1aefd88bb382e9baf8dc270fd29d64f6cbbfc822ef01cce878bad64811f46c279fa5f285ff7a3bba2f7c3cf396ece0ff6cf0bba7d929ed65d08c8992 WHIRLPOOL 521f423156fab6e666c27aebb4a38cd227e33d340e18dc9796b3dc4069d32636d0bfd7e33edc27f63bcf9ed09c08eba01828dc3a02282243aa9f35d45950cdf1
+MISC metadata.xml 281 SHA256 c5f4069c93aa8e06d87ed6375692bcbef3e1bb5e4bdc51f781164f58d54ca4b4 SHA512 d3a33c339bb7409528ddca6187790b842150e273bd7630a610c0be08be50e26278ed7b4d42305bfd1a796544c6be251301c938b15d70e609b9d91bd22161aee6 WHIRLPOOL 171454c2084c7dd11595a8535b505410ef93f18f271de22db329b9ef24a567c13443c17359c72a17eb8ccabe7100091ecccf337c9817c3dd45af2f05fd9f73d5
diff --git a/dev-db/aerospike-server-community/aerospike-server-community-3.13.0.7.ebuild b/dev-db/aerospike-server-community/aerospike-server-community-3.13.0.7.ebuild
new file mode 100644
index 000000000000..b7e20d5ad8b6
--- /dev/null
+++ b/dev-db/aerospike-server-community/aerospike-server-community-3.13.0.7.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils user
+
+DESCRIPTION="Flash-optimized, in-memory, nosql database"
+HOMEPAGE="http://www.aerospike.com"
+SRC_URI="http://www.aerospike.com/artifacts/${PN}/${PV}/${P}-debian7.tgz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="sys-libs/readline
+ sys-libs/zlib
+ dev-libs/openssl
+ "
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${P}-debian7"
+
+pkg_setup() {
+ enewgroup aerospike
+ enewuser aerospike -1 /bin/bash /opt/aerospike aerospike
+}
+
+src_prepare() {
+ local server_deb="${P}.debian7.x86_64.deb"
+ local tools_deb="aerospike-tools-3.13.0.1.debian7.x86_64.deb"
+
+ ar x "${server_deb}" || die
+ tar xzf data.tar.gz && rm data.tar.gz || die
+
+ ar x "${tools_deb}" || die
+ tar xzf data.tar.gz && rm data.tar.gz || die
+
+ rm *.deb asinstall control.tar.gz debian-binary LICENSE SHA256SUMS
+ rm usr/bin/{asfixownership,asmigrate2to3}
+}
+
+src_install() {
+ insinto /opt/
+ doins -r opt/aerospike
+
+ fperms +x -R /opt/aerospike/bin/
+ fperms +x -R /opt/aerospike/lib/python/
+
+ for dir in '/etc' '/var/log'; do
+ keepdir "${dir}/aerospike"
+ done
+
+ insinto /etc/aerospike
+ for conf in 'aerospike.conf' 'aerospike_mesh.conf' 'aerospike_ssd.conf'; do
+ doins "${FILESDIR}/${conf}"
+ done
+
+ insinto /usr/bin
+ doins usr/bin/*
+ fperms +x -R /usr/bin/asd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/aerospike.logrotate aerospike
+
+ newinitd "${FILESDIR}"/aerospike.init aerospike
+
+ fowners -R aerospike:aerospike /opt/aerospike/
+ fowners aerospike:aerospike /usr/bin/asd
+ fowners -R aerospike:aerospike /var/log/aerospike
+}
diff --git a/dev-db/aerospike-server-community/aerospike-server-community-3.14.1.4.ebuild b/dev-db/aerospike-server-community/aerospike-server-community-3.14.1.4.ebuild
new file mode 100644
index 000000000000..b7e20d5ad8b6
--- /dev/null
+++ b/dev-db/aerospike-server-community/aerospike-server-community-3.14.1.4.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils user
+
+DESCRIPTION="Flash-optimized, in-memory, nosql database"
+HOMEPAGE="http://www.aerospike.com"
+SRC_URI="http://www.aerospike.com/artifacts/${PN}/${PV}/${P}-debian7.tgz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="sys-libs/readline
+ sys-libs/zlib
+ dev-libs/openssl
+ "
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${P}-debian7"
+
+pkg_setup() {
+ enewgroup aerospike
+ enewuser aerospike -1 /bin/bash /opt/aerospike aerospike
+}
+
+src_prepare() {
+ local server_deb="${P}.debian7.x86_64.deb"
+ local tools_deb="aerospike-tools-3.13.0.1.debian7.x86_64.deb"
+
+ ar x "${server_deb}" || die
+ tar xzf data.tar.gz && rm data.tar.gz || die
+
+ ar x "${tools_deb}" || die
+ tar xzf data.tar.gz && rm data.tar.gz || die
+
+ rm *.deb asinstall control.tar.gz debian-binary LICENSE SHA256SUMS
+ rm usr/bin/{asfixownership,asmigrate2to3}
+}
+
+src_install() {
+ insinto /opt/
+ doins -r opt/aerospike
+
+ fperms +x -R /opt/aerospike/bin/
+ fperms +x -R /opt/aerospike/lib/python/
+
+ for dir in '/etc' '/var/log'; do
+ keepdir "${dir}/aerospike"
+ done
+
+ insinto /etc/aerospike
+ for conf in 'aerospike.conf' 'aerospike_mesh.conf' 'aerospike_ssd.conf'; do
+ doins "${FILESDIR}/${conf}"
+ done
+
+ insinto /usr/bin
+ doins usr/bin/*
+ fperms +x -R /usr/bin/asd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/aerospike.logrotate aerospike
+
+ newinitd "${FILESDIR}"/aerospike.init aerospike
+
+ fowners -R aerospike:aerospike /opt/aerospike/
+ fowners aerospike:aerospike /usr/bin/asd
+ fowners -R aerospike:aerospike /var/log/aerospike
+}
diff --git a/dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild b/dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild
new file mode 100644
index 000000000000..5010144ae241
--- /dev/null
+++ b/dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/aerospike/aerospike-server.git"
+
+inherit git-2 systemd user
+
+DESCRIPTION="Flash-optimized, in-memory, nosql database"
+HOMEPAGE="http://www.aerospike.com"
+SRC_URI=""
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS=""
+IUSE="+tools"
+
+RDEPEND="app-crypt/gcr
+ dev-libs/jansson
+ dev-libs/jemalloc"
+DEPEND="${RDEPEND}"
+
+DOCS=(
+ README.md
+)
+
+PATCHES=(
+ "${FILESDIR}"/3.5.8-use-system-libs.patch
+)
+
+pkg_setup() {
+ enewgroup aerospike
+ enewuser aerospike -1 /bin/bash /opt/aerospike aerospike
+}
+
+src_prepare() {
+ base_src_prepare
+
+ git submodule update --init
+
+ sed \
+ -e 's/USE_SYSTEM_JEM = 0/USE_SYSTEM_JEM = 1/g' \
+ -e 's/USE_SYSTEM_JANSSON = 0/USE_SYSTEM_JANSSON = 1/g' \
+ -e 's/LD_CRYPTO = static/LD_CRYPTO = dynamic/g' \
+ -e 's/LD_JANSSON = static/LD_JANSSON = dynamic/g' \
+ -e 's/LD_JEM = static/LD_JEM = dynamic/g' \
+ -i make_in/Makefile.vars || die
+
+ rm -rf modules/jansson
+ rm -rf modules/jemalloc
+}
+
+src_install() {
+ base_src_install_docs
+
+ dobin target/Linux-x86_64/bin/asd
+
+ insinto /opt/aerospike/sys/udf/lua
+ doins -r modules/lua-core/src/*
+
+ if use tools; then
+ insinto /opt/aerospike/bin
+ doins tools/afterburner/afterburner.sh
+ fperms +x /opt/aerospike/bin/afterburner.sh
+ fi
+
+ keepdir /opt/aerospike/usr/udf/lua
+ keepdir /var/log/aerospike
+
+ insinto /etc/aerospike
+ for conf in aerospike.conf aerospike_mesh.conf aerospike_ssd.conf; do
+ sed -e "s@/var/run/aerospike/asd.pid@/run/aerospike/aerospike.pid@g" -i as/etc/"${conf}" || die
+ doins as/etc/"${conf}"
+ done
+
+ insinto /etc/logrotate.d
+ newins as/etc/logrotate_asd aerospike
+
+ newinitd "${FILESDIR}"/aerospike.init aerospike
+ systemd_newunit as/etc/aerospike-server.service aerospike.service
+
+ fowners -R aerospike:aerospike /opt/aerospike/
+ fowners aerospike:aerospike /usr/bin/asd
+ fowners -R aerospike:aerospike /var/log/aerospike
+}
diff --git a/dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch b/dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch
new file mode 100644
index 000000000000..eb69f5ff2e51
--- /dev/null
+++ b/dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch
@@ -0,0 +1,63 @@
+diff --git a/Makefile b/Makefile
+index d4ce8ac..26271fd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -54,12 +54,16 @@ ifeq ($(USE_ASM),1)
+ $(MAKE) -C $(ASMALLOC) jem SRCDIR=src
+ endif
+ ifeq ($(USE_JEM),1)
++ifeq ($(USE_SYSTEM_JEM),0)
+ $(MAKE) -C $(JEMALLOC)
+ endif
++endif
+ ifeq ($(USE_LUAJIT),1)
+ $(MAKE) -C $(LUAJIT) Q= TARGET_SONAME=libluajit.so CCDEBUG=-g
+ endif
++ifeq ($(USE_SYSTEM_JANSSON),0)
+ $(MAKE) -C $(JANSSON)
++endif
+ $(MAKE) -C $(COMMON) CF=$(CF) EXT_CFLAGS="$(EXT_CFLAGS)"
+ $(MAKE) -C $(CF)
+ $(MAKE) -C $(MOD_LUA) CF=$(CF) COMMON=$(COMMON) LUA_CORE=$(LUA_CORE) EXT_CFLAGS="$(EXT_CFLAGS)" USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT)
+@@ -174,16 +178,24 @@ mexp2: mexp1
+ $(MAKE) MEXP_PHASE=2 SRCDIR=$(realpath $(MEXP_DIR))/
+
+ $(JANSSON)/configure:
++ifeq ($(USE_SYSTEM_JANSSON),0)
+ cd $(JANSSON) && autoreconf -i
++endif
+
+ $(JANSSON)/Makefile: $(JANSSON)/configure
++ifeq ($(USE_SYSTEM_JANSSON),0)
+ cd $(JANSSON) && ./configure $(JANSSON_CONFIG_OPT)
++endif
+
+ $(JEMALLOC)/configure:
++ifeq ($(USE_SYSTEM_JEM),0)
+ cd $(JEMALLOC) && autoconf
++endif
+
+ $(JEMALLOC)/Makefile: $(JEMALLOC)/configure
++ifeq ($(USE_SYSTEM_JEM),0)
+ cd $(JEMALLOC) && ./configure $(JEM_CONFIG_OPT)
++endif
+
+ $(LUAJIT)/src/luaconf.h: $(LUAJIT)/src/luaconf.h.orig
+ ln -s $(notdir $<) $@
+diff --git a/make_in/Makefile.vars b/make_in/Makefile.vars
+index efe3226..0b54701 100644
+--- a/make_in/Makefile.vars
++++ b/make_in/Makefile.vars
+@@ -31,6 +31,12 @@ ifeq ($(USE_ASM),1)
+ EXT_CFLAGS += -DUSE_ASM
+ endif
+
++# Use the system provided JEMalloc memory allocator? [By default, no.]
++USE_SYSTEM_JEM = 0
++
++# Use the system provided Jansson JSON API Library? [By default, no.]
++USE_SYSTEM_JANSSON = 0
++
+ # Use the JEMalloc memory allocator? [By default, yes.]
+ USE_JEM = 1
+
diff --git a/dev-db/aerospike-server-community/files/aerospike.conf b/dev-db/aerospike-server-community/files/aerospike.conf
new file mode 100644
index 000000000000..842873bd3e8e
--- /dev/null
+++ b/dev-db/aerospike-server-community/files/aerospike.conf
@@ -0,0 +1,70 @@
+# Aerospike database configuration file.
+
+service {
+ user root
+ group root
+ paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
+ pidfile /run/aerospike/aerospike.pid
+ service-threads 4
+ transaction-queues 4
+ transaction-threads-per-queue 4
+ proto-fd-max 15000
+}
+
+logging {
+ # Log file must be an absolute path.
+ file /var/log/aerospike/aerospike.log {
+ context any info
+ }
+}
+
+network {
+ service {
+ address any
+ port 3000
+ }
+
+ heartbeat {
+ mode multicast
+ address 239.1.99.222
+ port 9918
+
+ # To use unicast-mesh heartbeats, remove the 3 lines above, and see
+ # aerospike_mesh.conf for alternative.
+
+ interval 150
+ timeout 10
+ }
+
+ fabric {
+ port 3001
+ }
+
+ info {
+ port 3003
+ }
+}
+
+namespace test {
+ replication-factor 2
+ memory-size 4G
+ default-ttl 30d # 30 days, use 0 to never expire/evict.
+
+ storage-engine memory
+}
+
+namespace bar {
+ replication-factor 2
+ memory-size 4G
+ default-ttl 30d # 30 days, use 0 to never expire/evict.
+
+ storage-engine memory
+
+ # To use file storage backing, comment out the line above and use the
+ # following lines instead.
+# storage-engine device {
+# file /opt/aerospike/data/bar.dat
+# filesize 16G
+# data-in-memory true # Store data in memory in addition to file.
+# }
+}
diff --git a/dev-db/aerospike-server-community/files/aerospike.init b/dev-db/aerospike-server-community/files/aerospike.init
new file mode 100644
index 000000000000..b1dac8078d6d
--- /dev/null
+++ b/dev-db/aerospike-server-community/files/aerospike.init
@@ -0,0 +1,53 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+config_file=${config_file:-/etc/aerospike/${SVCNAME}.conf}
+run_dir=${run_dir:-/run/aerospike}
+
+command="/usr/bin/asd"
+command_args="--config-file ${config_file}"
+command_background="false"
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-aerospike}
+group=${group:-aerospike}
+start_stop_daemon_args="--user ${user} --group ${group}"
+required_files="${config_file}"
+
+depend() {
+ use net
+}
+
+set_shmall() {
+ mem=`/sbin/sysctl -n kernel.shmall`
+ min=4294967296
+ if [ ${#mem} -le ${#min} ]; then
+ if [ $mem -lt $min ]; then
+ ewarn "kernel.shmall too low, setting to 4G pages = 16TB"
+ /sbin/sysctl -w kernel.shmall=$min
+ fi
+ fi
+}
+
+set_shmmax() {
+ mem=`/sbin/sysctl -n kernel.shmmax`
+ min=1073741824
+ if [ ${#mem} -le ${#min} ]; then
+ if [ $mem -lt $min ]; then
+ ewarn "kernel.shmmax too low, setting to 1GB"
+ /sbin/sysctl -w kernel.shmmax=$min
+ fi
+ fi
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o "${user}":"${group}" "${run_dir}"
+ set_shmall
+ set_shmmax
+ ulimit -n 100000
+ if [ -n $LD_PRELOAD ]; then export LD_PRELOAD; fi
+}
+
+start_post() {
+ ewaitfile 60 "${pidfile}"
+}
diff --git a/dev-db/aerospike-server-community/files/aerospike.logrotate b/dev-db/aerospike-server-community/files/aerospike.logrotate
new file mode 100644
index 000000000000..04aabc4a6017
--- /dev/null
+++ b/dev-db/aerospike-server-community/files/aerospike.logrotate
@@ -0,0 +1,10 @@
+/var/log/aerospike/aerospike.log {
+ daily
+ rotate 90
+ dateext
+ compress
+ olddir /var/log/aerospike/
+ postrotate
+ kill -HUP `cat /var/run/aerospike/aerospike.pid`
+ endscript
+}
diff --git a/dev-db/aerospike-server-community/files/aerospike_mesh.conf b/dev-db/aerospike-server-community/files/aerospike_mesh.conf
new file mode 100644
index 000000000000..26274f310ed0
--- /dev/null
+++ b/dev-db/aerospike-server-community/files/aerospike_mesh.conf
@@ -0,0 +1,73 @@
+# Aerospike database configuration file for deployments using mesh heartbeats.
+
+service {
+ user root
+ group root
+ paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
+ pidfile /run/aerospike/aerospike.pid
+ service-threads 4
+ transaction-queues 4
+ transaction-threads-per-queue 4
+ proto-fd-max 15000
+}
+
+logging {
+ # Log file must be an absolute path.
+ file /var/log/aerospike/aerospike.log {
+ context any info
+ }
+}
+
+network {
+ service {
+ address any
+ port 3000
+ }
+
+ heartbeat {
+ mode mesh
+ port 3002 # Heartbeat port for this node.
+
+ # List one or more other nodes, one ip-address & port per line:
+ mesh-seed-address-port 10.10.10.10 3002
+# mesh-seed-address-port 10.10.10.11 3002
+# mesh-seed-address-port 10.10.10.12 3002
+# mesh-seed-address-port 10.10.10.13 3002
+# mesh-seed-address-port 10.10.10.14 3002
+
+ interval 250
+ timeout 10
+ }
+
+ fabric {
+ port 3001
+ }
+
+ info {
+ port 3003
+ }
+}
+
+namespace test {
+ replication-factor 2
+ memory-size 4G
+ default-ttl 30d # 30 days, use 0 to never expire/evict.
+
+ storage-engine memory
+}
+
+namespace bar {
+ replication-factor 2
+ memory-size 4G
+ default-ttl 30d # 30 days, use 0 to never expire/evict.
+
+ storage-engine memory
+
+ # To use file storage backing, comment out the line above and use the
+ # following lines instead.
+# storage-engine device {
+# file /opt/aerospike/data/bar.dat
+# filesize 16G
+# data-in-memory true # Store data in memory in addition to file.
+# }
+}
diff --git a/dev-db/aerospike-server-community/files/aerospike_ssd.conf b/dev-db/aerospike-server-community/files/aerospike_ssd.conf
new file mode 100644
index 000000000000..3d75bd6f7d91
--- /dev/null
+++ b/dev-db/aerospike-server-community/files/aerospike_ssd.conf
@@ -0,0 +1,68 @@
+# Aerospike database configuration file for deployments using raw storage.
+
+service {
+ user root
+ group root
+ paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
+ pidfile /run/aerospike/aerospike.pid
+ service-threads 8
+ transaction-queues 8
+ transaction-threads-per-queue 8
+ proto-fd-max 15000
+}
+
+logging {
+ # Log file must be an absolute path.
+ file /var/log/aerospike/aerospike.log {
+ context any info
+ }
+}
+
+network {
+ service {
+ address any
+ port 3000
+ }
+
+ heartbeat {
+ mode multicast
+ address 239.1.99.222
+ port 9918
+
+ # To use unicast-mesh heartbeats, remove the 3 lines above, and see
+ # aerospike_mesh.conf for alternative.
+
+ interval 150
+ timeout 10
+ }
+
+ fabric {
+ port 3001
+ }
+
+ info {
+ port 3003
+ }
+}
+
+namespace test {
+ replication-factor 2
+ memory-size 4G
+ default-ttl 30d # 30 days, use 0 to never expire/evict.
+
+ # Warning - legacy data in defined raw partition devices will be erased.
+ # These partitions must not be mounted by the file system.
+ storage-engine device {
+ # Use one or more lines like those below with actual device paths.
+# device /dev/sdb
+# device /dev/sdc
+
+ # The 2 lines below optimize for SSD.
+ scheduler-mode noop
+ write-block-size 128K
+
+ # Use the line below to store data in memory in addition to devices.
+# data-in-memory true
+ }
+}
+
diff --git a/dev-db/aerospike-server-community/metadata.xml b/dev-db/aerospike-server-community/metadata.xml
new file mode 100644
index 000000000000..647069390b01
--- /dev/null
+++ b/dev-db/aerospike-server-community/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="tools">Install extra tools</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/apgdiff/Manifest b/dev-db/apgdiff/Manifest
new file mode 100644
index 000000000000..93902e6cb65e
--- /dev/null
+++ b/dev-db/apgdiff/Manifest
@@ -0,0 +1,13 @@
+DIST apgdiff-1.4-src.zip 178608 SHA256 aa341a627e2087eb9fb66c1bc0a785e5e9953459395b60e1b447ed30947f52f9 SHA512 c1dcd3f39e931f90e65a439a610d5b264b790419a59b2c90f6d9107c1b5151c602887588f378110a2e9420428414fc333c7919e2137e2dc35168654ceb3ae8d0 WHIRLPOOL 2e05303fef00b999aa07dce0b59df7d805b486cced61ac50a40c3b8aefcdd37aec649feb4f5fc96111d388029198def0aada0d33c6421e672a652d19b55f94a1
+DIST apgdiff-2.2.1-src.zip 194305 SHA256 844c92499f80b52d290fa89edf19c955e056eb6d92ee7fb3ad01acfcc04b4d04 SHA512 cab6b2349d5822ca579c1e021ea7f02f5ddf39d56559f841d0cadfdccc1c1c61399c494302ea5909984b9a8a6d91cf08868f012dd3487a8633f65e3bbd28f19c WHIRLPOOL 364f78e22c136e10acd3337db7d7b85ef16e33042d7d6fae990824fda583d94189ebd737c6268fb1264f7b9d2fa11c3c4852fd8fab89cfbca6cd42c7bfb97397
+DIST apgdiff-2.2.2-src.zip 198814 SHA256 cd4c4a5315fdf311e3dd18c1368a50fead91bb17198e984b0d4ace15755a55ae SHA512 273ba473b5b4ccfe2ae1b3f34ce2c2b825e446fad166f28a4575528190c20922e6794563ae3e5b2918ade5a3292a792ea363e9e5ec0900e924332d8771548c0b WHIRLPOOL ee6af8b7444676e4eb887f716dee3514f9d5a5d54bf0efa859c20c817424a5dbcf4059dc6641c1fa19c53441c25e002e812d5eea13d3c4aecce6fee76a46dd9e
+DIST apgdiff-2.3-src.zip 215881 SHA256 bbae469988ca321b76a4d2d8717477261c823ac9608282998cec28ed8933c8b2 SHA512 e716143ff4378fc27c4781076c51826583c2ad9dab17f4364acbfed0f9a0958dca0de9a72171816bbce41653ad33834158cb9277dd8790649da4bd24e013bbb5 WHIRLPOOL e404000074fee973b49ace8f6223072eb4aca95283d9a3ffd9b4dec1f242de263546e0894b8242828368926a45ba3ac5388b59cb4be73a1b0421a9e1703f2685
+DIST apgdiff-2.4-src.zip 227714 SHA256 8551a3e10c7aae3a04efc5dad655575484b63a3323f07db5e81c50b42d88129c SHA512 f37e0f86ff8a8bc53a43cac1748ab3a2c96ab6c972b37ee63f281ee397b31a7b48986cbc963d89ea773f1bb7b10b798de74a4c88a03f2db7672501b93355261b WHIRLPOOL 61a8a605508564188f16fc306abd710e3895079a53a2f311e3cbb8b1943146f7f4039b31f5f5653b1ea30447a2e35328201d7aec7b91952483c1a5a18704d3b7
+EBUILD apgdiff-1.4.ebuild 1084 SHA256 6507370c1dd38485d326180eabad934ded8f2315670c14c9d83b03a0d0218a58 SHA512 94802beaad7f5e5f8b70b1376c8a3ba9dcb59b773c118d092233bf888ebe0d177e06b19860eb0f459c57b294a3fbe4c26c1e590c2a71e36db48af0aa99a99b70 WHIRLPOOL 8627e817139eb651e8e5ee06671409e8dc0dcfef077539a34dfc30d8ca970b678a319e83779e9a847e4c140ea028e8748f1b0ba17daaca83ff79ee5afaedde46
+EBUILD apgdiff-2.2.1.ebuild 1078 SHA256 3e3933303f1c1e6f8519b77da6aa71cbc4d72ef105bf7a1bb58cad143462e9d6 SHA512 f934a12ea0802c41606156d509598afd9c15983d7d6bd787021b60eb64d9548c111ec5e343b7ac438a2b40f3fdc09d4068dbd14766b373600f66015b38899120 WHIRLPOOL 08e2f1e439ecde913664b1f4d7999726c233a6986eb4c9f5d9d0863975010a4120174cafe62182be6a8588176167399f2a1cbabd4e04ef8bf6274345eed85407
+EBUILD apgdiff-2.2.2.ebuild 1072 SHA256 df208500a2e4722eee36956b72b10e8aafd1945218064d85035b5451014b3aff SHA512 81995806431fe958edf9d0e0a5891a5f092632a5364c191b0cb220eb0c2bb6085ae39aef7407d24e69cbcbdc4bb13a17f24085e79992b7bf2a861e141ddf7b9f WHIRLPOOL 9fd7bbea4441cea2c330afe87f7c15612dc242c7cb398e8cf5833fa6d01dd5c59adab1c9725125e0d1dfcdd3baaea0135532a782d478de8769e154d0dd26ebad
+EBUILD apgdiff-2.3.ebuild 1072 SHA256 df208500a2e4722eee36956b72b10e8aafd1945218064d85035b5451014b3aff SHA512 81995806431fe958edf9d0e0a5891a5f092632a5364c191b0cb220eb0c2bb6085ae39aef7407d24e69cbcbdc4bb13a17f24085e79992b7bf2a861e141ddf7b9f WHIRLPOOL 9fd7bbea4441cea2c330afe87f7c15612dc242c7cb398e8cf5833fa6d01dd5c59adab1c9725125e0d1dfcdd3baaea0135532a782d478de8769e154d0dd26ebad
+EBUILD apgdiff-2.4.ebuild 1072 SHA256 df208500a2e4722eee36956b72b10e8aafd1945218064d85035b5451014b3aff SHA512 81995806431fe958edf9d0e0a5891a5f092632a5364c191b0cb220eb0c2bb6085ae39aef7407d24e69cbcbdc4bb13a17f24085e79992b7bf2a861e141ddf7b9f WHIRLPOOL 9fd7bbea4441cea2c330afe87f7c15612dc242c7cb398e8cf5833fa6d01dd5c59adab1c9725125e0d1dfcdd3baaea0135532a782d478de8769e154d0dd26ebad
+MISC ChangeLog 3169 SHA256 15d4d2efe98a36b3c810d25ff374636af0d082ded7f7d63570d2edf210093fef SHA512 eea0bfe81cfb7153c1340cb01a772e70c8e6c2fd0788c775264d3de6772c179d9ac8b4323813173c5f06e2d4ab8fdf475a5e84664652a73373cb819d1306893e WHIRLPOOL b827ed61970f894ee9b480259cedd6c94549b5ca4c92ee855d5d086af10ec2626356e26194c8ff5d662ca245863fc1379020a15c70395bbbf46ee01ffc34dd79
+MISC ChangeLog-2015 2781 SHA256 257c0f06fb4d357de6c9943b3842ea33251399cebd27d0cf7d9723a72b9f6c30 SHA512 36bfa2a09067b3d888969e0c8ad19f4eac39900ce25062d0a2c34ee6787a4a966b41b56f04062dc2389c8c8e2878426a1bf8a25b2f7e6011498d115c35604501 WHIRLPOOL ea7f9c8b4b62a867d57c73043d9edcce4444264a80fe5021b1511503a37216c4a43c78be356bb206b537cb74bd51564d4fe8fe96a3496032624fe9946492adc6
+MISC metadata.xml 301 SHA256 3521731b521cfedfcaf95ef4b62ccf03a258a821de45b43eb500feb02676605e SHA512 c38dc6bf13779d6e575526c42fc108080b160b9a7127aaea7f93b8a7ca46dbee5d349e95bfbc8a598c745ba0d2c8ce8ce6ea65a475854ad4d5a85e3620166552 WHIRLPOOL 4c02f9ac1e7f2c5117eb40e0196faefeda673bd9315284cb730376523a5b82358fab38441792d2bc95631dd08a273628ff4e2e8837625f6e48f904db670e58b0
diff --git a/dev-db/apgdiff/apgdiff-1.4.ebuild b/dev-db/apgdiff/apgdiff-1.4.ebuild
new file mode 100644
index 000000000000..c0b641076fad
--- /dev/null
+++ b/dev-db/apgdiff/apgdiff-1.4.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+JAVA_PKG_IUSE="doc source"
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A simple PostgreSQL diff tool that is useful for schema upgrades"
+HOMEPAGE="http://apgdiff.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}-src.zip"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=">=virtual/jdk-1.5
+ >=dev-java/ant-core-1.7.0:0
+ >=dev-java/ant-junit-1.7.0:0
+ app-arch/zip:0
+ test? (
+ dev-java/hamcrest-core:0
+ >=dev-java/junit-4.4:4
+ )"
+
+RDEPEND=">=virtual/jre-1.5"
+
+java_prepare() {
+ mkdir "${S}"/lib
+ cd "${S}"/lib
+ if use test ; then
+ java-pkg_jar-from --build-only hamcrest-core
+ java-pkg_jar-from --build-only junit-4
+ fi
+}
+
+src_compile() {
+ eant -Dnoget=true jar $(use_doc)
+}
+
+src_install() {
+ java-pkg_newjar dist/${P}.jar ${PN}.jar
+ java-pkg_dolauncher apgdiff --jar ${PN}.jar
+
+ use doc && java-pkg_dojavadoc dist/javadoc
+ use source && java-pkg_dosrc src/main/java/*
+}
+
+src_test() {
+ ANT_TASKS="ant-junit" eant -Dnoget=true test
+}
diff --git a/dev-db/apgdiff/apgdiff-2.2.1.ebuild b/dev-db/apgdiff/apgdiff-2.2.1.ebuild
new file mode 100644
index 000000000000..208e867060c4
--- /dev/null
+++ b/dev-db/apgdiff/apgdiff-2.2.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+JAVA_PKG_IUSE="doc source"
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A simple PostgreSQL diff tool that is useful for schema upgrades"
+HOMEPAGE="http://apgdiff.com"
+SRC_URI="http://apgdiff.com/download/${P}-src.zip"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=">=virtual/jdk-1.6
+ >=dev-java/ant-core-1.7.0:0
+ >=dev-java/ant-junit-1.7.0:0
+ app-arch/zip:0
+ test? (
+ dev-java/hamcrest-core:1.3
+ >=dev-java/junit-4.4:4
+ )"
+
+RDEPEND=">=virtual/jre-1.6"
+
+java_prepare() {
+ mkdir "${S}"/lib
+ cd "${S}"/lib
+ if use test ; then
+ java-pkg_jar-from --build-only hamcrest-core-1.3
+ java-pkg_jar-from --build-only junit-4
+ fi
+}
+
+src_compile() {
+ eant -Dnoget=true jar $(use_doc)
+}
+
+src_install() {
+ java-pkg_newjar dist/${P}.jar ${PN}.jar
+ java-pkg_dolauncher apgdiff --jar ${PN}.jar
+
+ use doc && java-pkg_dojavadoc dist/javadoc
+ use source && java-pkg_dosrc src/main/java/*
+}
+
+src_test() {
+ ANT_TASKS="ant-junit" eant -Dnoget=true test
+}
diff --git a/dev-db/apgdiff/apgdiff-2.2.2.ebuild b/dev-db/apgdiff/apgdiff-2.2.2.ebuild
new file mode 100644
index 000000000000..8399cc340de1
--- /dev/null
+++ b/dev-db/apgdiff/apgdiff-2.2.2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+JAVA_PKG_IUSE="doc source"
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A simple PostgreSQL diff tool that is useful for schema upgrades"
+HOMEPAGE="http://apgdiff.com"
+SRC_URI="http://apgdiff.com/download/${P}-src.zip"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=">=virtual/jdk-1.6
+ >=dev-java/ant-core-1.7.0:0
+ >=dev-java/ant-junit-1.7.0:0
+ app-arch/zip:0
+ test? (
+ dev-java/hamcrest-core:0
+ >=dev-java/junit-4.4:4
+ )"
+
+RDEPEND=">=virtual/jre-1.6"
+
+java_prepare() {
+ mkdir "${S}"/lib
+ cd "${S}"/lib
+ if use test ; then
+ java-pkg_jar-from --build-only hamcrest-core
+ java-pkg_jar-from --build-only junit-4
+ fi
+}
+
+src_compile() {
+ eant -Dnoget=true jar $(use_doc)
+}
+
+src_install() {
+ java-pkg_newjar dist/${P}.jar ${PN}.jar
+ java-pkg_dolauncher apgdiff --jar ${PN}.jar
+
+ use doc && java-pkg_dojavadoc dist/javadoc
+ use source && java-pkg_dosrc src/main/java/*
+}
+
+src_test() {
+ ANT_TASKS="ant-junit" eant -Dnoget=true test
+}
diff --git a/dev-db/apgdiff/apgdiff-2.3.ebuild b/dev-db/apgdiff/apgdiff-2.3.ebuild
new file mode 100644
index 000000000000..8399cc340de1
--- /dev/null
+++ b/dev-db/apgdiff/apgdiff-2.3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+JAVA_PKG_IUSE="doc source"
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A simple PostgreSQL diff tool that is useful for schema upgrades"
+HOMEPAGE="http://apgdiff.com"
+SRC_URI="http://apgdiff.com/download/${P}-src.zip"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=">=virtual/jdk-1.6
+ >=dev-java/ant-core-1.7.0:0
+ >=dev-java/ant-junit-1.7.0:0
+ app-arch/zip:0
+ test? (
+ dev-java/hamcrest-core:0
+ >=dev-java/junit-4.4:4
+ )"
+
+RDEPEND=">=virtual/jre-1.6"
+
+java_prepare() {
+ mkdir "${S}"/lib
+ cd "${S}"/lib
+ if use test ; then
+ java-pkg_jar-from --build-only hamcrest-core
+ java-pkg_jar-from --build-only junit-4
+ fi
+}
+
+src_compile() {
+ eant -Dnoget=true jar $(use_doc)
+}
+
+src_install() {
+ java-pkg_newjar dist/${P}.jar ${PN}.jar
+ java-pkg_dolauncher apgdiff --jar ${PN}.jar
+
+ use doc && java-pkg_dojavadoc dist/javadoc
+ use source && java-pkg_dosrc src/main/java/*
+}
+
+src_test() {
+ ANT_TASKS="ant-junit" eant -Dnoget=true test
+}
diff --git a/dev-db/apgdiff/apgdiff-2.4.ebuild b/dev-db/apgdiff/apgdiff-2.4.ebuild
new file mode 100644
index 000000000000..8399cc340de1
--- /dev/null
+++ b/dev-db/apgdiff/apgdiff-2.4.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+JAVA_PKG_IUSE="doc source"
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A simple PostgreSQL diff tool that is useful for schema upgrades"
+HOMEPAGE="http://apgdiff.com"
+SRC_URI="http://apgdiff.com/download/${P}-src.zip"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=">=virtual/jdk-1.6
+ >=dev-java/ant-core-1.7.0:0
+ >=dev-java/ant-junit-1.7.0:0
+ app-arch/zip:0
+ test? (
+ dev-java/hamcrest-core:0
+ >=dev-java/junit-4.4:4
+ )"
+
+RDEPEND=">=virtual/jre-1.6"
+
+java_prepare() {
+ mkdir "${S}"/lib
+ cd "${S}"/lib
+ if use test ; then
+ java-pkg_jar-from --build-only hamcrest-core
+ java-pkg_jar-from --build-only junit-4
+ fi
+}
+
+src_compile() {
+ eant -Dnoget=true jar $(use_doc)
+}
+
+src_install() {
+ java-pkg_newjar dist/${P}.jar ${PN}.jar
+ java-pkg_dolauncher apgdiff --jar ${PN}.jar
+
+ use doc && java-pkg_dojavadoc dist/javadoc
+ use source && java-pkg_dosrc src/main/java/*
+}
+
+src_test() {
+ ANT_TASKS="ant-junit" eant -Dnoget=true test
+}
diff --git a/dev-db/apgdiff/metadata.xml b/dev-db/apgdiff/metadata.xml
new file mode 100644
index 000000000000..1013bce99e8f
--- /dev/null
+++ b/dev-db/apgdiff/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">apgdiff</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/barman/Manifest b/dev-db/barman/Manifest
new file mode 100644
index 000000000000..80861bbd9e19
--- /dev/null
+++ b/dev-db/barman/Manifest
@@ -0,0 +1,7 @@
+DIST barman-2.1.tar.gz 240437 SHA256 1db64930bf76f1d36c31838b247e517cee09d1133ce331d4e0be77d326d97295 SHA512 385e74c8dcd20d6ad46f6a5a0520cfa47a597395acd433a570ca062ee2834a8b75101fc9a04b19dd312373e4a0b017c90826f7fbeb4f32d8c59313d8b79af1e1 WHIRLPOOL e5b251146a44254a5c713bf2c4b2bb8985564f7e7e1826fbd658f68401fa6a1248cc2628ee4d064a6b51b7f54c4c2b6daba98310fd62ea79e494c65f5531bcad
+DIST barman-2.3.tar.gz 255500 SHA256 1a4cae3052c00f8401adc7af806df3d11375358d0cbd9ab1c84b5333808ea6cf SHA512 c7885ae4940fc990e3368bc654bfe6924fe36f66e6549d3f263a2f23ead2743b2a9ececf55e393ef3105cdf7fc2f38e491895d8e6135e95372eff9eb0d0bfa69 WHIRLPOOL 17db68636d2bf5a827fa81c33f7a14d27e5e05212d860b1d0c74cd517973e9eebf3da16cd71196e5a10cef0ae9756dc28cc1d6624b930fc7622d564776e5fc72
+EBUILD barman-2.1.ebuild 643 SHA256 f9280a3cc1714639803c94e58b4c71ff856c5235a0cb52cb1e5e5e35eef4551c SHA512 b3d6eaa4b329cc5fad38eb34d4e96bd65c57f7deba8ca5cd53aacb6b03b57b91752c5c0fda10cf14149904481200b979906d3066496b09de0889ff803684e9bd WHIRLPOOL 14e9647dcaaff983cb5fa6b1ea3273d5d47cbd203a9376503edbf708341a4efe4a771ab3d0f5f183d5dea6cf4baafbd2b92d82e9a9fcc4a1ca5729d3eb23e302
+EBUILD barman-2.3.ebuild 643 SHA256 f9280a3cc1714639803c94e58b4c71ff856c5235a0cb52cb1e5e5e35eef4551c SHA512 b3d6eaa4b329cc5fad38eb34d4e96bd65c57f7deba8ca5cd53aacb6b03b57b91752c5c0fda10cf14149904481200b979906d3066496b09de0889ff803684e9bd WHIRLPOOL 14e9647dcaaff983cb5fa6b1ea3273d5d47cbd203a9376503edbf708341a4efe4a771ab3d0f5f183d5dea6cf4baafbd2b92d82e9a9fcc4a1ca5729d3eb23e302
+MISC ChangeLog 3290 SHA256 3d9a3b9e99c7743083b51edd9f4ab4dd02afff347b8ad41208eeca53940bbd15 SHA512 0f74c3970830987273daca4e1f3da06e5e3a1630c1d7e4032329ec54742b4f14a06c1bfc9d657babf4dfc867c5114946947a0fb0ed8f950ac1272cae89484da4 WHIRLPOOL bdfa1032ce68dbb61ce6e2a5bc7dc592097ce8d3051b5ee86d693f7015a31f134db2b0b5b45de8d759a32e9f6e96d4ca00591e0c710e003d2440c032dfbd71a2
+MISC ChangeLog-2015 2978 SHA256 44410fa0f35b37c2c74753a2291bc74965bb338edea0461fdf8c6a6592d4966d SHA512 9fa855887476027a1d724ef230ad7319b3b6ab11b6e4001ebbae9debbb6fd4a052b8a08efce3a52a5e044e1062f1ce058144493414341d7b7337c01a6a025ac3 WHIRLPOOL 5f7afa1617586054ef78a9cb431d69577e6c4d028c96ef97ec078ced715f59903f5be939d395955846a6c06d6c01c21cce8ebe771e00a47c20c8f03fc1550860
+MISC metadata.xml 326 SHA256 aba5a73b5f1a68c34e34f469733e72a977a93be2a502d0d4bcfbf0fc6b6dc394 SHA512 c0fd87ba5960595461b98161bc9debc37bd5f9665461486845900929854a9b27954020d234688abd9c4589a4066d0185bd11ad53a96551b5399f0025acde4ed1 WHIRLPOOL fa419940910df495a5257dac381a376a1bc06d57a4d6f3fc2f2c02d6481d15341512551a8d69874ba3bb2d9ee4d0f53d6699d34df90a356bb45322faf7614ce5
diff --git a/dev-db/barman/barman-2.1.ebuild b/dev-db/barman/barman-2.1.ebuild
new file mode 100644
index 000000000000..f41587cacf79
--- /dev/null
+++ b/dev-db/barman/barman-2.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7)
+
+inherit distutils-r1
+
+DESCRIPTION="Administration tool for disaster recovery of PostgreSQL servers"
+
+HOMEPAGE="http://www.pgbarman.org"
+SRC_URI="http://downloads.sourceforge.net/project/pgbarman/${PV}/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+
+RDEPEND="dev-python/argh[${PYTHON_USEDEP}]
+ >=dev-python/psycopg-2[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ dev-python/argcomplete[${PYTHON_USEDEP}]
+ net-misc/rsync
+ dev-db/postgresql[server]"
+DEPEND=""
diff --git a/dev-db/barman/barman-2.3.ebuild b/dev-db/barman/barman-2.3.ebuild
new file mode 100644
index 000000000000..f41587cacf79
--- /dev/null
+++ b/dev-db/barman/barman-2.3.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7)
+
+inherit distutils-r1
+
+DESCRIPTION="Administration tool for disaster recovery of PostgreSQL servers"
+
+HOMEPAGE="http://www.pgbarman.org"
+SRC_URI="http://downloads.sourceforge.net/project/pgbarman/${PV}/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+
+RDEPEND="dev-python/argh[${PYTHON_USEDEP}]
+ >=dev-python/psycopg-2[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ dev-python/argcomplete[${PYTHON_USEDEP}]
+ net-misc/rsync
+ dev-db/postgresql[server]"
+DEPEND=""
diff --git a/dev-db/barman/metadata.xml b/dev-db/barman/metadata.xml
new file mode 100644
index 000000000000..37e0d90ffaf5
--- /dev/null
+++ b/dev-db/barman/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">downloads</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/bucardo/Manifest b/dev-db/bucardo/Manifest
new file mode 100644
index 000000000000..f3463ee451f7
--- /dev/null
+++ b/dev-db/bucardo/Manifest
@@ -0,0 +1,11 @@
+DIST Bucardo-5.1.1.tar.gz 313409 SHA256 73fec278e83ccd561050d24816438db34d0b68fb9bc44bf4d27c5885ad31597f SHA512 cfba0ad5bd305a057688e024b11dce8332ebada2a5ca649481311cd46e140d6fc57c71914570fe7f26beb9c6e5ac232d36450bed9017ae932117cf28561d311a WHIRLPOOL d8d4848e2e817d648bc9aa4102d00e6da981098f0baf10af3239c1818aa51fba890670788acdf2b0af6f87f3b2fc987a44918d45ab3a304ebd32e536430f0167
+DIST Bucardo-5.2.0.tar.gz 318481 SHA256 3b6353b5cf28e45e1ad612f3aea884dabd19823374cc38eeec8364390d5a94ad SHA512 179c72d3a6cd756a725b3f37e2d6dc30df5d473e90a479f22d6a2ca4e6e98f55c1aa12d92ae4958d4446f5f1176fad4c5c0085d38cf3c64f77b699e3bf0884dd WHIRLPOOL 8c76910c97f9252473cd7575a08fea9f6c536d58f66ab596274fec514e220edbd20ea0fac75dc739757702e1b9ee47181240f348ace74ca7f7cf9121a6f85d9c
+DIST Bucardo-5.3.1.tar.gz 321942 SHA256 de8f83305395571cff8c6db8e0016b195424ed75116012528d283dd789c2c132 SHA512 c0821116b81523016b1b7cd9f7544b575c9b762fea1a721f57648dd8484fbc8881fa10fc4a81166239b3a4b50072dfdb8075e5f1485c96c37265d023b0f4ac27 WHIRLPOOL acf5bb82a83d49f979301fe2941c884be0773e1180929d2973e3f6b781f610ea3650498141655b59c2e15dd581d555e4e2314f4d8762ffa323209d4146dab82c
+DIST Bucardo-5.4.1.tar.gz 327848 SHA256 0f080d75a7dca98c12f4d01463ba01e461c7c25c8daa383aca94202efd5d13dd SHA512 b669d62a588db41e69b81ede8dc9398ad2a4eb4fcb8839993bceb5b3f3251509304e5a30373ef48ba7d75befc87758f371d3db9125127da7b068fef2a0c49e1f WHIRLPOOL 200d83741d25cab87de7a4fba0f8cf0970b9b20636d00e8b6b805236ba668716d630ced053ef8155d77505b988bc28ab874f3e719558241e423e4da7b7ba9c2e
+EBUILD bucardo-5.1.1-r1.ebuild 638 SHA256 9bbe840eb8bb56f0afb41272ad4f0da6e3905b143a1a08d52689249dd3ca3df0 SHA512 fb1212b86ccb4de9741890c11e88fcca972647800bcd2d6143fa741ca6f77db041c096113a40bd58180ebea469b7df248ad3077c397a0cc4cb63f6fed0132f21 WHIRLPOOL 691b9dc5499dd9aa025fe58a0ee6322a00c119dd39801a8b95359875e310ac114395004bb86e53ca71bc0eaf720bfe2ded39acb2d810bc39b90da22e9c706e45
+EBUILD bucardo-5.2.0.ebuild 638 SHA256 9bbe840eb8bb56f0afb41272ad4f0da6e3905b143a1a08d52689249dd3ca3df0 SHA512 fb1212b86ccb4de9741890c11e88fcca972647800bcd2d6143fa741ca6f77db041c096113a40bd58180ebea469b7df248ad3077c397a0cc4cb63f6fed0132f21 WHIRLPOOL 691b9dc5499dd9aa025fe58a0ee6322a00c119dd39801a8b95359875e310ac114395004bb86e53ca71bc0eaf720bfe2ded39acb2d810bc39b90da22e9c706e45
+EBUILD bucardo-5.3.1.ebuild 638 SHA256 cf30a25fc71137b7d2050072c24903df6ea09a194af62aac83c5d60795e2004a SHA512 355f1d5a53b36f5be2d70c678ce1761dc2cbde50c2f4406a5db259c64168d203a0a03b6d8cb1e900ceadb04c801fb50f44afc3afcc0223249eaa5dc48c840aa9 WHIRLPOOL 4432de434f90f17c2e1b12dde43712480fc786ec8a9809823dd9a1c65277151657daac41c077abe9a23801da7dd29c0c2f4100d7074cf84c89ac2fdb97b22df6
+EBUILD bucardo-5.4.1.ebuild 638 SHA256 cf30a25fc71137b7d2050072c24903df6ea09a194af62aac83c5d60795e2004a SHA512 355f1d5a53b36f5be2d70c678ce1761dc2cbde50c2f4406a5db259c64168d203a0a03b6d8cb1e900ceadb04c801fb50f44afc3afcc0223249eaa5dc48c840aa9 WHIRLPOOL 4432de434f90f17c2e1b12dde43712480fc786ec8a9809823dd9a1c65277151657daac41c077abe9a23801da7dd29c0c2f4100d7074cf84c89ac2fdb97b22df6
+MISC ChangeLog 2681 SHA256 9b19ac6a29528082444e5ee231445281e1eee90e2a7216f060361ae537e63ccc SHA512 d568c0d4bc8a042802e64cf415d910c43d520a0e31b69279e682e939ad64df1044a4c94f6dc775a0a0939daa680a62a89d1f21107f4547634b3180dc68da6f43 WHIRLPOOL 592243e63db5f8f73460a8700cbed742d1407088ffaccaff4c48065b3555709522de6b400ae0d7240ea1236ae0ed6250f3fbd2e8f0e05be77d2adccf63a550dd
+MISC ChangeLog-2015 1342 SHA256 2bd99a9f1ab6a1a11a6aa5b23c21cdb242ae6efcb607402e796c56235566af92 SHA512 ec2e4eed204b6e030cf9cba0eaa722900d14b9a0bbc4a4fa46e53b42545b37ada8b8b67b0054639a11ac2f76fc46e64bc45d7add47620af6143b08163da7fa32 WHIRLPOOL 76c50fb06e2aaf4ab3144a47a58243d5a91ea52b425b999551494d3b5bcf7cb3e7633f5fbd9963e4062e56fed210922c65475570d5f1a86b18cab2c7d42e5de7
+MISC metadata.xml 280 SHA256 5660ba07e5d7576fce822b35f72d04dcf8a747816e9cf5e5d553242f5b7d9a41 SHA512 efb5fb6652ac8cd75fff4eea8b2b044a2c9201cce2faf3bbe13a97565d150e64f9ba0dd8bb691a44a1b6726455306ea8b6c1b121678a721a82e7ea8b6589c94f WHIRLPOOL eea3f820c4a7f73d6fc893f55c9408f1c27da41bc9e8aa2c07bdd9e884d54945f2eaeb47230411f03160a09ca5f3da762df6f977fed5995a4ffe413b4bce53af
diff --git a/dev-db/bucardo/bucardo-5.1.1-r1.ebuild b/dev-db/bucardo/bucardo-5.1.1-r1.ebuild
new file mode 100644
index 000000000000..f0ef9fd8cd89
--- /dev/null
+++ b/dev-db/bucardo/bucardo-5.1.1-r1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+RESTRICT="test"
+
+inherit perl-module
+
+MY_PN="Bucardo"
+
+DESCRIPTION="An asynchronous PostgreSQL replication system"
+HOMEPAGE="http://bucardo.org/wiki/Bucardo"
+SRC_URI="http://bucardo.org/downloads/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+#IUSE="test" doesn't work without extra data
+IUSE=""
+
+DEPEND="dev-perl/DBIx-Safe
+ dev-perl/DBD-Pg"
+RDEPEND="dev-perl/DBIx-Safe"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_BASE="${D}" install -j1
+ keepdir /var/run/bucardo
+}
diff --git a/dev-db/bucardo/bucardo-5.2.0.ebuild b/dev-db/bucardo/bucardo-5.2.0.ebuild
new file mode 100644
index 000000000000..f0ef9fd8cd89
--- /dev/null
+++ b/dev-db/bucardo/bucardo-5.2.0.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+RESTRICT="test"
+
+inherit perl-module
+
+MY_PN="Bucardo"
+
+DESCRIPTION="An asynchronous PostgreSQL replication system"
+HOMEPAGE="http://bucardo.org/wiki/Bucardo"
+SRC_URI="http://bucardo.org/downloads/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+#IUSE="test" doesn't work without extra data
+IUSE=""
+
+DEPEND="dev-perl/DBIx-Safe
+ dev-perl/DBD-Pg"
+RDEPEND="dev-perl/DBIx-Safe"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_BASE="${D}" install -j1
+ keepdir /var/run/bucardo
+}
diff --git a/dev-db/bucardo/bucardo-5.3.1.ebuild b/dev-db/bucardo/bucardo-5.3.1.ebuild
new file mode 100644
index 000000000000..d28a6ecfc9d9
--- /dev/null
+++ b/dev-db/bucardo/bucardo-5.3.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+RESTRICT="test"
+
+inherit perl-module
+
+MY_PN="Bucardo"
+
+DESCRIPTION="An asynchronous PostgreSQL replication system"
+HOMEPAGE="http://bucardo.org/wiki/Bucardo"
+SRC_URI="http://bucardo.org/downloads/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+#IUSE="test" doesn't work without extra data
+IUSE=""
+
+DEPEND="dev-perl/DBIx-Safe
+ dev-perl/DBD-Pg"
+RDEPEND="dev-perl/DBIx-Safe"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_BASE="${D}" install -j1
+ keepdir /var/run/bucardo
+}
diff --git a/dev-db/bucardo/bucardo-5.4.1.ebuild b/dev-db/bucardo/bucardo-5.4.1.ebuild
new file mode 100644
index 000000000000..d28a6ecfc9d9
--- /dev/null
+++ b/dev-db/bucardo/bucardo-5.4.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+RESTRICT="test"
+
+inherit perl-module
+
+MY_PN="Bucardo"
+
+DESCRIPTION="An asynchronous PostgreSQL replication system"
+HOMEPAGE="http://bucardo.org/wiki/Bucardo"
+SRC_URI="http://bucardo.org/downloads/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+#IUSE="test" doesn't work without extra data
+IUSE=""
+
+DEPEND="dev-perl/DBIx-Safe
+ dev-perl/DBD-Pg"
+RDEPEND="dev-perl/DBIx-Safe"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_BASE="${D}" install -j1
+ keepdir /var/run/bucardo
+}
diff --git a/dev-db/bucardo/metadata.xml b/dev-db/bucardo/metadata.xml
new file mode 100644
index 000000000000..711734ad7566
--- /dev/null
+++ b/dev-db/bucardo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/cdb/Manifest b/dev-db/cdb/Manifest
new file mode 100644
index 000000000000..57258d5e6b26
--- /dev/null
+++ b/dev-db/cdb/Manifest
@@ -0,0 +1,7 @@
+AUX cdb-0.75-errno.diff 243 SHA256 7d614d7e677a64685995067cc1db1d514b6a1c73981187f2d7a5d56b54b6966e SHA512 03c64d2ab185c16d88f51aaa12d1ca06102444c3eed9d712fcd53e6b8eaeeeacbdf525d91c7fc3eb28bf88be776de4748157d596103b9fc7776a5bde05eef4c4 WHIRLPOOL 8be1c7be4bd0b56bf1392eddaa598ddf96a5681d462c51d961e651719a23f742b6aeec1e756b353dd3a7161b276023924fb375fdd5e59d7009d2861544063ce5
+AUX cdb-0.75-stdint.diff 11423 SHA256 a9473ede09cd53e19cd2c0264a42c041bed19f48e5a62c71c4e2013b739422a1 SHA512 0308d25c6f9ee3b8fc49e75a2e69c7cdbf8cca7dbf165b3a107d5e2717051f6c68df04a962456295c56e6dde97ee0777944cf406c3eb48f4b7f39ecfaf56f877 WHIRLPOOL 5c5e5d4b87d4dac99edcd2c6371fe8db42204d8bf2b1746a8aa0b4174d0ea10db159f1da01a1915b737c0aeaa2f94eaff3dbf4596cf10fd8b7127a5c37b49e43
+DIST cdb-0.75.tar.gz 54162 SHA256 1919577799a50c080a8a05a1cbfa5fa7e7abc823d8d7df2eeb181e624b7952c5 SHA512 6faeab91a77457348b58f685e81000b83fb609691317198a06284c5c62dee1e4d6138f90be1e727021f279d740169c175a21b23c96adb39a654e3f7fafdf36c0 WHIRLPOOL 51e1783c3f5c7c44846e370075ca53593cf5cbf82bcdf39e3882b49205058844d7403c571ce007eaba987b23848dcc87e3c4ad3cc7b622389bb2f532bafb4912
+EBUILD cdb-0.75-r4.ebuild 1495 SHA256 fa56ab1cae06994dd708271b2bb2bdc3c75fff9c2e84aa4cbccd21f3d31bc645 SHA512 358754754c8e570291ad4a27abd7e625c7c334f7846dc9d04701a92b7f7f767c13da46d29c0c7c4038e305915803b28cdfeb95af044b256244404289b6877744 WHIRLPOOL cda1a1444c4a8bb0fdb718ed5c62f4f30380b2c83defda00dfee4b8e8dc3c09044da6a2bef3485455c097725dacebfa8b15ab5670b1ad619c466678c9a327133
+MISC ChangeLog 4724 SHA256 29ad6238eefa2b25360ca50dd93f7e637a20848b1aa17d3f65a67468795ff956 SHA512 756ea35a2b4646544c088445963325f54ce4de9071e8c9482aef487b1b487fe2795aa4f9f5733468143b710966acdbd6f2e156828a98925d62935ccdd30c9cea WHIRLPOOL 107db7fc135534e118cb667ce6dff80dcc831ba688109d4db1145e039c2498423be36dfc2dc2ddbee99485deeb08f2ebd9bb6a98cc158e02a38228367aa2ac96
+MISC ChangeLog-2015 6700 SHA256 dc6d41921fe5351f70bb3290f2a9b404e569d734e6c42814b3cec6e0a66d3492 SHA512 61a3800b8fb93521507228bb5fefc744f0206b7e100aab227bd14ee7fab01141adefec62bf4397a525491bae8d628af6dfa0dd8f37233228f48dc52874c5a28c WHIRLPOOL 38a8cfb18bb45aa2c9e88b7a86b6e284022c16fec77545c1c6d10aa027eb241e1fed60075c0fa4968872cf49940b2c382507924c5648b63906941345aa5152cb
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/cdb/cdb-0.75-r4.ebuild b/dev-db/cdb/cdb-0.75-r4.ebuild
new file mode 100644
index 000000000000..5e0da1dd2167
--- /dev/null
+++ b/dev-db/cdb/cdb-0.75-r4.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib toolchain-funcs
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
+
+DESCRIPTION="Fast, reliable, simple package for creating and reading constant databases"
+HOMEPAGE="http://cr.yp.to/cdb.html"
+SRC_URI="http://cr.yp.to/cdb/${P}.tar.gz"
+LICENSE="public-domain"
+SLOT="0"
+IUSE=""
+
+DEPEND=">=sys-apps/sed-4
+ !dev-db/tinycdb"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-errno.diff
+ epatch "${FILESDIR}"/${P}-stdint.diff
+
+ sed -i -e 's/head -1/head -n 1/g' Makefile \
+ || die "sed Makefile failed"
+}
+
+src_configure() {
+ echo "$(tc-getCC) ${CFLAGS} -fPIC" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+ echo "${EPREFIX}/usr" > conf-home
+}
+
+src_install() {
+ dobin cdbdump cdbget cdbmake cdbmake-12 cdbmake-sv cdbstats cdbtest \
+ || die "dobin failed"
+
+ # ok so ... first off, some automakes fail at finding
+ # cdb.a, so install that now
+ dolib *.a || die "dolib failed"
+
+ # then do this pretty little symlinking to solve the somewhat
+ # cosmetic library issue at hand
+ dosym cdb.a /usr/$(get_libdir)/libcdb.a || die "dosym failed"
+
+ # uint32.h needs installation too, otherwise compiles depending
+ # on it will fail
+ insinto /usr/include/cdb
+ doins cdb*.h buffer.h alloc.h uint32.h || die "doins failed"
+
+ dodoc CHANGES FILES README SYSDEPS TODO VERSION
+}
diff --git a/dev-db/cdb/files/cdb-0.75-errno.diff b/dev-db/cdb/files/cdb-0.75-errno.diff
new file mode 100644
index 000000000000..5f6ac20c59c6
--- /dev/null
+++ b/dev-db/cdb/files/cdb-0.75-errno.diff
@@ -0,0 +1,11 @@
+--- error.h.orig 2003-03-29 04:18:26.000000000 -0800
++++ error.h 2003-03-29 04:19:00.000000000 -0800
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
diff --git a/dev-db/cdb/files/cdb-0.75-stdint.diff b/dev-db/cdb/files/cdb-0.75-stdint.diff
new file mode 100644
index 000000000000..eb564512075e
--- /dev/null
+++ b/dev-db/cdb/files/cdb-0.75-stdint.diff
@@ -0,0 +1,436 @@
+diff -Naur cdb-0.75-orig/cdb.c cdb-0.75/cdb.c
+--- cdb-0.75-orig/cdb.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdb.c 2009-01-16 19:46:17.000000000 +0100
+@@ -41,7 +41,7 @@
+ }
+ }
+
+-int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32 pos)
++int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32_t pos)
+ {
+ if (c->map) {
+ if ((pos > c->size) || (c->size - pos < len)) goto FORMAT;
+@@ -67,7 +67,7 @@
+ return -1;
+ }
+
+-static int match(struct cdb *c,char *key,unsigned int len,uint32 pos)
++static int match(struct cdb *c,char *key,unsigned int len,uint32_t pos)
+ {
+ char buf[32];
+ int n;
+@@ -87,8 +87,8 @@
+ int cdb_findnext(struct cdb *c,char *key,unsigned int len)
+ {
+ char buf[8];
+- uint32 pos;
+- uint32 u;
++ uint32_t pos;
++ uint32_t u;
+
+ if (!c->loop) {
+ u = cdb_hash(key,len);
+diff -Naur cdb-0.75-orig/cdbdump.c cdb-0.75/cdbdump.c
+--- cdb-0.75-orig/cdbdump.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdbdump.c 2009-01-16 19:46:17.000000000 +0100
+@@ -18,7 +18,7 @@
+ if (buffer_flush(buffer_1) == -1) die_write();
+ }
+
+-uint32 pos = 0;
++uint32_t pos = 0;
+
+ void get(char *buf,unsigned int len)
+ {
+@@ -37,7 +37,7 @@
+
+ char buf[512];
+
+-void copy(uint32 len)
++void copy(uint32_t len)
+ {
+ unsigned int x;
+
+@@ -50,7 +50,7 @@
+ }
+ }
+
+-void getnum(uint32 *num)
++void getnum(uint32_t *num)
+ {
+ get(buf,4);
+ uint32_unpack(buf,num);
+@@ -60,9 +60,9 @@
+
+ main()
+ {
+- uint32 eod;
+- uint32 klen;
+- uint32 dlen;
++ uint32_t eod;
++ uint32_t klen;
++ uint32_t dlen;
+
+ getnum(&eod);
+ while (pos < 2048) getnum(&dlen);
+diff -Naur cdb-0.75-orig/cdbget.c cdb-0.75/cdbget.c
+--- cdb-0.75-orig/cdbget.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdbget.c 2009-01-16 19:46:17.000000000 +0100
+@@ -27,8 +27,8 @@
+ {
+ char *key;
+ int r;
+- uint32 pos;
+- uint32 len;
++ uint32_t pos;
++ uint32_t len;
+ unsigned long u = 0;
+
+ if (!*argv) die_usage();
+diff -Naur cdb-0.75-orig/cdb.h cdb-0.75/cdb.h
+--- cdb-0.75-orig/cdb.h 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdb.h 2009-01-16 19:46:17.000000000 +0100
+@@ -6,26 +6,26 @@
+ #include "uint32.h"
+
+ #define CDB_HASHSTART 5381
+-extern uint32 cdb_hashadd(uint32,unsigned char);
+-extern uint32 cdb_hash(char *,unsigned int);
++extern uint32_t cdb_hashadd(uint32_t,unsigned char);
++extern uint32_t cdb_hash(char *,unsigned int);
+
+ struct cdb {
+ char *map; /* 0 if no map is available */
+ int fd;
+- uint32 size; /* initialized if map is nonzero */
+- uint32 loop; /* number of hash slots searched under this key */
+- uint32 khash; /* initialized if loop is nonzero */
+- uint32 kpos; /* initialized if loop is nonzero */
+- uint32 hpos; /* initialized if loop is nonzero */
+- uint32 hslots; /* initialized if loop is nonzero */
+- uint32 dpos; /* initialized if cdb_findnext() returns 1 */
+- uint32 dlen; /* initialized if cdb_findnext() returns 1 */
++ uint32_t size; /* initialized if map is nonzero */
++ uint32_t loop; /* number of hash slots searched under this key */
++ uint32_t khash; /* initialized if loop is nonzero */
++ uint32_t kpos; /* initialized if loop is nonzero */
++ uint32_t hpos; /* initialized if loop is nonzero */
++ uint32_t hslots; /* initialized if loop is nonzero */
++ uint32_t dpos; /* initialized if cdb_findnext() returns 1 */
++ uint32_t dlen; /* initialized if cdb_findnext() returns 1 */
+ } ;
+
+ extern void cdb_free(struct cdb *);
+ extern void cdb_init(struct cdb *,int fd);
+
+-extern int cdb_read(struct cdb *,char *,unsigned int,uint32);
++extern int cdb_read(struct cdb *,char *,unsigned int,uint32_t);
+
+ extern void cdb_findstart(struct cdb *);
+ extern int cdb_findnext(struct cdb *,char *,unsigned int);
+diff -Naur cdb-0.75-orig/cdb_hash.c cdb-0.75/cdb_hash.c
+--- cdb-0.75-orig/cdb_hash.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdb_hash.c 2009-01-16 19:46:17.000000000 +0100
+@@ -2,15 +2,15 @@
+
+ #include "cdb.h"
+
+-uint32 cdb_hashadd(uint32 h,unsigned char c)
++uint32_t cdb_hashadd(uint32_t h,unsigned char c)
+ {
+ h += (h << 5);
+ return h ^ c;
+ }
+
+-uint32 cdb_hash(char *buf,unsigned int len)
++uint32_t cdb_hash(char *buf,unsigned int len)
+ {
+- uint32 h;
++ uint32_t h;
+
+ h = CDB_HASHSTART;
+ while (len) {
+diff -Naur cdb-0.75-orig/cdb_make.c cdb-0.75/cdb_make.c
+--- cdb-0.75-orig/cdb_make.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdb_make.c 2009-01-16 19:51:05.000000000 +0100
+@@ -19,15 +19,15 @@
+ return seek_set(fd,c->pos);
+ }
+
+-static int posplus(struct cdb_make *c,uint32 len)
++static int posplus(struct cdb_make *c,uint32_t len)
+ {
+- uint32 newpos = c->pos + len;
++ uint32_t newpos = c->pos + len;
+ if (newpos < len) { errno = error_nomem; return -1; }
+ c->pos = newpos;
+ return 0;
+ }
+
+-int cdb_make_addend(struct cdb_make *c,unsigned int keylen,unsigned int datalen,uint32 h)
++int cdb_make_addend(struct cdb_make *c,unsigned int keylen,unsigned int datalen,uint32_t h)
+ {
+ struct cdb_hplist *head;
+
+@@ -74,11 +74,11 @@
+ {
+ char buf[8];
+ int i;
+- uint32 len;
+- uint32 u;
+- uint32 memsize;
+- uint32 count;
+- uint32 where;
++ uint32_t len;
++ uint32_t u;
++ uint32_t memsize;
++ uint32_t count;
++ uint32_t where;
+ struct cdb_hplist *x;
+ struct cdb_hp *hp;
+
+@@ -99,7 +99,7 @@
+ }
+
+ memsize += c->numentries; /* no overflow possible up to now */
+- u = (uint32) 0 - (uint32) 1;
++ u = UINT32_MAX;
+ u /= sizeof(struct cdb_hp);
+ if (memsize > u) { errno = error_nomem; return -1; }
+
+diff -Naur cdb-0.75-orig/cdbmake.c cdb-0.75/cdbmake.c
+--- cdb-0.75-orig/cdbmake.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdbmake.c 2009-01-16 19:46:17.000000000 +0100
+@@ -41,7 +41,7 @@
+ unsigned int klen;
+ unsigned int dlen;
+ unsigned int i;
+- uint32 h;
++ uint32_t h;
+ int fd;
+ char ch;
+
+diff -Naur cdb-0.75-orig/cdb_make.h cdb-0.75/cdb_make.h
+--- cdb-0.75-orig/cdb_make.h 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdb_make.h 2009-01-16 19:46:17.000000000 +0100
+@@ -8,7 +8,7 @@
+
+ #define CDB_HPLIST 1000
+
+-struct cdb_hp { uint32 h; uint32 p; } ;
++struct cdb_hp { uint32_t h; uint32_t p; } ;
+
+ struct cdb_hplist {
+ struct cdb_hp hp[CDB_HPLIST];
+@@ -19,20 +19,20 @@
+ struct cdb_make {
+ char bspace[8192];
+ char final[2048];
+- uint32 count[256];
+- uint32 start[256];
++ uint32_t count[256];
++ uint32_t start[256];
+ struct cdb_hplist *head;
+ struct cdb_hp *split; /* includes space for hash */
+ struct cdb_hp *hash;
+- uint32 numentries;
++ uint32_t numentries;
+ buffer b;
+- uint32 pos;
++ uint32_t pos;
+ int fd;
+ } ;
+
+ extern int cdb_make_start(struct cdb_make *,int);
+ extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int);
+-extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32);
++extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32_t);
+ extern int cdb_make_add(struct cdb_make *,char *,unsigned int,char *,unsigned int);
+ extern int cdb_make_finish(struct cdb_make *);
+
+diff -Naur cdb-0.75-orig/cdbstats.c cdb-0.75/cdbstats.c
+--- cdb-0.75-orig/cdbstats.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdbstats.c 2009-01-16 19:46:17.000000000 +0100
+@@ -28,7 +28,7 @@
+ if (buffer_flush(buffer_1small) == -1) die_write();
+ }
+
+-uint32 pos = 0;
++uint32_t pos = 0;
+
+ void get(char *buf,unsigned int len)
+ {
+@@ -43,7 +43,7 @@
+ }
+ }
+
+-void getnum(uint32 *num)
++void getnum(uint32_t *num)
+ {
+ char buf[4];
+ get(buf,4);
+@@ -70,9 +70,9 @@
+
+ main()
+ {
+- uint32 eod;
+- uint32 klen;
+- uint32 dlen;
++ uint32_t eod;
++ uint32_t klen;
++ uint32_t dlen;
+ seek_pos rest;
+ int r;
+
+diff -Naur cdb-0.75-orig/cdbtest.c cdb-0.75/cdbtest.c
+--- cdb-0.75-orig/cdbtest.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/cdbtest.c 2009-01-16 19:46:17.000000000 +0100
+@@ -24,7 +24,7 @@
+ if (buffer_flush(buffer_1small) == -1) die_write();
+ }
+
+-uint32 pos = 0;
++uint32_t pos = 0;
+
+ void get(char *buf,unsigned int len)
+ {
+@@ -40,7 +40,7 @@
+ }
+ }
+
+-void getnum(uint32 *num)
++void getnum(uint32_t *num)
+ {
+ char buf[4];
+ get(buf,4);
+@@ -68,9 +68,9 @@
+
+ main()
+ {
+- uint32 eod;
+- uint32 klen;
+- uint32 dlen;
++ uint32_t eod;
++ uint32_t klen;
++ uint32_t dlen;
+ seek_pos rest;
+ int r;
+
+diff -Naur cdb-0.75-orig/Makefile cdb-0.75/Makefile
+--- cdb-0.75-orig/Makefile 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/Makefile 2009-01-16 19:46:17.000000000 +0100
+@@ -298,13 +298,6 @@
+ uint32.h
+ ./compile testzero.c
+
+-uint32.h: \
+-tryulong32.c compile load uint32.h1 uint32.h2
+- ( ( ./compile tryulong32.c && ./load tryulong32 && \
+- ./tryulong32 ) >/dev/null 2>&1 \
+- && cat uint32.h2 || cat uint32.h1 ) > uint32.h
+- rm -f tryulong32.o tryulong32
+-
+ uint32_pack.o: \
+ compile uint32_pack.c uint32.h
+ ./compile uint32_pack.c
+diff -Naur cdb-0.75-orig/TARGETS cdb-0.75/TARGETS
+--- cdb-0.75-orig/TARGETS 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/TARGETS 2009-01-16 19:52:06.000000000 +0100
+@@ -1,6 +1,5 @@
+ load
+ compile
+-uint32.h
+ cdbget.o
+ systype
+ makelib
+diff -Naur cdb-0.75-orig/uint32.h cdb-0.75/uint32.h
+--- cdb-0.75-orig/uint32.h 1970-01-01 01:00:00.000000000 +0100
++++ cdb-0.75/uint32.h 2009-01-16 19:46:17.000000000 +0100
+@@ -0,0 +1,11 @@
++#ifndef UINT32_H
++#define UINT32_H
++
++#include <stdint.h>
++
++extern void uint32_pack(char *,uint32_t);
++extern void uint32_pack_big(char *,uint32_t);
++extern void uint32_unpack(char *,uint32_t *);
++extern void uint32_unpack_big(char *,uint32_t *);
++
++#endif
+diff -Naur cdb-0.75-orig/uint32.h1 cdb-0.75/uint32.h1
+--- cdb-0.75-orig/uint32.h1 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/uint32.h1 1970-01-01 01:00:00.000000000 +0100
+@@ -1,11 +0,0 @@
+-#ifndef UINT32_H
+-#define UINT32_H
+-
+-typedef unsigned int uint32;
+-
+-extern void uint32_pack(char *,uint32);
+-extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(char *,uint32 *);
+-extern void uint32_unpack_big(char *,uint32 *);
+-
+-#endif
+diff -Naur cdb-0.75-orig/uint32.h2 cdb-0.75/uint32.h2
+--- cdb-0.75-orig/uint32.h2 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/uint32.h2 1970-01-01 01:00:00.000000000 +0100
+@@ -1,11 +0,0 @@
+-#ifndef UINT32_H
+-#define UINT32_H
+-
+-typedef unsigned long uint32;
+-
+-extern void uint32_pack(char *,uint32);
+-extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(char *,uint32 *);
+-extern void uint32_unpack_big(char *,uint32 *);
+-
+-#endif
+diff -Naur cdb-0.75-orig/uint32_pack.c cdb-0.75/uint32_pack.c
+--- cdb-0.75-orig/uint32_pack.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/uint32_pack.c 2009-01-16 19:46:17.000000000 +0100
+@@ -1,6 +1,6 @@
+ #include "uint32.h"
+
+-void uint32_pack(char s[4],uint32 u)
++void uint32_pack(char s[4],uint32_t u)
+ {
+ s[0] = u & 255;
+ u >>= 8;
+@@ -10,7 +10,7 @@
+ s[3] = u >> 8;
+ }
+
+-void uint32_pack_big(char s[4],uint32 u)
++void uint32_pack_big(char s[4],uint32_t u)
+ {
+ s[3] = u & 255;
+ u >>= 8;
+diff -Naur cdb-0.75-orig/uint32_unpack.c cdb-0.75/uint32_unpack.c
+--- cdb-0.75-orig/uint32_unpack.c 2009-01-16 19:38:41.000000000 +0100
++++ cdb-0.75/uint32_unpack.c 2009-01-16 19:46:17.000000000 +0100
+@@ -1,8 +1,8 @@
+ #include "uint32.h"
+
+-void uint32_unpack(char s[4],uint32 *u)
++void uint32_unpack(char s[4],uint32_t *u)
+ {
+- uint32 result;
++ uint32_t result;
+
+ result = (unsigned char) s[3];
+ result <<= 8;
+@@ -15,9 +15,9 @@
+ *u = result;
+ }
+
+-void uint32_unpack_big(char s[4],uint32 *u)
++void uint32_unpack_big(char s[4],uint32_t *u)
+ {
+- uint32 result;
++ uint32_t result;
+
+ result = (unsigned char) s[0];
+ result <<= 8;
diff --git a/dev-db/cdb/metadata.xml b/dev-db/cdb/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/cdb/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/cockroach/Manifest b/dev-db/cockroach/Manifest
new file mode 100644
index 000000000000..aec3d99b4f88
--- /dev/null
+++ b/dev-db/cockroach/Manifest
@@ -0,0 +1,16 @@
+AUX cockroach-limits.conf 136 SHA256 a237b61426c43735d44e7da85a19d34a46f95e70185dd3a3447302b85b7c252f SHA512 c8c68263967f0d25eaf29dc3023046edeaf9e36f23f6f296d7e1dd7b2126a0b4f431af60e34fcb5c075855260f19d7ffc0516d6ef68ff852b3c95a2632cdd6ae WHIRLPOOL 4ee01e79cffa35e3ed4d2724eed9c232701aa3a714ccaebd76f3e221101845534b57374dfcf361ded633a3e1f0ccf50a83c02bddd24108157ad74faf8fcef7a1
+AUX cockroach.confd 521 SHA256 0ed6f58c92ce5f73b10cea42821cc2e8272ec7e3d310c68ac668a002ba483603 SHA512 81efbc65e1e6dbcc4f98ab0f9ca201c9dd299140ee31cc04bfab82c7d33215a69cad15b3c190c23eb0e4a11b9050bc588b5d1097630bf2ebee4f3f14d53f3183 WHIRLPOOL f8b806370069c1d25c3b3204332924abc324d63c730395b6a0f86dc1d2d1afe7d8e29c9a3348a03d21f9df74dccf8356775a827ef4c710ceeced6c1b90840f35
+AUX cockroach.confd-1.0 1324 SHA256 cc03748d00c038bc5c509c61038fe207adf1dc53f9f9a48be528a27496321f3d SHA512 538042bb5484acfdb31c5a750be73d5e6efeb03a3b243d5bc204db9266a7b02daf7ea9d4687fd3a5223dc6d493a1672c1b581e4527599cb3e7c31e11ec2742fd WHIRLPOOL 8394f832670a97cfa0b44d7cc5c20afb14bbef1a09a166eecf39ef05c765f8b46e7cfec5091230332cf7b38ceec2d3932f04c5e86ded32557d57ee1f58107232
+AUX cockroach.initd 542 SHA256 dbd006aca5decf34579d02c9d67637738679899ca9cb1a9bd6133628b6fb2d3d SHA512 86684b238413812b6787bf0841dc34302f80b9ad2c25a47a349100503b37f61ec8851870c29bb4fe697216443a39ad5e2decbcedea90664adb3b7316c440e345 WHIRLPOOL b339f1cee7e597e8f162d14515adc2038ce2b445a398186afa1cc1dce5800025a81b93dce48a19e8d0ed5bdfd3e1964d4e9b44259218e5549e9995c53f258a33
+AUX cockroach.initd-1.0 1676 SHA256 de2403cbcc4d5bf608b2dbea71c560b44f8e85c3a4ab0bbfae2f82af68dcab34 SHA512 5f0b6ade2b25372cfc7d810d9dbe10e9732e79527c0ad73eec0cdbbad894a773bfd4aaffb958d3c0e0e7ecb636a07214be494cfdd5e69f4faacc30849f7e3eb9 WHIRLPOOL 29aef55e02d3e12e9edbfbd336264a1a458c962b66a4d77752d51175e38e172de16bfcdeb02d14ca9d014fb6bad588ff6b2af032695ea6269fd9c582c9b62cd7
+AUX cockroach.initd-1.0.1 1820 SHA256 3accf29051f04fcc4febf416d40a7ee985760f44c3a8ae21cef29a57e9c11f1f SHA512 df0c06bb6ee97c3f531250486ca1fe3d2333c1e280e2d0acb24c9aa061bd6ba35358504e29bf934a382e0a677c812e6dd474e78fcab1cd5188e93e8082748e04 WHIRLPOOL 2e0b7810db9d549c63cf894c0929432378291a2e673ca4e255bac7c12a13339ad174dce999103818580467c7efd0b1de1e93eb4d974b520606fb438ad2fbdb0a
+DIST cockroach-v1.0-rc.1.src.tgz 68784067 SHA256 162e3954ff41515bf2ab2017ab38f9cdf76775d7d67fdeead343234d470dca6c SHA512 c68fc712068cbfce167d98008cdcb46270a8fa772624281da23a70d0492c7990c9ce8513334fedc31d7dde5176087fa6211a4e90d77741ed0079f9568c71e0ff WHIRLPOOL 510dbefb6348f9707e1e3fcd94d873911350b8d2d767c093df3bfff514e7f72ca1ff1e16d0539c48f80dd53a725d8ab4f3fe901862ee88a4e5e1e9999034eeaf
+DIST cockroach-v1.0.1.src.tgz 69116931 SHA256 35c0b9e7e0330822f35c17339ecd635153274ae47e56a110a710e788cdb1b1c9 SHA512 d388d84c09f1318420f859c964c46b78e5237685fbc2b1a8d55fad2ce1dabc89461ad5eaa6d95283dda4551542f33e5df2feda4afd7129e1f850e469e0d17e69 WHIRLPOOL 82dba367bbc09ead8cb2480fb4cbe38e95571abe76d99a1c60628b0a15c4166ef414ed74899fe55912e3c287859d8b1786c58d60ec648683bb32930c90fbbd08
+DIST cockroach-v1.0.3.src.tgz 69127502 SHA256 80e9f3858dc0fd3e0cf08540b3f9a3e3f0fcefd8bc66bfc14e716de36be25765 SHA512 2bae99faba0f56774ab964d920f8628afc6af61ce53bc3e99f1b360c0606e0777b90dd93cbd6844109c3224867fc4180fb42e6dacc75e4eb4db8a4f93f586577 WHIRLPOOL 58f8b117b8fc1b052b43652507861aa0c18cced7c88393c7a5d2c860683070fdd2b61b5050fc11bd07316c4d400c80ca1fb4a05594a5e5c15a88ec1833f5671d
+DIST cockroach-v1.0.src.tgz 68753479 SHA256 ca87b10eec688195e0df4f85431b019f2980ae4b511ee321f91f945315efeb76 SHA512 d74ad9546908535f9a7ad4172a04a5f86f5ed22698bbb005aec7478a52632e0497a966b859fd68b40894eb7ee68bfa80dc4188d198f2f23725b9cadd50a55191 WHIRLPOOL c6011b09c2b20757ae5e3268cf050748a3856ec1fe1d86755e773390c97ebdb8494db3d51119298a797689bcc201bc20bf4bc8b5bdebff44d7598265c9379b93
+EBUILD cockroach-1.0-r1.ebuild 1703 SHA256 3c469f2de14d78dcd97e3cb7f5165cf00c7822379f2e28f59158ddbec7e07930 SHA512 f9d54c7b9395e8ef6552211535641b9241df50d922f6c2e8c74c1782538ea25953c8c15fd89bf6ab17c6264b75bcfd23b5fd27ea9b4054f6579a2753b81c9eb3 WHIRLPOOL 625f420833cb893c7a2932d6b38681ee4401e5a46a253ac29c00ea5c028560e44046ae231ab2a2346a1734099e225a998ae72e4ac06f64fc907479ffc65f6751
+EBUILD cockroach-1.0.1.ebuild 1701 SHA256 965d0b06f2cba95e5c7c80976b57634e4bd9376318af69251338671846d6395f SHA512 61ded57cbd28008a27b3b8a2e048a89a70be76317d350c29554ac0450de8932c275aedb63f6d032997013abb63b8a29aff4dae107bccf7876d7afe7ed14149df WHIRLPOOL 8d737e7c55dc27f2dbc1e0535240192b27f817b8f9eb449d7787cb158527382503ea38c5672b1820a191314f376571c89e6b89ac5540c7c61b73c3020db71628
+EBUILD cockroach-1.0.3.ebuild 1701 SHA256 fbf4948d7c56b724efd1afb0626d4fb89457af298e9c365480944501e73c03a2 SHA512 b1a0a2adb8555a227bdb9caff6a91efba4c010a82372b5ad446ab2feb9b68a98456b5b60c14513e5aeebae290a56fd936a8c17194821d12f2b910e8e0f3d1979 WHIRLPOOL 9ba79350953543cb305f19226c965128f3a20bbdc5db74f8b50c596de0e60dbda29b20565af1a8ae39a52ec750404dcc506003a99fc20c64130c419ed8af4dc3
+EBUILD cockroach-1.0.ebuild 1689 SHA256 73936d87d3dde1f06d265b797546a2306cb507929420b7c61e2f9a6c8e6d3e89 SHA512 66a6c94d7804cdb62eaa66083961d40b2e2fb8d4bde08a084fedf4b57ac67eadb28d97dfd0087b3e5cefd6ab9d1ddf4ec7a05b5e7413d803a5cfbcc2ba0a733b WHIRLPOOL 8dfef06a94e835ada80f81242cdc043dbb4799bd34707b7d5457d0cebc1187126e30d7e778c729d8608b224f607c5202598a3fd775f3acae45f1528da45f76f2
+EBUILD cockroach-1.0_rc1.ebuild 1593 SHA256 80b34d34c9a1298ea6193baa93a79c1c033c47facfd5aa7cc41cac9ac2721475 SHA512 6f273468fd5b869144d474027dd644a9031c18f1b18525c89775c9d8eacdeb59d64b195216189ebe6a2251973abc500b2f3047fc88af7d97aa9798c0db8fa16a WHIRLPOOL 75ff19fec6663afcf9bc9523df6255b07307a982545cb2c524fa3a299f78d04d00b30e3a22a368ed10907223e12b32900747b1260a901610e1a229a53fbcaadf
+MISC metadata.xml 409 SHA256 f5bafcf3d9325295524b3de69c6737a2cc2d0b0a41a4cf1c004636f18ef4f622 SHA512 e4494324632e55e32fdfe7c1d1b25301b8f7cff3f7475efaf7c6c59d435777eab7245bb200b39b90121babce4e1573038fb0f42e586854a820e1489c1afddd19 WHIRLPOOL b2c63749fa2337bdcdaed4e6e2aac84b689b830c72a1311251d154f7d1a33c077ccc1a4769a9828cbbf56eaa888d39acb9669cd0891c5d3292c32f9927d589e8
diff --git a/dev-db/cockroach/cockroach-1.0-r1.ebuild b/dev-db/cockroach/cockroach-1.0-r1.ebuild
new file mode 100644
index 000000000000..4b19589a461b
--- /dev/null
+++ b/dev-db/cockroach/cockroach-1.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PV=v${PV}
+CHECKREQS_MEMORY="2G"
+
+inherit check-reqs toolchain-funcs user
+
+DESCRIPTION="open source database for building cloud services"
+HOMEPAGE="https://www.cockroachlabs.com"
+SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
+
+LICENSE="Cockroach Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=app-arch/xz-utils-5.2.3
+ >=dev-lang/go-1.8.1
+ >=dev-util/cmake-3.8.1"
+
+S="${WORKDIR}/cockroach-${MY_PV}"
+
+pkg_pretend() {
+ check-reqs_pkg_pretend
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
+ eerror "Cockroach cannot be built with this version of gcc."
+ eerror "You need at least gcc-6.0"
+ die "Your C compiler is too old for this package."
+ fi
+}
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ enewgroup cockroach
+ enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
+}
+
+src_compile() {
+ emake GOPATH="${S}" build
+}
+
+src_install() {
+ dobin src/github.com/cockroachdb/cockroach/cockroach
+insinto /etc/security/limits.d
+newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
+newconfd "${FILESDIR}"/cockroach.confd-${PV} cockroach
+newinitd "${FILESDIR}"/cockroach.initd-${PV} cockroach
+dodir /var/log/cockroach
+fowners cockroach:cockroach /var/log/cockroach
+if [[ -z ${REPLACING_VERSIONS} ]]; then
+ ewarn "The default setup is for the first node of an insecure"
+ ewarn "cluster that only listens on localhost."
+ ewarn "Please read the cockroach manual at the following url"
+ ewarn "and configure /etc/conf.d/cockroach correctly if you"
+ ewarn "plan to use it in production."
+ ewarn
+ ewarn "http://cockroachlabs.com/docs"
+ fi
+}
diff --git a/dev-db/cockroach/cockroach-1.0.1.ebuild b/dev-db/cockroach/cockroach-1.0.1.ebuild
new file mode 100644
index 000000000000..212bede14658
--- /dev/null
+++ b/dev-db/cockroach/cockroach-1.0.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PV=v${PV}
+CHECKREQS_MEMORY="2G"
+
+inherit check-reqs toolchain-funcs user
+
+DESCRIPTION="open source database for building cloud services"
+HOMEPAGE="https://www.cockroachlabs.com"
+SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
+
+LICENSE="Cockroach Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=app-arch/xz-utils-5.2.3
+ >=dev-lang/go-1.8.1
+ >=dev-util/cmake-3.8.1"
+
+S="${WORKDIR}/cockroach-${MY_PV}"
+
+pkg_pretend() {
+ check-reqs_pkg_pretend
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
+ eerror "Cockroach cannot be built with this version of gcc."
+ eerror "You need at least gcc-6.0"
+ die "Your C compiler is too old for this package."
+ fi
+}
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ enewgroup cockroach
+ enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
+}
+
+src_compile() {
+ emake GOPATH="${S}" build
+}
+
+src_install() {
+ dobin src/github.com/cockroachdb/cockroach/cockroach
+insinto /etc/security/limits.d
+newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
+newconfd "${FILESDIR}"/cockroach.confd-1.0 cockroach
+newinitd "${FILESDIR}"/cockroach.initd-${PV} cockroach
+dodir /var/log/cockroach
+fowners cockroach:cockroach /var/log/cockroach
+if [[ -z ${REPLACING_VERSIONS} ]]; then
+ ewarn "The default setup is for the first node of an insecure"
+ ewarn "cluster that only listens on localhost."
+ ewarn "Please read the cockroach manual at the following url"
+ ewarn "and configure /etc/conf.d/cockroach correctly if you"
+ ewarn "plan to use it in production."
+ ewarn
+ ewarn "http://cockroachlabs.com/docs"
+ fi
+}
diff --git a/dev-db/cockroach/cockroach-1.0.3.ebuild b/dev-db/cockroach/cockroach-1.0.3.ebuild
new file mode 100644
index 000000000000..0b0e1d9f89d0
--- /dev/null
+++ b/dev-db/cockroach/cockroach-1.0.3.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PV=v${PV}
+CHECKREQS_MEMORY="2G"
+
+inherit check-reqs toolchain-funcs user
+
+DESCRIPTION="open source database for building cloud services"
+HOMEPAGE="https://www.cockroachlabs.com"
+SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
+
+LICENSE="Cockroach Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=app-arch/xz-utils-5.2.3
+ >=dev-lang/go-1.8.3
+ >=dev-util/cmake-3.8.1"
+
+S="${WORKDIR}/cockroach-${MY_PV}"
+
+pkg_pretend() {
+ check-reqs_pkg_pretend
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
+ eerror "Cockroach cannot be built with this version of gcc."
+ eerror "You need at least gcc-6.0"
+ die "Your C compiler is too old for this package."
+ fi
+}
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ enewgroup cockroach
+ enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
+}
+
+src_compile() {
+ emake GOPATH="${S}" build
+}
+
+src_install() {
+ dobin src/github.com/cockroachdb/cockroach/cockroach
+insinto /etc/security/limits.d
+newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
+newconfd "${FILESDIR}"/cockroach.confd-1.0 cockroach
+newinitd "${FILESDIR}"/cockroach.initd-1.0.1 cockroach
+dodir /var/log/cockroach
+fowners cockroach:cockroach /var/log/cockroach
+if [[ -z ${REPLACING_VERSIONS} ]]; then
+ ewarn "The default setup is for the first node of an insecure"
+ ewarn "cluster that only listens on localhost."
+ ewarn "Please read the cockroach manual at the following url"
+ ewarn "and configure /etc/conf.d/cockroach correctly if you"
+ ewarn "plan to use it in production."
+ ewarn
+ ewarn "http://cockroachlabs.com/docs"
+ fi
+}
diff --git a/dev-db/cockroach/cockroach-1.0.ebuild b/dev-db/cockroach/cockroach-1.0.ebuild
new file mode 100644
index 000000000000..c7253935686f
--- /dev/null
+++ b/dev-db/cockroach/cockroach-1.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PV=v${PV}
+CHECKREQS_MEMORY="2G"
+
+inherit check-reqs toolchain-funcs user
+
+DESCRIPTION="open source database for building cloud services"
+HOMEPAGE="https://www.cockroachlabs.com"
+SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
+
+LICENSE="Cockroach Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=app-arch/xz-utils-5.2.3
+ >=dev-lang/go-1.8.1
+ >=dev-util/cmake-3.8.1"
+
+S="${WORKDIR}/cockroach-${MY_PV}"
+
+pkg_pretend() {
+ check-reqs_pkg_pretend
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
+ eerror "Cockroach cannot be built with this version of gcc."
+ eerror "You need at least gcc-6.0"
+ die "Your C compiler is too old for this package."
+ fi
+}
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ enewgroup cockroach
+ enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
+}
+
+src_compile() {
+ emake GOPATH="${S}" build
+}
+
+src_install() {
+ dobin src/github.com/cockroachdb/cockroach/cockroach
+insinto /etc/security/limits.d
+newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
+newconfd "${FILESDIR}"/cockroach.confd cockroach
+newinitd "${FILESDIR}"/cockroach.initd cockroach
+dodir /var/log/cockroach
+fowners cockroach:cockroach /var/log/cockroach
+if [[ -z ${REPLACING_VERSIONS} ]]; then
+ ewarn "The default setup is for the first node of an insecure"
+ ewarn "cluster that only listens on localhost."
+ ewarn "Please read the cockroach manual at the following url"
+ ewarn "and configure /etc/conf.d/cockroach correctly if you"
+ ewarn "plan to use it in production."
+ elog
+ elog "http://cockroachlabs.com/docs"
+ fi
+}
diff --git a/dev-db/cockroach/cockroach-1.0_rc1.ebuild b/dev-db/cockroach/cockroach-1.0_rc1.ebuild
new file mode 100644
index 000000000000..7ce069fb3180
--- /dev/null
+++ b/dev-db/cockroach/cockroach-1.0_rc1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PV=v1.0-rc.1
+CHECKREQS_MEMORY="2G"
+
+inherit check-reqs toolchain-funcs user
+
+DESCRIPTION="open source database for building cloud services"
+HOMEPAGE="https://www.cockroachlabs.com"
+SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
+
+LICENSE="Cockroach Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=dev-lang/go-1.8.1"
+
+S="${WORKDIR}/cockroach-${MY_PV}"
+
+pkg_pretend() {
+ check-reqs_pkg_pretend
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
+ eerror "Cockroach cannot be built with this version of gcc."
+ eerror "You need at least gcc-6.0"
+ die "Your C compiler is too old for this package."
+ fi
+}
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ enewgroup cockroach
+ enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
+}
+
+src_compile() {
+ emake GOPATH="${S}" build || die
+}
+
+src_install() {
+ emake GOPATH="${S}" install || die
+dobin bin/*
+insinto /etc/security/limits.d
+newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
+newinitd "${FILESDIR}"/cockroach.initd cockroach
+dodir /var/log/cockroach
+fowners cockroach:cockroach /var/log/cockroach
+if [[ -z ${REPLACING_VERSIONS} ]]; then
+ ewarn "The default setup is for the first node of an insecure"
+ ewarn "cluster that only listens on localhost."
+ ewarn "Please read the cockroach manual at the following url"
+ ewarn "and configure /etc/conf.d/cockroach correctly if you"
+ ewarn "plan to use it in production."
+ elog
+ elog "http://cockroachlabs.com/docs"
+ fi
+}
diff --git a/dev-db/cockroach/files/cockroach-limits.conf b/dev-db/cockroach/files/cockroach-limits.conf
new file mode 100644
index 000000000000..2014a5d508cb
--- /dev/null
+++ b/dev-db/cockroach/files/cockroach-limits.conf
@@ -0,0 +1,4 @@
+# This is needed because cockroach can open a high number of file
+# descriptors
+cockroach soft nofile 35000
+cockroach hard nofile 35000
diff --git a/dev-db/cockroach/files/cockroach.confd b/dev-db/cockroach/files/cockroach.confd
new file mode 100644
index 000000000000..37593e217c71
--- /dev/null
+++ b/dev-db/cockroach/files/cockroach.confd
@@ -0,0 +1,14 @@
+# The default setup is for the first node of an insecure cluster that only
+# listens on localhost.
+# Please read the cockroach manual at the following url and configure
+# the start_args and stop_args correctly if you plan to use cockroach in
+# production.
+#
+# http://cockroachlabs.com/docs
+#
+# arguments to use when starting the database
+start_args="--http-host=localhost --host=localhost --insecure
+--store=/var/lib/cockroach/data"
+#
+# arguments to use when stopping the database
+stop_args="--host localhost --insecure"
diff --git a/dev-db/cockroach/files/cockroach.confd-1.0 b/dev-db/cockroach/files/cockroach.confd-1.0
new file mode 100644
index 000000000000..7874cc1cab23
--- /dev/null
+++ b/dev-db/cockroach/files/cockroach.confd-1.0
@@ -0,0 +1,45 @@
+# The default setup is for the first node of an insecure cluster that only
+# listens on localhost.
+#
+# Please read the cockroach manual at the following url and configure
+# this file correctly if you plan to use cockroach in production.
+#
+# http://cockroachlabs.com/docs
+#
+#For more information about what the arguments mean, run
+#"cockroach start --help" or "cockroach quit --help".
+#
+#These values are passed to the appropriate arguments when starting or
+#stopping the cockroach database.
+#Leaving these commented accepts the cockroach defaults with the
+#exceptions of host, http_host, insecure and log_path.
+#
+#The default for host and http_host is localhost instead of the catch-all
+#address. If you want to use the catch-all address for either of these,
+#please use
+# "all" for the setting. #
+#
+# The default for insecure is yes which passes the --insecure argument to
+# cockroach. If you want a secure connection, set insecure=no and set
+# certs_path to the location of your certificates.
+#
+#log_path defaults to /var/log/${RC_SVCNAME}.
+#
+#attrs=""
+#cache=""
+#certs_path=""
+#host=""
+#http_host=""
+#http_port=""
+#insecure=""
+#join=""
+#locality=""
+#log_path=""
+#port=""
+#store=""
+#
+# extra arguments to use when starting the database
+# start_args=""
+#
+# extra arguments to use when stopping the database
+# stop_args=""
diff --git a/dev-db/cockroach/files/cockroach.initd b/dev-db/cockroach/files/cockroach.initd
new file mode 100644
index 000000000000..3629cb6605fa
--- /dev/null
+++ b/dev-db/cockroach/files/cockroach.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/cockroach"
+pidfile=/run/cockroach/cockroach.pid
+command_args="start --background --log-dir=/var/log/cockroach
+ --pid-file=\"${pidfile}\" ${start_args}"
+start_stop_daemon_args="--quiet --user cockroach"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o cockroach:cockroach $(dirname ${pidfile})
+}
+
+stop() {
+ebegin "bringing down ${RC_SVCNAME}"
+"${command}" quit ${stop_args}
+eend $?
+}
diff --git a/dev-db/cockroach/files/cockroach.initd-1.0 b/dev-db/cockroach/files/cockroach.initd-1.0
new file mode 100644
index 000000000000..b2b4f6a0884f
--- /dev/null
+++ b/dev-db/cockroach/files/cockroach.initd-1.0
@@ -0,0 +1,60 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/bin/cockroach
+pidfile=/run/${RC_SVCNAME}/cockroach.pid
+start_stop_daemon_args="--quiet --user cockroach"
+[ -n "${attrs}" ] && attrs_arg="--attrs=${attrs}"
+[ -n "${cache}" ] && cache_arg="--cache=${cache}"
+[ -n "${certs_path}" ] && certs_dir_arg="--certs-dir=${certs_path}"
+[ "${host}" != all ] && host_arg="--host=${host:-localhost}"
+[ "$http_host" != all ] && http_host_arg="--http-host=${http_host:-localhost}"
+[ -n "${http_port}" ] && http_port_arg="--http-port=${http_port}"
+yesno "${insecure:-yes}" && insecure_arg="--insecure"
+[ -n "${join}" ] && join_arg="--join=${join}"
+[ -n "${locality}" ] && locality_arg="--locality=\"${locality}\""
+log_path="${log_path:-/var/log/${RC_SVCNAME}}"
+[ -n "${log_path}" ] && log_dir_arg="--log-dir=${log_path}"
+ pidfile_arg="--pid-file=${pidfile}"
+[ -n "${port}" ] && port_arg="--port=${port}"
+store_arg="--store=${store:-/var/lib/cockroach/data}"
+command_args="start --background
+ ${attrs_arg}
+ ${cache_arg}
+ ${certs_dir_arg}
+ ${host_arg}
+ ${http_host_arg}
+ ${http_port_arg}
+ ${insecure_arg}
+ ${join_arg}
+ ${locality_arg}
+ ${log_dir_arg}
+ ${pidfile_arg}
+ ${port_arg}
+ ${store_arg}
+ ${start_args}"
+quit_args="
+ ${certs_dir_arg}
+ ${host_arg}
+ ${insecure_arg}
+ ${port_arg}
+ "
+
+depend() {
+ use net
+}
+
+start_pre() {
+ if [ -n "${log_path}" ]; then
+ checkpath -d -m 0755 -o cockroach:cockroach "${log_path}" ||
+ return 1
+ fi
+ checkpath -d -m 0755 -o cockroach:cockroach "$(dirname ${pidfile})"
+}
+
+stop() {
+ebegin "bringing down ${RC_SVCNAME}"
+eval ${command} quit ${quit_args} ${stop_args}
+eend $?
+}
diff --git a/dev-db/cockroach/files/cockroach.initd-1.0.1 b/dev-db/cockroach/files/cockroach.initd-1.0.1
new file mode 100644
index 000000000000..252fc6bf7bb8
--- /dev/null
+++ b/dev-db/cockroach/files/cockroach.initd-1.0.1
@@ -0,0 +1,70 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/bin/cockroach
+pidfile=/run/${RC_SVCNAME}/cockroach.pid
+start_stop_daemon_args="--quiet --user cockroach"
+[ -n "${attrs}" ] && attrs_arg="--attrs=${attrs}"
+[ -n "${cache}" ] && cache_arg="--cache=${cache}"
+[ -n "${certs_path}" ] && certs_dir_arg="--certs-dir=${certs_path}"
+[ "${host}" != all ] && host_arg="--host=${host:-localhost}"
+[ "$http_host" != all ] && http_host_arg="--http-host=${http_host:-localhost}"
+[ -n "${http_port}" ] && http_port_arg="--http-port=${http_port}"
+yesno "${insecure:-yes}" && insecure_arg="--insecure"
+[ -n "${join}" ] && join_arg="--join=${join}"
+[ -n "${locality}" ] && locality_arg="--locality=\"${locality}\""
+log_path="${log_path:-/var/log/${RC_SVCNAME}}"
+[ -n "${log_path}" ] && log_dir_arg="--log-dir=${log_path}"
+ pidfile_arg="--pid-file=${pidfile}"
+[ -n "${port}" ] && port_arg="--port=${port}"
+store_arg="--store=${store:-/var/lib/cockroach/data}"
+command_args="start --background
+ ${attrs_arg}
+ ${cache_arg}
+ ${certs_dir_arg}
+ ${host_arg}
+ ${http_host_arg}
+ ${http_port_arg}
+ ${insecure_arg}
+ ${join_arg}
+ ${locality_arg}
+ ${log_dir_arg}
+ ${pidfile_arg}
+ ${port_arg}
+ ${store_arg}
+ ${start_args}"
+quit_args="
+ ${certs_dir_arg}
+ ${host_arg}
+ ${insecure_arg}
+ ${port_arg}
+ "
+
+depend() {
+ use net
+}
+
+start_pre() {
+ if [ -n "${log_path}" ]; then
+ checkpath -d -m 0755 -o cockroach:cockroach "${log_path}" ||
+ return 1
+ fi
+ checkpath -d -m 0755 -o cockroach:cockroach "$(dirname ${pidfile})"
+}
+
+stop() {
+ebegin "bringing down ${RC_SVCNAME}"
+eval ${command} quit ${quit_args} ${stop_args}
+eend $?
+}
+
+stop_post() {
+ local cr_pid
+ read -r cr_pid < "${pidfile}"
+ while [ -d /proc/"${cr_pid}" ]; do
+ sleep 1
+ done
+ rm -f "${pidfile}"
+ return 0
+}
diff --git a/dev-db/cockroach/metadata.xml b/dev-db/cockroach/metadata.xml
new file mode 100644
index 000000000000..b02140041af5
--- /dev/null
+++ b/dev-db/cockroach/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+ </maintainer>
+ <longdescription lang="en">
+ CockroachDB is an open source database for building global, scalable
+ cloud services that survive disasters.
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-db/couchdb/Manifest b/dev-db/couchdb/Manifest
new file mode 100644
index 000000000000..88d0c2acfd02
--- /dev/null
+++ b/dev-db/couchdb/Manifest
@@ -0,0 +1,10 @@
+AUX 1.6.1-erlang-18.patch 4121 SHA256 2b8cccf4d6b42f4cbc1d6809f4ce183aec751eeece0e5860fa003fafcc391be2 SHA512 fef596e46b729f69caac56b11e77b577e7985eed2f60c48011cc68726622d70bbb27a84f4d6874682327f47a85b63c1090e534907b944ed172fda6d4d4364b73 WHIRLPOOL aba1c1fa6230ac93bceb19f9f922a17ce74d81905e3d7d5aa4177d413dd501052c62b2282b7ac83bb92bec9d3832a9dedbfacb33ee5ced4a6cd01778af19e5e7
+AUX 1.6.1-erlang-19.patch 4270 SHA256 659484e060929bd51e6fc305cb83bef1c2e5d1860f3f078a14f4fbb0a7be89c9 SHA512 abc3e0162ca80e2f1784e47d15c23bd134efcf4b8e1ebf01d7c853215971ce03dfab86597671142c05c44a4fd6748ab9daa29a11fff23435831a89cbebb82099 WHIRLPOOL 1d33d182a6c60d94ada6a6f19e5d0fd6e850a32521186253010b1597ba673a3c4ac1e1e6b54b096db71af0c71a83998bb3d9fb6698167347c56f4c8de575379e
+AUX couchdb.conf-2 234 SHA256 056042951c9314feab924d707bf347b2ef265f10e90bec847315d9c0156f700a SHA512 5c40927957362a7431be6980be3a239e4ee0ca47d28f1b4d4fb3014b307e459eb429f5b50e0c8aa58b3e9f2285371616a58f06207e272feae1bed33f8c32d836 WHIRLPOOL 694a6ad4d948a56903ea8c628506325bcac181b827c8000aad1032014668da19d571ecee6f37bc1ecaec06c7783ea2918685aa107ff3786f5909cfbf3356fd5c
+AUX couchdb.init-4 439 SHA256 ae1b5551ce432ca85a99e3a93355204936b4dff99dc0cdba5e19d44b87946f76 SHA512 a1e0a9403082e1c336454584d78d15e5d76861b3b3d0e56fcfb25ab50c0dbbdcf658e251e25f22e2a58dc72f38ec16ce82759bf9c7b5330a569ffb5fab912999 WHIRLPOOL 8ebe4af5892ea2b8ef4e00d273ce3a0612de281907327a2b3191a30822077fb0470b6a0af39cea6806d59da25d19b517db678aaead514ad9b46a22c8d2110922
+DIST apache-couchdb-1.6.1.tar.gz 12085350 SHA256 5a601b173733ce3ed31b654805c793aa907131cd70b06d03825f169aa48c8627 SHA512 70630a27dec7281fa5bdca0601796baa28fba1d7c9975d8f38b9623bbeedd62b26081118357886c7be00b7769360238b2c99695234e13cecb15a210eb986eadc WHIRLPOOL 5776fe139db54e5ec285ef9882f5164a42a499bab312d66c0edd5314dd1915827a7cf7df02cd5df85c437bf3f70096cb101748956d639e8e80ffd0bb0b79197a
+EBUILD couchdb-1.6.1-r2.ebuild 1876 SHA256 c5edae443bb4025460844b845ab3aac1b70be4b2a4c1ad294c69f2f0d64798e2 SHA512 32ca749588b62e0cdb954e6fcf8753558ea754429b6cc330c8d2503d15f829cfa5d78922981447eb665335edb90bef6bffccf2f740ff7bfb438001abea63499d WHIRLPOOL 263970ac0b11cdc953ce249fe7ea75ff6e17777da5f8ed1d42a9d9c45d13b99736fe3373c62feabfccb7f235c91d292e51e5005b90dc50a47650196a6740efa1
+EBUILD couchdb-1.6.1-r3.ebuild 1921 SHA256 09b0f5d12a73094dfd06f6d10c87cb7a40957a5411431130b916578ef05ed009 SHA512 f48dc14ef8fdacc2d904d98d7b5f9cc24d00ae77858eedcbe32d8f8fc254b8c5ee4f996d097c67914c8fcf5749ac0877ec8af25a047a80359f2dccb5a5bd5b9f WHIRLPOOL d281422ae6f548f91f1007757d9080798bad4971d8a1204984e5d5e77395c231790fe0c8e95a7cd834061b0ea4f864e51d68f93fb0c1c43a90ea8329a73dff1b
+MISC ChangeLog 3689 SHA256 9695fbf0257c000cfb6b875048d6b5f7b61cd2a1d15da22017114675b293a5f3 SHA512 25cd2bbf8512952af2ffa3f6fd8fd14ec09497088eaea9b660f54e1c10752118b387e10b113218b1a36fdbedc9b7d03d18fb79814cc297484dfafad7234c6e51 WHIRLPOOL 3efe4e412eef4ca434bdf53ac0b81e8f882a7db4285b291730e4669d9bd68e267a6957ba783dc656774faa9c014e355593d0efc00554a978359ca0ddfa71028f
+MISC ChangeLog-2015 14103 SHA256 3a06cdf5f2fb5900395c9ceb77aa1e355811eb9412e6126f48dab7c07de136e3 SHA512 a90e09a5a6e33ec0f1eddec1a2b651a201b90dc797525616034330006e263f12cf1e338d456269a48a406557d649c6cc1bf3ced63545cda5055961f35adf088a WHIRLPOOL 1585d163b62ca0835f429d6d81b8d8572bc9dff8d477315649cb48aebf7364c81bec11dc4835b694d5c790e4fc50f54b39c8313c31d7f9fc7ab9bd2d69a953ac
+MISC metadata.xml 212 SHA256 061538b4837ab7b95b652299476a75942b769652dbd569225713fdf1166b1d37 SHA512 e4f4b6dbbf6bf039ff5c19bb6a209ad4e0b1286f8cf7cc0cbafcc04fcf93fb92766c8cae06ff19f980a069c7fe9a1686437ab215f84ce10e301275ae107d00bd WHIRLPOOL bb35c86572b2ad56bf93b52f6eca6bea0f5591c1a9ebd608833dea63c89d4bd36cd402a8ffc2d5fdc1d7e1d5466782d1e37dfcac14fae0bbb181029799728fa5
diff --git a/dev-db/couchdb/couchdb-1.6.1-r2.ebuild b/dev-db/couchdb/couchdb-1.6.1-r2.ebuild
new file mode 100644
index 000000000000..ae88d2259b31
--- /dev/null
+++ b/dev-db/couchdb/couchdb-1.6.1-r2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils multilib pax-utils user
+
+DESCRIPTION="Distributed, fault-tolerant and schema-free document-oriented database"
+HOMEPAGE="http://couchdb.apache.org/"
+SRC_URI="mirror://apache/couchdb/source/${PV}/apache-${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="libressl selinux test"
+
+RDEPEND=">=dev-libs/icu-4.3.1:=
+ <dev-lang/erlang-19.0[ssl]
+ !libressl? ( >=dev-libs/openssl-0.9.8j:0 )
+ libressl? ( dev-libs/libressl )
+ >=net-misc/curl-7.18.2
+ <dev-lang/spidermonkey-1.8.7
+ selinux? ( sec-policy/selinux-couchdb )"
+
+DEPEND="${RDEPEND}
+ sys-devel/autoconf-archive"
+RESTRICT=test
+
+S="${WORKDIR}/apache-${P}"
+
+pkg_setup() {
+ enewgroup couchdb
+ enewuser couchdb -1 -1 /var/lib/couchdb couchdb
+}
+
+src_prepare() {
+ sed -i ./src/couchdb/priv/Makefile.* -e 's|-Werror||g'
+ epatch "${FILESDIR}/${PV}-erlang-18.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-erlang="${EPREFIX}"/usr/$(get_libdir)/erlang/usr/include \
+ --localstatedir="${EPREFIX}"/var \
+ --with-js-lib="${EPREFIX}"/usr/$(get_libdir)
+ # bug 296609, upstream bug #COUCHDB-621
+ sed -e "s#localdocdir = /usr/share/doc/couchdb#localdocdir = "${EPREFIX}"/usr/share/doc/${PF}#" -i Makefile || die "sed failed"
+}
+
+src_compile() {
+ emake
+ # bug 442616
+ pax-mark mr src/couchdb/priv/couchjs
+}
+
+src_test() {
+ emake distcheck
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ fowners couchdb:couchdb \
+ /var/lib/couchdb \
+ /var/log/couchdb
+
+ for f in "${ED}"/etc/couchdb/*.ini ; do
+ fowners root:couchdb "${f#${ED}}"
+ fperms 660 "${f#${ED}}"
+ done
+ fperms 664 /etc/couchdb/default.ini
+
+ newinitd "${FILESDIR}/couchdb.init-4" couchdb
+ newconfd "${FILESDIR}/couchdb.conf-2" couchdb
+
+ sed -i -e "s:LIBDIR:$(get_libdir):" "${ED}/etc/conf.d/couchdb"
+}
diff --git a/dev-db/couchdb/couchdb-1.6.1-r3.ebuild b/dev-db/couchdb/couchdb-1.6.1-r3.ebuild
new file mode 100644
index 000000000000..cb3841fb4555
--- /dev/null
+++ b/dev-db/couchdb/couchdb-1.6.1-r3.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils multilib pax-utils user
+
+DESCRIPTION="Distributed, fault-tolerant and schema-free document-oriented database"
+HOMEPAGE="http://couchdb.apache.org/"
+SRC_URI="mirror://apache/couchdb/source/${PV}/apache-${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="libressl selinux test"
+
+RDEPEND=">=dev-libs/icu-4.3.1:=
+ <dev-lang/erlang-20.0[ssl]
+ !libressl? ( >=dev-libs/openssl-0.9.8j:0 )
+ libressl? ( dev-libs/libressl )
+ >=net-misc/curl-7.18.2
+ <dev-lang/spidermonkey-1.8.7
+ selinux? ( sec-policy/selinux-couchdb )"
+
+DEPEND="${RDEPEND}
+ sys-devel/autoconf-archive"
+RESTRICT=test
+
+S="${WORKDIR}/apache-${P}"
+
+pkg_setup() {
+ enewgroup couchdb
+ enewuser couchdb -1 -1 /var/lib/couchdb couchdb
+}
+
+src_prepare() {
+ sed -i ./src/couchdb/priv/Makefile.* -e 's|-Werror||g'
+ epatch "${FILESDIR}/${PV}-erlang-18.patch"
+ epatch "${FILESDIR}/${PV}-erlang-19.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-erlang="${EPREFIX}"/usr/$(get_libdir)/erlang/usr/include \
+ --localstatedir="${EPREFIX}"/var \
+ --with-js-lib="${EPREFIX}"/usr/$(get_libdir)
+ # bug 296609, upstream bug #COUCHDB-621
+ sed -e "s#localdocdir = /usr/share/doc/couchdb#localdocdir = "${EPREFIX}"/usr/share/doc/${PF}#" -i Makefile || die "sed failed"
+}
+
+src_compile() {
+ emake
+ # bug 442616
+ pax-mark mr src/couchdb/priv/couchjs
+}
+
+src_test() {
+ emake distcheck
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ fowners couchdb:couchdb \
+ /var/lib/couchdb \
+ /var/log/couchdb
+
+ for f in "${ED}"/etc/couchdb/*.ini ; do
+ fowners root:couchdb "${f#${ED}}"
+ fperms 660 "${f#${ED}}"
+ done
+ fperms 664 /etc/couchdb/default.ini
+
+ newinitd "${FILESDIR}/couchdb.init-4" couchdb
+ newconfd "${FILESDIR}/couchdb.conf-2" couchdb
+
+ sed -i -e "s:LIBDIR:$(get_libdir):" "${ED}/etc/conf.d/couchdb"
+}
diff --git a/dev-db/couchdb/files/1.6.1-erlang-18.patch b/dev-db/couchdb/files/1.6.1-erlang-18.patch
new file mode 100644
index 000000000000..a0ffea8b12fd
--- /dev/null
+++ b/dev-db/couchdb/files/1.6.1-erlang-18.patch
@@ -0,0 +1,99 @@
+From 95cb436be30305efa091809813b64ef31af968c8 Mon Sep 17 00:00:00 2001
+From: Dave Cottlehuber <dch@apache.org>
+Date: Fri, 26 Jun 2015 10:31:27 +0200
+Subject: [PATCH] build: support OTP-18.0
+
+---
+ INSTALL.Unix | 2 +-
+ INSTALL.Windows | 2 +-
+ configure.ac | 8 ++++----
+ share/doc/src/install/unix.rst | 2 +-
+ share/doc/src/install/windows.rst | 2 +-
+ 5 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/INSTALL.Unix b/INSTALL.Unix
+index f66f98c..4c63bc8 100644
+--- a/INSTALL.Unix
++++ b/INSTALL.Unix
+@@ -39,7 +39,7 @@ Dependencies
+
+ You should have the following installed:
+
+- * Erlang OTP (>=R14B01, =<R17) (http://erlang.org/)
++ * Erlang OTP (>=R14B01, =<R18) (http://erlang.org/)
+ * ICU (http://icu-project.org/)
+ * OpenSSL (http://www.openssl.org/)
+ * Mozilla SpiderMonkey (1.8.5) (http://www.mozilla.org/js/spidermonkey/)
+diff --git a/INSTALL.Windows b/INSTALL.Windows
+index 29c69b0..1ca04fd 100644
+--- a/INSTALL.Windows
++++ b/INSTALL.Windows
+@@ -29,7 +29,7 @@ Dependencies
+
+ You will need the following installed:
+
+- * Erlang OTP (>=14B01, <R17) (http://erlang.org/)
++ * Erlang OTP (>=14B01, <R18) (http://erlang.org/)
+ * ICU (>=4.*) (http://icu-project.org/)
+ * OpenSSL (>=0.9.8r) (http://www.openssl.org/)
+ * Mozilla SpiderMonkey (=1.8.5) (http://www.mozilla.org/js/spidermonkey/)
+diff --git a/configure.ac b/configure.ac
+index 103f029..bf9ffc4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -411,7 +411,7 @@ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Erlang version compatibility" >&5
+ $as_echo_n "checking Erlang version compatibility... " >&6; }
+-erlang_version_error="The installed Erlang version must be >= R14B (erts-5.8.1) and =< 17 (erts-6.0)"
++erlang_version_error="The installed Erlang version must be >= R14B (erts-5.8.1) and =< 18 (erts-7.0)"
+
+ version="`${ERL} -version 2>&1 | ${SED} 's/[[^0-9]]/ /g'` 0 0 0"
+ major_version=`echo $version | ${AWK} "{print \\$1}"`
+@@ -419,7 +419,7 @@ minor_version=`echo $version | ${AWK} "{print \\$2}"`
+ patch_version=`echo $version | ${AWK} "{print \\$3}"`
+ echo -n "detected Erlang version: $major_version.$minor_version.$patch_version..."
+
+-if test $major_version -lt 5 -o $major_version -gt 6; then
++if test $major_version -lt 5 -o $major_version -gt 7; then
+ as_fn_error $? "$erlang_version_error major_version does not match" "$LINENO" 5
+ fi
+
+@@ -438,9 +438,9 @@ otp_release="`\
+ AC_SUBST(otp_release)
+
+ AM_CONDITIONAL([USE_OTP_NIFS],
+- [can_use_nifs=$(echo $otp_release | grep -E "^(R14B|R15|R16|17)")])
++ [can_use_nifs=$(echo $otp_release | grep -E "^(R14B|R15|R16|17|18)")])
+ AM_CONDITIONAL([USE_EJSON_COMPARE_NIF],
+- [can_use_ejson=$(echo $otp_release | grep -E "^(R14B03|R15|R16|17)")])
++ [can_use_ejson=$(echo $otp_release | grep -E "^(R14B03|R15|R16|17|18)")])
+
+ has_crypto=`\
+ ${ERL} -eval "\
+diff --git a/share/doc/src/install/unix.rst b/share/doc/src/install/unix.rst
+index 76fe922..904c128 100644
+--- a/share/doc/src/install/unix.rst
++++ b/share/doc/src/install/unix.rst
+@@ -52,7 +52,7 @@ Dependencies
+
+ You should have the following installed:
+
+-* `Erlang OTP (>=R14B01, =<R17) <http://erlang.org/>`_
++* `Erlang OTP (>=R14B01, =<R18) <http://erlang.org/>`_
+ * `ICU <http://icu-project.org/>`_
+ * `OpenSSL <http://www.openssl.org/>`_
+ * `Mozilla SpiderMonkey (1.8.5) <http://www.mozilla.org/js/spidermonkey/>`_
+diff --git a/share/doc/src/install/windows.rst b/share/doc/src/install/windows.rst
+index b7b66af..494ef65 100644
+--- a/share/doc/src/install/windows.rst
++++ b/share/doc/src/install/windows.rst
+@@ -90,7 +90,7 @@ Dependencies
+
+ You should have the following installed:
+
+-* `Erlang OTP (>=14B01, <R17) <http://erlang.org/>`_
++* `Erlang OTP (>=14B01, <R18) <http://erlang.org/>`_
+ * `ICU (>=4.*) <http://icu-project.org/>`_
+ * `OpenSSL (>0.9.8r) <http://www.openssl.org/>`_
+ * `Mozilla SpiderMonkey (=1.8.5) <http://www.mozilla.org/js/spidermonkey/>`_
diff --git a/dev-db/couchdb/files/1.6.1-erlang-19.patch b/dev-db/couchdb/files/1.6.1-erlang-19.patch
new file mode 100644
index 000000000000..6ffb5a4e9536
--- /dev/null
+++ b/dev-db/couchdb/files/1.6.1-erlang-19.patch
@@ -0,0 +1,105 @@
+From 41304b83946f029f9712714cc89e9f630442d668 Mon Sep 17 00:00:00 2001
+From: Eugene Pirogov <iamexile@gmail.com>
+Date: Mon, 11 Jul 2016 00:38:11 +0300
+Subject: [PATCH] build: support OTP-19.0
+
+- add travis support for newer OTP releases
+- update docs
+- update configure.ac
+
+closes #431
+---
+ .travis.yml | 3 +++
+ INSTALL.Unix | 2 +-
+ INSTALL.Windows | 2 +-
+ configure.ac | 8 ++++----
+ share/doc/src/install/unix.rst | 2 +-
+ share/doc/src/install/windows.rst | 2 +-
+ 6 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/.travis.yml b/.travis.yml
+index 1bddb6a..ef19231 100644
+--- a/INSTALL.Unix
++++ b/INSTALL.Unix
+@@ -39,7 +39,7 @@ Dependencies
+
+ You should have the following installed:
+
+- * Erlang OTP (>=R14B01, =<R18) (http://erlang.org/)
++ * Erlang OTP (>=R14B01, =<R19) (http://erlang.org/)
+ * ICU (http://icu-project.org/)
+ * OpenSSL (http://www.openssl.org/)
+ * Mozilla SpiderMonkey (1.8.5) (http://www.mozilla.org/js/spidermonkey/)
+diff --git a/INSTALL.Windows b/INSTALL.Windows
+index 1ca04fd..41fdcef 100644
+--- a/INSTALL.Windows
++++ b/INSTALL.Windows
+@@ -29,7 +29,7 @@ Dependencies
+
+ You will need the following installed:
+
+- * Erlang OTP (>=14B01, <R18) (http://erlang.org/)
++ * Erlang OTP (>=14B01, <R19) (http://erlang.org/)
+ * ICU (>=4.*) (http://icu-project.org/)
+ * OpenSSL (>=0.9.8r) (http://www.openssl.org/)
+ * Mozilla SpiderMonkey (=1.8.5) (http://www.mozilla.org/js/spidermonkey/)
+diff --git a/configure.ac b/configure.ac
+index bf9ffc4..a6a667a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -411,7 +411,7 @@ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Erlang version compatibility" >&5
+ $as_echo_n "checking Erlang version compatibility... " >&6; }
+-erlang_version_error="The installed Erlang version must be >= R14B (erts-5.8.1) and =< 18 (erts-7.0)"
++erlang_version_error="The installed Erlang version must be >= R14B (erts-5.8.1) and =< 19 (erts-8.0)"
+
+ version="`${ERL} -version 2>&1 | ${SED} 's/[[^0-9]]/ /g'` 0 0 0"
+ major_version=`echo $version | ${AWK} "{print \\$1}"`
+@@ -419,7 +419,7 @@ minor_version=`echo $version | ${AWK} "{print \\$2}"`
+ patch_version=`echo $version | ${AWK} "{print \\$3}"`
+ echo -n "detected Erlang version: $major_version.$minor_version.$patch_version..."
+
+-if test $major_version -lt 5 -o $major_version -gt 7; then
++if test $major_version -lt 5 -o $major_version -gt 8; then
+ as_fn_error $? "$erlang_version_error major_version does not match" "$LINENO" 5
+ fi
+
+@@ -438,9 +438,9 @@ otp_release="`\
+ AC_SUBST(otp_release)
+
+ AM_CONDITIONAL([USE_OTP_NIFS],
+- [can_use_nifs=$(echo $otp_release | grep -E "^(R14B|R15|R16|17|18)")])
++ [can_use_nifs=$(echo $otp_release | grep -E "^(R14B|R15|R16|17|18|19)")])
+ AM_CONDITIONAL([USE_EJSON_COMPARE_NIF],
+- [can_use_ejson=$(echo $otp_release | grep -E "^(R14B03|R15|R16|17|18)")])
++ [can_use_ejson=$(echo $otp_release | grep -E "^(R14B03|R15|R16|17|18|19)")])
+
+ has_crypto=`\
+ ${ERL} -eval "\
+diff --git a/share/doc/src/install/unix.rst b/share/doc/src/install/unix.rst
+index 904c128..b4684fa 100644
+--- a/share/doc/src/install/unix.rst
++++ b/share/doc/src/install/unix.rst
+@@ -52,7 +52,7 @@ Dependencies
+
+ You should have the following installed:
+
+-* `Erlang OTP (>=R14B01, =<R18) <http://erlang.org/>`_
++* `Erlang OTP (>=R14B01, =<R19) <http://erlang.org/>`_
+ * `ICU <http://icu-project.org/>`_
+ * `OpenSSL <http://www.openssl.org/>`_
+ * `Mozilla SpiderMonkey (1.8.5) <http://www.mozilla.org/js/spidermonkey/>`_
+diff --git a/share/doc/src/install/windows.rst b/share/doc/src/install/windows.rst
+index 494ef65..0228550 100644
+--- a/share/doc/src/install/windows.rst
++++ b/share/doc/src/install/windows.rst
+@@ -90,7 +90,7 @@ Dependencies
+
+ You should have the following installed:
+
+-* `Erlang OTP (>=14B01, <R18) <http://erlang.org/>`_
++* `Erlang OTP (>=14B01, <R19) <http://erlang.org/>`_
+ * `ICU (>=4.*) <http://icu-project.org/>`_
+ * `OpenSSL (>0.9.8r) <http://www.openssl.org/>`_
+ * `Mozilla SpiderMonkey (=1.8.5) <http://www.mozilla.org/js/spidermonkey/>`_
diff --git a/dev-db/couchdb/files/couchdb.conf-2 b/dev-db/couchdb/files/couchdb.conf-2
new file mode 100644
index 000000000000..94d50b35f33d
--- /dev/null
+++ b/dev-db/couchdb/files/couchdb.conf-2
@@ -0,0 +1,9 @@
+# Options for CouchDB
+
+EXEC="/usr/bin/couchdb"
+COUCHDB_USER="couchdb:couchdb"
+COUCHDB_PID_FILE="/var/run/couchdb/couchdb.pid"
+COUCHDB_STDOUT_FILE="/dev/null"
+COUCHDB_STDERR_FILE="/dev/null"
+#COUCHDB_RESPAWN_TIMEOUT=
+#COUCHDB_OPTIONS=
diff --git a/dev-db/couchdb/files/couchdb.init-4 b/dev-db/couchdb/files/couchdb.init-4
new file mode 100644
index 000000000000..aab1757d3cf4
--- /dev/null
+++ b/dev-db/couchdb/files/couchdb.init-4
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Dirkjan Ochtman
+# Distributed under the terms of the Apache License, Version 2.0
+
+pidfile=${COUCHDB_PID_FILE}
+command=${EXEC:-/usr/bin/couchdb}
+command_args="-b -o ${COUCHDB_STDOUT_FILE} -e ${COUCHDB_STDERR_FILE} -p ${pidfile} ${COUCHDB_OPTIONS}"
+
+start_stop_daemon_args="--user ${COUCHDB_USER}"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 -o ${COUCHDB_USER} /var/run/couchdb
+}
diff --git a/dev-db/couchdb/metadata.xml b/dev-db/couchdb/metadata.xml
new file mode 100644
index 000000000000..37f6a3033902
--- /dev/null
+++ b/dev-db/couchdb/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>djc@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/cpp-driver/Manifest b/dev-db/cpp-driver/Manifest
new file mode 100644
index 000000000000..d3d9e1a78407
--- /dev/null
+++ b/dev-db/cpp-driver/Manifest
@@ -0,0 +1,4 @@
+DIST cpp-driver-2.4.3.tar.gz 593974 SHA256 d3364d1b8bc71ec4409ff7432f10d1edbdb1329ab8315418858561065b024bdf SHA512 a23fdd77a19dd99bd077af2d51163471c30dcb88c59a1c8c5221c4369e46637ecbb5ffa4d76ed5f60d1a0d0feabf05a731cd0b377ae5bbc901ba5beeb6055953 WHIRLPOOL ce5a54fd54be2e9e940b98785ebe8e3517dec5810c8318bb5dbb62639ed210c2aff1b04d25ea99164a3b77abd66a5679f4aa0ee042c902a6fd357a07702039fd
+EBUILD cpp-driver-2.4.3.ebuild 625 SHA256 7c1d5e61e33083fad2dc05d2153ba83be01e628b9039858d640cbb50549e9791 SHA512 84251aff02b34f4b0631cf896c87c33b5e2dba2421aeaa8aa061a79e3b6a57c7cb4379f2098b911beb7c81dc288daffeeee89a1b472322022730b7ac64fa10a5 WHIRLPOOL aeeab84f664898c9375f340cdd9498317d338d016c32586fc032d23e423076a52807ccb4f4a3c7fed39eb016dba87afc4ea419777ca10bda90418e491bbdac0a
+MISC ChangeLog 437 SHA256 f3bee71ef91c84ca9f18da94da28b11bc90a3eaddebce4c84a1d1341f56c7531 SHA512 f72463d8d4fee4aea606104b8d70b85bde985ef88b556e1e185cc67a95781e48211335c5a52cff972053fa377903e5e385d6f617ae0d5bdd4eb640f5de99fb18 WHIRLPOOL 3f159f244d2ad8649c665876fb868efaf45b17bd36e8b01d4dfa9284fb989a472b79783d48caf59192245c7dad5e9c699170d82d92c4c82504625e2e747c2771
+MISC metadata.xml 553 SHA256 b24ad0d80ce9bb2a470324829edf6edce68b588ccca4dcfa3c72a04752815d67 SHA512 7e02ca90a667319bd669dc10dbba7abc1018a1c4941fc213af728bd6b7afe48e5fca888f3f6d19798937f6fa5d8188cd784cd37f0ff690bc2295abab8ae408f8 WHIRLPOOL 0fbb770c6af77b58beda20e24dc793460501491b5cb99e0fb4c0b2408e4855f1b4c3384aaf78deb17aa94da091d9b9e449579ec17ed5781f0579218a05a00959
diff --git a/dev-db/cpp-driver/cpp-driver-2.4.3.ebuild b/dev-db/cpp-driver/cpp-driver-2.4.3.ebuild
new file mode 100644
index 000000000000..942cb0b2ed00
--- /dev/null
+++ b/dev-db/cpp-driver/cpp-driver-2.4.3.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils
+
+DESCRIPTION="DataStax C/C++ Driver for Cassandra"
+HOMEPAGE="http://datastax.github.io/cpp-driver/"
+SRC_URI="https://github.com/datastax/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ssl libressl"
+
+RDEPEND="
+ dev-libs/libuv
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local mycmakeargs=( -DCASS_USE_OPENSSL=$(usex ssl) )
+ cmake-utils_src_configure
+}
diff --git a/dev-db/cpp-driver/metadata.xml b/dev-db/cpp-driver/metadata.xml
new file mode 100644
index 000000000000..40d0b15e5721
--- /dev/null
+++ b/dev-db/cpp-driver/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ DataStax Cassandra C/C++ driver for Apache Cassandra or Scilla
+ </longdescription>
+ <maintainer type="person">
+ <email>geaaru@gmail.com</email>
+ <name>Geaaru</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">datastax/cpp-driver</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/cppdb/Manifest b/dev-db/cppdb/Manifest
new file mode 100644
index 000000000000..48ae10954b3d
--- /dev/null
+++ b/dev-db/cppdb/Manifest
@@ -0,0 +1,5 @@
+DIST cppdb-0.3.1.tar.bz2 251449 SHA256 d60eef5a732d8f84ef5e4a2845a8cefc543a6c75bf3782589c2cf6aa150b992e SHA512 19e60becbffef7a252eda5fdd5821b44c2eeb5d69e84cf46e89ed6af3cea315f3cfe7b2cc4f62fbe154be8abdad3363761dd0252f94671421010273eeae65678 WHIRLPOOL 71ab865ef7ffeae43ec8c7278553225ab0b6ccddc8355213a60ab77c835af569d157c77ff417e651754c3f34187b516f6e16fb982321de8701fa60619e19b77d
+EBUILD cppdb-0.3.1-r1.ebuild 1353 SHA256 1c21e3613fab9532837b5ef956f520ffa579305d9b7014d111ae23ebd0585fd0 SHA512 bb1a2d18a3ec7843f519c788d59697b53cfc10c321b4caa1dba4910b764246f542794fae49f1b4971d6521d7ef191573cf45c9c161254ede6871f147af60c4bb WHIRLPOOL 750c3456dfb511c866be10609ef48a7dd27710631f8bfc0f9b1532bf1c81a21fee21a1c58cfccbf8a4507decbc8c789decad38782aee0be3b6145723a64256d1
+MISC ChangeLog 2295 SHA256 296e6a726d185c7d303dff665fa38f93edba3be19bfc9f917efa65afb3840ecc SHA512 15ee0a9cdb3f0d5acaa2e0e52e3cf33de9daae53f62ade9913e473ed3e029a2cc2de97315db8bb514b530df6644057696f24db4966c5aa33f77f21d23a14b723 WHIRLPOOL c4987018a3ec9b625d816d2f5b2ee3e35f73446cb61ea6eb93e62b186e0b9d6637bbbb1b7dd51004d4d3cc55668a1025bfb765022e3092dde0111d4e9a64de2e
+MISC ChangeLog-2015 748 SHA256 68a8757314e57ca69a88e3a08778490e1dd368958efda4fc8a0aca302b38ea73 SHA512 91a84becbe3b139aa9db6e8ed0850559612be014a19e28b5d04925ca09019661518e1d192ba253fa8b052c7df10b766b2fb84bc5d31b59b762d1aa849e504284 WHIRLPOOL 73db4a027a0412088087e7805b149af81a6db095c1674519ad1ea3a7cb0af63a0e6ae844021adcab85c40c428589141ecde179958b28b1ab1092707f86d72c95
+MISC metadata.xml 767 SHA256 5350ed956055caf35b00f2422e2fec5a9ec1af3cf1ca85a642f3bd69252aef16 SHA512 930b662cc22169de50ef67af931799380b229c09a0b9b82c1ace9fa0abe75a685a3c3793c02cb85ac3d8f18f6450ea178e1a097e42e4d84c024286da9cbc085a WHIRLPOOL 1d35f95e1968a619a133381b9d8893c8b1028df97b9dae576cfb14099794e6619c11c91b6a41b20d4bf47631b3f4f48d4cb641a66d2f835d5acc3f46cbb3fc84
diff --git a/dev-db/cppdb/cppdb-0.3.1-r1.ebuild b/dev-db/cppdb/cppdb-0.3.1-r1.ebuild
new file mode 100644
index 000000000000..bcc4bd16cdc4
--- /dev/null
+++ b/dev-db/cppdb/cppdb-0.3.1-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+DESCRIPTION="An SQL connectivity library for platform and database independent connectivity"
+HOMEPAGE="http://cppcms.com/sql/cppdb/"
+SRC_URI="mirror://sourceforge/cppcms/${P}.tar.bz2"
+
+LICENSE="|| ( Boost-1.0 MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples mysql mysql_internal odbc odbc_internal postgres postgres_internal sqlite sqlite_internal"
+
+DEPEND="
+ mysql? ( virtual/mysql )
+ odbc? ( dev-db/unixODBC )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( dev-db/sqlite:3 )"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ local mycmakeargs="
+ $(cmake-utils_use_disable mysql MYSQL)
+ $(cmake-utils_use mysql_internal MYSQL_BACKEND_INTERNAL)
+ $(cmake-utils_use_disable odbc ODBC)
+ $(cmake-utils_use odbc_internal ODBC_BACKEND_INTERNAL)
+ $(cmake-utils_use_disable postgres PQ)
+ $(cmake-utils_use postgres_internal PQ_BACKEND_INTERNAL)
+ $(cmake-utils_use_disable sqlite SQLITE)
+ $(cmake-utils_use sqlite_internal SQLITE_BACKEND_INTERNAL)
+ -DLIBDIR=$(get_libdir)"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ if use doc; then
+ rm docs/build.txt || die
+ dodoc -r docs/*
+ dohtml -r html/*
+ fi
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+}
diff --git a/dev-db/cppdb/metadata.xml b/dev-db/cppdb/metadata.xml
new file mode 100644
index 000000000000..b4e431927502
--- /dev/null
+++ b/dev-db/cppdb/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="mysql_internal">Don't build a separate mysql loadable module but rather build it into the cppdb library itself</flag>
+ <flag name="odbc_internal">Don't build a separate postgresql loadable module but rather build it into the cppdb library itself</flag>
+ <flag name="postgres_internal">Don't build a separate odbc loadable module but rather build it into the cppdb library itself</flag>
+ <flag name="sqlite_internal">Don't build a separate sqlite3 loadable module but rather build it into the cppdb library itself</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">cppcms</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/datadraw/Manifest b/dev-db/datadraw/Manifest
new file mode 100644
index 000000000000..e98c4c146f89
--- /dev/null
+++ b/dev-db/datadraw/Manifest
@@ -0,0 +1,5 @@
+DIST datadraw3.1.1.tar.gz 607914 SHA256 11186bbf37f9b5bb11d7a21bc5ce6c45496b24dfa62a064d57d3ad414f4a9c04 SHA512 64773b984cb9d6928ec486833ee03f07c6c5f21dcfcc446e21fe90eb432b7a09459ea65e24c46df70bc6b791dfc640caf16b6f6cdd8a35319969bb8ec7e65009 WHIRLPOOL e4af7bcf81cf52c1743273ca2c09de7435066fd194a0ee5235171de2876acf865db951fe432e7e0cefd34af98902a242fa9906054d4b5fe9df6b7daa890128dc
+EBUILD datadraw-3.1.1.ebuild 1002 SHA256 fb0fb50e14a568905a8fb02dd77b6fa7754f84efc9a56815102fec6ecdda49e4 SHA512 5ba2c3d348ce7533dff173a3ed5bbf710ef55f7a3dcadc5360581704a3ceae4857ab773ca74165c81faa1a84226d5d706a9996df16db80ea22d2837a602e545d WHIRLPOOL 9f6a81158bfa8a0583a890352d524b9a88d4f8c6aac8f9a97b639b5bfe0289187914ad010e0ca9321662c9d97f94768ff289bba35a325b6c6400bc514ba84180
+MISC ChangeLog 2821 SHA256 b1fe262ac2b6b429349c20fb71350e2dffbd40baded1ab1025ae0b48cfef8c86 SHA512 fee119d7d2ed928da949fef028d984585960a9ecf88aa1a0a3bb7887487afd97f90eb9d43f0d20cc36031167432a9c589c879e9b6700f67384ae3f5859f21b1e WHIRLPOOL b95ad86e4a03bb4c3663dfdd01ced65716580def946150ac942cd71ab5a5076d967a8c762669a08cb83a5693b18819d9c105d18cb11813c801aa5654423654dd
+MISC ChangeLog-2015 385 SHA256 0a946e1ee5e6db7c726ee9491de127c08dee619952024d8ee5e6f41f3cefd11e SHA512 3edd58ba205101e9fd3d341fae21febc1c0925e6a25a7b795a23c2d13107a892862fe28518660a87dced3d42739fb38187434b8c0fde6da1dd0650ff2f8b96c9 WHIRLPOOL 5d007140f4c00077e15fd8e3249b7050d5d6145dac4141d8ebc7c25ae7ce886f3e064a207defb8b28d7f4ca94c9b098503e740865e478104dcf5bf8b45c35ffa
+MISC metadata.xml 683 SHA256 46a6916779ef07640fdc0e8a210f889430f34d02b587ea05c0ffa9affc3da39f SHA512 cf47cf89f8b79929d9fa0b74c1e6a924c17b7f5e51d6b831593b12c7ab802eb6cb77a96cbbb0bd96c76922cfecb88c8e0e9def477a93a1cca7489cd7b34d2af2 WHIRLPOOL fe087d451def772a35cd9a10e777557ed8dae81fd2108eee54fc4c793f5ef13090bcc0735ab544fe4d56daffb7f70ea21585d3d63a0c26c49fc4db88c8298fd2
diff --git a/dev-db/datadraw/datadraw-3.1.1.ebuild b/dev-db/datadraw/datadraw-3.1.1.ebuild
new file mode 100644
index 000000000000..608c45988c11
--- /dev/null
+++ b/dev-db/datadraw/datadraw-3.1.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="feature rich database generator for high performance C applications"
+HOMEPAGE="http://datadraw.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}${PV}/${PN}${PV}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples"
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/${PN}${PV}
+
+src_prepare() {
+ tc-export CC
+ sed -e "/^CFLAGS=/s:-g -Wall:${CFLAGS}:" \
+ -i configure \
+ -i dataview/configure \
+ -i util/configure || die
+
+ sed -e '/^datadraw:/,+2s:\\$(CFLAGS):\\$(CFLAGS) \\$(LDFLAGS):' \
+ -i configure || die
+}
+
+src_install() {
+ dobin ${PN}
+
+ insinto /usr/$(get_libdir)
+ for lib in util/*.a ; do
+ newins ${lib} lib$(basename ${lib})
+ done
+ insinto /usr/include
+
+ doins util/*.h
+
+ dodoc README
+ if use doc ; then
+ dodoc manual.pdf
+ dohtml -r www/index.html www/images
+ fi
+ use examples && dodoc -r examples
+}
diff --git a/dev-db/datadraw/metadata.xml b/dev-db/datadraw/metadata.xml
new file mode 100644
index 000000000000..48833abaadc8
--- /dev/null
+++ b/dev-db/datadraw/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+</maintainer>
+<maintainer type="project">
+ <email>sci-electronics@gentoo.org</email>
+ <name>Gentoo Electronics Project</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">datadraw</remote-id>
+</upstream>
+<longdescription lang="en">
+DataDraw is a feature rich database generator for high performance C applications. DataDraw gives your C application a high performance object-oriented framework at speeds that beat hand coded C.
+</longdescription>
+</pkgmetadata>
diff --git a/dev-db/db-je/Manifest b/dev-db/db-je/Manifest
new file mode 100644
index 000000000000..33c10b540731
--- /dev/null
+++ b/dev-db/db-je/Manifest
@@ -0,0 +1,6 @@
+AUX db-je-3.3.75-optional-test.patch 1791 SHA256 d7437fd7204aa3047c4d98eceebd95247513f1eac5d7864267dc6f3680f1ca1a SHA512 a33e2ae28fa121c68990b44f5441685d50b025db784d07ee6fb78ae9a19ec8c10ee1ec91fb0296507a94792fca86b9a54b5a3e8fd1c0e076f5dc6c0c28cceb1a WHIRLPOOL efa737026ddfd2628762982673b6f4064a5ef9c858dc674510af88152d695f469aa012ec4e0651e7052c5b6d525ef747603bfb4a93b595f79653cad2a0017671
+DIST je-3.3.75.tar.gz 5179709 SHA256 98bb5b374eac336329e4bb87f537355ba5128e697f2bfea5904eba46a5f1ee08 SHA512 e28648459a3a7dcf98e8865e6859544c656c3b58688b244df568cc8c006a74dda79aadfbfb279e099c1376914cca064734da490998a864c1bd2cc3209bc64ae4 WHIRLPOOL a86747a5a30444847e666fd82bd397ead06b4597200b82ce7e88301e6e8531faf267b1cebf2850bfc072916a3a1b903fe35012466a44a5c6bd5311cbce43455b
+EBUILD db-je-3.3.75.ebuild 914 SHA256 3521e2f028f1a71888d28d7ed9a502149676fda1d051d3e210388d1cd6692238 SHA512 101710c533e2dd1df633e0b82ef9d0d6cee5757a7ce476d16263deb5cbdff3ddb77d6e78eeb0917426d8d35e20a198e23e479f666e3c9af273a4a3ca1258d1e0 WHIRLPOOL b3b11de6d934895f53749d7c9d80e190f9829ed2ad180f9f431cd33898a251b809cc40bcbda4613ed535aeea38efea0f4669181c7f8d35638b75d64ff9a3949c
+MISC ChangeLog 2855 SHA256 74218c1d14b1495336b5cde0a469a9191f1528dce4337fd0322508218993316d SHA512 422601f4355eea690cb582cac938e6ccad22acf6916f050c09e10f11ea698c68a0c35f905a181ff74405273d102a7fcefbcd90cd729724209a13025437c6c43b WHIRLPOOL ec45ad046710f02fb9dab9881e508c741959448bc6173b22c3d47f4aac2841d70a5d1d21f1a2d379049da810c868155f4a154d29c2a7f477d704306e955c1a59
+MISC ChangeLog-2015 610 SHA256 d2e1e6c24edcf6e15560fd2b9ce687b50684be6a9d7123a9416b4db520b8ef36 SHA512 b5b6a68aae144181220f850453a4ecb7638af5caa3da41e33e3113cf9e5dcf2f80dcf70f8a09f8ad07968db322cb864b4c0db3ba2475e72a33aa6907b51aefa0 WHIRLPOOL d3d97f969703fdd80fc4128e4e3a33d9823150702a300f92fc7a08bc24dfb2d231d3531571fa2577c0c029abdc152d03db974d72dd67e224ba48621cd7f5c0d8
+MISC metadata.xml 352 SHA256 8c0d6e0f8946242af2c5b2513ca0b18d3408d428e6c84f63a93ee2dffd857194 SHA512 a3c6ce3cd97b39644238700277dd416e1ee79df975184de3429810ca4d77f7160112adef6a9b56f77243a003187f6642798b278cf8501d55da766ccfbaa861cf WHIRLPOOL 8a92408c9175845d852584035d1f33f0f032c5457ce8809d5f6c88710577ae6c958d55d2ab412d703e680d168fff0b00a41236472f8a866418a6d05b99335d57
diff --git a/dev-db/db-je/db-je-3.3.75.ebuild b/dev-db/db-je/db-je-3.3.75.ebuild
new file mode 100644
index 000000000000..20eabe5cf0a4
--- /dev/null
+++ b/dev-db/db-je/db-je-3.3.75.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-ant-2
+
+DESCRIPTION="A high performance, transactional storage engine written entirely in Java"
+HOMEPAGE="http://www.oracle.com/database/berkeley-db/je/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${P/db-/}.tar.gz"
+
+LICENSE="Sleepycat BSD"
+SLOT="3.3"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=">=virtual/jdk-1.5"
+RDEPEND=">=virtual/jre-1.5"
+S=${WORKDIR}/${P/db-/}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}" || die
+ epatch "${FILESDIR}"/${P}-optional-test.patch
+ rm -rf docs
+ cd lib || die
+ rm -v *jar || die
+ java-pkg_jar-from --build-only ant-core ant.jar
+}
+
+EANT_DOC_TARGET="javadoc-all"
+EANT_EXTRA_ARGS="-Dnotest=true"
+
+src_install() {
+ java-pkg_dojar build/lib/je.jar
+ use doc && java-pkg_dojavadoc docs
+ use source && java-pkg_dosrc src/com
+}
diff --git a/dev-db/db-je/files/db-je-3.3.75-optional-test.patch b/dev-db/db-je/files/db-je-3.3.75-optional-test.patch
new file mode 100644
index 000000000000..e8f7600398e2
--- /dev/null
+++ b/dev-db/db-je/files/db-je-3.3.75-optional-test.patch
@@ -0,0 +1,45 @@
+--- build.xml 2008-06-11 05:25:20.000000000 +0200
++++ build.xml.new 2008-08-22 15:59:53.000000000 +0200
+@@ -102,6 +102,7 @@
+ <path id="empty.classpath"/>
+
+ <path id="class.path">
++ <fileset dir="lib" includes="*.jar"/>
+ <pathelement location="${specificjar}"/>
+ <pathelement location="."/>
+ </path>
+@@ -487,14 +488,14 @@
+ <!-- JUnit unit tests -->
+ <!-- ============================================================ -->
+
+- <target name="init-unittest" depends="init">
++ <target name="init-unittest" depends="init" unless="notest">
+ <delete dir="${unittest.datadir}"/>
+ <delete dir="${unittest.reportsdir}"/>
+ <mkdir dir="${unittest.datadir}"/>
+ <mkdir dir="${unittest.reportsdir}"/>
+ </target>
+
+- <target name="clean-unittest" depends="init-unittest">
++ <target name="clean-unittest" depends="init-unittest" unless="notest">
+ <delete dir="${unittest.destdir}"/>
+ <mkdir dir="${unittest.destdir}"/>
+ <delete dir="${unittest.testserialdir}"/>
+@@ -503,7 +504,7 @@
+ <mkdir dir="${unittest.testevolvedir}"/>
+ </target>
+
+- <target name="compile-unittest" depends="compile-src">
++ <target name="compile-unittest" depends="compile-src" unless="notest">
+ <ant antfile="ant/compile.xml" dir="." inheritall="false">
+ <property name="srcdir" value="${unittest.srcdir}"/>
+ <property name="destdir" value="${unittest.destdir}"/>
+@@ -597,7 +598,7 @@
+ </path>
+
+ <target name="test"
+- depends="compile-unittest, init-unittest, jar">
++ depends="compile-unittest, init-unittest, jar" unless="notest">
+
+ <!-- Determine which tests to run. -->
+ <condition property="alltests">
diff --git a/dev-db/db-je/metadata.xml b/dev-db/db-je/metadata.xml
new file mode 100644
index 000000000000..bc74090b9d62
--- /dev/null
+++ b/dev-db/db-je/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tommy@gentoo.org</email>
+ <name>Thomas Sachau (Tommy[D])</name>
+ </maintainer>
+<maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/dbmodel/Manifest b/dev-db/dbmodel/Manifest
new file mode 100644
index 000000000000..5bd4022aa29e
--- /dev/null
+++ b/dev-db/dbmodel/Manifest
@@ -0,0 +1,5 @@
+DIST dbmodel-0.3.tar.gz 71581 SHA256 2e44e33690c1f290a7ed0cab86b51804fd09862332de1dae909149c9b1b1a6b2 SHA512 61c7b39bd57c1d6ff49961b35073c7205862b2e1d6a93b3c8950a62ce6c0e1ce8f39a38ed729174714f719cd92d0e6deba51c68b20ba22888f7d7f7096c05f62 WHIRLPOOL 72d1c09e7e62867a99e95c737cf8c02b6e22902df343c57f2859f08cc7ddbe39d952b04e897fd2d34790e973b9c6689647bc0aa04868a347cd68e070d8ab0cb8
+EBUILD dbmodel-0.3.ebuild 511 SHA256 8ab165b26f7a57758827cd811d5bab82e1c7cbedc5725e66043c6089bacbbb5c SHA512 03db25eb5f7ee48b8794e049862e78de444e8246d20c7e0f6ceb0d696737a064caa13d417ee7b4b8191acce71582706ea4a9c666443d1b28064ddc46f9ef6df8 WHIRLPOOL 192090b79d2f5a3d008f57a074759ea618ce22525ad69cd80451c9b0a89dcb1bfad338c720110a278d80f929833bc89492ec4a83f7dd7a55fcd3e96a5038593c
+MISC ChangeLog 2728 SHA256 b86aca243b1be942b9502fbe058e1272eb8d89c2ea8dcc6a42093edbcbc2930f SHA512 6f1f5b2c691d6dd484e2e74a9fb8a56ca60417d2e2bfe26ed01ccaa1be841b73023eb3cb827c70a8617cb3a80e59fa30b32d388d8ff4b2dca2b18cb68b7486c1 WHIRLPOOL a2ae468726c841b443e0bf068021ed1487c54790d4e6ec8dafd1c8ab4a485b824cdda458009d966b6d8e3cabe217e96e3b863e877b92f6b477fd06e3890fac8e
+MISC ChangeLog-2015 1412 SHA256 744d1971e39d53fce1ef3aeb3c4707a40372621ba1caaa4875f32428cd6b8ba1 SHA512 5eb1136f83023726636cdee56bc8bd564e7321c3849d58130d8a2cf1520ee1ca217636382e16b55f3bc047f9ef4f0d79aa2923923ab91a33f46f5540339e86dc WHIRLPOOL 5197cc3d307856a7e864291c210e9b1c2609c31792e9f9ea5047e548084b9693976245abd1af5e1ed5511cbf96a308efb16408c2bdddcb0bee11e79a7ab8ae71
+MISC metadata.xml 242 SHA256 c291cbfebe3219f12ab6b8882ecd87de0585c888af57de470eb6b2683619ff26 SHA512 9f1687695fe3c18ce5ebf4d226d5f017d86dcb88588a375667f0045cee403e935abe3b96dd0c5dc415656a750dab8624498eb04dbd86dbacaa81c68483085aa8 WHIRLPOOL 88310e30d3aa578235aec0eff8d1bdf0f9bed86bacb54267ba78694e6e688bfcf1b9d18d574dc3cc7e9acf5e0750bffa7046ff43a0c9f9930c77c623fa5f23d1
diff --git a/dev-db/dbmodel/dbmodel-0.3.ebuild b/dev-db/dbmodel/dbmodel-0.3.ebuild
new file mode 100644
index 000000000000..b6a2c307a9a7
--- /dev/null
+++ b/dev-db/dbmodel/dbmodel-0.3.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit qt4-r2
+
+DESCRIPTION="Qt4 tool for drawing entity-relational diagrams"
+HOMEPAGE="http://oxygene.sk/lukas/dbmodel/"
+SRC_URI="https://launchpad.net/dbmodel/trunk/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+DEPEND="dev-qt/qtgui:4
+ dev-qt/qtsvg:4"
+RDEPEND="${DEPEND}"
+
+DOCS="AUTHORS CHANGES"
+
+src_configure() {
+ eqmake4 ${PN}.pro PREFIX=/usr
+}
diff --git a/dev-db/dbmodel/metadata.xml b/dev-db/dbmodel/metadata.xml
new file mode 100644
index 000000000000..b90535458362
--- /dev/null
+++ b/dev-db/dbmodel/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="launchpad">dbmodel</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/etcd/Manifest b/dev-db/etcd/Manifest
new file mode 100644
index 000000000000..eebc0d783c39
--- /dev/null
+++ b/dev-db/etcd/Manifest
@@ -0,0 +1,13 @@
+AUX etcd.conf 978 SHA256 fbc4e715938bb3488f124c3bb4b655d404410d8590a93565eec7f0674780b617 SHA512 3b543104df93ebd6013b5e50c1e17b947e089bf27ba976859574f9fa57f2ed0ba16342984d12a68a00ff6745f37d229b1fe3206df7d713805e289d029774be0d WHIRLPOOL 1302f01825b512dcd2d2801c275b930599d3b4e6b0ce1ff8cf78c5d3b8c8655a08f4d3f50eed6ccb4b0e85d77a08abbc23a860c94844a3b7f1318a1923e242c5
+AUX etcd.confd 129 SHA256 11cf9557524f54fb167b117d2691f1dfeb4c2480b2d0c4d46fadf31e4e78df20 SHA512 a08b1c1701370dc23ebd86db915d1e65747dc4ca57ce44d8cba6cf8434d5711786ac96725eed3285f4ba7cdde25ea25a51539d6cd74fc2f4b713f48cda15c4c3 WHIRLPOOL bd537ca7af350d495b7a3583cdc77676f1eefec270d90e4c667a41bab6147954d79c43b85214efcbf74690e477405e33dd1ba47637f1888e56155b0e8b7293ce
+AUX etcd.initd 813 SHA256 5fe655198b7f1c1096bcd5473963be60146b08596c70eafdb01575321c0c74a7 SHA512 f86df57fc91e98310f00803b29d149a8a2850028b2a349eebfe7fb4059e97f8232fd137a6eeaa3a8edf29922e2552c6a4af10ed40696f0775b65645ac2c57859 WHIRLPOOL 038924a8057f02061a8c6718a0bf9314d0d37c640d7358698afa5adf41dae93d872f38afa3feea4179e3b16ab728ed2349158b9d39833c679ae1b3b177015545
+AUX etcd.logrotated 104 SHA256 adc7dbb76a2a11c2bf38fe47a702ba7302128c32e44774dbf61ba5e1d5b06198 SHA512 64d3181a936f8bab635a17f90679041c2d70a712307928feae03a517ad02252fc37e25738979bc1ccd0657ef70439e65cb0306759bec3939e940ec382a02d94f WHIRLPOOL 32ec0ea3408915f242e534690fee564ae9130b114eee669335c5303552819ba6a0603f6049c90176b6eb1b8b84cf1a0d438a820ba784271c147b5e77d0036b6e
+AUX etcd.service 304 SHA256 53e42ea98e8a9e2acc92c2c694099340000c2cc4fc03df6610aad509d79ad6f6 SHA512 0074f77a17afe2bb4145f12a6eb312caa3e08cfe8bf35856b79d091ad8786c4223bd91c0a865e789ee9ba180f2672b31721742bb32efd0cd383bc747eb926961 WHIRLPOOL 95c675c5ab30509070f63ae2c101b1414fe099396d812394b626455597403fb7b5e92bcffdce267728e915fd11cb16a3b8314e76a4d778cc98e7ea64dc6c1a98
+AUX etcd.tmpfiles.d.conf 76 SHA256 3594bdadb402b300d560fc23db53354c0ad73a78e38ba365fa2e62726b333ac1 SHA512 7324b74dcfe050dd7fbc318ca3ce9b5d58bce8fa2ce2d2d771664ef981c834375f7cbfebcb630cd61dab2a3f6bf6c3733ad04f752beadf7bb6fedcc80ff682ce WHIRLPOOL d260b0c66bda20a61ff9703e4527c43d08ad8c4a2d8f83610d38c656cd82fe3a67e674e1082c617de0867b2377b65aa0f4ddc54d900821c42076771302652ee3
+DIST etcd-2.3.8.tar.gz 2206562 SHA256 6a138b2005e42b0961a12886cc641b792e991cd631fdb502ec5c614b65231cd1 SHA512 4268de32797cab23e9e47784d31d5abd6982068c53d3cc9735a06719740dba45b73f4e067cbc7aa8aef5ca7c56d8be067f1076685ac82f64012b760d8b7f2bfc WHIRLPOOL 4db1b4fe6d0ff917adfc53bd959bb7ac2937da794483e4a4a95e5fb557cf4fbfd43d5bb3c5e21e499432f80f6606407accaa69bc03a3982621276deb529c07da
+DIST etcd-3.2.9.tar.gz 2889569 SHA256 7ad70d9b0d206fe09abc40e82d29ac748d09c0423ddf255ddf4334d21867eb6f SHA512 c194365e388fda8f796af70ff4b575b6ccabac0ca9ae3d84d55718e3914b927d5a6ba10b48eddc897139918880fcfa29d7a329463d20ce72f62115a0a41b6d4d WHIRLPOOL 4e6eb6b7b6d9ac68f0b1c8c2e5cc677ce9815ffd70c27901ef9a416ad73d9578b20592374e4e85a3aea11092b671832e8cdefc9781edd500e5d3bcd14f65cbc3
+EBUILD etcd-2.3.8.ebuild 1379 SHA256 a155c628b920b29ce72bdabf20634e4664210802b6a324b48f416b2c132b4454 SHA512 ea3065641cac36b9011238603479967c1de5ab6f0ccb61dbc54b751879ff239b43065034b17045eb9467e1870878e4837af88c922f9034899da1359b69be98f3 WHIRLPOOL 7468aa9d7ba52fd5cb2f581ec8913eceea5e4c662593dc0cbe50b27aeb3e5acdf5db54d1d56655f4552151f5df393a6fae4ec3eb55c6b7a954ecbd63f459f729
+EBUILD etcd-3.2.9.ebuild 1474 SHA256 2c5cdb3fa0460133550681acb34ba45e9ecf929831b5b623ef4efb390bdf4839 SHA512 21daa3a43edf7cdce091e376302967ca86bf3d3d09babab7bb331b7efed065c6b2d74b7eeb74e010b2d4d84595776befb037dc78391b37e5c7bab8e67b5d7cd5 WHIRLPOOL a2dad1bd9c91a266cf4992e4d917ac8072e8eecec76084c7e57de402fa1d1f8b10118c787d66370bbb5d9307ac51f94a16270f00787b9eec85ecc1521aacc014
+MISC ChangeLog 3997 SHA256 89726f1d48ebcdda7143b5bc4b79bf63b875877638e70c25fd91b074393a8187 SHA512 9d92e847ae61a4a8169ecc33a535c5119a19e4a6541a830f4aee0f935fd541d27f29ac4c016cf068d876d7108b781758d7e2a9ad979446c378538cee89d10b89 WHIRLPOOL ce3a507955d0ca316a5015e8e1d5827831582c41ca9df294cdf818090768b1fc569b67dcf09e11dff1bc91980165cc05060cf9951ce505cb42604b2ec0b0fe3b
+MISC ChangeLog-2015 958 SHA256 148c73d433247e8711a033ffa225469e78f875d5778f60fd9685bef5d678f4ec SHA512 d96c5afde74fd863fd0c69652c3b94cd022eaaa1eab53b1ff326f8dd1677bdc9e21ab34a261d403861a6b4d86a9cf66da0d614c4007772d0d21a470b8ca9a414 WHIRLPOOL 1333d7a44902ef017dc4fe3a8685170f852f68ee8e0db433af29133455b99aae316a893de0760db30f3f093d0539162b8baa741556e894945c5c5bfa92acfc26
+MISC metadata.xml 614 SHA256 e58f2b58c3c70478c03e4c042167b07a03c7054c5fd62236d14ae154d69cdefd SHA512 92fbd483e5a757d09c07c392cc6d54a5448b6ca02177fbc48ff9f1b4f558af4755e4590e3d7192dbc3e5a32d5bf797289a7b1067e585dd295e3e890b88af9cb2 WHIRLPOOL 7b21bc829ad5448c7b3c9b62a6f1181f88c1f69ea1a519817c1603da4679bf864006ec9a03bd55c1d9a26071233a63a09489182f2b1afe89ef50ded9a2a117fc
diff --git a/dev-db/etcd/etcd-2.3.8.ebuild b/dev-db/etcd/etcd-2.3.8.ebuild
new file mode 100644
index 000000000000..f20ed84c75b8
--- /dev/null
+++ b/dev-db/etcd/etcd-2.3.8.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit user systemd
+
+KEYWORDS="~amd64"
+DESCRIPTION="Highly-available key value store for shared configuration and service discovery"
+HOMEPAGE="https://github.com/coreos/etcd/"
+SRC_URI="https://github.com/coreos/etcd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="doc"
+DEPEND=">=dev-lang/go-1.4:="
+RDEPEND="!dev-db/etcdctl"
+
+#pkg_setup() {
+# enewgroup ${PN}
+# enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+#}
+
+src_prepare() {
+ sed -e 's|GIT_SHA=.*|GIT_SHA=v${PV}|'\
+ -e 's|-ldflags "-s.*"|-v -x|' \
+ -e 's|-ldflags "-s|-v -x "|' \
+ -i build || die
+ sed -e 's|go test|\0 -v|'\
+ -i test || die
+}
+
+src_compile() {
+ ./build || die
+}
+
+src_install() {
+ insinto /etc/${PN}
+ doins "${FILESDIR}/${PN}.conf"
+ dobin bin/*
+ dodoc README.md
+ use doc && dodoc -r Documentation
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotated" "${PN}"
+ dodir /var/lib/${PN}
+ fowners ${PN}:${PN} /var/lib/${PN}
+ fperms 755 /var/lib/${PN}
+ dodir /var/log/${PN}
+ fowners ${PN}:${PN} /var/log/${PN}
+ fperms 755 /var/log/${PN}
+}
+
+src_test() {
+ ./test || die
+}
diff --git a/dev-db/etcd/etcd-3.2.9.ebuild b/dev-db/etcd/etcd-3.2.9.ebuild
new file mode 100644
index 000000000000..9de03c3233bf
--- /dev/null
+++ b/dev-db/etcd/etcd-3.2.9.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit user systemd golang-vcs-snapshot
+
+KEYWORDS="~amd64"
+EGO_PN="github.com/coreos/etcd"
+DESCRIPTION="Highly-available key value store for shared configuration and service discovery"
+HOMEPAGE="https://github.com/coreos/etcd"
+SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="doc"
+DEPEND=">=dev-lang/go-1.8:="
+RDEPEND="!dev-db/etcdctl"
+
+src_prepare() {
+ default
+ sed -e 's|GIT_SHA=.*|GIT_SHA=v${PV}|'\
+ -i "${S}"/src/${EGO_PN}/build || die
+}
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+}
+
+src_compile() {
+ export GOPATH=${S}
+ pushd src/${EGO_PN} || die
+ ./build || die
+ popd || die
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ insinto /etc/${PN}
+ doins "${FILESDIR}/${PN}.conf"
+ dobin bin/*
+ dodoc README.md
+ use doc && dodoc -r Documentation
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotated" "${PN}"
+ dodir /var/lib/${PN}
+ fowners ${PN}:${PN} /var/lib/${PN}
+ fperms 755 /var/lib/${PN}
+ dodir /var/log/${PN}
+ fowners ${PN}:${PN} /var/log/${PN}
+ fperms 755 /var/log/${PN}
+ popd || die
+}
+
+src_test() {
+ pushd src/${EGO_PN} || die
+ ./test || die
+ popd || die
+}
diff --git a/dev-db/etcd/files/etcd.conf b/dev-db/etcd/files/etcd.conf
new file mode 100644
index 000000000000..3f34434e8e7c
--- /dev/null
+++ b/dev-db/etcd/files/etcd.conf
@@ -0,0 +1,39 @@
+# For an explanation of the options please see:
+# https://github.com/coreos/etcd/blob/master/Documentation/configuration.md#etcd-configuration
+#
+# The directory to store log and snapshot.
+# If you change this you have to make sure the directory exists at
+# the new path and has the correct permissions.
+# data_dir = "/var/lib/etcd"
+
+# name = "default-name"
+# addr = "127.0.0.1:4001"
+# bind_addr = "127.0.0.1:4001"
+# ca_file = ""
+# cert_file = ""
+# cors = []
+# cpu_profile_file = ""
+# discovery = "http://etcd.local:4001/v2/keys/_etcd/registry/examplecluster"
+# http_read_timeout = 10
+# http_write_timeout = 10
+# key_file = ""
+# peers = []
+# peers_file = ""
+# max_cluster_size = 9
+# max_result_buffer = 1024
+# max_retry_attempts = 3
+# snapshot = true
+# verbose = false
+# very_verbose = false
+
+[peer]
+addr = "127.0.0.1:7001"
+bind_addr = "127.0.0.1:7001"
+# ca_file = ""
+# cert_file = ""
+# key_file = ""
+
+#[cluster]
+# active_size = 9
+# remove_delay = 1800.0
+# sync_interval = 5.0
diff --git a/dev-db/etcd/files/etcd.confd b/dev-db/etcd/files/etcd.confd
new file mode 100644
index 000000000000..4592dac08d56
--- /dev/null
+++ b/dev-db/etcd/files/etcd.confd
@@ -0,0 +1,7 @@
+# Name of this node in the etcd cluster.
+ETCD_NAME=etcd
+
+# Path to the data directory.
+ETCD_DATA_DIR=/var/lib/etcd
+
+ETCD_OPTS=""
diff --git a/dev-db/etcd/files/etcd.initd b/dev-db/etcd/files/etcd.initd
new file mode 100644
index 000000000000..c9caecf7ff69
--- /dev/null
+++ b/dev-db/etcd/files/etcd.initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile=/run/${RC_SVCNAME}.pid
+LOGPATH=/var/log/${RC_SVCNAME}
+DATADIR=/var/lib/${RC_SVCNAME}
+command_user=${RC_SVCNAME}
+command=/usr/bin/etcd
+command_args="
+ -name=${ETCD_NAME}
+ -data-dir=${ETCD_DATA_DIR}
+ ${ETCD_OPTS}"
+command_background=true
+start_stop_daemon_args="
+ --chdir ${ETCD_DATA_DIR}
+ -1 ${LOGPATH}/${RC_SVCNAME}.log
+ -2 ${LOGPATH}/${RC_SVCNAME}.err"
+
+depend() {
+ need net
+ need localmount
+ after bootmisc
+}
+
+start_pre() {
+ if [ ! -d "${LOGPATH}" ] ; then
+ mkdir -p "${LOGPATH}"
+ chown "${command_user}:${command_user}" "${LOGPATH}"
+ fi
+ if [ ! -d "${ETCD_DATA_DIR}" ] ; then
+ mkdir -p "${ETCD_DATA_DIR}"
+ chown "${command_user}:${command_user}" "${ETCD_DATA_DIR}"
+ fi
+}
diff --git a/dev-db/etcd/files/etcd.logrotated b/dev-db/etcd/files/etcd.logrotated
new file mode 100644
index 000000000000..8c79bff297b5
--- /dev/null
+++ b/dev-db/etcd/files/etcd.logrotated
@@ -0,0 +1,7 @@
+/var/log/etcd/etcd.log /var/log/etcd/etcd.err {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/dev-db/etcd/files/etcd.service b/dev-db/etcd/files/etcd.service
new file mode 100644
index 000000000000..6823777066d6
--- /dev/null
+++ b/dev-db/etcd/files/etcd.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Etcd Server
+After=network.target
+
+[Service]
+Type=notify
+PermissionsStartOnly=true
+Environment=ETCD_DATA_DIR=/var/lib/etcd
+Environment=ETCD_NAME=%m
+WorkingDirectory=/var/lib/etcd/
+User=etcd
+ExecStart=/usr/bin/etcd
+Restart=on-failure
+LimitNOFILE=65536
+
+[Install]
+WantedBy=default.target
diff --git a/dev-db/etcd/files/etcd.tmpfiles.d.conf b/dev-db/etcd/files/etcd.tmpfiles.d.conf
new file mode 100644
index 000000000000..721e9c9161a3
--- /dev/null
+++ b/dev-db/etcd/files/etcd.tmpfiles.d.conf
@@ -0,0 +1,2 @@
+d /var/lib/etcd 0755 etcd etcd - -
+d /var/run/etcd 0755 etcd etcd - -
diff --git a/dev-db/etcd/metadata.xml b/dev-db/etcd/metadata.xml
new file mode 100644
index 000000000000..c07ccbfad9c4
--- /dev/null
+++ b/dev-db/etcd/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>https://github.com/coreos/etcd/issues</bugs-to>
+ <changelog>https://raw.githubusercontent.com/coreos/etcd/master/CHANGELOG</changelog>
+ <doc>https://github.com/coreos/etcd/blob/master/README.md/</doc>
+ <remote-id type="github">coreos/etcd</remote-id>
+ </upstream>
+ <maintainer type="person">
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <name>Manuel Rüger</name>
+ <email>mrueg@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/firebird/Manifest b/dev-db/firebird/Manifest
new file mode 100644
index 000000000000..19c48cad8f1d
--- /dev/null
+++ b/dev-db/firebird/Manifest
@@ -0,0 +1,19 @@
+AUX firebird-2.5.1.26351.0-superclassic.patch 713 SHA256 dbf9b28a50772ec5c158ab8dfc6a06da5c72b179117ef5b6c6e1645d796f13bf SHA512 b1c0e253f25616ae6522f693e4a1202bcf290eab3d3cfc06f29e6822f8e55d1d316f0e45b89ebca2b4cd5c97bba07997a7e3aa7e5870ffaca28295d1f3d449cb WHIRLPOOL eef1837adac86b7bc21f8e240b753398a787e4e108243004ca34b6015c842e7ca91ce584ffa4e85e1f2e908b5b2d5a3af5fa04125c110b13ffe43b5dca63c5d6
+AUX firebird-2.5.3.26780.0-deps-flags.patch 3054 SHA256 cfc32092e041dc8fd0997ca40332c21d1e05e847467ccb39bb389d328117f47e SHA512 c786daaec706223c67c74448a317b5dcebcabeba17c244ebbf474763fd3d61e9ee5613241b94194a14816c2bd90dfff8a649bee9ab59eb78e085cb9f812ec9e8 WHIRLPOOL e2a39f825cd6b5ba5f4123243daa48cc703ceddb7a48baa5a6594f24ba5148a2ed38561427acc8a6b6e61b1c5dc7b0cc517c4378b1575f3dc3d0196b96606a8a
+AUX firebird-3.0.2.32703.0-cloop-compiler.patch 349 SHA256 3e44dddd3984559f513c8b228e2d6adbc9874491d50dd8ebe66040d73d381338 SHA512 1d57f26ada2023d8bd04d73dd0f55951cef6b373710c8cf73b6bea0b4d54f879d689644d26541b2366bd1071b08eda2e1b531f3779a88b8fb52d3c9312f0c091 WHIRLPOOL 18eb967ab07416122dd6c03f271be11ee30cf32b94fc18f0df5f6385819ca95bbd6fa0a2ee970068efba84c67dab56f6b2dbe37d1e770f6068b25c94c2b0f042
+AUX firebird-3.0.2.32703.0-gcc6.patch 806 SHA256 a7da9356fda910e75b15b9d2cceb135a5eb1837687ded1d55ee711569078b59a SHA512 184f754c4c23b7917acfabf1a5024069b8f35f58e667112a203a02e906560f2f5fea711b12975dafb3adcbe5159999e40fa459898a41d88e6de9b3499d8eaa67 WHIRLPOOL 93f802f9af6491cb6512c5eb8cffbda5256ca23cc79dfca98b1774b539c4ee9fed7ce5d36314c275f696307d60c680aaa79524eb3eaefa3b19273b07fe1fd9f6
+AUX firebird-3.0.2.32703.0-unbundle.patch 1786 SHA256 44b06fb13209d8d1659caa0489804306a7e5ac7fd09c8c600d801e6cf611efe1 SHA512 bb0f8cb283ee230f9128a9da16da21933a1709615b34bbfac117a0563e2451a07381b52ffc1fed665e74688ff8e2c2548f86c1413427665914cb3df8500543c5 WHIRLPOOL c52c2c6ec8ad72534995ab6a5a26495390a24ce153f6752d93d3e4336ce0165319f8f84aa171a372f6e0ebf0fe6a08fa725450244efe3fb51dabe9fad6278bc1
+AUX firebird.conf.d.2.5 270 SHA256 c95575949a2509f61dfdad0b311319c15bc4fcf98397dbf86849a208e8e49cea SHA512 ac1410f45accae1beb845eb895592524be22fd0afb457aac4146dc6dc0a79c74c7e62eb814477797a10661a57bb731ade02a2a3b3fd8f5c5ef0c3b80e809bb64 WHIRLPOOL 3a842eb9ea3ab4c97e01eb24fc04f3f46ec4f60ceeda7b6e23d27b59cfde092ae5795790c3687aa41940837b215a358943c39e616804a3529e8f48014a560920
+AUX firebird.init.d.2.5 517 SHA256 abd9b8bab283c7fe46900879ce676a5c60c9d87aaaefc7a944e6ad4e163baa05 SHA512 7bc825cf596bcb01520d8f72bd577ec2c02f25b2f3f7b261c5dd9ac9fd08dae62dff491dcc934162f06aa85fd822950555a2a2376529531cdc9c80fafb11fb5b WHIRLPOOL 843243da4b6853ff0a208d81815e8ce0547820d7b33cd0f707a9ae7396a4873de193ef7fbbab0af36518b1e9b51b786baad75dc34ade940e4293ea0556af340e
+AUX firebird.init.d.3.0 642 SHA256 bd5ceedfb6120bd5311864198e1ced08583e994968b83fe3c85cdd3a3e7adfa4 SHA512 0805311d7e4ceb9cd5266be88fe61fb7d2d7cf5bf3c9482841c6431767cba9960d4f38418629519b23cdf64893173ebd01641056123ddc7f24c1f1bbf969812b WHIRLPOOL c74515b35bc85547a2514864087c1e935b771ef6b342780e2f8036410a7bd951cc427967d3cde62587f1af4e878ba8aaf35d2c49d0e7bbe580c419a024cf7ea8
+AUX firebird.logrotate 169 SHA256 462a7273c4881b66d31fe44349aae45d1f7085ff4db848eebc5e50b2bcb7f6da SHA512 f99edc010272af28f18e2b89e420aabc204feda918a1181e477edb56612b6af97ca6bab2e39989db401eb8296e3233a64853f824af437329e117f09aa9868823 WHIRLPOOL 0bbfe1cd410c42b137f11d3fb3b8c976c3fc89990650275dab135c66dcd78b35b6d4f73a2a767a56338a519393a33be6f64887f293528878ebe139896e3da49d
+AUX firebird.xinetd 199 SHA256 c0ea0c66e17c41633c19f7bed8cc8f818a3e1afad796d8d493c3b532b498da48 SHA512 4fc963b213e3cb13f1314129a7f5e04c44e3abd3b9cd6b28ea70219e34ecceda24995dc2f1a0a8ea342b016a897726f655604aa2ae6e7035e387d706515d1bfb WHIRLPOOL 4ac8ee679d07329143d9a98fb1acf432876c65695cd188748b3d4a2e4d693817fa6ea759f0e58ca7e75aa6cee8e902b097bcfe4a66715f825bb5379492fa8ad9
+AUX firebird.xinetd.3.0 193 SHA256 db3f4d91ca0790c5737efbfab10d2b7798e12d25529c2471a80917eed88cbf38 SHA512 e02c011b55c1d6823b051d14dbfabef6d034db32ee8046adc796fdf393c837b995c270e0efdcb97950f6fead82cd73773099a247dc29961b0e8f6c4f6c0723ae WHIRLPOOL f85931422a4f82a21a97e6ff984b47a070485532e7244a2c9503220aee6e0a6a12f982e8abb2863842d56a18aad3600e5704c62e6e45b305817afefcfa152e79
+DIST Firebird-2.5.7.27050-0.tar.bz2 13402538 SHA256 0a3b68c94e9d4eab0e56c98312f0955a0ec69ec4e9e801e0a81be758f032171a SHA512 793d47a8c8395dfb6f8417253950034dcd61b6b8337e654510d2d133396e5d1fccf615fc614bbe3129a64a101e956cb8b54d7460b06e72b245518f1b5af99327 WHIRLPOOL d162deb478fcee737aa973c3d87498a8fc418cf8facabf72a4d4cbc00db213ba0f6d98a29dc9bfd00a545e55cdb702770a3e10b7db0d0211b4cb60286c63105a
+DIST Firebird-3.0.2.32703-0.tar.bz2 9536416 SHA256 1eb4ca57538b03cf1f7504f19d10c86f5b0238604d72df7fbd7f24927a66ad2d SHA512 5950d1689c77fbcda22f1bd8015321d887dec3c7ef39665428a8bda9122838e767b168442ce7d8fb3b9b80cbd1206725b0f54bd215c5c9eb1d322b546cb042e6 WHIRLPOOL 2cba1a0d395147b730d7d97e7226edcaf3b90f816a18cb9fe46fb6914771bf74d1339c956b91b8a7b5da25c354dc33899a430ae53775b941720c203010fc52dd
+DIST ib_b60_doc.zip 10530848 SHA256 8c0158678b2a2fe3ba3abfea1f5487fc5af2644d66837ab8a558f5ad6b6cfd6d SHA512 59eccf1d6b1f0410eddbc5967fd77a3d00e09749640b3f81e2f8b624f5a45461dffad4af5ec61488e941fb3d3af266fe86c0b56e6b7e023239537cb6557a145a WHIRLPOOL 5c3e17eec64d835bac8832a51acefe04c3a5ff818d1d1e69a032bae1a730fd73996a2be073d2e22bcd4ad4ee1ba2247da8271cd3a03c0326acf46eef1073033f
+EBUILD firebird-2.5.7.27050.0.ebuild 7941 SHA256 9ef2b613d8a772f05a0f5128f7f95c4398a2f60e492eaf79b9e344c43ea37eec SHA512 1dd73505254f928424ed267f7d568e825125feb0b4eb1e95b7d751897011f60f516ef811144fdb50c8db928c9533a19f41e5c5eed781f18250417b93c208e0b5 WHIRLPOOL 5efab77c3fd5cdebeec0257a8a27b324d8fe1813c5b249945c3d6af9ef9237f86d79da9e08bb3eadebc0fe13d2611eb13c9f707f27d2f7ff1bd6a496fcbedf5d
+EBUILD firebird-3.0.2.32703.0-r2.ebuild 6157 SHA256 3317033811b4d30578e8a0179912fe79256d164487f3df680d58eab4c1fd635a SHA512 cf722eda8754fdf53bbb566c694f56107430bafc057ff10f86fba8ef17d15c7c02f693f29a9c0161a6c63aaa156ecdbf82fa59c18b122f9ae500128677ee2197 WHIRLPOOL 7159e819ea8057e3a7d770976dd96cee851db88d1caa71dac1f278b46912da0e2438426f5dba75469cb24aedbe1e463c7f9ad05f503dd387fadafe60d4252957
+MISC ChangeLog 4609 SHA256 dcd2323ad938a371b7e79a19127f7a9a0883eec3f8eba9533486737bf71e43b0 SHA512 a9cab5764dd9d25f0a12652afc7ab81754c165f56d9fd89befc1ec318d3cab8b7654e7c117a0e567940d9ca6b72888529a7c219c77d6a7a04a4bd3486483c637 WHIRLPOOL 0b52d2a7a41167ffd2e747a05d3bd16fa887b1aa740fa551fd0cea413ddf82602a0305f49a89f1ff7058fef14422a1f1d0153edd67edc202d36ddabe474b48aa
+MISC ChangeLog-2015 27643 SHA256 90f3ca67c90972e18ca65eb008f8c67d5b3648a396802236ed47f9c38e96aa4b SHA512 7f93124a70de0d5c577723b218ce6e852fb422c8980d06cca1869d7beaa5007b847e4b9d5d3baa5cf3dc62a7127e50e6da19f5f736f932eb3ea92bbeaf182690 WHIRLPOOL f79f0c1ca9f54784d0e3853b00ae34c17864e037696541eb0e318fb0316af8ad09c79f10e34c86a586730bc1cc3cbc1d85b7cae665fabfe6bbed038f90d467d4
+MISC metadata.xml 891 SHA256 b26287fdd475f0eaa39dc790873d16af7d613818fe7ac0b6fe12c71df8ec1fa0 SHA512 57377261a4594289406adbe84618e011dcf338d25110501a8aa772d765cf4b0f0c892fbca0f032f49a13a869d5e9e9f99743e044ab4a6b687ca06033ed352ffa WHIRLPOOL 1719f480e44715e8ee10ce48c0cd84f107d6bc58453ae9416f675d445bc04402dcb90e00cfca446d7cc1d7d4a8b34e3bf4a6b16d418bed0fd10bb4bc81d4e70d
diff --git a/dev-db/firebird/files/firebird-2.5.1.26351.0-superclassic.patch b/dev-db/firebird/files/firebird-2.5.1.26351.0-superclassic.patch
new file mode 100644
index 000000000000..3891cc776fae
--- /dev/null
+++ b/dev-db/firebird/files/firebird-2.5.1.26351.0-superclassic.patch
@@ -0,0 +1,12 @@
+diff -Naur orig/builds/posix/Makefile.in.firebird builds/posix/Makefile.in.firebird
+--- orig/builds/posix/Makefile.in.firebird 2010-11-09 12:42:45.000000000 -0500
++++ builds/posix/Makefile.in.firebird 2011-03-07 20:26:56.612573632 -0500
+@@ -332,7 +332,7 @@
+ .PHONY: libfbembed inet_server fb_smp_server embed_gfix embed_gbak embed_isql
+ .PHONY: embed_gpre embed_util
+
+-classic_targets: $(PLAT_CLASSIC_PRE_TARGET) libfbembed inet_server fb_smp_server embed_gfix embed_gbak embed_isql \
++classic_targets: $(PLAT_CLASSIC_PRE_TARGET) libfbembed fbserver fb_smp_server embed_gfix embed_gbak embed_isql \
+ embed_gpre libfbclient embed_util embed_gdef embed_qli embed_fbudf $(PLAT_CLASSIC_POST_TARGET)
+
+ libfbembed:
diff --git a/dev-db/firebird/files/firebird-2.5.3.26780.0-deps-flags.patch b/dev-db/firebird/files/firebird-2.5.3.26780.0-deps-flags.patch
new file mode 100644
index 000000000000..506a6c07a79c
--- /dev/null
+++ b/dev-db/firebird/files/firebird-2.5.3.26780.0-deps-flags.patch
@@ -0,0 +1,59 @@
+diff -Naur Firebird-2.5.0.26074-0_orig/builds/posix/Makefile.in.firebird Firebird-2.5.0.26074-0_deps-flags/builds/posix/Makefile.in.firebird
+--- Firebird-2.5.0.26074-0_orig/builds/posix/Makefile.in.firebird 2010-11-09 12:42:45.000000000 -0500
++++ Firebird-2.5.0.26074-0_deps-flags/builds/posix/Makefile.in.firebird 2011-03-28 15:10:09.814370706 -0400
+@@ -158,7 +158,7 @@
+ # some complications particularly for super in needing to start the server
+ # that you are currently building. MOD 28-July-2002
+
+-firebird_basic: btyacc_binary external_libraries firebird_boot basic_targets
++firebird_basic: firebird_boot basic_targets
+
+ firebird_boot: updateBuildNum boot_phase1 boot_phase2
+
+diff -Naur Firebird-2.5.0.26074-0_orig/builds/posix/make.defaults Firebird-2.5.0.26074-0_deps-flags/builds/posix/make.defaults
+--- Firebird-2.5.0.26074-0_orig/builds/posix/make.defaults 2010-11-09 12:42:45.000000000 -0500
++++ Firebird-2.5.0.26074-0_deps-flags/builds/posix/make.defaults 2011-03-28 15:21:26.904370708 -0400
+@@ -138,7 +138,7 @@
+ AR= ar @AR_OPTIONS@ crsu
+ LN= @LN_S@
+ RANLIB= @RANLIB@
+-BTYACC=$(ROOT)/extern/btyacc/btyacc
++BTYACC=/usr/bin/btyacc
+
+ CC = @CC@
+ CXX = @CXX@
+diff -Naur Firebird-2.5.0.26074-0_orig/builds/posix/prefix.linux Firebird-2.5.0.26074-0_deps-flags/builds/posix/prefix.linux
+--- Firebird-2.5.0.26074-0_orig/builds/posix/prefix.linux 2010-11-09 12:42:45.000000000 -0500
++++ Firebird-2.5.0.26074-0_deps-flags/builds/posix/prefix.linux 2011-03-25 21:38:29.031037374 -0400
+@@ -18,11 +18,10 @@
+ #
+ # 2 Oct 2002, Nickolay Samofatov - Major cleanup
+
+-COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -pipe -MMD -fPIC -fmessage-length=0
+-OPTIMIZE_FLAGS=-O3 -march=i586 -mtune=i686 -fno-omit-frame-pointer
++COMMON_FLAGS=-DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -MMD -fPIC -fmessage-length=0
+ WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable
+
+-PROD_FLAGS=-DNDEBUG $(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
++PROD_FLAGS=$(COMMON_FLAGS)
+ #DEV_FLAGS=-DUSE_VALGRIND -p $(COMMON_FLAGS) $(WARN_FLAGS)
+ DEV_FLAGS=-p $(COMMON_FLAGS) $(WARN_FLAGS)
+
+diff -Naur Firebird-2.5.0.26074-0_orig/builds/posix/prefix.linux_amd64 Firebird-2.5.0.26074-0_deps-flags/builds/posix/prefix.linux_amd64
+--- Firebird-2.5.0.26074-0_orig/builds/posix/prefix.linux_amd64 2010-11-09 12:42:45.000000000 -0500
++++ Firebird-2.5.0.26074-0_deps-flags/builds/posix/prefix.linux_amd64 2011-03-25 21:39:15.134370707 -0400
+@@ -18,12 +18,11 @@
+ #
+ # 2 Oct 2002, Nickolay Samofatov - Major cleanup
+
+-COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -pipe -MMD -fPIC -fmessage-length=0
+-OPTIMIZE_FLAGS=-O3 -fno-omit-frame-pointer
++COMMON_FLAGS=-DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -MMD -fPIC -fmessage-length=0
+ WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable
+ CXXFLAGS:= $(CXXFLAGS) -fno-rtti
+
+-PROD_FLAGS=-DNDEBUG $(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
++PROD_FLAGS=$(COMMON_FLAGS)
+ #DEV_FLAGS=-DUSE_VALGRIND $(COMMON_FLAGS) $(WARN_FLAGS)
+ DEV_FLAGS=$(COMMON_FLAGS) $(WARN_FLAGS)
+
diff --git a/dev-db/firebird/files/firebird-3.0.2.32703.0-cloop-compiler.patch b/dev-db/firebird/files/firebird-3.0.2.32703.0-cloop-compiler.patch
new file mode 100644
index 000000000000..363602bed8f4
--- /dev/null
+++ b/dev-db/firebird/files/firebird-3.0.2.32703.0-cloop-compiler.patch
@@ -0,0 +1,15 @@
+Source: LibreOffice git master
+
+
+diff -ur firebird.org/extern/cloop/Makefile firebird/extern/cloop/Makefile
+--- firebird.org/extern/cloop/Makefile 2016-08-17 18:32:59.078044357 +0200
++++ firebird/extern/cloop/Makefile 2016-08-17 18:33:14.430518561 +0200
+@@ -4,8 +4,6 @@
+
+ TARGET := release
+
+-CC := gcc
+-CXX := g++
+ LD := $(CXX)
+
+ SRC_DIR := src
diff --git a/dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch b/dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch
new file mode 100644
index 000000000000..e1361415c03b
--- /dev/null
+++ b/dev-db/firebird/files/firebird-3.0.2.32703.0-gcc6.patch
@@ -0,0 +1,19 @@
+commit 3618aa2171674babf79ef935aa049c40a3db1321
+Author: asfernandes <asfernandes@users.sourceforge.net>
+Date: Sat Mar 5 03:39:36 2016 +0000
+
+ Make the generated code compatible with gcc 6 in C++-14 mode.
+
+diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp
+index 2af96c6..2dcffd6 100644
+--- a/src/gpre/c_cxx.cpp
++++ b/src/gpre/c_cxx.cpp
+@@ -2820,7 +2820,7 @@ static void gen_request(const gpre_req* request)
+ printa(0, "static %sshort\n isc_%dl = %d;",
+ (request->req_flags & REQ_extend_dpb) ? "" : CONST_STR,
+ request->req_ident, request->req_length);
+- printa(0, "static %schar\n isc_%d [] = {", CONST_STR, request->req_ident);
++ printa(0, "static %sunsigned char\n isc_%d [] = {", CONST_STR, request->req_ident);
+
+ const TEXT* string_type = "blr";
+ if (gpreGlob.sw_raw)
diff --git a/dev-db/firebird/files/firebird-3.0.2.32703.0-unbundle.patch b/dev-db/firebird/files/firebird-3.0.2.32703.0-unbundle.patch
new file mode 100644
index 000000000000..6fdd657223d4
--- /dev/null
+++ b/dev-db/firebird/files/firebird-3.0.2.32703.0-unbundle.patch
@@ -0,0 +1,51 @@
+diff -ruN Firebird-3.0.2.32703-0.orig/builds/posix/Makefile.in Firebird-3.0.2.32703-0/builds/posix/Makefile.in
+--- Firebird-3.0.2.32703-0.orig/builds/posix/Makefile.in 2017-03-21 10:11:35.000000000 +0100
++++ Firebird-3.0.2.32703-0/builds/posix/Makefile.in 2017-05-14 01:32:34.032241679 +0200
+@@ -123,7 +123,6 @@
+ #
+
+ extern:
+- $(MAKE) -C $(ROOT)/extern/btyacc
+ $(MAKE) -C $(ROOT)/extern/cloop TARGET=release WITH_FPC=0 BUILD_DIR=$(TMP_ROOT)/cloop OUT_DIR=$(GEN_ROOT)/$(TARGET)/cloop
+
+ ifeq ($(TOMBUILD_FLG),Y)
+@@ -648,7 +647,7 @@
+ # various cleaning
+ #
+ .PHONY: clean clean_objects clean_dependancies clean_extern_objects clean_build \
+- clean_gpre_gen clean_icu clean_dbs clean_examples clean_makefiles \
++ clean_gpre_gen clean_dbs clean_examples clean_makefiles \
+ clean_editline clean_all
+
+
+@@ -669,8 +668,6 @@
+ $(RM) $(ROOT)/libtool
+ $(RM_R) $(ROOT)/autom4te.cache
+ -$(MAKE) -C $(ROOT)/extern/editline distclean
+-# -$(MAKE) -C $(ROOT)/extern/icu/source distclean
+- -$(MAKE) -C $(ROOT)/extern/btyacc distclean
+
+ clean_dbs:
+ $(RM) *.fdb *.FDB msg.timestamp
+@@ -687,9 +684,6 @@
+ clean_editline:
+ -$(MAKE) -C $(ROOT)/extern/editline clean
+
+-#clean_icu:
+-# -$(MAKE) -C $(ROOT)/extern/icu/source clean
+-
+ clean_tommath:
+ -$(MAKE) -C $(ROOT)/extern/libtommath clean
+
+diff -ruN Firebird-3.0.2.32703-0.orig/builds/posix/make.defaults Firebird-3.0.2.32703-0/builds/posix/make.defaults
+--- Firebird-3.0.2.32703-0.orig/builds/posix/make.defaults 2017-03-21 10:11:35.000000000 +0100
++++ Firebird-3.0.2.32703-0/builds/posix/make.defaults 2017-05-14 01:29:54.590235045 +0200
+@@ -155,7 +155,7 @@
+ AR= ar @AR_OPTIONS@
+ LN= @LN_S@
+ RANLIB= @RANLIB@
+-BTYACC=$(ROOT)/extern/btyacc/btyacc
++BTYACC=/usr/bin/btyacc
+ CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
+
+ CC = @CC@
diff --git a/dev-db/firebird/files/firebird.conf.d.2.5 b/dev-db/firebird/files/firebird.conf.d.2.5
new file mode 100644
index 000000000000..625963d0c13b
--- /dev/null
+++ b/dev-db/firebird/files/firebird.conf.d.2.5
@@ -0,0 +1,7 @@
+FBUSER=firebird
+FBGROUP=firebird
+FIREBIRD=/usr/lib/firebird
+FBGUARD=/usr/sbin/fbguard
+PIDFILE=/var/run/firebird/firebird.pid
+FB_OPTS="-forever -daemon -pidfile $PIDFILE"
+LD_LIBRARY_PATH=/usr/lib/:/usr/lib/firebird/intl/:/usr/lib/firebird/plugins/:/usr/lib/firebird/UDF/
diff --git a/dev-db/firebird/files/firebird.init.d.2.5 b/dev-db/firebird/files/firebird.init.d.2.5
new file mode 100644
index 000000000000..9c9bfb92d601
--- /dev/null
+++ b/dev-db/firebird/files/firebird.init.d.2.5
@@ -0,0 +1,30 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -o $FBUSER "$(dirname $PIDFILE)"
+}
+
+start(){
+ ebegin "Starting Firebird server"
+ start-stop-daemon --start --pidfile $PIDFILE --user $FBUSER --group $FBGROUP --exec $FBGUARD -- $FB_OPTS
+ eend $?
+}
+
+stop(){
+ ebegin "Stopping Firebird server"
+ start-stop-daemon --stop --name fbguard
+ eend $?
+}
+
+restart(){
+ svc_stop
+ sleep 1
+ svc_start
+}
+
diff --git a/dev-db/firebird/files/firebird.init.d.3.0 b/dev-db/firebird/files/firebird.init.d.3.0
new file mode 100644
index 000000000000..9fd4f8504769
--- /dev/null
+++ b/dev-db/firebird/files/firebird.init.d.3.0
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+name=${RC_SVCNAME}
+
+fbhomedir="/var/run/firebird"
+fblogdir="/var/log/firebird"
+pidfile="${fbhomedir}/firebird.pid"
+command="/usr/sbin/fbguard"
+command_args="-forever -daemon -pidfile $pidfile"
+
+start_stop_daemon_args="-p ${pidfile} -u ${FBUSER:-firebird}:${FBGROUP:-firebird}"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -q -d -m 0770 -o ${FBUSER:-firebird}:${FBGROUP:-firebird} ${fbhomedir} || return 1
+ checkpath -q -d -m 0770 -o ${FBUSER:-firebird}:${FBGROUP:-firebird} ${fblogdir} || return 1
+}
diff --git a/dev-db/firebird/files/firebird.logrotate b/dev-db/firebird/files/firebird.logrotate
new file mode 100644
index 000000000000..c87cd43f30f8
--- /dev/null
+++ b/dev-db/firebird/files/firebird.logrotate
@@ -0,0 +1,10 @@
+/var/log/firebird/firebird.log {
+ compress
+ weekly
+ missingok
+ rotate 52
+ size=+1024k
+ delaycompress
+ notifempty
+ create 644 firebird
+ }
diff --git a/dev-db/firebird/files/firebird.xinetd b/dev-db/firebird/files/firebird.xinetd
new file mode 100644
index 000000000000..01fc102ee3a8
--- /dev/null
+++ b/dev-db/firebird/files/firebird.xinetd
@@ -0,0 +1,11 @@
+service gds_db
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = firebird
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = /usr/bin/fb_inet_server
+ disable = yes
+}
diff --git a/dev-db/firebird/files/firebird.xinetd.3.0 b/dev-db/firebird/files/firebird.xinetd.3.0
new file mode 100644
index 000000000000..4e094bdf0627
--- /dev/null
+++ b/dev-db/firebird/files/firebird.xinetd.3.0
@@ -0,0 +1,11 @@
+service gds_db
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = firebird
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = /usr/bin/firebird
+ disable = yes
+}
diff --git a/dev-db/firebird/firebird-2.5.7.27050.0.ebuild b/dev-db/firebird/firebird-2.5.7.27050.0.ebuild
new file mode 100644
index 000000000000..b118e34f5f20
--- /dev/null
+++ b/dev-db/firebird/firebird-2.5.7.27050.0.ebuild
@@ -0,0 +1,275 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic user versionator
+
+MY_P=${PN/f/F}-$(replace_version_separator 4 -)
+
+DESCRIPTION="Relational database offering many ANSI SQL:2003 and some SQL:2008 features"
+HOMEPAGE="https://www.firebirdsql.org/"
+SRC_URI="
+ mirror://sourceforge/firebird/${MY_P}.tar.bz2
+ doc? ( ftp://ftpc.inprise.com/pub/interbase/techpubs/ib_b60_doc.zip )"
+
+LICENSE="IDPL Interbase-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug doc examples +superserver xinetd"
+REQUIRED_USE="?? ( superserver xinetd )"
+
+CDEPEND="
+ dev-libs/icu:=
+ dev-libs/libedit
+"
+DEPEND="${CDEPEND}
+ >=dev-util/btyacc-3.0-r2
+ doc? ( app-arch/unzip )
+"
+RDEPEND="${CDEPEND}
+ xinetd? ( virtual/inetd )
+ !sys-cluster/ganglia
+"
+
+RESTRICT="userpriv"
+
+PATCHES=( "${FILESDIR}"/${PN}-2.5.3.26780.0-deps-flags.patch )
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup firebird 450
+ enewuser firebird 450 /bin/sh /usr/$(get_libdir)/firebird firebird
+}
+
+check_sed() {
+ MSG="sed of $3, required $2 line(s) modified $1"
+ einfo "${MSG}"
+ [[ $1 -ge $2 ]] || die "${MSG}"
+}
+
+src_unpack() {
+ unpack "${MY_P}.tar.bz2"
+ if use doc; then
+ # Unpack docs
+ mkdir "manuals" || die
+ cd "manuals" || die
+ unpack ib_b60_doc.zip
+ fi
+}
+
+src_prepare() {
+ use xinetd || eapply "${FILESDIR}"/${PN}-2.5.1.26351.0-superclassic.patch
+
+ default
+
+ # Rename references to isql to fbsql
+ # sed vs patch for portability and addtional location changes
+ check_sed "$(sed -i -e 's:"isql :"fbsql :w /dev/stdout' \
+ src/isql/isql.epp | wc -l)" "1" "src/isql/isql.epp" # 1 line
+ check_sed "$(sed -i -e 's:isql :fbsql :w /dev/stdout' \
+ src/msgs/history2.sql | wc -l)" "4" "src/msgs/history2.sql" # 4 lines
+ check_sed "$(sed -i -e 's:--- ISQL:--- FBSQL:w /dev/stdout' \
+ -e 's:isql :fbsql :w /dev/stdout' \
+ -e 's:ISQL :FBSQL :w /dev/stdout' \
+ src/msgs/messages2.sql | wc -l)" "6" "src/msgs/messages2.sql" # 6 lines
+
+ find "${S}" -name \*.sh -exec chmod +x {} + || die
+ rm -r "${S}"/extern/{btyacc,editline,icu} || die
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -fprefetch-loop-arrays
+ filter-mfpmath sse
+
+ econf \
+ --prefix=/usr/$(get_libdir)/firebird \
+ $(use_enable superserver) \
+ $(use_enable debug) \
+ --with-editline \
+ --with-system-editline \
+ --with-system-icu \
+ --with-fbbin=/usr/bin \
+ --with-fbsbin=/usr/sbin \
+ --with-fbconf=/etc/${PN} \
+ --with-fblib=/usr/$(get_libdir) \
+ --with-fbinclude=/usr/include \
+ --with-fbdoc=/usr/share/doc/${P} \
+ --with-fbudf=/usr/$(get_libdir)/${PN}/UDF \
+ --with-fbsample=/usr/share/doc/${P}/examples \
+ --with-fbsample-db=/usr/share/doc/${P}/examples/db \
+ --with-fbhelp=/usr/$(get_libdir)/${PN}/help \
+ --with-fbintl=/usr/$(get_libdir)/${PN}/intl \
+ --with-fbmisc=/usr/share/${PN} \
+ --with-fbsecure-db=/etc/${PN} \
+ --with-fbmsg=/usr/$(get_libdir)/${PN} \
+ --with-fblog=/var/log/${PN}/ \
+ --with-fbglock=/var/run/${PN} \
+ --with-fbplugins=/usr/$(get_libdir)/${PN}/plugins \
+ --with-gnu-ld \
+ ${myconf}
+}
+
+src_compile() {
+ MAKEOPTS="${MAKEOPTS/-j*/-j1} ${MAKEOPTS/-j/CPU=}"
+ emake
+}
+
+src_install() {
+ cd "gen/${PN}" || die
+
+ if use doc; then
+ dodoc "${S}"/doc/*.pdf
+ find "${WORKDIR}"/manuals -type f -iname "*.pdf" -exec dodoc '{}' + || die
+ fi
+
+ doheader include/*
+
+ rm lib/libfbstatic.a || die "failed to remove libfbstatic.a"
+
+ insinto /usr/$(get_libdir)
+ dolib.so lib/*.so*
+
+ # links for backwards compatibility
+ dosym libfbclient.so /usr/$(get_libdir)/libgds.so
+ dosym libfbclient.so /usr/$(get_libdir)/libgds.so.0
+ dosym libfbclient.so /usr/$(get_libdir)/libfbclient.so.1
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins *.msg
+
+ einfo "Renaming isql -> fbsql"
+ mv bin/isql bin/fbsql || die "failed to rename isql -> fbsql"
+
+ local bins="fbsql fbsvcmgr fbtracemgr gbak gdef gfix gpre gsec gstat nbackup qli"
+ for bin in ${bins}; do
+ dobin bin/${bin}
+ done
+
+ dosbin bin/fb_lock_print
+ # SuperServer
+ if use superserver ; then
+ dosbin bin/{fbguard,fbserver}
+ # ClassicServer
+ elif use xinetd ; then
+ dosbin bin/fb_inet_server
+ # SuperClassic
+ else
+ dosbin bin/{fbguard,fb_smp_server}
+
+ #Temp should not be necessary, need to patch/fix
+ dosym ../../libib_util.so /usr/$(get_libdir)/${PN}/lib/libib_util.so
+ fi
+
+ exeinto /usr/bin/${PN}
+ exeopts -m0755
+ doexe bin/{changeRunUser,restoreRootRunUser,changeDBAPassword}.sh
+
+ insinto /usr/$(get_libdir)/${PN}/help
+ doins help/help.fdb
+
+ exeinto /usr/$(get_libdir)/firebird/intl
+ dolib.so intl/libfbintl.so
+ dosym ../../libfbintl.so /usr/$(get_libdir)/${PN}/intl/fbintl
+ dosym libfbintl.so /usr/$(get_libdir)/libfbintl.so.1
+ dosym /etc/firebird/fbintl.conf /usr/$(get_libdir)/${PN}/intl/fbintl.conf
+
+ exeinto /usr/$(get_libdir)/${PN}/plugins
+ dolib.so plugins/libfbtrace.so
+ dosym ../../libfbtrace.so /usr/$(get_libdir)/${PN}/plugins/libfbtrace.so
+ dosym libfbtrace.so /usr/$(get_libdir)/libfbtrace.so.0
+
+ exeinto /usr/$(get_libdir)/${PN}/UDF
+ doexe UDF/*.so
+
+ insinto /usr/share/${PN}/upgrade
+ doins -r "${S}"/src/misc/upgrade/v2/*
+
+ insinto /etc/${PN}
+ insopts -m0644 -o firebird -g firebird
+ doins ../install/misc/*.conf
+ insopts -m0660 -o firebird -g firebird
+ doins security2.fdb
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ else
+ newinitd "${FILESDIR}/${PN}.init.d.2.5" ${PN}
+ newconfd "${FILESDIR}/${PN}.conf.d.2.5" ${PN}
+ fperms 640 /etc/conf.d/${PN}
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+ fperms 0644 /etc/logrotate.d/${PN}
+
+ diropts -m 755 -o firebird -g firebird
+ dodir /var/log/${PN}
+ keepdir /var/log/${PN}
+
+ use examples && docinto examples
+}
+
+pkg_postinst() {
+ # Hack to fix ownership/perms
+ chown -fR firebird:firebird "${ROOT}/etc/${PN}" "${ROOT}/usr/$(get_libdir)/${PN}"
+ chmod 750 "${ROOT}/etc/${PN}"
+}
+
+pkg_config() {
+ # if found /etc/security.gdb from previous install, backup, and restore as
+ # /etc/security2.fdb
+ if [[ -f "${ROOT}/etc/firebird/security.gdb" ]] ; then
+ # if we have scurity2.fdb already, back it 1st
+ if [[ -f "${ROOT}/etc/firebird/security2.fdb" ]] ; then
+ cp "${ROOT}/etc/firebird/security2.fdb" "${ROOT}/etc/firebird/security2.fdb.old" || die
+ fi
+ gbak -B "${ROOT}/etc/firebird/security.gdb" "${ROOT}/etc/firebird/security.gbk" || die
+ gbak -R "${ROOT}/etc/firebird/security.gbk" "${ROOT}/etc/firebird/security2.fdb" || die
+ mv "${ROOT}/etc/firebird/security.gdb" "${ROOT}/etc/firebird/security.gdb.old" || die
+ rm "${ROOT}/etc/firebird/security.gbk" || die
+
+ # make sure they are readable only to firebird
+ chown firebird:firebird "${ROOT}/etc/firebird/{security.*,security2.*}" || die
+ chmod 660 "${ROOT}/etc/firebird/{security.*,security2.*}" || die
+
+ echo
+ einfo "Converted old security.gdb to security2.fdb, security.gdb has been "
+ einfo "renamed to security.gdb.old. if you had previous security2.fdb, "
+ einfo "it's backed to security2.fdb.old (all under ${ROOT}/etc/firebird)."
+ echo
+ fi
+
+ # we need to enable local access to the server
+ if [[ ! -f "${ROOT}/etc/hosts.equiv" ]] ; then
+ touch "${ROOT}/etc/hosts.equiv" || die
+ chown root:0 "${ROOT}/etc/hosts.equiv" || die
+ chmod u=rw,go=r "${ROOT}/etc/hosts.equiv" || die
+ fi
+
+ # add 'localhost.localdomain' to the hosts.equiv file...
+ if grep -q 'localhost.localdomain$' "${ROOT}/etc/hosts.equiv" ; then
+ echo "localhost.localdomain" >> "${ROOT}/etc/hosts.equiv" || die
+ einfo "Added localhost.localdomain to ${ROOT}/etc/hosts.equiv"
+ fi
+
+ # add 'localhost' to the hosts.equiv file...
+ if grep -q 'localhost$' "${ROOT}/etc/hosts.equiv" ; then
+ echo "localhost" >> "${ROOT}/etc/hosts.equiv" || die
+ einfo "Added localhost to ${ROOT}/etc/hosts.equiv"
+ fi
+
+ HS_NAME=`hostname`
+ if grep -q ${HS_NAME} "${ROOT}/etc/hosts.equiv" ; then
+ echo "${HS_NAME}" >> "${ROOT}/etc/hosts.equiv" || die
+ einfo "Added ${HS_NAME} to ${ROOT}/etc/hosts.equiv"
+ fi
+
+ einfo "If you're using UDFs, please remember to move them"
+ einfo "to /usr/$(get_libdir)/firebird/UDF"
+}
diff --git a/dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild b/dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild
new file mode 100644
index 000000000000..0ffc66ca5917
--- /dev/null
+++ b/dev-db/firebird/firebird-3.0.2.32703.0-r2.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic user versionator
+
+MY_P=${PN/f/F}-$(replace_version_separator 4 -)
+
+DESCRIPTION="Relational database offering many ANSI SQL:2003 and some SQL:2008 features"
+HOMEPAGE="https://www.firebirdsql.org/"
+SRC_URI="
+ mirror://sourceforge/firebird/${MY_P}.tar.bz2
+ doc? ( ftp://ftpc.inprise.com/pub/interbase/techpubs/ib_b60_doc.zip )"
+
+LICENSE="IDPL Interbase-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc examples +server xinetd"
+
+# FIXME: cloop?
+CDEPEND="
+ dev-libs/libtommath
+ dev-libs/icu:=
+ dev-libs/libedit
+"
+DEPEND="${CDEPEND}
+ >=dev-util/btyacc-3.0-r2
+ doc? ( app-arch/unzip )
+"
+RDEPEND="${CDEPEND}
+ xinetd? ( virtual/inetd )
+ !sys-cluster/ganglia
+"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${P}"-unbundle.patch
+ "${FILESDIR}/${P}"-gcc6.patch
+ "${FILESDIR}/${P}"-cloop-compiler.patch
+)
+
+pkg_pretend() {
+ if [[ -e /var/run/${PN}/${PN}.pid ]] ; then
+ ewarn
+ ewarn "The presence of server connections may prevent isql or gsec"
+ ewarn "from establishing an embedded connection. Accordingly,"
+ ewarn "creating employee.fdb or security3.fdb could fail."
+ ewarn "It is more secure to stop the firebird daemon before running emerge."
+ ewarn
+ fi
+}
+
+pkg_setup() {
+ enewgroup firebird 450
+ enewuser firebird 450 /bin/sh /usr/$(get_libdir)/firebird firebird
+}
+
+check_sed() {
+ MSG="sed of $3, required $2 line(s) modified $1"
+ einfo "${MSG}"
+ [[ $1 -ge $2 ]] || die "${MSG}"
+}
+
+src_unpack() {
+ unpack "${MY_P}.tar.bz2"
+ if use doc; then
+ # Unpack docs
+ mkdir "manuals" || die
+ cd "manuals" || die
+ unpack ib_b60_doc.zip
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Rename references to isql to fbsql
+ # sed vs patch for portability and addtional location changes
+ check_sed "$(sed -i -e 's:"isql :"fbsql :w /dev/stdout' \
+ src/isql/isql.epp | wc -l)" "1" "src/isql/isql.epp" # 1 line
+ check_sed "$(sed -i -e 's:isql :fbsql :w /dev/stdout' \
+ src/msgs/history2.sql | wc -l)" "4" "src/msgs/history2.sql" # 4 lines
+ check_sed "$(sed -i -e 's:--- ISQL:--- FBSQL:w /dev/stdout' \
+ -e 's:isql :fbsql :w /dev/stdout' \
+ -e 's:ISQL :FBSQL :w /dev/stdout' \
+ src/msgs/messages2.sql | wc -l)" "6" "src/msgs/messages2.sql" # 6 lines
+
+ find "${S}" -name \*.sh -exec chmod +x {} + || die
+ rm -r "${S}"/extern/{btyacc,editline,icu} || die
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -fprefetch-loop-arrays
+ filter-mfpmath sse
+
+ # otherwise this doesnt build with gcc-6
+ # http://tracker.firebirdsql.org/browse/CORE-5099
+ append-cflags -fno-sized-deallocation -fno-delete-null-pointer-checks
+ append-cxxflags -fno-sized-deallocation -fno-delete-null-pointer-checks
+
+ econf \
+ --prefix=/usr/$(get_libdir)/firebird \
+ --with-editline \
+ --with-system-editline \
+ --with-fbbin=/usr/bin \
+ --with-fbsbin=/usr/sbin \
+ --with-fbconf=/etc/${PN} \
+ --with-fblib=/usr/$(get_libdir) \
+ --with-fbinclude=/usr/include \
+ --with-fbdoc=/usr/share/doc/${PF} \
+ --with-fbudf=/usr/$(get_libdir)/${PN}/UDF \
+ --with-fbsample=/usr/share/doc/${PF}/examples \
+ --with-fbsample-db=/usr/share/doc/${PF}/examples/db \
+ --with-fbhelp=/usr/$(get_libdir)/${PN}/help \
+ --with-fbintl=/usr/$(get_libdir)/${PN}/intl \
+ --with-fbmisc=/usr/share/${PN} \
+ --with-fbsecure-db=/etc/${PN} \
+ --with-fbmsg=/usr/$(get_libdir)/${PN} \
+ --with-fblog=/var/log/${PN}/ \
+ --with-fbglock=/var/run/${PN} \
+ --with-fbplugins=/usr/$(get_libdir)/${PN}/plugins \
+ --with-gnu-ld \
+ ${myconf}
+}
+
+# from linux underground, merging into this here
+src_install() {
+ if use doc; then
+ dodoc -r doc
+ find "${WORKDIR}"/manuals -type f -iname "*.pdf" -exec dodoc '{}' + || die
+ fi
+
+ cd "${S}/gen/Release/${PN}" || die
+
+ doheader include/*
+ dolib.so lib/*.so*
+
+ # links for backwards compatibility
+ insinto /usr/$(get_libdir)
+ dosym libfbclient.so /usr/$(get_libdir)/libgds.so
+ dosym libfbclient.so /usr/$(get_libdir)/libgds.so.0
+ dosym libfbclient.so /usr/$(get_libdir)/libfbclient.so.1
+
+ insinto /usr/share/${PN}/msg
+ doins *.msg
+
+ use server || return
+
+ einfo "Renaming isql -> fbsql"
+ mv bin/isql bin/fbsql || die "failed to rename isql -> fbsql"
+
+ dobin bin/{fb_config,fbsql,fbsvcmgr,fbtracemgr,gbak,gfix,gpre,gsec,gsplit,gstat,nbackup,qli}
+ dosbin bin/{firebird,fbguard,fb_lock_print}
+
+ insinto /usr/share/${PN}/help
+ # why???
+ insopts -m0660 -o firebird -g firebird
+ doins help/help.fdb
+
+ exeinto /usr/$(get_libdir)/${PN}/intl
+ doexe intl/libfbintl.so
+ dosym libfbintl.so /usr/$(get_libdir)/${PN}/intl/fbintl.so
+
+ insinto /usr/$(get_libdir)/${PN}/intl
+ insopts -m0644 -o root -g root
+ doins intl/fbintl.conf
+
+ # plugins
+ exeinto /usr/$(get_libdir)/${PN}/plugins
+ doexe plugins/*.so
+ exeinto /usr/$(get_libdir)/${PN}/plugins/udr
+ doexe plugins/udr/*.so
+
+ exeinto /usr/$(get_libdir)/${PN}/UDF
+ doexe UDF/*.so
+
+ # logging (do we really need the perms?)
+ diropts -m 755 -o firebird -g firebird
+ dodir /var/log/${PN}
+ keepdir /var/log/${PN}
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # configuration files
+ insinto /etc/${PN}/plugins
+ doins plugins/udr_engine.conf
+ insinto /etc/${PN}
+ doins {databases,fbtrace,firebird,plugins}.conf
+
+ # install secutity3.fdb
+ insopts -m0660 -o firebird -g firebird
+ doins security3.fdb
+
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd.3.0" ${PN}
+ else
+ newinitd "${FILESDIR}/${PN}.init.d.3.0" ${PN}
+ fi
+
+ if use examples; then
+ cd examples
+ insinto /usr/share/${PN}/examples
+ insopts -m0644 -o root -g root
+ doins -r api
+ doins -r dbcrypt
+ doins -r include
+ doins -r interfaces
+ doins -r package
+ doins -r stat
+ doins -r udf
+ doins -r udr
+ doins CMakeLists.txt
+ doins functions.c
+ doins README
+ insinto /usr/share/${PN}/examples/empbuild
+ insopts -m0660 -o firebird -g firebird
+ doins empbuild/employee.fdb
+ fi
+
+ einfo
+ elog "Starting with version 3, server mode is set in firebird.conf"
+ elog "The default setting is superserver."
+ einfo
+ elog "If you're using UDFs, please remember to move them to /usr/$(get_libdir)/firebird/UDF"
+ einfo
+ ewarn "${CATEGORY}/${PF} is still a tad experimental. Please test and file bugs!"
+}
diff --git a/dev-db/firebird/metadata.xml b/dev-db/firebird/metadata.xml
new file mode 100644
index 000000000000..a6eba6edad06
--- /dev/null
+++ b/dev-db/firebird/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+ Firebird is a relational database offering many ANSI SQL standard
+ features that runs on Linux, Windows, and a variety of Unix platforms.
+ Firebird offers excellent concurrency, high performance, and powerful
+ language support for stored procedures and triggers. It has been used
+ in production systems, under a variety of names, since 1981.
+ </longdescription>
+ <use>
+ <flag name="superserver">Install SuperServer</flag>
+ <flag name="server">Install the server components of Firebird, not just the client</flag>
+ <flag name="xinetd">Install ClassicServer</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">firebird</remote-id>
+ </upstream>
+ <maintainer type="project">
+ <email>office@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/freetds/Manifest b/dev-db/freetds/Manifest
new file mode 100644
index 000000000000..2407f9958509
--- /dev/null
+++ b/dev-db/freetds/Manifest
@@ -0,0 +1,11 @@
+AUX without-flags.patch 1859 SHA256 8ec0e14096ad1da12faadcae07315a0d0118f940a670e866de79ec4036a2658b SHA512 b981dd2ddab06e4c163d847de9a1086515775abacbbcf10be5d67388ce5502a37a23bb6c94eaf36082dc36d30060ff12a38fd9ceb6b93e3f8116d2de7ddcb2e7 WHIRLPOOL a2d39825fd8c45f77d9e2a7a18e53d270ee389e6c20d54bed3904cb4c635128881a44c5ad4a5e0acdfab3aec3537536304c36180a5949f36121f1074ea0c94a8
+DIST freetds-0.91.tar.gz 2136329 SHA256 6a8148bd803aebceac6862b0dead1c5d9659f7e1038993abfe0ce8febb322465 SHA512 4dadafe49848ab5505b0fa5bd650e19e7652c3e1181d3c49f087c50ed055f395eaf5917a99744ed3594e4af9032c4e18f397af58fb1010e695ac2c0bc601b5e3 WHIRLPOOL 63662b56011edb6d22ce28cc7bad3af272ff81862f0d8ff65b113af260e3c8d05a9d941c1cf4b8039b99f460c3a5c8364dd69d42d8e98c0c92530462f732dec2
+DIST freetds-1.00.41.tar.gz 2904915 SHA256 f054f1ac09d933527b634e081f5b36856669b7a507601cde93eda32174681e59 SHA512 dec3197a6478fc59b7386f9a7a562df8b581bba7184210c42f26827e957b9746e6820d687a9c6cbcd7c825fc5d4f556547c0483d06c786a064d5c4859db4daa1 WHIRLPOOL de396ba6fa04c7fb580614297c62f61c77a606417e749eb1dd4ad352e7f87cea05ed1567d7dd7f97b189f83d48f711e1254a59d0f9c897050b505e31f6fe8da7
+DIST freetds-1.00.54.tar.gz 2907015 SHA256 b2dc627b87762ffb665ce318121aec3a63ddd430132aa7fbdafb02297dc8f1f0 SHA512 a2a5034705fe06ee38b085f980f6ddf086789abc9485331fdaf829e7243f7ba95a5f0c612d7e3ec9e10f28a5c8b3a3fd8e7853d66f67110bd860afce949c798c WHIRLPOOL 519cf22370ed0baab6bd24e0d9e237703157e8be9a5ff8af1ec9307d9faf3e961df8c6d623ce53998efa28fe884897bb4190f2f4f7e29642c8c465b82ea64c37
+EBUILD freetds-0.91.ebuild 1118 SHA256 a74e0519417c01b2d4fb599773125dba5bfd4f6b2708c23659edba3c13860f85 SHA512 c4623548cc786c3f114f71456011e2b9a5f225e3a032c7268dd7152bb083aac8242af24f585d9ce40baf2e1f5a616cdbf003997874ead4621af8007804d3c3e1 WHIRLPOOL ada51deda98d8ba46318d077e8eb4ba9e591df63d740745bbcc9df2aa5fcbe90547302b9dfb13ad2542640e06577010b2170c0c88ddec3e7bac5d951cca0019f
+EBUILD freetds-1.00.41.ebuild 1989 SHA256 facba6cef0d048d4602b1fd355814c2bcc664d12c909d59f5bf75cda2f45586d SHA512 cb6fa1e777c9ffb4656d9ea850b4bb3050a549890a0e4e961d30578e318e88c923cf53dd59d2ec93b806b460cfd2825452bbd456c32e6cddcfa04315afa75db2 WHIRLPOOL eb122158155142dc4890b1749e2cf5c5fd2d63c03e74af5b10a4bec94cedfa9bd09120fa1e6e40cf7313dc7380bca1224dd5a6da09470a9279caa3817ff18f78
+EBUILD freetds-1.00.54-r1.ebuild 2064 SHA256 e45ff69ab23deefc69f7929b45ff0dbe468f5fa3c3290f1462e85d1cd7528173 SHA512 48931c5f0e49cdd9f07e413339a0e647a4b48eec562cfe337a6c57243d11a99d47977d8987902a6ecafa3930a94a1102912c57359e146f155f6fcf6ee5753ce0 WHIRLPOOL 632ca8142b6dfb780d1f48d6162e48126edf1731b8e1b9ba3317f40bb595eca621afe7cba0df9c68ff98ece9513c3f10a9c86ce956b5e80c0ee990214c20ff5f
+EBUILD freetds-9999.ebuild 1603 SHA256 1fd3bf5f72212d4c2dc5ed420bbc2d6a08f7cbd08167b496818f96e9c9682885 SHA512 264144b12f57bd34d1ace56458e4ea2cda0f4f5fd9f789373d8e7b4695cdf910562441359218b0c7c8bac446c8fa5673c56a37d0cfef444fc6d11fe57f2121b9 WHIRLPOOL 49a1632ef4172d3675a1e8909dc7cbe8edcf2f52f0438b9ca36f1c77ab6762b2be645126e27bf2ac4690610572f0fa7de1fd8961c19871fa7e859cb781d58d75
+MISC ChangeLog 3598 SHA256 d291a3c0f91ed7cc8428525f9d569fe6fcfcc480d56a638197a0cd7427e8b99b SHA512 da0610072732a93d3f5e1631a143d8ae47890692379e9914cbac321307b527477185fd052eb1763f839dc26f65458ba7291485e9cf36503c0c71e9e08967e977 WHIRLPOOL 5063594adc62ada60ec780eb112ba021a5f013e0707b580bd5a49993b0c241643f31e80c7b8cb9045544ea601f882c0f14d76e0bcbc745658c0c6b703361f5dd
+MISC ChangeLog-2015 9309 SHA256 bd6c799c90c309912b44aa691a47547ba697e47ba032d2328230c325b9d93b1f SHA512 19eb3a05c7729d750a4ae4ebac3bfbf0f4d07aa49122cee00b912b7d4c7d1ca7800882086b2c7aebca3ba15bf8f852c2bebbc253e8885a2e8068d98d3590f038 WHIRLPOOL 8c8d97e60db87bb3db83d219161d91fa08b30ba2b44dfd84021dea7912690858f60b21e04bc8af22216e619ff744742a5520807b329ae19ff3eda15489652bb1
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/freetds/files/without-flags.patch b/dev-db/freetds/files/without-flags.patch
new file mode 100644
index 000000000000..1f04a90ac6af
--- /dev/null
+++ b/dev-db/freetds/files/without-flags.patch
@@ -0,0 +1,48 @@
+From c4b9d766e009273c70d8953767ef2fcb95f65314 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Fri, 11 Aug 2017 16:45:15 -0400
+Subject: [PATCH] configure.ac: support "without" versions of three ./configure
+ flags.
+
+The --with-iodbc, --with-unixodbc, and --with-odbc-nodm flags all use
+the standard AC_ARG_WITH macro. The resulting ./configure script
+accepts e.g. --without-iodbc to indicate that the user does not want
+to enable iODBC, and in place of a path the word "no" is placed into
+the $with_iodbc variable. The current configure.ac doesn't handle that
+and instead treats "no" as a path. This commit updates configure.ac to
+ignore "no" as the value of those three flags.
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4f41033ae..9dfe12bb7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -546,7 +546,7 @@ esac
+
+ AC_ARG_WITH(iodbc,
+ AS_HELP_STRING([--with-iodbc=DIR], [build odbc driver against iODBC in DIR]))
+-if test "$with_iodbc"; then
++if test "x$with_iodbc" != "x" -a "x$with_iodbc" != "xno"; then
+ if echo "$with_iodbc" | grep -v '^/'; then
+ with_iodbc="$PWD/$with_iodbc"
+ fi
+@@ -563,7 +563,7 @@ fi
+
+ AC_ARG_WITH(unixodbc,
+ AS_HELP_STRING([--with-unixodbc=DIR], [build odbc driver against unixODBC in DIR]))
+-if test "$with_unixodbc"; then
++if test "x$with_unixodbc" != "x" -a "x$with_unixodbc" != "xno"; then
+ if echo "$with_unixodbc" | grep -v '^/'; then
+ with_unixodbc="$PWD/$with_unixodbc"
+ fi
+@@ -588,7 +588,7 @@ fi
+
+ AC_ARG_WITH(odbc_nodm,
+ AS_HELP_STRING([--with-odbc-nodm=DIR], [build odbc using headers in DIR/include]))
+-if test "$with_odbc_nodm"; then
++if test "x$with_odbc_nodm" != "x" -a "x$with_odbc_nodm" != "xno"; then
+ if echo "$with_odbc_nodm" | grep -v '^/'; then
+ with_odbc_nodm="$PWD/$with_odbc_nodm"
+ fi
diff --git a/dev-db/freetds/freetds-0.91.ebuild b/dev-db/freetds/freetds-0.91.ebuild
new file mode 100644
index 000000000000..076b5f0e7a95
--- /dev/null
+++ b/dev-db/freetds/freetds-0.91.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit autotools
+
+DESCRIPTION="Tabular Datastream Library"
+HOMEPAGE="http://www.freetds.org/"
+SRC_URI="http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos"
+IUSE="kerberos odbc iodbc mssql"
+RESTRICT="test"
+
+DEPEND="
+ iodbc? ( dev-db/libiodbc )
+ kerberos? ( virtual/krb5 )
+ odbc? ( dev-db/unixODBC )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ config_rpath_update
+ sed -ie 's:with_iodbc/include":with_iodbc/include/iodbc":' configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ local myconf="--with-tdsver=7.0 $(use_enable mssql msdblib)"
+
+ if use iodbc ; then
+ myconf="${myconf} --enable-odbc --with-iodbc=${EPREFIX}/usr"
+ elif use odbc ; then
+ myconf="${myconf} --enable-odbc --with-unixodbc=${EPREFIX}/usr"
+ fi
+ if use kerberos ; then
+ myconf="${myconf} --enable-krb5"
+ fi
+
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" DOCDIR="doc/${PF}" install
+}
diff --git a/dev-db/freetds/freetds-1.00.41.ebuild b/dev-db/freetds/freetds-1.00.41.ebuild
new file mode 100644
index 000000000000..ede21dd57848
--- /dev/null
+++ b/dev-db/freetds/freetds-1.00.41.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="Tabular Datastream Library"
+HOMEPAGE="http://www.freetds.org/"
+SRC_URI="ftp://ftp.freetds.org/pub/freetds/stable/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos"
+IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl"
+RESTRICT="test"
+
+DEPEND="
+ gnutls? ( net-libs/gnutls )
+ iconv? ( virtual/libiconv )
+ iodbc? ( dev-db/libiodbc )
+ kerberos? ( virtual/krb5 )
+ odbc? ( dev-db/unixODBC )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+# bind-tools is needed because the osql script calls "host".
+RDEPEND="${DEPEND}
+ net-dns/bind-tools
+ sys-apps/grep
+ sys-apps/sed
+ virtual/awk"
+
+src_prepare() {
+ default
+ # Fix the iodbc include path in the configure script. Otherwise, it
+ # can't find isql.h.
+ sed -ie 's:with_iodbc/include":with_iodbc/include/iodbc":' \
+ configure.ac \
+ || die "failed to fix the iodbc include path in configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=( --with-tdsver=7.4 )
+
+ # The configure script doesn't support --without-{i,unix}odbc and
+ # it will still search for the associated headers if you try that
+ # Instead, to disable {i,unix}odbc, you just have to omit the
+ # --with-{i,unix}odbc line.
+ if use iodbc ; then
+ myconf+=( --enable-odbc --with-iodbc="${EPREFIX}/usr" )
+ fi
+
+ if use odbc ; then
+ myconf+=( --enable-odbc --with-unixodbc="${EPREFIX}/usr" )
+ fi
+
+ myconf+=( $(use_enable iconv libiconv) )
+ use iconv && myconf+=( --with-libiconv-prefix="${EPREFIX}/usr" )
+ myconf+=( $(use_enable kerberos krb5) )
+ myconf+=( $(use_enable mssql msdblib) )
+ myconf+=( $(use_with gnutls) )
+ myconf+=( $(use_with ssl openssl "${EPREFIX}/usr") )
+
+ # The docdir doesn't contain ${PV} without this
+ myconf+=( --docdir="/usr/share/doc/${PF}" )
+
+ econf "${myconf[@]}"
+}
diff --git a/dev-db/freetds/freetds-1.00.54-r1.ebuild b/dev-db/freetds/freetds-1.00.54-r1.ebuild
new file mode 100644
index 000000000000..0032727f6bf8
--- /dev/null
+++ b/dev-db/freetds/freetds-1.00.54-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="Tabular Datastream Library"
+HOMEPAGE="http://www.freetds.org/"
+SRC_URI="ftp://ftp.freetds.org/pub/freetds/stable/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos"
+IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl"
+RESTRICT="test"
+
+# sed, grep, and awk are used by the build system and the osql script.
+COMMON_DEPEND="sys-apps/sed
+ sys-apps/grep
+ virtual/awk
+ gnutls? ( net-libs/gnutls )
+ iconv? ( virtual/libiconv )
+ iodbc? ( dev-db/libiodbc )
+ kerberos? ( virtual/krb5 )
+ odbc? ( dev-db/unixODBC )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+DEPEND="${COMMON_DEPEND}"
+
+# bind-tools is needed because the osql script calls "host".
+# binutils is for "strings".
+RDEPEND="${COMMON_DEPEND}
+ sys-devel/binutils
+ net-dns/bind-tools"
+
+# iODBC and unixODBC are mutually-exclusive choices for
+# the ODBC driver manager. Future versions of FreeTDS
+# will throw an error if you specify both.
+REQUIRED_USE="?? ( iodbc odbc )"
+
+# Won't be necessary in the next release.
+PATCHES=( "${FILESDIR}/without-flags.patch" )
+
+src_prepare() {
+ default
+
+ # Fix the iodbc include path in the configure script. Otherwise, it
+ # can't find isql.h.
+ sed -ie 's:with_iodbc/include":with_iodbc/include/iodbc":' \
+ configure.ac \
+ || die "failed to fix the iodbc include path in configure.ac"
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=( $(use_with iodbc iodbc "${EPREFIX}/usr") )
+ myconf+=( $(use_with odbc unixodbc "${EPREFIX}/usr") )
+ myconf+=( $(use_enable iconv libiconv) )
+ myconf+=( $(use_with iconv libiconv-prefix "${EPREFIX}/usr") )
+ myconf+=( $(use_enable kerberos krb5) )
+ myconf+=( $(use_enable mssql msdblib) )
+ myconf+=( $(use_with gnutls) )
+ myconf+=( $(use_with ssl openssl "${EPREFIX}/usr") )
+ myconf+=( --docdir="/usr/share/doc/${PF}" )
+
+ econf "${myconf[@]}"
+}
diff --git a/dev-db/freetds/freetds-9999.ebuild b/dev-db/freetds/freetds-9999.ebuild
new file mode 100644
index 000000000000..ec6e2cf418f3
--- /dev/null
+++ b/dev-db/freetds/freetds-9999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools git-r3
+
+DESCRIPTION="Tabular Datastream Library"
+HOMEPAGE="http://www.freetds.org/"
+EGIT_REPO_URI="https://github.com/FreeTDS/${PN}.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl"
+RESTRICT="test"
+
+# sed, grep, and awk are used by the build system and the osql script.
+COMMON_DEPEND="sys-apps/sed
+ sys-apps/grep
+ virtual/awk
+ gnutls? ( net-libs/gnutls )
+ iconv? ( virtual/libiconv )
+ iodbc? ( dev-db/libiodbc )
+ kerberos? ( virtual/krb5 )
+ odbc? ( dev-db/unixODBC )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+DEPEND="${COMMON_DEPEND}"
+
+# bind-tools is needed because the osql script calls "host".
+# binutils is for "strings".
+RDEPEND="${COMMON_DEPEND}
+ sys-devel/binutils
+ net-dns/bind-tools"
+
+# iODBC and unixODBC are mutually-exclusive choices for
+# the ODBC driver manager. Future versions of FreeTDS
+# will throw an error if you specify both.
+REQUIRED_USE="?? ( iodbc odbc )"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=( $(use_with iodbc) )
+ myconf+=( $(use_with odbc unixodbc "${EPREFIX}/usr") )
+ myconf+=( $(use_enable iconv libiconv) )
+ myconf+=( $(use_with iconv libiconv-prefix "${EPREFIX}/usr") )
+ myconf+=( $(use_enable kerberos krb5) )
+ myconf+=( $(use_enable mssql msdblib) )
+ myconf+=( $(use_with gnutls) )
+ myconf+=( $(use_with ssl openssl "${EPREFIX}/usr") )
+ myconf+=( --docdir="/usr/share/doc/${PF}" )
+
+ econf "${myconf[@]}"
+}
diff --git a/dev-db/freetds/metadata.xml b/dev-db/freetds/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/freetds/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/gigabase/Manifest b/dev-db/gigabase/Manifest
new file mode 100644
index 000000000000..1169c0435042
--- /dev/null
+++ b/dev-db/gigabase/Manifest
@@ -0,0 +1,8 @@
+AUX gigabase-3.83-cpp14.patch 978 SHA256 24cfb56d4c084536916c82baab733716ba167ebe62e078505fe0dd7143bc2fcf SHA512 93a4ca2af7161af11c6b05af9a608884ca3991bf1615866a1c12271ad4cbf7748fae05dd7ad82dc2dc69fc36423039115242f38688dcdddb166d4e1c8d53b305 WHIRLPOOL 2ebb46acc7260c9416d2730a7f06b51c3bf49d94a41f5a424b8307b6edc708a478b977006e782a74850d9d7e2ff848c8a4f1c4d64bfddb54ff0f57fe4278c76c
+AUX gigabase-3.83-fix-build-system.patch 2139 SHA256 e273fc54e59a55e999c0c4ea6b3f8476782127899304d0628d4b775cfdef9543 SHA512 a1f80fbf4a06f7646c617dc572066bf73255c2040512407d2440d5196d7a551f62df1cdfc276d890632c6567a11951bf42b20c82c91604696dc1414420bbf0df WHIRLPOOL 37f80db79c2bab17e2860a53b68a31613a16e2074b8533abfd6838d8053e4e6e095ce686cf1968c21abd7b6c74d5b550eb2b157ee944e9eae82c7e1dc2aa8b55
+AUX gigabase-3.83-fix-dereferencing.patch 5947 SHA256 7fee24c651ae65e64f9d57043f51c129108665191107e83eef0cda0cb630c881 SHA512 7603024ce9eded76a36317a52cf49783fe37bc5cc0642648031f9f2c216d6a7234cdd49a019605b7a169f4d4277a052675adb809efc161160b3e9d847ddec522 WHIRLPOOL c25220d4d0a134865d14b769dd13d52e93bd4c3e9206412cfb3b4596b9e381a243b77d67c97ef013611ea4a8a0444e0f32e29dd88954867727a225a59d8581eb
+DIST gigabase-3.83.tar.gz 1746301 SHA256 0d627fa41ce0b3336b08738bf00cfc41ef5ddc8eb91c11f6a621d0e6f2e65607 SHA512 df2eab9b8ceae831c24a25f010cf06ebdd38fdf2f7478116b0d769092d6e4575c5c95222562410752df462a8bf3cc2f205c05d3adfaeb1634e82f443529957e5 WHIRLPOOL 4be91ddc164b96346e8d69c00f1467c2c90676e5c3225f54a8d7d2436f59d5ef3cd41658e7061a41945e1a29c86bea5f33731c13df1442320210b1905f7d1778
+EBUILD gigabase-3.83-r2.ebuild 1164 SHA256 f118087f7b829072e74d7c4421dfc883e7aca6c543d5b38a9da46d5c5cf01c3e SHA512 bb2ffc6bf438f919e0a8afb3815e0dc1056b285cd0d5d26cb43afe5433a67c7d2b79c6a07945d1901c78dfb0a16d94c3cb1eb58094328b0f41ca8675fc392622 WHIRLPOOL be983f68bf965f41ba309e3c5bd228e9f8e13b3504effdf16b8c4e876271696da32e6301cdf13333ef87e1427e1d0a24b3b7da3ccc042485e76cc8e1e004c0c0
+MISC ChangeLog 3021 SHA256 fac8d4c0634c310036e8891f294f5174ec20be65d18a848bf693e8634f120d00 SHA512 a34bd987efb88b345441eef38fd61f1c4e95af823ce93c818deaeb7039047ba571dce2b6629696bd06bdd8594e7a5b93d78c5de00fb34ed9adfd9c6b0dd4b264 WHIRLPOOL 91617e904bf0fedf269ceeccdc8abc6d67172ee08bc841665d0ff8c448aeaee90f3ad42ab6f4956e0878af505f0fb8ddceda99595c0cda916e6e0a007359587a
+MISC ChangeLog-2015 7974 SHA256 1a8db815fbccc5f1322489a5afb1c898058a36e4c74f87a7f598b75fe480ce1d SHA512 82ace709c93cb8c3d4d89df26e8d286a05a87381ec254bb28bc9dfa6d1b1fbc385635a562ce9e43f9ce22f3c483ae0171c4b728d605bb94c2983874365ba7451 WHIRLPOOL 1156f5f23d4e8e3fca05c9a48b274161829664290991368292a39ebaa7175c5a2f6a1041b53139456817e003ba069c60234d0c13e50605b5f2ae1e2397ba5428
+MISC metadata.xml 1528 SHA256 a0c4cae3111a7513443ecb594ffca1d40b0562a58e7271b94cc22e41a63cad56 SHA512 3361591956fa707cf0607695ec180eb011f832519dd8147406ea2c065f7809758b145b007ad177cc5e15b5ca7416c91eaaae49ed3a6a3bd028e4c153fd12851c WHIRLPOOL d864305cd93247afa7b0cec071974c965f32a0b28a5e2042fc07ec2e2e555b60644200b77ad150887b57efdd48c47cce770745b86fb76ae28efd87f51bb81e55
diff --git a/dev-db/gigabase/files/gigabase-3.83-cpp14.patch b/dev-db/gigabase/files/gigabase-3.83-cpp14.patch
new file mode 100644
index 000000000000..47d2a1a540ff
--- /dev/null
+++ b/dev-db/gigabase/files/gigabase-3.83-cpp14.patch
@@ -0,0 +1,34 @@
+This patch fixes GCC6 (C++14) compilation errors. It replaces two invalid macro
+calls with correct code in one place. It also removes redefinitions of fmax and
+fmin functions which exist in standard library since C++11.
+Gentoo-bug: https://bugs.gentoo.org/show_bug.cgi?id=594550
+
+--- a/testddl.cpp
++++ b/testddl.cpp
+@@ -102,8 +102,13 @@
+
+ REGISTER(Record);
+
++#if __cplusplus < 201103L
+ USER_FUNC(sin);
+ USER_FUNC(cos);
++#else
++static dbUserFunction fsin_descriptor((double (*)(double))&sin, STRLITERAL("sin"));
++static dbUserFunction fcos_descriptor((double (*)(double))&cos, STRLITERAL("cos"));
++#endif
+
+ int __cdecl main()
+ {
+--- a/testtimeseries.cpp
++++ b/testtimeseries.cpp
+@@ -47,8 +47,10 @@
+ REGISTER(Stock);
+
+ inline int random(unsigned mod) { return rand() % mod; }
++#if __cplusplus < 201103L
+ inline float fmax(float x, float y) { return x > y ? x : y; }
+ inline float fmin(float x, float y) { return x < y ? x : y; }
++#endif
+
+ int main(int argc, char* argv[])
+ {
diff --git a/dev-db/gigabase/files/gigabase-3.83-fix-build-system.patch b/dev-db/gigabase/files/gigabase-3.83-fix-build-system.patch
new file mode 100644
index 000000000000..d807bc9a7fdb
--- /dev/null
+++ b/dev-db/gigabase/files/gigabase-3.83-fix-build-system.patch
@@ -0,0 +1,63 @@
+Fix build system to respect DESTDIR and rename subsql to subsql-gdb,
+in order to avoid name clash with FastDB version of subsql.
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -21,7 +21,7 @@
+ # Place where to copy Gigabase library
+ libdir = @libdir@
+
+-# Place where to copy Gigabase subsql utility
++# Place where to copy Gigabase subsql-gdb utility
+ bindir = @bindir@
+
+ VERSION = 2
+@@ -42,7 +42,7 @@
+
+ GB_LIB = libgigabase$(SUFF).${LIBEXT}
+ CLI_LIB = libcli$(SUFF).${LIBEXT}
+-EXES = subsql
++EXES = subsql-gdb
+
+ EXAMPLES = guess testdb testjoin testddl testperf testspat testperf2 testsync testiref testtrav testidx testidx2 clitest testblob testleak testsession testtimeseries testtl
+ WEB_EXAMPLES = cgistub bugdb clidb
+@@ -90,8 +90,8 @@
+ clitest: clitest.o $(CLI_LIB)
+ $(LIBTOOL) --mode=link $(LD) $(LDFLAGS) -o clitest clitest.o $(CLI_LIB) $(SOCKLIBS)
+
+-subsql: subsql.o $(GB_LIB)
+- $(LIBTOOL) --mode=link $(LD) $(LDFLAGS) -o subsql subsql.o $(GB_LIB) $(SOCKLIBS)
++subsql-gdb: subsql.o $(GB_LIB)
++ $(LIBTOOL) --mode=link $(LD) $(LDFLAGS) -o subsql-gdb subsql.o $(GB_LIB) $(SOCKLIBS)
+
+ bugdb: bugdb.o $(GB_LIB)
+ $(LIBTOOL) --mode=link $(LD) $(LDFLAGS) -o bugdb bugdb.o $(GB_LIB) $(SOCKLIBS)
+@@ -153,18 +153,18 @@
+ testleak: testleak.o $(GB_LIB)
+ $(LIBTOOL) --mode=link $(LD) $(LDFLAGS) -o testleak testleak.o $(GB_LIB) $(SLHACK)
+
+-install: subsql $(GB_LIB) $(CLI_LIB)
+- mkdir -p $(includedir)
+- cp $(INCS) $(CLI_INCS) $(includedir)
+- mkdir -p $(libdir)
+- $(LIBTOOL) --mode=install $(INSTALL) $(GB_LIB) $(CLI_LIB) $(libdir)
+- mkdir -p $(bindir)
+- if test -x .libs/subsql ; then \
+- cp .libs/subsql $(bindir); \
++install: subsql-gdb $(GB_LIB) $(CLI_LIB)
++ mkdir -p $(DESTDIR)$(includedir)
++ cp $(INCS) $(CLI_INCS) $(DESTDIR)$(includedir)
++ mkdir -p $(DESTDIR)$(libdir)
++ $(LIBTOOL) --mode=install $(INSTALL) $(GB_LIB) $(CLI_LIB) $(DESTDIR)$(libdir)
++ mkdir -p $(DESTDIR)$(bindir)
++ if test -x .libs/subsql-gdb ; then \
++ cp .libs/subsql-gdb $(DESTDIR)$(bindir); \
+ else \
+- cp subsql $(bindir); \
++ cp subsql-gdb $(DESTDIR)$(bindir); \
+ fi
+-# strip $(bindir)/subsql
++# strip $(bindir)/subsql-gdb
+
+ clean:
+ rm -f *.o *.lo core *~
diff --git a/dev-db/gigabase/files/gigabase-3.83-fix-dereferencing.patch b/dev-db/gigabase/files/gigabase-3.83-fix-dereferencing.patch
new file mode 100644
index 000000000000..d2f0669d24fa
--- /dev/null
+++ b/dev-db/gigabase/files/gigabase-3.83-fix-dereferencing.patch
@@ -0,0 +1,182 @@
+--- a/session.cpp
++++ b/session.cpp
+@@ -131,7 +131,7 @@
+ throw CursorException("Cursor is not opened");
+ }
+ fillBuffer(sizeof(oid_t));
+- oid_t currOid = *(oid_t*)&sockBuf[bufPos];
++ oid_t currOid = *(oid_t*)(sockBuf + bufPos);
+ bufPos += sizeof(oid_t);
+ if (currObj != NULL) {
+ delete[] currObj;
+@@ -139,7 +139,7 @@
+ }
+ if (currOid != 0) {
+ fillBuffer(sizeof(int));
+- size_t size = *(int*)&sockBuf[bufPos];
++ size_t size = *(int*)(sockBuf + bufPos);
+ if (size <= SOCKET_BUFFER_SIZE) {
+ fillBuffer(size);
+ if (record != NULL) {
+--- a/database.cpp
++++ b/database.cpp
+@@ -739,40 +739,55 @@
+ return;
+
+ case dbvmInvokeMethodBool:
+- execute(expr->ref.base, iattr, sattr);
+- expr->ref.field->method->invoke(sattr.base, &sattr.bvalue);
+- sattr.bvalue = *(bool*)&sattr.bvalue;
+- iattr.free(sattr);
+- return;
++ {
++ bool val;
++ execute(expr->ref.base, iattr, sattr);
++ expr->ref.field->method->invoke(sattr.base, &val);
++ sattr.bvalue = val;
++ iattr.free(sattr);
++ return;
++ }
+ case dbvmInvokeMethodInt1:
+- execute(expr->ref.base, iattr, sattr);
+- expr->ref.field->method->invoke(sattr.base, &sattr.ivalue);
+- sattr.ivalue = *(int1*)&sattr.ivalue;
+- iattr.free(sattr);
+- return;
++ {
++ int1 val;
++ execute(expr->ref.base, iattr, sattr);
++ expr->ref.field->method->invoke(sattr.base, &val);
++ sattr.ivalue = val;
++ iattr.free(sattr);
++ return;
++ }
+ case dbvmInvokeMethodInt2:
+- execute(expr->ref.base, iattr, sattr);
+- expr->ref.field->method->invoke(sattr.base, &sattr.ivalue);
+- sattr.ivalue = *(int2*)&sattr.ivalue;
+- iattr.free(sattr);
+- return;
++ {
++ int2 val;
++ execute(expr->ref.base, iattr, sattr);
++ expr->ref.field->method->invoke(sattr.base, &val);
++ sattr.ivalue = val;
++ iattr.free(sattr);
++ return;
++ }
+ case dbvmInvokeMethodInt4:
+- execute(expr->ref.base, iattr, sattr);
+- expr->ref.field->method->invoke(sattr.base, &sattr.ivalue);
+- sattr.ivalue = *(int4*)&sattr.ivalue;
+- iattr.free(sattr);
+- return;
++ {
++ int4 val;
++ execute(expr->ref.base, iattr, sattr);
++ expr->ref.field->method->invoke(sattr.base, &val);
++ sattr.ivalue = val;
++ iattr.free(sattr);
++ return;
++ }
+ case dbvmInvokeMethodInt8:
+ execute(expr->ref.base, iattr, sattr);
+ expr->ref.field->method->invoke(sattr.base, &sattr.ivalue);
+ iattr.free(sattr);
+ return;
+ case dbvmInvokeMethodReal4:
+- execute(expr->ref.base, iattr, sattr);
+- expr->ref.field->method->invoke(sattr.base, &sattr.fvalue);
+- sattr.fvalue = *(real4*)&sattr.fvalue;
+- iattr.free(sattr);
+- return;
++ {
++ real4 val;
++ execute(expr->ref.base, iattr, sattr);
++ expr->ref.field->method->invoke(sattr.base, &val);
++ sattr.fvalue = val;
++ iattr.free(sattr);
++ return;
++ }
+ case dbvmInvokeMethodReal8:
+ execute(expr->ref.base, iattr, sattr);
+ expr->ref.field->method->invoke(sattr.base, &sattr.fvalue);
+@@ -792,28 +807,43 @@
+ return;
+
+ case dbvmInvokeSelfMethodBool:
+- expr->ref.field->method->invoke(iattr.record, &sattr.bvalue);
+- sattr.bvalue = *(bool*)&sattr.bvalue;
+- return;
++ {
++ bool val;
++ expr->ref.field->method->invoke(iattr.record, &val);
++ sattr.bvalue = val;
++ return;
++ }
+ case dbvmInvokeSelfMethodInt1:
+- expr->ref.field->method->invoke(iattr.record, &sattr.ivalue);
+- sattr.ivalue = *(int1*)&sattr.ivalue;
+- return;
++ {
++ int1 val;
++ expr->ref.field->method->invoke(iattr.record, &val);
++ sattr.ivalue = val;
++ return;
++ }
+ case dbvmInvokeSelfMethodInt2:
+- expr->ref.field->method->invoke(iattr.record, &sattr.ivalue);
+- sattr.ivalue = *(int2*)&sattr.ivalue;
+- return;
++ {
++ int2 val;
++ expr->ref.field->method->invoke(iattr.record, &val);
++ sattr.ivalue = val;
++ return;
++ }
+ case dbvmInvokeSelfMethodInt4:
+- expr->ref.field->method->invoke(iattr.record, &sattr.ivalue);
+- sattr.ivalue = *(int4*)&sattr.ivalue;
+- return;
++ {
++ int4 val;
++ expr->ref.field->method->invoke(iattr.record, &val);
++ sattr.ivalue = val;
++ return;
++ }
+ case dbvmInvokeSelfMethodInt8:
+ expr->ref.field->method->invoke(iattr.record, &sattr.ivalue);
+ return;
+ case dbvmInvokeSelfMethodReal4:
+- expr->ref.field->method->invoke(iattr.record, &sattr.fvalue);
+- sattr.fvalue = *(real4*)&sattr.fvalue;
+- return;
++ {
++ real4 val;
++ expr->ref.field->method->invoke(iattr.record, &val);
++ sattr.fvalue = *(real4*)&sattr.fvalue;
++ return;
++ }
+ case dbvmInvokeSelfMethodReal8:
+ expr->ref.field->method->invoke(iattr.record, &sattr.fvalue);
+ return;
+--- a/server.cpp
++++ b/server.cpp
+@@ -2097,7 +2097,7 @@
+ bufUsed = 0;
+ }
+ oid_t oid = cursor.getOid();
+- *(oid_t*)&buf[bufUsed] = oid;
++ *(oid_t*)(buf + bufUsed) = oid;
+ bufUsed += sizeof(oid_t);
+ dbRecord* record = db->getRow(tie, oid);
+ size_t size = record->size;
+@@ -2129,7 +2129,7 @@
+ bufUsed = 0;
+ }
+ }
+- *(oid_t*)&buf[bufUsed] = 0;
++ *(oid_t*)(buf + bufUsed) = 0;
+ return session->sock->write(buf, bufUsed + sizeof(oid_t));
+ }
+
diff --git a/dev-db/gigabase/gigabase-3.83-r2.ebuild b/dev-db/gigabase/gigabase-3.83-r2.ebuild
new file mode 100644
index 000000000000..5e21d4f9ae8f
--- /dev/null
+++ b/dev-db/gigabase/gigabase-3.83-r2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="OO-DBMS with interfaces for C/C++/Java/PHP/Perl"
+HOMEPAGE="http://www.garret.ru/~knizhnik/gigabase.html"
+SRC_URI="mirror://sourceforge/gigabase/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc static-libs"
+
+DEPEND="doc? ( app-doc/doxygen )"
+RDEPEND=""
+
+S="${WORKDIR}/${PN}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-dereferencing.patch"
+ "${FILESDIR}/${P}-cpp14.patch" # fix #594550
+ "${FILESDIR}/${P}-fix-build-system.patch"
+)
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ doxygen doxygen.cfg || die
+ HTML_DOCS=( GigaBASE.htm docs/html/. )
+ fi
+}
+
+src_test() {
+ local t
+ for t in testddl testidx testidx2 testiref testleak testperf \
+ testperf2 testspat testtl testsync testtimeseries; do
+ ./${t} || die
+ done
+}
+
+src_install() {
+ default
+
+ if ! use static-libs; then
+ find "${D}" -name '*.la' -delete || die
+ fi
+}
+
+pkg_postinst() {
+ elog "The subsql binary has been renamed to subsql-gdb,"
+ elog "to avoid a name clash with the FastDB version of subsql"
+}
diff --git a/dev-db/gigabase/metadata.xml b/dev-db/gigabase/metadata.xml
new file mode 100644
index 000000000000..4277b141f815
--- /dev/null
+++ b/dev-db/gigabase/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <longdescription lang="en">
+ Object-Relational Database Management System GigaBASE inherits most of the
+ features of FastDB, but uses page pool instead of direct mapping of file on
+ virtual memory. So GigaBASE is able to handle database, which size
+ significantly exceeds size of computer physical memory. Convenient and
+ flexible C++ interface makes development of application for GigaBASE very
+ easy and automatic scheme evaluation simplifies maintenance and modification
+ of the system. GigaBASE merges best features of relational (simple data
+ structure and non-procedural query language) and object-oriented (direct
+ object references, user defined types and methods) databases. GigaBASE is
+ primary oriented on application requiring fast data retrieving by means of
+ indices and direct object references, such as Web Server databases
+ applications. SUBSQL utility can be used for database browsing and
+ inspection, performing online backups, database recovery, importing data to
+ and exporting data from database. GigaBASE will perform automatic recovery
+ after system or application crash, you should not worry about it. The only
+ thing you can have to do manually is stopping all database application if
+ one of them is crashed leaving database blocked.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">gigabase</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/go-etcd/Manifest b/dev-db/go-etcd/Manifest
new file mode 100644
index 000000000000..210ac0014009
--- /dev/null
+++ b/dev-db/go-etcd/Manifest
@@ -0,0 +1,8 @@
+DIST go-etcd-0_p20141013.tar.gz 18214 SHA256 1f23919939588fbdc76dc40977f20d47fe67e633be24f53e4042122a942f867e SHA512 af07b2434bbad219962e989ca1d6ccb86bb40f698aa3f2b681ac04094dc7e878593af6a54e9c1e976d1aeb451661d8100295b0637291b46bafa45452537f1575 WHIRLPOOL 6cfb874e90bc43d643eb9b3db59e9d7c914614adfcb34db642b794c645823863cdab70c72b0e60abda2dc97dc1c526bc2d8c4c28d7c32811fcc9798744b4beaa
+DIST go-etcd-2.0.0.tar.gz 18214 SHA256 1f23919939588fbdc76dc40977f20d47fe67e633be24f53e4042122a942f867e SHA512 af07b2434bbad219962e989ca1d6ccb86bb40f698aa3f2b681ac04094dc7e878593af6a54e9c1e976d1aeb451661d8100295b0637291b46bafa45452537f1575 WHIRLPOOL 6cfb874e90bc43d643eb9b3db59e9d7c914614adfcb34db642b794c645823863cdab70c72b0e60abda2dc97dc1c526bc2d8c4c28d7c32811fcc9798744b4beaa
+EBUILD go-etcd-0_p20141013-r1.ebuild 1055 SHA256 bbe6aa5b03cae954ca81d34309ba0fa951830a26953efcb5ef859366ca5434c8 SHA512 e38ff58b31ef12ad6b8c475cf5ad041ee2e65c807606972c084b65c32b754a38e3233c49310c85958a2e7bc335631f3dcd8452b1ba5125edbf0d550ed3ed7dbd WHIRLPOOL 1ede4c53e791306ad8c2e583e587712e45e8c5e4626f874639810868e81aedce78b4231659d0918a31ea40266253e0be018547c53ee742c02031b5e291ed16a5
+EBUILD go-etcd-2.0.0-r1.ebuild 1043 SHA256 108b7153423619ab942024c3914552b4475f8d74268a91f1f5ec1dda60c6b0e2 SHA512 687b694b9e8bf85bd6db084878f3c8a9a67e4da97cf1aba3ddeaf9e7901e6d0d9c8f955380febc007022a4f70d58b9cea5318283b0a97f3c8cb006dd5c5aebc4 WHIRLPOOL 66908ce56b34b5894f103bf69475aae072d4c6007921680a986f177790b5ad0de1d543eaa67cd0577c6c9b2c4757fd8cee21f00c11c827671904342678ddc897
+EBUILD go-etcd-2.0.0.ebuild 1057 SHA256 7cea98dd1d2cf426673a5ce628f683aa5388553a86c58b18ffd80a2878f81f04 SHA512 2b8c8e7b4f2413a5389d6905c14784f0120943a2082d4e7bfd0d6b655add5c4ec245b28ea8c526940a67bf555a917a54c71a3dabd1659850ab12b109b7a0cf35 WHIRLPOOL e287578d8502baaea20c0c2ae30836971a1533cde1ca116f47f6fa32575bf9dba40de05e2fe3a39526a0a61427343ecf4d1dc4bed25146e4ff2c275f92758d82
+MISC ChangeLog 2598 SHA256 a31f62ec33d96b9a5e5e3c58a471c14451bb39c50e69e18d4f61c824035cc7ec SHA512 0d2d31023fb13f38b9839680bde510cbb2a93affdf5393c483c0236396c768f457bffe4f6ee49c4af833d4e9412f95281a7e305a98f217cca16642a834bb12fd WHIRLPOOL 4fd0fa4a40a3b03fc98935673700661ad979f2bace509efc4777c554536d7c4277b584e8b193a6d6474a00ac12e6796a3802128867bca0c4a3d3758529d697d4
+MISC ChangeLog-2015 1339 SHA256 8f0d0255c4ba1cfa4b5245d9052d369eb2e4c336006cdb243b516b292e2b7ced SHA512 89be15ef6220d016e96eab81199949979a6a58aaaa81571f4eef2c53069dd29cf72f5bf98485b2b0ae4a064ecdb774af22c441c0653b5e6cbd67f0a2cf34c107 WHIRLPOOL 39603361712191509fd2e65b8c242037be60589f03a4326117cc2fb14cf8d6556f200a72f482120287ca650ac33ff87cebb92636925092b73b967d15b1c1c1ed
+MISC metadata.xml 509 SHA256 ba4c66131c2820e17e82face99a4e0dce845a447a9e97725a31fc3ef73c60157 SHA512 0162c39d76959d8cbe7ca2a280a4c415912c09f1d0044216ad73367c865dcf61037da0022711777fcc277fa8ee65feb5c04a2a4a50fb549a9585798ceb3c6d28 WHIRLPOOL cbc3678f50172cd2d552376b122f008c08a16d1408aedcb7f6f2c66b9c6d8947801f302abe8bc11cee1050073a90d1ffcff2875d2b71eb798ebc8f9552b8893d
diff --git a/dev-db/go-etcd/go-etcd-0_p20141013-r1.ebuild b/dev-db/go-etcd/go-etcd-0_p20141013-r1.ebuild
new file mode 100644
index 000000000000..837299014728
--- /dev/null
+++ b/dev-db/go-etcd/go-etcd-0_p20141013-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+GO_PN=github.com/coreos/${PN}
+DESCRIPTION="Go client library for etcd"
+HOMEPAGE="https://${GO_PN}"
+EGIT_COMMIT="25e2c63be8e8ab405014a78879e0992ae5ff55e8"
+SRC_URI="https://${GO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=dev-lang/go-1.4"
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ default_src_unpack
+ mkdir -p src/${GO_PN%/*} || die
+ mv ${PN}-${EGIT_COMMIT} src/${GO_PN} || die
+}
+
+src_compile() {
+ # Create a filtered GOROOT tree out of symlinks,
+ # excluding go-etcd, for bug #503324.
+ cp -sR /usr/lib/go goroot || die
+ rm -rf goroot/src/${GO_PN} || die
+ rm -rf goroot/pkg/linux_${ARCH}/${GO_PN} || die
+ GOROOT=${WORKDIR}/goroot GOPATH=${WORKDIR} \
+ go install -x ${GO_PN}/etcd || die
+}
+
+src_install() {
+ insopts -m0644 -p # preserve timestamps for bug 551486
+ insinto /usr/lib/go
+ doins -r pkg
+ insinto /usr/lib/go/src
+ egit_clean
+ doins -r src/*
+}
diff --git a/dev-db/go-etcd/go-etcd-2.0.0-r1.ebuild b/dev-db/go-etcd/go-etcd-2.0.0-r1.ebuild
new file mode 100644
index 000000000000..f21ea8588426
--- /dev/null
+++ b/dev-db/go-etcd/go-etcd-2.0.0-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+GO_PN=github.com/coreos/${PN}
+EGIT_COMMIT="25e2c63be8e8ab405014a78879e0992ae5ff55e8"
+
+DESCRIPTION="Go client library for etcd"
+HOMEPAGE="https://${GO_PN}"
+SRC_URI="https://${GO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=dev-lang/go-1.4:="
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ default_src_unpack
+ mkdir -p src/${GO_PN%/*} || die
+ mv ${PN}-${EGIT_COMMIT} src/${GO_PN} || die
+}
+
+src_compile() {
+ # Create a filtered GOROOT tree out of symlinks,
+ # excluding go-etcd, for bug #503324.
+ cp -sR /usr/lib/go goroot || die
+ rm -rf goroot/src/${GO_PN} || die
+ rm -rf goroot/pkg/linux_${ARCH}/${GO_PN} || die
+ GOROOT=${WORKDIR}/goroot GOPATH=${WORKDIR} \
+ go install -x ${GO_PN}/etcd || die
+}
+
+src_install() {
+ insopts -m0644 -p # preserve timestamps for bug 551486
+ insinto /usr/lib/go
+ doins -r pkg
+ insinto /usr/lib/go/src
+ egit_clean
+ doins -r src/*
+}
diff --git a/dev-db/go-etcd/go-etcd-2.0.0.ebuild b/dev-db/go-etcd/go-etcd-2.0.0.ebuild
new file mode 100644
index 000000000000..af467e145d78
--- /dev/null
+++ b/dev-db/go-etcd/go-etcd-2.0.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+GO_PN=github.com/coreos/${PN}
+EGIT_COMMIT="25e2c63be8e8ab405014a78879e0992ae5ff55e8"
+
+DESCRIPTION="Go client library for etcd"
+HOMEPAGE="https://${GO_PN}"
+SRC_URI="https://${GO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=dev-lang/go-1.4"
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ default_src_unpack
+ mkdir -p src/${GO_PN%/*} || die
+ mv ${PN}-${EGIT_COMMIT} src/${GO_PN} || die
+}
+
+src_compile() {
+ # Create a filtered GOROOT tree out of symlinks,
+ # excluding go-etcd, for bug #503324.
+ cp -sR /usr/lib/go goroot || die
+ rm -rf goroot/src/${GO_PN} || die
+ rm -rf goroot/pkg/linux_${ARCH}/${GO_PN} || die
+ GOROOT=${WORKDIR}/goroot GOPATH=${WORKDIR} \
+ go install -x ${GO_PN}/etcd || die
+}
+
+src_install() {
+ insopts -m0644 -p # preserve timestamps for bug 551486
+ insinto /usr/lib/go
+ doins -r pkg
+ insinto /usr/lib/go/src
+ egit_clean
+ doins -r src/*
+}
diff --git a/dev-db/go-etcd/metadata.xml b/dev-db/go-etcd/metadata.xml
new file mode 100644
index 000000000000..479b509156bb
--- /dev/null
+++ b/dev-db/go-etcd/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>https://github.com/coreos/go-etcd/issues</bugs-to>
+ <changelog>https://github.com/coreos/go-etcd/commits/master</changelog>
+ <doc>https://godoc.org/github.com/coreos/go-etcd/etcd</doc>
+ <remote-id type="github">coreos/go-etcd</remote-id>
+ </upstream>
+ <maintainer type="person">
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/gqlplus/Manifest b/dev-db/gqlplus/Manifest
new file mode 100644
index 000000000000..33ed10608196
--- /dev/null
+++ b/dev-db/gqlplus/Manifest
@@ -0,0 +1,4 @@
+DIST gqlplus-1.16.tar.gz 2128428 SHA256 9e0071d6f8bc24b0b3623c69d9205f7d3a19c2cb32b5ac9cff133dc75814acdd SHA512 e9d7685e4db741db8232f7ba7a05df59042d0cafe198060adcd37aea2d3878e785eacb1f7b72fcb154558d1be8c619818dbeceffaefb75e372a18ed23e234512 WHIRLPOOL d4c06fce8774c4f6ad6a37e7c48f7720fef8cf4fb40997ff2ae14e148a5e3d6cab4c293d5ea7a4888d4764233707a8845dfac8862bab960f40f6163e7d914d8f
+EBUILD gqlplus-1.16.ebuild 752 SHA256 8fc614d588ff2cd484bc0d61041ae0503af766ff40ac68bb646d30c7ae99ddaa SHA512 629af9bb7de9b883ce1c3e6a47c7100ac875302531de6fbdc9d84ccf19770a3af6e481f34e41fa7324f95ba06c554225db265d37fdfce63af2320c535f70e64e WHIRLPOOL 2adaecc178503c09a78ad71e87197bf5866ba4a387fe4d6dba90b95df650556aa05d9f4c2dd254cb31e0a3afe8ce1b8f7dcc7b1f208737b867dd41bd31eff499
+MISC ChangeLog 559 SHA256 cac8d2d6f55060c7c4eeef7020267679e6c89858e7d311bc8aa353e1a7548438 SHA512 04eea1d88277792030b876b3dea07789d7314ac464a024c05f3da6545f4433da827fbbc3a89f5c658dba321f14e0962832b95585b61fa9c60765d649aa950277 WHIRLPOOL c3ae97e77f9c44ee5269fbbf8170df291194195c8ee880170f2bdf91200fb9623635107af15619c4b4c0c76c5f952f84d60a0a7e1d49be2001c3c4f7a21883e1
+MISC metadata.xml 620 SHA256 46a9d2db61d14081949902d049f2f934cbcc152e8021d0b167d2bd8b14960d3b SHA512 8ce9a86e99c4198a246b149f5a526f0cf70ea9e75d3e97bc643520c9377136e83ca56ac47869ae0b62f021dd28da6745204c7c12a52a82e996949b4a796086ce WHIRLPOOL 3c7958b6f964fe64243dc4ea3a46d604aeefa0b1e34fedf78788fbc1600d04e7e0c17055a1888b550d64cfab39e4d7bafd6c4f522d8c51c43f61d15312689802
diff --git a/dev-db/gqlplus/gqlplus-1.16.ebuild b/dev-db/gqlplus/gqlplus-1.16.ebuild
new file mode 100644
index 000000000000..a3aa8f209869
--- /dev/null
+++ b/dev-db/gqlplus/gqlplus-1.16.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools
+
+DESCRIPTION="a front-end for Oracle program sqlplus with command-line editing"
+HOMEPAGE="https://sourceforge.net/projects/gqlplus/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-linux ~x64-macos"
+IUSE=""
+
+DEPEND="sys-libs/readline:*"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # don't use packaged readline and old version containing it
+ rm -Rf readline gqlplus-1.15
+
+ # maintainer can't seem to get versioning right
+ sed -i '/^#define VERSION/s/"[^"]\+"/"'"${PV}"'"/' gqlplus.c || die
+ sed -i '/^AC_INIT/s/\[[1-9.]\+\]/['"${PV}"']/' configure.ac || die
+ eautoreconf
+}
diff --git a/dev-db/gqlplus/metadata.xml b/dev-db/gqlplus/metadata.xml
new file mode 100644
index 000000000000..533ec708627b
--- /dev/null
+++ b/dev-db/gqlplus/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grobian@gentoo.org</email>
+ <name>Fabian Groffen</name>
+ </maintainer>
+ <longdescription lang="en">
+ gqlplus is a front-end for Oracle program sqlplus with
+ command-line editing, history, table-name and column-name
+ completion. Otherwise the user interface is identical to that of
+ sqlplus. Command-line editing works as in bash/tcsh shells.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">gqlplus</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/henplus/Manifest b/dev-db/henplus/Manifest
new file mode 100644
index 000000000000..b8ac5f33f442
--- /dev/null
+++ b/dev-db/henplus/Manifest
@@ -0,0 +1,8 @@
+AUX 0.9.8-build.xml.patch 771 SHA256 0be482afe8459b005ffce5f67cf18580dc4a593e7aa65cd49bb6e3859aa9ce3c SHA512 b886c7f53bbbb10221b99c3d2ff32513c5388769310714e1c74c69aa662618bc719aa7338ccde92ca2119f9e6fa9591ae260dfe5055fa760f90b5f26ad740190 WHIRLPOOL 4cd022936f57f3c9121216825658bf4a699384c9374152713b51e158ef54d49e360066a75b07509cc739378fccae56cf9c8af8612421a9a26d45090dcae08f58
+AUX henplus.pre 1418 SHA256 cfd948b2b124202cc6c30d95ca29ce47c6ec43eae8fc6724e2fcd978a4442784 SHA512 331138630336c9f7a2f7cbf343b6ea77277d4ad77d706497545a6ff33cf44572cbe126acb4f0d212a40f652a24190b629f7776dbca08630de66d6f8ac3fae26a WHIRLPOOL 4a557f4bb8aa9d6f950da6a55612b04a509052134a59161810e30ebf20f1a1c430fd0c87517f24f42cc1c9a11fb24516c20e31e71dd7e921060489e9c6729cfc
+DIST henplus-0.9.8.tar.gz 233035 SHA256 ea7ca363d0503317235e97f66aa0efefe44463d8445e88b304ec0ac1748fe1ff SHA512 a22fc847f4441f627c1fa12f4f365c38d0c8ddfc205758d044e797e83f8d37032995666c2ee3dbb68d0a5f563fa5d574886e85757b1faa0acfc055e92b2fad0b WHIRLPOOL 82236dcde4865049b97d89dc02bbe062e74fbb002bdebd301400fbb84d28a4a196c7bf206fe279c881e47661216c18e5356fe6ff7170f46c6ee1c01cdb61f42e
+EBUILD henplus-0.9.8-r1.ebuild 1027 SHA256 85d9d638f8315625de52ae3f2fc7cdacb58a2a8f57ab3dcc6793ca713121db1f SHA512 77d8761c54d1200a3b4c756b8f91b31482c108778e6061b4a69f05e21367fd064f071dd106a6c473a975c1a92a8b1885028ae0a98ac937f4471cf5f7bbc6ad0a WHIRLPOOL 2d7046f79b6d7b2de5ade5221a1126a57d13d638252f26b72258d6f24e5fb63f7d4ea82f744a58ba5a4448687361b5c76a8637e2f5d332b3060d3c64be24a8bb
+EBUILD henplus-0.9.8.ebuild 1027 SHA256 228a2fe11429c9d26f0506510283d3d0e23745db2be9d5f3460043c51b0609a2 SHA512 aca0dd9ac10a62f3036130f5e82cc16b032e2381378b7ef10d86b8e38d416b95f3f687e823b785d5df6653412651abf5d2cb6846e41e22f56e470bf302e6a8e8 WHIRLPOOL 27018268ad0f335fa89a88cba174139515094f4cc10ef6843bf4000a93b7ef0a74c3bed90519450624418cfe153dc1fd3dd8ebd459858867922fc17a872b1282
+MISC ChangeLog 3193 SHA256 78b0cc9f65270741816d1b556db5e2dfda89c673147056f1b5c6400f95b5c7f8 SHA512 cbd935ed97024ba367ac4f32d36a824421a509056404e05c37aae1acbe984bb3e6f15427f6cef11c2fcd8630b79208a9b42f78fc78104a622dd8d7ac6e976763 WHIRLPOOL a2ce677db47c15182c6c08ff95d7be2427584f892515197423a96ff96486dda911f96b131ccdb6ea83f694095798afe8ed8fc610fc15500e65e98c106f587a53
+MISC ChangeLog-2015 3716 SHA256 5eaff78ffe5df166c4876014fe6cd9233476f797a4974107666619991c22c07b SHA512 5295f7160165fe341ee3736100a208243a28e30bf47fea3fb79a86b205eaec6a02b61b70f2168196fae75bd23b7851d1214397ed9f5ee94b6f9933e617adf7c9 WHIRLPOOL 6be98061b28f77b6b77d791840f4547db0ef07dbd85a8d5a314012b44a02b07079bc8bbb3e7265cbff93c1976c5a7b93fae94055ead22d5a85a915e97f6bf1dd
+MISC metadata.xml 313 SHA256 de3763f49b5db84be4b15d2180382b1da7528fd41212a741f42b856043076db8 SHA512 22c759bfaa403d45fd081972c2009675d69156ff6f2caff621d9330b5c4a6c56030e70fd9a0639ff6a8684c1ff0e213ce9b8d6890607b12522eb2c768361d762 WHIRLPOOL fdc6b5088c35d900773279bef95e62fa4291e9fbff69bbec1bffd1021c5eaa8f7cb0e6343f7e3a9bd11e77a80b416ccb55667d9bc52ce53831bee5a6fee5aa6e
diff --git a/dev-db/henplus/files/0.9.8-build.xml.patch b/dev-db/henplus/files/0.9.8-build.xml.patch
new file mode 100644
index 000000000000..e2763978080e
--- /dev/null
+++ b/dev-db/henplus/files/0.9.8-build.xml.patch
@@ -0,0 +1,23 @@
+diff -ur henplus-0.9.8.old/build.xml henplus-0.9.8/build.xml
+--- henplus-0.9.8.old/build.xml 2009-05-01 23:51:41.000000000 +0300
++++ henplus-0.9.8/build.xml 2009-05-01 23:52:31.000000000 +0300
+@@ -33,13 +33,13 @@
+ <pathelement path="${classes}" />
+ </path>
+
+- <taskdef name="ant-server" classname="net.sweetohm.ant.server.ServerTask">
+- <classpath>
+- <pathelement location="${lib}/build/sat-0.7.jar" />
+- </classpath>
+- </taskdef>
+-
+ <target name="server">
++ <taskdef name="ant-server" classname="net.sweetohm.ant.server.ServerTask">
++ <classpath>
++ <pathelement location="${lib}/build/sat-0.7.jar" />
++ </classpath>
++ </taskdef>
++
+ <ant-server/>
+ </target>
+
diff --git a/dev-db/henplus/files/henplus.pre b/dev-db/henplus/files/henplus.pre
new file mode 100644
index 000000000000..c29585e369fa
--- /dev/null
+++ b/dev-db/henplus/files/henplus.pre
@@ -0,0 +1,51 @@
+#
+# Based on the upstream script but parts not relevant to Gentoo
+# stripped away. We would not need this at all but better to make
+# this behave as the upstream docs say and then also have all the
+# Gentoo goodies.
+# https://bugs.gentoo.org/show_bug.cgi?id=176185
+
+##------------------
+THISDIR=`dirname $0`
+# install layout is: script in /usr/bin/henplus and libs in /usr/share/henplus
+HENPLUSDIR=$THISDIR/../share/henplus
+
+# you may just throw your own jar files in this dir.
+# (like additional JDBC-drivers, that are not in default
+# classpath)
+for f in $HENPLUSDIR/*.jar $HENPLUSDIR/*.zip ; do
+ if [ -r "$f" ] ; then
+ CLASSPATH=$CLASSPATH:$f
+ fi
+done
+
+# starting at the current directory we look for additional
+# JDBC-drivers in .henplus/lib-directories up the path.
+# if no directory like that has been found the one in the
+# home directory will be used
+DIR=`pwd`
+CUSTOM_HENPLUSDIR=""
+
+while [ $DIR != "/" ] ; do
+ if [ -d $DIR"/.henplus/lib" ]; then
+ CUSTOM_HENPLUSDIR=$DIR"/.henplus/lib"
+ break
+ fi
+ DIR=`dirname $DIR`
+done
+
+if [ -z $CUSTOM_HENPLUSDIR ]; then
+ if [ -d "/.henplus/lib" ]; then
+ CUSTOM_HENPLUSDIR="/.henplus/lib"
+ else
+ CUSTOM_HENPLUSDIR=$HOME/.henplus/lib
+ fi
+fi
+
+for f in $CUSTOM_HENPLUSDIR/*.jar $CUSTOM_HENPLUSDIR/*.zip ; do
+ if [ -r "$f" ] ; then
+ CLASSPATH=$CLASSPATH:$f
+ fi
+done
+
+export CLASSPATH
diff --git a/dev-db/henplus/henplus-0.9.8-r1.ebuild b/dev-db/henplus/henplus-0.9.8-r1.ebuild
new file mode 100644
index 000000000000..5d4aeac8bdd9
--- /dev/null
+++ b/dev-db/henplus/henplus-0.9.8-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 eutils java-ant-2
+
+DESCRIPTION="Java-based multisession SQL shell for databases with JDBC support"
+HOMEPAGE="http://henplus.sf.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+COMMON_DEPEND="dev-java/commons-cli:1
+ dev-java/libreadline-java:0"
+RDEPEND=">=virtual/jre-1.6
+ ${COMMON_DEPEND}"
+DEPEND=">=virtual/jdk-1.6
+ ${COMMON_DEPEND}"
+
+java_prepare() {
+ epatch "${FILESDIR}/0.9.8-build.xml.patch"
+ rm -v lib/*.jar lib/*/*.jar || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+EANT_GENTOO_CLASSPATH="commons-cli-1,libreadline-java"
+
+src_install () {
+ java-pkg_dojar "build/${PN}.jar"
+
+ java-pkg_dolauncher ${PN} -pre "${FILESDIR}/${PN}.pre" \
+ --main henplus.HenPlus
+
+ dodoc README || die
+ dohtml doc/HenPlus.html || die
+
+ use doc && java-pkg_dojavadoc javadoc/api
+ use source && java-pkg_dosrc "src/${PN}"
+}
diff --git a/dev-db/henplus/henplus-0.9.8.ebuild b/dev-db/henplus/henplus-0.9.8.ebuild
new file mode 100644
index 000000000000..97a42b47f1fd
--- /dev/null
+++ b/dev-db/henplus/henplus-0.9.8.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 eutils java-ant-2
+
+DESCRIPTION="Java-based multisession SQL shell for databases with JDBC support"
+HOMEPAGE="http://henplus.sf.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+COMMON_DEPEND="dev-java/commons-cli:1
+ dev-java/libreadline-java:0"
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON_DEPEND}"
+DEPEND=">=virtual/jdk-1.4
+ ${COMMON_DEPEND}"
+
+java_prepare() {
+ epatch "${FILESDIR}/0.9.8-build.xml.patch"
+ rm -v lib/*.jar lib/*/*.jar || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+EANT_GENTOO_CLASSPATH="commons-cli-1,libreadline-java"
+
+src_install () {
+ java-pkg_dojar "build/${PN}.jar"
+
+ java-pkg_dolauncher ${PN} -pre "${FILESDIR}/${PN}.pre" \
+ --main henplus.HenPlus
+
+ dodoc README || die
+ dohtml doc/HenPlus.html || die
+ use doc && java-pkg_dojavadoc javadoc/api
+
+ use source && java-pkg_dosrc "src/${PN}"
+}
diff --git a/dev-db/henplus/metadata.xml b/dev-db/henplus/metadata.xml
new file mode 100644
index 000000000000..651b465469ac
--- /dev/null
+++ b/dev-db/henplus/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">henplus</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/hsqldb/Manifest b/dev-db/hsqldb/Manifest
new file mode 100644
index 000000000000..eb8a733b69e0
--- /dev/null
+++ b/dev-db/hsqldb/Manifest
@@ -0,0 +1,12 @@
+AUX StringComparator.java 1986 SHA256 9f672518cd27d2da5fb9e0a0f7ffe56a872186cdf188cb5840598ed88b959b95 SHA512 a0103b0b8445bfbbe325c73ab65dcf4c22c8fd4dab89cd9d60809b4323263e62da2c20a0c1f2900ee97eb9ca2549730e1d37b7f1bffdfce3d116ca802fe8beaa WHIRLPOOL 7f581b3df177f92bcc7195781dd3edfde633bad76661d3a683294379e53396d61f0688605ea9d2c884846ddae278455306e48910e7b8a1930ad83dac876f5f0c
+AUX TestBug1191815.java 4112 SHA256 e101366203272e942f3d4cd5fce772220f60ad66b4f543858204ddef7b0dc563 SHA512 c37491e2fcea0b4ce6bd641ffe128deaa9a8e38533ec3e607415cb1325a975dd8317c212c0fbf9f42b25de7808869df6ac63dacd53c773455f5d2ca0a58f1f62 WHIRLPOOL cc515a4d4bc9737430945ab1bd0f6b9a5f4735e0d6c207a5cd21a57bf669e5090ab86f9b516dbe17ebd90ec4526f8e8da1c1dbbca2d8e1fd9fb7868153ad4f8d
+AUX hsqldb 364 SHA256 d593c563da4beb2ca469c514c635c0e911b69a4978dd900c43151a9478798873 SHA512 6cd0a4a26739960536192a9dda36324e10a16e4ed51028515f07ca5542c68a9f13d9ee9456faf7f797071476747b2026cdf5872ebdf20c1fbfda1079c4164716 WHIRLPOOL 19ffee6439c78571bdd66f9199978240fd10ee1208ee31dad7589237ed84e16400484fde31eb620de01e1d097a382a4d8e1f3a0febdd422766a77356c3c99704
+AUX hsqldb-1.8.1.3-java7.patch 13842 SHA256 47e36e85f3224906372b39afc82ddbfebfa0d0141c0039dab0e1f4df3c5934a7 SHA512 b5e67c3a6e883b50ed74bbc18b81e5244b43161612d2114b645a16c1405c355555740daf8774a3347ae3721f607ca2eb7570117c1ca93ccbe925d34d4968b6e2 WHIRLPOOL 4cd9e15ed03e0e230ea8f8a94585955f4feea9d9127b51514c959e34253c4f4f3b12528de04a45b9477847ad94dce1bdc9d5901bdf57b002d96dfaa7baea40d3
+AUX resolve-config-softlinks.patch 846 SHA256 a7de5886aed87fa040e65d265d5418daee38376ba23742fb97119b629b678517 SHA512 5510a6f70647bb50d4c8ef6c8341b8d4bf38119fd8849b4086b4548ef19abbbaaa12d552f5602bd91ec24e96d7c4ef51efd8e83b38a841f3276ac478bd2480f4 WHIRLPOOL 432f660861d2e7b5a5ca49f973ebe5bdfe932fae5d3b3db19fd446d765971d7f0e3a7039ff8513a762087ea35d102c824b2a8c5068c1face3c5db6bb455935bb
+AUX server.properties 686 SHA256 be7c54fc356d2b14c26e8ec0eecb79c7fa1c72e84c3475bedcd4d08548beeabd SHA512 c36a1d2e387762f96872d94bdb3a6a2af9edb949be9d33321f9ea4e3fb996baecff6fc3875b6bef8f73a54a6a1cedd71dcdf97c881819cb130b1a2b43ec7e842 WHIRLPOOL d36c355af3e9b18da16c670d8a1b03c3edd9b80d6979f1cc3a44bb503dd3e3b979d9f7dd69d9f73f4abb7002e5d8d6702bb73161a07ebe50e67eeaed62ff8358
+AUX sqltool.rc 560 SHA256 f8401fd0472711a9151374e0a15d122f74f4341b19f91def9d738e549a35a8e3 SHA512 80ce53ad07c2091113787cb41232e5900426b042dcc3f62157569588538ad26d471e5d17aac62052902789065efb01647bfbc3488ff3d0f3c9e3df513895f57c WHIRLPOOL 16a9d294009360120cd469b773d17fccec269237e24e0e268a7fdb9688b4a56da9800c80fd985177e79dcc755185592da137a854376ab5a4a12e662d702f7233
+DIST hsqldb_1_8_1_3.zip 3170550 SHA256 c3669bbebcb5c722b273f20c316af744d4e263bc90cc20fd1e6296dff7cc3d07 SHA512 0483ca3299b63b4931b07d49588c729231efca76a317b9620abbd5039127f3f79449eaa1e9d29c52782c58bdb0cc4879b1e3f30f669d2c02c880818f531a8442 WHIRLPOOL ae025d408ee78683133a7bcb1ea6cc130844abc837abe408fe0ea4cf885e082080cb926fabb47ecc59a0f64463e2f969ce51a9e5acc802bdc4e7ba9a62f9756d
+EBUILD hsqldb-1.8.1.3-r2.ebuild 5620 SHA256 44522f8a0d8f6ccefa1316b74a5db963921455b22bd2a960e3647d4356aa2b61 SHA512 29de5768070071682a887c2d738b4b35c9d0b471e69c7b80fd1134a20011ad2ae382dbabc40f56ae14faee55faf4d871c55384a068d44d5d0ec0e018c0e7ce8a WHIRLPOOL df42d2d9c2b11731d0aed1d0e984addf29a705a2bac8be50d1a81a266a08ea776120b372c5070f49202b763e75e50dcb2aa45e4fa02c1184fa99672bebeeb3a4
+MISC ChangeLog 3214 SHA256 2d6819148d8efa8d0913ee7d2f53f47a820856030dfc6fb933d52289f537c509 SHA512 551ba27d9d63a98253fcef3e6d3e7ccff14f0833f437de0a0275a736f3eb5a8538425060d5c2d96554a422e59fcd28d4325ce0e0d6cce40631165974fecb6086 WHIRLPOOL d1f9972e7222e5c31fca7f85404d7f09e1114768110968d06e346eb48abb0671c7bf958d3af6bfad2294c4232e8ba78f4ed945bbe72982337df644619016512f
+MISC ChangeLog-2015 11026 SHA256 b7ac04f85d850a5b3f27cdcff98c02234b8421cedc81acbd9bd1c98ff538b949 SHA512 8e84c311645ea066f73982b5cb8696e135ce1acf576888e59d2d4f69fccdfdfabf74d13b5c0beb272c9f827886a25d2419f68a571ce30c15f5c4e275c753ac19 WHIRLPOOL d346876b966dfda3930b2fc18e25d0cf0514598e565e4b2da66ec8a9a9979ffa9159f4eb20266eb337256a3d38e84de5a4847e4cd07704a5afee37b10dd21896
+MISC metadata.xml 312 SHA256 c1b8f2d2ace87caa277a8c45b4cb15962c7c3cd8f848c78f7c8d396a764b001b SHA512 2b9fff35bd58701cd4992ddc02f6bc7a2027d90616a5b886ef352ad6c6781949a68478bb17bbc22382189ec73ddd1798f67c27941323cb0b727dfead38c7f975 WHIRLPOOL 7c3ebd59c9e7a3e122930ba84524277bea55e9a75a3b4f491bceaa9cdda1eeda14d13b1c603e2573cf287e52432716abe664460432661b8d1c5125c3570a638f
diff --git a/dev-db/hsqldb/files/StringComparator.java b/dev-db/hsqldb/files/StringComparator.java
new file mode 100644
index 000000000000..ae0f7b0fb979
--- /dev/null
+++ b/dev-db/hsqldb/files/StringComparator.java
@@ -0,0 +1,53 @@
+/* Copyright (c) 2001-2008, The HSQL Development Group
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of the HSQL Development Group nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package org.hsqldb.lib;
+
+public class StringComparator implements ObjectComparator {
+
+ public int compare(Object a, Object b) {
+
+ // handle nulls
+ if (a == b) {
+ return 0;
+ }
+
+ if (a == null) {
+ return -1;
+ }
+
+ if (b == null) {
+ return 1;
+ }
+
+ return ((String) a).compareTo((String) b);
+ }
+}
diff --git a/dev-db/hsqldb/files/TestBug1191815.java b/dev-db/hsqldb/files/TestBug1191815.java
new file mode 100644
index 000000000000..06c606401cdd
--- /dev/null
+++ b/dev-db/hsqldb/files/TestBug1191815.java
@@ -0,0 +1,129 @@
+/* Copyright (c) 2001-2009, The HSQL Development Group
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of the HSQL Development Group nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package org.hsqldb.test;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+
+/**
+ * Created on Apr 28, 2005
+ * @author Antranig Basman (antranig@caret.cam.ac.uk)
+ */
+public class TestBug1191815 extends TestBase {
+
+ public TestBug1191815(String name) {
+ super(name);
+ }
+
+ public void test() throws Exception {
+
+ try {
+ Connection conn = newConnection();
+ Statement stmt = conn.createStatement();
+
+ stmt.executeUpdate("drop table testA if exists;");
+ stmt.executeUpdate("create table testA(data timestamp);");
+
+ TimeZone pst = TimeZone.getTimeZone("PST");
+ Calendar cal = new GregorianCalendar(pst);
+
+ cal.clear();
+ cal.set(2005, 0, 1, 0, 0, 0);
+
+
+ // yyyy-mm-dd hh:mm:ss.fffffffff
+ Timestamp ts = new Timestamp(cal.getTimeInMillis());
+ ts.setNanos(1000);
+ PreparedStatement ps =
+ conn.prepareStatement("insert into testA values(?)");
+
+ ps.setTimestamp(1, ts, cal);
+ ps.execute();
+ ps.setTimestamp(1, ts, null);
+ ps.execute();
+
+ String sql = "select * from testA";
+
+ stmt = conn.createStatement();
+
+ ResultSet rs = stmt.executeQuery(sql);
+
+ rs.next();
+
+ Timestamp returned = rs.getTimestamp(1, cal);
+
+ rs.next();
+
+ Timestamp def = rs.getTimestamp(1, null);
+
+ assertEquals(ts, returned);
+ assertEquals(ts, def);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ TestResult result;
+ TestCase test;
+ java.util.Enumeration exceptions;
+ java.util.Enumeration failures;
+ int count;
+
+ result = new TestResult();
+ test = new TestBug1191815("test");
+
+ test.run(result);
+
+ count = result.failureCount();
+
+ System.out.println("TestBug1192000 failure count: " + count);
+
+ failures = result.failures();
+
+ while (failures.hasMoreElements()) {
+ System.out.println(failures.nextElement());
+ }
+ }
+}
+
diff --git a/dev-db/hsqldb/files/hsqldb b/dev-db/hsqldb/files/hsqldb
new file mode 100644
index 000000000000..69920b07f868
--- /dev/null
+++ b/dev-db/hsqldb/files/hsqldb
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting HSQL Database"
+ hsqldb_enable=yes /var/lib/hsqldb/bin/hsqldb start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping HSQL Database"
+ hsqldb_enable=yes /var/lib/hsqldb/bin/hsqldb stop
+ eend $?
+}
diff --git a/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch b/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch
new file mode 100644
index 000000000000..7f9245597182
--- /dev/null
+++ b/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch
@@ -0,0 +1,380 @@
+diff --git a/build/build.xml b/build/build.xml
+index 68c446f..e82f00f 100644
+--- a/build/build.xml
++++ b/build/build.xml
+@@ -98,16 +98,24 @@ examples:
+ <echo message="ant.java.hasjsse=${ant.java.hasjsse}" />
+ </target>
+
+- <target name="javaversion6">
++ <target name="javaversion7" unless="ant.java.iscjavaset">
++ <available classname="java.util.Objects" property="ant.java.iscjava17"/>
++ <available classname="java.util.Objects" property="ant.java.iscjavaset"/>
++ </target>
++
++ <target name="javaversion6" depends="javaversion7" unless="ant.java.iscjavaset">
+ <available classname="java.net.IDN" property="ant.java.iscjava16"/>
++ <available classname="java.net.IDN" property="ant.java.iscjavaset"/>
+ </target>
+
+- <target name="javaversion4" depends="javaversion6" unless="ant.java.iscjava16">
++ <target name="javaversion4" depends="javaversion6" unless="ant.java.iscjavaset">
+ <available classname="java.nio.Buffer" property="ant.java.iscjava14"/>
++ <available classname="java.nio.Buffer" property="ant.java.iscjavaset"/>
+ </target>
+
+- <target name="javaversion2" depends="javaversion4" unless="ant.java.iscjava14">
++ <target name="javaversion2" depends="javaversion4" unless="ant.java.iscjavaset">
+ <available classname="java.lang.ref.Reference" property="ant.java.iscjava12"/>
++ <available classname="java.lang.ref.Reference" property="ant.java.iscjavaset"/>
+ </target>
+
+ <target name="-prepare" depends="init,javaversion2">
+@@ -166,6 +174,7 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcStatement.java"/>
+ <arg file="${src}/org/hsqldb/persist/LockFile.java"/>
+ <arg file="${src}/org/hsqldb/persist/Logger.java"/>
+@@ -183,6 +192,7 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -210,6 +220,7 @@ examples:
+ <arg value="+JAVA2FULL"/>
+ <arg value="-JAVA4"/>
+ <arg value="-JAVA6"/>
++ <arg value="-JAVA7"/>
+ </java>
+ </target>
+
+@@ -218,6 +229,7 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -244,6 +256,7 @@ examples:
+ <arg value="+JAVA2FULL"/>
+ <arg value="+JAVA4"/>
+ <arg value="-JAVA6"/>
++ <arg value="-JAVA7"/>
+ </java>
+ </target>
+
+@@ -253,6 +266,43 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcCallableStatement.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcClob.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcConnection.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcParameterMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcPreparedStatement.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcResultSet.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcResultSetMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcStatement.java"/>
++ <arg file="${src}/org/hsqldb/persist/LockFile.java"/>
++ <arg file="${src}/org/hsqldb/persist/Logger.java"/>
++ <arg file="${src}/org/hsqldb/persist/ScaledRAFile.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/util/DatabaseManager.java"/>
++ <arg file="${src}/org/hsqldb/util/ConnectionDialogCommon.java"/>
++ <arg file="${src}/org/hsqldb/lib/SimpleLog.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/lib/SimpleLog.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/HsqlDateTime.java"/>
++ <arg value="+JAVA2"/>
++ <arg value="+JAVA2FULL"/>
++ <arg value="+JAVA4"/>
++ <arg value="+JAVA6"/>
++ <arg value="-JAVA7"/>
++ </java>
++ </target>
++
++ <target name="switchtojdk17" depends="switchtojdk16"
++ description="self explanatory" if="ant.java.iscjava17">
++ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
++ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
++ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -279,10 +329,11 @@ examples:
+ <arg value="+JAVA2FULL"/>
+ <arg value="+JAVA4"/>
+ <arg value="+JAVA6"/>
++ <arg value="+JAVA7"/>
+ </java>
+ </target>
+
+- <target name="store" depends="switchtojdk16"
++ <target name="store" depends="switchtojdk17"
+ description="compiles the /store folder">
+ <javac srcdir="${src}"
+ destdir="classes"
+diff --git a/src/org/hsqldb/jdbc/jdbcCallableStatement.java b/src/org/hsqldb/jdbc/jdbcCallableStatement.java
+index 3779094..d2131ed 100644
+--- a/src/org/hsqldb/jdbc/jdbcCallableStatement.java
++++ b/src/org/hsqldb/jdbc/jdbcCallableStatement.java
+@@ -3106,7 +3106,6 @@ implements CallableStatement {
+
+ //#endif JAVA4
+ //#ifdef JAVA6
+-/*
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -3376,7 +3375,20 @@ implements CallableStatement {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public <T> T getObject(int ColumnIndex, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcConnection.java b/src/org/hsqldb/jdbc/jdbcConnection.java
+index 5d59464..0c7e08a 100644
+--- a/src/org/hsqldb/jdbc/jdbcConnection.java
++++ b/src/org/hsqldb/jdbc/jdbcConnection.java
+@@ -43,13 +43,17 @@ import java.sql.Connection;
+ import java.sql.DatabaseMetaData;
+
+ //#ifdef JAVA6
+-/*
+ import java.sql.NClob;
+ import java.sql.SQLClientInfoException;
+ import java.sql.SQLXML;
+-*/
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++import java.util.concurrent.Executor;
++
++//#endif JAVA7
++
+ import java.sql.PreparedStatement;
+ import java.sql.SQLException;
+ import java.sql.SQLWarning;
+@@ -2794,4 +2798,31 @@ public class jdbcConnection implements Connection {
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public int getNetworkTimeout() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void setNetworkTimeout(Executor executor, int millis) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void abort(Executor executor) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public String getSchema() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void setSchema(String schema) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcDataSource.java b/src/org/hsqldb/jdbc/jdbcDataSource.java
+index 9f79a37..d0ab49b 100644
+--- a/src/org/hsqldb/jdbc/jdbcDataSource.java
++++ b/src/org/hsqldb/jdbc/jdbcDataSource.java
+@@ -47,6 +47,11 @@ import javax.sql.DataSource;
+ //#endif JAVA4
+ import org.hsqldb.jdbcDriver;
+
++//#ifdef JAVA7
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++//#endif JAVA7
++
+ // boucherb@users 20040411 - doc 1.7.2 - javadoc updates toward 1.7.2 final
+
+ /**
+@@ -312,7 +317,6 @@ public class jdbcDataSource implements Serializable {
+ }
+
+ //#ifdef JAVA6
+-/*
+ public <T> T unwrap(Class<T> iface) throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -322,7 +326,14 @@ public class jdbcDataSource implements Serializable {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException
++ {
++ throw new SQLFeatureNotSupportedException("Not supported yet.");
++ }
++
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
+index ffa238d..0480228 100644
+--- a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
++++ b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
+@@ -5650,7 +5650,6 @@ public class jdbcDatabaseMetaData implements DatabaseMetaData {
+ }
+
+ //#ifdef JAVA6
+-/*
+ public RowIdLifetime getRowIdLifetime() throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -5694,7 +5693,23 @@ public class jdbcDatabaseMetaData implements DatabaseMetaData {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+
+ //#endif JAVA6
++
++
++//#ifdef JAVA7
++ public boolean generatedKeyAlwaysReturned() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public ResultSet getPseudoColumns(String catalog, String schemaPattern,
++ String tableNamePattern, String columnNamePattern) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++
++//#endif JAVA7
++
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcResultSet.java b/src/org/hsqldb/jdbc/jdbcResultSet.java
+index 2a6567e..81aecf3 100644
+--- a/src/org/hsqldb/jdbc/jdbcResultSet.java
++++ b/src/org/hsqldb/jdbc/jdbcResultSet.java
+@@ -5332,4 +5332,19 @@ public class jdbcResultSet implements ResultSet {
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public <T> T getObject(int columnNum, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++//#endif JAVA7
++
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcStatement.java b/src/org/hsqldb/jdbc/jdbcStatement.java
+index f84f2e2..38bf8d0 100644
+--- a/src/org/hsqldb/jdbc/jdbcStatement.java
++++ b/src/org/hsqldb/jdbc/jdbcStatement.java
+@@ -1588,7 +1588,6 @@ public class jdbcStatement implements Statement {
+ }
+ }
+ //#ifdef JAVA6
+-/*
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -1608,6 +1607,17 @@ public class jdbcStatement implements Statement {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public boolean isCloseOnCompletion() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void closeOnCompletion() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbcDriver.java b/src/org/hsqldb/jdbcDriver.java
+index a377b36..361c074 100644
+--- a/src/org/hsqldb/jdbcDriver.java
++++ b/src/org/hsqldb/jdbcDriver.java
+@@ -42,6 +42,11 @@ import org.hsqldb.jdbc.jdbcConnection;
+ import org.hsqldb.persist.HsqlDatabaseProperties;
+ import org.hsqldb.persist.HsqlProperties;
+
++//#ifdef JAVA7
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++//#endif JAVA7
++
+ // fredt@users 20011220 - patch 1.7.0 by fredt
+ // new version numbering scheme
+ // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
+@@ -321,4 +326,12 @@ public class jdbcDriver implements Driver {
+ DriverManager.registerDriver(new jdbcDriver());
+ } catch (Exception e) {}
+ }
++
++//#ifdef JAVA7
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException
++ {
++ throw new SQLFeatureNotSupportedException("Not supported yet.");
++ }
++
++//#endif JAVA7
+ }
diff --git a/dev-db/hsqldb/files/resolve-config-softlinks.patch b/dev-db/hsqldb/files/resolve-config-softlinks.patch
new file mode 100644
index 000000000000..5a716e6dc3a2
--- /dev/null
+++ b/dev-db/hsqldb/files/resolve-config-softlinks.patch
@@ -0,0 +1,22 @@
+diff -urpN hsqldb.orig/bin/hsqldb hsqldb/bin/hsqldb
+--- hsqldb.orig/bin/hsqldb 2006-07-08 15:55:55.000000000 +0200
++++ hsqldb/bin/hsqldb 2006-07-08 16:03:28.000000000 +0200
+@@ -282,6 +282,18 @@ else
+ echo "Auth file '$_AUTH_TEST_PATH' not readable" 1>&2
+ exit 2
+ }
++
++ # resolve links - $_AUTH_TEST_PATH may be a softlink
++ while [ -h "$_AUTH_TEST_PATH" ]; do
++ ls=`ls -ld "$_AUTH_TEST_PATH"`
++ link=`expr "$ls" : '.*-> \(.*\)$'`
++ if expr "$link" : '.*/.*' > /dev/null; then
++ _AUTH_TEST_PATH="$link"
++ else
++ _AUTH_TEST_PATH=`dirname "$_AUTH_TEST_PATH"`/"$link"
++ fi
++ done
++
+ ls -ld "$_AUTH_TEST_PATH" | grep '^-..------' > /dev/null 2>&1 || {
+ echo "Fix permissions on '$_AUTH_TEST_PATH' like 'chmod 600 $_AUTH_TEST_PATH'" 1>&2
+ exit 2
diff --git a/dev-db/hsqldb/files/server.properties b/dev-db/hsqldb/files/server.properties
new file mode 100644
index 000000000000..4827d1cb6ec0
--- /dev/null
+++ b/dev-db/hsqldb/files/server.properties
@@ -0,0 +1,20 @@
+# Hsqldb Server cfg file.
+# See the UNIX Quick Start and the Advanced Topics chapters
+# of the Hsqldb User Guide.
+
+server.database.0=file:/var/lib/hsqldb/db1
+server.urlid.0=localhost
+
+# Warning!
+# When running hsqldb in Server mode, for each additional database
+# the server.urlid.X entry must have a proper corresponding urlid
+# section in the 'sqltool.rc' file.
+# Otherwise you may have problems with shutting down the server.
+#
+# Note that each server can serve only up to 10 different
+# databases simultaneously (with consecutive {0-9} suffixes).
+
+# An example of additional database.
+#server.database.1=file:/var/lib/hsqldb/newdb/newdb
+#server.dbname.1=newdb
+#server.urlid.1=newdb
diff --git a/dev-db/hsqldb/files/sqltool.rc b/dev-db/hsqldb/files/sqltool.rc
new file mode 100644
index 000000000000..2e65a6816f3d
--- /dev/null
+++ b/dev-db/hsqldb/files/sqltool.rc
@@ -0,0 +1,18 @@
+# This is a sample SqlTool configuration file, a.k.a. rc file.
+
+# This is for a hsqldb Server running with default settings on your local
+# computer (and for which you have not changed the password for "sa").
+urlid localhost
+url jdbc:hsqldb:hsql://localhost
+username sa
+password
+
+# Each urlid section in this file corresponds to one of the
+# server.urlid.X entries in the 'server.properties' file.
+# This is required by the hsqldb init script.
+
+# An example of additional database.
+#urlid newdb
+#url jdbc:hsqldb:hsql://localhost/newdb
+#username sa
+#password
diff --git a/dev-db/hsqldb/hsqldb-1.8.1.3-r2.ebuild b/dev-db/hsqldb/hsqldb-1.8.1.3-r2.ebuild
new file mode 100644
index 000000000000..e71cb3f4b018
--- /dev/null
+++ b/dev-db/hsqldb/hsqldb-1.8.1.3-r2.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+JAVA_PKG_IUSE="doc source test"
+
+inherit eutils user versionator java-pkg-2 java-ant-2
+
+MY_PV=$(replace_all_version_separators _ )
+MY_P="${PN}_${MY_PV}"
+
+DESCRIPTION="The leading SQL relational database engine written in Java"
+HOMEPAGE="http://hsqldb.org"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+CDEPEND="
+ java-virtuals/servlet-api:2.5"
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.5"
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.5
+ app-arch/unzip
+ test? ( dev-java/junit:0 )"
+
+S="${WORKDIR}/${PN}"
+
+HSQLDB_JAR=/usr/share/hsqldb/lib/hsqldb.jar
+HSQLDB_HOME=/var/lib/hsqldb
+
+pkg_setup() {
+ enewgroup hsqldb
+ enewuser hsqldb -1 /bin/sh /dev/null hsqldb
+
+ java-pkg-2_pkg_setup
+}
+
+java_prepare() {
+ rm -v lib/*.jar || die
+
+ sed -i -r \
+ -e "s#/etc/sysconfig#${EPREFIX}/etc/conf.d#g" \
+ bin/hsqldb || die
+
+ java-pkg_filter-compiler jikes
+
+ eant -q -f "${EANT_BUILD_XML}" cleanall > /dev/null
+
+ epatch "${FILESDIR}/resolve-config-softlinks.patch"
+ epatch "${FILESDIR}/${P}-java7.patch"
+
+ mkdir conf
+ sed -e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${EPREFIX//\//\\/}${HSQLDB_JAR//\//\\/}/g" \
+ -e "s/^SERVER_HOME=.*$/SERVER_HOME=${EPREFIX//\//\\/}\/var\/lib\/hsqldb/g" \
+ -e "s/^HSQLDB_OWNER=.*$/HSQLDB_OWNER=hsqldb/g" \
+ -e 's/^#AUTH_FILE=.*$/AUTH_FILE=${SERVER_HOME}\/sqltool.rc/g' \
+ src/org/hsqldb/sample/sample-hsqldb.cfg > conf/hsqldb || die
+ cp "${FILESDIR}/server.properties" conf/ || die
+ cp "${FILESDIR}/sqltool.rc" conf/ || die
+
+ # Missing source file - needed for tests
+ # http://hsqldb.cvs.sourceforge.net/*checkout*/hsqldb/hsqldb-dev/src/org/hsqldb/lib/StringComparator.java?revision=1.1&pathrev=hsqldb_1_8_0_10
+ # https://sourceforge.net/tracker/index.php?func=detail&aid=2008754&group_id=23316&atid=378131
+ cp "${FILESDIR}/StringComparator.java" src/org/hsqldb/lib || die
+ cp "${FILESDIR}/TestBug1191815.java" src/org/hsqldb/test/ || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+
+# EANT_BUILD_XML used also in src_prepare
+EANT_BUILD_XML="build/build.xml"
+EANT_BUILD_TARGET="jar jarclient jarsqltool jarutil"
+EANT_DOC_TARGET="javadocdev"
+EANT_GENTOO_CLASSPATH="servlet-api-2.5"
+
+src_test() {
+ java-pkg_jar-from --into lib junit
+ eant -f ${EANT_BUILD_XML} jartest
+ cd testrun/hsqldb || die
+ ./runTest.sh TestSelf || die "TestSelf hsqldb tests failed"
+ # TODO. These fail. Investigate why.
+ #cd "${S}/testrun/sqltool" || die
+ #CLASSPATH="${S}/lib/hsqldb.jar" ./runtests.bash || die "sqltool test failed"
+}
+
+src_install() {
+ java-pkg_dojar lib/hsql*.jar
+
+ if use doc; then
+ dodoc doc/*.txt
+ dohtml -r doc/zaurus
+ dohtml -r doc/src
+ fi
+ use source && java-pkg_dosrc src/*
+
+ echo "CONFIG_PROTECT=\"${HSQLDB_HOME}\"" > "${T}"/35hsqldb || die
+ doenvd "${T}"/35hsqldb
+
+ # Put init, configuration and authorization files in /etc
+ doinitd "${FILESDIR}/hsqldb"
+ doconfd conf/hsqldb
+ dodir /etc/hsqldb
+ insinto /etc/hsqldb
+ # Change the ownership of server.properties and sqltool.rc
+ # files to hsqldb:hsqldb. (resolves Bug #111963)
+ use prefix || insopts -m0600 -o hsqldb -g hsqldb
+ doins conf/server.properties
+ use prefix || insopts -m0600 -o hsqldb -g hsqldb
+ doins conf/sqltool.rc
+
+ # Install init script
+ dodir "${HSQLDB_HOME}/bin"
+ keepdir "${HSQLDB_HOME}"
+ exeinto "${HSQLDB_HOME}/bin"
+ doexe bin/hsqldb
+
+ # Make sure that files have correct permissions
+ use prefix || chown -R hsqldb:hsqldb "${ED}${HSQLDB_HOME}"
+ chmod o-rwx "${ED}${HSQLDB_HOME}"
+
+ # Create symlinks to authorization files in the server home dir
+ # (required by the hqldb init script)
+ insinto "${HSQLDB_HOME}"
+ dosym ../../../etc/hsqldb/server.properties "${HSQLDB_HOME}/server.properties"
+ dosym ../../../etc/hsqldb/sqltool.rc "${HSQLDB_HOME}/sqltool.rc"
+}
+
+pkg_postinst() {
+ ewarn "If you intend to run Hsqldb in Server mode and you want to create"
+ ewarn "additional databases, remember to put correct information in both"
+ ewarn "'server.properties' and 'sqltool.rc' files."
+ ewarn "(read the 'Init script Setup Procedure' section of the 'Chapter 3."
+ ewarn "UNIX Quick Start' in the Hsqldb docs for more information)"
+ echo
+ elog "Example:"
+ echo
+ elog "${EPREFIX}/etc/hsqldb/server.properties"
+ elog "============================="
+ elog "server.database.1=file:xdb/xdb"
+ elog "server.dbname.1=xdb"
+ elog "server.urlid.1=xdb"
+ elog
+ elog "${EPREFIX}/etc/hsqldb/sqltool.rc"
+ elog "======================"
+ elog "urlid xdb"
+ elog "url jdbc:hsqldb:hsql://localhost/xdb"
+ elog "username sa"
+ elog "password "
+ echo
+ elog "Also note that each hsqldb server can serve only up to 10"
+ elog "different databases simultaneously (with consecutive {0-9}"
+ elog "suffixes in the 'server.properties' file)."
+ echo
+ ewarn "For data manipulation use:"
+ ewarn
+ ewarn "# java -classpath ${EPREFIX}${HSQLDB_JAR} org.hsqldb.util.DatabaseManager"
+ ewarn "# java -classpath ${EPREFIX}${HSQLDB_JAR} org.hsqldb.util.DatabaseManagerSwing"
+ ewarn "# java -classpath ${EPREFIX}${HSQLDB_JAR} org.hsqldb.util.SqlTool \\"
+ ewarn " --rcFile ${EPREFIX}/var/lib/hsqldb/sqltool.rc <dbname>"
+ echo
+ elog "The Hsqldb can be run in multiple modes - read 'Chapter 1. Running'"
+ elog "and Using Hsqldb' in the Hsqldb docs at:"
+ elog " http://hsqldb.org/web/hsqlDocsFrame.html"
+ elog "If you intend to run it in the Server mode, it is suggested to add the"
+ elog "init script to your start-up scripts, this should be done like this:"
+ elog " \`rc-update add hsqldb default\`"
+ echo
+}
diff --git a/dev-db/hsqldb/metadata.xml b/dev-db/hsqldb/metadata.xml
new file mode 100644
index 000000000000..90ae84e29855
--- /dev/null
+++ b/dev-db/hsqldb/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">hsqldb</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/hyperdex/Manifest b/dev-db/hyperdex/Manifest
new file mode 100644
index 000000000000..57d8b3245e5a
--- /dev/null
+++ b/dev-db/hyperdex/Manifest
@@ -0,0 +1,15 @@
+AUX hyperdex.confd 122 SHA256 8ecfb0b8fbadacff70efeaae479ff527c7ee868d2f98c17cf3afb30d212844d2 SHA512 77bd29ba3aad673a024be819c488bd344c0780d09822aa40285657f89c32a40de799bc33edb198205c7a42c8fc5fc1215c289100364caff95c6a1d765d436202 WHIRLPOOL 9f467bfca34b1d24e0429c8cb6bd1b455e1eba3a639968d6c955381ba2f61c04026f38bd3f03d01ec9c4f4cb31f0a55f8f43de14a9e0da8ab396f0c8732c8ea0
+AUX hyperdex.initd 226 SHA256 0a3a7ca0ab50bf41c8d139ac3cb4535fdefdc66442c6a49a82b66397c229cb41 SHA512 1eb77a5ea22e0893ba130239d9783b1699f6d1ef7773f9cba10e4353fd4cf4a21d9fd57b2f4acac0488597f88d74bf36e2fa0f5d6472709e926ef898463bf37c WHIRLPOOL 2487f9181ce3bcc5944299dac1cb9702aa76103998280780b357b6d5b46ccfcce62c296918587af50691ecee3ffb0c8acc5992e1e1ab4b4b58b7340a9a2b51be
+DIST autotools-java.tar 2770 SHA256 b74a069cf94d05cfbfe3eb65d42603d9a9d46a130044d76ffbf55ae822b62b3d SHA512 a193c3c3f8cc654967905c9ab559098425f1688a75c21a4207959fbe13572b4dba3e5c21e04913f20e5aa1b1c2fd2b13dcef91cc4f031b06884ac3130edc5757 WHIRLPOOL 3fbf5f0ab1a4bd231e69f924442f047c1e872f04c85afc46dca423c93641264347dc2d2c2a8b1cca740bf349d4db02594144c3797eb1c4bd649a35c169f7c86e
+DIST hyperdex-1.6.0.tar.gz 1490273 SHA256 1a29ef60b2416b078cf82f120386e4fda53fc40ef613653d6c1b8a46ef4167c0 SHA512 44e1c5fa1e0e2158bf3eb72dc94681f8aaf3a804ce7b2df05461c1f4c9f0e3e71ee7f0503c25ee9e00701ba9444df18ecbe427606de4ddd3b1f31d382b037272 WHIRLPOOL f52494148800b16cb663dc137c54beca61010a0a279d7a4fbefb0a3b149963437600808aa7d2efab5015c2c03efc544fb2ee6ecc1ad05da205a026b9dec1d1c0
+DIST hyperdex-1.7.1.tar.gz 1517677 SHA256 db3857aa74795698e50c6a9abdc6a0570c67e701b5213c803d5fba16b45cf1a4 SHA512 41bf8cc49081ba41917c737facfa7b5e29bcf73f510ae5743356828643bd7292ac8c610915985e52f6609c4a80cf70e7d515504bbe0a85383c74d7e288f2dc5b WHIRLPOOL 8bfd39e9e3aea7eae5a85ab64f583f5689add551c86a6c3bf40557ebb9fff0dbfec91bb1c0eb3f812be7f35d044ba16872eae850bc9127b56aff21168e66ead2
+DIST hyperdex-1.8.0.tar.gz 1516389 SHA256 5717fa3775dd28c996805ee7b48afd1bbf64868a6cf271c8e96928addebcd968 SHA512 e667552f16899edf57a08f3704e762e33b33aa9508ee486187b5c6fd6f01ab9cb61cd65444a676386554cebb2e4d191b4181df4c9b399821e5d244791bf3cb12 WHIRLPOOL 151d560e30135349be07b5f543c435f36ab839576f84d994742b9e1423174fd211761f84146acea7e847ff7e3e27688c42fb276c5b4f681a2bef7b37337e6aea
+DIST hyperdex-1.8.1.tar.gz 1516446 SHA256 b62e9dc5c6bda115869b35213b221b2483d43a64de8356c028b49a748eb76d26 SHA512 28a9b1a1f99d4159fb2d453fb7f740d4926ac2275488c8676a70d45879be5b1ef9b1e84720f86ef4f058706558899f2e3229fc7140349dadc3974754a03ac13e WHIRLPOOL d62b1d4562f89a5818d57514e079f7a749315068dfd5cbd99aca71d996969ae32e2e776e1b934a33d78ba15d6f9013719aeac80484f614dd2f466c5486a2bb31
+EBUILD hyperdex-1.6.0-r1.ebuild 1495 SHA256 0add13ef951a7465610b2a2ddf03ae51fcda3a9e66c7d60fe3485eac0259e53f SHA512 9b062654809c5bdd6c53f7cca813f88d1d3e1675e54522aa3ad7957f278b932f6ff98d800b63984ad24548abb4724107b7fd1ead15f899dc548e5553e463c807 WHIRLPOOL a6369773124ff17ed6b9adc7d002b190c52f0452071a8c734379f9fda6da59d9305ba2ace268c174774a665e1a84f3319cb0abcb07bba98fadcb86c27078242f
+EBUILD hyperdex-1.7.1.ebuild 1495 SHA256 0add13ef951a7465610b2a2ddf03ae51fcda3a9e66c7d60fe3485eac0259e53f SHA512 9b062654809c5bdd6c53f7cca813f88d1d3e1675e54522aa3ad7957f278b932f6ff98d800b63984ad24548abb4724107b7fd1ead15f899dc548e5553e463c807 WHIRLPOOL a6369773124ff17ed6b9adc7d002b190c52f0452071a8c734379f9fda6da59d9305ba2ace268c174774a665e1a84f3319cb0abcb07bba98fadcb86c27078242f
+EBUILD hyperdex-1.8.0.ebuild 1594 SHA256 49ad0c9cdeda1a0f130d42087f30406ec267e53bcdcc5be2b6db9f2291c0b0c1 SHA512 1a797b399c474392d7170349964fcf6a3592ff5f3678627b96fda458db15de30515819ae2df55a9c852c9aea00cfbc37a6bfc0aa849d0001a226dcbab70cb517 WHIRLPOOL df86a9047dd9df823391d79c7847a011f350f1278b2f70935cfcb0aee07dd4ed1560aae76bb1d98d92fea113bc59c6fda5689cb94fd2a29d1303b28629a42366
+EBUILD hyperdex-1.8.1.ebuild 1594 SHA256 49ad0c9cdeda1a0f130d42087f30406ec267e53bcdcc5be2b6db9f2291c0b0c1 SHA512 1a797b399c474392d7170349964fcf6a3592ff5f3678627b96fda458db15de30515819ae2df55a9c852c9aea00cfbc37a6bfc0aa849d0001a226dcbab70cb517 WHIRLPOOL df86a9047dd9df823391d79c7847a011f350f1278b2f70935cfcb0aee07dd4ed1560aae76bb1d98d92fea113bc59c6fda5689cb94fd2a29d1303b28629a42366
+EBUILD hyperdex-9999.ebuild 1431 SHA256 dc4e5e5c6fe07be499f089fe832c09abef6f8cdd37542f818889a0e401657d3f SHA512 36982995c3e8ba96613dcadc3736218f0baf039f52ac66d49bb7dd3fe0d1a6638a8c86a8ffdf5a604b4293128b694c6289c13540517bfbed2f58249c2c44c338 WHIRLPOOL 7163dc4946577d944ecdc6510e62abb5fae2dee0392d99fac48311fb0332427ac39b00521a92434f0877ab740614bef4639de04082a3266206f8134d0b1b1ff6
+MISC ChangeLog 3094 SHA256 9e296961d144e0d2d7f1a8bf04b376713ac4993f864e2f0c9d375cf6f59bed0c SHA512 acc1248ccb352db707095f99d50e3553e443516f598568047a00f8182e1cbb84b2a515a8447e208574b74766ca3e87bb2e46a2d399d15a59fe9e40bd48af036d WHIRLPOOL 8834e9b30f986becae4b1b5893947c3e27d4da4163342ebf2f5e7c76a0746942d269cb0718dd4cc4afc38e31df06720f1e02ff61f4404950899a2dba54e8d86f
+MISC ChangeLog-2015 4982 SHA256 ad08061d15c4903cc823beb4b0cfab466bd202d89555eb83cb9b6579bd2904bf SHA512 31f6cabf61acc4944ffa069a2648b12e61c6f5de586124bf06f754267a102d246249a784ea51d08bb2fc240348a2eab430132b591b0a2b3d91c8952f4afe85bf WHIRLPOOL 3782221c10496d17a8b53d72aec0f73b6b01e0e093f0c6510841475a37594bb55711bc8f1565542b3df90ca5d0a1b2723a4091b13de9cfb8c6ad851e79ea41b3
+MISC metadata.xml 247 SHA256 0deec0776f26fb762fdf7711f4589b14f52a2456436ef557eec62a2cf2fb2bb7 SHA512 29cf52c16b0cce69899d9c2da8acd9144b7d760442aa323b854dceadb42459e009545193b1df7911ac2241b59f4819b4a6bb1d206d6f57953f770031433bb6b7 WHIRLPOOL a135fa622e99d3dcdb432bc6b3c366076b3d86b4bfd9a76c852d781b8e9152541c7e7a2c7c6d6a3c4d2200dce792847a08166aaf7c17c22b6299dfe868234dec
diff --git a/dev-db/hyperdex/files/hyperdex.confd b/dev-db/hyperdex/files/hyperdex.confd
new file mode 100644
index 000000000000..d7bab25e5c9d
--- /dev/null
+++ b/dev-db/hyperdex/files/hyperdex.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/hyperdex: config file for /etc/init.d/hyperdex
+
+# see documentation for HyperDex for help
+#HYPERDEX_OPTS=""
diff --git a/dev-db/hyperdex/files/hyperdex.initd b/dev-db/hyperdex/files/hyperdex.initd
new file mode 100644
index 000000000000..181f1c7a811f
--- /dev/null
+++ b/dev-db/hyperdex/files/hyperdex.initd
@@ -0,0 +1,10 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/hyperdex-daemon"
+command_args="--daemon ${HYPERDEX_OPTS}"
+
+depend() {
+ use net
+}
diff --git a/dev-db/hyperdex/hyperdex-1.6.0-r1.ebuild b/dev-db/hyperdex/hyperdex-1.6.0-r1.ebuild
new file mode 100644
index 000000000000..785eef7c7353
--- /dev/null
+++ b/dev-db/hyperdex/hyperdex-1.6.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 autotools
+
+DESCRIPTION="A searchable distributed Key-Value Store"
+
+HOMEPAGE="http://hyperdex.org"
+SRC_URI="http://hyperdex.org/src/${P}.tar.gz
+ http://dev.gentooexperimental.org/~patrick/autotools-java.tar"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="test +python"
+# need to add ruby and java useflags too
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) test? ( python )"
+
+# Tests fail, still
+RESTRICT="test"
+
+DEPEND="
+ dev-cpp/glog
+ dev-cpp/sparsehash
+ dev-libs/cityhash
+ dev-libs/libpo6
+ dev-libs/libe
+ dev-libs/busybee
+ dev-libs/popt
+ dev-libs/replicant
+ dev-libs/libmacaroons
+ dev-libs/libtreadstone
+ dev-libs/json-c
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ cp "${WORKDIR}/"*.m4 m4/
+ sed -i -e 's~json/json.h~json-c/json.h~' configure.ac common/datatype_document.cc daemon/index_document.cc || die "Blergh!"
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-static \
+ $(use_enable python python-bindings)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to install"
+ newinitd "${FILESDIR}/hyperdex.initd" hyperdex || die "Failed to install init script"
+ newconfd "${FILESDIR}/hyperdex.confd" hyperdex || die "Failed to install config file"
+ find "${D}" -name '*.la' -exec rm {} \; # bad buildsystem! bad!
+}
diff --git a/dev-db/hyperdex/hyperdex-1.7.1.ebuild b/dev-db/hyperdex/hyperdex-1.7.1.ebuild
new file mode 100644
index 000000000000..785eef7c7353
--- /dev/null
+++ b/dev-db/hyperdex/hyperdex-1.7.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 autotools
+
+DESCRIPTION="A searchable distributed Key-Value Store"
+
+HOMEPAGE="http://hyperdex.org"
+SRC_URI="http://hyperdex.org/src/${P}.tar.gz
+ http://dev.gentooexperimental.org/~patrick/autotools-java.tar"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="test +python"
+# need to add ruby and java useflags too
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) test? ( python )"
+
+# Tests fail, still
+RESTRICT="test"
+
+DEPEND="
+ dev-cpp/glog
+ dev-cpp/sparsehash
+ dev-libs/cityhash
+ dev-libs/libpo6
+ dev-libs/libe
+ dev-libs/busybee
+ dev-libs/popt
+ dev-libs/replicant
+ dev-libs/libmacaroons
+ dev-libs/libtreadstone
+ dev-libs/json-c
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ cp "${WORKDIR}/"*.m4 m4/
+ sed -i -e 's~json/json.h~json-c/json.h~' configure.ac common/datatype_document.cc daemon/index_document.cc || die "Blergh!"
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-static \
+ $(use_enable python python-bindings)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to install"
+ newinitd "${FILESDIR}/hyperdex.initd" hyperdex || die "Failed to install init script"
+ newconfd "${FILESDIR}/hyperdex.confd" hyperdex || die "Failed to install config file"
+ find "${D}" -name '*.la' -exec rm {} \; # bad buildsystem! bad!
+}
diff --git a/dev-db/hyperdex/hyperdex-1.8.0.ebuild b/dev-db/hyperdex/hyperdex-1.8.0.ebuild
new file mode 100644
index 000000000000..6d245f6659b3
--- /dev/null
+++ b/dev-db/hyperdex/hyperdex-1.8.0.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 autotools
+
+DESCRIPTION="A searchable distributed Key-Value Store"
+
+HOMEPAGE="http://hyperdex.org"
+SRC_URI="http://hyperdex.org/src/${P}.tar.gz
+ http://dev.gentooexperimental.org/~patrick/autotools-java.tar"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="test +python"
+# need to add ruby and java useflags too
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) test? ( python )"
+
+# Tests fail, still
+RESTRICT="test"
+
+DEPEND="
+ dev-cpp/glog
+ dev-cpp/sparsehash
+ dev-libs/cityhash
+ >=dev-libs/hyperleveldb-1.2
+ >=dev-libs/libpo6-0.8
+ >=dev-libs/libe-0.11
+ >=dev-libs/busybee-0.7
+ dev-libs/popt
+ >=dev-libs/replicant-0.8
+ >=dev-libs/libmacaroons-0.3
+ >=dev-libs/libtreadstone-0.2
+ dev-libs/json-c
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ cp "${WORKDIR}/"*.m4 m4/
+ sed -i -e 's~json/json.h~json-c/json.h~' configure.ac common/datatype_document.cc daemon/index_document.cc || die "Blergh!"
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-static \
+ $(use_enable python python-bindings)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to install"
+ newinitd "${FILESDIR}/hyperdex.initd" hyperdex || die "Failed to install init script"
+ newconfd "${FILESDIR}/hyperdex.confd" hyperdex || die "Failed to install config file"
+ find "${D}" -name '*.la' -exec rm {} \; # bad buildsystem! bad!
+}
+
+src_test() {
+ emake -j1 check
+}
diff --git a/dev-db/hyperdex/hyperdex-1.8.1.ebuild b/dev-db/hyperdex/hyperdex-1.8.1.ebuild
new file mode 100644
index 000000000000..6d245f6659b3
--- /dev/null
+++ b/dev-db/hyperdex/hyperdex-1.8.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 autotools
+
+DESCRIPTION="A searchable distributed Key-Value Store"
+
+HOMEPAGE="http://hyperdex.org"
+SRC_URI="http://hyperdex.org/src/${P}.tar.gz
+ http://dev.gentooexperimental.org/~patrick/autotools-java.tar"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="test +python"
+# need to add ruby and java useflags too
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) test? ( python )"
+
+# Tests fail, still
+RESTRICT="test"
+
+DEPEND="
+ dev-cpp/glog
+ dev-cpp/sparsehash
+ dev-libs/cityhash
+ >=dev-libs/hyperleveldb-1.2
+ >=dev-libs/libpo6-0.8
+ >=dev-libs/libe-0.11
+ >=dev-libs/busybee-0.7
+ dev-libs/popt
+ >=dev-libs/replicant-0.8
+ >=dev-libs/libmacaroons-0.3
+ >=dev-libs/libtreadstone-0.2
+ dev-libs/json-c
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ cp "${WORKDIR}/"*.m4 m4/
+ sed -i -e 's~json/json.h~json-c/json.h~' configure.ac common/datatype_document.cc daemon/index_document.cc || die "Blergh!"
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-static \
+ $(use_enable python python-bindings)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to install"
+ newinitd "${FILESDIR}/hyperdex.initd" hyperdex || die "Failed to install init script"
+ newconfd "${FILESDIR}/hyperdex.confd" hyperdex || die "Failed to install config file"
+ find "${D}" -name '*.la' -exec rm {} \; # bad buildsystem! bad!
+}
+
+src_test() {
+ emake -j1 check
+}
diff --git a/dev-db/hyperdex/hyperdex-9999.ebuild b/dev-db/hyperdex/hyperdex-9999.ebuild
new file mode 100644
index 000000000000..92491ebb675a
--- /dev/null
+++ b/dev-db/hyperdex/hyperdex-9999.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1 autotools git-r3
+
+DESCRIPTION="A searchable distributed Key-Value Store"
+
+HOMEPAGE="http://hyperdex.org"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS=""
+
+EGIT_REPO_URI="https://github.com/rescrv/HyperDex.git"
+
+SRC_URI="http://dev.gentooexperimental.org/~patrick/autotools-java.tar"
+
+IUSE="+python"
+# need to add ruby and java useflags too
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="
+ dev-cpp/glog
+ dev-cpp/sparsehash
+ dev-libs/cityhash
+ dev-libs/libpo6
+ dev-libs/libe
+ dev-libs/busybee
+ dev-libs/popt
+ dev-libs/replicant
+ dev-libs/json-c
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ cd m4; tar xf "${DISTDIR}/autotools-java.tar"
+ cd ..
+ sed -i -e 's~json/json.h~json-c/json.h~' configure.ac common/datatype_document.cc daemon/index_document.cc || die "Blergh!"
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-static \
+ $(use_enable python python-bindings)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to install"
+ newinitd "${FILESDIR}/hyperdex.initd" hyperdex || die "Failed to install init script"
+ newconfd "${FILESDIR}/hyperdex.confd" hyperdex || die "Failed to install config file"
+ find "${D}" -name '*.la' -exec rm {} \; # bad buildsystem! bad!
+}
diff --git a/dev-db/hyperdex/metadata.xml b/dev-db/hyperdex/metadata.xml
new file mode 100644
index 000000000000..40aa45df2b01
--- /dev/null
+++ b/dev-db/hyperdex/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/innotop/Manifest b/dev-db/innotop/Manifest
new file mode 100644
index 000000000000..dc347ed4d899
--- /dev/null
+++ b/dev-db/innotop/Manifest
@@ -0,0 +1,7 @@
+DIST innotop-1.11.1.tar.gz 178295 SHA256 c93a4fb496ce1749aaaf0a70f0899ed1fa1aa5cd231208b6b3424285c77dc1b7 SHA512 49654e8ed81f5690c7e80fb169ad514caedb8d62e22bddc12cc234701875bc8ca7e2cc79061c10557d63dadbb40f2328a58b38dcf8aa60469c0c1558dbf0bed9 WHIRLPOOL 5b6162973be67821f46d580425a2ee23877687365cd6b87ca55c84d30115e02ce85197eacc80d30690f9523b711d16bcae9d87696eb78c10b8ea5db233948bb9
+DIST innotop-1.11.4.tar.gz 179683 SHA256 fb0d7d2558e2198d9224b44dc4220d4c62e1b5b0069312012306275be39b4ab9 SHA512 678d57074fd4fc87c93032052b87dc187cfe273e99fef8ec8f93131f8d885613bacda7b900f56e7572a6cc51c36c26fe1968e55dd1736b8509fb6e269c9d2aff WHIRLPOOL 7f80d74c0e05a3d1dcc7285714ce97ef4f90c4b978519d2117b1be7fcb590f52c488f041f718016b08e6bf8a87abee99228628d2c0588ef35afe668b2ae22ed1
+EBUILD innotop-1.11.1.ebuild 636 SHA256 c0850ea409972623cb4187831a425fd068d98fafdfa521eae21e6f445541220c SHA512 99631c9b1cc35783b526b46ae23cac85603b67f3aa1edee09a0b931adee9b59e67bebb8c79905c41d1447e0dad12ca791e26ff9d5918797db43c4a865fd27556 WHIRLPOOL bfeaffc4ed57db3f9c680e08747cf84170a9afa689dd065bbb0c6edafac2f51039e7792a75912382476926b6641e27839aeadb41b95aa70e038ec3769eda30df
+EBUILD innotop-1.11.4.ebuild 636 SHA256 4e2617e7c03f05e83b7447433750185e11f964d8e40dbf347fd073afa7f508ae SHA512 7b6c18ac7149d41b54cdd296ad0431dc291ebb6baa23dbba5a0903ea58a384cece14907238e05f31c64be49f18e6f4eda913a62d01ca06ca37173bd53a6a1d7c WHIRLPOOL 731c9d9485582e8aa0f597f1a0b9f9587e451605c92eb845c110ddb98fa9207058fbb81e19d67b6d17449069f0e8ef99822432dac047a344bcd7ec60eae616c1
+MISC ChangeLog 3608 SHA256 9c4d17815af20ddbbbb105e9a5cdf99dc6d4bff756d2cf43cd6adad8f1556e41 SHA512 081ca0e1cbd2d42da2d332288554d2126e806938eeb9f1d68adc19d99b3d6e21f37fec8f6df408a1a9666a332ef115025364814431d744ddf7be605a438f058d WHIRLPOOL 35e5af4ab7aa9196b7cd6e6ec60ab1f518d7348cf51401a553e9f8b8e550bb204586d61cfab1e945cc2b661a20eb488230f9dbe9af76c941fc3d728e09aa2074
+MISC ChangeLog-2015 1749 SHA256 77cf54e49d01794bfe8d073495c2a2f442d4562c3d8af0f394d659c809ff3184 SHA512 263ee0d01b072ca5cb05f7ba57aff0c1b9882ccae3799594df1e5f845a280392b13395343abb6e500f6d31c9d2118186c06c29b1b22a4065bcc281b113301b72 WHIRLPOOL 96e8224e600fd792af761bcd802034b0450aa4203aa4b9d196b1f1907f6d7919fb5875831edffabe9161231df328fc4e775adf08db7e871633562f3d13964517
+MISC metadata.xml 446 SHA256 812f0aeb20286b62109ee59c2b4f0eca123965100393d942b1260eb961235a84 SHA512 788b300a652ef6577b92c1db658937f7db9beffe2ae3a94559f0c3a885fbe0a0cfaef2aa6b7bc8fc907823722d4b9016b2e272b47932628b55d4512a7bfc9bf7 WHIRLPOOL c2f8a1eeac6afc912f6460655fbc14d202110fc4f67b7c4895fcde42a8275b9285dd82b02da176f106acd8a95431d59ff9dc976d2e468f80f8cf1d71dfef7f56
diff --git a/dev-db/innotop/innotop-1.11.1.ebuild b/dev-db/innotop/innotop-1.11.1.ebuild
new file mode 100644
index 000000000000..cdc2f369ac59
--- /dev/null
+++ b/dev-db/innotop/innotop-1.11.1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit perl-module
+
+DESCRIPTION="A text-mode MySQL and InnoDB monitor like mytop, but with many more features"
+HOMEPAGE="https://github.com/innotop/innotop"
+SRC_URI="https://github.com/innotop/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes"
+
+DIST_TEST="do parallel"
+
+src_install() {
+ perl-module_src_install
+}
diff --git a/dev-db/innotop/innotop-1.11.4.ebuild b/dev-db/innotop/innotop-1.11.4.ebuild
new file mode 100644
index 000000000000..bb3180d850d9
--- /dev/null
+++ b/dev-db/innotop/innotop-1.11.4.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit perl-module
+
+DESCRIPTION="A text-mode MySQL and InnoDB monitor like mytop, but with many more features"
+HOMEPAGE="https://github.com/innotop/innotop"
+SRC_URI="https://github.com/innotop/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes"
+
+DIST_TEST="do parallel"
+
+src_install() {
+ perl-module_src_install
+}
diff --git a/dev-db/innotop/metadata.xml b/dev-db/innotop/metadata.xml
new file mode 100644
index 000000000000..05dc2a7fb700
--- /dev/null
+++ b/dev-db/innotop/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+ <longdescription>innotop - A text-mode MySQL and InnoDB monitor like mytop,
+but with many more features</longdescription>
+ <upstream>
+ <remote-id type="github">innotop/innotop</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/kdb/Manifest b/dev-db/kdb/Manifest
new file mode 100644
index 000000000000..6d44be375701
--- /dev/null
+++ b/dev-db/kdb/Manifest
@@ -0,0 +1,4 @@
+DIST kdb-3.0.2.tar.xz 478576 SHA256 896804959f4e203cbafb3d345127c6d80721d79136dbfd6d51c4e93131ec21d8 SHA512 e2fcc09d9477b707bc5af23d23ebfedd21ee7445b0de8fa160969795eb608d712d74572618334fcef4aa06095fa69ce9861542851f5609e83287b23ef01fae90 WHIRLPOOL 2d94426cfdaae4f57872e6a2b9369f467327998551f893cc4a1005fa20b2b34c5eec48af25984b039f41b4eeab8e4c2d8e9b5a623c0d6ddb9283fad8c0730529
+EBUILD kdb-3.0.2.ebuild 948 SHA256 acedd202739ae8ef2becc0a262ad60d611739793c8e02a0c7e6577fdbbe4ac4f SHA512 0497fd1f4b0d8e4d6140131a1f922cdf43dff147dd3604cd8b3d88d968b947019d05a6006e5e1174ba85101be9399edd47b7753d0ad63693e4ecb65ce0a6e379 WHIRLPOOL 97202dceae5fef469fff744f01c7cbd54b85375f9e05e79536625aade38a388962eafdae2935a0a0f0dc4d35e089ce46dbf4b9dd45672bb7991daf3fd0a1ae01
+MISC ChangeLog 297 SHA256 cd20e6102162735db9a60ecf4dc86039670374255525a065a5d6627c9aeacf77 SHA512 0a2a81b472c4bedf8d87f76f4112aae59c572a3c4af575734c8cb52ed86199ecbe59001845781bbcc781e81364d8eb1e4c7c9312a47f79b9d3a9a8ae33cccaac WHIRLPOOL e38e283c53bf02cd6c1fca0adbf96c9932684468be5d02e3b8203cadbda0fab6cf31f6d811e3093e3bbe5536124f93fd4de06d60e4d21c5699eaf354048e79ef
+MISC metadata.xml 249 SHA256 584f1dcf51866dc24a9abf7a89bfba0fad11dde81ae1c1b715da41770d233c99 SHA512 76a5a340b13f0053ca3c5e94ed24380ea8d29b45ac8655419e22eaadb1e4a827c04d2e7e36b65145c4964e6526f656618fc6ac144e277ef53cb7373e6239e3c3 WHIRLPOOL 200c07a8bf7c55b11b7936d5cd30e991a511684913334e72f59def66c0ced5fed0b4a8754e2d98bffbab631cb90d4e17fcccc59d5dcc5a8e988f69e47c85518c
diff --git a/dev-db/kdb/kdb-3.0.2.ebuild b/dev-db/kdb/kdb-3.0.2.ebuild
new file mode 100644
index 000000000000..7f7b20c738f5
--- /dev/null
+++ b/dev-db/kdb/kdb-3.0.2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit kde5 python-any-r1
+
+DESCRIPTION="Database connectivity and creation framework for various vendors"
+[[ ${KDE_BUILD_TYPE} != live ]] && SRC_URI="mirror://kde/stable/${PN}/src/${P}.tar.xz"
+
+LICENSE="LGPL-2+"
+KEYWORDS="amd64 x86"
+IUSE="mysql postgres sqlite"
+
+RDEPEND="
+ $(add_frameworks_dep kcoreaddons)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtwidgets)
+ $(add_qt_dep qtxml)
+ dev-libs/icu:=
+ mysql? ( virtual/mysql )
+ postgres? (
+ $(add_qt_dep qtnetwork)
+ dev-db/postgresql:*
+ )
+ sqlite? ( dev-db/sqlite:3 )
+"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_find_package mysql MySQL)
+ $(cmake-utils_use_find_package postgres PostgreSQL)
+ $(cmake-utils_use_find_package sqlite Sqlite)
+ )
+
+ kde5_src_configure
+}
diff --git a/dev-db/kdb/metadata.xml b/dev-db/kdb/metadata.xml
new file mode 100644
index 000000000000..2fdbf33d963d
--- /dev/null
+++ b/dev-db/kdb/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>kde@gentoo.org</email>
+ <name>Gentoo KDE Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/kyotocabinet/Manifest b/dev-db/kyotocabinet/Manifest
new file mode 100644
index 000000000000..eb84f291fc88
--- /dev/null
+++ b/dev-db/kyotocabinet/Manifest
@@ -0,0 +1,9 @@
+AUX fix_configure-1.2.62.patch 1668 SHA256 7dd081e9e44f9c41b8172d4161f8d43561ca50298ffa37aa71bc789c6f377c6b SHA512 cd36241bdde29f62b99b2bfcb45b592fad3d15a32a370c925e5085be18893a8ba9bb15cb55939871beb9776dc6ab7da4f2d2cf54efed6f86310f3297d33dd567 WHIRLPOOL c401d376cc95940d35ea57798debee5b2e390776d1c46975f72b261aa201c2b0f35354db6c9ae68382e8ed7ff4d3d9fc9016a3e68e4304074b596afd5e3efcc1
+AUX kyotocabinet-1.2.76-configure-8-byte-atomics.patch 1250 SHA256 9a71b33b33e953ee40210d31f73b30cfd0d39909cd03f7066d8e22960b63f8fc SHA512 4833cecd6c67515e0c59d7161be6891df290ae816593de1bf35718e9c9d8691db221bec5078c5dc7cf56e55b0086d61c415e148a7ee63b2a47ac4885f6d0960e WHIRLPOOL f94d74398140aeea7e1237ddb2f06986a9eac7d599c85cbf7f2ef1bff0e10edce58efbd241cb31559feec1462696469b1ee766d9cd0b612f06fdbe2cae33c783
+AUX kyotocabinet-1.2.76-flags.patch 894 SHA256 f1b1ab691b56c382464b83dcfd13a41cf6a694ce6ad74d3fef822a41002d7548 SHA512 60a15c54994a5f338cf168feb831d858fdd2cadd16ea0c8001ef652e8502797f5920d3fed0a3ec4a6a2d817381b4690410878a18c7c859df34e26b033f48fe03 WHIRLPOOL ce032205dbb64987cb3cad63b6283811d85703e4901ce49795cd301fe0e74a08a73354af03b1398325812e80a4a227544f384f5d5b2e75a2865197cf865f6899
+AUX kyotocabinet-1.2.76-gcc6.patch 289 SHA256 85e9d7e48c5819ad712194a25a7c7908f966bcd3de2db2f456cb1f4dce4410e7 SHA512 755fe06635309139d55d1ede2e5ec30e37867501ead68abd3218c59ea016b72c9aa4d7d4072e15b53d22755606949dfaafa7b283d33a821d280fe7791ee8ff10 WHIRLPOOL bdc4f5a23b8479a08482dc55460124bbbae3bafa98834c92e3399f093d4400966be01babf4138f375744c465d1bbe99fafebb94d714e1aff71d7d7ee2be007a1
+DIST kyotocabinet-1.2.76.tar.gz 951930 SHA256 812a2d3f29c351db4c6f1ff29d94d7135f9e601d7cc1872ec1d7eed381d0d23c SHA512 278db7b327eb4c21bf0137d9aa14fb67d74d5ce7ed1cb29fc9120d157a60de165ec0cf842903eb7952e8f998045ae585b958977fa973ba0e0773381de71d9f6a WHIRLPOOL db984a6dcef0e3f313e56e5398a0fe75d1014e02dce04c4837d0aa01c0e97eb04eac728f4e9b600acec22a098a1f19ba33d8abb2ee50a8a60ba64afcd6d9c873
+EBUILD kyotocabinet-1.2.76-r1.ebuild 1285 SHA256 0e19f78951c35f35db402b4a5cb5ab2e6f31a03ea39d34bc4e4be950ce3ada05 SHA512 a7fe18f52685252e4895e055a4988c52aa2e74823bc6b7746801de46567ef300e37780d54ef80694a673489817a5551c09e1027d05af1cd34e7074e0a8613c2e WHIRLPOOL 9f2104301f95c1248560022b66140651cccbba938adff8108c7f201857402c8c2f436a56b8a9698db0506fb7999a6b613d2363406a5aa689390688f0922e15a9
+MISC ChangeLog 2906 SHA256 8ddde6926b42e78e07b1edb549622e7867ddd79fdd135268a3e756770262578e SHA512 409116d7d7ce681e048db6114f1aec47e6460c9ffd4abca0b00cf683f9bf936eb2528b9e4d7eda63fb07bbb66b8abc7ff7da362652416fe2f3801d00b77ac5d9 WHIRLPOOL 909c336b50df6ec364e5c20ed4d23047599354d76839ab8fe855b40d613bf1d7de1cd575aac6e0e76a9721c68319d44a8b831f99633e27e7fd00b61b718095d1
+MISC ChangeLog-2015 5230 SHA256 15d8574833ef6bc862bb417b75fa23785587e156bbf1692671323cbf4faaf019 SHA512 d10f964f1484345b400e408cfe1a4b86b1bd1132f42d55eb88b2bcc02cb192613f77280ad033cc7d797a883a2caec1d7f028d6e494d448530125d07a4cf809e6 WHIRLPOOL 1024586afb88d8f88b2d6eb0bb33d854e07ffb78746ff8b40a3829cca1891273f872190d03ea22a72a08fbaea9352f6b1298ad86e6106df28118a6f8f99ad644
+MISC metadata.xml 247 SHA256 0deec0776f26fb762fdf7711f4589b14f52a2456436ef557eec62a2cf2fb2bb7 SHA512 29cf52c16b0cce69899d9c2da8acd9144b7d760442aa323b854dceadb42459e009545193b1df7911ac2241b59f4819b4a6bb1d206d6f57953f770031433bb6b7 WHIRLPOOL a135fa622e99d3dcdb432bc6b3c366076b3d86b4bfd9a76c852d781b8e9152541c7e7a2c7c6d6a3c4d2200dce792847a08166aaf7c17c22b6299dfe868234dec
diff --git a/dev-db/kyotocabinet/files/fix_configure-1.2.62.patch b/dev-db/kyotocabinet/files/fix_configure-1.2.62.patch
new file mode 100644
index 000000000000..622b7fd52792
--- /dev/null
+++ b/dev-db/kyotocabinet/files/fix_configure-1.2.62.patch
@@ -0,0 +1,51 @@
+diff --git a/configure.in b/configure.in
+index 94e9d29..6999615 100644
+--- a/configure.in
++++ b/configure.in
+@@ -35,27 +35,18 @@ MYDOCUMENTFILES="COPYING FOSSEXCEPTION ChangeLog doc kyotocabinet.idl"
+ MYPCFILES="kyotocabinet.pc"
+
+ # Building flags
+-MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -g0 -O2"
+-MYCXXFLAGS="-Wall -fPIC -fsigned-char -g0 -O2"
+-MYCPPFLAGS="-I. -I\$(INCLUDEDIR) -I/usr/local/include"
++MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char"
++MYCXXFLAGS="-Wall -fPIC -fsigned-char"
++MYCPPFLAGS="-I. -I\$(INCLUDEDIR)"
+ MYCPPFLAGS="$MYCPPFLAGS -DNDEBUG -D_GNU_SOURCE=1"
+ MYCPPFLAGS="$MYCPPFLAGS -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D__EXTENSIONS__"
+-MYLDFLAGS="-L. -L\$(LIBDIR) -L/usr/local/lib"
++MYLDFLAGS="-L. -L\$(LIBDIR)"
+ MYCMDLDFLAGS=""
+ MYCMDLIBS=""
+ MYLDLIBPATH=""
+ MYLDLIBPATHENV="LD_LIBRARY_PATH"
+ MYPOSTCMD="true"
+
+-# Building paths
+-PATH=".:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH"
+-CPATH=".:/usr/local/include:$CPATH"
+-LIBRARY_PATH=".:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH=".:/usr/local/lib:$LD_LIBRARY_PATH"
+-PKG_CONFIG_PATH=".:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
+-export PATH CPATH LIBRARY_PATH LD_LIBRARY_PATH PKG_CONFIG_PATH
+-
+-
+
+ #================================================================
+ # Options
+@@ -285,14 +276,6 @@ then
+ MYCMDLIBS="$MYCMDLIBS $LIBS"
+ fi
+
+-# As-needed linking
+-if uname | grep Linux >config.tmp
+-then
+- MYLDFLAGS="$MYLDFLAGS -Wl,-rpath-link,.:/usr/local/lib:$MYLDLIBPATH"
+- MYLDFLAGS="$MYLDFLAGS -Wl,--as-needed"
+-else
+- MYCMDLIBS="$MYCMDLIBS $LIBS"
+-fi
+
+ # Shared libraries
+ if test "$enable_shared" != "no" && test "$enable_profile" != "yes"
diff --git a/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-configure-8-byte-atomics.patch b/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-configure-8-byte-atomics.patch
new file mode 100644
index 000000000000..729efc083ba5
--- /dev/null
+++ b/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-configure-8-byte-atomics.patch
@@ -0,0 +1,44 @@
+From: Shawn Landden <shawnlandden@gmail.com>
+Date: Thu, 21 Jun 2012 20:34:28 -0700
+Subject: configure: 8 byte atomics
+
+fix up configure test to handle lack of 8 byte atomics correctly
+
+as is the case with all ARM targets currently
+---
+ configure | 29 +++++++++++++----------------
+ configure.in | 19 ++++++++++++++++---
+ 2 files changed, 29 insertions(+), 19 deletions(-)
+
+index a07063d..bfc6df0 100755
+--- a/configure.in
++++ b/configure.in
+@@ -238,9 +238,22 @@ fi
+ # Atomic operations
+ if test "$enable_atomic" != "no"
+ then
+- printf 'checking for atomic operations... '
+- AC_TRY_COMPILE([], [__sync_fetch_and_add], [MYGCCATOMIC=yes], [MYGCCATOMIC=no])
+- if test "$MYGCCATOMIC" = "yes"
++ printf 'checking for 8 byte atomic operations... '
++ if printf '
++/* Some targets support 4 byte atomics, but not 8 byte atomics,
++ * and will fail at link time if they are used.
++ *
++ * http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Atomic-Builtins.html
++ * http://gcc.gnu.org/wiki/Atomic
++ */
++#include <stdint.h>
++int
++main ()
++{
++uint64_t n = 0xdeadbeaf;
++__sync_bool_compare_and_swap(&n, 0xdeadbeaf, 0);
++return n;
++}' | $CC -xc -o config.tmp - >/dev/null 2>&1
+ then
+ MYCPPFLAGS="$MYCPPFLAGS -D_MYGCCATOMIC"
+ printf 'yes\n'
+--
+1.7.9.5
+
diff --git a/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-flags.patch b/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-flags.patch
new file mode 100644
index 000000000000..931e8c3f7bbe
--- /dev/null
+++ b/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-flags.patch
@@ -0,0 +1,31 @@
+--- a/configure.in
++++ b/configure.in
+@@ -193,28 +193,6 @@
+ # Byte order
+ AC_C_BIGENDIAN(MYCPPFLAGS="$MYCPPFLAGS -D_MYBIGEND")
+
+-# System-depending optimization
+-printf 'checking for 64-bit availability... '
+-if printf 'main() {}' | $CC -xc -m64 -o config.tmp - >config.tmp 2>&1
+-then
+- MYCFLAGS="-m64 $MYCFLAGS"
+- MYCXXFLAGS="-m64 $MYCXXFLAGS"
+- printf 'yes\n'
+-else
+- printf 'no\n'
+-fi
+-if test "$enable_opt" != "no"
+-then
+- printf 'checking for CPU optimization availability... '
+- if printf 'main() {}' | $CC -xc -march=native -o config.tmp - >config.tmp 2>&1
+- then
+- MYCFLAGS="-march=native $MYCFLAGS"
+- MYCXXFLAGS="-march=native $MYCXXFLAGS"
+- printf 'yes\n'
+- else
+- printf 'no\n'
+- fi
+-fi
+ printf 'checking for useless warnings... '
+ if printf 'main() {}' | $CC -xc \
+ -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -o config.tmp - >config.tmp 2>&1
diff --git a/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-gcc6.patch b/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-gcc6.patch
new file mode 100644
index 000000000000..3bcc6a28e795
--- /dev/null
+++ b/dev-db/kyotocabinet/files/kyotocabinet-1.2.76-gcc6.patch
@@ -0,0 +1,11 @@
+--- a/kcdbext.h
++++ b/kcdbext.h
+@@ -1278,7 +1278,7 @@
+ if (omode_ == 0) {
+ set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened");
+ *sp = 0;
+- return false;
++ return NULL;
+ }
+ if (!cache_) return db_.get(kbuf, ksiz, sp);
+ size_t dvsiz = 0;
diff --git a/dev-db/kyotocabinet/kyotocabinet-1.2.76-r1.ebuild b/dev-db/kyotocabinet/kyotocabinet-1.2.76-r1.ebuild
new file mode 100644
index 000000000000..4b7d4de72a8f
--- /dev/null
+++ b/dev-db/kyotocabinet/kyotocabinet-1.2.76-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools ltprune toolchain-funcs
+
+DESCRIPTION="A straightforward implementation of DBM"
+HOMEPAGE="http://fallabs.com/kyotocabinet/"
+SRC_URI="${HOMEPAGE}pkg/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm64 ~hppa ~ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
+IUSE="debug doc examples static-libs"
+
+DEPEND="sys-libs/zlib[static-libs?]
+ app-arch/xz-utils[static-libs?]"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/fix_configure-1.2.62.patch
+ "${FILESDIR}"/${PN}-1.2.76-configure-8-byte-atomics.patch
+ "${FILESDIR}"/${PN}-1.2.76-flags.patch
+ "${FILESDIR}"/${PN}-1.2.76-gcc6.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i -e "/DOCDIR/d" Makefile.in || die
+ tc-export AR
+
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable debug) \
+ $(use_enable static-libs static) \
+ $(use_enable !static-libs shared) \
+ --enable-lzma
+}
+
+src_test() {
+ emake -j1 check
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if use examples; then
+ insinto /usr/share/${PF}/example
+ doins example/*
+ fi
+
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins -r doc/*
+ fi
+}
diff --git a/dev-db/kyotocabinet/metadata.xml b/dev-db/kyotocabinet/metadata.xml
new file mode 100644
index 000000000000..40aa45df2b01
--- /dev/null
+++ b/dev-db/kyotocabinet/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_fPROJ4/Manifest b/dev-db/lib_mysqludf_fPROJ4/Manifest
new file mode 100644
index 000000000000..eef587b8a858
--- /dev/null
+++ b/dev-db/lib_mysqludf_fPROJ4/Manifest
@@ -0,0 +1,6 @@
+AUX lib_mysqludf_fPROJ4-warnings.patch 956 SHA256 21be48543341465e007f73dbe0c339070fe486f7ceb633bd18bd62b8cb745caa SHA512 b1097327bd0f94c55f5c8b7c45296cb7e2f0c682c3503541a9a301c15d1e860abc31557d2e984ee42d659178e82e219b334b775ba5bae7eddb6cdf8e43d04852 WHIRLPOOL f769960ae1c62d3369e9b23418e2ccd143179f3cd230174a530d66843655e54843eb31505bfecc6e2620d9f4083624c50c2841381847ef41f87c0e15ad07d31e
+DIST lib_mysqludf_fPROJ4-0.1.0.tar.gz 2573 SHA256 22ec139f1652040828da18a4b3a469355486d459f8000d25381422b9c9e45cdd SHA512 cc0307bcbdf15a37f77fced46b262783327fbd1e9883bd2d3f55c005bc5948ea7d2b7afa98a75390045636abbb04bb22aeaafdbe670e5642710a6a4a785fd3b3 WHIRLPOOL 8294e54ccae4028796db1efa58a2c9a83625df11a158382ea096aa713d79cda1dbab993926d3b00604e5edca80c27771ba11f5e9b3da719fea69c63cabb1b493
+EBUILD lib_mysqludf_fPROJ4-0.1.0.ebuild 1320 SHA256 52ccafe1322bd688b04a7a6b4fdde7c27bed3b25f5a35d19c2ed65d83eb5483e SHA512 d8adea33afc42474f68d5c3c4d02effda53d1c348a16fb712e4570913630459254b5f2d41b44d1475c77e65c1b4be7dd32b7f4f61e0aa63fc8bbb851750b566a WHIRLPOOL eaa1a05bb0381672a1c5b3b4b1ab094ff6697f41d86d10116a6013e6198f108d02a9aeba6ad1434dd630f5091646b5e181fbbbf7e9b79e6e7db0d3db294e4413
+MISC ChangeLog 2601 SHA256 e96af12538917ac59001f27ffa85cfd0923d10109db8119af56e355a47535a80 SHA512 c7d02d6e3d155570870d3e0155b1388f882858ce0da0eae0b5050d015a14b7ddb9713fab0ebf1b7e9f2d4a47a59d2c6b45c0e700509e41226ee71f16a017efb3 WHIRLPOOL 4acdf8fa3382a7bb139b8a8080b5b0f0b5482195a8e01fbc536e1c19090f15b554730b6dac9bb8db1bf3d43035d2b39615c0b4bd6234f581618c170cb2f4573a
+MISC ChangeLog-2015 517 SHA256 616ba800a5f6746a49324da6d2b7f2635a64feef3c95d1576e905c7c38b1c1d7 SHA512 bb92416207755fc08518367cbc27081c19b7ddd29c3da5f36d626a118f2b0d252b99c81851d72096123cd307cee6417db6c140e96881bd0177d9986e61bd2ea2 WHIRLPOOL e0ea2f6cb4cb2c4bd5456ca848d2728c98f6db9fe2610e1c7f143fdaadaaa69bb41ecb0b48ae75bd9ea5142703c9aad40d2dbb68bf27cf4fcaeac23750121ecd
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_fPROJ4/files/lib_mysqludf_fPROJ4-warnings.patch b/dev-db/lib_mysqludf_fPROJ4/files/lib_mysqludf_fPROJ4-warnings.patch
new file mode 100644
index 000000000000..0b9669991cb3
--- /dev/null
+++ b/dev-db/lib_mysqludf_fPROJ4/files/lib_mysqludf_fPROJ4-warnings.patch
@@ -0,0 +1,35 @@
+--- lib_mysqludf_fPROJ4.c.orig 2010-05-09 13:46:12.000000000 +0200
++++ lib_mysqludf_fPROJ4.c 2011-10-19 02:32:48.000000000 +0200
+@@ -1,5 +1,3 @@
+-/*
+-
+ /*
+ lib_mysqludf_fPROJ4 - An extended set of scientific functions which
+ converts geographic longitude and latitude coordinates into cartesian
+@@ -178,7 +176,7 @@
+ }
+ double fPROJ4_transform(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
+ {
+- projPJ pj_in, pj_out;
++ projPJ pj_in=NULL, pj_out=NULL;
+ double x, y,z;
+ int p,t;
+
+@@ -248,7 +246,7 @@
+ }
+ double fPROJ4_Geo2UTM(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
+ {
+- projPJ pj_in, pj_out;
++ projPJ pj_in=NULL, pj_out=NULL;
+ double x, y;
+ int p,t,zone;
+ char *tmp;
+@@ -323,7 +321,7 @@
+ }
+ double fPROJ4_UTM2Geo(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
+ {
+- projPJ pj_in, pj_out;
++ projPJ pj_in=NULL, pj_out=NULL;
+ double x, y;
+ int p,t,zone;
+ char *tmp;
diff --git a/dev-db/lib_mysqludf_fPROJ4/lib_mysqludf_fPROJ4-0.1.0.ebuild b/dev-db/lib_mysqludf_fPROJ4/lib_mysqludf_fPROJ4-0.1.0.ebuild
new file mode 100644
index 000000000000..2dc76b444b43
--- /dev/null
+++ b/dev-db/lib_mysqludf_fPROJ4/lib_mysqludf_fPROJ4-0.1.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs which converts geographic/cartesian coordinates"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_fPROJ4/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ sci-libs/proj"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${P}-src"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+
+ # fix doc (BOM, CR/LF, soname)
+ sed -i -e '1 s|^\xEF\xBB\xBF||' \
+ -e "s|'\(${PN}\).*'|'\1.so'|g" ${PN}.sql
+ echo >> ${PN}.sql # add LF
+ edos2unix ${PN}.sql
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} -lproj \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_fPROJ4/metadata.xml b/dev-db/lib_mysqludf_fPROJ4/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_fPROJ4/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_json/Manifest b/dev-db/lib_mysqludf_json/Manifest
new file mode 100644
index 000000000000..c9068dc5dba4
--- /dev/null
+++ b/dev-db/lib_mysqludf_json/Manifest
@@ -0,0 +1,5 @@
+DIST lib_mysqludf_json_0.0.2.tar.gz 18177 SHA256 bed11c73d1e5d23669051b8a430f5c17b961e462ee82612b7dcdbceba47052b5 SHA512 04cc299498e7a7c40d2d181649e433c48be29f5dab2f46b64930f415060c3e05065d0d44d28ce0b35d190f3544687aa7e2ea66a69decc12609ec949bd78b8e05 WHIRLPOOL c0084c9f9c35717bbf5b76c311c357bd14dc160c5061bc09b34cd1ddec112c51548b5ca94c1078bd62121f197994de501b478f40c67cc40722817aedd1f86eed
+EBUILD lib_mysqludf_json-0.0.2.ebuild 1151 SHA256 4edaf0320d8e2a6e4f98062421a1b70320e903934bb7e6141f0f9fb967db9224 SHA512 0281fa061ee0bb0fb3e55ec99282fff030ea78a2442221a30085400c24f1243eca472d1ef86b842e1b93bb4f56e0d8cbdb39d1ff0a83496c7f15bae8657237f6 WHIRLPOOL 4122006600082e99479cd6014961ef0b6f3d1a68de89a556939585a82fae25ee6bcac95f0f526422fd35a94e0a52d823e3f3c62fa453f527e03db3f6c7169e24
+MISC ChangeLog 2550 SHA256 fd9ac889667117887557dee31f4c1033b5b617e1aa553c46b3bc9829ad1efd47 SHA512 99ebda2a0fcffe032e31b02f46ca6a76a3a9e4f26d411f6c432f281c7649dd1714289e0fc3458abb84ee19046f196cdb0e2945a32089b62a53f7e0c8687bac8d WHIRLPOOL 77e575d707df08dac57b117b912fadb97f97ad085a976090873d0e29cc5b30d3d1f316e9ef6b587bf53738ff4d329dcaebcc67962175d2fa40435f4ab3dc81d6
+MISC ChangeLog-2015 464 SHA256 75bf0fb5e524ee876f39d8f09a232b9705195f91b809246ed294ee1104f9e9c6 SHA512 5ac528206765300b34b1d7804d654d39731792ddc3dea08b5b7b9fef84a201ceb670b66b3a39520454050e4fb785bbe9fc9b070aa1ab2e36043cbe1492e00bea WHIRLPOOL 8b4968b2d6bbee4a0c4a0aa7acd35f4e7296499fe479a46852bcb5b1a2aa2ad91e98875165422c416bb0a21e8e312d17eda2d700a6b2550c8ca87bf7391e6f2a
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_json/lib_mysqludf_json-0.0.2.ebuild b/dev-db/lib_mysqludf_json/lib_mysqludf_json-0.0.2.ebuild
new file mode 100644
index 000000000000..7e1fe812fcb9
--- /dev/null
+++ b/dev-db/lib_mysqludf_json/lib_mysqludf_json-0.0.2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs to map relational data to the JSON format"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_json/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # remove precompiled object
+ rm -f -- ${PN}.so
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+ dohtml ${PN}.html
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_json/metadata.xml b/dev-db/lib_mysqludf_json/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_json/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_log/Manifest b/dev-db/lib_mysqludf_log/Manifest
new file mode 100644
index 000000000000..a991ca1036dd
--- /dev/null
+++ b/dev-db/lib_mysqludf_log/Manifest
@@ -0,0 +1,6 @@
+AUX lib_mysqludf_log-warnings.patch 479 SHA256 e716bb4842f5ba2c6e68eaee25d03d954538c719c513c3834a347373f8a1d85a SHA512 b3de4eebb97ba168574a0c06096484f62e4cf50c794d0755ea9b0872d2731f308763733ea3ec567e76f0801fc3159130da47bdf8c0d6ce06f0812a12345e959a WHIRLPOOL bfadf232b65625b96a87e9af8094d35cc2c5a7a2e55dbb7fbea60de59cfcc06f067ae77477526c5816c27b28b4e9d1940b22cfd08238d2acf141d2cbcb6a44b7
+DIST lib_mysqludf_log_0.0.2.tar.gz 1892 SHA256 4291dcca238129c93169b6351349c252af591de5b7e90424b0de6c690a8c3d6d SHA512 674395c145260122bd14055a838b82d69217841364a496a518eb08860ba0beabe35627fe42108663caaf4a8c461d27551de43942ffd4c724d5ab912a2e74474d WHIRLPOOL d495f2e8b7306a84a6752e069457ba269123992b047414bbb4c67c9aecfe59f3b910e56d4fe79b7b14a964c0b0e577bc3edb423d2541f8f82b8f4aaa241f5e95
+EBUILD lib_mysqludf_log-0.0.2.ebuild 1105 SHA256 1bf98cbdbbdd11d81afbcb79fb5dcb712b16ade24f7baebc6e0fb324bf6e84d1 SHA512 33b332b75c79b4120c9a48a94d1e6fc2f21a4a10201a866cd90d6134f2b5531654577b4d3ae0f62574a63bffde84d815980ed7535f5735ca7a5a66cb984e7a94 WHIRLPOOL 60ee36ac85b4262d543590edd37cf58ab1b93d58df51980182b518d1a45eadf89d05d8df6f5ad4b39b041d2f83bfb8e1d1118976491830fc1849fa37d55e63b0
+MISC ChangeLog 2589 SHA256 851239106009134881fc58e0122a429257cf0578d5f0586866efb6aed66ad75a SHA512 5dcdb0cf568ea2e2caef361e1c8a7eee55bec739711bb84f27603c86a65f6b3553356885427c64c7775a0f2186ca0c61c43f917839e967f038a31d64a6d9a5f1 WHIRLPOOL c131c86d77ae52c3ee8f3f28fb88ee619c1cfb21ca1fefa4c509e84998e6df3d87ebb8c3b04254b0909d712d4e4a75395e9337448a46d3348b743009c74ef594
+MISC ChangeLog-2015 502 SHA256 5d40ee38314e825882e49e90e39e1c99e5a10342ffe48e8db0c7fb1aece37eba SHA512 486f054adfa2d519f6591e60dcff110ffedfdb16ea71ee94de491dee37b8248b6cb6879ebf4fa51eb8fe20ddba19de19e442908f5584e20f09ff3d5274915980 WHIRLPOOL aaad51c1be031b6171ce63056eeefc641fe90a5b9121c6ff6952e75e84d95b20b31aebfa4d85035cb47a3433a25e181fd87ddfbbb730271c4ba222f7e7bfd509
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch b/dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch
new file mode 100644
index 000000000000..64b59639a328
--- /dev/null
+++ b/dev-db/lib_mysqludf_log/files/lib_mysqludf_log-warnings.patch
@@ -0,0 +1,11 @@
+--- lib_mysqludf_log.c.orig 2008-07-07 01:17:06.000000000 +0200
++++ lib_mysqludf_log.c 2011-10-18 12:50:52.000000000 +0200
+@@ -159,7 +159,7 @@
+ } else {
+ fmt = (char *)initid->ptr;
+ memcpy(fmt, "%0.", 3);
+- sprintf(fmt+3, "%d", args->lengths[0]<=9999? args->lengths[0]: 9999);
++ sprintf(fmt+3, "%d", (int)(args->lengths[0]<=9999? args->lengths[0]: 9999));
+ numDigits = strlen(fmt + 4);
+ memcpy(fmt + 4 + numDigits, "s\n\0", 3);
+ fprintf(stderr, fmt, args->args[0]);
diff --git a/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild b/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild
new file mode 100644
index 000000000000..639f48e5e596
--- /dev/null
+++ b/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDF to write to log files"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_log/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_log/metadata.xml b/dev-db/lib_mysqludf_log/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_log/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_preg/Manifest b/dev-db/lib_mysqludf_preg/Manifest
new file mode 100644
index 000000000000..0353dde34563
--- /dev/null
+++ b/dev-db/lib_mysqludf_preg/Manifest
@@ -0,0 +1,5 @@
+DIST lib_mysqludf_preg-1.0.1.tar.gz 321868 SHA256 50c7179b354148d66a2324f1a8ed918b133924c8fc0cd53c28afda70e1768daa SHA512 36bb9c412d5f69040e5d4b3325a4b95e5e165010daea240c96611135b2c74dddb3e36bb6938c0684ecc30ff08151ce7543167a9e3a05e3e5cd0361102b1b083d WHIRLPOOL 72a0ff7ad9a9e0ff5e1beac108fcbbe8d312268740eb4341eecd4f2eacdbab1bd2fcb20f9770bcbdfe6a6d7d183b11be35cb9ea15f876551c7b0365d48da3812
+EBUILD lib_mysqludf_preg-1.0.1.ebuild 1262 SHA256 42a499e27ff374d9df39da0e0e069fc146d5dc7b9d8791ae1f39bf35317bee61 SHA512 64d3980db9caa1915e050e5be5b1c14eb4d243da112d86cb4675bf827a31641834650c25ea195ec751ea94898f4af08fbd22311257ce4b26335a435ed0277b61 WHIRLPOOL 6d610586ca0492de6f54725f9cdb1048720b284702ce3d4eac31c5889457867f0ce73d992c8ffa60bfa23b284671131191e36a39eef36ed6c4531436fef0fb0f
+MISC ChangeLog 2550 SHA256 47fdcd9cfe66dc098cc4094a0c98d5a86e0bf9131d14a20a0e2b2e5da2479ce5 SHA512 3b1a31abaa68de28c5b01d5db32bf3f80744c9fe0e8af8bc7b0b81fb35e1d83848f86cde902a32c1c2e6a175890f2ebef66a7b3196bd1c2a5e0e75508ce2af8a WHIRLPOOL 9df7d460eaedb5b0386e809cfef1654f6417e9962f5b7e31aae5f0d8de5342633013107fb4138cf3eab7220d935408ff9abd7133f76c0eb7a2b1edb44450a10a
+MISC ChangeLog-2015 464 SHA256 5e42da3370a2f8b8c55eee683cc99c8cf9a6f50b6d1ecc209b60c12b9beb6c32 SHA512 2f9683eddd2b4f25e88723ab597ae51e17a1a9c9b095ab014b3449a4657f6d8c522b0359b1e3ac2235cbb8baa4b6909b0002e1c58885da82bfd6bed10bc612bc WHIRLPOOL 877bba7c2dc592d8b149a014700c0c5d870f7f06d1ec518ca3228f0b8dc61c2332101b66741164ba70652323de2c9dec37b9ac86e339ec2e28969ae89d978bd0
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.ebuild b/dev-db/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.ebuild
new file mode 100644
index 000000000000..327f16cebe4e
--- /dev/null
+++ b/dev-db/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs that provide access to the PCRE library for pattern matching"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_preg/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ dev-libs/libpcre"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ edos2unix README
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ local X
+ emake DESTDIR="${D}" install
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_preg/metadata.xml b/dev-db/lib_mysqludf_preg/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_preg/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_stat/Manifest b/dev-db/lib_mysqludf_stat/Manifest
new file mode 100644
index 000000000000..c188b4d7eced
--- /dev/null
+++ b/dev-db/lib_mysqludf_stat/Manifest
@@ -0,0 +1,6 @@
+AUX lib_mysqludf_stat-warnings.patch 551 SHA256 4a793906b047643d50db30034dfadb772fff8d1c2ed9a451a26a9ef575fc4dc4 SHA512 da0a53f3d7063dc2e032a7b79adc9de11fe9aee20449dcb97639498898b1e9a50a842f1fe842b55c0ac4c5147bdddf0188c19d5d130ea586b7776299922b674e WHIRLPOOL 9000ea77b6a70fa6d552aa93ba830a50beeadf9e78e5e4e6c225ec369d1086e5be8b59785b6a2864b183d80353517943c9d64c32008c78879e9caf293567cf50
+DIST lib_mysqludf_stat_0.0.3.tar.gz 7325 SHA256 23925494d486ca142a33a5a5766e861d8964772e962f711496f86e19e917fa70 SHA512 553a5f112c67fe773b27ca57c15611b5534ddc7babc0fff6e8771b106dc3037b9ca1459f9d2b201c53161037dc1e909b2a492fc0380340daddee098b5d82bd30 WHIRLPOOL dbe0e2b260f375078ea8ce4901287fea6f088d339b4a0d95e4beda1c88197872df32caa6a8e6265b27a4107097c01ec359dbd31a2c25d2e2359eb121b6f70630
+EBUILD lib_mysqludf_stat-0.0.3.ebuild 1161 SHA256 0cff8bebebc63393c7198c7c603213cdefd072f2190d56ebfa2d804ed9958e73 SHA512 021b14fad22dab1fe599404912c8bd727c8a6b2e1bba060b6869bcc20afc6df37fc02a36bb5f40f3d05fcf8a5688daf2be7cca343cca9bbe67622cf380db335d WHIRLPOOL a4a82aeb909ea6184bf247b1c477eb3a29af7594197575b9d024b0070711cd7f198096cb0f7eebdde3b649dc0e3c6fcae96e3b182f2fbac96920f5ad71220562
+MISC ChangeLog 2593 SHA256 0887edc157dc5705da7a068d925d72d6954aaea486ff399489d35223efdbdb1c SHA512 a259b1978b0034734c4beefcca024919137b9ee93c484513ce451de330d049b64b40bd5b79d1c30988337cc5ea7e9be621d4a2aab4bf265e900f6f5a98fa46c3 WHIRLPOOL f97da2ff793ec60e7cd3008ed47fc3db585e907124c15ba78abeb460479e13060d696e720c29c4eaf024c745341f4b898183e8c8fa38439c33b0da0b0a8cc65b
+MISC ChangeLog-2015 507 SHA256 33be93f029cf3abc848a836f50fbdc6b4e2c30b90595d98a04029bbb708582b8 SHA512 8540cd8062a4d71ecac8ee2c6c1e7c6894463bce8131d6535b6cbc6d96c09cc14d4daea5c2aaf234c2408333ade6939c8dc6c776bb0e63f78126b65331f97ba0 WHIRLPOOL 920e75669bcbfd80d5496c2a97e287963d00fa7e5c0b050d1e2a5b0432c9f4af743f648c25b0005f392383088a53fce8495d37ad533bf17d38391a0cba128ef6
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_stat/files/lib_mysqludf_stat-warnings.patch b/dev-db/lib_mysqludf_stat/files/lib_mysqludf_stat-warnings.patch
new file mode 100644
index 000000000000..5447356fea2d
--- /dev/null
+++ b/dev-db/lib_mysqludf_stat/files/lib_mysqludf_stat-warnings.patch
@@ -0,0 +1,20 @@
+--- lib_mysqludf_stat.c.orig 2011-10-19 04:30:24.000000000 +0200
++++ lib_mysqludf_stat.c 2011-10-19 04:31:21.000000000 +0200
+@@ -550,7 +550,7 @@
+ , char *error
+ ){
+ PEARSON* pearson_struct = (PEARSON *)initid->ptr;
+- double result;
++ double result=0.0;
+ if (pearson_struct->n==0){
+ *is_null = 1;
+ } else if (
+@@ -700,7 +700,7 @@
+ POINT_BISERIAL_GROUP* X0;
+ POINT_BISERIAL_GROUP* X1;
+ double s;
+- double result;
++ double result=0.0;
+
+ point_biserial_struct = (POINT_BISERIAL *)initid->ptr;
+ X = &point_biserial_struct->X;
diff --git a/dev-db/lib_mysqludf_stat/lib_mysqludf_stat-0.0.3.ebuild b/dev-db/lib_mysqludf_stat/lib_mysqludf_stat-0.0.3.ebuild
new file mode 100644
index 000000000000..f6c6fb36007d
--- /dev/null
+++ b/dev-db/lib_mysqludf_stat/lib_mysqludf_stat-0.0.3.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs with statistical functions"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_stat/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+
+ # remove precompiled object
+ rm -f -- ${PN}.so
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_stat/metadata.xml b/dev-db/lib_mysqludf_stat/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_stat/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_stem/Manifest b/dev-db/lib_mysqludf_stem/Manifest
new file mode 100644
index 000000000000..37367d087f51
--- /dev/null
+++ b/dev-db/lib_mysqludf_stem/Manifest
@@ -0,0 +1,6 @@
+AUX lib_mysqludf_stem-mysql_m4.patch 2494 SHA256 3998c45367c04e33460c7e4573415f3cc22953a8bfe5afbfaf41eb469b73fccf SHA512 11c057d563f430fa3fedfb8e1b9d830f2b593004dfca98d4ddf61b8ad4a6f77e67725862469dfc01c2dcabce2e65e64ca735e506344e044feeb51ff82e265c4e WHIRLPOOL aa4d25228b3825fcf8d4dd90887e641da3d80be42797c2f33f29610872f4ac26f2282b71294b921b8a32d6b44522b7de1922d8aedebda32ce07527bc190b6dcc
+DIST lib_mysqludf_stem-0.9.1.tar.gz 953171 SHA256 a98394b8275ea91eae0bd34703c0a686c5b8c3df039128b0487db757646d1f37 SHA512 d15736da91dc5a6f2b0289694efeb531337ff6a001d39aafca02c9f165ba5901163855b8f03d13a50c2ab9bee58e7fc03d19e893d086ec0022de9dd6921f93b7 WHIRLPOOL 26c670424a092052d0ce33b25ba094afa67bb9e1fc6609a3467778f498bf15c0dfe59ce54c29f056a0c33785a32ff36b643217f1768acf624f304e5ef0c79f59
+EBUILD lib_mysqludf_stem-0.9.1.ebuild 1641 SHA256 614bac26299a1f78dac411315e3a1d66f614078d679b280c989064d6f4cec577 SHA512 d2b001d5d05e1ed34ce1453b4519c07478312d41924afdc9f427c43135a49e9ef3d5bbe546c8f8206040f496c205cd6e749b5939ee4b7ca77ac9118e4f633483 WHIRLPOOL c9770adcf3414f9a6d4425057422287cc0f3fde5215afe389ad807a6798171ae588ee98b538a503948f4a3c6df9648dab8ea0e3971482b0fa039dcbaa5fce2fa
+MISC ChangeLog 2593 SHA256 b115e1b9e7e4ef22469dcefe96a0f8e73537c14ce348a3bdb5d9563eb6c312d9 SHA512 ffb522ab3b403c0342924848ddc33bf8ae261081403038e0c940dd95dc95d2dd10198f20cde9576831d5b249e3df3fd41a2c9ea14be323312fdc51580d8a94a6 WHIRLPOOL 0fd35fc87d38a6c555165da76542ba23203c4a5539e73fc57db1f6eb0116ff92a8acbba6abe30af9a1334c4234ad76161a3453064a9d5dc97160febe07cb149c
+MISC ChangeLog-2015 507 SHA256 60bd73afb7da37281da60aae1500865fb28f94244cfb6984da2ef57ce16b1218 SHA512 de61124e0a150d3b56f4036cfa2ff48882f03b6465fdefe00d3c2c38209e708be886bd1cd95dfe55d355d120018850c6f55000f5ba0905d71feb1f9acb7db62d WHIRLPOOL 18eb37cada78e5cd4b274b1402b22bdfd89f7208ed1ff87715d07669a51eadc3a6ded4c82ce246547eaa077e10b12c172dc8752b7fab22b11488033f33cfd4d4
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch b/dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch
new file mode 100644
index 000000000000..c12d1f7d39a9
--- /dev/null
+++ b/dev-db/lib_mysqludf_stem/files/lib_mysqludf_stem-mysql_m4.patch
@@ -0,0 +1,71 @@
+--- config/ax_lib_mysql.m4.orig 2008-05-28 17:31:47.000000000 +0200
++++ config/ax_lib_mysql.m4 2008-11-26 22:43:48.000000000 +0100
+@@ -87,10 +87,9 @@
+ MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`"
+
+ MYSQL_VERSION=`$MYSQL_CONFIG --version`
+-
+- if test `$MYSQL_CONFIG | /usr/bin/awk '{if ($1 == "--plugindir") print 1}'` == "1"; then
+- MYSQL_PLUGINDIR=`$MYSQL_CONFIG --plugindir`
+- fi
++ if $MYSQL_CONFIG --plugindir > /dev/null; then
++ MYSQL_PLUGINDIR=`$MYSQL_CONFIG --plugindir`
++ fi
+
+ AC_DEFINE([HAVE_MYSQL], [1],
+ [Define to 1 if MySQL libraries are available])
+--- config/ax_mysql_bin.m4.orig 2007-08-15 02:22:37.000000000 +0200
++++ config/ax_mysql_bin.m4 2008-11-26 22:55:40.000000000 +0100
+@@ -43,35 +43,36 @@
+ fi
+
+ if test -z "$withmysqlbin" -o "$withmysqlbin" = "yes"; then
+- for i in /usr/bin /usr/local/bin ; do
+- if test -f "$i/mysql" ; then
+- MYSQL="$i/mysql $MYSQL_ARGS"
+- fi
+- done
++ MYSQL=`which mysql`;
++ if test -n "$MYSQL"; then MYSQL="$MYSQL $MYSQL_ARGS"; fi
+ elif test "$withmysqlbin" != "no"; then
+ MYSQL="$withmysqlbin"
+ fi
+
+ if test -n "$MYSQL" ; then
+- MYSQLBIN_PATH = `dirname "$MYSQL"`
++ MYSQLBIN_PATH=`dirname "$MYSQL"`
+ fi
+
+ if test -z "$withmysqladmin" -o "$withmysqladmin" = "yes"; then
+- for i in "$MYSQLBIN_PATH" /usr/bin /usr/local/bin ; do
+- if test -n "$i" -a -f "$i/mysqladmin" ; then
+- MYSQLADMIN="$i/mysqladmin $MYSQL_ARGS"
+- fi
+- done
++ if test -n "$MYSQLBIN_PATH" -a -f "$MYSQLBIN_PATH/mysqladmin"; then
++ MYSQLADMIN="$MYSQLBIN_PATH/mysqladmin";
++ else
++ MYSQLADMIN=`which mysqladmin`;
++ fi
++
++ if test -n "$MYSQLADMIN"; then MYSQLADMIN="$MYSQLADMIN $MYSQL_ARGS"; fi
+ elif test "$withmysqladmin" != "no"; then
+ MYSQLADMIN="$withmysqladmin"
+ fi
+
+ if test -z "$withmysqltest" -o "$withmysqltest" = "yes"; then
+- for i in "$MYSQLBIN_PATH" /usr/bin /usr/local/bin ; do
+- if test -n "$i" -a -f "$i/mysqltest" ; then
+- MYSQLTEST="$i/mysqltest $MYSQL_ARGS"
+- fi
+- done
++ if test -n "$MYSQLBIN_PATH" -a -f "$MYSQLBIN_PATH/mysqltest"; then
++ MYSQLTEST="$MYSQLBIN_PATH/mysqltest";
++ else
++ MYSQLTEST=`which mysqltest`;
++ fi
++
++ if test -n "$MYSQLTEST"; then MYSQLTEST="$MYSQLTEST $MYSQL_ARGS"; fi
+ elif test "$withmysqltest" != "no"; then
+ MYSQLTEST="$withmysqltest"
+ fi
diff --git a/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild b/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild
new file mode 100644
index 000000000000..fdfa360a4beb
--- /dev/null
+++ b/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs which provides stemming capability for a variety of languages"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_stem/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # add AC_PROG_CXX to configure.ac
+ sed -i -e 's|\(AC_PROG_CC\)|\1\nAC_PROG_CXX|g' configure.ac
+
+ # fix ax_lib_mysql.m4 + ax_mysql_bin.m4
+ epatch "${FILESDIR}/${PN}-mysql_m4.patch"
+
+ # fix and clean libstemmer_c
+ sed -i -e 's|^\(CFLAGS\)=|\1+=-fPIC |g' libstemmer_c/Makefile
+ rm -f -- libstemmer_c/stemwords libstemmer_c/*.{o,a} libstemmer_c/*/*.o
+
+ edos2unix installdb.sql
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ local X
+ emake DESTDIR="${D}" install
+ dodoc libstemmer_c/libstemmer/*.txt
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_stem/metadata.xml b/dev-db/lib_mysqludf_stem/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_stem/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_str/Manifest b/dev-db/lib_mysqludf_str/Manifest
new file mode 100644
index 000000000000..703e27c659fd
--- /dev/null
+++ b/dev-db/lib_mysqludf_str/Manifest
@@ -0,0 +1,5 @@
+DIST lib_mysqludf_str-0.3.tar.gz 353717 SHA256 6a11bcfba19f97dfc696d0871779eba67e2a6badc20364403a9f68a9bb8a398b SHA512 a63ffbfd352db087da5a3e70f713845a88c6f4db47511a5b359bb8bcb466070d34b5e2b16d2bde38bd617ed209e2dc4553bbccfb406820e7669aa688652332b8 WHIRLPOOL 42712c9dc2948819680b1afb8f76f3ac3ad1b644c2215ae245afdc94c9f0be0eae5c27e799a336000a6865ac40cd467bf3e49b728ec27373698532b21416fb85
+EBUILD lib_mysqludf_str-0.3.ebuild 1235 SHA256 f78ac4ab9773d9387879a899fcb35fe9d1fb716ba1b461c1ca3226f68036b460 SHA512 b85391b4ed17f7714376688e4512008f02c1ceea62f2f5a0ed4f911b36c3899362f672131f861c1c14bc354a45b89eff1ecdfd9721239f46a12c4baa5708890a WHIRLPOOL 88f51a63496daca4c0310ce69b4530356951c44dee9cab56bf1d4fb6d2f077eb1a8ac13db7f33268049b6d993314411807a927ded78d0c610d1f5f2699ea2603
+MISC ChangeLog 2543 SHA256 860007196bb985b86d82da09b9b7d2c7c05b48b2227487378ee10698e44a16d7 SHA512 56c80aebed4c336c0658e78fe8b5fa6506b90013e6d02d1b16f2f759b2b00c2891f1e4b434f88b2b20b3f66b6084df609697842eeff9717d71606ccd71a3ad5d WHIRLPOOL d7e8ef48bac46769e615a5ff46e991f9c5178d2ef28894617fe853f2d218674c96db394527c4beb79997eb6e01b0282971ba3a6472d3c21d36e024c7b162cf95
+MISC ChangeLog-2015 456 SHA256 9000862022f9c7a46342487fe28e04e8f7b304aa87d9422c40feb12a9177588e SHA512 8b22de572f237715fa3e489186b1a82335ddaa3dc919c56cac129a8947bd30ea825c053dd8204e0e13bf1a77cd5e9da5aa77f8c1f1b642662ff30b6222c70cd6 WHIRLPOOL 57d82e86dfa3f1d282495b4e9e8375425da0cdada1972a9ea9538af297eba992ce9da17de6fb8e8f813409a3d780afdb0808c6341a74ffd3f5261844f9185eb3
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_str/lib_mysqludf_str-0.3.ebuild b/dev-db/lib_mysqludf_str/lib_mysqludf_str-0.3.ebuild
new file mode 100644
index 000000000000..599c50b6457c
--- /dev/null
+++ b/dev-db/lib_mysqludf_str/lib_mysqludf_str-0.3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs of string functions that complement the set of native ones"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_str/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ edos2unix README
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_str/metadata.xml b/dev-db/lib_mysqludf_str/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_str/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_sys/Manifest b/dev-db/lib_mysqludf_sys/Manifest
new file mode 100644
index 000000000000..c0ec47497aea
--- /dev/null
+++ b/dev-db/lib_mysqludf_sys/Manifest
@@ -0,0 +1,5 @@
+DIST lib_mysqludf_sys_0.0.3.tar.gz 9136 SHA256 174f43d1df5372c84d98981031f02a2b9e090954ac473f543bff79f9a87c2c4d SHA512 17154007bc315b7f5c98ed4eb0f6305a1c2bbd4a66a3b6985ed4547baddffcaac71a384fcce0780e26968021439f32534160661a5db756a012763b2ac74a3060 WHIRLPOOL 5c4a626a12507af799c8b54c457d01556b80c91582aa22668e733ca6013ea70693feeaade8908ab3650cb84db7f0997df5b102ec5eb75b0eb0353c9e970639a6
+EBUILD lib_mysqludf_sys-0.0.3.ebuild 1162 SHA256 4bc12395486eba372198abf9e7a61671a1837943a7923feb0335a09f49787e29 SHA512 265e49dc7e890be1301614322cf36ad9144f06d6d67dbbfb7c03963cf5e5d942fef501bb5b5b46e6b5f4ef307bf7c54c2214d04a04ad78a7f42803595213b297 WHIRLPOOL e5fbc06adde05dc9c398f1453e411ee8eaa74c69d9bcd4eb7aa7e01df0c65bc23f325614f8e7db5b6ce99ae6bcc42043de2b0effa8913f57e39fc2b72c0c7ca2
+MISC ChangeLog 2547 SHA256 e032de065361c9119c9cfbc61e9114e075cb6a34b3590186f160f94d8fd73049 SHA512 bdb0ab839f127d24965afedddac45c2ab09345b75b32d69f36267ae18d9fb3ffaac2f1b014d92b6e5fc9da911ee5e1077fdc79137f8f278c118c8687606f5404 WHIRLPOOL f209c3999c0640dbd2ea758eb64bf7ebe1d33d6185c18b3afc7097551fbf61b8b3e432e96b62608a2dd4a3efc7408b486a814e1314c2e84fdce0689b0bf1fcf7
+MISC ChangeLog-2015 638 SHA256 3050689d36eb62f8bed4268475bdc122999a3852a7f67286ee3d7e928af233f8 SHA512 0cc6e0d88a140e0a2fdf3cdbf291e3469de12af0133a71cb0672557841fdebaf828a961891aca9b6256ad72a35183bfe43226375527823852ac858c5287c090c WHIRLPOOL 267af12df5636e24e038e0166ef0ceeb57f032bc1d13b2ab071b565389c4a560ef40e344ee7a90ee3aaaad2be38ff1167a70f13228e9149f4333789186805853
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_sys/lib_mysqludf_sys-0.0.3.ebuild b/dev-db/lib_mysqludf_sys/lib_mysqludf_sys-0.0.3.ebuild
new file mode 100644
index 000000000000..9a99af98128d
--- /dev/null
+++ b/dev-db/lib_mysqludf_sys/lib_mysqludf_sys-0.0.3.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs that allows one to interact with the operating system"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_sys/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # remove precompiled object
+ rm -f -- ${PN}.so
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+ dohtml ${PN}.html
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_sys/metadata.xml b/dev-db/lib_mysqludf_sys/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_sys/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_ta/Manifest b/dev-db/lib_mysqludf_ta/Manifest
new file mode 100644
index 000000000000..3eaa62ad1a28
--- /dev/null
+++ b/dev-db/lib_mysqludf_ta/Manifest
@@ -0,0 +1,5 @@
+DIST joaocosta-lib_mysqludf_ta-a8e623c.tar.gz 932876 SHA256 6f1b728018f1bae276ce6d6722263fa07c8a864752b8906a030e3830e6321069 SHA512 4e8422067a055b55bdd1e7103f925f47b8174a83bd20d337d3f39479eebba3de9da0dc8a382441c090c6ef86b03e965d34a38b4c0f3ecc14ad0408aa2cdf511a WHIRLPOOL a4b6b644d01ca23708166307533ae5ea3b26da70728c1a08d2fb1f74b28d567c5a724ce1b036d82c80e5591247addcfed1e554ebfba33e0b69e47d0017b6e08b
+EBUILD lib_mysqludf_ta-0.1.ebuild 1382 SHA256 d466a195ffe0eb9317cfc53e176a7df7d6b025647b02d05cd61d98b0093433e6 SHA512 99edafdbc3cc9f63d2f39e8a1cd66e7dcc9155d0f9a4e9521bf36b1a50e52349526b21a5527b2fcf3d4afcad33b9d126ba9bfcce124710749c4f7473541b2f03 WHIRLPOOL 09294f33e541e22fb779b0790e555f12b956407e1ef5188468bc68780fc722bdaf8d9b75b308ee49648f1eb3d756164537667aa7108b55d06e18f1145de8bce6
+MISC ChangeLog 2540 SHA256 c52008f4b5f1a6c2100f3648c142a62ba2a4a0988680397bc2b1c8ed0b445b61 SHA512 9640f958d2ee2cb8828441590e098e723bc531dcd31f1c77e7573d6541b6764bb5a664e94e4a75d297ea29cc4c5396b1ab7898135a7fb9f145e25fb784cbdd83 WHIRLPOOL 08d22add1db07bfcb46880361b3e43d04ebdffae0a21b6570d1ef1921e0aca8e3527f6ee3418af651822049e27b2ebda46d8b3efc748b88ce5a5e5b5253b9f68
+MISC ChangeLog-2015 672 SHA256 7ad75312f7367f635e26712c82d7d2bf362e34152bf5384bd195193df5bb0404 SHA512 9aa601b4bba5c340ce41659645fa63cb9cde89ad5ddfaae7ca3bf435f1a3cb25bbdbecf369b046288b879d13279e89941f8146a73b9848f9c0427ee4efc18bc9 WHIRLPOOL e0632f589b5c1171cc4441be0d7859b205c47ffb7b90c4986b9bff3be210f88842018e47a167b764ddb0ff5c8fa1d492b909a65cdfb779f8f0f9a4786b79573e
+MISC metadata.xml 262 SHA256 78f0d037980429fe7faf477cd02e9f31b303bec782d3bf4c18a9ac21f3e39616 SHA512 cfc88194e048840067afd955cc1b01ded9440ad80ffefb509e74c03ba27bc9137d28ca62bfa83858644c4a7ad8cca2204ac1bf41cab10fb7a6371d3a9daaeb31 WHIRLPOOL 8908fe95fc8994be48b712c03111ad5d0c4783cdbfcc0bf56c3c1b1ef59c1f963612fd77c5172c8553371993c87a396c0f02734a3ce16cac38fa9f3c401c8035
diff --git a/dev-db/lib_mysqludf_ta/lib_mysqludf_ta-0.1.ebuild b/dev-db/lib_mysqludf_ta/lib_mysqludf_ta-0.1.ebuild
new file mode 100644
index 000000000000..1d60af33a1e3
--- /dev/null
+++ b/dev-db/lib_mysqludf_ta/lib_mysqludf_ta-0.1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+MY_REV="a8e623c" # checkout revision
+MY_USR="joaocosta" # user name
+
+MY_P="${MY_USR}-${PN}-${MY_REV}"
+
+DESCRIPTION="MySQL UDFs with technical analysis functions"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_ta/"
+SRC_URI="https://github.com/${MY_USR}/${PN}/tarball/${MY_REV} -> ${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+
+ # fix Makefile.am
+ sed -i -e "s|\(-shared\)|\1 -avoid-version|g" Makefile.am
+
+ # convert to UTF-8
+ iconv -f LATIN1 -t UTF-8 < README > README~
+ mv -f README~ README
+
+ edos2unix README
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README sampledb.sql
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_ta/metadata.xml b/dev-db/lib_mysqludf_ta/metadata.xml
new file mode 100644
index 000000000000..cc95dc0337f7
--- /dev/null
+++ b/dev-db/lib_mysqludf_ta/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="github">joaocosta/lib_mysqludf_ta</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/lib_mysqludf_udf/Manifest b/dev-db/lib_mysqludf_udf/Manifest
new file mode 100644
index 000000000000..d42eca354f4e
--- /dev/null
+++ b/dev-db/lib_mysqludf_udf/Manifest
@@ -0,0 +1,5 @@
+DIST lib_mysqludf_udf_0.0.3.tar.gz 2516 SHA256 47b46f6112d8d69798904f4bd33f703b4af47e6e13fecd2d1ca546322356b895 SHA512 5fdaa12b3846eb3921f8fbdf9001706155287066dd488fff2bb8419b306b20cad24e677224368c80e3f3af0379a4038e5a532d855ce16366c7a152cd1127c162 WHIRLPOOL 694910134dc11644d8e85fd51481f38644603810a8ee136e2e56e08d593551cd1582647297c61ae4768b5833e42d634dcf12b1c40cbbbcc089b866c7122f1123
+EBUILD lib_mysqludf_udf-0.0.3.ebuild 1069 SHA256 bf565cbf13556083cc7b6a636fccd28eab92b6acd8f785d45cd0e1ccd56e21df SHA512 9db3638c721c5c18eee12de293a91df20c4b2568957e657c0bf34777e0e7eb17e5b1e1b15499bad2afd3edbbd35652681bfff8012ba8da2110e61a77e6b417c9 WHIRLPOOL efc364c94354f76d6e0dc5a5923fe799dc03e708a2e16e1a6194a9e22c4a365c114af76a453752ac429389d52bb7020329205e016dc64f37a90a6844c6cf4c87
+MISC ChangeLog 2547 SHA256 4ce4cda1a68bfc94cbe8eccf1328a30afbda3d3e6b62d10364daf5ebdfee412b SHA512 51a2d6be17336db98c1029bdbc866c5037ea1008a28514334d63b0a2b51259393b10001fec6bd0ffb849fe84a39e53ac89ff4570395649adb704c65003fced5f WHIRLPOOL 801a51123e1a201cc34a6a710c2cc0ec3424678a3e5435244f18c550c288ecfa4978e8c6f41575b085fe2f5be71e398a98064cc9efc9e0f08fdc26b5822e4226
+MISC ChangeLog-2015 460 SHA256 d40e036506ab15b8399a2de2edb5d947bbbe32e8cd7612026032f43d270be364 SHA512 bcc47d796ce5c344026ba841f57f57457ca3ce358dd84e687d0806d36336cbb032c32c10c939f3c71c98a746556492e34c622eebf91f7dac65f4b8a613532834 WHIRLPOOL 20406e09a4c8ddc7076199e3b6feef1d03db1929e06a32fad4a93220fde05e7331924f88181eb7fd203ebc510471b226aac62d15c7c4bbbb623369215dce64a2
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/lib_mysqludf_udf/lib_mysqludf_udf-0.0.3.ebuild b/dev-db/lib_mysqludf_udf/lib_mysqludf_udf-0.0.3.ebuild
new file mode 100644
index 000000000000..e5858d5dae8f
--- /dev/null
+++ b/dev-db/lib_mysqludf_udf/lib_mysqludf_udf-0.0.3.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs for reporting internals from the udf interface"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_udf/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/lib_mysqludf_udf/metadata.xml b/dev-db/lib_mysqludf_udf/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/lib_mysqludf_udf/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/libdbi-drivers/Manifest b/dev-db/libdbi-drivers/Manifest
new file mode 100644
index 000000000000..bea2f6477cf0
--- /dev/null
+++ b/dev-db/libdbi-drivers/Manifest
@@ -0,0 +1,6 @@
+AUX libdbi-drivers-0.9.0-doc-build-fix.patch 694 SHA256 e1750eaeff253efee00c13765184028f10129f2367522861c7b526f0cf825d39 SHA512 0ff58a08909327db91ebd0dfad7ac88ebb17156bbb7afc8bfc8a3711fee37708a7ad715ed50b5085cdd15d3cdb5c06de3a0779694104fb6332a1e9c2f51f5b0e WHIRLPOOL 9dbc00f61263332c26196190928573e6d44c650fd0b538d8d256782a83c98174cb7bfe0d23292527d8fd5a456a30a5eb10113fba78226eb0a31a51a6ce46d038
+DIST libdbi-drivers-0.9.0.tar.gz 1829864 SHA256 43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854 SHA512 f4d3aaa71014697c53012a10bf9f0af398bcf5ee5872af165f8f43a682d2fb3045a9172ffea0e068dcbfcad52494878c037d8d90fadfaf176936e42f7f1e85c1 WHIRLPOOL 6ed745a19afe4b6b5d51f7730ca9698e645fac529051aeaae886938e063f8fcd3357c2f24913a5428db4847de1de38e931acc1e3e20aeed3e6d71b6877a104d6
+EBUILD libdbi-drivers-0.9.0.ebuild 2089 SHA256 ed065e9f60e63d3c17e29825c8a628fa371a2a845ba2731a35ac8bcfa4a3f089 SHA512 7031314753edcda27237ef260f33dff06c086672771799da8d8b7f27992a56f2af42bb943fd7d0ac0f3c81148e4786e4de1ec5361bf930f7452ed47f95d3eb3b WHIRLPOOL d89e2b3b50800fbc1a96c0dfd1044d71b8d13138d50d54b98fc9f5caaac969b3e1ad5fccf160b97b53945155f3d2c75de372c20427a7e5a6506829279c19c218
+MISC ChangeLog 2246 SHA256 45b7f97811b752ee2e4491c4d455d5c1e9053924a99ea004743b1be0a5b9a909 SHA512 f6cde29aba841a89c6f3a1f54c30b1062ad38525984065deeb0f4998d399f291e477835e5f44f9f40ee3849a3aeaa0beb41b1297378ea4d6ed793a27ddb09626 WHIRLPOOL ead9fea8b94bf1dfb0585806c5061cc6b699657d99810496ed002a645657f976ffb2b1045244ff4eee2042794cac39e337b3af876c00c21180f951130121bb10
+MISC ChangeLog-2015 11089 SHA256 19216573018ce89fb05e519ccff1ca3c1d9d8ff65f5ad81e2bc98487e88a57c2 SHA512 886290efb877f5ad6862d64115de2cbc355a7b4ab0b188de6a10ac357ac5b81d226c6fb4caf34904a07e32d555540f0b75c2e75856826a8915f6ceaa7bd06633 WHIRLPOOL 7c86e35393e83f62b986e861fac1eebd5092d657e4248bfe5dda020f55ddf2350b99198215a0194b2259142d19eff57a970280aaf74943464370cab40a985e45
+MISC metadata.xml 302 SHA256 7b71ffa5ee736f88b6500d313a36df434355a41d01a80da5f47586f9265be81a SHA512 d0d6c905c747105c3b5c2bde24ea7f8c63225779fe41f106b3de3d3082cbc01b0749546c3477db1e9f14db44e1b2921316f4cddb256ef8dddec3b4176a051c70 WHIRLPOOL d967b58fac01ceedfdd4bfb75a17fc5e1f37b05e8847ac86161b12fea6def63f29cd5efec2a86de6392d142cce7846fb31eb5edacef8a25e7cce8e3ca4b878c4
diff --git a/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-doc-build-fix.patch b/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-doc-build-fix.patch
new file mode 100644
index 000000000000..d0d74221fdb0
--- /dev/null
+++ b/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-doc-build-fix.patch
@@ -0,0 +1,22 @@
+diff -Nuar libdbi-drivers-0.9.0.orig/configure.in libdbi-drivers-0.9.0/configure.in
+--- libdbi-drivers-0.9.0.orig/configure.in 2013-03-11 23:41:05.000000000 +0000
++++ libdbi-drivers-0.9.0/configure.in 2013-08-29 15:52:57.632105403 +0000
+@@ -165,14 +165,13 @@
+ dnl See whether to build the docs
+ dnl ==============================
+
+-ac_docs="YES"
++ac_docs="yes"
+ AC_ARG_ENABLE(docs,
+ [ --disable-docs do not build and install the documentation.],
+- [ if test "$enable_docs" = "no"; then
+- ac_docs="NO"
+- fi])
++ [ ac_docs="$enableval" ],
++ [ ac_docs="no" ])
+
+-if test "$ac_docs" = "YES"; then
++if test "$ac_docs" = "yes"; then
+ docs_subdirs="doc"
+ else
+ docs_subdirs=""
diff --git a/dev-db/libdbi-drivers/libdbi-drivers-0.9.0.ebuild b/dev-db/libdbi-drivers/libdbi-drivers-0.9.0.ebuild
new file mode 100644
index 000000000000..9d4bf1e7df0f
--- /dev/null
+++ b/dev-db/libdbi-drivers/libdbi-drivers-0.9.0.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils autotools
+
+DESCRIPTION="The libdbi-drivers project maintains drivers for libdbi"
+SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${P}/${P}.tar.gz"
+HOMEPAGE="http://libdbi-drivers.sourceforge.net/"
+LICENSE="LGPL-2.1"
+
+IUSE="doc firebird mysql oci8 postgres +sqlite static-libs"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+SLOT=0
+REQUIRED_USE="|| ( mysql postgres sqlite firebird oci8 )"
+RESTRICT="firebird? ( bindist )"
+
+RDEPEND="
+ >=dev-db/libdbi-0.9.0
+ firebird? ( dev-db/firebird )
+ mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( dev-db/sqlite:3 )
+"
+DEPEND="${RDEPEND}
+ doc? ( app-text/openjade )
+"
+
+DOCS="AUTHORS ChangeLog NEWS README README.osx TODO"
+
+pkg_setup() {
+ use oci8 && [[ -z "${ORACLE_HOME}" ]] && die "\$ORACLE_HOME is not set!"
+}
+
+src_prepare() {
+ #"${FILESDIR}"/${P}-fix-ac-macro.patch \
+ #"${FILESDIR}"/${PN}-0.8.3-oracle-build-fix.patch \
+ #"${FILESDIR}"/${PN}-0.8.3-firebird-fix.patch
+ epatch \
+ "${FILESDIR}"/${PN}-0.9.0-doc-build-fix.patch
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=""
+ # WARNING: the configure script does NOT work correctly
+ # --without-$driver does NOT work
+ # so do NOT use `use_with...`
+ # Future additions:
+ # msql
+ # freetds
+ # ingres
+ # db2
+ use mysql && myconf+=" --with-mysql"
+ use postgres && myconf+=" --with-pgsql"
+ use sqlite && myconf+=" --with-sqlite3"
+ use firebird && myconf+=" --with-firebird"
+ if use oci8; then
+ [[ -z "${ORACLE_HOME}" ]] && die "\$ORACLE_HOME is not set!"
+ myconf+=" --with-oracle-dir=${ORACLE_HOME} --with-oracle"
+ fi
+
+ econf \
+ $(use_enable doc docs) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_test() {
+ if [[ -z "${WANT_INTERACTIVE_TESTS}" ]]; then
+ ewarn "Tests disabled due to interactivity."
+ ewarn "Run with WANT_INTERACTIVE_TESTS=1 if you want them."
+ return 0
+ fi
+ einfo "Running interactive tests"
+ emake check
+}
+
+src_install() {
+ default
+
+ prune_libtool_files --all
+}
diff --git a/dev-db/libdbi-drivers/metadata.xml b/dev-db/libdbi-drivers/metadata.xml
new file mode 100644
index 000000000000..812be68795b8
--- /dev/null
+++ b/dev-db/libdbi-drivers/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libdbi-drivers</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/libdbi/Manifest b/dev-db/libdbi/Manifest
new file mode 100644
index 000000000000..b0ef3939b120
--- /dev/null
+++ b/dev-db/libdbi/Manifest
@@ -0,0 +1,7 @@
+AUX dbi.pc.in 244 SHA256 9c7969c72ad8bb5371fd8c30a163408ed5dcd2a9523b6274b2e7e7f2fb9eba40 SHA512 6865b37e8d84d7a95b0ae482d9b1cb486ab7abbe726e699099ea4368d418f64b6d8cb02ecd4d1473f643aa5d715c57817a9496bd8950461921d5db4ff4272ef9 WHIRLPOOL 4d170682fe48f03bbbd9deb51281b36cecfbf5d5fdcd4705215c43509668dd61b96f2efd9f1bc55b9761ada74327730f93ee9cf18cd187dbfa4e36aca1f3dabc
+AUX libdbi-0.9.0-doc-build-fix.patch 662 SHA256 548e01cb57ae4123ba6fc909642f5d300e735f6b0b0e58f24417a83c1c7b39dd SHA512 db18d3697be13ef416914843d0933caead3b1f57c13790373ec435318212f0ccfb599514f8bd6f1c603e09f13bd526b62322ff92e68512e43020b31f8d0dec55 WHIRLPOOL bc1e08665484bf2b869902e25c27e64b9279b6de9e1a0f0e4b5812e9c25c876aa270b566cd086852d6da5c221683c1bf73640b6ce820c3c9ca3d6b69dd08d0ce
+DIST libdbi-0.9.0.tar.gz 1194284 SHA256 dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503 SHA512 ee8777195af43057409d051a6055ec0467cd926d48da076458b09f91d2f0995a1cc4bc071762e401b7bdcd8a4173fd8ea3472db3a1518e34b4c5b5ed24e4e2ce WHIRLPOOL 32770a9247670f30cd280a7c2111239d251e09d7c72e6b3890d02fdf3db7384de88e899431999e1b476ac099d4b8cd9f4d727d9610d47d62dccb9229bcdb36b7
+EBUILD libdbi-0.9.0.ebuild 1356 SHA256 c9968646e77be991b6c60ccbc7a285c6a9168fad78bbd583d012ac180c228b7a SHA512 a2b8b099edb1d5a3733656e61abfa3454bff90fb2faf2bffcffebfececb938bfe953adbc76216b55ebba5a42285974e6ae080721d386e9cba5f2d647ce8e415d WHIRLPOOL 051ed1a6b5459609e1a167c7810cd524d8df61a1d6b41fa6ea8a08a4185ee3ddf6ca2478f0c068c0cc765784410354ee3057bae5dc1c2fad45b6d020ca241970
+MISC ChangeLog 2232 SHA256 c99c81c151dae1930fe89d7d8e85d209c543cf9856e2ca22e75e29517775d052 SHA512 64e0484009df5ab8d64155b8f8866344d55b7b5541cd16c846e5f96fcf7e23806760399a0fb35bb3a6e8dda82d3f7055aee17233a372e58c3d2d5ade047fa760 WHIRLPOOL 2108ae5f4b1befa485925e072fefcb1cfd287b088858e1b45277452fd6a03d49932863c76b3171ac92467db8ef4d0e45a8551e2bebafa9b3c8aa587bb854b138
+MISC ChangeLog-2015 7707 SHA256 8e63f445b2512157488b363494d499396b9d5f039815560af807827ae6e92e4d SHA512 922fcbcbda4692b15bbee0f5c3ef09f9d6da5879188228f25aa8bf61d4f3da76d2b02abeb70fda1ce6aeda3d90b6ab5a26c64aa2a65e3afce3e7438c43c55e00 WHIRLPOOL f1eb06b84724e70f3446867aa79a79cd01c3af825eda51e1fb1814b0e04468bfeff64a952ed2b02125de210b8a2ed5ed144333348d94c93895bcf3afcc0c0eee
+MISC metadata.xml 294 SHA256 5bf959fcabb0126ba033a40f7c4b4b54e2ce74aaef9bc82d4ae23177050fd0bb SHA512 acb2d7a1ab6206a1f489cc8999ae35f014453bc95764000c5a6492a4b8832f2e0cf83bc875aecf50a6a6beb6bedabddb74628a2599f6c84a2d4aded345a39cd1 WHIRLPOOL 66290ee1c4117faf95ac324e31213a41066d8cda1fbffeb9b102a445bdc9261351feeb31d3bdbe61ac23b6f6c3062eefb9303ab52b54051961595b54343ca9df
diff --git a/dev-db/libdbi/files/dbi.pc.in b/dev-db/libdbi/files/dbi.pc.in
new file mode 100644
index 000000000000..a0144549db9b
--- /dev/null
+++ b/dev-db/libdbi/files/dbi.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@/dbi
+
+Name: libdbi
+Description: database-independent abstraction layer in C
+Version: @VERSION@
+Libs: -L${libdir} -ldbi
+Cflags: -I${includedir} -I${includedir}/dbi
diff --git a/dev-db/libdbi/files/libdbi-0.9.0-doc-build-fix.patch b/dev-db/libdbi/files/libdbi-0.9.0-doc-build-fix.patch
new file mode 100644
index 000000000000..c0818b9c295b
--- /dev/null
+++ b/dev-db/libdbi/files/libdbi-0.9.0-doc-build-fix.patch
@@ -0,0 +1,22 @@
+diff -Nuar libdbi-0.9.0.orig/configure.in libdbi-0.9.0/configure.in
+--- libdbi-0.9.0.orig/configure.in 2013-08-29 15:34:54.883102666 +0000
++++ libdbi-0.9.0/configure.in 2013-08-29 15:36:07.827905613 +0000
+@@ -201,14 +201,13 @@
+ dnl See whether to build the docs
+ dnl ==============================
+
+-ac_docs="YES"
++ac_docs="yes"
+ AC_ARG_ENABLE(docs,
+ [ --disable-docs do not build and install the documentation.],
+- [ if test "$enable_docs" = "no"; then
+- ac_docs="NO"
+- fi])
++ [ ac_docs="$enableval" ],
++ [ ac_docs="no" ])
+
+-if test "$ac_docs" = "YES"; then
++if test "$ac_docs" = "yes"; then
+ docs_subdirs="doc"
+ else
+ docs_subdirs=""
diff --git a/dev-db/libdbi/libdbi-0.9.0.ebuild b/dev-db/libdbi/libdbi-0.9.0.ebuild
new file mode 100644
index 000000000000..7f6a738b7a40
--- /dev/null
+++ b/dev-db/libdbi/libdbi-0.9.0.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils autotools multilib
+
+DESCRIPTION="A database-independent abstraction layer in C"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://libdbi.sourceforge.net/"
+LICENSE="LGPL-2.1"
+
+IUSE="doc static-libs"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+SLOT=0
+
+DOCS="AUTHORS ChangeLog README README.osx TODO"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4
+ virtual/pkgconfig
+ doc? ( app-text/openjade )
+"
+PDEPEND=">=dev-db/libdbi-drivers-0.9.0" # On purpose, libdbi-drivers 0.8.4 does not exist
+
+src_unpack() {
+ unpack ${A}
+ chown -R portage:portage "${S}"
+}
+
+src_prepare() {
+ #epatch "${FILESDIR}"/${PN}-0.9.0-fix-ac-macro.patch
+ #epatch "${FILESDIR}"/libdbi-0.8.1-pkg-config.patch
+ #cp -f "${FILESDIR}"/dbi.pc.in "${S}"/dbi.pc.in
+ epatch "${FILESDIR}"/libdbi-0.9.0-doc-build-fix.patch
+
+ # configure.in has been changed
+ eautoreconf
+ # should append CFLAGS, not replace them
+ sed -i.orig -e 's/^CFLAGS = /CFLAGS += /g' src/Makefile.in
+}
+
+src_configure() {
+ econf \
+ $(use_enable doc docs) \
+ $(use_enable static-libs static)
+}
+
+src_install () {
+ default
+
+ prune_libtool_files --all
+
+ # syslog-ng requires dbi.pc
+ insinto /usr/$(get_libdir)/pkgconfig/
+ doins dbi.pc
+}
diff --git a/dev-db/libdbi/metadata.xml b/dev-db/libdbi/metadata.xml
new file mode 100644
index 000000000000..77b6543efd3e
--- /dev/null
+++ b/dev-db/libdbi/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libdbi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/libiodbc/Manifest b/dev-db/libiodbc/Manifest
new file mode 100644
index 000000000000..3b804c5ca108
--- /dev/null
+++ b/dev-db/libiodbc/Manifest
@@ -0,0 +1,17 @@
+AUX fix-runpaths-r1.patch 438 SHA256 07efa7397c869dbf4baa17b8ab102d5c746a609710c438f0f65b0c91f02ed8e2 SHA512 2c64890a2e61f7fd3c6c053a35308b57eb7c50bf070d4833bd0b8a4182d3581cfb358ee315cc26cb26d6b11941d4e9265b38f59732f7b679d3b2d23d0dda0035 WHIRLPOOL 526c90ffcbb947ec0320fe90ba7e8b5d654b26a0024d3c5eee10792a9d82da9a11f7f089f2f91207a9ccdea16d28f17f3016ce7194863a003c9c4d4e4e1e03b1
+AUX fix-runpaths.patch 434 SHA256 b18af410745b0c0fe2468c486e310fa8e48ec36f28ff3315fd1be395ed419b9a SHA512 48364d6004c0f2dadb71a8b6838a4c4b1caf4d2df59e2f4acca82f6203704c4ad4aa4b3d0d4f33fdab4e8d01d7c70dad916b6bc4455dfa1581ff80f9f48468fa WHIRLPOOL a51adaa95024a5ed0ea1130328b7c9d96b39c8848f554f790a52c23e5211254db41c5cca598a00b2d578962425eb3bfc2e372535ad2687ffa0f646f1d77f5fbb
+AUX libiodbc-3.52.12-multilib.patch 934 SHA256 1fdfd4df7484cae69fd0efb34e822cf11cbd6cbc769ac610f9f7971a7000852b SHA512 718f564371d962283525f946b60b9028e66b3477d4bf20fd6f5363d08635c2d2603d9de5fb157e6039c124324578e5367e985d83623a3b1cd4dd0de7605f1911 WHIRLPOOL 5808ae4b057d55bbb90193250d06b823e5067df59629448503bca2a339a7081dd2ca6cd8869a604885be356baf8a28e2e9ba7767e9c6d2bf1225822d0393868c
+AUX libiodbc-3.52.7-debian_bug501100.patch 408 SHA256 d81564fdf0637bacbcbad52d7ad097ec9236f4145ad4f958763747bdc5239158 SHA512 e36a2b936b36af3cbdf125725628a2c5ca1f4d246c7b7eaf8c08a97e96fa25915b2b03bdd33f7a1c42b08d54f89174edbcb7f1ebaaa1a2e9777ff33023ac2575 WHIRLPOOL 215843432087ee2d8f782c301491167b4d8599a527774a6a10154975b082a65cfea390e16847a9a357c531c206156ff1fa6bcd08cfb4a71489929b497477d6ea
+AUX libiodbc-3.52.7-debian_bug508480.patch 577 SHA256 234990661704b35a475a55f28fe0c7275558bf85c5faf1abac4f94ccb8302113 SHA512 2e3a0ab2284b0b302e2eb5d27e1cc952810c5ec2d123491047cda15d1e0b2aa651a1d3357fb330be24fa72ec855a89143eb88bd4b87ce079b469b6ab8647ce74 WHIRLPOOL 949aa7a117577b7331b955fa5981e92e4e0041315d9a00375c2bb8d131b92cbbbc63c2da4aa7f20c38ce0f35bce31f57bf72d440b84e9d8c99f85f0791ade6c8
+AUX libiodbc-3.52.7-gtk.patch 445 SHA256 a883c7c87c1abac24c8964f94ccfe61e6011a1d3d6c424782ae3116fae85bd0e SHA512 ec7d682846103ac67274eb145c8501bdc8fdc2f0a7bda650302713e785ca428c75ad29230301e455ec2ad967aa272b13ad5283e8d5b01ff0dfca6beeac7dd0fb WHIRLPOOL e3e0fcb11518ed63fa0ae45f81b2fcf8863bfd4a3fbb61f913a3c6b750d68bccce5e16afef66a06ac8de08937781178c948bf38359046acebc7f1a88bceff6fb
+AUX libiodbc-3.52.7-multilib.patch 853 SHA256 bb9e60277d14f16206351efdd22e74264e03608b487300a5ef6fc641b9078bea SHA512 b91644eb58110cc429458ce372441e76655171ffa52904e0629f238bc6df21793875a6f4b524dddaa9f68f1f2ebc773db56d6da08643e4054299d09f38517849 WHIRLPOOL dec275bcaab1d2c94b3d5d893c5b59f57ac07d81e59dc64b32a955df2dbef01deab31ea657217f9ccec792009601cdaa42bf231d568c79bfe73de7d78fb37ca6
+AUX libiodbc-3.52.7-unicode_includes.patch 432 SHA256 cfa6fc4bdbd200f5eb7d502b9d5878d46a9c7b140b41c876dfda4e42bbda6f97 SHA512 b4bd56e88199ed06ec7ce64bbf53c3d792c501cdadee44a1c52d95336c36e93c2379d312b14c576a138210f2cf277e895ded18e80db4e5bb3f664ccb5695a305 WHIRLPOOL 8af0a923e8425094afaa10b22c00aa67094084c350885d6bd03ec467cafbb703d93d0c94885ba7edbc79e95a1493df38e8c99ff34d3a3beb8bbb7d77d0b79040
+AUX libiodbc-3.52.8-gtk-parallel-make.patch 661 SHA256 c7275637ce251106258d2436f640c352eef11c3083515cf109ce88e0d6efaac5 SHA512 5378bba53eea8c45a13631b5b8d0d4efed78ea2f786835d509431da3813924cbc07aae3d19053efef6fc052d351193f576ed4fcc301956f59f3e36e18280d537 WHIRLPOOL 059a360ff0d0a9cc04e1a65bc6323a2673935dda8eaf7db78a56a1a63e66f31ff3f71ce8bc1bf42a4a3c61b1a5a58c74556763743069c20d66032e2bebd33e49
+AUX libiodbc-3.52.8-runtime-failures.patch 2033 SHA256 84909ef0bbd8a862c9ed83ca73f22fa7bf75107eeb35d36d87a9b8413c9da66d SHA512 a6b921a85bf4076cf5af8744987cdd98ebc570043344e681def5a83e677e64ddc6457f86c135b33162f7248de6c9897b65978699582e0ad71cb9e696f6270142 WHIRLPOOL 2dd19d56ad6ba8ff6688769f22c2afd25d275fe0c75c9824b1b8c3e1d575ead75be6b180b5e7c2e40301a29a381db6a29ff8a94c6ebde1a7cab28a21cbc4a108
+DIST libiodbc-3.52.12.zip 1248801 SHA256 3e764524538bf26ada27a8e55915d7ca42d5069e01d36ed57eabcb724d3764b4 SHA512 240f6f7dc406fcc6688499bac8800b81380d32e8443e4f098875fabc649da1b86567b67d2259206be64cced8537d3171040d16be39845b9009cd90be62ae97db WHIRLPOOL 782eec0afb4802abf6d2b3d293b0a886bdb8aa011676fc2814d7df02c14919c425b82cc7428495015fcdc14512a0aa887e5eb641b3eeb8372838e21e73a3e5dd
+DIST libiodbc-3.52.8.zip 1188493 SHA256 f96cee2f04ab01b3c32297262ebf97b3faed1e49688399e656e8e4743ed72a0c SHA512 76da1e69a6e7ab1b7ba103547070c5dfe7c40fa88d82c243640d862c93c19e731d5a35d0575038491a148bb1d1cb7c5168dc30bf3f9600b31f4e014350f16551 WHIRLPOOL b6dafe709c3dff771ef43f023e62f528d92f9f9b05f0b986942826a2ded16e3cc2ccdae1606b2c31931ee487d01c25a173488c5e6d6c1ddafddb8f6be7dd326b
+EBUILD libiodbc-3.52.12.ebuild 1658 SHA256 21d54836da157150726da10cd2aab0c4aa195b7969d10614e9e90d0c89c2f543 SHA512 53efa97c5709d59b26d631aaefb9210468ab3aa2a8bdc32d9492a691b0ee2b66c7d6f9163095f00ab747370113a528600481eba35388914a91c36ff20d1df3a1 WHIRLPOOL 1f5297d87c288863915e9dda70b880b5ce7df2af0d9dbcba8a3db8bc7412ffe0867a06057d4e127a348562d9120273a4800d99a1b4d3ca9ea4acacf43abf387e
+EBUILD libiodbc-3.52.8-r2.ebuild 1711 SHA256 6c1943360c66b65b8ed52cddd75063a114dbc176a637a8500ba1e1a41ce4a6e9 SHA512 9ac4fa353299828cd7419ee5c5502434a3390db1a3f6c3558bda884cf091fa31cec34c69d2e2612985bd73c0ad97ee8dfa6bf6d96af59424f34148706475c8b1 WHIRLPOOL f964f07008868f9024ab7810a6ac1420e4b10928c7536a37627972ed4238b1655a8abec3732fa5d7dbe0562f41376d1997e9ac59ad2f3706858181c6191a1b96
+MISC ChangeLog 3724 SHA256 100fef70c65a9577d0e3bd3bdb410724bc36ade707a040dab691d4e1f0b74056 SHA512 cafc86087a2889c72c3b27da245d92923d5dc6cca36f740921d6a8534050ffd62dcc5f3edbb0740d2f7087c7c81be16ca3f5a584a3b645df7e56b856f5763191 WHIRLPOOL f171c4be3731af414ebf1458b30607e23276b59e16f22705c59749f9a8484be362cbac2cae4bce7b4dfabc3b109536bb835a4dd9272b3d6ed400c3cb85cfacc2
+MISC ChangeLog-2015 9092 SHA256 452849aff501c673fa4922154b800ae60312cef5ba5dc641a8019eaca0436e7b SHA512 4d3e31bdb0ea6764562168561fa691b389f44e04a69a8ce604691c43107dcf86ef5ca8f13bd4d4b6a77ad204bdb36ff8d2b77886e29a37a327f8767ada95ed3f WHIRLPOOL e09d877cf38cc49121b05e8d363b8b9b6fb8143823c6c6efbb00bb55db4b9abfbec2d124193aa2fc08301c8d08bc16a5562ae549d9c7956e26971a22f63fdf76
+MISC metadata.xml 251 SHA256 4e1c02894ff5f769312db313c8f094a234a29e559cc6f88357ca6fbacdd18fca SHA512 ec0eb5cbc30d0a7ad8c74612255d84a473c370d977f9be4c95904eb5281060bbe3c23d97fb9537e844bbaf90c2f6dd1fae891d44628bbca29fbecb0fe0cb8bbd WHIRLPOOL b54f8ed32c068cbc42189d6140a2689b1bb1b449db0300d29e926e6e782fcc35ebce78257f026a90bc6f412aa8df36fcd2be7370925d48f275502c3fd3518296
diff --git a/dev-db/libiodbc/files/fix-runpaths-r1.patch b/dev-db/libiodbc/files/fix-runpaths-r1.patch
new file mode 100644
index 000000000000..2cd76c816254
--- /dev/null
+++ b/dev-db/libiodbc/files/fix-runpaths-r1.patch
@@ -0,0 +1,15 @@
+--- a/samples/Makefile.am 2012-03-27 05:15:02.000000000 +0200
++++ b/samples/Makefile.am.new 2013-04-09 14:07:48.303789999 +0200
+@@ -78,12 +78,10 @@
+ #
+ iodbctest_SOURCES = iodbctest.c
+ iodbctest_LDADD = ../iodbc/libiodbc.la
+-iodbctest_LDFLAGS = -static
+
+ iodbctestw_CFLAGS = -DUNICODE
+ iodbctestw_SOURCES = iodbctest.c
+ iodbctestw_LDADD = ../iodbc/libiodbc.la
+-iodbctestw_LDFLAGS = -static
+
+ EXTRA_DIST = $(srcdir)/Makefile.sample
+
diff --git a/dev-db/libiodbc/files/fix-runpaths.patch b/dev-db/libiodbc/files/fix-runpaths.patch
new file mode 100644
index 000000000000..e913b4c7c4cc
--- /dev/null
+++ b/dev-db/libiodbc/files/fix-runpaths.patch
@@ -0,0 +1,15 @@
+--- samples/Makefile.am 2012-03-27 05:15:02.000000000 +0200
++++ samples/Makefile.am.new 2013-04-09 14:07:48.303789999 +0200
+@@ -78,12 +78,10 @@
+ #
+ iodbctest_SOURCES = iodbctest.c
+ iodbctest_LDADD = ../iodbc/libiodbc.la
+-iodbctest_LDFLAGS = -static
+
+ iodbctestw_CFLAGS = -DUNICODE
+ iodbctestw_SOURCES = iodbctest.c
+ iodbctestw_LDADD = ../iodbc/libiodbc.la
+-iodbctestw_LDFLAGS = -static
+
+ EXTRA_DIST = $(srcdir)/Makefile.sample
+
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.12-multilib.patch b/dev-db/libiodbc/files/libiodbc-3.52.12-multilib.patch
new file mode 100644
index 000000000000..e2819211ccac
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.12-multilib.patch
@@ -0,0 +1,37 @@
+diff --git a/bin/iodbc-config.in b/bin/iodbc-config.in
+index 08d46ae..576aa8b 100644
+--- a/bin/iodbc-config.in
++++ b/bin/iodbc-config.in
+@@ -145,10 +145,10 @@ while test $# -gt 0; do
+ echo_libs=yes
+ ;;
+ --static-libs)
+- echo_staticlibs=yes
++ echo_libs=yes
+ ;;
+ --libtool-libs)
+- echo_libtoollibs=yes
++ echo_libs=yes
+ ;;
+ --data-dir)
+ echo_data_dir=yes
+@@ -196,19 +196,5 @@ if test "$echo_libs" = "yes"; then
+ if test "$lib_iodbc" = "yes"; then
+ libs="$libs -liodbc -liodbcinst"
+ fi
+- echo "-L@libdir@ $libs"
+-fi
+-if test "$echo_staticlibs" = "yes"; then
+- libs=""
+- if test "$lib_iodbc" = "yes"; then
+- libs="@libdir@/libiodbc.a @libdir@/libiodbcinst.a -lpthread @LIBADD_DL@"
+- fi
+- echo "$libs"
+-fi
+-if test "$echo_libtoollibs" = "yes"; then
+- libs=""
+- if test "$lib_iodbc" = "yes"; then
+- libs="@libdir@/libiodbc.la @libdir@/libiodbcinst.la"
+- fi
+ echo "$libs"
+ fi
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug501100.patch b/dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug501100.patch
new file mode 100644
index 000000000000..5e19d1e68094
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug501100.patch
@@ -0,0 +1,14 @@
+Index: libiodbc2-3.52.7/include/sqltypes.h
+===================================================================
+--- libiodbc2-3.52.7.orig/include/sqltypes.h 2010-06-26 21:15:00.000000000 +0200
++++ libiodbc2-3.52.7/include/sqltypes.h 2010-06-26 21:15:36.000000000 +0200
+@@ -96,6 +96,9 @@
+ extern "C" {
+ #endif
+
++#ifndef _IODBCUNIX_H
++#include <iodbcunix.h>
++#endif
+
+ /*
+ * Environment specific definitions
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug508480.patch b/dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug508480.patch
new file mode 100644
index 000000000000..d1e80184e5b1
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.7-debian_bug508480.patch
@@ -0,0 +1,14 @@
+Index: libiodbc2-3.52.7/iodbcinst/inifile.c
+===================================================================
+--- libiodbc2-3.52.7.orig/iodbcinst/inifile.c 2010-06-26 21:29:43.000000000 +0200
++++ libiodbc2-3.52.7/iodbcinst/inifile.c 2010-06-26 21:30:07.000000000 +0200
+@@ -1023,7 +1023,8 @@
+
+ if (!_iodbcdm_cfg_find (pCfg, lpszSection, NULL))
+ {
+- while (curr < cbRetBuffer && 0 == _iodbcdm_cfg_nextentry (pCfg))
++ while (curr < cbRetBuffer && 0 == _iodbcdm_cfg_nextentry (pCfg)
++ && pCfg->section)
+ {
+ if (_iodbcdm_cfg_section (pCfg))
+ break;
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.7-gtk.patch b/dev-db/libiodbc/files/libiodbc-3.52.7-gtk.patch
new file mode 100644
index 000000000000..83fc954d46c9
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.7-gtk.patch
@@ -0,0 +1,16 @@
+diff -pruN 3.52.6-1/configure.in 3.52.6-1ubuntu1/configure.in
+--- 3.52.6-1/configure.in 2007-10-08 14:04:32.000000000 +0100
++++ 3.52.6-1ubuntu1/configure.in 2007-12-06 00:12:00.000000000 +0000
+@@ -315,12 +315,6 @@ then
+ no_gtk=""
+ # Check for GTK+ 2.x
+ AM_PATH_GTK_2_0(2.0.0)
+- if test x$no_gtk != x
+- then
+- # Try GTK 1.2.x instead
+- no_gtk=""
+- AM_PATH_GTK(1.2.3)
+- fi
+ if test x$no_gtk = x
+ then
+ USE_GTK=true
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.7-multilib.patch b/dev-db/libiodbc/files/libiodbc-3.52.7-multilib.patch
new file mode 100644
index 000000000000..73e81d30aec0
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.7-multilib.patch
@@ -0,0 +1,35 @@
+--- bin/iodbc-config.in.orig 2006-01-23 11:29:22.000000000 +0100
++++ bin/iodbc-config.in 2009-06-04 17:48:19.000000000 +0200
+@@ -145,10 +145,10 @@
+ echo_libs=yes
+ ;;
+ --static-libs)
+- echo_staticlibs=yes
++ echo_libs=yes
+ ;;
+ --libtool-libs)
+- echo_libtoollibs=yes
++ echo_libs=yes
+ ;;
+ --data-dir)
+ echo_data_dir=yes
+@@ -196,19 +196,5 @@
+ if test "$lib_iodbc" = "yes"; then
+ libs="$libs -liodbc -liodbcinst"
+ fi
+- echo "-L@libdir@ $libs"
+-fi
+-if test "$echo_staticlibs" = "yes"; then
+- libs=""
+- if test "$lib_iodbc" = "yes"; then
+- libs="@libdir@/libiodbc.a @libdir@/libiodbcinst.a @LIBADD_DL@"
+- fi
+- echo "$libs"
+-fi
+-if test "$echo_libtoollibs" = "yes"; then
+- libs=""
+- if test "$lib_iodbc" = "yes"; then
+- libs="@libdir@/libiodbc.la @libdir@/libiodbcinst.la"
+- fi
+ echo "$libs"
+ fi
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.7-unicode_includes.patch b/dev-db/libiodbc/files/libiodbc-3.52.7-unicode_includes.patch
new file mode 100644
index 000000000000..67730ec65556
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.7-unicode_includes.patch
@@ -0,0 +1,12 @@
+Index: libiodbc2-3.52.7/iodbcinst/unicode.h
+===================================================================
+--- libiodbc2-3.52.7.orig/iodbcinst/unicode.h 2009-09-09 14:13:17.000000000 +0200
++++ libiodbc2-3.52.7/iodbcinst/unicode.h 2010-06-26 21:16:26.000000000 +0200
+@@ -76,6 +76,7 @@
+
+ #ifndef _UNICODE_H
+ #define _UNICODE_H
++#include <iodbc.h>
+
+
+ #if defined (__APPLE__) && !defined (MACOSX102) && !defined (HAVE_CONFIG_H)
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.8-gtk-parallel-make.patch b/dev-db/libiodbc/files/libiodbc-3.52.8-gtk-parallel-make.patch
new file mode 100644
index 000000000000..7278499aff35
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.8-gtk-parallel-make.patch
@@ -0,0 +1,23 @@
+diff -u -r iODBC-3.52.8.orig/iodbcadm/Makefile.am iODBC-3.52.8/iodbcadm/Makefile.am
+--- iODBC-3.52.8.orig/iodbcadm/Makefile.am 2012-03-27 05:15:02.000000000 -0500
++++ iODBC-3.52.8/iodbcadm/Makefile.am 2013-01-08 08:12:58.639414826 -0600
+@@ -96,7 +96,7 @@
+
+ if GTK
+ libiodbcadm_la_LIBADD = \
+- ../iodbcadm/gtk/libiodbcadm-gtk.la \
++ gtk/libiodbcadm-gtk.la \
+ $(LIBADD_DL) \
+ @GTK_LIBS@ \
+ ../iodbcinst/libiodbc_common.la \
+@@ -117,8 +117,8 @@
+
+ iodbcadm_gtk_SOURCES =
+ iodbcadm_gtk_LDADD = \
+- ../iodbcadm/gtk/main.lo \
+- ../iodbcadm/libiodbcadm.la \
++ gtk/main.lo \
++ libiodbcadm.la \
+ ../iodbcinst/libiodbcinst.la \
+ ../iodbc/libiodbc.la \
+ @GTK_LIBS@
diff --git a/dev-db/libiodbc/files/libiodbc-3.52.8-runtime-failures.patch b/dev-db/libiodbc/files/libiodbc-3.52.8-runtime-failures.patch
new file mode 100644
index 000000000000..50724ba46b48
--- /dev/null
+++ b/dev-db/libiodbc/files/libiodbc-3.52.8-runtime-failures.patch
@@ -0,0 +1,56 @@
+diff -u -r iODBC-3.52.8.orig/configure.in iODBC-3.52.8/configure.in
+--- iODBC-3.52.8.orig/configure.in 2012-03-27 05:15:02.000000000 -0500
++++ iODBC-3.52.8/configure.in 2013-01-08 10:31:39.740041040 -0600
+@@ -87,7 +87,7 @@
+ AC_CONFIG_SRCDIR([include/isql.h])
+ AC_CONFIG_AUX_DIR(admin)
+ AC_CONFIG_MACRO_DIR(admin)
+-AM_CONFIG_HEADER(include/config.h)
++AC_CONFIG_HEADER(include/config.h)
+ AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
+ AC_CANONICAL_HOST
+ AM_MAINTAINER_MODE
+diff -u -r iODBC-3.52.8.orig/iodbcadm/gtk/administrator.c iODBC-3.52.8/iodbcadm/gtk/administrator.c
+--- iODBC-3.52.8.orig/iodbcadm/gtk/administrator.c 2012-03-27 05:15:02.000000000 -0500
++++ iODBC-3.52.8/iodbcadm/gtk/administrator.c 2013-01-08 10:29:51.758462953 -0600
+@@ -72,6 +72,13 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __linux
++# ifndef _GNU_SOURCE
++# define _GNU_SOURCE /* make sure dladdr is declared */
++# endif
++# define HAVE_DL_INFO 1
++#endif
++
+ #include <iodbc.h>
+ #include <dlfcn.h>
+ #include <sys/stat.h>
+@@ -82,7 +89,7 @@
+ #include "odbc4.xpm"
+
+
+-#if !defined(HAVE_DL_INFO)
++#if defined (HAVE_DLADDR) && !defined(HAVE_DL_INFO)
+ typedef struct
+ {
+ const char *dli_fname; /* File name of defining object. */
+@@ -90,6 +97,7 @@
+ const char *dli_sname; /* Name of nearest symbol. */
+ void *dli_saddr; /* Exact value of nearest symbol. */
+ } Dl_info;
++
+ #endif /* HAVE_DL_INFO */
+
+ static char *szDriverButtons[] = {
+diff -u -r iODBC-3.52.8.orig/iodbcadm/gtk/gui.h iODBC-3.52.8/iodbcadm/gtk/gui.h
+--- iODBC-3.52.8.orig/iodbcadm/gtk/gui.h 2012-03-27 05:15:02.000000000 -0500
++++ iODBC-3.52.8/iodbcadm/gtk/gui.h 2013-01-08 10:30:48.124240299 -0600
+@@ -219,5 +219,6 @@
+ void addlistofdir_to_optionmenu(GtkWidget* widget, LPCSTR path, TDSNCHOOSER *choose_t);
+ LPSTR create_keyval (HWND wnd, LPCSTR attrs, BOOL *verify_conn);
+ LPSTR create_fgensetup (HWND hwnd, LPCSTR dsn, LPCSTR attrs, BOOL add, BOOL *verify_conn);
++void create_message (HWND hwnd, LPCSTR dsn, LPCSTR text);
+
+ #endif
diff --git a/dev-db/libiodbc/libiodbc-3.52.12.ebuild b/dev-db/libiodbc/libiodbc-3.52.12.ebuild
new file mode 100644
index 000000000000..601567f5e7e1
--- /dev/null
+++ b/dev-db/libiodbc/libiodbc-3.52.12.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools multilib-minimal
+
+MY_PN="iODBC"
+
+DESCRIPTION="ODBC Interface for Linux"
+HOMEPAGE="http://www.iodbc.org/"
+SRC_URI="https://github.com/openlink/${MY_PN}/archive/v${PV}.zip -> ${P}.zip"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
+LICENSE="|| ( LGPL-2 BSD )"
+SLOT="0"
+IUSE="gtk"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS NEWS README )
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+MULTILIB_CHOST_TOOLS=( /usr/bin/iodbc-config )
+
+PATCHES=(
+ "${FILESDIR}"/libiodbc-3.52.12-multilib.patch
+ "${FILESDIR}"/libiodbc-3.52.7-debian_bug501100.patch
+ "${FILESDIR}"/libiodbc-3.52.7-debian_bug508480.patch
+ "${FILESDIR}"/libiodbc-3.52.7-unicode_includes.patch
+ "${FILESDIR}"/fix-runpaths-r1.patch
+)
+
+src_prepare() {
+ default
+ sed -i.orig \
+ -e '/^cd "$PREFIX"/,/^esac/d' \
+ iodbc/install_libodbc.sh || die "sed failed"
+
+ # Without this, automake dies. It's what upstream's autogen.sh does.
+ touch ChangeLog || die "failed to create empty ChangeLog"
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" \
+ econf \
+ --disable-static \
+ --enable-odbc3 \
+ --enable-pthreads \
+ --with-layout=gentoo \
+ --with-iodbc-inidir=yes \
+ $(use_enable gtk gui)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files
+
+ # Install lintian overrides
+ insinto /usr/share/lintian/overrides
+ newins debian/iodbc.lintian-overrides iodbc
+ newins debian/libiodbc2.lintian-overrides libiodbc2
+}
diff --git a/dev-db/libiodbc/libiodbc-3.52.8-r2.ebuild b/dev-db/libiodbc/libiodbc-3.52.8-r2.ebuild
new file mode 100644
index 000000000000..364fe91e946c
--- /dev/null
+++ b/dev-db/libiodbc/libiodbc-3.52.8-r2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit autotools eutils multilib-minimal
+
+MY_PN="iODBC"
+
+DESCRIPTION="ODBC Interface for Linux"
+HOMEPAGE="http://www.iodbc.org/"
+SRC_URI="https://github.com/openlink/${MY_PN}/archive/v${PV}.zip -> ${P}.zip"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
+LICENSE="|| ( LGPL-2 BSD )"
+SLOT="0"
+IUSE="gtk"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/iodbc-config
+)
+
+src_prepare() {
+ sed -i.orig \
+ -e '/^cd "$PREFIX"/,/^esac/d' \
+ iodbc/install_libodbc.sh || die "sed failed"
+ epatch \
+ "${FILESDIR}"/libiodbc-3.52.7-debian_bug501100.patch \
+ "${FILESDIR}"/libiodbc-3.52.7-debian_bug508480.patch \
+ "${FILESDIR}"/libiodbc-3.52.7-gtk.patch \
+ "${FILESDIR}"/libiodbc-3.52.7-multilib.patch \
+ "${FILESDIR}"/libiodbc-3.52.7-unicode_includes.patch \
+ "${FILESDIR}"/libiodbc-3.52.8-gtk-parallel-make.patch \
+ "${FILESDIR}"/libiodbc-3.52.8-runtime-failures.patch \
+ "${FILESDIR}"/fix-runpaths.patch
+ chmod -x include/*.h || die
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-static \
+ --enable-odbc3 \
+ --enable-pthreads \
+ --with-layout=gentoo \
+ --with-iodbc-inidir=yes \
+ $(use_enable gtk gui)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files
+
+ # Install lintian overrides
+ insinto /usr/share/lintian/overrides
+ newins debian/iodbc.lintian-overrides iodbc
+ newins debian/libiodbc2.lintian-overrides libiodbc2
+}
diff --git a/dev-db/libiodbc/metadata.xml b/dev-db/libiodbc/metadata.xml
new file mode 100644
index 000000000000..81b92f1d893e
--- /dev/null
+++ b/dev-db/libiodbc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="github">openlink/iODBC</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/libodbc++/Manifest b/dev-db/libodbc++/Manifest
new file mode 100644
index 000000000000..2d87878d12d8
--- /dev/null
+++ b/dev-db/libodbc++/Manifest
@@ -0,0 +1,8 @@
+AUX libodbc++-0.2.3-doxygen.patch 561 SHA256 2642d896e705ab56fc378547ae9eb27e1db136bd54d6ac6656463de24d79f825 SHA512 226dcfe4cbe3bac7a3eba2f1eb1184115e71494a6063521e2a3c6944316a323c383c88891780c701ffaef3a3564248b58869b2ce5d1da753063579fca0f1b7d5 WHIRLPOOL 5f9f1efe4fbe4e6726b00f10d7357fe857cd4062326aa5b53a549f0875e2b5699caea06ee95249474b4522e582340c843dbaeeb43fe1b2365ce457516c5cf2a5
+AUX libodbc++-0.2.3-gcc41.patch 456 SHA256 ad380ec268435405146431e47a9a9bd354be8c0edc1229b315f31c60990a3c43 SHA512 9b758fab94141338f42d9ce4291620bb839f7d044a9020de90258b70ef0554bb128879a3008bbafae9e5fab2082170d1a2b9e631d5ea7ef5c23eaf03f14d7615 WHIRLPOOL 48ababe3258ef8b5b34a2114f7039e9bc86f24463d24d63c6491cb8aec92c0e5a5a227ebacfba0c5cdab169375ee692056c01c3d14490d3317221d68550e9270
+AUX libodbc++-0.2.3-gcc44.patch 316 SHA256 738490176ed9a8efd3cb28b2260f289bd99603e8c30eb3f986625dcf612479f8 SHA512 6b8b6f57523e9128927530d95477c3c55a27c47836e7231e8017958bd20407e637fd4896015a2a3fbf2e47e3e44f7f3e933a28c4ac84fc600366b899462aebb1 WHIRLPOOL 3cd4d22053f8c5c2edee69568ea970ce7fcea28e8eefd097e1e1c17479327538ff5bbad97caebf2350dcb4387400bc2afaa8442a64e4bbb605ee5c039e932671
+DIST libodbc++-0.2.5.tar.bz2 362310 SHA256 ba3030a27b34e4aafbececa2ddbbf42a38815e9534f34c051620540531b5e23e SHA512 cc2485a0dae8a3f548a26a759f1421133a0a23715296f632067f5967b61778ca64e1339e19a4de15d06fb80b4e43ec8ddb13ba170b70dd7202c4d07b5669c2c7 WHIRLPOOL e39b35d288f6a37ea84815346540f07f39ed30fca3cdf9ce768ef48a3133301364a45fc2495daf11d6655d3d7748a7b9ab833b16213e67bce92c403dfdc9806f
+EBUILD libodbc++-0.2.5-r2.ebuild 3266 SHA256 78f336566ad25b549eda683867e3c0bfa4817e6c80de72fccbf291ae301656a3 SHA512 2a76bbc2584fda03c1547b2d8e9153d1e21366e62d1ff08120085a8bc66855258b13a58903c481d614cff27740a6fd9e4c4bd4744709f09c64db556fbd4b2352 WHIRLPOOL 405582568450dac055ea678b9d48462baf96c20c1e59e77025ed9adcead85af0523f291c5a063a8a8029655f869b17fe416be0199f8b2e2dc00295a13d695e25
+MISC ChangeLog 2551 SHA256 b517a66e2963a4b0382394467ed350dc98ee7d8aecf671f0e15626cf6478f665 SHA512 d3888683f02d381218b8b6944cdb5adf16fc2cf68c7f29df3712bc5a2c445a41aee7e729b53766c5ce2cbfa881b94d835ba4664fbd6e75c4a9a2ad0f1b8bfa4d WHIRLPOOL 83ddce257b5a973ea9ef603e7902c55f7bc22991cefad6fd1031d5545a1f29b3f6e4fb1a2a64f9b28c752609954fae6aff8b83bb348224f0ad5a2dce2c38772b
+MISC ChangeLog-2015 4320 SHA256 e3e8a42e9b7c42b80f9becfb98e9fac591d998db887299ac035bb4f8f735ee82 SHA512 387ba4eb4e9630c548e691c906331840b50fd9b1c9c5a44e1711652ab8815b21723d02e915adeca7262da3caeebc803d071b4a8dbb13ed39d875c3057963eaf8 WHIRLPOOL 3ee5aeb58e74efd9c3dfe4d796140c0e131c6535ad4711ecf83a2163166513cf4e1bbcc434e9d9bbace3292232fe155310989fc7f2be58ee7aedc1d797bae173
+MISC metadata.xml 407 SHA256 da214e72ebcfe62c8d8643083aac96cdf89261927cd920d3905f534fa496a804 SHA512 053eab77d80889554b167bd7449d9ae3994d59c68f84e1732413e003729b3ee852b05fa2dcc160746be7b482b6ea8811f790e4f2ce61f025010c9a8070121cf0 WHIRLPOOL 6345c5502d75fbbfe9d42e4f4f3c7f0bf429e581a6349a0cd57be2301265bc2a4ee849f7fa13a52c06ffe419da936ce7d0d63ba1ea31f1aeb4b99e992456bb74
diff --git a/dev-db/libodbc++/files/libodbc++-0.2.3-doxygen.patch b/dev-db/libodbc++/files/libodbc++-0.2.3-doxygen.patch
new file mode 100644
index 000000000000..e750c198123f
--- /dev/null
+++ b/dev-db/libodbc++/files/libodbc++-0.2.3-doxygen.patch
@@ -0,0 +1,12 @@
+diff -ur libodbc++-0.2.3-orig/doc/progref/Doxyfile libodbc++-0.2.3/doc/progref/Doxyfile
+--- libodbc++-0.2.3-orig/doc/progref/Doxyfile 2006-04-08 01:03:20.000000000 -0400
++++ libodbc++-0.2.3/doc/progref/Doxyfile 2006-04-08 01:06:03.000000000 -0400
+@@ -256,7 +256,7 @@
+ # each generated HTML page. If it is left blank doxygen will generate a
+ # standard footer.
+
+-HTML_FOOTER = footer
++HTML_FOOTER =
+
+ # The HTML_STYLESHEET tag can be used to specify a user defined cascading
+ # style sheet that is used by each HTML page. It can be used to
diff --git a/dev-db/libodbc++/files/libodbc++-0.2.3-gcc41.patch b/dev-db/libodbc++/files/libodbc++-0.2.3-gcc41.patch
new file mode 100644
index 000000000000..089277fbd722
--- /dev/null
+++ b/dev-db/libodbc++/files/libodbc++-0.2.3-gcc41.patch
@@ -0,0 +1,12 @@
+diff -ur libodbc++-0.2.3-orig/include/odbc++/drivermanager.h libodbc++-0.2.3/include/odbc++/drivermanager.h
+--- libodbc++-0.2.3-orig/include/odbc++/drivermanager.h 2006-04-08 00:54:19.000000000 -0400
++++ libodbc++-0.2.3/include/odbc++/drivermanager.h 2006-04-08 00:56:15.000000000 -0400
+@@ -26,6 +26,8 @@
+
+ #include <odbc++/types.h>
+
++#include <odbc++/errorhandler.h>
++
+ /** The namespace where all <b>libodbc++</b> classes reside */
+ namespace odbc {
+
diff --git a/dev-db/libodbc++/files/libodbc++-0.2.3-gcc44.patch b/dev-db/libodbc++/files/libodbc++-0.2.3-gcc44.patch
new file mode 100644
index 000000000000..415ae0185e08
--- /dev/null
+++ b/dev-db/libodbc++/files/libodbc++-0.2.3-gcc44.patch
@@ -0,0 +1,11 @@
+--- libodbc++-0.2.3-orig/src/datastream.h 2009-06-12 13:31:54.000000000 +0200
++++ libodbc++-0.2.3/src/datastream.h 2009-06-12 13:32:11.000000000 +0200
+@@ -25,6 +25,7 @@
+ #include <odbc++/types.h>
+
+ #if defined(ODBCXX_HAVE_ISO_CXXLIB)
++# include <cstdio>
+ # include <istream>
+ # include <streambuf>
+ #else
+
diff --git a/dev-db/libodbc++/libodbc++-0.2.5-r2.ebuild b/dev-db/libodbc++/libodbc++-0.2.5-r2.ebuild
new file mode 100644
index 000000000000..2ff9b64fa4bf
--- /dev/null
+++ b/dev-db/libodbc++/libodbc++-0.2.5-r2.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils flag-o-matic
+
+DESCRIPTION="Provides a subset of the well-known JDBC 2.0(tm) and runs on top of ODBC"
+SRC_URI="mirror://sourceforge/libodbcxx/${P}.tar.bz2"
+HOMEPAGE="http://libodbcxx.sourceforge.net/"
+
+LICENSE="LGPL-2.1"
+SLOT=0
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~x86"
+
+IUSE="static-libs"
+
+DEPEND="dev-db/unixODBC
+ sys-libs/ncurses"
+RDEPEND="${DEPEND}"
+
+SB="${S}-build"
+SB_MT="${S}-build-mt"
+# QT3 is no longer supported in Gentoo.
+#SB_QT="${S}-build_qt"
+#SB_QT_MT="${S}-build_qt-mt"
+
+src_prepare() {
+ #epatch "${FILESDIR}"/${PN}-0.2.3-std-streamsize.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-doxygen.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-gcc41.patch
+ #epatch "${FILESDIR}"/${PN}-0.2.3-gcc43.patch
+ #epatch "${FILESDIR}"/${PN}-0.2.3-typecast.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-gcc44.patch
+
+ # Fix configure to use ncurses instead of termcap (bug #103105)
+ sed -i -e 's~termcap~ncurses~g' configure
+
+ # Fix undeclared ODBCXX_STRING_PERCENT symbol, bug #532356
+ sed -i -e 's/ODBCXX_STRING_PERCENT/"%"/' src/dtconv.h || die
+
+ epatch_user
+}
+
+src_configure() {
+ local commonconf buildlist
+ commonconf="--with-odbc=/usr --without-tests"
+ commonconf="${commonconf} $(use_enable static-libs static) --enable-shared"
+ # " --enable-threads"
+
+ export ECONF_SOURCE="${S}"
+ append-flags -DODBCXX_DISABLE_READLINE_HACK
+
+ buildlist="${SB} ${SB_MT}"
+ #use qt3 && buildlist="${buildlist} $SB_QT $SB_QT_MT"
+
+ for sd in ${buildlist}; do
+ einfo "Doing configure pass for $sd"
+ mkdir -p "${sd}"
+ cd "${sd}"
+ commonconf2=''
+ LIBS=''
+ [ "${sd}" == "${SB_MT}" -o "${sd}" == "${SB_QT_MT}" ] && commonconf2="${commonconf2} --enable-threads"
+ [ "${sd}" == "${SB_QT}" -o "${sd}" == "${SB_QT_MT}" ] && commonconf2="${commonconf2} --with-qt"
+ # isql++ tool fails to compile:
+ #libodbc++-0.2.5/isql++/isql++.cpp: In constructor 'Isql::Isql(odbc::Connection*)':
+ #libodbc++-0.2.5/isql++/isql++.cpp:275: error: invalid cast to function type 'char** ()()'
+ #[ "${sd}" == "${SB}" ] && commonconf2="${commonconf2} --with-isqlxx"
+ # Upstream configure is broken as well, passing --without or
+ # --with-isqlxx=no will turn it ON instead of forcing it off.
+ #commonconf2="${commonconf2} _-without-isqlxx"
+ [ "${sd}" == "${SB_QT}" ] && commonconf2="${commonconf2} --with-qtsqlxx"
+ export LIBS
+ # using without-qt breaks the build
+ #--without-qt \
+ econf \
+ ${commonconf} \
+ ${commonconf2} \
+ || die "econf failed"
+ done
+}
+
+src_compile() {
+ local buildlist failures
+ buildlist="${SB} ${SB_MT}"
+ #use qt3 && buildlist="${buildlist} $SB_QT $SB_QT_MT"
+ for sd in ${buildlist}; do
+ einfo "Doing compile pass for $sd"
+ cd "${sd}"
+ emake LIBS='' || failures="${failures} ${sd//${S}-}"
+ done
+ [ -n "${failures}" ] && die "Failures: ${failures}"
+}
+
+src_install () {
+ dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
+
+ buildlist="${SB} ${SB_MT}"
+ #use qt3 && buildlist="${buildlist} $SB_QT $SB_QT_MT"
+ for sd in ${buildlist}; do
+ einfo "Doing install pass for $sd"
+ cd ${sd}
+ emake DESTDIR="${D}" install
+ done
+ if [[ "${P}" != "${PF}" ]]; then
+ mv "${D}"/usr/share/doc/${P}/* "${D}"/usr/share/doc/${PF}/
+ rmdir "${D}"/usr/share/doc/${P}
+ fi
+}
diff --git a/dev-db/libodbc++/metadata.xml b/dev-db/libodbc++/metadata.xml
new file mode 100644
index 000000000000..4fe3e6f563b4
--- /dev/null
+++ b/dev-db/libodbc++/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>cpp@gentoo.org</email>
+ <name>Gentoo C++ Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libodbcxx</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/libzdb/Manifest b/dev-db/libzdb/Manifest
new file mode 100644
index 000000000000..07bb2419519e
--- /dev/null
+++ b/dev-db/libzdb/Manifest
@@ -0,0 +1,15 @@
+DIST libzdb-2.11.1.tar.gz 599354 SHA256 390cdee70dcdd77f4ae113949564056b7a0648a931a918c0b626fa7e6d820c8c SHA512 b630c8ce8ee9eaee53cd801cca08af543faaf7f945c9bfd2721bba0a5569980949ab8212c4bf17fec56b5c5c107cef17cfa893e293444a39bd32116d47edb2c5 WHIRLPOOL 1fca845c84c7f5a867f6de7e5e3cae28e73a2ff0b7f261d385a87893c716b8640a60d262aaaedc5cd36f91dfbabfb818f820906d3e1eefcebc9e20928d3b66c7
+DIST libzdb-2.11.2.tar.gz 603149 SHA256 23d8cc201f4d4417963a440005bf3a93fc2010032a275056b0970c060910a298 SHA512 482510fcf382e3b235ae7a5615f175d46f2d0244ed2d06c6c2df14ea5cebff5dbf6ac855aedc28a7981b77f3662c505049c5439c33e29a762af2d2a793d959c9 WHIRLPOOL a04cd2c25bfaf7fd899c8d334e8836a3d574b033ba2c5e43986f1d915e3090d1f9b0bb9a3bb7a6f4b6897fda028f143492156081c331b11ad51df3582ff6cfba
+DIST libzdb-2.11.3.tar.gz 604720 SHA256 3ad2ffa8533b8b4524104a66345659235cec56211664906eba83134e3b305028 SHA512 89305e5ecfc6a630936268f2b70f417c9a66bcc37063f4d87fcc0d1e6b106f0fec0b299da9c7375087e77de07abf3ae81fb48027fd741f150cffef7027930c66 WHIRLPOOL 449924b519cd84904b72aa9d5a3557489f0c0c62d024ee2cd23b978ea26b2323ee58faa0a55388c48de5bfadb2a5d6a6cdbe9ae5abe69d7190a65329e267689f
+DIST libzdb-2.12.tar.gz 599160 SHA256 37e6bd3d8254be7d8fe1419cf0500b9006783d0e3544eeeffc5e6954cbcd07d4 SHA512 d2fbf7e0d7a8f37f8ce3404a0bf249165daafb54dfff31e6c7cea964b8360c1322bcd8cdc97a0ec8fec0a3be5bbe4f1690cb36a956bbcbea7b6a795655089f6f WHIRLPOOL 06449cf801f062dbbd322f95f80027b09f33b6e8a514638988ad33b47ef8d44a83fa31a21b1e561883bf487dfbd0c4196f04bb73ed62ff9924feccac7e9291ff
+DIST libzdb-3.0.tar.gz 700284 SHA256 e334bcb9ca1410e863634a164e3b1b5784018eb6e90b6c2b527780fc29a123c8 SHA512 ce29b0b381695b874627c38a12fe808179ed74a07898fce10bbf7db0279256192eba377a89c9daaf3c6981e29aa67f95e0b21615d9a94c36b0e2e90c9ce6e12d WHIRLPOOL a4efb05a761cf8a5dfee390910c0dbdb5e0256e5e9aefd0d2d3ea510eca31435607d27ed03ebc99f80bef6c9b7498a69aec36c853327612605f397c46491162b
+DIST libzdb-3.1.tar.gz 720162 SHA256 0f01abb1b01d1a1f4ab9b55ad3ba445d203fc3b4757abdf53e1d85e2b7b42695 SHA512 7cf24ccf0f0a938955d8b54af2c6eca8a8f700737beafde9e824129f324511e06adbc11a3fdbd6ad6d9b902fdae6f7caab4e5c1c594d2211be314e3a24c697f3 WHIRLPOOL a6c2f713e070aaf4aa60d518db7ed1e7f05c82536c63c4c183e6dd8116ab506941dd6bff967956336b089dc83f69f017e10d3194ff82f1b8bf5808083d85ed40
+EBUILD libzdb-2.11.1.ebuild 1949 SHA256 0eaa6db688f1b5a471fe720513b39ec0dcf84c5f17531c20595b215372f94311 SHA512 e463dc5edeec408ae42d282319b9cd4e49338fb7cf86a7c26de5ca808d9e4159fce8610f14fb881ae999626be373db4918e5f9162387f0663a7fc99cc6372ca3 WHIRLPOOL 51d2168936b0c8b3d39ea99e02f511f13817f3cf3fdd8705b26f4f705f1d995dbf62203b6d19d73032fbb776a3a44c2661f1f9f16febcd864ab48a74ab171180
+EBUILD libzdb-2.11.2.ebuild 1951 SHA256 437c25c2cd21907bf0e8ec386a23e1ef1c1e8647bd6f5c920c15a89bd1f43ce2 SHA512 d928c77f97d1f974561ef951fcdb3774af7880e6a06705df21698012a747475fb64b3c44248bbe4086e13e6373b038896d35c5cc877e57f2bbc3693498799a25 WHIRLPOOL 77b75e6b157a0fb285c8973ae2982079f8b93e941be04a3a0dcbbf13ac6a15dca7d2333242939d3926dff401e63efe2911ade5a7a49d4c514f81f00a2813f41e
+EBUILD libzdb-2.11.3.ebuild 1951 SHA256 437c25c2cd21907bf0e8ec386a23e1ef1c1e8647bd6f5c920c15a89bd1f43ce2 SHA512 d928c77f97d1f974561ef951fcdb3774af7880e6a06705df21698012a747475fb64b3c44248bbe4086e13e6373b038896d35c5cc877e57f2bbc3693498799a25 WHIRLPOOL 77b75e6b157a0fb285c8973ae2982079f8b93e941be04a3a0dcbbf13ac6a15dca7d2333242939d3926dff401e63efe2911ade5a7a49d4c514f81f00a2813f41e
+EBUILD libzdb-2.12.ebuild 1949 SHA256 0eaa6db688f1b5a471fe720513b39ec0dcf84c5f17531c20595b215372f94311 SHA512 e463dc5edeec408ae42d282319b9cd4e49338fb7cf86a7c26de5ca808d9e4159fce8610f14fb881ae999626be373db4918e5f9162387f0663a7fc99cc6372ca3 WHIRLPOOL 51d2168936b0c8b3d39ea99e02f511f13817f3cf3fdd8705b26f4f705f1d995dbf62203b6d19d73032fbb776a3a44c2661f1f9f16febcd864ab48a74ab171180
+EBUILD libzdb-3.0.ebuild 1951 SHA256 437c25c2cd21907bf0e8ec386a23e1ef1c1e8647bd6f5c920c15a89bd1f43ce2 SHA512 d928c77f97d1f974561ef951fcdb3774af7880e6a06705df21698012a747475fb64b3c44248bbe4086e13e6373b038896d35c5cc877e57f2bbc3693498799a25 WHIRLPOOL 77b75e6b157a0fb285c8973ae2982079f8b93e941be04a3a0dcbbf13ac6a15dca7d2333242939d3926dff401e63efe2911ade5a7a49d4c514f81f00a2813f41e
+EBUILD libzdb-3.1.ebuild 1947 SHA256 35ecd858a73940adf8cef20bcd1ce8c722e5d93f9ff530ee32124c8aac6bea21 SHA512 88f77f36dfa481d6886ecf767060fefd2064b2c31ddd950c64a2e6a34679951574f4cae330ab006ca4101c42b4cfa670f55a909fed1d5bbcb786dcc235a49744 WHIRLPOOL 9cce0bed0f52612dd62d060466becf4dcb239bd97c3fce6db6a87725b1e0ad83e6b514ee99e2940b47b853f4f3c3710a7f30cc4eea6eaac9c662a81df91e8ff4
+MISC ChangeLog 3233 SHA256 4fbaca9bc68c295f6d86c1232338bc8b32897d45a3ec6c3314cf71f4064dd3d4 SHA512 7957376f37697ea32e21faf20836881d774bf0e89b588d026bec3c75ebf06b13e3d30ffa5a8fb03a438b6f2e78d20081578fabac0b3be85e7b197cdbc1ffb152 WHIRLPOOL cb210bf09ad98ad68eff12f3347fb1d320b1dde19180a59d32cf37d125524dc286cb7d711c46538372ae199606b461cb034468d2b66c03a26f71f2b88bdad40d
+MISC ChangeLog-2015 3229 SHA256 a2e4f83959942f6a24652c51f74f6889a0f4e38f2c14c8c4abbccb30e5a8ff0c SHA512 3d6c8bfdaa9594e0b79fb68d67dd066693600a184c3442a640bf93be6d7328884fed195bdb5a32ac4142d7e4687750c3d2ee420d4fec8c95c600812719deb0ff WHIRLPOOL 50e10f4bfcd4211d961e4e331ee365ba30cbe3d2b569a0d1aebf9b84e001d2dfa080ea6a404d78040fb8a1a7f6567381a0e18005c83a0e2c54baeeaa16a5f926
+MISC metadata.xml 260 SHA256 ce25918590fb654f24c1a6b3d197aaf5f1e3f903e49b6626a1b9155dd2f8a671 SHA512 59cfd931bff3d126b19f8a1fa49dde57212b12115e6f48e9905ba07aad8472e998c92f87e4f450e1fdb7966e5eae2ac17582eef48cfc71547045628cf4cbf275 WHIRLPOOL 5ad881f4353ffe88da063f3a3ff98c92e5fb2e5557987fd54afa359c9d6c075cae4a74de0c47dea4b7f29a5f3853f4a6a97c4d48f9fa094daca9c36d03775d0b
diff --git a/dev-db/libzdb/libzdb-2.11.1.ebuild b/dev-db/libzdb/libzdb-2.11.1.ebuild
new file mode 100644
index 000000000000..6c5247ef4b6b
--- /dev/null
+++ b/dev-db/libzdb/libzdb-2.11.1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A thread safe high level multi-database connection pool library"
+HOMEPAGE="http://www.tildeslash.com/libzdb/"
+SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug doc mysql postgres +sqlite ssl static-libs"
+REQUIRED_USE=" || ( postgres mysql sqlite )"
+
+RESTRICT=test
+
+RDEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i -e "s|&& ./pool||g" test/Makefile.in || die
+}
+
+src_configure() {
+ ## TODO: check what --enable-optimized actually does
+ ## TODO: find someone with oracle db to add oci8 support
+ myconf=""
+ if [[ $(gcc-version) < 4.1 ]];then
+ myconf="${myconf} --disable-protected"
+ else
+ myconf="${myconf} --enable-protected"
+ fi
+
+ if use sqlite; then
+ myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
+ else
+ myconf="${myconf} --without-sqlite"
+ fi
+
+ if use mysql; then
+ myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
+ else
+ myconf="${myconf} --without-mysql"
+ fi
+
+ if use postgres; then
+ myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
+ else
+ myconf="${myconf} --without-postgresql"
+ fi
+
+ econf \
+ $(use_enable debug profiling) \
+ $(use_enable static-libs static) \
+ $(use_enable ssl openssl) \
+ --without-oci \
+ ${myconf}
+}
+
+src_compile() {
+ default_src_compile
+ if use doc; then
+ emake doc
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # the --disable-static flag only skips .a
+ use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
+
+ dodoc AUTHORS CHANGES README
+ if use doc;then
+ dohtml -r "${S}/doc/api-docs"/*
+ fi
+}
+
+src_test() {
+ emake verify
+}
diff --git a/dev-db/libzdb/libzdb-2.11.2.ebuild b/dev-db/libzdb/libzdb-2.11.2.ebuild
new file mode 100644
index 000000000000..a21cf467d7c8
--- /dev/null
+++ b/dev-db/libzdb/libzdb-2.11.2.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A thread safe high level multi-database connection pool library"
+HOMEPAGE="http://www.tildeslash.com/libzdb/"
+SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="debug doc mysql postgres +sqlite ssl static-libs"
+REQUIRED_USE=" || ( postgres mysql sqlite )"
+
+RESTRICT=test
+
+RDEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i -e "s|&& ./pool||g" test/Makefile.in || die
+}
+
+src_configure() {
+ ## TODO: check what --enable-optimized actually does
+ ## TODO: find someone with oracle db to add oci8 support
+ myconf=""
+ if [[ $(gcc-version) < 4.1 ]];then
+ myconf="${myconf} --disable-protected"
+ else
+ myconf="${myconf} --enable-protected"
+ fi
+
+ if use sqlite; then
+ myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
+ else
+ myconf="${myconf} --without-sqlite"
+ fi
+
+ if use mysql; then
+ myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
+ else
+ myconf="${myconf} --without-mysql"
+ fi
+
+ if use postgres; then
+ myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
+ else
+ myconf="${myconf} --without-postgresql"
+ fi
+
+ econf \
+ $(use_enable debug profiling) \
+ $(use_enable static-libs static) \
+ $(use_enable ssl openssl) \
+ --without-oci \
+ ${myconf}
+}
+
+src_compile() {
+ default_src_compile
+ if use doc; then
+ emake doc
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # the --disable-static flag only skips .a
+ use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
+
+ dodoc AUTHORS CHANGES README
+ if use doc;then
+ dohtml -r "${S}/doc/api-docs"/*
+ fi
+}
+
+src_test() {
+ emake verify
+}
diff --git a/dev-db/libzdb/libzdb-2.11.3.ebuild b/dev-db/libzdb/libzdb-2.11.3.ebuild
new file mode 100644
index 000000000000..a21cf467d7c8
--- /dev/null
+++ b/dev-db/libzdb/libzdb-2.11.3.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A thread safe high level multi-database connection pool library"
+HOMEPAGE="http://www.tildeslash.com/libzdb/"
+SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="debug doc mysql postgres +sqlite ssl static-libs"
+REQUIRED_USE=" || ( postgres mysql sqlite )"
+
+RESTRICT=test
+
+RDEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i -e "s|&& ./pool||g" test/Makefile.in || die
+}
+
+src_configure() {
+ ## TODO: check what --enable-optimized actually does
+ ## TODO: find someone with oracle db to add oci8 support
+ myconf=""
+ if [[ $(gcc-version) < 4.1 ]];then
+ myconf="${myconf} --disable-protected"
+ else
+ myconf="${myconf} --enable-protected"
+ fi
+
+ if use sqlite; then
+ myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
+ else
+ myconf="${myconf} --without-sqlite"
+ fi
+
+ if use mysql; then
+ myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
+ else
+ myconf="${myconf} --without-mysql"
+ fi
+
+ if use postgres; then
+ myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
+ else
+ myconf="${myconf} --without-postgresql"
+ fi
+
+ econf \
+ $(use_enable debug profiling) \
+ $(use_enable static-libs static) \
+ $(use_enable ssl openssl) \
+ --without-oci \
+ ${myconf}
+}
+
+src_compile() {
+ default_src_compile
+ if use doc; then
+ emake doc
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # the --disable-static flag only skips .a
+ use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
+
+ dodoc AUTHORS CHANGES README
+ if use doc;then
+ dohtml -r "${S}/doc/api-docs"/*
+ fi
+}
+
+src_test() {
+ emake verify
+}
diff --git a/dev-db/libzdb/libzdb-2.12.ebuild b/dev-db/libzdb/libzdb-2.12.ebuild
new file mode 100644
index 000000000000..6c5247ef4b6b
--- /dev/null
+++ b/dev-db/libzdb/libzdb-2.12.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A thread safe high level multi-database connection pool library"
+HOMEPAGE="http://www.tildeslash.com/libzdb/"
+SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug doc mysql postgres +sqlite ssl static-libs"
+REQUIRED_USE=" || ( postgres mysql sqlite )"
+
+RESTRICT=test
+
+RDEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i -e "s|&& ./pool||g" test/Makefile.in || die
+}
+
+src_configure() {
+ ## TODO: check what --enable-optimized actually does
+ ## TODO: find someone with oracle db to add oci8 support
+ myconf=""
+ if [[ $(gcc-version) < 4.1 ]];then
+ myconf="${myconf} --disable-protected"
+ else
+ myconf="${myconf} --enable-protected"
+ fi
+
+ if use sqlite; then
+ myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
+ else
+ myconf="${myconf} --without-sqlite"
+ fi
+
+ if use mysql; then
+ myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
+ else
+ myconf="${myconf} --without-mysql"
+ fi
+
+ if use postgres; then
+ myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
+ else
+ myconf="${myconf} --without-postgresql"
+ fi
+
+ econf \
+ $(use_enable debug profiling) \
+ $(use_enable static-libs static) \
+ $(use_enable ssl openssl) \
+ --without-oci \
+ ${myconf}
+}
+
+src_compile() {
+ default_src_compile
+ if use doc; then
+ emake doc
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # the --disable-static flag only skips .a
+ use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
+
+ dodoc AUTHORS CHANGES README
+ if use doc;then
+ dohtml -r "${S}/doc/api-docs"/*
+ fi
+}
+
+src_test() {
+ emake verify
+}
diff --git a/dev-db/libzdb/libzdb-3.0.ebuild b/dev-db/libzdb/libzdb-3.0.ebuild
new file mode 100644
index 000000000000..a21cf467d7c8
--- /dev/null
+++ b/dev-db/libzdb/libzdb-3.0.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A thread safe high level multi-database connection pool library"
+HOMEPAGE="http://www.tildeslash.com/libzdb/"
+SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="debug doc mysql postgres +sqlite ssl static-libs"
+REQUIRED_USE=" || ( postgres mysql sqlite )"
+
+RESTRICT=test
+
+RDEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i -e "s|&& ./pool||g" test/Makefile.in || die
+}
+
+src_configure() {
+ ## TODO: check what --enable-optimized actually does
+ ## TODO: find someone with oracle db to add oci8 support
+ myconf=""
+ if [[ $(gcc-version) < 4.1 ]];then
+ myconf="${myconf} --disable-protected"
+ else
+ myconf="${myconf} --enable-protected"
+ fi
+
+ if use sqlite; then
+ myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
+ else
+ myconf="${myconf} --without-sqlite"
+ fi
+
+ if use mysql; then
+ myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
+ else
+ myconf="${myconf} --without-mysql"
+ fi
+
+ if use postgres; then
+ myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
+ else
+ myconf="${myconf} --without-postgresql"
+ fi
+
+ econf \
+ $(use_enable debug profiling) \
+ $(use_enable static-libs static) \
+ $(use_enable ssl openssl) \
+ --without-oci \
+ ${myconf}
+}
+
+src_compile() {
+ default_src_compile
+ if use doc; then
+ emake doc
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # the --disable-static flag only skips .a
+ use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
+
+ dodoc AUTHORS CHANGES README
+ if use doc;then
+ dohtml -r "${S}/doc/api-docs"/*
+ fi
+}
+
+src_test() {
+ emake verify
+}
diff --git a/dev-db/libzdb/libzdb-3.1.ebuild b/dev-db/libzdb/libzdb-3.1.ebuild
new file mode 100644
index 000000000000..4de988ae6ebd
--- /dev/null
+++ b/dev-db/libzdb/libzdb-3.1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A thread safe high level multi-database connection pool library"
+HOMEPAGE="http://www.tildeslash.com/libzdb/"
+SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug doc mysql postgres +sqlite ssl static-libs"
+REQUIRED_USE=" || ( postgres mysql sqlite )"
+
+RESTRICT=test
+
+RDEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i -e "s|&& ./pool||g" test/Makefile.in || die
+}
+
+src_configure() {
+ ## TODO: check what --enable-optimized actually does
+ ## TODO: find someone with oracle db to add oci8 support
+ myconf=""
+ if [[ $(gcc-version) < 4.1 ]];then
+ myconf="${myconf} --disable-protected"
+ else
+ myconf="${myconf} --enable-protected"
+ fi
+
+ if use sqlite; then
+ myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
+ else
+ myconf="${myconf} --without-sqlite"
+ fi
+
+ if use mysql; then
+ myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
+ else
+ myconf="${myconf} --without-mysql"
+ fi
+
+ if use postgres; then
+ myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
+ else
+ myconf="${myconf} --without-postgresql"
+ fi
+
+ econf \
+ $(use_enable debug profiling) \
+ $(use_enable static-libs static) \
+ $(use_enable ssl openssl) \
+ --without-oci \
+ ${myconf}
+}
+
+src_compile() {
+ default_src_compile
+ if use doc; then
+ emake doc
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # the --disable-static flag only skips .a
+ use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
+
+ dodoc AUTHORS CHANGES README
+ if use doc;then
+ dohtml -r "${S}/doc/api-docs"/*
+ fi
+}
+
+src_test() {
+ emake verify
+}
diff --git a/dev-db/libzdb/metadata.xml b/dev-db/libzdb/metadata.xml
new file mode 100644
index 000000000000..e97f3c9a8559
--- /dev/null
+++ b/dev-db/libzdb/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>lordvan@gentoo.org</email>
+ <name>Thomas Raschbacher</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/lmdb++/Manifest b/dev-db/lmdb++/Manifest
new file mode 100644
index 000000000000..d4fa718a4628
--- /dev/null
+++ b/dev-db/lmdb++/Manifest
@@ -0,0 +1,5 @@
+DIST lmdbxx-0.9.14.0.tar.gz 14732 SHA256 f74c55184bff19de607948a5f00fe1073de5b59c4309ab2e8ebc488cf675f419 SHA512 8eff8c89e0cb9989d8a0cedfd483856aeb2fcf810d59cf8afca3086034711ff22f2bb88ba967ef745d36fdaa1b5e79fb75655af764cddcdb2ac59fc255da670d WHIRLPOOL ab023a06e43d8f5189a83dc6eaf04b632eff83c028991ff440fd06a3c7f582f2aa0cf0332ef182837194979fbabb3a4cab6df7252d06455baec498db1941a635
+EBUILD lmdb++-0.9.14.0.ebuild 518 SHA256 724b2c87191d4121331f7b334760d9f0448ebb9570a0b6eac8a562b8fd52d9f0 SHA512 74aaa80812d92bb1527a6af9549b88fac1515ffaefcbdfd8d4985741e2f7fa1f7049a5e38a032d7bb412e86c2e8b6a54d7230b37d6f2b21187847619d46dc75e WHIRLPOOL 4e23a71c97690136f915d347a66d89f40edc31115ef85bafd499301dd94016172e8e4293afd11d31af9d425320cf13cd826d9a34cbba8c451179537bd75434e3
+MISC ChangeLog 2177 SHA256 4885348f6b81036daa64709b9f8dd704a72ff5b8470aeca5bd4de06dbad3a7c9 SHA512 d8d361ad7b20a924076c2c9803d9c670eb33fbbfbee4ea1f3d124300beb7343bc3a57012df5dcd3b25b5eafb8fdb9422730e71ccb96a6232555d1393461f98f0 WHIRLPOOL 1d7e290bcf76727bfba328a21f424d9682c9020b697119f212d60cadb9793b819b186702be54f97693e3c74b9af36dc7388e58c59a3a7656f65367ee76a40db6
+MISC ChangeLog-2015 535 SHA256 d6e41e4d3f8f2b9736fc28e26cdf3e305028d5b385d95c11e7f23a510db8af2b SHA512 ef6d364ce43ed760bb3f7d6f40ff5d5617b3f9129ea3b20480a78e0417f1d28dfe35a6e111d9665f50a0d0bfea3de125a7e2d2c9cd64f8d08735bc5aeb8598a8 WHIRLPOOL 7393febd8f58f204d08048db985b67f04551ecf516d389b1d222912a463e82723e284e44765a895facd66d7b46ed21da5261213027791792907e7bc521fd49f6
+MISC metadata.xml 572 SHA256 21d24c5136eb1945cbf77c6d5f8e90c55570462c5d0a2e586a6910436e4e9cf3 SHA512 6d715221bd0c7975cd9171a4091e3735571ad97bcaf72e3b5800f513268b6199a40d5dd0c854e87ff3a68f6f5ae3e9a689dd511a1dbedcad748c98ba5deb61e7 WHIRLPOOL cfc5dde5935037421929f74c0abfcd1194c6952e0f58f5e2a67869042914568c4fd1d8018955219cd3477c75b3260a8d6987a8fa1e3e7bdeb6016f5282906a5f
diff --git a/dev-db/lmdb++/lmdb++-0.9.14.0.ebuild b/dev-db/lmdb++/lmdb++-0.9.14.0.ebuild
new file mode 100644
index 000000000000..f87e4833db55
--- /dev/null
+++ b/dev-db/lmdb++/lmdb++-0.9.14.0.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/lmdb++/lmdbxx}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="C++11 wrapper for the LMDB database library"
+HOMEPAGE="http://lmdbxx.sourceforge.net/"
+SRC_URI="mirror://sourceforge/lmdbxx/${PV}/${MY_P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-db/lmdb"
+
+src_install() {
+ emake PREFIX="${D}/usr" install
+ dodoc AUTHORS CREDITS INSTALL README TODO UNLICENSE
+}
diff --git a/dev-db/lmdb++/metadata.xml b/dev-db/lmdb++/metadata.xml
new file mode 100644
index 000000000000..40459a804d71
--- /dev/null
+++ b/dev-db/lmdb++/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>nicolasbock@gentoo.org</email>
+ <name>Nicolas Bock</name>
+ </maintainer>
+ <longdescription lang="en">
+ This is a comprehensive C++ wrapper for the LMDB embedded database
+ library, offering both an error-checked procedural interface and an
+ object-oriented resource interface with RAII semantics.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">lmdbxx</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/lmdb/Manifest b/dev-db/lmdb/Manifest
new file mode 100644
index 000000000000..3cfc223e2d26
--- /dev/null
+++ b/dev-db/lmdb/Manifest
@@ -0,0 +1,7 @@
+DIST LMDB_0.9.18.tar.gz 139156 SHA256 dd35b471d6eea84f48f2feece13d121abf59ef255308b8624a36223ffbdf9989 SHA512 394e88d99d446eb30771d7cf7a661584683a0d6d8e976cc561b5eecbb2a5d0817bbd59994002afa4eae6c86a39f05f50ebc2eff77cd70dd8c67225df4611f5e6 WHIRLPOOL 067fdb080edfc338885358c5cfef39a6ca9cdab8f49fd0f62bc68005e1f7dac9cd69fc87d130cf19f818906d090b906ea8b9716440358f33982e96e91ae4c049
+DIST LMDB_0.9.19.tar.gz 143141 SHA256 108532fb94c6f227558d45be3f3347b52539f0f58290a7bb31ec06c462d05326 SHA512 1d9825f09592ad92a540a1dec232cf6649f41cc67b0d59dc8958a71f4090f347c84995f32a166e2c2efecb862981f455814dd07af99bc3489e42fe3fd8bc6191 WHIRLPOOL 968546a1ba458c9686353a4f497c070fd2f01087de68e91d92ae98aae9e371871d90a03645cd35d40208d670bfe5113144038739db8b53f5a9b7ec1b5ec13b75
+EBUILD lmdb-0.9.18.ebuild 1247 SHA256 66384181376e4ecf948286bea0be4eea5d389cc427441afc5876ed609682215f SHA512 b75fb4c52e5128665f29e6e0fbf977c1c01f55f56dcb9322888d8fcb25b07b1b32e6a9f337d2bf768a2a982a82d25872ed8617822d718d818cd832c26949e936 WHIRLPOOL 01cfd89509a807fad6c45f172052225a17f2913a4c2ca751fd7b245258e3dc36174d0fd85558900588e0e03e2591807ef0306aef1c49499083722f41ec38cd63
+EBUILD lmdb-0.9.19.ebuild 1754 SHA256 63411754ee3c0796fe845d465bb4ffed4a8a44a5bdcc342a864d0633fda79dc0 SHA512 92d6c497f1b60fda20edb7bfec617611b7310d0b008a6cb6253dd89fbbabc8a833ce2c0403922e1503714237b972e699e9994788277fecd1bb174664c366735f WHIRLPOOL 47193e85d94af70c4772647f77f2862cdc1efd96ad443b27c82c034af5383bd95fa03959be475d83394e417b34f29ee4e2ebe08245af869d672ab76c2ffffdff
+MISC ChangeLog 6409 SHA256 10e2bcf22a5d662da0fb1724ee9bcce2bb0dc2e6f8a5d2f2dd5f387d0bcf0a63 SHA512 a762689de509be2fbee0f18eb022ccd4da64bbdb669dcbf32d05db76f330ab41f34c153cdc5b930a7f15a07f0e871a16bf31a5e29dbb0370e6fe917c54800495 WHIRLPOOL 77ced34b779fcc62c354bec652e57487c37dba2b624d97b6e397752249a91e5b9e53d0722ed6dcbac9fd40de1b9597a61748d0177bf90f400063e260252be91a
+MISC ChangeLog-2015 2969 SHA256 c8be453c72fed6218ec06e0110e0ae0e4f0d2f1b7013075f791d687667f4b946 SHA512 2601794579e2081d9727ebef3f6af9f1e7a1f99683537a896149fde1d81c54a35279a9f6451e4b166daa0a74617d4bec9051011749f65882dee8311c5940cc1d WHIRLPOOL 5e11dddc945ecd8d212d33c3facb037714f5098c43072bb6324aef7bc5db47291eb6faa5fe2b0c401a3c13a64f2c6584c91c9e254b0cd2bf557f336908c60bb5
+MISC metadata.xml 540 SHA256 61eb9f33306e258f3c4e432818e0c17113d38e847d9e90026cbf490075c2bccc SHA512 7ff1fddaca73c5d7b4a6a9ada9a7aad60e16c8c7063ad5cd9cf57301f504f6e0fe53bf568dec83abf522c2c099d2b3b2463619df17077ebaa3b39bd67bd738c4 WHIRLPOOL c412ead07298b9f6996feec6851deab4b97222105543256ff93ea5836babe61627c88ac92f68b66b3a7ea84a48b4f84e3fd975c6cb4a77afdbbe2f581f4fa902
diff --git a/dev-db/lmdb/lmdb-0.9.18.ebuild b/dev-db/lmdb/lmdb-0.9.18.ebuild
new file mode 100644
index 000000000000..6071b64f9718
--- /dev/null
+++ b/dev-db/lmdb/lmdb-0.9.18.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="An ultra-fast, ultra-compact key-value embedded data store"
+HOMEPAGE="http://symas.com/mdb/"
+SRC_URI="https://github.com/LMDB/lmdb/archive/LMDB_${PV}.tar.gz"
+
+LICENSE="OPENLDAP"
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="static-libs"
+
+DEPEND=""
+# =net-nds/openldap-2.4.40 installs lmdb files.
+RDEPEND="!=net-nds/openldap-2.4.40"
+
+S="${WORKDIR}/${PN}-LMDB_${PV}/libraries/liblmdb"
+
+src_prepare() {
+ sed -i -e "s!^CC.*!CC = $(tc-getCC)!" \
+ -e "s!^CFLAGS.*!CFLAGS = ${CFLAGS}!" \
+ -e "s!^AR.*!AR = $(tc-getAR)!" \
+ -e "/^prefix/s!/usr/local!${EPREFIX}/usr!" \
+ -e "/^libdir/s!lib\$!$(get_libdir)!" \
+ -e "s!shared!shared -Wl,-soname,liblmdb.so.0!" \
+ "${S}/Makefile" || die
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ emake LDLIBS+=" -pthread"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ mv "${ED}"usr/$(get_libdir)/liblmdb.so{,.0} || die
+ dosym liblmdb.so.0 /usr/$(get_libdir)/liblmdb.so
+
+ use static-libs || rm "${ED}"usr/$(get_libdir)/liblmdb.a || die
+}
diff --git a/dev-db/lmdb/lmdb-0.9.19.ebuild b/dev-db/lmdb/lmdb-0.9.19.ebuild
new file mode 100644
index 000000000000..c4452f3a228f
--- /dev/null
+++ b/dev-db/lmdb/lmdb-0.9.19.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit toolchain-funcs flag-o-matic multilib
+
+DESCRIPTION="An ultra-fast, ultra-compact key-value embedded data store"
+HOMEPAGE="http://symas.com/mdb/"
+SRC_URI="https://github.com/LMDB/lmdb/archive/LMDB_${PV}.tar.gz"
+
+LICENSE="OPENLDAP"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+DEPEND=""
+# =net-nds/openldap-2.4.40 installs lmdb files.
+RDEPEND="!=net-nds/openldap-2.4.40"
+
+S="${WORKDIR}/${PN}-LMDB_${PV}/libraries/liblmdb"
+
+src_prepare() {
+ local soname="-Wl,-soname,liblmdb$(get_libname 0)"
+ [[ ${CHOST} == *-darwin* ]] && \
+ soname="-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/liblmdb$(get_libname 0)"
+ sed -i -e "s!^CC.*!CC = $(tc-getCC)!" \
+ -e "s!^CFLAGS.*!CFLAGS = ${CFLAGS}!" \
+ -e "s!^AR.*!AR = $(tc-getAR)!" \
+ -e "s!^SOEXT.*!SOEXT = $(get_libname)!" \
+ -e "/^prefix/s!/usr/local!${EPREFIX}/usr!" \
+ -e "/^libdir/s!lib\$!$(get_libdir)!" \
+ -e "s!shared!shared ${soname}!" \
+ "${S}/Makefile" || die
+ eapply_user
+}
+
+src_configure() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ # ensure sigwait has a second sig argument
+ append-cppflags -D_POSIX_PTHREAD_SEMANTICS
+ fi
+}
+
+src_compile() {
+ emake LDLIBS+=" -pthread"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ mv "${ED}"usr/$(get_libdir)/liblmdb$(get_libname) \
+ "${ED}"usr/$(get_libdir)/liblmdb$(get_libname 0) || die
+ dosym liblmdb$(get_libname 0) /usr/$(get_libdir)/liblmdb$(get_libname)
+
+ use static-libs || rm "${ED}"usr/$(get_libdir)/liblmdb.a || die
+}
diff --git a/dev-db/lmdb/metadata.xml b/dev-db/lmdb/metadata.xml
new file mode 100644
index 000000000000..160bf60c274e
--- /dev/null
+++ b/dev-db/lmdb/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ An ultra-fast, ultra-compact key-value embedded data store
+</longdescription>
+ <maintainer type="person">
+ <email>eras@gentoo.org</email>
+ <name>Eray Aslan</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>ldap-bugs@gentoo.org</email>
+ <name>Gentoo LDAP Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">LMDB/lmdb</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/m17n-contrib/Manifest b/dev-db/m17n-contrib/Manifest
new file mode 100644
index 000000000000..3fdcbabf04ce
--- /dev/null
+++ b/dev-db/m17n-contrib/Manifest
@@ -0,0 +1,7 @@
+DIST m17n-contrib-1.1.13.tar.gz 697293 SHA256 adcf708ea7abd651b4a72562059b4b2408b9729527330a28f1a467168d27de6c SHA512 09b04315162b197bbada94e4213108a7b02e2349e519e311b545faefcb057f0bd5345a18f8eb3e9bb96843c2e8f04f56685e0347ede0ccade1b79caf459cb945 WHIRLPOOL e1bdcf80b41bcacc4717e4c5a364c10c0e857e14528420f3537ed7d76d4ae28daedb98e023433fa192cb78169c1cbdb2d38fd3691f7e5ad7798c5e858ce158b6
+DIST m17n-contrib-1.1.14.tar.gz 698611 SHA256 4f623be23979e2d52c1275621b3d4488c24b9fbd81f5a9d28260d88f93d23d2c SHA512 569149dc4318e033ecde347cd9f935b6e18fefdd8f24d8a447aed3f754a920cec53b5f7a806d93032a45c05a346076c38a3a5b6398cf4caadc7db0e52baf5ced WHIRLPOOL be907582d6774dcc48a94c2bd689dd19a01ffa456cd22728dcdd4ba3b340daa093eca7890b32f88b38e570d9c5b7316e7c7552f547199ff1efd687801549d088
+EBUILD m17n-contrib-1.1.13.ebuild 362 SHA256 8dd1ec3a83b20a24d353ef03eefe7ed95466f972db14dcb108959653be20731c SHA512 4110c884914a3659b49e4183c043ba66c17dd4e500b80e12187a5240c90a775b35b55dbd8c081b7d6785762283db475763149b13db922f3d6766fcdde78c4d4c WHIRLPOOL f94f0f925a1dcd41ada4852d1b8959b3a4d2ec2d76d6573a289128f00ed1476996efd5d0b98dff5c14f6c8cc243bc23777c1f7ee05e7f0d60deb677cdc64a3f5
+EBUILD m17n-contrib-1.1.14.ebuild 362 SHA256 35c8ac82b7b5a428f6017a20a43355a12153c414d15ae6ba581976c9abdcc3b6 SHA512 49099dff373faa9405679b071b38ff4b309296ff33bf6fd6aaf30d4eb1427adc8f1158ee0dd42af30a30794174fb06a94cab1f2779ab39689732805ecf4fa1cf WHIRLPOOL 83c4cd86451a738c618d120311f5ecc15fc7753f1ac42067755ff9a60a7f6c97ac2dc59c9f4af99671b3f690186b8bb7df2ccbcbd4890c264b8ac6070cae66a1
+MISC ChangeLog 2899 SHA256 8a8d9f6715c3836084e8b6e565bb12968c76a9ff17af393e9b7973157256a5ed SHA512 83170952f19ca9f3071fe44458926de15300af05ebeccb865b80ed399d5555e6d8bce63a17f685b3debd328b7300f60eb150619384ae341b9ddaca46b4822e99 WHIRLPOOL 448e61006af55a92c9f786322c5f813097a336e119fdd0c632477e9866e8ff8932b32a81d905bbc3149bbeff81ce5bf4f5d036967a8ae94ee455fe88f193ca21
+MISC ChangeLog-2015 2391 SHA256 8f0379603cc192030f11a70d4c5992923258dc94e6d3500df8841ded42ed28e0 SHA512 549ef609f1980b86f961bb159861ea42b425d11f4d7f3b1106f95cfaffde8baebf7a5c9b90ce40d2d12bf680feef67e1dc65fecd138ff223f6ba92019f77750f WHIRLPOOL aac52f666f5520bda188734767b745629925ab03f1ce1767ac07a714801df133c2a443bd38d1c02669b62e7f511809b10a7c3ede5cb5ff5bccc301bb8cce9176
+MISC metadata.xml 365 SHA256 5eb4ab4318e3d56daac89d886db15df9830481f3041e330bf6fb8a6373c45bca SHA512 e272f7633a6e09ec16bb0662076759674cbb5cdf00a4455c430450d480f3e6b9067aa560679686c51f6980508e5851f326888b238b3668f07f23ee98ee688466 WHIRLPOOL f7e6dec3f823368fa40d5e74aca81cc35393dc00e4a87abccd55a9a1d29493b44f7fb1ce9afd5d06af1712df1b3f9ef059826dc6cb91b1fa3abe96ca812e7233
diff --git a/dev-db/m17n-contrib/m17n-contrib-1.1.13.ebuild b/dev-db/m17n-contrib/m17n-contrib-1.1.13.ebuild
new file mode 100644
index 000000000000..44db8e9237f3
--- /dev/null
+++ b/dev-db/m17n-contrib/m17n-contrib-1.1.13.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Contribution database for the m17n library"
+HOMEPAGE="https://savannah.nongnu.org/projects/m17n"
+SRC_URI="mirror://nongnu/m17n/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="~dev-db/m17n-db-1.6.3"
diff --git a/dev-db/m17n-contrib/m17n-contrib-1.1.14.ebuild b/dev-db/m17n-contrib/m17n-contrib-1.1.14.ebuild
new file mode 100644
index 000000000000..fa435afbe24c
--- /dev/null
+++ b/dev-db/m17n-contrib/m17n-contrib-1.1.14.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Contribution database for the m17n library"
+HOMEPAGE="https://savannah.nongnu.org/projects/m17n"
+SRC_URI="mirror://nongnu/m17n/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="~dev-db/m17n-db-1.6.4"
diff --git a/dev-db/m17n-contrib/metadata.xml b/dev-db/m17n-contrib/metadata.xml
new file mode 100644
index 000000000000..8007e041859b
--- /dev/null
+++ b/dev-db/m17n-contrib/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+</maintainer>
+<longdescription lang="en">
+The m17n-contrib is a collection of contributed works to be used with the m17n library.
+</longdescription>
+</pkgmetadata>
diff --git a/dev-db/m17n-db/Manifest b/dev-db/m17n-db/Manifest
new file mode 100644
index 000000000000..58cd03131ed1
--- /dev/null
+++ b/dev-db/m17n-db/Manifest
@@ -0,0 +1,9 @@
+DIST m17n-db-1.6.3.tar.gz 1384587 SHA256 5f1d11b43efa4c1fcc9681d0c0e13f8d241450625f34351a9deb2a7194cac211 SHA512 4a808b7f8298b9c15c479e7e2dbe26dfe39b0756da5f7a5f968700950d5e41527ce935bc6ced6e65d5e0d57c5f8402dba7f6001144f805129def8237d272625f WHIRLPOOL 55657e6fdc47da30de6ec9094b27b861d37b74a65a5d25b5dcd3ccc94a1057692442cdc40f68b0e67e893688aa5eb6fffa8f118d158d3518ae188638c3a26fdc
+DIST m17n-db-1.6.4.tar.gz 1390344 SHA256 530ecb1615a9a64d4caca9ffc59c0dd1c551d34e0c19e39694d083db0506d017 SHA512 54016284335630fca5403e540863aaff5f135429c5716c35404fc38d40544c03a213ad26af5ea7eb82567b11f4645608f66cde95036187e6e23ce0dae17e2324 WHIRLPOOL 9eb0d78319b46864f8d7bec05d30299c798153416ac912119f487990fe26540554d41b89cb06ec427161102b8b312a48ff224adcf6e8c2c5268cef00796d1767
+DIST m17n-db-1.7.0.tar.gz 1939608 SHA256 a2ba9f80161433d5c06e57915a9cd51f26c6df4a8909723f952cdbb9b48508f0 SHA512 02c3cb347e9f5c840a723de9ed85be84fc9fb5f86d4963f0d1c6b669045d37d10e5efcf5ac0e0c3cb7249fb391b0dd32bd50fbc3332455aaf0b49d96fc09b2f2 WHIRLPOOL 821071ea60a947526cd92661b9246732379cc924cae0a0a21e141a0cb3e59834633bec20e0ae01a9c66529f09bf9353696f96f2dde4120b2742fdf6ed338e4f8
+EBUILD m17n-db-1.6.3.ebuild 507 SHA256 d533ef17a97415bac97d66d9b86a9e58b9ed539982be0be54b5985416110a44f SHA512 260a94b0e5fe3b506e9f4c667fa4ea065656c1308b2166e00f253761e479ccf99fad689e1ca6175b822ecb9b4b9b75179441e634d91002ca12144b3071ac6b5f WHIRLPOOL d2d0b2a6ebe98a2f7d7b89f9ce1ede12cb637e556162ed369805e4c393765b99c5d3d06ea0386f60dc10a84959826a5e66e3282cfbe84c0b2113a215e44fa8d4
+EBUILD m17n-db-1.6.4.ebuild 514 SHA256 1ca2f615f4f4a2b781e85d05466766e8fd02c5590c5ccfb796bb7466ff8e07be SHA512 96e7e70c793b1ce424bbaf62b465d9a8bcc53c0357bb4a3663a86581e0fb45926c3f13c684ec049361f0a047d2bdf70928177e984220e87dc93e3dc717a382dd WHIRLPOOL e108c343d4e1b8c111951b19550594cf19087d26afdbb9e90c9b0c55a996876a74ddbf83e0991fcc6937f213b51f65a136be6ccd3d3d3d7945f8da63b8e501a7
+EBUILD m17n-db-1.7.0.ebuild 546 SHA256 d2d8b13188363560516a26f6f2bf1ddb9d5e6c79a1b58191f699b0e4126b90a4 SHA512 b1be16118d2e6c42fcd855489b40dad4179a2fcf77a13136debfadb316edf6ddaddfc16d2bf3482cdbbe93011ca4ee56bb2153dc9616208bcbe7b3f69abd70a8 WHIRLPOOL b18b9882e3f39353203145f2ca2e6b8f7ae6dc7293483e884857525708db1f32e96e278d24511aa2f5e376515484b8cd46512ddccf9effcb0d1ced2128c0ea84
+MISC ChangeLog 2683 SHA256 ebd6c23bf3f78ebe13ad1da5afac8ee0a5c49e0948b9eae1a6641a9ef661fd8c SHA512 604f1af9bdd07190fd89339cd073f51a483e29c9c9679454b820a11209876c819f6cafede313372531038b5efc44f32a9572d98cab5532ad779a6061436739e2 WHIRLPOOL 5982919ad90614ff799698282c2aba9e2f957f65034b1987a78a7bf092b7e6ab7076750697a23b5900abc4673f1d020063e7f6fce26c578e72ff6430379a2082
+MISC ChangeLog-2015 7585 SHA256 a4b55a0d559ffa34e7a483b36fb4c9592c2707b3ee48c2ff240dc3cd9f1f4aa3 SHA512 2d7e9223783594d680629e123b5f6ef209d21481e9648e1eafa1ed9fc6039631d8ad7a92fcd39334739aaaf163402e7aa782f5368d64f311ac02371dc850a44a WHIRLPOOL c40f58356cdb3dd59e0ac1997c9dd26607a795fbd8e270e90033142b60323f0e3b26bc9818040a9fff290eb88c455822b2fb905dc32030dfbf3e16642cda940a
+MISC metadata.xml 240 SHA256 4351b96b5a18595fae67161f1207f22bbf99e9a2235b95b68975cfc9f5baff54 SHA512 12aaa73d9b690de68a5c7b20e214ceb099efa87884b784eafd994f26032b44dcb66e7feac8a5b1df7f349ac05c5a198a7593dff2cc686de158cb21e4c54f38dd WHIRLPOOL d279940dd88c4b1caa478907576d5732c8376e3f99830950c6c18c63dca78c7d0ec1983660e5cbd4da0133b961ef38dc8460650cb48467298542e04005cffc2c
diff --git a/dev-db/m17n-db/m17n-db-1.6.3.ebuild b/dev-db/m17n-db/m17n-db-1.6.3.ebuild
new file mode 100644
index 000000000000..7a14bf3921e9
--- /dev/null
+++ b/dev-db/m17n-db/m17n-db-1.6.3.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Database for the m17n library"
+HOMEPAGE="https://savannah.nongnu.org/projects/m17n"
+SRC_URI="mirror://nongnu/m17n/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"
+IUSE=""
+
+DEPEND="sys-devel/gettext"
+RDEPEND="virtual/libintl"
+
+src_install() {
+ default
+
+ docinto FORMATS
+ dodoc FORMATS/*
+
+ docinto UNIDATA
+ dodoc UNIDATA/*
+}
diff --git a/dev-db/m17n-db/m17n-db-1.6.4.ebuild b/dev-db/m17n-db/m17n-db-1.6.4.ebuild
new file mode 100644
index 000000000000..68c3d2fe9f5e
--- /dev/null
+++ b/dev-db/m17n-db/m17n-db-1.6.4.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Database for the m17n library"
+HOMEPAGE="https://savannah.nongnu.org/projects/m17n"
+SRC_URI="mirror://nongnu/m17n/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sh sparc x86"
+IUSE=""
+
+DEPEND="sys-devel/gettext"
+RDEPEND="virtual/libintl"
+
+src_install() {
+ default
+
+ docinto FORMATS
+ dodoc FORMATS/*
+
+ docinto UNIDATA
+ dodoc UNIDATA/*
+}
diff --git a/dev-db/m17n-db/m17n-db-1.7.0.ebuild b/dev-db/m17n-db/m17n-db-1.7.0.ebuild
new file mode 100644
index 000000000000..fc63f861b9a6
--- /dev/null
+++ b/dev-db/m17n-db/m17n-db-1.7.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Database for the m17n library"
+HOMEPAGE="https://savannah.nongnu.org/projects/m17n"
+SRC_URI="mirror://nongnu/m17n/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
+
+DEPEND="sys-devel/gettext"
+RDEPEND="!dev-db/m17n-contrib
+ virtual/libintl"
+
+src_install() {
+ default
+
+ docinto FORMATS
+ dodoc FORMATS/*
+
+ docinto UNIDATA
+ dodoc UNIDATA/*
+}
diff --git a/dev-db/m17n-db/metadata.xml b/dev-db/m17n-db/metadata.xml
new file mode 100644
index 000000000000..e1a49f498885
--- /dev/null
+++ b/dev-db/m17n-db/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/maatkit/Manifest b/dev-db/maatkit/Manifest
new file mode 100644
index 000000000000..b8c911e04ed7
--- /dev/null
+++ b/dev-db/maatkit/Manifest
@@ -0,0 +1,5 @@
+DIST maatkit-7540.tar.gz 1312812 SHA256 618b8ba8f8df1c8ac04d127986a7bb6a834643523000c9c5ea4ee7d95aeef9a8 SHA512 98cb44a5ebce09322b4d9a8cfa9e14e2ccb54ef9e0e8a95ee92b0fee5277f06157415152566497893488967735049d95c6efadc0d57c8a70060c7bc714afef9a WHIRLPOOL 73685d156a750263ec8d8ba6d22c6e96aa98ed2247523b74a336572ef8e6ae8239f84dd2e7839752c921baca55d911195c0bb1e83d42a87b3a721fa7d0e8439d
+EBUILD maatkit-7540-r1.ebuild 2648 SHA256 3f2c18dee8774e27a2fca1e46c1c9163e6fe6aad5852e48a7c7f005f8382be6e SHA512 50bb20b8ed8f7cfe42e672c43803f62cc97756fd268be02e6166e7b184cf2671e8447aa7f12ec29c71872a493fa2b807318faaf62fa1ea94a95aa652bfef33eb WHIRLPOOL 42dd306861048b6b5f458d535ca37b56a5d0325d977169117e70d01ff476a88479491756f90f24172db873a47cd65b03a1ab81093d077b237f4357af9fd7673d
+MISC ChangeLog 2343 SHA256 3c4fb1ae266bc8b652af7f6f36db444545e3934201e7a088178ac6a5840ed700 SHA512 2a02eda8fb258cb0ba272664a76138fa525bcf3c2516e3494387361d59a487e8a033e4bacbd87685acad38a5b364936e16b3ea6fd72d781fcfb3c0598acca170 WHIRLPOOL 229120cb2692aeed1440b0b60ac9b54cb07fa8626df0b09c18984397adaa34394f00b7ca2bdc72ad7d302d301d4eebf214b803ccb05eb6f5df06c547322c56f0
+MISC ChangeLog-2015 4123 SHA256 d1d14f33b16a5b55bdc16f89e261c47471b1b19abc7ce84bf1fe546808d644b5 SHA512 0b9518660d90bda68b4190614a27eb126630ae44119c5fd1a2e4ee9aa4ead33069f1bca8dd589b41a97dfac5df4465b08a6ab7ecc4eeb64ffc3e1f8537e291bf WHIRLPOOL 5be85f36560449bb2c191ff6704a88d76bfce701986382cbd56878c2ec35adfe44590545cd397237f46deb1e1262eff7e680e5fa5cecaeee0551f849c32a46a6
+MISC metadata.xml 775 SHA256 dcc598a66aa7a1ed87b005aacaf7ff9387997e80acddfeb38915ce165b587735 SHA512 280bda9b191976c9b96f2916c93f2d3b29fdcdffe25c2465246d4752023d0c640660206447e9d20922e627e3d789e030f41f4750642ff2f5fffce07f3d59db4a WHIRLPOOL f6d6a61a02ece2b2a7b4c37051784ef0d384db67fc4f0518daae3fec82458029ed89b381480fc5d2d184159e2929d2929d9f645fb73829071cfb24613789b805
diff --git a/dev-db/maatkit/maatkit-7540-r1.ebuild b/dev-db/maatkit/maatkit-7540-r1.ebuild
new file mode 100644
index 000000000000..9cefb50cea68
--- /dev/null
+++ b/dev-db/maatkit/maatkit-7540-r1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit perl-app perl-module toolchain-funcs
+
+DESCRIPTION="essential command-line utilities for MySQL"
+HOMEPAGE="http://www.maatkit.org/"
+SRC_URI="https://maatkit.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="udf"
+
+COMMON_DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ virtual/perl-Time-HiRes"
+RDEPEND="${COMMON_DEPEND}
+ virtual/perl-Getopt-Long
+ virtual/perl-Time-Local
+ virtual/perl-Digest-MD5
+ virtual/perl-IO-Compress
+ virtual/perl-File-Temp
+ virtual/perl-File-Spec
+ virtual/perl-Time-HiRes
+ virtual/perl-Scalar-List-Utils
+ dev-perl/TermReadKey"
+DEPEND="${COMMON_DEPEND}
+ udf? ( dev-db/mysql )
+ virtual/perl-ExtUtils-MakeMaker"
+
+mysql-udf_src_compile() {
+ local udfdir="${T}/udf/"
+ mkdir -p "${udfdir}"
+
+ local udfname udffile udfext udfoutpath
+ udfname="${1}"
+ udfext=".so"
+ udffile="${udfname}${udfext}"
+ udfoutpath="${udfdir}/${udffile}"
+ shift
+ CXX="$(tc-getCXX)"
+ local src="$@"
+ if [ -z "$@" ]; then
+ src="${udfname}.cc"
+ fi
+ for f in ${src} ; do
+ [ -f "${f}" ] || \
+ die "UDF ${udfname}: Cannot find source file ${f} to compile"
+ done
+ einfo "UDF ${udfname}: compiling from ${src}"
+ ${CXX} \
+ ${CXXFLAGS} -I/usr/include/mysql \
+ ${LDFLAGS} -fPIC -shared -o "${udfoutpath}" $src \
+ || die "UDF ${udfname}: Failed to compile"
+}
+
+mysql-udf_src_install() {
+ local udfdir="${T}/udf/"
+ local udfname udfext udffile udfoutpath
+ udfname="${1}"
+ udfext=".so"
+ udffile="${udfname}${udfext}"
+ udfoutpath="${udfdir}/${udffile}"
+ insinto /usr/$(get_libdir)/mysql/plugins
+ doins "${udfoutpath}"
+}
+
+udf_done_intro=0
+mysql-udf_pkg_postinst() {
+ local udfname udffile udfext udffunc udfreturn
+ udfname="${1}"
+ udfext=".so"
+ udffile="${udfname}${udfext}"
+ udffunc="${2}"
+ udfreturn="${3}"
+ if [ ${udf_done_intro} -eq 0 ]; then
+ elog "To use the UDFs that were built:"
+ elog "Update your configuration to include 'plugin_dir=/usr/$(get_libdir)/mysql/plugins'"
+ elog "Issue the following commands as a user with FUNCTION privileges:"
+ udf_done_intro=1
+ fi
+ elog "CREATE FUNCTION ${udffunc} RETURNS ${udfreturn} SONAME '${udffile}'"
+}
+
+src_compile() {
+ perl-app_src_compile
+ if use udf; then
+ cd "${S}"/udf
+ mysql-udf_src_compile murmur_udf
+ mysql-udf_src_compile fnv_udf
+ fi
+}
+
+src_install() {
+ perl-module_src_install
+ if use udf; then
+ mysql-udf_src_install murmur_udf
+ mysql-udf_src_install fnv_udf
+ fi
+}
+
+pkg_postinst() {
+ if use udf; then
+ mysql-udf_pkg_postinst murmur_udf murmur_hash INTEGER
+ mysql-udf_pkg_postinst fnv_udf fnv_64 INTEGER
+ fi
+}
diff --git a/dev-db/maatkit/metadata.xml b/dev-db/maatkit/metadata.xml
new file mode 100644
index 000000000000..0e4bad3f0f4f
--- /dev/null
+++ b/dev-db/maatkit/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ </maintainer>
+ <longdescription>maatkit, formerly MySQL Toolkit, is a collection of command-line utilities that
+provide missing functionality for MySQL. Some of the tools implement lacking
+server functionality, such as online consistency checks for master/slave
+replication; others are client-side utilities such as a query profiler.</longdescription>
+ <use>
+ <flag name="udf">Build the MySQL UDFs shipped with maatkit, requires non-minimal MySQL</flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">maatkit</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mariadb-galera/Manifest b/dev-db/mariadb-galera/Manifest
new file mode 100644
index 000000000000..94dc1d210c7f
--- /dev/null
+++ b/dev-db/mariadb-galera/Manifest
@@ -0,0 +1,8 @@
+AUX my.cnf-5.5 5244 SHA256 29df6af222caeb4942fd37ca1f250c8f4b8aa4353c067928a07a18caf4b59fc6 SHA512 c20420fb498ba2c3db7973848fe8cf715815e15ccc315a57e4ab9cea3c8778def0e66cef8253870dc94c92903e04dd0c7037c12894b37e8cfd70f0c3822ee65e WHIRLPOOL 7f2a2f778339d06c5374b4e8a9fc467d0a7eb4d987eb804dd4d7c6d459d9e6133d148c0e18a6efdab90578aa70f23318d8308af4d7bd39fc34e989f401cc3dd9
+AUX my.cnf-5.6 5144 SHA256 31808dcb896583e36231eedd994fb9fb23e48bc7a3089d33aa1f34371bd0ceea SHA512 db4bdde6f82d9bd33026477d89d8191ddc4099586273ca4aa3f2dcd09572f887d03f79c2ce00bf74d01c21a18384b05516982bdcf31a6c458631315ea75c4cab WHIRLPOOL b3f758d3677acd17ba7265baf89f79d84b0d087124cafb02c34ac709f88c90acbe3e6f228179243b4adcc19b1ad6d3ce051cd05975ccae76e276e81a231d0f02
+DIST mariadb-galera-10.0.32.tar.gz 63961466 SHA256 a471406b5c122d01760f868b3137ef53c21b36daa10591c6158076b55a7669fb SHA512 3f17c4baaa06a51e037c96bc9a44fb612d6e492f9212664a7b9b7a70be49e7657626cd10b89ec312d4062ddf44bbc1d2ca6b044269af0507669e86bdc683fabb WHIRLPOOL a70661e8495cd8806fac45025f54d418d3c37f8e0f5ccc966a6cc3491a6af58750acfd119bd3e1dedd4c468763dc15cf9909ea4c843a97835dc0fa8babf978a6
+DIST mysql-extras-20160629-1442Z.tar.bz2 299152 SHA256 c90979db927772468f8b398c640469ff4740f950068e740c04ff60500e714766 SHA512 1de46daf6b4534dadf9d3eff8d5d557778e63b5e04aedb57fe56d3016ba93a9d55d80faee38f77852d23da5169879e4f25b3386abe44ee8d961db7ffc4145715 WHIRLPOOL d8c94e4e43e772307d8d137a28e18991fa24a27b1587ec19ae5bd12c733cc0931e459092de2c43216776e3284c7c416d52030fe20c98a6439388507c5fe5111f
+EBUILD mariadb-galera-10.0.32.ebuild 5474 SHA256 f0cd57e679932602f9e0258ac7691509f118ba4985aab364cacf64ea42fe8daa SHA512 bd885311ad0fc0826ffe93b57042890a522769055c069ba1797c9e71a065835ea827ec3bcc2205b518f611c60bbe06aafc9b6571681fdc2d9f19e19263e98494 WHIRLPOOL bf8d98e9de9db0b25c210fc2d18d052548015e55cae0e60dc5d35b3fbedc509f8caf0b4dc8fe82f00745c3c96a2c6e6bae1e09c348e373cba232f96130604bd0
+MISC ChangeLog 5452 SHA256 940d71d613d67482380f6c027ce5e2836d31e1aca1cc098eb440de9133b6e166 SHA512 5bb1b336bcfcbace7fe78a2c4d669208b6925421e992571f7235ed61b853e276df57826382a3480cea2df8eb6372aed403349e944e9c82cce166465a59f644c6 WHIRLPOOL 43b8281c8648b4e71aa28bec154faa067f3e172409d06db1652ce748a37077069fbb32c29f0f42a9befa15d5b716f1e86b9d544659bb60131f9e73d76867f2d9
+MISC ChangeLog-2015 2731 SHA256 3c6b2f3f6424f3d27bd3a8e96303e02a265a93e386f7b783243d2c417a6979b2 SHA512 cbdeb596fdf2a22b6e3bc4344a29ecfa939de2a9a175ee9a9c57cbaca988494cddb67d71a4dfeff3a848c2f4e7bfbda1c3fe4982f8a5005484d9b01377efdd79 WHIRLPOOL 3d2ce00f9a4546e2064b6375cac1fc3538ca8ee6dfc2cbb324e18b948ab824da0aedd4cf8543bf2017773c9e385fe3f0fa5c51afbe2101acc9334ca8f89d15af
+MISC metadata.xml 1848 SHA256 da4bb62353028c2826e735e354d1ddb7d51c43f20b9fe8c61dbfed4d56ebc088 SHA512 57f604c9f265f3b4873b681fda8005a0241bc8474bf966b83209ec56b3de70172a70401f2ac9818068ae79656e78b1dfb13b616f3ddc9254669c1ccdc43749aa WHIRLPOOL 0020d1273f79b0dec24fa2f7cb324f48d2fd81fb2157bffd61881c0fbdf4ff223244cf3bfafe53de68b78d6f978e90bff64ac71f2aa59d20789f25e9d0336aec
diff --git a/dev-db/mariadb-galera/files/my.cnf-5.5 b/dev-db/mariadb-galera/files/my.cnf-5.5
new file mode 100644
index 000000000000..e9a4bcded277
--- /dev/null
+++ b/dev-db/mariadb-galera/files/my.cnf-5.5
@@ -0,0 +1,158 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+# These settings are required for Galera clustering
+#mysql settings
+binlog_format=ROW
+default-storage-engine=innodb
+innodb_autoinc_lock_mode=2
+query_cache_size=0
+query_cache_type=0
+bind-address=0.0.0.0
+# Uncomment this section to activate Galera clustering
+#wsrep_provider=@GENTOO_PORTAGE_EPREFIX@/usr/lib/galera/libgalera_smm.so
+# You should change this name to something meaningful
+#wsrep_cluster_name="my_wsrep_cluster"
+# List all nodes of the cluster including this one
+#wsrep_cluster_address="gcomm://172.16.8.5,172.16.8.6,172.16.8.4"
+#wsrep_sst_method=rsync
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/mariadb-galera/files/my.cnf-5.6 b/dev-db/mariadb-galera/files/my.cnf-5.6
new file mode 100644
index 000000000000..379a2c47049f
--- /dev/null
+++ b/dev-db/mariadb-galera/files/my.cnf-5.6
@@ -0,0 +1,158 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 4M
+table_open_cache = 400
+sort_buffer_size = 512K
+net_buffer_length = 16K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 128M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 48M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+# These settings are required for Galera clustering
+#mysql settings
+binlog_format=ROW
+default-storage-engine=innodb
+innodb_autoinc_lock_mode=2
+query_cache_size=0
+query_cache_type=0
+bind-address=0.0.0.0
+# Uncomment this section to activate Galera clustering
+#wsrep_provider=@GENTOO_PORTAGE_EPREFIX@/usr/lib/galera/libgalera_smm.so
+# You should change this name to something meaningful
+#wsrep_cluster_name="my_wsrep_cluster"
+# List all nodes of the cluster including this one
+#wsrep_cluster_address="gcomm://172.16.8.5,172.16.8.6,172.16.8.4"
+#wsrep_sst_method=rsync
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
+
+[mariadb]
diff --git a/dev-db/mariadb-galera/mariadb-galera-10.0.32.ebuild b/dev-db/mariadb-galera/mariadb-galera-10.0.32.ebuild
new file mode 100644
index 000000000000..61a1c209dde8
--- /dev/null
+++ b/dev-db/mariadb-galera/mariadb-galera-10.0.32.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20160629-1442Z"
+# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number
+WSREP_REVISION="25"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+SERVER_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz"
+MY_SOURCEDIR="${PN%%-galera}-${PV}"
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL with Galera Replication"
+
+IUSE="bindist jdbc odbc oqgraph pam sphinx sst-rsync sst-xtrabackup tokudb xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~amd64 ~x86"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+PATCHES=(
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch"
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-10.0.26.patch"
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch"
+ "${MY_PATCH_DIR}/20018_all_mariadb-galera-10.0.20-without-clientlibs-tools.patch"
+)
+COMMON_DEPEND="
+ !bindist? ( >=sys-libs/readline-4.1:0= )
+ server? (
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ sys-apps/iproute2
+ =sys-cluster/galera-${WSREP_REVISION}*
+ sst-rsync? ( sys-process/lsof )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) )"
+
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DWITHOUT_FEDERATED=1
+ -DWITHOUT_FEDERATEDX=1 )
+ fi
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ $(mysql-cmake_use_plugin oqgraph OQGRAPH)
+ $(mysql-cmake_use_plugin sphinx SPHINX)
+ $(mysql-cmake_use_plugin tokudb TOKUDB)
+ $(mysql-cmake_use_plugin pam AUTH_PAM)
+ -DWITHOUT_CASSANDRA=0
+ $(mysql-cmake_use_plugin extraengine SEQUENCE)
+ $(mysql-cmake_use_plugin extraengine SPIDER)
+ $(mysql-cmake_use_plugin extraengine CONNECT)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITHOUT_MROONGA=1
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+ retstatus_tests=$?
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
diff --git a/dev-db/mariadb-galera/metadata.xml b/dev-db/mariadb-galera/metadata.xml
new file mode 100644
index 000000000000..e62426447b79
--- /dev/null
+++ b/dev-db/mariadb-galera/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+<!--
+Please note that this list is shared between the following packages:
+dev-db/mysql
+dev-db/mariadb
+-->
+<use>
+ <flag name="embedded">Build embedded server (libmysqld)</flag>
+ <flag name="extraengine">Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)</flag>
+ <flag name="jdbc">Enable the CONNECT engine to access foreign databases via JDBC</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
+ <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
+ <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
+ <flag name="oqgraph">Add support for the Open Query GRAPH engine</flag>
+ <flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag>
+ <flag name="profiling">Add support for statement profiling (requires USE=community).</flag>
+ <flag name="server">Build the server program</flag>
+ <flag name="sst-rsync">Add tools needed to support the rsync SST method</flag>
+ <flag name="sst-xtrabackup">Add tools needed to support the xtrabackup and xtrabackup-v2 SST methods</flag>
+ <flag name="systemtap">Build support for profiling and tracing using <pkg>dev-util/systemtap</pkg></flag>
+ <flag name="sphinx">Add suport for the sphinx full-text search engine</flag>
+ <flag name="test">Install upstream testsuites for end use.</flag>
+ <flag name="tokudb">Add support for TokuDB storage engine</flag>
+ <flag name="yassl">Enable SSL connections and crypto functions using the bundled yaSSL</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/mariadb/Manifest b/dev-db/mariadb/Manifest
new file mode 100644
index 000000000000..35affa71282e
--- /dev/null
+++ b/dev-db/mariadb/Manifest
@@ -0,0 +1,31 @@
+AUX my.cnf-10.2 140 SHA256 9efe658334216e175f7d91e1baffe138f3be79a083758ba861f1aeb7a114f197 SHA512 85c650670e364f5f71842d9ab07b59c5de6e26e774e7192102562e56f94ed5f8fbc487cef31c134209c22b72fde38f7f53b7279cead97a8af608436d1ecc8857 WHIRLPOOL db2d0fbebb3dc40cbd43c05bf925f191c1f3745fb17f47429b104fa8ddf3cb24a605936513d2c2164465bc3add318c2bf582363d9f5e48ba500d63fbcbbd49d8
+AUX my.cnf-5.1 4722 SHA256 f1f9f35cb2a002b47b37321064317f6fee16ebff35d6b922f5f0a11d293149a8 SHA512 1b7c0d49cd13e265f1c52afda471e8365f3d679fe724a7dec296683355123f6b2fc7f8dd5c8e195d561f8ba68fcc5078d029b750dbb71d892b1ee828beda5a05 WHIRLPOOL 8c68ae4e308ef4a39c47f8230aa25e7818d7e40143cdea056eb1d81dec2d51b390aa58e06784c0a1fa17c40a400ced061b9fa78ffcb41c1dadd9435d5e6db60b
+AUX my.cnf-5.5 4805 SHA256 cfd7deae0f7be56f3efec8581428892ea614626b19818e938f2deb6b2b098f95 SHA512 2826b9c5d751150e57bf11665d05257fae6e20fb97fae72fdcb460b653bd96198b5cbc94db6bf81c17e36e5554fbcec8dfd717f554b55a5d5d090e17ad49c819 WHIRLPOOL ebcc422085cac9fed9c7d847057bfa9342e49ccacd04771d6d33fa9678e3bfa79357160069b228e102a876192418741705874a55d7a121d8fead4e9b814a6ab6
+AUX my.cnf-5.6 4579 SHA256 118bb51fe3e4af1b45d2403d803bd6afea15f1091586bd7cf9c31fdd5f514c95 SHA512 4a55807a119e847f6aa42c94a3c1761eb819d837a9d71a28afb71e5704195f920a0488d54cbeacbe978590c5f2b1dc9b743127cb9d2aa9e3813db226b5bdc356 WHIRLPOOL ffa3ed22ff8c270fdf5358e255d48cf41e2d4641057155c868dee7370980555ba69ad3d9cf7919025f6a59ae09bb6047fa5e5f388bb9fb39520f55868424238c
+AUX my.cnf.distro-client 637 SHA256 fe72e71376fda41384c1ec95139640ca0fb55f6256b127cfa9a84a277b8cc262 SHA512 85c0b0eb4281b398ca7c010042d69b4306ccebae9838bf7a1ee53c0d6bb12b20f95bcbd3bb359b107b018d456d7bcae8d168757ff34028ce69357ce3f3fbd54e WHIRLPOOL fc4a732069effff2c3079b31ff81c679eda7a5d0f9de0da9fa19fe41b305bd8eaa79228145e7cdf98b06a094f9bee10a2257b0732161eb809cfcedf9178eafda
+AUX my.cnf.distro-server 998 SHA256 30a033609ee26535115f39b1bce07fe7aef6bc31068eaf4d9d977b170d813aec SHA512 d9ab6f7fdfe08e6c242f84410ec680ef6aa6778c4bd55fee67c644e1a7d997446d8ef2129be6fc9833d16fe40cf17e09cdf0cf015f06bb145bbf9cfecb51e882 WHIRLPOOL 2bcede79a4d7c8501061554613951bddf1296a086c6a51c3b0446cc0647160d3c0ea35d35dcf95adb98e555b0ff1d43fc342cd48eb4b8605e426643256eb547e
+DIST mariadb-10.0.29.tar.gz 63385696 SHA256 f5f8da646f7df4b1fb21adb8d2b15e6dfbe1964ceb8cea53207d580a464350f4 SHA512 187c3563e8cb74221505e3e77dbe716a8f3fe53130b304c073105c59f0aededf7285b3fa0d0a60cc2d084323f7d2892dce14d60755c594b20c06864255c2dc9c WHIRLPOOL ef9b20fccf280da2bc65c64081f8b1fb7c1984fd8815da3ee40957fa6f977a415b983ba35cf57ddb0380e273e18039deba93007c2ce7496ec4f3ae2d5554397b
+DIST mariadb-10.0.30.tar.gz 63433598 SHA256 9a2cb7f06ecce1bb64dddc70c484e36507b50b756c110c1d37fa145a13a796bb SHA512 b9f4bdf2b19edc661c80b0c19b09979ad765e6a7f76e038436660d29bc05c2c9882c39f557aa407828ba2917632a9a0f6a96090279912e78f04b54ca2d9f14e7 WHIRLPOOL d109efc6599f457b0a270c62f32115bc0753a5357e88f40023944668c2cfece70f01050fe4773f2bb97ae58c76da15b22031a281aeebaf0512a64bc9ff3f4c37
+DIST mariadb-10.0.32.tar.gz 63567828 SHA256 f7a8d9ba88b01d426f5d69e5044e505e444a5ce73e22c9c50913dade43725936 SHA512 e1ecfc2b819b5ffa72fc0d4131fc9d7b6811919e10f15608830611028746580731c653a6b3eb43c92640cd29716b6278f48d27af5322dd2084f2d5f356e6f628 WHIRLPOOL e39e115d1382dbce432c2e27f85b03c8079dec03fd84fc3a0e1f906cb8ef2f82e2eab719fe2544de2ba8a83c66858d276ca2224e66317ecd7ade2d7a78d00368
+DIST mariadb-10.1.24.tar.gz 61780687 SHA256 b3df99ae5b1ec8cf6cede4cbc4ae3f54ce66464549cba6d56d9ff4d24e4d551e SHA512 0b8d81b53f6866a81f33559ce57ebf956fec3ba25da0bd58c8bee3b2ecc00a6c370340000209d18463f84501d3ba35994b51ef99224616c37cd38d2fc87b73e9 WHIRLPOOL 91261a05e3d8b0cad925c382e0cf9a40fcfd3d35ae320c4a9860db110cb5655d1e1f992f9dea8987e50a07dd4a66aa42c9a3470a7acb3d0d706bcef7bc890122
+DIST mariadb-10.1.26.tar.gz 61887132 SHA256 ba88b1cb9967dea2909938a34ba89373b162b0d83e5c98a0f1c94540156bf73d SHA512 a7505c579728b58eb6a92bdee1f5dfea5c10c8389cb7a31eb99fe2c6bc416593925cf9708d3dec91ede12eb4e232098a0833af2185bdd60bc593c89d255f3c0b WHIRLPOOL 8fe0c23f70b441a1f8d32d1fedcd033443641288ef1a20c49fbedfe6f5da95cb82125faa68f676fd68c441d4bf096101f364e1b3976f54229f5d9d0d10edbe21
+DIST mariadb-10.1.28.tar.gz 67559689 SHA256 292dc8fff420c4bdaf3a2c3381ec3c99292965db2b09de0d7fec414c00032bbd SHA512 ca10d28f6b966719c7488c2b4ba928b65cbe9dc32ccf2a28d29c4d0c2d46ea1c59c3e339230017b317132dcd216925a71769dfba80a7d6321079c74ac41926d8 WHIRLPOOL d8ff24346a9e8ada4a9ec0ea8fd7657ff4972d43347afb7a9d7725293437ba70e0035c365738084b1e4828344861f000bd963260176524da2188c2c3a1389f67
+DIST mariadb-10.2.9.tar.gz 70858881 SHA256 12e0a01c52591ee77cf0f940fe65df024457fa16c70f08c6116048d576096124 SHA512 11ba0913144d7298ffa4c0a0128a3d1525a39b8205ffc580311751cf25a4e86159e46a32d3c8330c4ea028cdd50643eb5381651df654751ca3e4fb3d4698a373 WHIRLPOOL dba0a8dfd5079b314ffc399e116abf8582bdaf51657dfe6e72247ab92da874aca97af4ca27dbcfdca5634c926598a853b7a8ecd8a61fee453c2764085a05b949
+DIST mariadb-5.5.57.tar.gz 45783940 SHA256 5dbde98d7e4a5a1721b6cbed7898b2549a88866247951cf586057975c6cea641 SHA512 5d6350abd6f0ba98326633a36bb7ec67525e34e08cbe43f79c9b30bf0b872b0a8f9f0bfd5f3a4c2800a52d25b9c6f3a3a4a62e0f41574153bbf4b881f5347c71 WHIRLPOOL c2af12fb71b3fcc9989cd2208a44dc81401fe1387ae2d03981fd5d00277d480a35f23bdb8f1564f91b4c345bdb18a610b46ee91f47772ba5de1baf8f808eaec3
+DIST mysql-extras-20160629-1442Z.tar.bz2 299152 SHA256 c90979db927772468f8b398c640469ff4740f950068e740c04ff60500e714766 SHA512 1de46daf6b4534dadf9d3eff8d5d557778e63b5e04aedb57fe56d3016ba93a9d55d80faee38f77852d23da5169879e4f25b3386abe44ee8d961db7ffc4145715 WHIRLPOOL d8c94e4e43e772307d8d137a28e18991fa24a27b1587ec19ae5bd12c733cc0931e459092de2c43216776e3284c7c416d52030fe20c98a6439388507c5fe5111f
+DIST mysql-extras-20160721-1526Z.tar.bz2 301788 SHA256 45198f8adb4a61fdd89a5d3c7966ce2fe9241381510e1f7b93e793502a32dfcb SHA512 c7450039780e4e2684c932ba7c291c1de25dd1a64e4c6e88aa13b790768b4100955f36ae4a3bf983569ea23b43be02da6dad3d5985c1163ec9e8aa91f0efd85d WHIRLPOOL becdf0d4d7b8b5a269246d2fcf1bc09c4313046468b264f07394ae9f1de2f736ad3fff8cad35e544df7a3623688050e6fb9635dfea3876ea082d19cf9fe88927
+DIST mysql-extras-20170310-1426Z.tar.bz2 307052 SHA256 23f5becec389fc49e7cf0d52c6c914cbc8d7e3fc5851ee38881ee6884ffc5732 SHA512 2dbb3e46f14fbd0be9ee0e3a8ff2e4d5325f9a9be332014ea556283c0bc5f53349952d267d6713fac5b54e3167a66ddd36f18b18b79ca6b68ede399399488157 WHIRLPOOL 9f459d9e58938597e7919b29fc819d87920a51461d274bf87520fe322a67ad8638ef19212855ba8e37507d3b160d29ecad0099f4632f078cc503e1be0f809fb4
+DIST mysql-extras-20170316-1355Z.tar.bz2 308933 SHA256 ebcb4f03413ccf42877558ad365db01bbb5ef2e12620a9be479ffc2514d9830e SHA512 5bf7938bfa5989da85216fbca4575397fc05c83e1afac76bd6c0b338a876caf37194f53a2a933d6f69eb31727ca005be617e53a8fdd0a95d8f1f68684c4ba68c WHIRLPOOL 701871ff554970adef8e5eb1e2e966a09c4b59ac7931df125f78a4fcfa415e87767184a9d3418013d27410ad0482673942f1df48d5e5de68917f49e1efa96689
+DIST mysql-extras-20170830-1210Z.tar.bz2 312079 SHA256 eda0090fb448e22a004e334956278a887843a3b2bf3ed523b80dd4691d4729d4 SHA512 55553de3bb93b09c29ff411c135ff2762edad3498d9e8fb844df349ce8ab864969668f2bbc3ba99e2217cc20f1c9155443794c301ca064d09a1b45ddead567c8 WHIRLPOOL 961073913064ad3f4decf4221bd9f87fd8bd6349c3e13c1c799e5622b9f2353a2981d2577c5a00c026ac006c03a1c609f4527c2d9027610214d2e79bc5be0669
+DIST mysql-extras-20170926-1321Z.tar.bz2 312466 SHA256 e2ecfa43d70d9796cfd60dc2448b8e76e4e35ccbbe12b6a4becc8f854e172c12 SHA512 556e782ccc40d8cffb2fde8c46038c90023440c07785ec667f898afdb8c802faeb4dbfe8b3918a1e563b46d1dc8c0de1172f7843ce08ee1ded435b344f8f0cf5 WHIRLPOOL cae69f01090231bd25a48002e8682b70894d0b4e3ae43083fb062db159a44d4b085edb46f92ed0452d98fccbec7fc0fd1f97eff9fd16b810fc22e845e8923b50
+EBUILD mariadb-10.0.29.ebuild 6795 SHA256 157bb51bebe6fe9cf33ad75cbbef343f038f101e2c8d4b5bc354358ea342f1ea SHA512 d146a24f4b1902c02b312b2fd64c7ffb198051c8bfe2e48f7f7076db1d63c72904beb51a767eb8a06da5b5c4f354ce091ac876ed0b30dbb5e997257cdce1293d WHIRLPOOL de82641687ed6350f39acec5e2f9810209f66280567fcdb8a0ee9c4911d708a8949475bdedcef30030ba3359bd9780748b9abd43623d5413039a5b8eb5326f62
+EBUILD mariadb-10.0.30.ebuild 6886 SHA256 e9ed5cf89f7d44ad61b6c9c35d958fbfe6b56b30cd7cf22c405e1f31d2bcba09 SHA512 4c8ed348db2b71ebc351a78c141b56fe1736e35e7db6819612c43f347251b4fc68db9a2b982a1a70219310e23b0ffdc3bdf1253cebd6955ba0700c76b39a2ca3 WHIRLPOOL 4ceb753a8122b9c2e42cc1ad7e85f5c71d3e06dce0eb22dab57982e8f102101f42cef4a85367c66f2eb2e2b0ee1924226284fa72e9f229fb523321a1a672d062
+EBUILD mariadb-10.0.32.ebuild 6767 SHA256 9ea0af871fe806b30a877415da0b0881cd24f3eb3611d4e2dec18e78e15c443d SHA512 8ecca9144723916e28351cb349ea465227946d08ce905a19c7fe5503018c3e8441549a92ef6bffcd8d2ee9eedff3541354ab920d89c4f4f0bbd5ea1c19f96e5e WHIRLPOOL 8736b28d7092ff0f07b722f057a7f9ee65960b2d2a6b633fc17b0f14925a5ee68de857393ba433f1f0c126307d3e496bc6b306659769e9e576b14c66d0ef67e2
+EBUILD mariadb-10.1.24.ebuild 7187 SHA256 fb9a9a37ea87839b5df675be187df0756853d995e56af9f46e4d938f1f3bb778 SHA512 f88e2f171b9785ab6c834511ca71d9939eb36020a32cfdba5fb91f81253df8a35b891db321c0f796dfec03c7fa39226d1696607518efbaa446531590de97a75a WHIRLPOOL 95a507b48de0251948e1511c285d50b7fdbc490395ce3618a2e4517fd3223d62e17787837570f5f4ba5b78d3b7f773889826ef0966ae7b92ed7da9d6639a0f21
+EBUILD mariadb-10.1.26.ebuild 7255 SHA256 3dfe3f3c0effdb9a13b4e89398169a58773c056da51a12ac9c79e28ed0cc2b02 SHA512 171bd1cf59c77e98505f9f2217a5522611977fcd1c13d67dbe551892da3569b45298a032e33d5aed8cc2caa95f326c6f011291f678436a7fb3069133792693c7 WHIRLPOOL 3bc062878d0be9c3211299ab3e2c2d90d970f2cb2cf311dfe3fa799545bc09fd32f6da3532883dc5a6a4adfb42e23459b302d43bb01ebb1d776f5811f5102156
+EBUILD mariadb-10.1.28.ebuild 7320 SHA256 b45d0316aed437a96b46648109783fd9a8d3252d92acadf89e8a763843327e49 SHA512 4868269e57a2951e6f51dafb51fea044902e390aedaf2d1229b85c61fda12f39cf0b01935dcd4ae111b5323b647c9f639cc4fbfe03d20f50b56085babcb275e9 WHIRLPOOL cbaf38b55fcc2d3f2b0ba00fbde07b513077952b33d3679f99a1b48eb5e15638f274753bc1b536570350890d0faa5ccaa3e45934984699d95c3c9fb8fb56f45f
+EBUILD mariadb-10.2.9.ebuild 33584 SHA256 2493e44d407da15ee064afb0dae082980514d5b8754a4f0cf9cf544a8f435724 SHA512 308a9089edb55264e290aed7fade8ba2e4c9bdb6c83204dbbbfdf3f0b205a64a82874079134d48de958b0755f92d3fc9a1a2e73fefd105c58862c4ca1a327e9b WHIRLPOOL 03a803a33eb343bfef919e4cc5b8aacba74b32ecad01d12dbecbddd71ce26a4a0862d1f539e735bdd91064f3476aca4128bd47852aeee7332b92587766fc72c3
+EBUILD mariadb-5.5.57.ebuild 4241 SHA256 ebb8013626eb0a5a222b3bac6ef12606545e67338903c5872249589ae8d79aa8 SHA512 3de822605e73ca9094f6635ee232b133371823e3f3330d6ecad973c0e9176d2280a5fd5ae6032a4f6e3f914c8a937f912e2aeb91a5802342ced02aee6db11944 WHIRLPOOL 3d68d32e9d157c909659ddb17550c517e5407366c2e867a7d7ecc14594d329e551d42221e2a918155e0a1d6cbe7819a121f8ac3a417110156010ed1716ef230f
+MISC ChangeLog 24701 SHA256 3ff49394f0611c2c667536a084ba1816152d1770039e716db13ff905ed3382da SHA512 c7dce735d23de6f8c71f27d0047e5079bf6587ba386935800613cb36c0e3653f59e5021d73a4efaf56c74ba4a4f6ce4bbe21e10b214ed4618e0b2528bf13f65d WHIRLPOOL de0cbab6250b12fb8f55acc5978e3d135723ff727805e2c898a921ad7adae798702a16df7077159c195ea9854cada6840f1ef03d7f4934a183d5b0f081dd57b9
+MISC ChangeLog-2015 18661 SHA256 49a3541aba6998e4e877f4a11c5f3b9e3c6019c87d2f7ad8b8e55a25eab88eda SHA512 24861a1e538520bb16a70d09a34633dd51b15a4c2fee86928be65ec589ef54014aea54072124b245a4572b69208483c30cd2e26260fa09e30433e3ab617d25fc WHIRLPOOL 6b99d1767c2bf508d584fc9ab323e722079280aaad98ef7d56414f6b183a87b54b1907cc6f2bb2487d87e9cb672f9879cf65a49bf872f59fb09d794bb83253a7
+MISC metadata.xml 3051 SHA256 01a96c7d17bd176e1acdc11d7b2522d858cc27d0bbedd92b46b08623a05dbd30 SHA512 e6fd6d89b587b8b1fc29fc6c6c6ef8dbe0ec209a52887468bd047e5813dd5479f6e1217e4d29db0a278caac544c645157721fefe8b3c59e59431eb8a85019a68 WHIRLPOOL 95422cf084e505625e47d5a098e7acefbd2b1a9292e1f7d30758adb95b3ebed269853f93b5e3adbdf87327fc19a358e0738347c9956f2460e0d82c409798dceb
diff --git a/dev-db/mariadb/files/my.cnf-10.2 b/dev-db/mariadb/files/my.cnf-10.2
new file mode 100644
index 000000000000..80b47714b8f5
--- /dev/null
+++ b/dev-db/mariadb/files/my.cnf-10.2
@@ -0,0 +1,3 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+!includedir @GENTOO_PORTAGE_EPREFIX@/etc/mysql/mariadb.d
diff --git a/dev-db/mariadb/files/my.cnf-5.1 b/dev-db/mariadb/files/my.cnf-5.1
new file mode 100644
index 000000000000..ec5abfbde9d2
--- /dev/null
+++ b/dev-db/mariadb/files/my.cnf-5.1
@@ -0,0 +1,145 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+language = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/english
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# uncomment the following directives if you are using BDB tables
+#bdb_cache_size = 4M
+#bdb_max_lock = 10000
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/mariadb/files/my.cnf-5.5 b/dev-db/mariadb/files/my.cnf-5.5
new file mode 100644
index 000000000000..dec0c4cb8ee3
--- /dev/null
+++ b/dev-db/mariadb/files/my.cnf-5.5
@@ -0,0 +1,149 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
+
+[mariadb]
diff --git a/dev-db/mariadb/files/my.cnf-5.6 b/dev-db/mariadb/files/my.cnf-5.6
new file mode 100644
index 000000000000..f3a433d39566
--- /dev/null
+++ b/dev-db/mariadb/files/my.cnf-5.6
@@ -0,0 +1,142 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 4M
+table_open_cache = 400
+sort_buffer_size = 512K
+net_buffer_length = 16K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 128M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 48M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
+
+[mariadb]
diff --git a/dev-db/mariadb/files/my.cnf.distro-client b/dev-db/mariadb/files/my.cnf.distro-client
new file mode 100644
index 000000000000..4bbe0f976c63
--- /dev/null
+++ b/dev-db/mariadb/files/my.cnf.distro-client
@@ -0,0 +1,21 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/50-distro-client.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+character-sets-dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets
+default-character-set=utf8
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb/charsets
diff --git a/dev-db/mariadb/files/my.cnf.distro-server b/dev-db/mariadb/files/my.cnf.distro-server
new file mode 100644
index 000000000000..eaf80be0a15d
--- /dev/null
+++ b/dev-db/mariadb/files/my.cnf.distro-server
@@ -0,0 +1,28 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/50-distro-server.cnf: The global mysql configuration file.
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mariadb.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mariadb
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
diff --git a/dev-db/mariadb/mariadb-10.0.29.ebuild b/dev-db/mariadb/mariadb-10.0.29.ebuild
new file mode 100644
index 000000000000..091fe95c3d59
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.0.29.ebuild
@@ -0,0 +1,211 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20160629-1442Z"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="bindist jdbc odbc oqgraph pam sphinx tokudb xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+PATCHES=(
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch"
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-10.0.26.patch"
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch"
+ "${MY_PATCH_DIR}/20018_all_mariadb-10.0.20-without-clientlibs-tools.patch"
+)
+COMMON_DEPEND="
+ !bindist? ( >=sys-libs/readline-4.1:0= )
+ server? (
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DWITHOUT_FEDERATED=1
+ -DWITHOUT_FEDERATEDX=1 )
+ fi
+
+ # Connect with Zip is currently broken and does not compile
+ # Reported upstream https://jira.mariadb.org/browse/MDEV-11809
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ $(mysql-cmake_use_plugin oqgraph OQGRAPH)
+ $(mysql-cmake_use_plugin sphinx SPHINX)
+ $(mysql-cmake_use_plugin tokudb TOKUDB)
+ $(mysql-cmake_use_plugin pam AUTH_PAM)
+ -DWITHOUT_CASSANDRA=0
+ $(mysql-cmake_use_plugin extraengine SEQUENCE)
+ $(mysql-cmake_use_plugin extraengine SPIDER)
+ $(mysql-cmake_use_plugin extraengine CONNECT)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITHOUT_MROONGA=1
+ -DCONNECT_WITH_ZIP=OFF
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if use server ; then
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql main.bootstrap
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+#main.bootstrap \
+# for t in main.mysql_client_test main.mysql_client_test_nonblock \
+# main.mysql_client_test_comp \
+# binlog.binlog_statement_insert_delayed main.information_schema \
+# main.mysqld--help \
+# archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+# funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do
+# mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+# done
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mariadb/mariadb-10.0.30.ebuild b/dev-db/mariadb/mariadb-10.0.30.ebuild
new file mode 100644
index 000000000000..a0218bb32389
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.0.30.ebuild
@@ -0,0 +1,212 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170310-1426Z"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="bindist jdbc odbc oqgraph pam sphinx tokudb xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+PATCHES=(
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch"
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-10.0.26.patch"
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch"
+ "${MY_PATCH_DIR}/20018_all_mariadb-10.0.20-without-clientlibs-tools.patch"
+ "${MY_PATCH_DIR}/20034_all_mariadb-10.0.30-fix-without-server.patch"
+)
+COMMON_DEPEND="
+ !bindist? ( >=sys-libs/readline-4.1:0= )
+ server? (
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=[${MULTILIB_USEDEP}]
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DWITHOUT_FEDERATED=1
+ -DWITHOUT_FEDERATEDX=1 )
+ fi
+
+ # Connect with Zip is currently broken and does not compile
+ # Reported upstream https://jira.mariadb.org/browse/MDEV-11809
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ $(mysql-cmake_use_plugin oqgraph OQGRAPH)
+ $(mysql-cmake_use_plugin sphinx SPHINX)
+ $(mysql-cmake_use_plugin tokudb TOKUDB)
+ $(mysql-cmake_use_plugin pam AUTH_PAM)
+ -DWITHOUT_CASSANDRA=0
+ $(mysql-cmake_use_plugin extraengine SEQUENCE)
+ $(mysql-cmake_use_plugin extraengine SPIDER)
+ $(mysql-cmake_use_plugin extraengine CONNECT)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITHOUT_MROONGA=1
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if use server ; then
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql main.bootstrap
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+#main.bootstrap \
+# for t in main.mysql_client_test main.mysql_client_test_nonblock \
+# main.mysql_client_test_comp \
+# binlog.binlog_statement_insert_delayed main.information_schema \
+# main.mysqld--help \
+# archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+# funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do
+# mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+# done
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mariadb/mariadb-10.0.32.ebuild b/dev-db/mariadb/mariadb-10.0.32.ebuild
new file mode 100644
index 000000000000..e02c2cfe240c
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.0.32.ebuild
@@ -0,0 +1,209 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170310-1426Z"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="bindist jdbc odbc oqgraph pam sphinx tokudb xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+PATCHES=(
+ "${MY_PATCH_DIR}/01050_all_mariadb_mysql_config_cleanup-5.5.41.patch"
+ "${MY_PATCH_DIR}/20006_all_cmake_elib-mariadb-10.0.26.patch"
+ "${MY_PATCH_DIR}/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch"
+ "${MY_PATCH_DIR}/20018_all_mariadb-10.0.20-without-clientlibs-tools.patch"
+)
+COMMON_DEPEND="
+ !bindist? ( >=sys-libs/readline-4.1:0= )
+ server? (
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=[${MULTILIB_USEDEP}]
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DWITHOUT_FEDERATED=1
+ -DWITHOUT_FEDERATEDX=1 )
+ fi
+
+ # Connect with Zip is currently broken and does not compile
+ # Reported upstream https://jira.mariadb.org/browse/MDEV-11809
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ $(mysql-cmake_use_plugin oqgraph OQGRAPH)
+ $(mysql-cmake_use_plugin sphinx SPHINX)
+ $(mysql-cmake_use_plugin tokudb TOKUDB)
+ $(mysql-cmake_use_plugin pam AUTH_PAM)
+ $(mysql-cmake_use_plugin extraengine SEQUENCE)
+ $(mysql-cmake_use_plugin extraengine SPIDER)
+ $(mysql-cmake_use_plugin extraengine CONNECT)
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITHOUT_MROONGA=1
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if use server ; then
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql main.bootstrap
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+#main.bootstrap \
+# for t in main.mysql_client_test main.mysql_client_test_nonblock \
+# main.mysql_client_test_comp \
+# binlog.binlog_statement_insert_delayed main.information_schema \
+# main.mysqld--help \
+# archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+# funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do
+# mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+# done
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mariadb/mariadb-10.1.24.ebuild b/dev-db/mariadb/mariadb-10.1.24.ebuild
new file mode 100644
index 000000000000..12dfcd871287
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.1.24.ebuild
@@ -0,0 +1,227 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170316-1355Z"
+# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number
+WSREP_REVISION="25"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga odbc oqgraph pam sphinx sst-rsync sst-xtrabackup tokudb systemd xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.16.patch
+ "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch
+)
+
+COMMON_DEPEND="
+ mroonga? ( app-text/groonga-normalizer-mysql )
+ kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd:= )
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-${WSREP_REVISION}*
+ sst-rsync? ( sys-process/lsof )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ local MYSQL_CMAKE_EXTRA_DEFINES=(
+ -DPLUGIN_AUTH_GSSAPI_CLIENT=$(usex kerberos YES NO)
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_OQGRAPH=$(usex oqgraph YES NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga YES NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos YES NO)
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ mysql-multilib-r1_disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ main.mysql_client_test_comp ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+ retstatus_tests=$?
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || eerror "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
diff --git a/dev-db/mariadb/mariadb-10.1.26.ebuild b/dev-db/mariadb/mariadb-10.1.26.ebuild
new file mode 100644
index 000000000000..c40f1daf24c5
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.1.26.ebuild
@@ -0,0 +1,228 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170830-1210Z"
+# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number
+WSREP_REVISION="25"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga odbc oqgraph pam sphinx sst-rsync sst-xtrabackup tokudb systemd xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.16.patch
+ "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch
+)
+
+COMMON_DEPEND="
+ mroonga? ( app-text/groonga-normalizer-mysql )
+ kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ systemd? ( sys-apps/systemd:= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-${WSREP_REVISION}*
+ sst-rsync? ( sys-process/lsof )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ local MYSQL_CMAKE_EXTRA_DEFINES=(
+ -DPLUGIN_AUTH_GSSAPI_CLIENT=$(usex kerberos YES NO)
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_OQGRAPH=$(usex oqgraph YES NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga YES NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos YES NO)
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ mysql-multilib-r1_disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ main.mysql_client_test_comp ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+ retstatus_tests=$?
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || eerror "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
diff --git a/dev-db/mariadb/mariadb-10.1.28.ebuild b/dev-db/mariadb/mariadb-10.1.28.ebuild
new file mode 100644
index 000000000000..0464ff44aa76
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.1.28.ebuild
@@ -0,0 +1,229 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170926-1321Z"
+# The wsrep API version must match between upstream WSREP and sys-cluster/galera major number
+WSREP_REVISION="25"
+SUBSLOT="18"
+MYSQL_PV_MAJOR="5.6"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib-r1
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+
+IUSE="+backup bindist cracklib galera kerberos innodb-lz4 innodb-lzo innodb-snappy jdbc mroonga odbc oqgraph pam sphinx sst-rsync sst-mariabackup sst-xtrabackup tokudb systemd xml"
+RESTRICT="!bindist? ( bindist )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static ) server? ( tokudb? ( jemalloc !tcmalloc ) ) static? ( !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mariadb-10.1.27.patch
+ "${MY_PATCH_DIR}"/20009_all_mariadb_myodbc_symbol_fix-5.5.38.patch
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.1.16-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch
+)
+
+COMMON_DEPEND="
+ mroonga? ( app-text/groonga-normalizer-mysql )
+ kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ sys-libs/zlib[minizip]
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ systemd? ( sys-apps/systemd:= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=
+"
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="${RDEPEND} ${COMMON_DEPEND}
+ galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-${WSREP_REVISION}*
+ sst-rsync? ( sys-process/lsof )
+ sst-mariabackup? ( net-misc/socat[ssl] )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) )"
+
+MULTILIB_WRAPPED_HEADERS+=( /usr/include/mysql/mysql_version.h
+ /usr/include/mysql/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/private/probes_mysql_dtrace.h )
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ mysql-multilib-r1_pkg_setup
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+ mysql-multilib-r1_pkg_preinst
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ mysql-multilib-r1_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+
+ local MYSQL_CMAKE_NATIVE_DEFINES=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ )
+ local MYSQL_CMAKE_EXTRA_DEFINES=(
+ -DPLUGIN_AUTH_GSSAPI_CLIENT=$(usex kerberos YES NO)
+ )
+ if use server ; then
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ -DPLUGIN_OQGRAPH=$(usex oqgraph YES NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga YES NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos YES NO)
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='embedded extraengine perl server openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ mysql-multilib-r1_disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ main.mysql_client_test_comp ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+ retstatus_tests=$?
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || eerror "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
diff --git a/dev-db/mariadb/mariadb-10.2.9.ebuild b/dev-db/mariadb/mariadb-10.2.9.ebuild
new file mode 100644
index 000000000000..cc434baea248
--- /dev/null
+++ b/dev-db/mariadb/mariadb-10.2.9.ebuild
@@ -0,0 +1,1006 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170926-1321Z"
+SUBSLOT="18"
+
+JAVA_PKG_OPT_USE="jdbc"
+
+# Keeping eutils in EAPI=6 for emktemp in pkg_config
+
+inherit eutils systemd flag-o-matic prefix toolchain-funcs \
+ java-pkg-opt-2 user cmake-utils multilib-minimal
+
+SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz "
+
+# Gentoo patches to MySQL
+if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
+ SRC_URI="${SRC_URI}
+ mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
+ https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
+fi
+
+HOMEPAGE="http://mariadb.org/"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL"
+LICENSE="GPL-2 LGPL-2.1+"
+SLOT="0/${SUBSLOT:-0}"
+IUSE="+backup bindist cracklib debug embedded extraengine galera innodb-lz4
+ innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga
+ numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx
+ sst-rsync sst-mariabackup sst-xtrabackup static static-libs systemd systemtap tcmalloc
+ test tokudb xml yassl"
+
+# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
+RESTRICT="!bindist? ( bindist ) libressl? ( test )"
+
+REQUIRED_USE="jdbc? ( extraengine server !static )
+ server? ( tokudb? ( jemalloc !tcmalloc ) )
+ !server? ( !extraengine !embedded )
+ ?? ( tcmalloc jemalloc )
+ static? ( yassl !pam )"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+# Shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/mysql"
+
+if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
+ MY_PATCH_DIR="${WORKDIR}/mysql-extras"
+else
+ MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+fi
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
+ "${MY_PATCH_DIR}"/20018_all_mariadb-10.2.8-without-clientlibs-tools.patch
+ "${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch
+ "${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch
+ "${MY_PATCH_DIR}"/20026_all_mariadb-add-pkgdatadir.patch
+)
+
+# Be warned, *DEPEND are version-dependant
+# These are used for both runtime and compiletime
+# MULTILIB_USEDEP only set for libraries used by the client library
+COMMON_DEPEND="
+ kernel_linux? (
+ sys-process/procps:0=
+ dev-libs/libaio:0=
+ )
+ >=sys-apps/sed-4
+ >=sys-apps/texinfo-4.7-r1
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ jemalloc? ( dev-libs/jemalloc:0= )
+ tcmalloc? ( dev-util/google-perftools:0= )
+ systemtap? ( >=dev-util/systemtap-1.3:0= )
+ !yassl? (
+ !libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP},static-libs?] )
+ )
+ >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?]
+ sys-libs/ncurses:0=
+ mroonga? ( app-text/groonga-normalizer-mysql )
+ kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+ !bindist? (
+ sys-libs/binutils-libs:0=
+ >=sys-libs/readline-4.1:0=
+ )
+ server? (
+ backup? ( app-arch/libarchive:0= )
+ cracklib? ( sys-libs/cracklib:0= )
+ extraengine? (
+ odbc? ( dev-db/unixODBC:0= )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ innodb-lz4? ( app-arch/lz4 )
+ innodb-lzo? ( dev-libs/lzo )
+ innodb-snappy? ( app-arch/snappy )
+ numa? ( sys-process/numactl )
+ oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
+ pam? ( virtual/pam:0= )
+ systemd? ( sys-apps/systemd:= )
+ tokudb? ( app-arch/snappy )
+ )
+ >=dev-libs/libpcre-8.35:3=
+"
+DEPEND="virtual/yacc
+ static? ( sys-libs/ncurses[static-libs] )
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
+ ${COMMON_DEPEND}"
+RDEPEND="selinux? ( sec-policy/selinux-mysql )
+ abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] )
+ !dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
+ server? ( !prefix? ( dev-db/mysql-init-scripts ) )
+ !<virtual/mysql-5.6-r9
+ ${COMMON_DEPEND}
+ server? ( galera? (
+ sys-apps/iproute2
+ =sys-cluster/galera-25*
+ sst-rsync? ( sys-process/lsof )
+ sst-mariabackup? ( net-misc/socat[ssl] )
+ sst-xtrabackup? ( net-misc/socat[ssl] )
+ ) )
+ perl? ( !dev-db/mytop
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes )
+ server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
+"
+# For other stuff to bring us in
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+# xtrabackup-bin causes a circular dependency if DBD-mysql is not already installed
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )
+ server? ( ~virtual/mysql-5.6[embedded=,static=] )
+ virtual/libmysqlclient:${SLOT}[${MULTILIB_USEDEP},static-libs=]
+ server? ( galera? ( sst-xtrabackup? ( || ( >=dev-db/xtrabackup-bin-2.2.4 dev-db/percona-xtrabackup ) ) ) )"
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]] ; then
+ local GCC_MAJOR_SET=$(gcc-major-version)
+ local GCC_MINOR_SET=$(gcc-minor-version)
+ if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} with tokudb needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
+ # non x86{,_64} arches
+ if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
+ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+ fi
+ java-pkg-opt-2_pkg_setup
+ if has test ${FEATURES} && \
+ use server && ! has userpriv ${FEATURES} ; then
+ eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+
+ # This should come after all of the die statements
+ enewgroup mysql 60 || die "problem adding 'mysql' group"
+ enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+
+ # Here we need to see if the implementation switched client libraries
+ # We check if this is a new instance of the package and a client library already exists
+ local SHOW_ABI_MESSAGE libpath
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so")
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library ${libpath}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}
+
+pkg_postinst() {
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Create log directory securely if it does not exist
+ [[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
+
+ if use server ; then
+ if use pam; then
+ einfo
+ elog "This install includes the PAM authentication plugin."
+ elog "To activate and configure the PAM plugin, please read:"
+ elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/"
+ einfo
+ fi
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ einfo
+ elog "You might want to run:"
+ elog "\"emerge --config =${CATEGORY}/${PF}\""
+ elog "if this is a new install."
+ elog
+ elog "If you are switching server implentations, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ else
+ einfo
+ elog "If you are upgrading major versions, you should run the"
+ elog "mysql_upgrade tool."
+ einfo
+ fi
+
+ if use galera ; then
+ einfo
+ elog "Be sure to edit the my.cnf file to activate your cluster settings."
+ elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\""
+ elog "The first time the cluster is activated, you should add"
+ elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node."
+ elog "This option should then be removed for subsequent starts."
+ einfo
+ fi
+ fi
+
+ # Note about configuration change
+ einfo
+ elog "This version of mariadb reorganizes the configuration from a single my.cnf"
+ elog "to several files in /etc/mysql/${PN}.d."
+ elog "Please backup any changes you made to /etc/mysql/my.cnf"
+ elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension."
+ elog "You may have as many files as needed and they are read alphabetically."
+ elog "Be sure the options have the appropitate section headers, i.e. [mysqld]."
+ einfo
+}
+
+src_unpack() {
+
+ # Initialize the proper variables first
+ mysql_init_vars
+
+ unpack ${A}
+ # Grab the patches
+ [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack
+
+ mv -f "${WORKDIR}/${P}" "${S}" || die
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ if use tcmalloc; then
+ echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt"
+ fi
+
+ # Don't build bundled xz-utils for tokudb
+ echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
+ sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die
+ sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die
+
+ # Remove the bundled groonga
+ # There is no CMake flag, it simply checks for existance
+ rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga"
+
+ cmake-utils_src_prepare
+}
+
+src_configure(){
+ # bug 508724 mariadb cannot use ld.gold
+ tc-ld-disable-gold
+ # Bug #114895, bug #110149
+ filter-flags "-O" "-O[01]"
+
+ append-cxxflags -felide-constructors
+
+ # bug #283926, with GCC4.4, this is required to get correct behavior.
+ append-flags -fno-strict-aliasing
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ CMAKE_BUILD_TYPE="RelWithDebInfo"
+
+ # debug hack wrt #497532
+ mycmakeargs=(
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
+ -DSYSCONFDIR="${EPREFIX}/etc/mysql"
+ -DINSTALL_BINDIR=bin
+ -DINSTALL_DOCDIR=share/doc/${PF}
+ -DINSTALL_DOCREADMEDIR=share/doc/${PF}
+ -DINSTALL_INCLUDEDIR=include/mysql
+ -DINSTALL_INFODIR=share/info
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DINSTALL_MANDIR=share/man
+ -DINSTALL_MYSQLSHAREDIR=share/mariadb
+ -DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin
+ -DINSTALL_SCRIPTDIR=share/mariadb/scripts
+ -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
+ -DINSTALL_SBINDIR=sbin
+ -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb"
+ -DWITH_COMMENT="Gentoo Linux ${PF}"
+ -DWITH_UNIT_TESTS=$(usex test ON OFF)
+ -DWITH_LIBEDIT=0
+ -DWITH_ZLIB=system
+ -DWITHOUT_LIBWRAP=1
+ -DENABLED_LOCAL_INFILE=1
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_DEFAULT_COMPILER_OPTIONS=0
+ -DWITH_DEFAULT_FEATURE_SET=0
+ -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)"
+ -DENABLE_STATIC_LIBS=$(usex static-libs ON OFF)
+ # The build forces this to be defined when cross-compiling. We pass it
+ # all the time for simplicity and to make sure it is actually correct.
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
+ -DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)"
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
+ -DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF)
+ -DCONC_WITH_EXTERNAL_ZLIB=YES
+ -DWITH_EXTERNAL_ZLIB=YES
+ -DSUFFIX_INSTALL_DIR=""
+ -DWITH_UNITTEST=OFF
+ )
+ if use test ; then
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test )
+ else
+ mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
+ fi
+
+ if ! use yassl ; then
+ mycmakeargs+=( -DWITH_SSL=system )
+ else
+ mycmakeargs+=( -DWITH_SSL=bundled )
+ fi
+
+ # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION
+ # systemtap only works on native ABI bug 530132
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DWITH_READLINE=$(usex bindist 1 0)
+ -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
+ -DENABLE_DTRACE=$(usex systemtap)
+ )
+ else
+ mycmakeargs+=(
+ -DWITHOUT_TOOLS=1
+ -DWITH_READLINE=1
+ -DNOT_FOR_DISTRIBUTION=0
+ -DENABLE_DTRACE=0
+ )
+ fi
+
+ if multilib_is_native_abi && use server ; then
+
+ # Federated{,X} must be treated special otherwise they will not be built as plugins
+ if ! use extraengine ; then
+ mycmakeargs+=(
+ -DPLUGIN_FEDERATED=NO
+ -DPLUGIN_FEDERATEDX=NO )
+ fi
+
+ mycmakeargs+=(
+ -DWITH_JEMALLOC=$(usex jemalloc system)
+ -DWITH_PCRE=system
+ -DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO)
+ -DPLUGIN_SPHINX=$(usex sphinx YES NO)
+ -DPLUGIN_TOKUDB=$(usex tokudb YES NO)
+ -DPLUGIN_AUTH_PAM=$(usex pam YES NO)
+ -DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
+ -DPLUGIN_CASSANDRA=NO
+ -DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
+ -DPLUGIN_SPIDER=$(usex extraengine YES NO)
+ -DPLUGIN_CONNECT=$(usex extraengine YES NO)
+ -DCONNECT_WITH_MYSQL=1
+ -DCONNECT_WITH_LIBXML2=$(usex xml)
+ -DCONNECT_WITH_ODBC=$(usex odbc)
+ -DCONNECT_WITH_JDBC=$(usex jdbc)
+ -DWITH_WSREP=$(usex galera)
+ -DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
+ -DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
+ -DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
+ -DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO)
+ -DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
+ -DWITH_MARIABACKUP=$(usex backup ON OFF)
+ -DWITH_LIBARCHIVE=$(usex backup ON OFF)
+ -DINSTALL_SQLBENCHDIR=share/mariadb
+ -DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO)
+ # systemd is only linked to for server notification
+ -DWITH_SYSTEMD=$(usex systemd yes no)
+ -DWITH_NUMA=$(usex numa ON OFF)
+ )
+ if use test ; then
+ # This is needed for the new client lib which tests a real, open server
+ mycmakeargs+=( -DSKIP_TESTS=ON )
+ fi
+
+ if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
+ ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
+ ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
+ ewarn "You MUST file bugs without these variables set."
+
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
+ -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
+ )
+
+ elif ! use latin1 ; then
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=utf8
+ -DDEFAULT_COLLATION=utf8_general_ci
+ )
+ else
+ mycmakeargs+=(
+ -DDEFAULT_CHARSET=latin1
+ -DDEFAULT_COLLATION=latin1_swedish_ci
+ )
+ fi
+ mycmakeargs+=(
+ -DEXTRA_CHARSETS=all
+ -DMYSQL_USER=mysql
+ -DDISABLE_SHARED=$(usex static YES NO)
+ -DWITH_DEBUG=$(usex debug)
+ -DWITH_EMBEDDED_SERVER=$(usex embedded)
+ -DWITH_PROFILING=$(usex profiling)
+ )
+
+ if use static; then
+ mycmakeargs+=( -DWITH_PIC=1 )
+ fi
+
+ if use jemalloc || use tcmalloc ; then
+ mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
+ fi
+
+ # Storage engines
+ mycmakeargs+=(
+ -DWITH_ARCHIVE_STORAGE_ENGINE=1
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=1
+ -DWITH_CSV_STORAGE_ENGINE=1
+ -DWITH_HEAP_STORAGE_ENGINE=1
+ -DWITH_INNOBASE_STORAGE_ENGINE=1
+ -DWITH_MYISAMMRG_STORAGE_ENGINE=1
+ -DWITH_MYISAM_STORAGE_ENGINE=1
+ -DWITH_PARTITION_STORAGE_ENGINE=1
+ )
+
+ else
+ mycmakeargs+=(
+ -DWITHOUT_SERVER=1
+ -DWITHOUT_EMBEDDED_SERVER=1
+ -DEXTRA_CHARSETS=none
+ -DINSTALL_SQLBENCHDIR=
+ -DWITH_SYSTEMD=no
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ multilib-minimal_src_compile
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ # headers with ABI specific data
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/mysql/server/my_config.h
+ /usr/include/mysql/server/private/embedded_priv.h
+ /usr/include/mysql/server/mysql_version.h
+ /usr/include/mariadb/mariadb_version.h
+ /usr/include/mysql/mariadb_version.h
+ /usr/include/mysql/server/private/probes_mysql_nodtrace.h
+ /usr/include/mysql/server/private/probes_mysql_dtrace.h )
+
+ # wrap the config scripts
+ local MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config /usr/bin/mysql_config )
+ multilib-minimal_src_install
+}
+
+# Intentionally override eclass function
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
+ if [[ -f "${D}/usr/include/mysql/server/private/config.h" ]] ; then
+ rm "${D}/usr/include/mysql/server/private/config.h" || die
+ fi
+
+ if ! multilib_is_native_abi && use server ; then
+ insinto /usr/include/mysql/server/private
+ doins "${S}"/sql/*.h
+ fi
+
+ # Install compatible symlinks to libmysqlclient
+# use static-libs && dosym libmariadbclient.a "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.a"
+# dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so"
+ dosym libmariadb.so.3 "${EPREFIX}/usr/$(get_libdir)/libmysqlclient.so.${SUBSLOT}"
+
+ # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them.
+ find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die
+}
+
+multilib_src_install_all() {
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ # Convenience links
+ einfo "Making Convenience links for mysqlcheck multi-call binary"
+ dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
+ dosym "mysqlcheck" "/usr/bin/mysqlrepair"
+ dosym "mysqlcheck" "/usr/bin/mysqloptimize"
+
+ # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
+ if [[ -d "${ED}/usr/data" ]] ; then
+ rm -Rf "${ED}/usr/data" || die
+ fi
+
+ # Unless they explicitly specific USE=test, then do not install the
+ # testsuite. It DOES have a use to be installed, esp. when you want to do a
+ # validation of your database configuration after tuning it.
+ if ! use test ; then
+ rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test"
+ fi
+
+ # Configuration stuff
+ einfo "Building default configuration ..."
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}"
+ [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
+ cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die
+ eprefixify "${TMPDIR}/my.cnf"
+ doins "${TMPDIR}/my.cnf"
+ insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d"
+ cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die
+ eprefixify "${TMPDIR}/50-distro-client.cnf"
+ doins "${TMPDIR}/50-distro-client.cnf"
+
+ if use server ; then
+ mycnf_src="my.cnf.distro-server"
+ sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
+ "${FILESDIR}/${mycnf_src}" \
+ > "${TMPDIR}/my.cnf.ok" || die
+ if use prefix ; then
+ sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+ if use latin1 ; then
+ sed -i \
+ -e "/character-set/s|utf8|latin1|g" \
+ "${TMPDIR}/my.cnf.ok" || die
+ fi
+ eprefixify "${TMPDIR}/my.cnf.ok"
+ newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
+
+ einfo "Including support files and sample configurations"
+ docinto "support-files"
+ local script
+ for script in \
+ "${S}"/support-files/magic
+ do
+ [[ -f "$script" ]] && dodoc "${script}"
+ done
+
+ docinto "scripts"
+ for script in "${S}"/scripts/mysql* ; do
+ [[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
+ done
+ fi
+
+ #Remove mytop if perl is not selected
+ [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
+}
+
+# Official test instructions:
+# USE='extraengine perl server static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ _disable_test() {
+
+ local rawtestname testname testsuite reason mysql_disabled_file mysql_disabled_dir
+ rawtestname="${1}" ; shift
+ reason="${@}"
+ ewarn "test '${rawtestname}' disabled: '${reason}'"
+
+ testsuite="${rawtestname/.*}"
+ testname="${rawtestname/*.}"
+ for mysql_disabled_file in \
+ "${S}/mysql-test/disabled.def" \
+ "${S}/mysql-test/t/disabled.def" ; do
+ [[ -f ${mysql_disabled_file} ]] && break
+ done
+ #mysql_disabled_file="${S}/mysql-test/t/disabled.def"
+ #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
+ echo ${testname} : ${reason} >> "${mysql_disabled_file}"
+
+ if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
+ for mysql_disabled_file in \
+ "${S}/mysql-test/suite/${testsuite}/disabled.def" \
+ "${S}/mysql-test/suite/${testsuite}/t/disabled.def" \
+ FAILED ; do
+ [[ -f ${mysql_disabled_file} ]] && break
+ done
+ if [[ ${mysql_disabled_file} != "FAILED" ]]; then
+ echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
+ else
+ for mysql_disabled_dir in \
+ "${S}/mysql-test/suite/${testsuite}" \
+ "${S}/mysql-test/suite/${testsuite}/t" \
+ FAILED ; do
+ [[ -d ${mysql_disabled_dir} ]] && break
+ done
+ if [[ ${mysql_disabled_dir} != "FAILED" ]]; then
+ echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
+ else
+ ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
+ fi
+ fi
+ fi
+ }
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might run out of order
+ mkdir -p "${T}"/var-tests{,/log} || die
+
+ # Run mysql tests
+ pushd "${TESTDIR}" > /dev/null || die
+
+ # These are failing in MariaDB 10.0 for now and are believed to be
+ # false positives:
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock
+ # main.mysql_client_test_comp:
+ # segfaults at random under Portage only, suspect resource limits.
+
+ local t
+ for t in plugins.cracklib_password_check plugins.two_password_validations ; do
+ _disable_test "$t" "False positive due to varying policies"
+ done
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ main.mysql_client_test_comp ; do
+ _disable_test "$t" "False positives in Gentoo"
+ done
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder
+ retstatus_tests=$?
+
+ popd > /dev/null || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ local failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+}
+
+mysql_init_vars() {
+ MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
+ MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
+ MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
+ MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
+
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=""
+ if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
+ MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
+ | sed -e 's/.*=\s*//' \
+ | tail -n1`
+ fi
+ fi
+ if [[ -z "${MY_DATADIR}" ]] ; then
+ MY_DATADIR="${MY_LOCALSTATEDIR}"
+ einfo "Using default MY_DATADIR"
+ fi
+ elog "MySQL MY_DATADIR is ${MY_DATADIR}"
+
+ if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
+ if [[ -e "${MY_DATADIR}" ]] ; then
+ # If you get this and you're wondering about it, see bug #207636
+ elog "MySQL datadir found in ${MY_DATADIR}"
+ elog "A new one will not be created."
+ PREVIOUS_DATADIR="yes"
+ else
+ PREVIOUS_DATADIR="no"
+ fi
+ export PREVIOUS_DATADIR
+ fi
+ else
+ if [[ ${EBUILD_PHASE} == "config" ]]; then
+ local new_MY_DATADIR
+ new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
+ | sed -ne '/datadir/s|^--datadir=||p' \
+ | tail -n1`
+
+ if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
+ ewarn "MySQL MY_DATADIR has changed"
+ ewarn "from ${MY_DATADIR}"
+ ewarn "to ${new_MY_DATADIR}"
+ MY_DATADIR="${new_MY_DATADIR}"
+ fi
+ fi
+ fi
+
+ export MY_SHAREDSTATEDIR MY_SYSCONFDIR
+ export MY_LOCALSTATEDIR MY_LOGDIR
+ export MY_DATADIR
+}
+
+pkg_config() {
+ _getoptval() {
+ local mypd="${EROOT}"/usr/bin/my_print_defaults
+ local section="$1"
+ local flag="--${2}="
+ local extra_options="${3}"
+ "${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
+ }
+ local old_MY_DATADIR="${MY_DATADIR}"
+ local old_HOME="${HOME}"
+ # my_print_defaults needs to read stuff in $HOME/.my.cnf
+ export HOME=${EPREFIX}/root
+
+ # Make sure the vars are correctly initialized
+ mysql_init_vars
+
+ [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
+ if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then
+ die "Minimal builds do NOT include the MySQL server"
+ fi
+
+ if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
+ local MY_DATADIR_s="${ROOT}/${MY_DATADIR}"
+ MY_DATADIR_s="${MY_DATADIR_s%%/}"
+ local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
+ old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
+
+ if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
+ ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
+ else
+ elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
+ mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
+ || die "Moving MY_DATADIR failed"
+ fi
+ else
+ ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
+ if [[ -d "${MY_DATADIR_s}" ]]; then
+ ewarn "Attempting to use ${MY_DATADIR_s}"
+ else
+ eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
+ die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
+ fi
+ fi
+ fi
+
+ local pwd1="a"
+ local pwd2="b"
+ local maxtry=15
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+ local tmp_mysqld_password_source=
+
+ for tmp_mysqld_password_source in mysql client; do
+ einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
+ if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
+ if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
+ ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
+ MYSQL_ROOT_PASSWORD=
+ continue
+ fi
+
+ einfo "Found password in '${tmp_mysqld_password_source}' section!"
+ break
+ fi
+ done
+
+ # Sometimes --show is required to display passwords in some implementations of my_print_defaults
+ if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
+ MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
+ fi
+
+ unset tmp_mysqld_password_source
+ fi
+ MYSQL_TMPDIR="$(_getoptval '--mysqld' tmpdir)"
+ # These are dir+prefix
+ MYSQL_RELAY_LOG="$(_getoptval '--mysqld' relay-log)"
+ MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
+ MYSQL_LOG_BIN="$(_getoptval '--mysqld' log-bin)"
+ MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
+
+ if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
+ einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR"
+ fi
+ if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then
+ einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN"
+ fi
+ if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then
+ einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
+ install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG"
+ fi
+
+ if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
+ ewarn "You have already a MySQL database in place."
+ ewarn "(${ROOT}/${MY_DATADIR}/*)"
+ ewarn "Please rename or delete it if you wish to replace it."
+ die "MySQL database already exists!"
+ fi
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
+
+ einfo "Please provide a password for the mysql 'root' user now"
+ einfo "or through the ${HOME}/.my.cnf file."
+ ewarn "Avoid [\"'\\_%] characters in the password"
+ read -rsp " >" pwd1 ; echo
+
+ einfo "Retype the password"
+ read -rsp " >" pwd2 ; echo
+
+ if [[ "x$pwd1" != "x$pwd2" ]] ; then
+ die "Passwords are not the same"
+ fi
+ MYSQL_ROOT_PASSWORD="${pwd1}"
+ unset pwd1 pwd2
+ fi
+
+ local options
+ local sqltmp="$(emktemp)"
+
+ # Fix bug 446200. Don't reference host my.cnf, needs to come first,
+ # see http://bugs.mysql.com/bug.php?id=31312
+ use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
+
+ # Figure out which options we need to disable to do the setup
+ local helpfile="${TMPDIR}/mysqld-help"
+ "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
+ for opt in grant-tables host-cache name-resolve networking slave-start \
+ federated ssl log-bin relay-log slow-query-log external-locking \
+ log-slave-updates \
+ ; do
+ optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
+ egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
+ done
+
+ einfo "Creating the mysql database and setting proper permissions on it ..."
+
+ # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
+ PID_DIR="${EROOT}/var/run/mysqld"
+ if [[ ! -d "${PID_DIR}" ]]; then
+ install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
+ fi
+
+ if [[ ! -d "${MY_DATADIR}" ]]; then
+ install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
+ fi
+
+ pushd "${TMPDIR}" &>/dev/null || die
+
+ # Filling timezones, see
+ # http://dev.mysql.com/doc/mysql/en/time-zone-support.html
+ "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
+
+ local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" )
+ [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
+ cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
+ einfo "Command: ${cmd[*]}"
+ su -s /bin/sh -c "${cmd[*]}" mysql \
+ >"${TMPDIR}"/mysql_install_db.log 2>&1
+ if [ $? -ne 0 ]; then
+ grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
+ die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
+ fi
+ popd &>/dev/null || die
+ [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
+ || die "MySQL databases not installed"
+
+ use prefix || options="${options} --user=mysql"
+
+ local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
+ local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
+ local mysqld="${EROOT}/usr/sbin/mysqld \
+ ${options} \
+ --log-warnings=0 \
+ --basedir=${EROOT}/usr \
+ --datadir=${ROOT}/${MY_DATADIR} \
+ --max_allowed_packet=8M \
+ --net_buffer_length=16K \
+ --socket=${socket} \
+ --pid-file=${pidfile}
+ --tmpdir=${ROOT}/${MYSQL_TMPDIR}"
+ #einfo "About to start mysqld: ${mysqld}"
+ ebegin "Starting mysqld"
+ einfo "Command ${mysqld}"
+ ${mysqld} &
+ rc=$?
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
+ maxtry=$((${maxtry}-1))
+ echo -n "."
+ sleep 1
+ done
+ eend $rc
+
+ if ! [[ -S "${socket}" ]]; then
+ die "Completely failed to start up mysqld with: ${mysqld}"
+ fi
+
+ ebegin "Setting root password"
+ # Do this from memory, as we don't want clear text passwords in temp files
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'; FLUSH PRIVILEGES"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -e "${sql}"
+ eend $?
+
+ if [[ -n "${sqltmp}" ]] ; then
+ ebegin "Loading \"zoneinfo\", this step may require a few seconds"
+ "${EROOT}/usr/bin/mysql" \
+ "--socket=${socket}" \
+ -hlocalhost \
+ -uroot \
+ --password="${MYSQL_ROOT_PASSWORD}" \
+ mysql < "${sqltmp}"
+ rc=$?
+ eend $?
+ [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
+ fi
+
+ # Stop the server and cleanup
+ einfo "Stopping the server ..."
+ kill $(< "${pidfile}" )
+ rm -f "${sqltmp}"
+ wait %1
+ einfo "Done"
+}
diff --git a/dev-db/mariadb/mariadb-5.5.57.ebuild b/dev-db/mariadb/mariadb-5.5.57.ebuild
new file mode 100644
index 000000000000..0619086e848c
--- /dev/null
+++ b/dev-db/mariadb/mariadb-5.5.57.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+MY_EXTRAS_VER="20160721-1526Z"
+
+# Build system
+BUILD="cmake"
+
+inherit toolchain-funcs mysql-v2
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+# When MY_EXTRAS is bumped, the index should be revised to exclude these.
+EPATCH_EXCLUDE=''
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="${RDEPEND}"
+SLOT="0/18"
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+# Official test instructions:
+# USE='embedded extraengine perl ssl static-libs community' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mariadb-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if ! use "minimal" ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # create symlink for the tests to find the replace util
+ ln -s "${BUILD_DIR}/extra/replace" "${BUILD_DIR}/client/"
+
+ # These are failing in MariaDB 5.5 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help, funcs_1.is_triggers, funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test, main.mysql_client_test_nonblock:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+ for t in main.mysql_client_test main.mysql_client_test_nonblock \
+ binlog.binlog_statement_insert_delayed main.information_schema \
+ main.mysqld--help \
+ archive.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ funcs_1.is_triggers funcs_1.is_tables_mysql funcs_1.is_columns_mysql ; do
+ mysql-v2_disable_test "$t" "False positives in Gentoo"
+ done
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --testcase-timeout=30
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mariadb/metadata.xml b/dev-db/mariadb/metadata.xml
new file mode 100644
index 000000000000..7a863a5e5170
--- /dev/null
+++ b/dev-db/mariadb/metadata.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+<use>
+ <flag name="backup">Build mariadb-backup which supports SST and hot backup of InnoDB, Aria and MyISAM including compression and encryption</flag>
+ <flag name="cluster">Add support for NDB clustering (deprecated)</flag>
+ <flag name="community">Enables the community features from upstream.</flag>
+ <flag name="embedded">Build embedded server (libmysqld)</flag>
+ <flag name="extraengine">Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)</flag>
+ <flag name="galera">Enables galera replication</flag>
+ <flag name="innodb-lz4">Enables lz4 compression methods for InnoDB/XtraDB</flag>
+ <flag name="innodb-lzo">Enables lzo compression methods for InnoDB/XtraDB</flag>
+ <flag name="innodb-snappy">Enables snappy compression methods for InnoDB/XtraDB using <pkg>app-arch/snappy</pkg></flag>
+ <flag name="jdbc">Enable the CONNECT engine to access foreign databases via JDBC</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
+ <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
+ <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
+ <flag name="max-idx-128">Raise the max index per table limit from 64 to 128</flag>
+ <flag name="minimal">Install client programs only, no server</flag>
+ <flag name="mroonga">Add support for the Mroonga engine for interfacing with the Groonga text search</flag>
+ <flag name="numa">Enable NUMA support using sys-process/numactl (NUMA kernel support is also required)</flag>
+ <flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag>
+ <flag name="oqgraph">Add support for the Open Query GRAPH engine</flag>
+ <flag name="pam">Enable the optional PAM authentication plugin for the server</flag>
+ <flag name="profiling">Add support for statement profiling (requires USE=community).</flag>
+ <flag name="rocksdb">Add support for RocksDB; a key/value, LSM database optimized for flash storage</flag>
+ <flag name="server">Build the server program</flag>
+ <flag name="sphinx">Add suport for the sphinx full-text search engine</flag>
+ <flag name="sst-rsync">Add tools needed to support the rsync SST method</flag>
+ <flag name="sst-mariabackup">Add tools needed to support the mariabackup SST method</flag>
+ <flag name="sst-xtrabackup">Add tools needed to support the xtrabackup and xtrabackup-v2 SST methods</flag>
+ <flag name="systemtap">Build support for profiling and tracing using <pkg>dev-util/systemtap</pkg></flag>
+ <flag name="test">Install upstream testsuites for end use.</flag>
+ <flag name="tokudb">Add support for TokuDB storage engine</flag>
+ <flag name="yassl">Enable SSL connections and crypto functions using the bundled yaSSL</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/maxscale/Manifest b/dev-db/maxscale/Manifest
new file mode 100644
index 000000000000..92e7213697e6
--- /dev/null
+++ b/dev-db/maxscale/Manifest
@@ -0,0 +1,6 @@
+AUX maxscale-1.2.0-rpath.patch 2892 SHA256 bb50d3f1360aa0c8a7d9b37404816e4280cc94c2c1e98a8b6c5113216a2ba79a SHA512 43c3972cd0f6f9fa5fcf4ebf920ce502445e45feb26ca77067b66e8e5a28d7290e43f8102e280a38953f2f4bc15fdca69561bdd067c6544729d791c6f043e926 WHIRLPOOL 36b2bbcbc24ca924a19775801cedf62078edc8cda6005426ac33c8fd29e02753a2ef5e0b54904257724c481ee869f9e0e113d0b7fd39840b23c375b43b50b3f6
+AUX maxscale-init.d 421 SHA256 85327a887ad7c8177e2969a04014369bb13af3b5c4334e2b83a35c925726aa32 SHA512 6450d75c4c31646b544285e96c056e8a476587eda7fe3eaced241da55b014fd9036df448191bb7cff4dbcf95205fe2da33fdd20035c915527a33b24666f31b2d WHIRLPOOL 55483879080237c37f88e1b80c791f4a7a1035377f1822ab8daaa68e040e4ca687aa9e78175db23500d41007856d02c7bccadf392eeda8a4425624b1409c70c6
+DIST MaxScale-1.2.0.tar.gz 8747330 SHA256 9408238ba589f0f22d16005f0274e09f5bf3dc54d660b10ece3136d5c26c260b SHA512 59988397fc7c8112dc81e77d317b4625e071448c0669805fdee91e156553c2144d802f70ebc047df75aab6f7e0114e22a3f9f68768f779ab2300536196c34a7e WHIRLPOOL 823be39fa22ad13868dcc0c9942dd4fecbecf56afcbeb2df92bcf096d268e602b49bd43794f9b8fb3ebe1213def82296473c955347b5793ec9a582975136b1fa
+EBUILD maxscale-1.2.0.ebuild 1840 SHA256 e78adc6b88c02d68918a8ab477b848665e6ebb9affceb0ff83d73edc2283c9a5 SHA512 3445658997aff7b0d64205af230551823fd3cf2f383e54db650b8f37e30a9ababb235179993ff42e524881b63698f12e7ebc7565f334019223eb6ac09028d111 WHIRLPOOL 764612762dbd94fb8f36123d024921386d8a04889c2422bf6f04ce2ffde993e386eb97907490bb4a427110cb8eafa05e4d832ace4a89ec70ffd322f3e60ec043
+MISC ChangeLog 1425 SHA256 04d0e09a0f7f14707b8544c03f65cef24b13363f43ea454de039dc8c1625c8fb SHA512 f61aa59e2436ffdf1808ec0654845e0cba166cb5c941fb621e5f14c5eb6ca1db3405c6bd8ff5f89b7fb19f90a3f4123c582cd390e6841cb9090fde2e33d1f752 WHIRLPOOL a303ccdd8d2b17b28b372bfa687d648dc625bc5a927be01c77826becec4b6b698cff2f80528cb300e51c8cb735d6e086d69d0186d5d549ba692e7261fe3c0ad0
+MISC metadata.xml 597 SHA256 b6d03f7899faefba07e27dc873fb72e706e2ba79bbf3c5db90f0dd582d2c7881 SHA512 a9b1bc343e09599d45294814e7c04d279b1c7b114466fb87e5be89d21b62f89f4bc08532f5bccbfa7914ae20870993b1780e3d9558261df2ec1b24d90e516e80 WHIRLPOOL c2221bb1c7aa21c8c50d7a4e93b72ed05ea6019800805ca46703e13e62b34707904cdf9a967557426d2178f78da9b154bc9debf2b60162847c3b8d66c1d1d626
diff --git a/dev-db/maxscale/files/maxscale-1.2.0-rpath.patch b/dev-db/maxscale/files/maxscale-1.2.0-rpath.patch
new file mode 100644
index 000000000000..76cca09845f8
--- /dev/null
+++ b/dev-db/maxscale/files/maxscale-1.2.0-rpath.patch
@@ -0,0 +1,48 @@
+diff -aurN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2015-07-15 09:34:27.000000000 -0400
++++ b/CMakeLists.txt 2015-08-10 22:12:06.021818283 -0400
+@@ -56,7 +56,7 @@
+ endif()
+ endif()
+
+-set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/${MAXSCALE_LIBDIR})
++set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${MAXSCALE_LIBDIR})
+
+ # Make sure the release notes for this release are present if it is a stable one
+ if(${MAXSCALE_VERSION} MATCHES "-stable")
+diff -aurN a/server/modules/filter/hint/CMakeLists.txt b/server/modules/filter/hint/CMakeLists.txt
+--- a/server/modules/filter/hint/CMakeLists.txt 2015-07-15 09:34:27.000000000 -0400
++++ b/server/modules/filter/hint/CMakeLists.txt 2015-08-10 22:12:49.413170068 -0400
+@@ -1,4 +1,3 @@
+ add_library(hintfilter SHARED hintfilter.c hintparser.c)
+-set_target_properties(hintfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
+ target_link_libraries(hintfilter ssl log_manager utils)
+ install(TARGETS hintfilter DESTINATION ${MAXSCALE_LIBDIR})
+diff -aurN a/server/modules/routing/binlog/CMakeLists.txt b/server/modules/routing/binlog/CMakeLists.txt
+--- a/server/modules/routing/binlog/CMakeLists.txt 2015-07-15 09:34:27.000000000 -0400
++++ b/server/modules/routing/binlog/CMakeLists.txt 2015-08-10 22:12:35.565376937 -0400
+@@ -1,4 +1,3 @@
+ add_library(binlogrouter SHARED blr.c blr_master.c blr_cache.c blr_slave.c blr_file.c)
+-set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
+ target_link_libraries(binlogrouter ssl pthread log_manager)
+ install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR})
+diff -aurN a/server/modules/routing/maxinfo/CMakeLists.txt b/server/modules/routing/maxinfo/CMakeLists.txt
+--- a/server/modules/routing/maxinfo/CMakeLists.txt 2015-07-15 09:34:27.000000000 -0400
++++ b/server/modules/routing/maxinfo/CMakeLists.txt 2015-08-10 22:12:25.265530805 -0400
+@@ -1,4 +1,3 @@
+ add_library(maxinfo SHARED maxinfo.c maxinfo_parse.c maxinfo_error.c maxinfo_exec.c)
+-set_target_properties(maxinfo PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
+ target_link_libraries(maxinfo pthread log_manager)
+ install(TARGETS maxinfo DESTINATION ${MAXSCALE_LIBDIR})
+diff -aurN a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt
+--- a/server/core/CMakeLists.txt 2015-07-15 09:34:27.000000000 -0400
++++ b/server/core/CMakeLists.txt 2015-08-10 22:39:22.709368505 -0400
+@@ -8,6 +8,8 @@
+ target_link_libraries(fullcore ${CURL_LIBRARIES} utils log_manager pthread ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ssl aio rt crypt dl crypto inih z m stdc++)
+ endif()
+
++SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
++
+ add_executable(maxscale atomic.c buffer.c spinlock.c gateway.c
+ gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c
+ poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c
diff --git a/dev-db/maxscale/files/maxscale-init.d b/dev-db/maxscale/files/maxscale-init.d
new file mode 100644
index 000000000000..1eaa046aefe9
--- /dev/null
+++ b/dev-db/maxscale/files/maxscale-init.d
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+
+command=/usr/bin/maxscale
+command_args="-U maxscale -P /run/maxscale"
+name="MaxScale database proxy"
+pidfile="/run/maxscale/maxscale.pid"
+
+description="MaxScale provides database specific proxy functionality"
+extra_started_commands="reload"
+
+start_pre() {
+ checkpath -D -o maxscale:maxscale /run/maxscale
+}
+
+reload()
+{
+ ebegin "Reloading ${name}"
+ pkill -HUP -F /run/maxscale/maxscale.pid
+ eend $?
+}
+
diff --git a/dev-db/maxscale/maxscale-1.2.0.ebuild b/dev-db/maxscale/maxscale-1.2.0.ebuild
new file mode 100644
index 000000000000..bee3d1f390e8
--- /dev/null
+++ b/dev-db/maxscale/maxscale-1.2.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils cmake-utils multilib user
+
+MY_PN="MaxScale"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A content aware, plug-able MySQL proxy server"
+HOMEPAGE="http://mariadb.com/MaxScale"
+SRC_URI="https://github.com/mariadb-corporation/${MY_PN}/archive/${PV}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="jemalloc rabbitmq tcmalloc"
+
+REQUIRED_USE="?? ( jemalloc tcmalloc )"
+
+DEPEND="
+ dev-libs/libaio
+ >=dev-libs/libpcre-8.35
+ dev-libs/openssl:0
+ net-misc/curl
+ virtual/mysql[embedded]
+ jemalloc? ( dev-libs/jemalloc )
+ rabbitmq? ( net-libs/rabbitmq-c )
+ tcmalloc? ( dev-util/google-perftools:= )
+"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=( "${FILESDIR}/${PN}-1.2.0-rpath.patch" )
+
+pkg_setup() {
+ enewgroup maxscale
+ enewuser maxscale -1 -1 -1 maxscale
+}
+
+src_configure() {
+# -DEMBEDDED_LIB=/usr/$(get_libdir)/mysql
+ local mycmakeargs=(
+ -DSTATIC_EMBEDDED=OFF
+ -DWITH_SCRIPTS=OFF
+ $(cmake-utils_use_with jemalloc JEMALLOC)
+ $(cmake-utils_use_build rabbitmq RABBITMQ)
+ $(cmake-utils_use_with tcmalloc TCMALLOC)
+ -DMODULE_INSTALL_PATH=$(get_libdir)/${PN}
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ local DOCS=( README README.md "${BUILD_DIR}"/Changelog.txt "${BUILD_DIR}"/ReleaseNotes.txt )
+ cmake-utils_src_install
+ # Remove badly placed documents
+ rm "${D}usr/share/${PN}/README" "${D}usr/share/${PN}/Changelog.txt" \
+ "${D}usr/share/${PN}/LICENSE" "${D}usr/share/${PN}/COPYRIGHT" \
+ "${D}usr/share/${PN}/ReleaseNotes.txt" || die
+ newinitd "${FILESDIR}/${PN}-init.d" ${PN}
+ keepdir /var/log/maxscale /var/lib/maxscale/data \
+ /var/cache/maxscale
+ fowners maxscale:maxscale /var/log/maxscale \
+ /var/lib/maxscale/data \
+ /var/lib/maxscale \
+ /var/cache/maxscale
+}
diff --git a/dev-db/maxscale/metadata.xml b/dev-db/maxscale/metadata.xml
new file mode 100644
index 000000000000..2ca7145c7649
--- /dev/null
+++ b/dev-db/maxscale/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grknight@gentoo.org</email>
+ <name>Brian Evans</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+ <use>
+ <flag name="jemalloc">Use dev-libs/jemalloc for allocations</flag>
+ <flag name="rabbitmq">Add support for RabbitMQ message queue</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mariadb-corporation/MaxScale</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/metadata.xml b/dev-db/metadata.xml
new file mode 100644
index 000000000000..7ef0dd98662b
--- /dev/null
+++ b/dev-db/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The dev-db category contains libraries and utilities for database
+ related programming.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie dev-db enhält Bibliotheken und Werkzeuge für die
+ Datenbank-Programmierung.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría dev-db contiene librerias y utilidades para programación
+ referente a bases de datos.
+ </longdescription>
+ <longdescription lang="ja">
+ dev-dbカテゴリーにはデータベース・プログラミングに関連したライブラリーと
+ ユーティリティが含まれます。
+ </longdescription>
+ <longdescription lang="nl">
+ De dev-db categorie bevat bibliotheken en hulpmiddelen voor het gebruik
+ van verschillende database-programmeertalen.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm dev-db chứa các thư viện và tiện ích liên quan
+ đến Cơ sở dữ liệu.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria dev-db contiene librerie ed utilità per la programmazione di basi di dati.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria dev-db contém bibliotecas e utilitários para a
+ programação relacionada a bancos de dados.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria dev-db zawiera biblioteki i narzędzia związane z
+ programowaniem związanym z bazami danych.
+ </longdescription>
+</catmetadata>
+
diff --git a/dev-db/metakit/Manifest b/dev-db/metakit/Manifest
new file mode 100644
index 000000000000..0a92147413ec
--- /dev/null
+++ b/dev-db/metakit/Manifest
@@ -0,0 +1,7 @@
+AUX metakit-2.4.9.7-linking.patch 1802 SHA256 4fe2e50a0901ec599322887a381430cf4a44c71a0e7f85e0541f2a756b6318b3 SHA512 911675e8ed060ba662df4bed55a9357bcbebaecb5bf4abe37218f8030aa057c36ed01a851c6d266d8d8fdb94a81ee78d547d86b99f96f8e81809dc4d94209f37 WHIRLPOOL 9533ecbc25a9f7014490a609ce52c71c7d5ba3c5e2b3890a69b0aba4088f58711a4d6d260d3e23bfa6861729e3f24a17d9bdb02515ccc510488e93c157b1b47e
+AUX metakit-2.4.9.7-tcltk86.patch 2449 SHA256 81ce36495df6cfd4d0d212ef5d7423f4576c13cd22c147057357a6dbb81554b6 SHA512 1d17157ea8e384bb9094ab937b1ac6854c5a140feb574fa53adf6fcc0dab4060a0f6da9008509f3d924bc1e0e84d6663778605ca506fdec99af39610f1f509b7 WHIRLPOOL cba2bfac2c9e7003215e16e16aa927770c7dc1b46874d3fce461beca741d500c31a7417b5c1771492cbd8850c2d1ea122d65502b7f35dba3aa36ad502bf7f617
+DIST metakit-2.4.9.7.tar.gz 868310 SHA256 d1ba361d2d8517925cff5c23e8602822da9c8c347a75a15c225ec656ff7ca94d SHA512 94be6ae8ae5f1f24d255a427b0c01eccd2543cd49c5620df7c47f5bf09854ed464a01c52fc8441f7a8e9d5bdc8b966dc77ed34c15cbf9cdfe75a3063572cb8b9 WHIRLPOOL 2736564da532bf50982c9a529fcb50cf95c1e27192bba15ac19606eba98a9c97408ca8888f9ddd38b2a07496e1ee020e2fcd3de77142267b27148cae3ed1a5d9
+EBUILD metakit-2.4.9.7-r2.ebuild 1838 SHA256 ec99090ba0766711cc3d2888a92bad660529ea9903841e327cb7a833ecf34f4e SHA512 eb8b3e0e8305e44c751d46c468bb6719a89f8b5e8b206a80c61c3461437c6b65916167c31d031aaa30cb6cfa9913999dc5b413ca5bc2b069a15022080439ae91 WHIRLPOOL e43a2664c4ca0adb7629e6e99e82209087a017d608430ce1732b207b20731e94dc430494fe0412543a35a4dab4e67faf4de101b7983820d10b2719ac258604ce
+MISC ChangeLog 2608 SHA256 4a977f51d9df645a6c279e721253d060035fa33bc50d2ee8d9cc0eb6ac469987 SHA512 2b7f765e0a70b4f3863c86eba2d655644b53e9a71097b29b777a41e1ef6962150489c838d2d95f364ce196ddd462cd3ddf98a62149b72a10c396790cf19ac05e WHIRLPOOL 3da49f3b627a61b72e467bfe9cdfc2bf85da93ad2f92759cfb703fd1a4097c13e8fec4a93588d969dfec0cc36807e15ebcf62825c73492f6aa350a8120945dd5
+MISC ChangeLog-2015 8566 SHA256 ada57566bcce24396fbfb8886cc172ace366298b1bb9f6b4c7d9ab5fbd29e74e SHA512 23bac2ff8f12aee79cab076818c0898652ed1427677d8ad92ada58e79eadd13f9f2140bee019e135896cca508c25351b9d4870b9839fd87985cc9c80d775ec54 WHIRLPOOL 650a5aa31622681a31cdacf5523ef99584d61deba3c3839a8e5c5e69bf67fbfab5c120a8879bb3745719d7cb408de076d6fe8454f3767780d6e74d4719178eda
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/metakit/files/metakit-2.4.9.7-linking.patch b/dev-db/metakit/files/metakit-2.4.9.7-linking.patch
new file mode 100644
index 000000000000..55453a2d8e4a
--- /dev/null
+++ b/dev-db/metakit/files/metakit-2.4.9.7-linking.patch
@@ -0,0 +1,45 @@
+ unix/Makefile.in | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/unix/Makefile.in b/unix/Makefile.in
+index bf187ba..763558f 100755
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -43,7 +43,7 @@ CXX_FLAGS = @CPPFLAGS@ @CXXFLAGS@ @MK_THREADS@ @SHLIB_CFLAGS@ \
+ # (e.g. in Mk4py). This does not affect standard operation, *only* errors.
+ # Happens in gcc 2.95.3, it has been disabled for now (even though slower).
+ #CXXFLAGS = -fomit-frame-pointer $(CXX_FLAGS)
+-CXXFLAGS = $(CXX_FLAGS)
++CXXFLAGS += -I$(srcdir)/../include
+ #CXXFLAGS = -Dq4_CHECK $(CXX_FLAGS)
+ #CXXFLAGS = -Wall -pedantic -Wno-unused $(CXX_FLAGS)
+
+@@ -134,24 +134,24 @@ libmk4$(LIB_SUFFIX): $(LOBJS)
+ ranlib $@
+
+ libmk4$(SHLIB_SUFFIX): $(LOBJS) $(LINK_SPECIAL_FILES)
+- $(SHLIB_LD) -o $@ $(LOBJS) $(LINK_SPECIAL_FLAGS)
++ $(SHLIB_LD) $(LDFLAGS) -o $@ $(LOBJS) $(LINK_SPECIAL_FLAGS)
+
+ Mk4tcl$(LIB_SUFFIX): mk4tcl.o mk4too.o $(LOBJS)
+ ar rcu $@ mk4tcl.o mk4too.o $(LOBJS)
+ ranlib $@
+
+ Mk4tcl$(SHLIB_SUFFIX): mk4tcl.o mk4too.o $(LOBJS) $(LINK_SPECIAL_FILES)
+- $(SHLIB_LD) -o $@ mk4tcl.o mk4too.o $(LOBJS) $(LINK_SPECIAL_FLAGS)
++ $(SHLIB_LD) $(LDFLAGS) -o $@ mk4tcl.o mk4too.o $(LOBJS) $(LINK_SPECIAL_FLAGS)
+
+ Mk4py$(LIB_SUFFIX): $(PYOBJS) $(LOBJS)
+ ar cru $@ $(PYOBJS) $(LOBJS)
+ ranlib $@
+
+ Mk4py$(SHLIB_SUFFIX): $(PYOBJS) $(LOBJS) $(LINK_SPECIAL_FILES)
+- $(SHLIB_LD) -o $@ $(PYOBJS) $(LOBJS) $(LINK_SPECIAL_FLAGS)
++ $(SHLIB_LD) $(LDFLAGS) -o $@ $(PYOBJS) -L. -lmk4 $(LINK_SPECIAL_FLAGS) $(PYTHON_LIB)
+
+ Mk4lua$(SHLIB_SUFFIX): mk4lua.o $(LOBJS) $(LINK_SPECIAL_FILES)
+- $(SHLIB_LD) -o $@ mk4lua.o $(LOBJS) $(LINK_SPECIAL_FLAGS)
++ $(SHLIB_LD) $(LDFLAGS) -o $@ mk4lua.o $(LOBJS) $(LINK_SPECIAL_FLAGS)
+
+ demo: $(srcdir)/../demos/demo.cpp libmk4$(LIBEXT)
+ $(CXX) $(CXX_SWITCHES) -o $@$(EXEEXT) \
diff --git a/dev-db/metakit/files/metakit-2.4.9.7-tcltk86.patch b/dev-db/metakit/files/metakit-2.4.9.7-tcltk86.patch
new file mode 100644
index 000000000000..cbf4ce3549f6
--- /dev/null
+++ b/dev-db/metakit/files/metakit-2.4.9.7-tcltk86.patch
@@ -0,0 +1,70 @@
+ tcl/mk4tcl.cpp | 10 +++++++---
+ tcl/mk4too.cpp | 6 +++++-
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/tcl/mk4tcl.cpp b/tcl/mk4tcl.cpp
+index 049bf8e..8d2249e 100755
+--- a/tcl/mk4tcl.cpp
++++ b/tcl/mk4tcl.cpp
+@@ -28,6 +28,10 @@
+ #define MyInitStubs(x) 1
+ #endif
+
++#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
++#define Tcl_GetErrorLine(interp) (interp)->errorLine
++#endif
++
+ // definition of valid property name - alpha numerics, underscore, percent,
+ // or any extended utf-8 character
+ #define ISNAME(c) (isalnum((c)) || (c) == '_' || (c) == '%' || (c) & 0x80)
+@@ -979,7 +983,7 @@ const c4_Property &AsProperty(Tcl_Obj *objPtr, const c4_View &view_) {
+ void *tag = (&view_[0])._seq; // horrific hack to get at c4_Sequence pointer
+ if (objPtr->typePtr != &mkPropertyType || objPtr
+ ->internalRep.twoPtrValue.ptr1 != tag) {
+- Tcl_ObjType *oldTypePtr = objPtr->typePtr;
++ CONST86 Tcl_ObjType *oldTypePtr = objPtr->typePtr;
+
+ char type = 'S';
+
+@@ -1083,7 +1087,7 @@ int SetCursorFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) {
+ }
+
+ if (objPtr->typePtr != &mkCursorType) {
+- Tcl_ObjType *oldTypePtr = objPtr->typePtr;
++ CONST86 Tcl_ObjType *oldTypePtr = objPtr->typePtr;
+
+ const char *string = Tcl_GetStringFromObj(objPtr, 0);
+
+@@ -2156,7 +2160,7 @@ int MkTcl::LoopCmd() {
+ _error = TCL_OK;
+ else if (_error == TCL_ERROR) {
+ char msg[100];
+- sprintf(msg, "\n (\"mk::loop\" body line %d)", interp->errorLine);
++ sprintf(msg, "\n (\"mk::loop\" body line %d)", Tcl_GetErrorLine(interp));
+ Tcl_AddObjErrorInfo(interp, msg, - 1);
+ }
+ break;
+diff --git a/tcl/mk4too.cpp b/tcl/mk4too.cpp
+index 7c845c0..ffcbc4e 100644
+--- a/tcl/mk4too.cpp
++++ b/tcl/mk4too.cpp
+@@ -7,6 +7,10 @@
+ #include <stdio.h>
+ #include <string.h>
+
++#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
++#define Tcl_GetErrorLine(interp) (interp)->errorLine
++#endif
++
+ ///////////////////////////////////////////////////////////////////////////////
+ // Defined in this file:
+
+@@ -612,7 +616,7 @@ int MkView::LoopCmd() {
+ _error = TCL_OK;
+ else if (_error == TCL_ERROR) {
+ char msg[100];
+- sprintf(msg, "\n (\"mk::loop\" body line %d)", interp->errorLine);
++ sprintf(msg, "\n (\"mk::loop\" body line %d)", Tcl_GetErrorLine(interp));
+ Tcl_AddObjErrorInfo(interp, msg, - 1);
+ }
+ break;
diff --git a/dev-db/metakit/metadata.xml b/dev-db/metakit/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/metakit/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/metakit/metakit-2.4.9.7-r2.ebuild b/dev-db/metakit/metakit-2.4.9.7-r2.ebuild
new file mode 100644
index 000000000000..6f734ed0c15c
--- /dev/null
+++ b/dev-db/metakit/metakit-2.4.9.7-r2.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils flag-o-matic multilib python-single-r1 toolchain-funcs
+
+DESCRIPTION="Embedded database library"
+HOMEPAGE="http://www.equi4.com/metakit/"
+SRC_URI="http://www.equi4.com/pub/mk/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="python static tcl"
+
+DEPEND="
+ python? ( ${PYTHON_DEPS} )
+ tcl? ( >=dev-lang/tcl-8.6:0= )"
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RESTRICT="test"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-linking.patch \
+ "${FILESDIR}"/${P}-tcltk86.patch
+}
+
+src_configure() {
+ local myconf mycxxflags
+ use tcl && myconf+=" --with-tcl=${EPREFIX}/usr/include,${EPREFIX}/usr/$(get_libdir)"
+ use static && myconf+=" --disable-shared"
+ use static || append-cxxflags -fPIC
+
+ CXXFLAGS="${CXXFLAGS} ${mycxxflags}" unix/configure \
+ ${myconf} \
+ --host=${CHOST} \
+ --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --infodir="${EPREFIX}/usr/share/info" \
+ --mandir="${EPREFIX}/usr/share/man"
+}
+
+src_compile() {
+ emake SHLIB_LD="$(tc-getCXX) -shared -Wl,-soname,libmk4.so.2.4"
+
+ if use python; then
+ emake \
+ SHLIB_LD="$(tc-getCXX) -shared" \
+ pyincludedir="$(python_get_includedir)" \
+ PYTHON_LIB="-l${EPYTHON}" \
+ python
+ fi
+}
+
+src_install () {
+ default
+
+ mv "${ED}"//usr/$(get_libdir)/libmk4.so{,.2.4}
+ dosym libmk4.so.2.4 /usr/$(get_libdir)/libmk4.so.2
+ dosym libmk4.so.2.4 /usr/$(get_libdir)/libmk4.so
+
+ if use python; then
+ mkdir -p "${D%/}$(python_get_sitedir)" || die
+ emake \
+ DESTDIR="${D}" \
+ pylibdir="$(python_get_sitedir)" \
+ install-python
+ fi
+
+ dohtml Metakit.html
+ dohtml -a html,gif,png,jpg -r doc/*
+}
diff --git a/dev-db/mongodb/Manifest b/dev-db/mongodb/Manifest
new file mode 100644
index 000000000000..108fec47311a
--- /dev/null
+++ b/dev-db/mongodb/Manifest
@@ -0,0 +1,49 @@
+AUX mongodb-2.4-fix-v8-pythonpath.patch 439 SHA256 27728aaefca317287147d10c1b9e4331d4d4ab5c813356c32067699f22f4db72 SHA512 8d8a73eaf605cac50fe429c7141500bbc0e4f308c35b36b4ec48b4123f3241b6f5dc2670725bc7caba5769949b254874e9c36871142635c552a4c2d05a339d2c WHIRLPOOL ae1e88085c8db0f6244f3e286c8af5e8fb5b3966a204c0c104a094d27b5832b339b6ffe60f9a06ebdd1c8ec4eee94b3d89cf3b732fed88eb84668475c1e544aa
+AUX mongodb-2.6.10-fix-boost-1.57.patch 482 SHA256 e6a633a5bbafebe3e9b7e6f8775b189bda8840e2119c4df0ada97a2b1f492073 SHA512 23ce6b7c7b1d297ed45789e0b6486e699e2353bd4d3c7c0249b6df4efeb06695224e68f198f5a3c424e60fb20cb3f3d0b5d34f3ccc3ebcb9f964683acc5a4a5c WHIRLPOOL 167a68f3ff651fbc6347de4e780477ccb8b80ade178d573afc58b961a182ab5921d6bd3e30e1bf789b2276d76853f930bdf263cf97e36dab94794d9cb28a3f66
+AUX mongodb-2.6.2-fix-scons.patch 1448 SHA256 a2628d1ddb55d7a7adf9080d39ddd9a88980ecb27546fd04b74b01d478560165 SHA512 acda6ee27bf2b9a75bb2a1484fa8754e4dc700e5bd835e9f48b528a89e46a6236c38b68d42d58be6bd504d6287f673e6d71d07807e42c93fd0bd4d492387b8a6 WHIRLPOOL bf3ac06028abf8bacf9631cc763258c436842b45ce36283f5eb2083509c7e05fb854d1099c8f639c6c6282df14dc22bf1df2c416f784be9fa29afe58b775ec0e
+AUX mongodb-3.0.0-fix-scons.patch 1455 SHA256 195fdc32d431d23420c33d25b6ebbaedba4a37bd21b6f5698fa3421db70b0a4d SHA512 2dcf2679a520028babda9dd05a593dcb8c935b7232477cb31bb6f3c4240de333f8b463134a27776bd1fe1ac346fe7a44a559d65c47885712b20620ef70654a92 WHIRLPOOL 736b26c4724440729c5f748493655ffff5e9153ee10e2982ab054799a33fe0d4389a0efa922a891816168eaec7c237a3836efe682ee9f13efde22150cb29a4d9
+AUX mongodb-3.0.14-fix-scons.patch 1419 SHA256 b23c96e9c6c7d050c390a2ea656f27f8b2feb6f9286ee27c82c3e876f9e495a1 SHA512 2cf591ee25d33adf98ca6baeb086fb8677720809bc3e2b9398bba6ae84548b2aa3dfd57216e185fc6aa0aa185c9a906fe2a1b97bc81942560f02903b24f7bd25 WHIRLPOOL 2fb334eb1b80c22dd1bf0614f4f733ae096321a2382f9199b3ea8fa5ab2200f960fa247fcc6f9a7ec369ec599b635c087440ea1964b6a92edd50608d5527ec0f
+AUX mongodb-3.0.14-fix-std-string.patch 2341 SHA256 f82bb7bdf457c665308159a1bc7fa0ba6f98bca23d03e3a4273af88a2b531d70 SHA512 1c1d46f4d058685371914ac70c8ad36fba387e9a140ddfd5650cf0411a73776d7b8ef6108a778eaeaa5ba22eba0e16b2301d257a47250a67e7e013d7bb402e47 WHIRLPOOL 6fe6af8464bc7eebdfdf1a6a9d0e7cebac5c203b10dabaaa83718f00904a1e5d158d1c63ca84d331d56a3d6b61143c85d4fe9f0aebbc0587fbefa2c2f2b01355
+AUX mongodb-3.2.0-fix-scons.patch 1738 SHA256 1f269f83a0c5c1a44749ef35dd803b8f43facd3e80e6e85c79962d73929c4645 SHA512 04f95586b46960405b7b1906ea3c3c75d37d6831a458f619347ac028c77db5744131cb7bf39cdf62bf564500b1f6785e25b9a0c0526f126bf2072269385afe45 WHIRLPOOL 6a73736acdd53384af3e1426b8a1c1b4f0f0d5bcdc7f2cec2f89ae169f00ceda9a7caa2cbef4e9a9c3c23ef2f1745a68a0f6a8534201319a976615842102f353
+AUX mongodb-3.2.10-boost-1.62.patch 702 SHA256 bf373d1514b7947dc4747e11babf87a4bd8e7d581781c6771a844e69c1c4d273 SHA512 79edfd1a6eaba597b31a82e54722dccab288d8b8840a53f79140b5fca221b5acd9fbc770d99e46ea9fa0da502cdf18dd35d982c95a4aa341806c3d8b61fc732f WHIRLPOOL 4c489e4a5f058873ec6b9215610fd20a73c733699856141b68e6c717977f9620f3723d2c40436cd4963b96ae49dadb6e0227b5368df5a08871cc70d9b12e60f5
+AUX mongodb-3.2.16-Replace-string-with-explicit-std-string.patch 12636 SHA256 c55afdf1ba8d513b7e1ee68ce895c20d45e5eb20666c72cbc982a6fd997fc61d SHA512 43a610b0c37c74576ef3e3df3734c4d9d904271dd3853003ff439f61099666a356ed5d4f046573a753c652dfe1e1c1607b1abe041482b740fe828f543272646c WHIRLPOOL a65574dc682ab6399d7a8f43501a13546e8aaffce786434d18585f41e9a7820d5e1dd9d41325d7517e0ca49311770b4d4d0d981d29689769ee64928bf042d79d
+AUX mongodb-3.2.4-boost-1.60.patch 3352 SHA256 c473a461950dd1397b4fa22af8e2e779925847de56fd50e6d525f3bcfb8b3d75 SHA512 260c3edc3a04f3fae9f18fb73b3ae027709aa019751627d1a24b2ee40a72f91ef9de64606aff32c0890861fc56ae3c80341ba87cd16fffdd009b4fa5089c70db WHIRLPOOL d952fd59365a9b85e92774052fc5a9324f1c0e916cf9ad0fb1723da1e88772a3ec0d6f6eb15dd73527597502fb466b7424671e087943bb6bb13185bf3d0c468c
+AUX mongodb-3.4.0-fix-scons.patch 1411 SHA256 d7f04f05dc540d992b355a0c4ea6e45a50116526af9e9d887120ce6027248958 SHA512 2e29c91a22663259d2f5413fbb2652702bceb122899e50a8969fb82d74a64a78649e79b005e20e6640740c089b1cee19080890eb8d9344c2ce355a977146b770 WHIRLPOOL 6619adf75585676a89c263d9f6964c9b37dbc9e22df1f49cb594e0ce8be3c5ff9f41437590549723f89cf5dd44624f4df73cb01cd5911b7ecf90208e8af93a06
+AUX mongodb-3.4.4-Replace-string-with-explicit-std-string.patch 14244 SHA256 56c7d7a3076aaf799fcc7b94ff7d3adccccd71a52cad9345a86afc142a8ec42e SHA512 2f01729c2121fdad368c1bc157e4648ff933673107f3d1fb7de1a65e2bfc3a41c678eff345a5060bf26d45636947337cf2b5136a69ca06c012574a91a57d959a WHIRLPOOL 4e1f69a936fcde23c66d123990de4209b2f532e6efc2a1650a517249238c3e59075af82afe44783727caf6fd2eb7b1ae3ae5fa13be9b317d6dee8924fe2b28dc
+AUX mongodb-3.4.6-no-boost-check.patch 617 SHA256 752847edb3ecc03672835e8085d6d8a1c020f96b44958c5c7d7e7d0200e298bc SHA512 a7047a0099ff5d0cab7efe60b6980df51b360a6b9750b8c6b4f6b841d9c98f0cc16f8d322de675ec9e97126d03081d4e574abd9b87c6a6c8b34481d9f57c7eb5 WHIRLPOOL 38767c0819c85168d5e37f32b08af73bdef3daa83a947e230ebd3db399fe6afea0bbbb988bd2f0100cdbfb6f5860760bc432ab00483247b7149b283b1e42bdd0
+AUX mongodb-3.4.6-sysmacros-include.patch 1419 SHA256 9ef54b5e58aab228b4ff97374815c8c508be06f6caaabaff295c3f9dc9fe148b SHA512 ab269ec003b74848f981021f5eb09e38216d75dd9d1b8a155068b2a335d9ec9d1f5f575028ae9b4b0d8745d15e464cb05b70aabc6c28c984115574c6747afc05 WHIRLPOOL eaa5a1ff6e4cccdfa20233a22da5ba3453d66bc16f86f370f2750453cdf5bd8ce81160e6c29abd972a95eb1d00f944408328653314b38000c78dd086d5e84e72
+AUX mongodb-3.4.7-no-boost-check.patch 641 SHA256 320763c670703418016b1f0cc176c51fdd28daff2eb7d5cf6f8de759f549fbde SHA512 812eaaadb6f265cfc904e8f3a7ae8276e42e3968529914179efab5e44f1951ab46ac3bbcfb259f924b20a8ca61d2ebcf72b7103ea9d5f25594ff8e9e3e85836b WHIRLPOOL bd3534095ac829466231bc256deca4ff57d27b53a49e1b4d74fce46518263e51bf11f956f8235c759f216c59f421d35b4f144c16b096e7ec4eb768cc2cd395ad
+AUX mongodb.conf 246 SHA256 8010ce728d657524cd76b5afda7ffbc1cc389642336b12b89cec5df2b09fc0e4 SHA512 05dead727d3ea5fe8af1a3c3888693f6b3e2b8cb7f197a5d793352e10d2c524e96c9a5c55ad2e88c1114643a9612ec0b26a2574b48a5260a9b51ec8941461f1c WHIRLPOOL 17a27daaa7892140d741256cf9acaf2f2909a545f350c936183aeb7b6671c25a3dc11f191b01ed008195965b8cc39b49f1a3a8c69cfd90c4ca57b9fa2732beff
+AUX mongodb.conf-r2 698 SHA256 780fa095f5eacee59f3f683f225fe545c8ec93a27157894885d5f4656a6ae15a SHA512 15480651b5e7b1927b95d633193aee08def71e2f9ef6438f93972e359b2605e51ce6f071f5fd64b73b2bf4db58710a04634a36144db2c2e585588098d69b66fb WHIRLPOOL 2d2d2bf793ae5b1c7c27be227001c3eeb1a76cd620ce8e3882e7d43f10625df8c21d8452dabeef4b8cb750246436d57ad900f915aadd74dcc02c9341ab5d343b
+AUX mongodb.conf-r3 722 SHA256 b4009296b3e794fa1686aec0502b01431e94fc4754cb66d1f00bad64dcb24e72 SHA512 ef193bfed673477aa0e868114bd52be6675492c164f218c71ccd02c4a620b5c4799ea1d18df0c3f2b364027b9f25e60ac4475bb216b25e1dc10bfd00a9f5d45d WHIRLPOOL f536abc8102f20c94bf19c9691345a31eaed84768a413d508437b0aab5100e36cb29f193e0d90e1b76d13892789bd9a9bd815d0f76491df0db375315df7a135e
+AUX mongodb.confd-r2 549 SHA256 6275df7b1bbee218545331d68da3814d0e0fa89d3b30e21370bbeb776dd19e0a SHA512 75f11e8350e98b90eccafd577d794e4b05f36ede8d95e7839e9fa1eb77ea7bd9cdd2fdd07719abb78a714cd7d72109c177d265d6417ef198a4217453c0a4db68 WHIRLPOOL 974eeb5dd58d52670121b2e8e687250cae4d5c49ec020dc30746bf39356762d63f41371526744f2b9fdd657134e7570d7501a3ce5995e830e039cc9eeb8a427e
+AUX mongodb.initd-r2 654 SHA256 aef830c770a9f58ae55fa73caea31eb9d1a2d18c6e2ffba186848aa3f67e860f SHA512 566d47356ef956ee44b170b4498a6361583efea5a01cc3a7e0936c0abdff3100b535eb1259434bd7a68de354b75d165e543362bb93f1fb527b1605de23557398 WHIRLPOOL bffff8adb48c16522adc0226262e4015e74d72367148302f7c6c1897f229eb2210b102d731db257224d142b0cbd3c8f4ad0d99ab1a58e79ce1f943fee3618a5a
+AUX mongodb.logrotate 205 SHA256 76994c32d999def5c925bd7be3f96687b3406f1d67b89aa6a4df8053025b1e01 SHA512 8c089b1a11f494e4148fb4646265964c925bf937633a65e395ee1361d42facf837871dd493a9a2e0f480ae0e0829dbd3ed60794c5334e2716332e131fc5c2c51 WHIRLPOOL c1d94339a6e58363ba37bfd0f878ea6db403eaee02aa030891bfd54af1a61e34622286e560ba5217201435a745217b2da55d857fece83d5a94b12d915ad2940c
+AUX mongodb.service 220 SHA256 19f55ab28652b3817e98fc3f15cc2f6f3255a5e1dfd7b0d5a27c9ba22fd2703e SHA512 177251404b2e818ae2b546fe8b13cb76e348c99e85c7bef22a04b0f07b600fd515a309ede50214f4198594388a6d2b31f46e945b9dae84aabb4dfa13b1123bb9 WHIRLPOOL 0f6e032acbc7f625b03dcec990126cef064925a341e38c27cddbed5a951c8cfeded00ee3b8b0d9044245c833e86748262434665342e6baa98500fb02c07f4281
+AUX mongos.conf-r2 648 SHA256 d1bf479cee999b4e59e5100c134cd3e7af4bb126342418100cf8f9a08a26f6a7 SHA512 5aa8ced8d83572358e008c0df45dbe72a2e9c0003c9f49514d6b91bf9b75d4fb48b189ffe00d14e5675679943a05215a9873c5c9bde9ab1be4ed4813e75714e3 WHIRLPOOL f1036ea1bd7efa54d28d131dd1bfd1e06c1c3ffbf247ee68a33eee0383d87bf3bfa6639040e6b68a0a14cce0bd77bd5b91a8e245f615007fccccb0cbe2becd84
+AUX mongos.confd-r2 546 SHA256 1378a880ffde0efae213ac6d6d4bbe2181c92fbb06535a58c2dab06ef88ee8e3 SHA512 30e208690b5f28bd0442b7ed302d9be991aedd27203f24e5849201d33291ad7f0f9153ae3a00b55697d79a45c40d7b3792ff45f0c24ef2cf4e88222f88ea1400 WHIRLPOOL 68b8eed779e19261c4d13ebd6be8c11b6df94e748bb8f03d632ecbfc5fcd151a693e51c5a4ad4f0af9439d07dedafc29bd9b86b5a532bad48d570fca73002987
+AUX mongos.initd-r2 654 SHA256 02afad9fb6cbea2a04560549931a300faad8afe7a26eb0725f53bdc731a8e62d SHA512 751ddcfa406d6683e33b484ae441f7c8502698b651a1ace9b77bc13be48cee1c1ad657c474764f06bd8ef4bff51cdb235929c8d41b669a326a6ab7d24647a2c5 WHIRLPOOL 8d4ca5e052528e4f8bdf6899e3d87cc87e6f543a5df5568eb824f01217b9906ef288fdb560899f94af04366992777cec0c79bd34be2e5b1081aac2a50d9504e4
+DIST 20140409-mms-monitoring-agent.zip 40122 SHA256 9c4f89cfba10b4604512ab21eb082248104aeabe7e813b852db2b86f47d7ecb2 SHA512 5290a813c407251b5e4def813ce6fe7e09d6c3a1907fd409e326b15b07aed39f7db3a28710ecdaffe2771136c9433253c5d1857c823844a4b75dd38f1d15eefd WHIRLPOOL ce80870e2618f3d9ed80af41b1069ed5bd97af475089564eed1bc111e820c048bc5cbaa03f859349e772fe232f876127e0627c75c135a9b2e196ab13258ed9f1
+DIST mongodb-src-r2.6.12.tar.gz 16462842 SHA256 2dd51eabcfcd133573be74c0131c85b67764042833e7d94077e86adc0b9406dc SHA512 ceed10f2da50ca390f56cc79d39ea4db7a1ef6764e37dae61c3f3f664708be72de09443bbf94f8e58479e4f2923ff2ab9eee45652e82271b3bad591e03ef7657 WHIRLPOOL 1587ef45ee17f9e3357a92b480ea739192076ead280c44c801650d01d2ae29a627a96db611eac6c9b6b47e5e619e2362df94e1792348709b3ea5a4970a8751a0
+DIST mongodb-src-r3.0.14.tar.gz 28093922 SHA256 ebbb758ca7ee53e8d25e2410bb7ef61640829566d094cde2487b55e73d0fd880 SHA512 477fab29ca0ad2a0f24b895e30dc4770af8d6a1a57f3c10a02a989b58dd22510db554da0418129d4e81958342ad169696eed4b86bf5aa73916c7cec879db1152 WHIRLPOOL 7fc02969c52954f0fd9b90ace9efd3677a9d6b8d3618b5dedb470343a3ba71789d451cc30a95742b2b9e61b21ffe0f1a23e239e388a497a327f2cc8ed1ed6aef
+DIST mongodb-src-r3.0.15.tar.gz 28096395 SHA256 09ad76e06df007085520025c94a5e5840d65f37660c2b359f4962e135e4ae259 SHA512 21cec235a691dad7d1d2c625ef04a851b59223b8f2c0bdc979f2a0b8249ed46b4e62753fd595afa7b74bce13851d1f6547e54d8ffad8ba1f56e36db664f5b27e WHIRLPOOL 18bf58af05dfa23b0156615578e9a880579ad178416cfe6ab1e77c1a11bc82ebfc2b9e274defa3b3e6f97400677cbb3155353d03c75cb799626c29758cd76238
+DIST mongodb-src-r3.2.12.tar.gz 29178424 SHA256 406ced873a9abe8a3f0f92939bf5374663bac86c72181c80bec144aedf6cd306 SHA512 0c4ddaaddf15d97957faff46dc4a3f79c545cacc8a56dbe1d063778117ba9b645323b0cb7fd054fae805d092b8372c411a82e3370244b7939bda20a65fdb951c WHIRLPOOL 67673788859ea99752f2e0d1d8c7feb40b004efc344a2a589553675be7f9020ed384cb4a9000bb7eee0059105af364a722f17890ea3f0d38508b8d045db7da75
+DIST mongodb-src-r3.2.13.tar.gz 29273616 SHA256 31492b99d12d6363a6ebcbba32269ce9e97dadedda8c470cbff8c1af227e9753 SHA512 649b599da65fc205a6e18cde82da6153fb4c03a21cf679e18fb57f705ac168690a37f9520be1242278bc0fe441fda08f1c10c9924cabc636ba153c545d32f91d WHIRLPOOL f7ac6c5a14814650c4bbb52f25d710613ae3aa4011f2600f4727c0c81d83ec33c9be9ddac594e6a2d1ad4556bc6c9de71d3a11abfb3bd2883322ab85010ae905
+DIST mongodb-src-r3.2.16.tar.gz 29293555 SHA256 7a8b1b16f3fa545af16f48aeef1f918f57d96a80e1ceb6e669cdb81fab6511d0 SHA512 ba57aae430959f7df036b7e19e1b7d81956184bededd35631616c6e3dc9423dc79a50ab3265bc48b06d198a7043bca902aee2ea75954e38151ebead5b5ab2db2 WHIRLPOOL 0ac7b7cfae8b8b3727dc722c616eb576b3ae3aced5340b9fbd9a995d9f55552411c0507cb43a7378fa35187cf940d72d86ee20d08762f87bb4ebcd13eb697f09
+DIST mongodb-src-r3.4.3.tar.gz 39832718 SHA256 889d49312ed072130936cfa3281123a0e89228c04f3f8e992a0b92669b28d767 SHA512 e2fb5fc2f02e9dbca6c30d2e2aaf1569180ca15198226cdad46f47f44905293afe77763fe2e5c9add0b5bcbd62b7ce7905fb183068c0738cdeeae8d39f848cef WHIRLPOOL ba6fa864249cc80e5f65feaed685980b874b46bcf975142e15fa0eda3e474cc85388920e152474dc5527a30d215c309db6d471c716e6bbe374193ff6016ba22e
+DIST mongodb-src-r3.4.4.tar.gz 39867133 SHA256 09e962bf3428474b9790bbd464cb6176817f9da6121c30e096240dbb4d51c9f6 SHA512 dbae89b49c363e7258021cd31385e4449bfdfdfd5adfcb1683e4431372731e58ec33bf8f7576d2d52659a52461bd6a32fbc67d5c6e36d52184ec1aabb345d940 WHIRLPOOL 5ad9f80c7f0f597982a32f95365df961fcd80ffa7c04183f9cb4952a52262a27ab09fee4d0115405c5197b6d3848ede56c9a4e5012ec1c358ea8c752164405c2
+DIST mongodb-src-r3.4.6.tar.gz 39922209 SHA256 8170360f6dfede9c19c131f3d76831e952b3f1494925aa7e2a3a2f95b58ad901 SHA512 68da2f385a5e1d636f1699b13818e125af2b7f13c6ff74d5f6dc8f9e04025f9baaa23acfd386118d90ac0eb8b9b7dfbf5b00f1db580a1ea1fe2309361f46eae4 WHIRLPOOL 71b9f42a192b41c797763a02eb8b318488edbd7ffaa149497d3dea5c446c43ff078d24e48971ce4644d54767bcb848e1acaca3e17be9e8c50bbdd349e0d05fab
+DIST mongodb-src-r3.4.7.tar.gz 39936247 SHA256 9272e7663c7915e09ad2609e28c58437d760d54a9552c711ea735cd8e1784ec0 SHA512 30f4d0dbd487d148531d7073881cd55db3fef3dcfd199e260e1a51858c5a2c28dfe904d1273b89b27b2fbcde23c3a301a3fa24766489ad6eb2daa25da31d3182 WHIRLPOOL 0ecaa271f9fbe634404aca2d13b0bb0ef47847656fc2825f5ff220655bc213df96170ec6009efc033c5e0a50baf7afd400c240dcaecdaf03fc356138121dd928
+EBUILD mongodb-2.6.12.ebuild 4683 SHA256 b9e07ceec39c1a0e792d1825c25c1c2172de3d875a133dba0587911d4e77e2ea SHA512 e7a8aa76abf8c50c588411a0fc75b9723d1261784d30aa6a0908ffdb6addfa212a9008da68adecd8d49372c7be29050cfad3c06b219f9696ce4e0eb0ba56e5c2 WHIRLPOOL f98d328336e27679f1c3ce383f05234b55bfc840be3917d3c3b07aba437a4890250b2d4f2693cf37306e6ed91ad01cce054f4b0789ff5d8a159c40dec9790a06
+EBUILD mongodb-3.0.14.ebuild 4559 SHA256 50dea173c26b90ecf2e6eaa263ff8fb6ab57a0ca5f103caa97bb54b3f0c54960 SHA512 747424cae955229f6affd867961171d9ad3fe9c34553ddb94e034db76d4e389ba0c6dc47db23c291212b893b7377d1bfac52e79ae4ab1b9dfd8f4c89743e1a19 WHIRLPOOL 13bb75aa3cd7e6a19f9deacbd78679001f622776586b7e65543fd34a325b6c086d6837df191891daa932fcb4acc48d755d278a41e5dfc2a8e36af54f155c9177
+EBUILD mongodb-3.0.15.ebuild 4561 SHA256 89cf9eabd07b61fccc1648ada55f076664f1624fea849f1b6321cb0bbc8119cb SHA512 9385be15a82a988a0f829ffc8e10cd6a093d92f866f57a1b9ebaf87d8e66f90bdbbfb122b8f68575c3fa7ff4667df5f1d2b70c97653caa688012e74ba595033d WHIRLPOOL 22881f43fa9a2813d8fdf1d24f7876a870428094bfb3c4856bc73ed438635474d808a1ae912132042fea8d125b811d25aa231c318d137aab61ff386d274181b2
+EBUILD mongodb-3.2.12.ebuild 5160 SHA256 5e85021266af5ccb8ee6631be7f8f7263bfe26c1062caa769696d247bba7d53a SHA512 79fe16c3ce86b92ba74f353d90eb37d3033c04a8bd7d30b680bed206aa8af3052d8fdec99dc59e7078a7d5ce9d609a886cb6ee89176e8ee0f7b81e42f9820dd9 WHIRLPOOL a282c5bdf69ae2d0b968a06604970614d4d5928dfe50994bc66125b1af3f84674116711b46d222468f19472f724d120aa3182bc3b818c3c7a8f85016c9241f67
+EBUILD mongodb-3.2.13.ebuild 5160 SHA256 5e85021266af5ccb8ee6631be7f8f7263bfe26c1062caa769696d247bba7d53a SHA512 79fe16c3ce86b92ba74f353d90eb37d3033c04a8bd7d30b680bed206aa8af3052d8fdec99dc59e7078a7d5ce9d609a886cb6ee89176e8ee0f7b81e42f9820dd9 WHIRLPOOL a282c5bdf69ae2d0b968a06604970614d4d5928dfe50994bc66125b1af3f84674116711b46d222468f19472f724d120aa3182bc3b818c3c7a8f85016c9241f67
+EBUILD mongodb-3.2.16.ebuild 5180 SHA256 11f821c2c99c402582736bd486e673bea008bcdfc4a090c10c4ff406af13592a SHA512 181671beb49d13d96797b08e4fe24d2603da3b1e5c07ef3f51d59a1fa4f28182f27a504a8b17d2cf0f47a2235af86ee4a397472b706884afb0e57ef8ff3cffd4 WHIRLPOOL 3a19a70268cd4aafc785ec051d1bc39f038f01335f971c3951483dfae785279f9e77ebd9bc9a181ff41d27f520050fed7445225eb2e1864bc16b3c6024618711
+EBUILD mongodb-3.4.3.ebuild 4991 SHA256 d80acf1c9e41145289f7a6b9a726065c7e04df18df365d229bffcba80dc22175 SHA512 3338544cf467e182d87bafdf765dcaf11fac907a9ac40731e27b9bfb0562c3e84334ec3d9d3f165ffac5fc933c1e6ebab356e4bddad5bb6127b6a9d44b4227d5 WHIRLPOOL 1d88dd17d216a7534e575ef3b36552e91312be488581e4569518994bbd743c5f5345c1ea3576f943c75e6a0fdbeeb28cff6e052458301827888b96d1ddc06fef
+EBUILD mongodb-3.4.4.ebuild 5067 SHA256 f57f1806f233174b6053f2b5537c738b840d5b7ccf93498ba3a180600e0d46b3 SHA512 d254fcfd2be4462ba36fd51ff55649eca890a83087b8514584d286564816dd2c9e32f96231746d30c38188f94757b01237e18899bae46ecca9ac60aa7db26f38 WHIRLPOOL f95712fe42a22c9a6e4a70568db5d569b1d52d23d5f7210ec2bd24477a5202b05d55cd097195b45584adf27dbfd7506943f3183927f7a0fb194388b0e64f3d79
+EBUILD mongodb-3.4.6.ebuild 5111 SHA256 82daf6f9d8c5e2e6e9adedc3f87e7d6fd4bced645b5c5779fb920d7a63c7c252 SHA512 3f7a4fb7fcfa55f24e2ce4a22bc227b5b69ec21243569c9e4ee272e385b56dbe6986387d09f2b5d90a742e4302f88f3740f8c5e5b2c269b06b4c409b3c339a76 WHIRLPOOL 3eca6a59b8d8adf761f321765d848b80cfd030752a36e52a66da463e6866fefd3270039ed1863cc7d2bcdeb3b3f9818d5ed35a21639a2a55449f4ca70e8f2d0c
+EBUILD mongodb-3.4.7.ebuild 5091 SHA256 5ea93a46e08872457d83fdceaa57fa4ef16389a20d3a6c3c5d7d8d14c2cb7b4f SHA512 0e2d5151ee5326ec606b170a902b2672d456de911170001bb4bb49394636b8ca4994dec251636c54c3cead203b04c516dffeb21e698f502d54760c6b6bdd3c7f WHIRLPOOL effb9368d2e7b2d768b0674b4b612a72aecf5a18dc620561bf4adbff3ed9076c0ca39260102318321805032ee68f0b970003a7bbc38dcefd796b70be687c2a70
+MISC ChangeLog 11694 SHA256 2a53f4136a8358cc02fbdc1c6c0dea500c5cf58d01a5879fdc45f01c3c10891d SHA512 88c23a8f81788cbf66e952edfaeb92c9d81754a86539f808d467abf2dfa9c3e5f0d64679692cf3d28c75cae377478fd7c9471965c76607c0f5c43fb723add98d WHIRLPOOL bec26640ffacf717f31061f615f9092ed2af63e16c3f1e86907b1eca189b19e43bfca52e71a4ba4aee5a0b3574a900ee4e55c5d54967489ba6ce7c788117133c
+MISC ChangeLog-2015 25355 SHA256 a3aed548a6ffb7287da4945eb5bd03d1fa13d900600ba8b9349065276684e916 SHA512 efaeaa046614ab70a6e790cd9af861ec98a6472f62f3362cc1a935e12eceae8e00bbe210abec070eae6bba6cf791b69b937744acf2053ef2eda7458eb6b62efd WHIRLPOOL 22ad53f03a3f038d53fc8143b2a8a729c0157efe458a7aabd48ea753bc37b90c7424dc5103dafac750db40a47296a8624e566789fa49c71f54d479af860550f5
+MISC metadata.xml 1112 SHA256 1e6f3abb5e292c4df14b673502b88e0636043fb4f3445ea9c050753cf04dbab7 SHA512 39b9bd8afc1c79382130c691154eac4338810fb4069406482648d32fd2aefd5d3697c272321d300154be2e4d37ac10f1372c62687d9c41ca0d3682b0152a53c4 WHIRLPOOL 54e2e1f9465ffa8497a5637d8fae65e34b0c62b8c569344cd02fe48fd51b4c8bdfead6e396b3515b5653459e3cd31f55b1d15af143b2cf8f343af2e72fd83dcf
diff --git a/dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch b/dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch
new file mode 100644
index 000000000000..19efad676839
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch
@@ -0,0 +1,11 @@
+--- a/src/third_party/v8/SConscript 2014-05-26 11:00:37.725508098 +0200
++++ b/src/third_party/v8/SConscript 2014-05-26 11:01:13.265029083 +0200
+@@ -29,7 +29,7 @@
+ import sys
+ from os.path import join, dirname, abspath
+ root_dir = dirname(File('SConscript').rfile().abspath)
+-sys.path.append(join(root_dir, 'tools'))
++sys.path.insert(0, join(root_dir, 'tools'))
+ import js2c
+
+ Import("env windows linux darwin solaris freebsd debugBuild")
diff --git a/dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch b/dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch
new file mode 100644
index 000000000000..5f289c078831
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch
@@ -0,0 +1,13 @@
+diff -up mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h\~ mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h
+--- mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h~ 2015-01-13 18:12:06.000000000 +0100
++++ mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h 2015-01-28 22:22:50.538934558 +0100
+@@ -17,6 +17,7 @@
+
+ #include <boost/smart_ptr/scoped_array.hpp>
+ #include <string.h>
++#include <algorithm>
+
+ namespace linenoise_utf8 {
+
+
+Diff finished. Wed Jan 28 22:24:47 2015
diff --git a/dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch b/dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch
new file mode 100644
index 000000000000..76feba7bfe76
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch
@@ -0,0 +1,35 @@
+--- a/SConstruct 2014-06-16 19:32:46.274507258 +0200
++++ b/SConstruct 2014-06-16 19:34:04.763586829 +0200
+@@ -813,7 +813,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -821,13 +820,13 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux or darwin:
+- env.Append( CCFLAGS=["-pipe"] )
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -844,7 +843,7 @@
+ if not darwin:
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch b/dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch
new file mode 100644
index 000000000000..b7378d8ac416
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch
@@ -0,0 +1,35 @@
+--- SConstruct.orig 2015-02-05 16:33:41.000000000 +0000
++++ SConstruct 2015-02-18 08:21:23.120134258 +0000
+@@ -1008,7 +1008,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -1016,13 +1015,13 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux or darwin:
+- env.Append( CCFLAGS=["-pipe"] )
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -1039,7 +1038,7 @@
+ if not darwin:
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-3.0.14-fix-scons.patch b/dev-db/mongodb/files/mongodb-3.0.14-fix-scons.patch
new file mode 100644
index 000000000000..1db5d7695c72
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.0.14-fix-scons.patch
@@ -0,0 +1,36 @@
+diff --git a/SConstruct b/SConstruct
+--- a/SConstruct
++++ b/SConstruct
+@@ -1008,7 +1008,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -1016,13 +1015,13 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux or darwin:
+- env.Append( CCFLAGS=["-pipe"] )
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -1039,7 +1038,7 @@
+ if not darwin:
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-3.0.14-fix-std-string.patch b/dev-db/mongodb/files/mongodb-3.0.14-fix-std-string.patch
new file mode 100644
index 000000000000..9de319bda9dd
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.0.14-fix-std-string.patch
@@ -0,0 +1,83 @@
+--- a/src/mongo/shell/bench.cpp 2017-09-20 19:12:20.893056990 +0200
++++ b/src/mongo/shell/bench.cpp 2017-09-20 19:14:08.165060566 +0200
+@@ -52,6 +52,9 @@
+ #include "mongo/util/time_support.h"
+ #include "mongo/util/version.h"
+
++#include <string>
++using namespace std;
++
+ // ---------------------------------
+ // ---- benchmarking system --------
+ // ---------------------------------
+--- a/src/mongo/db/dbwebserver.cpp 2017-09-20 19:24:50.042081961 +0200
++++ b/src/mongo/db/dbwebserver.cpp 2017-09-20 19:26:20.240084968 +0200
+@@ -58,6 +58,8 @@
+ #include "mongo/util/ramlog.h"
+ #include "mongo/util/version.h"
+
++#include <string>
++using namespace std;
+
+ namespace mongo {
+
+--- a/src/mongo/db/matcher/expression_leaf.cpp 2017-09-20 19:27:59.009088260 +0200
++++ b/src/mongo/db/matcher/expression_leaf.cpp 2017-09-20 19:28:31.082089329 +0200
+@@ -39,6 +39,9 @@
+ #include "mongo/db/jsobj.h"
+ #include "mongo/db/matcher/path.h"
+
++#include <string>
++using namespace std;
++
+ namespace mongo {
+
+ Status LeafMatchExpression::initPath(const StringData& path) {
+--- a/src/mongo/db/repl/master_slave.cpp 2017-09-20 19:30:04.569092445 +0200
++++ b/src/mongo/db/repl/master_slave.cpp 2017-09-20 19:31:19.145094931 +0200
+@@ -70,6 +70,9 @@
+ #include "mongo/util/exit.h"
+ #include "mongo/util/log.h"
+
++#include <string>
++using namespace std;
++
+ using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::cout;
+--- a/src/mongo/util/net/miniwebserver.cpp 2017-09-20 19:32:55.368098138 +0200
++++ b/src/mongo/util/net/miniwebserver.cpp 2017-09-20 19:33:57.128100197 +0200
+@@ -39,6 +39,9 @@
+ #include "mongo/util/hex.h"
+ #include "mongo/util/log.h"
+
++#include <string>
++using namespace std;
++
+ namespace mongo {
+
+ using boost::shared_ptr;
+--- a/src/mongo/s/config.cpp 2017-09-20 19:42:45.614117812 +0200
++++ b/src/mongo/s/config.cpp 2017-09-20 19:43:28.278119234 +0200
+@@ -60,6 +60,9 @@
+ #include "mongo/util/net/message.h"
+ #include "mongo/util/stringutils.h"
+
++#include <string>
++using namespace std;
++
+ namespace mongo {
+
+ using boost::scoped_ptr;
+--- a/src/mongo/s/grid.cpp 2017-09-20 19:51:07.684134547 +0200
++++ b/src/mongo/s/grid.cpp 2017-09-20 19:51:43.436135739 +0200
+@@ -55,6 +55,9 @@
+ #include "mongo/util/startup_test.h"
+ #include "mongo/util/stringutils.h"
+
++#include <string>
++using namespace std;
++
+ namespace mongo {
+
+ using std::endl;
diff --git a/dev-db/mongodb/files/mongodb-3.2.0-fix-scons.patch b/dev-db/mongodb/files/mongodb-3.2.0-fix-scons.patch
new file mode 100644
index 000000000000..8b29bd4a2a4f
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.2.0-fix-scons.patch
@@ -0,0 +1,49 @@
+From ab6f929ee4584f3f1a040e55a63f493603f228d2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 1 Jan 2016 10:27:35 +0100
+Subject: [PATCH] Fix build for Gentoo
+
+---
+ SConstruct | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index 64c8387..fa9ab8b 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -1371,7 +1371,6 @@ if env.TargetOSIs('posix'):
+ env.Append( CCFLAGS=["-fno-omit-frame-pointer",
+ "-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -1382,8 +1381,9 @@ if env.TargetOSIs('posix'):
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -1398,10 +1398,10 @@ if env.TargetOSIs('posix'):
+ env.Append( SHLINKFLAGS=["-Wl,-z,now"] )
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+- #make scons colorgcc friendly
+- for key in ('HOME', 'TERM'):
++ #make scons colorgcc, distcc, ccache friendly
++ for key in ('HOME', 'PATH', 'TERM'):
+ try:
+ env['ENV'][key] = os.environ[key]
+ except KeyError:
+--
+2.6.4
+
diff --git a/dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch b/dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch
new file mode 100644
index 000000000000..30a3bdff45f8
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.2.10-boost-1.62.patch
@@ -0,0 +1,15 @@
+Derived from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/mongodb/patches/patch-src_mongo_db_fts_unicode_string.cpp v1.1
+
+* Fix build with boost 1.62.0
+
+--- a/src/mongo/db/fts/unicode/string.cpp 2016-09-26 12:10:04.000000000 +0000
++++ b/src/mongo/db/fts/unicode/string.cpp
+@@ -274,7 +274,7 @@ bool String::substrMatch(const std::stri
+
+ // Case sensitive and diacritic sensitive.
+ return boost::algorithm::boyer_moore_search(
+- haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end();
++ haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end());
+ }
+
+ } // namespace unicode
diff --git a/dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch b/dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch
new file mode 100644
index 000000000000..6067850ad0b2
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch
@@ -0,0 +1,283 @@
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/db/dbwebserver.cpp mongodb-src-r3.2.16/src/mongo/db/dbwebserver.cpp
+--- mongodb-src-r3.2.16_orig/src/mongo/db/dbwebserver.cpp 2017-07-14 22:36:01.000000000 +0200
++++ mongodb-src-r3.2.16/src/mongo/db/dbwebserver.cpp 2017-08-01 15:43:55.860712772 +0200
+@@ -69,6 +69,7 @@
+ using std::map;
+ using std::stringstream;
+ using std::vector;
++using std::string;
+
+ using namespace html;
+
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/db/matcher/expression_leaf.cpp mongodb-src-r3.2.16/src/mongo/db/matcher/expression_leaf.cpp
+--- mongodb-src-r3.2.16_orig/src/mongo/db/matcher/expression_leaf.cpp 2017-07-14 22:36:01.000000000 +0200
++++ mongodb-src-r3.2.16/src/mongo/db/matcher/expression_leaf.cpp 2017-08-01 15:46:17.070708001 +0200
+@@ -200,7 +200,7 @@
+ }
+
+ void ComparisonMatchExpression::toBSON(BSONObjBuilder* out) const {
+- string opString = "";
++ std::string opString = "";
+ switch (matchType()) {
+ case LT:
+ opString = "$lt";
+@@ -880,7 +880,7 @@
+ }
+
+ void BitTestMatchExpression::toBSON(BSONObjBuilder* out) const {
+- string opString = "";
++ std::string opString = "";
+
+ switch (matchType()) {
+ case BITS_ALL_SET:
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/db/repl/master_slave.cpp mongodb-src-r3.2.16/src/mongo/db/repl/master_slave.cpp
+--- mongodb-src-r3.2.16_orig/src/mongo/db/repl/master_slave.cpp 2017-07-14 22:36:01.000000000 +0200
++++ mongodb-src-r3.2.16/src/mongo/db/repl/master_slave.cpp 2017-08-01 15:54:45.140690837 +0200
+@@ -161,7 +161,7 @@
+
+ BSONObjBuilder dbsNextPassBuilder;
+ int n = 0;
+- for (set<string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
++ for (set<std::string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
+ n++;
+ dbsNextPassBuilder.appendBool(*i, 1);
+ }
+@@ -170,7 +170,7 @@
+
+ BSONObjBuilder incompleteCloneDbsBuilder;
+ n = 0;
+- for (set<string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
++ for (set<std::string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
+ n++;
+ incompleteCloneDbsBuilder.appendBool(*i, 1);
+ }
+@@ -181,7 +181,7 @@
+ }
+
+ void ReplSource::ensureMe(OperationContext* txn) {
+- string myname = getHostName();
++ std::string myname = getHostName();
+
+ // local.me is an identifier for a server for getLastError w:2+
+ bool exists = Helpers::getSingleton(txn, "local.me", _me);
+@@ -373,10 +373,10 @@
+ }
+
+ virtual bool run(OperationContext* txn,
+- const string& ns,
++ const std::string& ns,
+ BSONObj& cmdObj,
+ int options,
+- string& errmsg,
++ std::string& errmsg,
+ BSONObjBuilder& result) {
+ HandshakeArgs handshake;
+ Status status = handshake.initialize(cmdObj);
+@@ -393,7 +393,7 @@
+ } handshakeCmd;
+
+ bool replHandshake(DBClientConnection* conn, const OID& myRID) {
+- string myname = getHostName();
++ std::string myname = getHostName();
+
+ BSONObjBuilder cmd;
+ cmd.append("handshake", myRID);
+@@ -445,7 +445,7 @@
+ BSONElement e = i.next();
+ if (e.eoo())
+ break;
+- string name = e.embeddedObject().getField("name").valuestr();
++ std::string name = e.embeddedObject().getField("name").valuestr();
+ if (!e.embeddedObject().getBoolField("empty")) {
+ if (name != "local") {
+ if (only.empty() || only == name) {
+@@ -459,7 +459,7 @@
+ save(txn);
+ }
+
+-void ReplSource::resyncDrop(OperationContext* txn, const string& db) {
++void ReplSource::resyncDrop(OperationContext* txn, const std::string& db) {
+ log() << "resync: dropping database " << db;
+ OldClientContext ctx(txn, db);
+ dropDatabase(txn, ctx.db());
+@@ -502,13 +502,13 @@
+
+ static DatabaseIgnorer ___databaseIgnorer;
+
+-void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) {
++void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) {
+ if (futureOplogTime > _ignores[db]) {
+ _ignores[db] = futureOplogTime;
+ }
+ }
+
+-bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) {
++bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) {
+ if (_ignores[db].isNull()) {
+ return false;
+ }
+@@ -598,7 +598,7 @@
+
+ // The database is present on the master and no conflicting databases
+ // are present on the master. Drop any local conflicts.
+- for (set<string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
++ for (set<std::string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
+ ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
+ incompleteCloneDbs.erase(*i);
+ addDbNextPass.erase(*i);
+@@ -793,10 +793,10 @@
+ }
+
+ void ReplSource::syncToTailOfRemoteLog() {
+- string _ns = ns();
++ std::string _ns = ns();
+ BSONObjBuilder b;
+ if (!only.empty()) {
+- b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
++ b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
+ }
+ BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
+ if (!last.isEmpty()) {
+@@ -844,7 +844,7 @@
+ */
+ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+ int okResultCode = 1;
+- string ns = string("local.oplog.$") + sourceName();
++ std::string ns = std::string("local.oplog.$") + sourceName();
+ LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
+
+ bool tailing = true;
+@@ -864,7 +864,7 @@
+ BSONElement e = i.next();
+ if (e.eoo())
+ break;
+- string name = e.embeddedObject().getField("name").valuestr();
++ std::string name = e.embeddedObject().getField("name").valuestr();
+ if (!e.embeddedObject().getBoolField("empty")) {
+ if (name != "local") {
+ if (only.empty() || only == name) {
+@@ -888,7 +888,7 @@
+ if (!only.empty()) {
+ // note we may here skip a LOT of data table scanning, a lot of work for the master.
+ // maybe append "\\." here?
+- query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
++ query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
+ }
+ BSONObj queryObj = query.done();
+ // e.g. queryObj = { ts: { $gte: syncedTo } }
+@@ -907,7 +907,7 @@
+
+ // show any deferred database creates from a previous pass
+ {
+- set<string>::iterator i = addDbNextPass.begin();
++ set<std::string>::iterator i = addDbNextPass.begin();
+ if (i != addDbNextPass.end()) {
+ BSONObjBuilder b;
+ b.append("ns", *i + '.');
+@@ -938,7 +938,7 @@
+ BSONObj op = oplogReader.next();
+ BSONElement ts = op.getField("ts");
+ if (ts.type() != Date && ts.type() != bsonTimestamp) {
+- string err = op.getStringField("$err");
++ std::string err = op.getStringField("$err");
+ if (!err.empty()) {
+ // 13051 is "tailable cursor requested on non capped collection"
+ if (op.getIntField("code") == 13051) {
+@@ -1106,7 +1106,7 @@
+
+ // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
+ // hostName.
+- if ((string("localhost") == hostName || string("127.0.0.1") == hostName) &&
++ if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) &&
+ serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
+ log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
+ sleepsecs(5);
+@@ -1251,7 +1251,7 @@
+ if (s) {
+ stringstream ss;
+ ss << "sleep " << s << " sec before next pass";
+- string msg = ss.str();
++ std::string msg = ss.str();
+ if (!serverGlobalParams.quiet)
+ log() << msg << endl;
+ ReplInfo r(msg.c_str());
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/shell/bench.cpp mongodb-src-r3.2.16/src/mongo/shell/bench.cpp
+--- mongodb-src-r3.2.16_orig/src/mongo/shell/bench.cpp 2017-07-14 22:36:01.000000000 +0200
++++ mongodb-src-r3.2.16/src/mongo/shell/bench.cpp 2017-08-01 16:20:20.864638957 +0200
+@@ -674,7 +674,7 @@
+ invariant(bsonTemplateEvaluator.setId(_id) == BsonTemplateEvaluator::StatusSuccess);
+
+ if (_config->username != "") {
+- string errmsg;
++ std::string errmsg;
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(15931, "Authenticating to connection for _benchThread failed: " + errmsg);
+ }
+@@ -920,7 +920,7 @@
+
+ if (!result["err"].eoo() && result["err"].type() == String &&
+ (_config->throwGLE || op.throwGLE))
+- throw DBException((string) "From benchRun GLE" +
++ throw DBException((std::string) "From benchRun GLE" +
+ causedBy(result["err"].String()),
+ result["code"].eoo() ? 0 : result["code"].Int());
+ }
+@@ -987,7 +987,7 @@
+
+ if (!result["err"].eoo() && result["err"].type() == String &&
+ (_config->throwGLE || op.throwGLE))
+- throw DBException((string) "From benchRun GLE" +
++ throw DBException((std::string) "From benchRun GLE" +
+ causedBy(result["err"].String()),
+ result["code"].eoo() ? 0 : result["code"].Int());
+ }
+@@ -1035,7 +1035,7 @@
+
+ if (!result["err"].eoo() && result["err"].type() == String &&
+ (_config->throwGLE || op.throwGLE))
+- throw DBException((string) "From benchRun GLE " +
++ throw DBException((std::string) "From benchRun GLE " +
+ causedBy(result["err"].String()),
+ result["code"].eoo() ? 0 : result["code"].Int());
+ }
+@@ -1136,7 +1136,7 @@
+ try {
+ std::unique_ptr<DBClientBase> conn(_config->createConnection());
+ if (!_config->username.empty()) {
+- string errmsg;
++ std::string errmsg;
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
+ }
+@@ -1168,7 +1168,7 @@
+ std::unique_ptr<DBClientBase> conn(_config->createConnection());
+ // Must authenticate to admin db in order to run serverStatus command
+ if (_config->username != "") {
+- string errmsg;
++ std::string errmsg;
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(16704,
+ str::stream()
+@@ -1204,7 +1204,7 @@
+ {
+ std::unique_ptr<DBClientBase> conn(_config->createConnection());
+ if (_config->username != "") {
+- string errmsg;
++ std::string errmsg;
+ // this can only fail if admin access was revoked since start of run
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(16705,
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/util/net/miniwebserver.cpp mongodb-src-r3.2.16/src/mongo/util/net/miniwebserver.cpp
+--- mongodb-src-r3.2.16_orig/src/mongo/util/net/miniwebserver.cpp 2017-07-14 22:36:01.000000000 +0200
++++ mongodb-src-r3.2.16/src/mongo/util/net/miniwebserver.cpp 2017-08-01 16:01:01.832678112 +0200
+@@ -45,8 +45,9 @@
+ using std::endl;
+ using std::stringstream;
+ using std::vector;
++using std::string;
+
+-MiniWebServer::MiniWebServer(const string& name, const string& ip, int port)
++MiniWebServer::MiniWebServer(const std::string& name, const std::string& ip, int port)
+ : Listener(name, ip, port, false) {}
+
+ string MiniWebServer::parseURL(const char* buf) {
diff --git a/dev-db/mongodb/files/mongodb-3.2.4-boost-1.60.patch b/dev-db/mongodb/files/mongodb-3.2.4-boost-1.60.patch
new file mode 100644
index 000000000000..41c9bd2ba85c
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.2.4-boost-1.60.patch
@@ -0,0 +1,84 @@
+Fix issues caused by boost::none changes.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=578846
+Adapted from: https://github.com/mongodb/mongo/commit/92c3f80f384d2825efeabd0d26aa534c0deb6988
+
+--- mongodb-src-r3.2.4/src/mongo/db/ftdc/compressor.cpp
++++ mongodb-src-r3.2.4/src/mongo/db/ftdc/compressor.cpp
+@@ -47,7 +47,7 @@
+ if (_referenceDoc.isEmpty()) {
+ FTDCBSONUtil::extractMetricsFromDocument(sample, sample, &_metrics);
+ _reset(sample, date);
+- return {boost::none_t()};
++ return {boost::none};
+ }
+
+ _metrics.resize(0);
+@@ -107,7 +107,7 @@
+ }
+
+ // The buffer is not full, inform the caller
+- return {boost::none_t()};
++ return {boost::none};
+ }
+
+ StatusWith<std::tuple<ConstDataRange, Date_t>> FTDCCompressor::getCompressedSamples() {
+--- mongodb-src-r3.2.4/src/mongo/db/ftdc/compressor_test.cpp
++++ mongodb-src-r3.2.4/src/mongo/db/ftdc/compressor_test.cpp
+@@ -122,7 +122,7 @@
+ TestTie() : _compressor(&_config) {}
+
+ ~TestTie() {
+- validate(boost::none_t());
++ validate(boost::none);
+ }
+
+ StatusWith<boost::optional<std::tuple<ConstDataRange, FTDCCompressor::CompressorState, Date_t>>>
+--- mongodb-src-r3.2.4/src/mongo/db/ftdc/file_writer.cpp
++++ mongodb-src-r3.2.4/src/mongo/db/ftdc/file_writer.cpp
+@@ -205,7 +205,7 @@
+
+ Status FTDCFileWriter::close() {
+ if (_archiveStream.is_open()) {
+- Status s = flush(boost::none_t(), Date_t());
++ Status s = flush(boost::none, Date_t());
+
+ _archiveStream.close();
+
+--- mongodb-src-r3.2.4/src/mongo/util/concurrency/shared_mutex_win.hpp
++++ mongodb-src-r3.2.4/src/mongo/util/concurrency/shared_mutex_win.hpp
+@@ -175,7 +175,7 @@
+ return true;
+ }
+
+- unsigned long const res=detail::win32::WaitForSingleObject(unlock_sem,::boost::detail::get_milliseconds_until(wait_until));
++ unsigned long const res=WaitForSingleObject(unlock_sem,::boost::detail::get_milliseconds_until(wait_until));
+ if(res==detail::win32::timeout)
+ {
+ for(;;)
+@@ -328,7 +328,7 @@
+ {
+ return true;
+ }
+- unsigned long const wait_res=detail::win32::WaitForMultipleObjects(2,semaphores,true,::boost::detail::get_milliseconds_until(wait_until));
++ unsigned long const wait_res=WaitForMultipleObjects(2,semaphores,true,::boost::detail::get_milliseconds_until(wait_until));
+ if(wait_res==detail::win32::timeout)
+ {
+ for(;;)
+@@ -421,7 +421,7 @@
+ return;
+ }
+
+- BOOST_VERIFY(!detail::win32::WaitForSingleObject(unlock_sem,detail::win32::infinite));
++ BOOST_VERIFY(!WaitForSingleObject(unlock_sem,detail::win32::infinite));
+ }
+ }
+
+@@ -502,7 +502,7 @@
+ {
+ if(!last_reader)
+ {
+- BOOST_VERIFY(!detail::win32::WaitForSingleObject(upgrade_sem,detail::win32::infinite));
++ BOOST_VERIFY(!WaitForSingleObject(upgrade_sem,detail::win32::infinite));
+ }
+ break;
+ }
diff --git a/dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch b/dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch
new file mode 100644
index 000000000000..2dd751fad813
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch
@@ -0,0 +1,35 @@
+--- a/SConstruct 2016-12-27 11:10:06.801949538 +0100
++++ b/SConstruct 2016-12-27 11:12:40.426407713 +0100
+@@ -1557,7 +1557,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fno-omit-frame-pointer",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -1568,8 +1567,9 @@
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+- env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -1579,10 +1579,10 @@
+ env.Append( LINKFLAGS=["-Wl,-z,now"] )
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+- #make scons colorgcc friendly
+- for key in ('HOME', 'TERM'):
++ #make scons colorgcc, distcc, ccache friendly
++ for key in ('HOME', 'PATH', 'TERM'):
+ try:
+ env['ENV'][key] = os.environ[key]
+ except KeyError:
diff --git a/dev-db/mongodb/files/mongodb-3.4.4-Replace-string-with-explicit-std-string.patch b/dev-db/mongodb/files/mongodb-3.4.4-Replace-string-with-explicit-std-string.patch
new file mode 100644
index 000000000000..da33d47df7ff
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.4.4-Replace-string-with-explicit-std-string.patch
@@ -0,0 +1,302 @@
+From 9df9837299ab952d4d30db2427beef667e608f79 Mon Sep 17 00:00:00 2001
+From: Steven Green <steven@greenius.co.uk>
+Date: Mon, 17 Jul 2017 13:05:44 +0100
+Subject: [PATCH] SERVER-30166 Replace string with explicit std::string.
+ Enables compulation when using --use-system-pcre which presusably used to do
+ 'using std::string' in an earlier version of pcre
+
+ https://github.com/mongodb/mongo/pull/1166
+
+---
+ src/mongo/db/dbwebserver.cpp | 1 +
+ src/mongo/db/matcher/expression_leaf.cpp | 4 ++--
+ src/mongo/db/repl/master_slave.cpp | 40 ++++++++++++++++----------------
+ src/mongo/shell/bench.cpp | 14 +++++------
+ src/mongo/util/net/miniwebserver.cpp | 1 +
+ 5 files changed, 31 insertions(+), 29 deletions(-)
+
+diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp
+index b202e0500b9..02556135240 100644
+--- a/src/mongo/db/dbwebserver.cpp
++++ b/src/mongo/db/dbwebserver.cpp
+@@ -67,6 +67,7 @@ namespace mongo {
+ using std::map;
+ using std::stringstream;
+ using std::vector;
++using std::string;
+
+ using namespace html;
+
+diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp
+index d562bff141e..b96a36d543f 100644
+--- a/src/mongo/db/matcher/expression_leaf.cpp
++++ b/src/mongo/db/matcher/expression_leaf.cpp
+@@ -202,7 +202,7 @@ void ComparisonMatchExpression::debugString(StringBuilder& debug, int level) con
+ }
+
+ void ComparisonMatchExpression::serialize(BSONObjBuilder* out) const {
+- string opString = "";
++ std::string opString = "";
+ switch (matchType()) {
+ case LT:
+ opString = "$lt";
+@@ -884,7 +884,7 @@ void BitTestMatchExpression::debugString(StringBuilder& debug, int level) const
+ }
+
+ void BitTestMatchExpression::serialize(BSONObjBuilder* out) const {
+- string opString = "";
++ std::string opString = "";
+
+ switch (matchType()) {
+ case BITS_ALL_SET:
+diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
+index 05faad12599..042350465c6 100644
+--- a/src/mongo/db/repl/master_slave.cpp
++++ b/src/mongo/db/repl/master_slave.cpp
+@@ -168,7 +168,7 @@ BSONObj ReplSource::jsobj() {
+
+ BSONObjBuilder dbsNextPassBuilder;
+ int n = 0;
+- for (set<string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
++ for (set<std::string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
+ n++;
+ dbsNextPassBuilder.appendBool(*i, 1);
+ }
+@@ -177,7 +177,7 @@ BSONObj ReplSource::jsobj() {
+
+ BSONObjBuilder incompleteCloneDbsBuilder;
+ n = 0;
+- for (set<string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
++ for (set<std::string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
+ n++;
+ incompleteCloneDbsBuilder.appendBool(*i, 1);
+ }
+@@ -188,7 +188,7 @@ BSONObj ReplSource::jsobj() {
+ }
+
+ void ReplSource::ensureMe(OperationContext* txn) {
+- string myname = getHostName();
++ std::string myname = getHostName();
+
+ // local.me is an identifier for a server for getLastError w:2+
+ bool exists = Helpers::getSingleton(txn, "local.me", _me);
+@@ -378,10 +378,10 @@ class HandshakeCmd : public Command {
+ }
+
+ virtual bool run(OperationContext* txn,
+- const string& ns,
++ const std::string& ns,
+ BSONObj& cmdObj,
+ int options,
+- string& errmsg,
++ std::string& errmsg,
+ BSONObjBuilder& result) {
+ HandshakeArgs handshake;
+ Status status = handshake.initialize(cmdObj);
+@@ -398,7 +398,7 @@ class HandshakeCmd : public Command {
+ } handshakeCmd;
+
+ bool replHandshake(DBClientConnection* conn, const OID& myRID) {
+- string myname = getHostName();
++ std::string myname = getHostName();
+
+ BSONObjBuilder cmd;
+ cmd.append("handshake", myRID);
+@@ -450,7 +450,7 @@ void ReplSource::forceResync(OperationContext* txn, const char* requester) {
+ BSONElement e = i.next();
+ if (e.eoo())
+ break;
+- string name = e.embeddedObject().getField("name").valuestr();
++ std::string name = e.embeddedObject().getField("name").valuestr();
+ if (!e.embeddedObject().getBoolField("empty")) {
+ if (name != "local") {
+ if (only.empty() || only == name) {
+@@ -481,7 +481,7 @@ Status ReplSource::_updateIfDoneWithInitialSync() {
+ return Status::OK();
+ }
+
+-void ReplSource::resyncDrop(OperationContext* txn, const string& dbName) {
++void ReplSource::resyncDrop(OperationContext* txn, const std::string& dbName) {
+ log() << "resync: dropping database " << dbName;
+ invariant(txn->lockState()->isW());
+
+@@ -531,13 +531,13 @@ void ReplSource::resync(OperationContext* txn, const std::string& dbName) {
+
+ static DatabaseIgnorer ___databaseIgnorer;
+
+-void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) {
++void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) {
+ if (futureOplogTime > _ignores[db]) {
+ _ignores[db] = futureOplogTime;
+ }
+ }
+
+-bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) {
++bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) {
+ if (_ignores[db].isNull()) {
+ return false;
+ }
+@@ -627,7 +627,7 @@ bool ReplSource::handleDuplicateDbName(OperationContext* txn,
+
+ // The database is present on the master and no conflicting databases
+ // are present on the master. Drop any local conflicts.
+- for (set<string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
++ for (set<std::string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
+ ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
+ incompleteCloneDbs.erase(*i);
+ addDbNextPass.erase(*i);
+@@ -826,10 +826,10 @@ void ReplSource::_sync_pullOpLog_applyOperation(OperationContext* txn,
+ }
+
+ void ReplSource::syncToTailOfRemoteLog() {
+- string _ns = ns();
++ std::string _ns = ns();
+ BSONObjBuilder b;
+ if (!only.empty()) {
+- b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
++ b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
+ }
+ BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
+ if (!last.isEmpty()) {
+@@ -877,7 +877,7 @@ class ReplApplyBatchSize
+ */
+ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+ int okResultCode = restartSyncAfterSleep;
+- string ns = string("local.oplog.$") + sourceName();
++ std::string ns = std::string("local.oplog.$") + sourceName();
+ LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
+
+ bool tailing = true;
+@@ -897,7 +897,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+ BSONElement e = i.next();
+ if (e.eoo())
+ break;
+- string name = e.embeddedObject().getField("name").valuestr();
++ std::string name = e.embeddedObject().getField("name").valuestr();
+ if (!e.embeddedObject().getBoolField("empty")) {
+ if (name != "local") {
+ if (only.empty() || only == name) {
+@@ -921,7 +921,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+ if (!only.empty()) {
+ // note we may here skip a LOT of data table scanning, a lot of work for the master.
+ // maybe append "\\." here?
+- query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
++ query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
+ }
+ BSONObj queryObj = query.done();
+ // e.g. queryObj = { ts: { $gte: syncedTo } }
+@@ -940,7 +940,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+
+ // show any deferred database creates from a previous pass
+ {
+- set<string>::iterator i = addDbNextPass.begin();
++ set<std::string>::iterator i = addDbNextPass.begin();
+ if (i != addDbNextPass.end()) {
+ BSONObjBuilder b;
+ b.append("ns", *i + '.');
+@@ -984,7 +984,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+ BSONObj op = oplogReader.nextSafe();
+ BSONElement ts = op.getField("ts");
+ if (ts.type() != Date && ts.type() != bsonTimestamp) {
+- string err = op.getStringField("$err");
++ std::string err = op.getStringField("$err");
+ if (!err.empty()) {
+ // 13051 is "tailable cursor requested on non capped collection"
+ if (op.getIntField("code") == 13051) {
+@@ -1152,7 +1152,7 @@ int ReplSource::sync(OperationContext* txn, int& nApplied) {
+
+ // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
+ // hostName.
+- if ((string("localhost") == hostName || string("127.0.0.1") == hostName) &&
++ if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) &&
+ serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
+ log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
+ sleepsecs(5);
+@@ -1297,7 +1297,7 @@ static void replMain(OperationContext* txn) {
+ if (s) {
+ stringstream ss;
+ ss << "sleep " << s << " sec before next pass";
+- string msg = ss.str();
++ std::string msg = ss.str();
+ if (!serverGlobalParams.quiet)
+ log() << msg << endl;
+ ReplInfo r(msg.c_str());
+diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp
+index 040002f5c6e..338477ebe56 100644
+--- a/src/mongo/shell/bench.cpp
++++ b/src/mongo/shell/bench.cpp
+@@ -674,7 +674,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+ invariant(bsonTemplateEvaluator.setId(_id) == BsonTemplateEvaluator::StatusSuccess);
+
+ if (_config->username != "") {
+- string errmsg;
++ std::string errmsg;
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(15931, "Authenticating to connection for _benchThread failed: " + errmsg);
+ }
+@@ -918,7 +918,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+
+ if (!result["err"].eoo() && result["err"].type() == String &&
+ (_config->throwGLE || op.throwGLE))
+- throw DBException((string) "From benchRun GLE" +
++ throw DBException((std::string) "From benchRun GLE" +
+ causedBy(result["err"].String()),
+ result["code"].eoo() ? 0 : result["code"].Int());
+ }
+@@ -984,7 +984,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+
+ if (!result["err"].eoo() && result["err"].type() == String &&
+ (_config->throwGLE || op.throwGLE))
+- throw DBException((string) "From benchRun GLE" +
++ throw DBException((std::string) "From benchRun GLE" +
+ causedBy(result["err"].String()),
+ result["code"].eoo() ? 0 : result["code"].Int());
+ }
+@@ -1031,7 +1031,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+
+ if (!result["err"].eoo() && result["err"].type() == String &&
+ (_config->throwGLE || op.throwGLE))
+- throw DBException((string) "From benchRun GLE " +
++ throw DBException((std::string) "From benchRun GLE " +
+ causedBy(result["err"].String()),
+ result["code"].eoo() ? 0 : result["code"].Int());
+ }
+@@ -1133,7 +1133,7 @@ void BenchRunWorker::run() {
+ try {
+ std::unique_ptr<DBClientBase> conn(_config->createConnection());
+ if (!_config->username.empty()) {
+- string errmsg;
++ std::string errmsg;
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
+ }
+@@ -1165,7 +1165,7 @@ void BenchRunner::start() {
+ std::unique_ptr<DBClientBase> conn(_config->createConnection());
+ // Must authenticate to admin db in order to run serverStatus command
+ if (_config->username != "") {
+- string errmsg;
++ std::string errmsg;
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(
+ 16704,
+@@ -1201,7 +1201,7 @@ void BenchRunner::stop() {
+ {
+ std::unique_ptr<DBClientBase> conn(_config->createConnection());
+ if (_config->username != "") {
+- string errmsg;
++ std::string errmsg;
+ // this can only fail if admin access was revoked since start of run
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+ uasserted(
+diff --git a/src/mongo/util/net/miniwebserver.cpp b/src/mongo/util/net/miniwebserver.cpp
+index 5f4165d42f4..7a7d0714934 100644
+--- a/src/mongo/util/net/miniwebserver.cpp
++++ b/src/mongo/util/net/miniwebserver.cpp
+@@ -47,6 +47,7 @@ namespace mongo {
+ using std::shared_ptr;
+ using std::stringstream;
+ using std::vector;
++using std::string;
+
+ MiniWebServer::MiniWebServer(const string& name, const string& ip, int port, ServiceContext* ctx)
+ : Listener(name, ip, port, ctx, false, false) {}
diff --git a/dev-db/mongodb/files/mongodb-3.4.6-no-boost-check.patch b/dev-db/mongodb/files/mongodb-3.4.6-no-boost-check.patch
new file mode 100644
index 000000000000..2abde5ef08e0
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.4.6-no-boost-check.patch
@@ -0,0 +1,11 @@
+--- SConstruct.orig 2017-06-27 19:02:43.000000000 +0000
++++ SConstruct 2017-07-07 11:33:13.252639289 +0000
+@@ -2798,8 +2798,6 @@
+ if use_system_version_of_library("boost"):
+ if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ):
+ myenv.ConfError("can't find boost headers")
+- if not conf.CheckBoostMinVersion():
+- myenv.ConfError("system's version of boost is too old. version 1.49 or better required")
+
+ # Note that on Windows with using-system-boost builds, the following
+ # FindSysLibDep calls do nothing useful (but nothing problematic either)
diff --git a/dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch b/dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch
new file mode 100644
index 000000000000..868ba73e4421
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch
@@ -0,0 +1,38 @@
+From e245cac2b3c18015dee8caddd449532785d15c2b Mon Sep 17 00:00:00 2001
+From: Jason Carey <jcarey@argv.me>
+Date: Mon, 26 Jun 2017 11:09:10 -0400
+Subject: [PATCH] SERVER-29855 Pull major/minor from sys/sysmacros.h
+
+Per newer versions of glibc:
+
+----
+error: In the GNU C Library, "major" is defined
+ by <sys/sysmacros.h>. For historical compatibility, it is
+ currently defined by <sys/types.h> as well, but we plan to
+ remove this soon. To use "major", include <sys/sysmacros.h>
+ directly. If you did not intend to use a system-defined macro
+ "major", you should undefine it after including <sys/types.h>. [-Werror]
+ string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)
+----
+
+Including <sys/sysmacros.h> appears to be the correct solution to quiet
+the warning
+---
+ src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
+index 5a784b25dc7..c43e148d3f4 100644
+--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
++++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
+@@ -36,6 +36,10 @@
+ #include <boost/filesystem/path.hpp>
+ #include <fstream>
+
++#ifdef __linux__
++#include <sys/sysmacros.h>
++#endif
++
+ #include "mongo/db/mongod_options.h"
+ #include "mongo/db/storage/mmap_v1/data_file_sync.h"
+ #include "mongo/db/storage/mmap_v1/dur.h"
diff --git a/dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch b/dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch
new file mode 100644
index 000000000000..1d908e73f438
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch
@@ -0,0 +1,13 @@
+diff --git a/SConstruct b/SConstruct
+index df92e41659..2c387d5a24 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -2831,8 +2831,6 @@ def doConfigure(myenv):
+ if use_system_version_of_library("boost"):
+ if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ):
+ myenv.ConfError("can't find boost headers")
+- if not conf.CheckBoostMinVersion():
+- myenv.ConfError("system's version of boost is too old. version 1.49 or better required")
+
+ # Note that on Windows with using-system-boost builds, the following
+ # FindSysLibDep calls do nothing useful (but nothing problematic either)
diff --git a/dev-db/mongodb/files/mongodb.conf b/dev-db/mongodb/files/mongodb.conf
new file mode 100644
index 000000000000..c5272b7f2df3
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.conf
@@ -0,0 +1,8 @@
+# See http://www.mongodb.org/display/DOCS/File+Based+Configuration for format details
+# Run mongod --help to see a list of options
+
+bind_ip = 127.0.0.1
+quiet = true
+dbpath = /var/lib/mongodb
+logpath = /var/log/mongodb/mongod.log
+logappend = true
diff --git a/dev-db/mongodb/files/mongodb.conf-r2 b/dev-db/mongodb/files/mongodb.conf-r2
new file mode 100644
index 000000000000..8e8a64408cdf
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.conf-r2
@@ -0,0 +1,33 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+storage:
+ dbPath: "/var/lib/mongodb"
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongodb.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+# ssl:
+# mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#replication:
+ #replSetName:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/dev-db/mongodb/files/mongodb.conf-r3 b/dev-db/mongodb/files/mongodb.conf-r3
new file mode 100644
index 000000000000..83b4cc0589ad
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.conf-r3
@@ -0,0 +1,34 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+storage:
+ dbPath: "/var/lib/mongodb"
+ #engine: wiredTiger
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongodb.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+ #ssl:
+ # mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#replication:
+ #replSetName:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/dev-db/mongodb/files/mongodb.confd-r2 b/dev-db/mongodb/files/mongodb.confd-r2
new file mode 100644
index 000000000000..dddb67e9301d
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.confd-r2
@@ -0,0 +1,12 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your mongodb instance,
+# see the /etc/mongodb.conf file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/mongodb.conf)
+# - user : the user used to run your mongodb instance (default : mongodb)
+# - group : the group used to run your mongodb instance (default : mongodb)
+# - run_dir : the run directory for your PID files (default : /run/mongodb)
diff --git a/dev-db/mongodb/files/mongodb.initd-r2 b/dev-db/mongodb/files/mongodb.initd-r2
new file mode 100644
index 000000000000..27b9f2a43872
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.initd-r2
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+config_file=${config_file:-/etc/${SVCNAME}.conf}
+run_dir=${run_dir:-/run/mongodb}
+
+command="/usr/bin/mongod"
+command_args="--config ${config_file}"
+command_background="true"
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-mongodb}
+group=${group:-mongodb}
+start_stop_daemon_args="--user ${user} --group ${group}"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ if [ ! -f ${config_file} ]; then
+ eerror "Missing configuration file ${config_file}"
+ return 1
+ fi
+}
diff --git a/dev-db/mongodb/files/mongodb.logrotate b/dev-db/mongodb/files/mongodb.logrotate
new file mode 100644
index 000000000000..f95a438b5b2c
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.logrotate
@@ -0,0 +1,13 @@
+# Default log rotation / compression keeps 1 year of logs.
+/var/log/mongodb/*.log {
+ daily
+ rotate 365
+ dateext
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ extension gz
+ sharedscripts
+ missingok
+}
diff --git a/dev-db/mongodb/files/mongodb.service b/dev-db/mongodb/files/mongodb.service
new file mode 100644
index 000000000000..78d551183838
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=High-performance, schema-free document-oriented database
+After=network.target
+
+[Service]
+User=mongodb
+ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/mongodb/files/mongos.conf-r2 b/dev-db/mongodb/files/mongos.conf-r2
new file mode 100644
index 000000000000..fc0068962cfd
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.conf-r2
@@ -0,0 +1,30 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongos.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+ ssl:
+ mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#sharding:
+ #configDB:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/dev-db/mongodb/files/mongos.confd-r2 b/dev-db/mongodb/files/mongos.confd-r2
new file mode 100644
index 000000000000..0dc2a189ff67
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.confd-r2
@@ -0,0 +1,12 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your mongos instance,
+# see the /etc/mongos.conf file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/mongos.conf)
+# - user : the user used to run your mongodb instance (default : mongodb)
+# - group : the group used to run your mongodb instance (default : mongodb)
+# - run_dir : the run directory for your PID files (default : /run/mongodb)
diff --git a/dev-db/mongodb/files/mongos.initd-r2 b/dev-db/mongodb/files/mongos.initd-r2
new file mode 100644
index 000000000000..2e7db669a5e0
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.initd-r2
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+config_file=${config_file:-/etc/${SVCNAME}.conf}
+run_dir=${run_dir:-/run/mongodb}
+
+command="/usr/bin/mongos"
+command_args="--config ${config_file}"
+command_background="true"
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-mongodb}
+group=${group:-mongodb}
+start_stop_daemon_args="--user ${user} --group ${group}"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ if [ ! -f ${config_file} ]; then
+ eerror "Missing configuration file ${config_file}"
+ return 1
+ fi
+}
diff --git a/dev-db/mongodb/metadata.xml b/dev-db/mongodb/metadata.xml
new file mode 100644
index 000000000000..e5bdd69829a7
--- /dev/null
+++ b/dev-db/mongodb/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>julien@thebault.co</email>
+ <name>Lujeni</name>
+ <description>Proxy-Maintainer, assign bugs</description>
+ </maintainer>
+ <maintainer type="person">
+ <email>ultrabug@gentoo.org</email>
+ <name>Alexys Jacob</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ MongoDB (from "humongous") is a scalable, high-performance, open source,
+ schema-free, document-oriented database. Written in C++, MongoDB features:
+
+ MongoDB bridges the gap between key-value stores (which are fast and highly
+ scalable) and traditional RDBMS systems (which provide structured schemas
+ and powerful queries).
+ </longdescription>
+ <use>
+ <flag name="mms-agent">Install the MongoDB Monitoring Service agent</flag>
+ <flag name="tools">Install the MongoDB tools (mongoimport, mongodump...) from <pkg>app-admin/mongo-tools</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/mongodb/mongodb-2.6.12.ebuild b/dev-db/mongodb/mongodb-2.6.12.ebuild
new file mode 100644
index 000000000000..e17d7986b3c5
--- /dev/null
+++ b/dev-db/mongodb/mongodb-2.6.12.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+SCONS_MIN_VERSION="1.2.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="http://downloads.mongodb.org/src/${MY_P}.tar.gz
+ mms-agent? ( https://dev.gentoo.org/~ultrabug/20140409-mms-monitoring-agent.zip )"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug kerberos mms-agent ssl static-libs"
+
+PDEPEND="mms-agent? ( dev-python/pymongo app-arch/unzip )"
+RDEPEND="
+ app-arch/snappy
+ >=dev-cpp/yaml-cpp-0.5.1
+ >=dev-libs/boost-1.50[threads(+)]
+ >=dev-libs/libpcre-8.37[cxx]
+ dev-libs/snowball-stemmer
+ dev-util/google-perftools[-minimal]
+ net-libs/libpcap
+ ssl? ( >=dev-libs/openssl-1.0.1g )"
+DEPEND="${RDEPEND}
+ sys-libs/ncurses
+ sys-libs/readline
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ scons_opts="--variant-dir=build --cc=$(tc-getCC) --cxx=$(tc-getCXX)"
+ scons_opts+=" --disable-warnings-as-errors"
+ scons_opts+=" --use-system-boost"
+ scons_opts+=" --use-system-pcre"
+ scons_opts+=" --use-system-snappy"
+ scons_opts+=" --use-system-stemmer"
+ scons_opts+=" --use-system-tcmalloc"
+ scons_opts+=" --use-system-yaml"
+ scons_opts+=" --usev8"
+
+ if use debug; then
+ scons_opts+=" --dbg=on"
+ fi
+
+ if use prefix; then
+ scons_opts+=" --cpppath=${EPREFIX}/usr/include"
+ scons_opts+=" --libpath=${EPREFIX}/usr/$(get_libdir)"
+ fi
+
+ if use kerberos; then
+ scons_opts+=" --use-sasl-client"
+ fi
+
+ if use ssl; then
+ scons_opts+=" --ssl"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.6.2-fix-scons.patch"
+ epatch "${FILESDIR}/${PN}-2.4-fix-v8-pythonpath.patch"
+ epatch "${FILESDIR}/${PN}-2.6.10-fix-boost-1.57.patch"
+
+ # fix yaml-cpp detection
+ sed -i -e "s/\[\"yaml\"\]/\[\"yaml-cpp\"\]/" SConstruct || die
+
+ # bug #462606
+ sed -i -e "s@\$INSTALL_DIR/lib@\$INSTALL_DIR/$(get_libdir)@g" src/SConscript.client || die
+
+ # bug #482576
+ sed -i -e "/-Werror/d" src/third_party/v8/SConscript || die
+}
+
+src_configure() {
+ # filter some problematic flags
+ filter-flags "-march=*"
+ filter-flags -O?
+}
+
+src_compile() {
+ escons ${scons_opts} all
+}
+
+src_install() {
+ escons ${scons_opts} --full --nostrip install --prefix="${ED}"/usr
+
+ use static-libs || find "${ED}"/usr/ -type f -name "*.a" -delete
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r2" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+
+ if use mms-agent; then
+ local MY_PN="mms-agent"
+ local MY_D="/opt/${MY_PN}"
+
+ insinto /etc
+ newins "${WORKDIR}/${MY_PN}/settings.py" mms-agent.conf
+ rm "${WORKDIR}/${MY_PN}/settings.py"
+
+ insinto ${MY_D}
+ doins "${WORKDIR}/${MY_PN}/"*
+ dosym /etc/mms-agent.conf ${MY_D}/settings.py
+
+ fowners -R mongodb:mongodb ${MY_D}
+ newinitd "${FILESDIR}/${MY_PN}.initd-r2" ${MY_PN}
+ fi
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ escons ${scons_opts} test
+ "${S}"/test --dbpath=unittest || die
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 2.6 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/2.6-upgrade/"
+ ewarn " "
+ if use mms-agent; then
+ ewarn "MMS Agent configuration file has been moved to :"
+ ewarn " /etc/mms-agent.conf"
+ fi
+ break
+ else
+ if use mms-agent; then
+ elog "Edit your MMS Agent configuration file :"
+ elog " /etc/mms-agent.conf"
+ fi
+ fi
+ done
+}
diff --git a/dev-db/mongodb/mongodb-3.0.14.ebuild b/dev-db/mongodb/mongodb-3.0.14.ebuild
new file mode 100644
index 000000000000..97c48d9a1d0b
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.0.14.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="http://downloads.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug kerberos libressl mms-agent ssl +tools"
+
+RDEPEND="app-arch/snappy
+ >=dev-cpp/yaml-cpp-0.5.1
+ >=dev-libs/boost-1.57[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ sys-libs/zlib
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-4.8.2:*
+ sys-libs/ncurses
+ sys-libs/readline
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.0.14-fix-scons.patch"
+ "${FILESDIR}/${PN}-3.0.14-fix-std-string.patch"
+ "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch"
+)
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+ #
+ # --c++11 is required by scons instead of auto detection:
+ # https://jira.mongodb.org/browse/SERVER-19661
+
+ scons_opts=(
+ --variant-dir=build --cc=$(tc-getCC) --cxx=$(tc-getCXX) --c++11
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include )"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools || die
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr || die
+
+ local x
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ escons "${scons_opts[@]}" unittests || die
+
+ # tests fail
+ sed -i '/\/util\/options_parser\/options_parser_test/d' build/unittests.txt || die
+ sed -i '/\/mongo\/server_options_test/d' build/unittests.txt || die
+
+ local x
+ while read x; do
+ einfo "Running test $x"
+ ./$x || die
+ done < build/unittests.txt
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+}
diff --git a/dev-db/mongodb/mongodb-3.0.15.ebuild b/dev-db/mongodb/mongodb-3.0.15.ebuild
new file mode 100644
index 000000000000..848080d07995
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.0.15.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="http://downloads.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl +tools"
+
+RDEPEND="app-arch/snappy
+ >=dev-cpp/yaml-cpp-0.5.1
+ >=dev-libs/boost-1.57[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ sys-libs/zlib
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-4.8.2:*
+ sys-libs/ncurses
+ sys-libs/readline
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.0.14-fix-scons.patch"
+ "${FILESDIR}/${PN}-3.0.14-fix-std-string.patch"
+ "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch"
+)
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+ #
+ # --c++11 is required by scons instead of auto detection:
+ # https://jira.mongodb.org/browse/SERVER-19661
+
+ scons_opts=(
+ --variant-dir=build --cc=$(tc-getCC) --cxx=$(tc-getCXX) --c++11
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include )"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools || die
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr || die
+
+ local x
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ escons "${scons_opts[@]}" unittests || die
+
+ # tests fail
+ sed -i '/\/util\/options_parser\/options_parser_test/d' build/unittests.txt || die
+ sed -i '/\/mongo\/server_options_test/d' build/unittests.txt || die
+
+ local x
+ while read x; do
+ einfo "Running test $x"
+ ./$x || die
+ done < build/unittests.txt
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+}
diff --git a/dev-db/mongodb/mongodb-3.2.12.ebuild b/dev-db/mongodb/mongodb-3.2.12.ebuild
new file mode 100644
index 000000000000..52572e121314
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.2.12.ebuild
@@ -0,0 +1,192 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.2
+ || ( =dev-cpp/yaml-cpp-0.5.1 >dev-cpp/yaml-cpp-0.5.2 )
+ >=dev-libs/boost-1.57[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-4.8.2:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade an existing MongoDB deployment to 3.2, you must be"
+ ewarn "running a 3.0-series release. Please update to the latest 3.0"
+ ewarn "release before continuing if wish to keep your data."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-3.2.0-fix-scons.patch" \
+ "${FILESDIR}/${PN}-3.2.4-boost-1.60.patch"
+ if has_version ">=dev-libs/boost-1.62"; then
+ epatch "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch"
+ fi
+ epatch_user
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.2/"
+ ewarn " https://docs.mongodb.org/master/release-notes/3.2-upgrade/"
+ ewarn
+ ewarn " Starting in 3.2, MongoDB uses the WiredTiger as the default storage engine."
+}
diff --git a/dev-db/mongodb/mongodb-3.2.13.ebuild b/dev-db/mongodb/mongodb-3.2.13.ebuild
new file mode 100644
index 000000000000..52572e121314
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.2.13.ebuild
@@ -0,0 +1,192 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.2
+ || ( =dev-cpp/yaml-cpp-0.5.1 >dev-cpp/yaml-cpp-0.5.2 )
+ >=dev-libs/boost-1.57[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-4.8.2:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade an existing MongoDB deployment to 3.2, you must be"
+ ewarn "running a 3.0-series release. Please update to the latest 3.0"
+ ewarn "release before continuing if wish to keep your data."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-3.2.0-fix-scons.patch" \
+ "${FILESDIR}/${PN}-3.2.4-boost-1.60.patch"
+ if has_version ">=dev-libs/boost-1.62"; then
+ epatch "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch"
+ fi
+ epatch_user
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.2/"
+ ewarn " https://docs.mongodb.org/master/release-notes/3.2-upgrade/"
+ ewarn
+ ewarn " Starting in 3.2, MongoDB uses the WiredTiger as the default storage engine."
+}
diff --git a/dev-db/mongodb/mongodb-3.2.16.ebuild b/dev-db/mongodb/mongodb-3.2.16.ebuild
new file mode 100644
index 000000000000..f18602bddd95
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.2.16.ebuild
@@ -0,0 +1,191 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.2
+ >=dev-cpp/yaml-cpp-0.5.1
+ >=dev-libs/boost-1.57[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-4.8.2:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-fix-scons.patch"
+ "${FILESDIR}/${PN}-3.2.4-boost-1.60.patch"
+ "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch"
+ "${FILESDIR}/${PN}-3.2.16-Replace-string-with-explicit-std-string.patch"
+ "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch"
+)
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade an existing MongoDB deployment to 3.2, you must be"
+ ewarn "running a 3.0-series release. Please update to the latest 3.0"
+ ewarn "release before continuing if wish to keep your data."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ local x
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js || die
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.2/"
+ ewarn " https://docs.mongodb.org/master/release-notes/3.2-upgrade/"
+ ewarn
+ ewarn " Starting in 3.2, MongoDB uses the WiredTiger as the default storage engine."
+}
diff --git a/dev-db/mongodb/mongodb-3.4.3.ebuild b/dev-db/mongodb/mongodb-3.4.3.ebuild
new file mode 100644
index 000000000000..25b6b977c05c
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.4.3.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.3
+ >=dev-cpp/yaml-cpp-0.5.3
+ >=dev-libs/boost-1.60[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-5.3.0:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade from a version earlier than the 3.0-series, you must"
+ ewarn "successively upgrade major releases until you have upgraded"
+ ewarn "to 3.2-series. Then upgrade to 3.4 series."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-3.4.0-fix-scons.patch"
+ if has_version ">=dev-libs/boost-1.62"; then
+ epatch "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch"
+ fi
+ epatch_user
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.4/"
+ ewarn " https://docs.mongodb.com/manual/release-notes/3.4/#upgrade-procedures"
+}
diff --git a/dev-db/mongodb/mongodb-3.4.4.ebuild b/dev-db/mongodb/mongodb-3.4.4.ebuild
new file mode 100644
index 000000000000..ddb22087d4ab
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.4.4.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.3
+ >=dev-cpp/yaml-cpp-0.5.3
+ >=dev-libs/boost-1.60[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-5.3.0:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade from a version earlier than the 3.0-series, you must"
+ ewarn "successively upgrade major releases until you have upgraded"
+ ewarn "to 3.2-series. Then upgrade to 3.4 series."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-3.4.0-fix-scons.patch" \
+ "${FILESDIR}/${PN}-3.4.4-Replace-string-with-explicit-std-string.patch"
+ if has_version ">=dev-libs/boost-1.62"; then
+ epatch "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch"
+ fi
+ epatch_user
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.4/"
+ ewarn " https://docs.mongodb.com/manual/release-notes/3.4/#upgrade-procedures"
+}
diff --git a/dev-db/mongodb/mongodb-3.4.6.ebuild b/dev-db/mongodb/mongodb-3.4.6.ebuild
new file mode 100644
index 000000000000..5900f1f4fac4
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.4.6.ebuild
@@ -0,0 +1,191 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.3
+ >=dev-cpp/yaml-cpp-0.5.3
+ >=dev-libs/boost-1.60[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-5.3.0:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade from a version earlier than the 3.0-series, you must"
+ ewarn "successively upgrade major releases until you have upgraded"
+ ewarn "to 3.2-series. Then upgrade to 3.4 series."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-3.4.0-fix-scons.patch" \
+ "${FILESDIR}/${P}-no-boost-check.patch" \
+ "${FILESDIR}/${PN}-3.4.4-Replace-string-with-explicit-std-string.patch" \
+ "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch" \
+ "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch"
+
+ epatch_user
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.4/"
+ ewarn " https://docs.mongodb.com/manual/release-notes/3.4/#upgrade-procedures"
+}
diff --git a/dev-db/mongodb/mongodb-3.4.7.ebuild b/dev-db/mongodb/mongodb-3.4.7.ebuild
new file mode 100644
index 000000000000..2aef3eaf1253
--- /dev/null
+++ b/dev-db/mongodb/mongodb-3.4.7.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+SCONS_MIN_VERSION="2.3.0"
+CHECKREQS_DISK_BUILD="2400M"
+CHECKREQS_DISK_USR="512M"
+CHECKREQS_MEMORY="1024M"
+
+inherit eutils flag-o-matic multilib pax-utils scons-utils systemd toolchain-funcs user versionator check-reqs
+
+MY_P=${PN}-src-r${PV/_rc/-rc}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos libressl mms-agent ssl test +tools"
+
+RDEPEND=">=app-arch/snappy-1.1.3
+ >=dev-cpp/yaml-cpp-0.5.3
+ >=dev-libs/boost-1.60[threads(+)]
+ >=dev-libs/libpcre-8.39[cxx]
+ dev-libs/snowball-stemmer
+ net-libs/libpcap
+ >=sys-libs/zlib-1.2.8
+ mms-agent? ( app-admin/mms-agent )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.0.1g:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-5.3.0:*
+ sys-libs/ncurses
+ sys-libs/readline
+ debug? ( dev-util/valgrind )
+ kerberos? ( dev-libs/cyrus-sasl[kerberos] )
+ test? (
+ dev-python/pymongo
+ dev-python/pyyaml
+ )"
+PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch"
+ "${FILESDIR}/${PN}-3.4.0-fix-scons.patch"
+ "${FILESDIR}/${PN}-3.4.4-Replace-string-with-explicit-std-string.patch"
+ "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch"
+ "${FILESDIR}/${PN}-3.4.7-no-boost-check.patch"
+)
+
+S=${WORKDIR}/${MY_P}
+
+pkg_pretend() {
+ if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
+ ewarn "To upgrade from a version earlier than the 3.0-series, you must"
+ ewarn "successively upgrade major releases until you have upgraded"
+ ewarn "to 3.2-series. Then upgrade to 3.4 series."
+ fi
+}
+
+pkg_setup() {
+ enewgroup mongodb
+ enewuser mongodb -1 -1 /var/lib/${PN} mongodb
+
+ # Maintainer notes
+ #
+ # --use-system-tcmalloc is strongly NOT recommended:
+ # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
+
+ scons_opts=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+
+ --disable-warnings-as-errors
+ --use-system-boost
+ --use-system-pcre
+ --use-system-snappy
+ --use-system-stemmer
+ --use-system-yaml
+ --use-system-zlib
+ )
+
+ # wiredtiger not supported on 32bit platforms #572166
+ use x86 && scons_opts+=( --wiredtiger=off )
+
+ if use debug; then
+ scons_opts+=( --dbg=on )
+ fi
+
+ if use prefix; then
+ scons_opts+=(
+ --cpppath="${EPREFIX}/usr/include"
+ --libpath="${EPREFIX}/usr/$(get_libdir)"
+ )
+ fi
+
+ if use kerberos; then
+ scons_opts+=( --use-sasl-client )
+ fi
+
+ if use ssl; then
+ scons_opts+=( --ssl )
+ fi
+}
+
+src_compile() {
+ # respect mongoDB upstream's basic recommendations
+ # see bug #536688 and #526114
+ if ! use debug; then
+ filter-flags '-m*'
+ filter-flags '-O?'
+ fi
+ escons "${scons_opts[@]}" core tools
+}
+
+src_install() {
+ escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
+
+ local x
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners mongodb:mongodb "${x}"
+ done
+
+ doman debian/mongo*.1
+ dodoc README docs/building.md
+
+ newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
+ newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
+ newins "${FILESDIR}/${PN/db/s}.conf-r2" ${PN/db/s}.conf
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ # see bug #526114
+ pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
+}
+
+pkg_preinst() {
+ # wrt bug #461466
+ if [[ "$(get_libdir)" == "lib64" ]]; then
+ rmdir "${ED}"/usr/lib/ &>/dev/null
+ fi
+}
+
+src_test() {
+ # this one test fails
+ rm jstests/core/repl_write_threads_start_param.js || die
+
+ ./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed"
+}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 3.0 ${v}; then
+ ewarn "!! IMPORTANT !!"
+ ewarn " "
+ ewarn "${PN} configuration files have changed !"
+ ewarn " "
+ ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
+ ewarn " "
+ ewarn "Make sure you also follow the upgrading process :"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
+ ewarn " "
+ ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
+ ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
+ ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
+ ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
+ break
+ fi
+ done
+
+ ewarn "Make sure to read the release notes and follow the upgrade process:"
+ ewarn " https://docs.mongodb.org/manual/release-notes/3.4/"
+ ewarn " https://docs.mongodb.com/manual/release-notes/3.4/#upgrade-procedures"
+}
diff --git a/dev-db/mtop/Manifest b/dev-db/mtop/Manifest
new file mode 100644
index 000000000000..40ebaeffa64b
--- /dev/null
+++ b/dev-db/mtop/Manifest
@@ -0,0 +1,6 @@
+AUX mtop-0.6.6-globalstatusfix.patch 623 SHA256 a0c8f0a644b1b6d87c2bd172b03c7bc63a96134f291991b9a953811bb3d27f1f SHA512 848de7bda1a79bbe51b139b149720872a57e4fa12161fc822e69f393586817acbe14571841df5d327297546b4ad3a2725b7cd8d1815f80ffc0a2dfcbb9ea5005 WHIRLPOOL 211c3f3d2872762ada945b26c4ffddadcdbacd219876de68dfeeea88adb5c0353a6e44bdde4d058fe8cd65470ed13efd2965af8d863cb186d0d6a405bb35248e
+DIST mtop-0.6.6.tar.gz 48161 SHA256 2e7fc09511d2d0f130da1f52bf85fcfeea0be2cc3aa3d93b88498605c0281d74 SHA512 9befb1d44ef537c4abe0246ebbf20019499875d7e8efeac2fd1cf068dc577c2809bb0333ebf633982852446a0160d73ccfa0006dcfa42f7d95bbbf765f12ce17 WHIRLPOOL 7f85fa504882a789eb78919aa63084db2f7555a4d584b4a04f0183e92da7750f417357ab40b4558fcb928d6c8e6af0157888ad59186cdb3d0bdf82bc093d96ed
+EBUILD mtop-0.6.6-r3.ebuild 689 SHA256 04142ea0d391cfce6ae4d472d864d65fa3f59ee8762cb20fc873bc83a855252a SHA512 fe88f9bc1fd7f454183317ddaf0a02929d124ebac5dae2ee0deee4d777e8ae42ad4817d655857aec45c6b72e6c783b7ec0a2407afad98923c2aeec648d6500c6 WHIRLPOOL 11934359b766b8ea25386b9c4fd2d4b77ad408fe5b67bd9b23c30d9db756bfed7574620738e932ec4c4ef77850e4038f801c668d022d357878f974e6f9e04b85
+MISC ChangeLog 2465 SHA256 a097a2ee05ae5b03ff1cdff17ac346dd0f50ebd65cd2bd2b0f25fe985f51b683 SHA512 adf6399ed814fca2396f1483d498e307017dae8f95a82113cb479b37c39aef1aa084362d69ae68abd3bcb93d904405524b6d6cce85fdafa6cc3a188c00b30e71 WHIRLPOOL 9f0b0554482e65390f47164715c81c4015454a7fd039aa6c60b8254296e1ae03d2178fac05a06ae3cded38d9ee44bbcb293f93ee201bd63a0379143e6f0a05a0
+MISC ChangeLog-2015 1908 SHA256 569e53c2b85cbee751b1665796add70aea9863994a970c17e85a2100ab12dfc8 SHA512 948d36164fcc204b7d9fb7ff1c50b5c45ea285ec2e1e2d6ad5a5072295d036ac9df77bdc2339666118530e325e0997f203a8592061c012e2e8b2dfd4e778e3d3 WHIRLPOOL 2662bd6a68cfcf0170e4668b8f32d27c7085230a0dfd620335d440d65abebd7b8a0d8a5783b5efb7b56026da6d276148878897d3e1d35c7ebff34bc36119bfcc
+MISC metadata.xml 317 SHA256 36729a1a776cc96449186b37db67cb815090db8956c0704876ce0e042f1b4720 SHA512 20fab32a55c5ac7cdec57d533376c1dc642e30e75e2d9289f815293e734b9e21c1047cf28bba9f75808a9f2c77992ca651ecd3a244849479ad43bfa7fe02ec8c WHIRLPOOL 935274f3c1c3587b5baf3339ed6e95ae471699a6c9886333ba48a59e3d041aa090a9778b874d4d39bb5e07e6812bdf6ecf869d80cc8ca5f9b82928d35634a50d
diff --git a/dev-db/mtop/files/mtop-0.6.6-globalstatusfix.patch b/dev-db/mtop/files/mtop-0.6.6-globalstatusfix.patch
new file mode 100644
index 000000000000..1d10acc42a99
--- /dev/null
+++ b/dev-db/mtop/files/mtop-0.6.6-globalstatusfix.patch
@@ -0,0 +1,12 @@
+diff -ur mtop-0.6.6/work/mtop-0.6.6/mtop.PL mtop-0.6.6-r1/work/mtop-0.6.6/mtop.PL
+--- mtop-0.6.6/work/mtop-0.6.6/mtop.PL 2004-09-13 00:22:03.000000000 +0200
++++ mtop-0.6.6-r1/work/mtop-0.6.6/mtop.PL 2009-12-08 15:04:56.000000000 +0100
+@@ -568,7 +568,7 @@
+ die "Unable to connect to mysql [", $DBI::errstr, "]\n";
+
+ my $st_procs = $dbh->prepare("show full processlist");
+-my $st_status = $dbh->prepare("show status");
++my $st_status = $dbh->prepare("show global status");
+ my $st_kill = $dbh->prepare("kill ?");
+ my $st_flush = $dbh->prepare("flush status");
+ my $st_vars = $dbh->prepare("show variables");
diff --git a/dev-db/mtop/metadata.xml b/dev-db/mtop/metadata.xml
new file mode 100644
index 000000000000..b42d9d75d4c9
--- /dev/null
+++ b/dev-db/mtop/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">mtop</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mtop/mtop-0.6.6-r3.ebuild b/dev-db/mtop/mtop-0.6.6-r3.ebuild
new file mode 100644
index 000000000000..9a6df615b6d3
--- /dev/null
+++ b/dev-db/mtop/mtop-0.6.6-r3.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit perl-module
+
+DESCRIPTION="Mysql top monitors a MySQL server"
+HOMEPAGE="http://mtop.sourceforge.net"
+SRC_URI="mirror://sourceforge/mtop/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+DEPEND="dev-perl/Curses
+ dev-perl/DBI
+ dev-perl/DBD-mysql
+ virtual/perl-libnet"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}"/mtop-0.6.6-globalstatusfix.patch )
+DOCS=( ChangeLog README README.devel )
+
+warnmsg() {
+ einfo "Upstream no longer maintains mtop. You should consider dev-db/mytop instead."
+}
+
+pkg_postinst() {
+ warnmsg
+}
+
+pkg_preinst() {
+ warnmsg
+}
diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest
new file mode 100644
index 000000000000..58adc80886f6
--- /dev/null
+++ b/dev-db/mycli/Manifest
@@ -0,0 +1,7 @@
+DIST mycli-1.10.0.tar.gz 272722 SHA256 b0a4b7950783ecca7a129280b4f5ce9bc38b26311ea21199515e47677838451c SHA512 d66866fd23ee2be3f1bb47d1414b8151c2b50e8844a2553e139f753ae55dd010d1c23aae7c5863891ea4f347b124145405dc7894efc27fc8fcb74127c14261f8 WHIRLPOOL f12339070ec884f0ed37eaec0f0b448bb3f518805f5976172860c01d34a05ce0ce220986e9f5d4742e832b529e5d783abb799c69dc5d8386d1873ecf19478964
+DIST mycli-1.7.1.tar.gz 266597 SHA256 27c1bbaa100b1a3fe4adaaf09eab3a372c14a9c27d07fe41b3d6dad6c800bbe6 SHA512 5c61fe67f3205dd1123ed8d38441cda0574db04dd46b7e075d216f7aa8cd856a2f06a1b4bf7dbe9fd0b07f3e91c151fe3f885d10d3db488b6c306e0ce9ac9e7c WHIRLPOOL 265aa82c9c2306576abdb4a90e81baeea74b74c8ab31e430051f9b7de6125c568366efdec76a95d75e1d0bce2fbf4c3bb57e85e69a09a4632dfa56fba3546d5d
+EBUILD mycli-1.10.0.ebuild 821 SHA256 50beeed69f4807f661fae0b768a71dda5d84a500cc73b0b22b686559a088f436 SHA512 16df33c8943ccc83bb5e22f4207490d5850ce3d38d252c5f7035c066a906481a3ece64ec185c15fb5945d34a4ca1b88189c2233fb3f44eb0c1c89b3f2734bd1e WHIRLPOOL 51966054c80d81729526bffb6fc77a3217dac0316203eec0a8fd8b2b2128a0ab114045701bb65053482510b507e88c34388803f903dc687792383fd2181fa0a1
+EBUILD mycli-1.7.1.ebuild 939 SHA256 571d102045b7f271681ed64e3b148772a8e6b1403d909477ddb548a3258540e0 SHA512 75c6921589218796a539089db1c06e107efd506809d1e7337bddfe98d1491fc13e80500b0d0fa6364aad7ee751ed69e0a040339a918239b3a5268c0886fa4a03 WHIRLPOOL 3cd333257c6d0de59969aba0cdda65c54d2c8a71652f8031e0204927f6cbde3c240f90bc2d1d69e6f03a633d004a7776efc57aa8ec77a8b6968b6875ee012632
+EBUILD mycli-9999.ebuild 850 SHA256 b04409a45ec86c101de9f5054883d1e0bd2d27377f2a970670f3917801d85278 SHA512 943c12d1b8536b231bed08837a9260ed45d12f9794e16fe5f8de333ea49e00cc6335040e2f60589871072bf9406254683df29d75ad81a65eab1fdc4f3f6f661e WHIRLPOOL 5839a7f1845790a2ee3ba1422da912493bf557a2d58beaea6c9e04fdfc032a39e997532037febc9a61fa5118c198b3b905395fb0777363c02564aacf7538dd2a
+MISC ChangeLog 2178 SHA256 9812206e359d40668d79de15ac052c83721ec60550a40a839672438f49e71414 SHA512 30c07a3617fd131cebc6e4d7fc1737f3199aff5b23ca3df2b5fc2d7df95029aed467186b979e635b3308513136fee3376020037d7289a2aec725d660b2617969 WHIRLPOOL a612ea1dda6a648a4c84d8dfa2b9ab4d945eb2594833821bbbc8fae78519c9228f0493ae3c1262fab39e38ba943647f22ad4c562c45d12308b60e5c28569a9ac
+MISC metadata.xml 322 SHA256 d4524ef56bca926d08996b7a59b54e4f92ea2b658fe09c0343733f2db112272e SHA512 ae5215f13b457aa43dc95d67bacc371292f0c8f6540dcb49633f0120232dbde7fe12479c3ff16c203b20ac96700be12c187444a768f50e319320684553509dd1 WHIRLPOOL dbf5fa6725d51a3f584dcb8d8088688ba546b7f4e6e132c50c9748c3abaf2634ea123aa3a54b5c0a71c4b5a9432ad82957892fb9ab4e72e602920a85bc585834
diff --git a/dev-db/mycli/metadata.xml b/dev-db/mycli/metadata.xml
new file mode 100644
index 000000000000..c80f94490085
--- /dev/null
+++ b/dev-db/mycli/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grknight@gentoo.org</email>
+ <name>Brian Evans</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">dbcli/mycli</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mycli/mycli-1.10.0.ebuild b/dev-db/mycli/mycli-1.10.0.ebuild
new file mode 100644
index 000000000000..ea8f4543b3fb
--- /dev/null
+++ b/dev-db/mycli/mycli-1.10.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+inherit distutils-r1
+
+DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
+
+HOMEPAGE="http://mycli.net"
+SRC_URI="https://github.com/dbcli/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+RDEPEND="
+ >=dev-python/click-4.1[${PYTHON_USEDEP}]
+ >=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
+ >=dev-python/prompt_toolkit-1.0.10[${PYTHON_USEDEP}]
+ dev-python/pycryptodome[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.0[${PYTHON_USEDEP}]
+ >=dev-python/pymysql-0.6.7[${PYTHON_USEDEP}]
+ >=dev-python/python-sqlparse-0.1.19[${PYTHON_USEDEP}]
+"
diff --git a/dev-db/mycli/mycli-1.7.1.ebuild b/dev-db/mycli/mycli-1.7.1.ebuild
new file mode 100644
index 000000000000..8be1e51a3302
--- /dev/null
+++ b/dev-db/mycli/mycli-1.7.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_4} )
+inherit distutils-r1
+
+DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
+
+HOMEPAGE="http://mycli.net"
+SRC_URI="https://github.com/dbcli/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+RDEPEND="
+ >=dev-python/click-4.1[${PYTHON_USEDEP}]
+ >=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
+ >=dev-python/prompt_toolkit-1.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pycrypto-2.6.1[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.0[${PYTHON_USEDEP}]
+ >=dev-python/pymysql-0.6.6[${PYTHON_USEDEP}]
+ >=dev-python/python-sqlparse-0.1.19[${PYTHON_USEDEP}]
+"
+
+src_prepare() {
+ rm mycli/packages/counter.py || die "Could not remove python 2.6 counter.py"
+ distutils-r1_src_prepare
+}
diff --git a/dev-db/mycli/mycli-9999.ebuild b/dev-db/mycli/mycli-9999.ebuild
new file mode 100644
index 000000000000..e58d1eb05b00
--- /dev/null
+++ b/dev-db/mycli/mycli-9999.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+EGIT_REPO_URI="https://github.com/dbcli/mycli.git"
+inherit distutils-r1 git-r3
+
+DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
+
+HOMEPAGE="http://mycli.net"
+SRC_URI=""
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+RDEPEND="
+ >=dev-python/cli_helpers-0.1.0[${PYTHON_USEDEP}]
+ >=dev-python/click-4.1[${PYTHON_USEDEP}]
+ >=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
+ dev-python/cryptography[${PYTHON_USEDEP}]
+ >=dev-python/prompt_toolkit-1.0.10[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.0[${PYTHON_USEDEP}]
+ >=dev-python/pymysql-0.6.7[${PYTHON_USEDEP}]
+ >=dev-python/python-sqlparse-0.2.2[${PYTHON_USEDEP}]
+"
diff --git a/dev-db/mydumper/Manifest b/dev-db/mydumper/Manifest
new file mode 100644
index 000000000000..9bd99aaac021
--- /dev/null
+++ b/dev-db/mydumper/Manifest
@@ -0,0 +1,8 @@
+AUX mydumper-mariadb-include-fix.patch 696 SHA256 b7c2998f31453360d1891e10856210e98672055ecf81b9133eda22564c90af53 SHA512 e4343f00f0f61d63ec8621d42537411158a995e624562f71d322357a7322b46aef8859252e8b8c5c51370247ff70d2cb5187ff33be56e964e54a2e392124fc7c WHIRLPOOL edca806761d639eee3f671dd400ff3d60b5ec66b46b998e7ae771cd21b3eca5bec46aa586505c7062bc8ff2aa8e4fc3ecf0e23fb4b2478878fb82c7944183457
+DIST mydumper-0.6.2.tar.gz 40165 SHA256 fa28563e8967752828954c5d81e26ef50aad9083d50a977bf5733833b23e3330 SHA512 ef9e48cc481f2674456659c061c45f3cb056180ab5576805e75d458658e94998758b894e45ddc06fb716c1d37fedefb644158f07cf6e77f4b5477663e954eb83 WHIRLPOOL 867b7efa6ca00dcfbb32f5dda2b63de038d0da3ac1a127059cbfdae9af577fef74868c38dad2bd5b5a9b4de76f7d108fcb6232b27c41d3062f413eac4cac843b
+DIST mydumper-0.9.3.tar.gz 45320 SHA256 2cd6a074bac7072905bd044ec20955c53c81b10e877ac9c644509940a8d201fb SHA512 3bc2c85dbedf234aecca3b66f445e42bb7ddff83f914d5cc231f6a5755d1c2bf300ae9bf4bdea0717b45ea5338c6c336ec44f375dbf29570ed785ffddda53898 WHIRLPOOL 09988aa314ede6e56ce82c6eade9d29770ca2cbc39d4b2f1cd3f8403f9521e1aa5a372fda7992885c1c25743cc59d4c41cdce8d86eb79b8c7725631c2919c9ae
+EBUILD mydumper-0.6.2.ebuild 923 SHA256 6c52294cdff77ad253cb1efa360ed2aaea01896d34205b3c372ac5727ed8faf6 SHA512 9416dde31e347bad594cd54ae223ba00038f392d0fe372acccc781b4dbafce89a4113c09efd3ffb4a9973f0dbdacbd631d4229f0a2a966c0aaab047cf83d8f9d WHIRLPOOL 6e43db2d36671931bdde54c2f34ee500001f0ee05545c0c6a4ea5d36faa4164f837da29ed672337ca40c03072ff3530f253b046af7639ba90e7e99ec7f8cafa6
+EBUILD mydumper-0.9.3.ebuild 1030 SHA256 452452ce20ac7136f8b77d7310197dd728dc2a9432757d4bbffdf92167deaa40 SHA512 9d0514b4d1690855c8e828ee29e767410ab19f6726f10eb381c9bed0a0c42e63fa7eed88fc278e532d951f49652d0675d839e3d14c650eb352831cd5f7eacccf WHIRLPOOL 60584b90fec8bc5bc1c3c28eaa6767862923410f17612d7ca7c2e6f9e36c8b7bef090b79ce6650bd18e4db891b23aab2bb050d21286ebdbce5331f1cc6cdeea8
+MISC ChangeLog 2725 SHA256 d1ecaf2b0c71e99c461f83588d14e73b773277a4aecf10aeda571f84b4a342f8 SHA512 c9eb636071b042ccae43a5b8af330dfed81f2547467931146ad66a360fae0c058abcab3d9a18451d8e5d323c92fe5c8db1e4325b7b76c54477df94cf290a91c6 WHIRLPOOL ef094c02e8427ec6fcaf2e10b6e10e6dd8eb2045b69831de35711398607e28eaaf5b5c0ac76af0d6040602201c799208901f8c24bb75356614f6d2fbb00d7a41
+MISC ChangeLog-2015 1534 SHA256 c65362f5aafb0d2cafc22db7177e28dce95edd3f8bf5d38711440872c3e72c0e SHA512 e269d766dbba9ce8913397f4321d30545bb06e58042619eed88d2de19d69c9f21ec1a0146cc10e9226e6b6394d5b37469754ae1d27cf33a4ddf93a15f1d6ff9b WHIRLPOOL 6640ffed60e7253d2373db39d26c6459803387b55ffa10483d8ce0c69fbb697630e5e33f77904bb5c7e6b8c8c02b317ecf8541d3c958612792e8ed14979a88f3
+MISC metadata.xml 448 SHA256 f67c25fe06defd93c231d0c47d8c25dc1b9e9209f3ce8ab50e2b5b3c5da8e9a8 SHA512 192415f225533e6195856255483cb80c5da21f496bfe048518dbfccf8cdc049339ab5322d125e627a3a84fcdfb052012fd57cbe2083118917b35796f7a9e9353 WHIRLPOOL bf616b518dbc668cbc7d3bc41955253dcca574778a96268bfc8474995b7e658e282fea428940c1e465b7d31d2c9444d7bd3f027febbc13b91b208e8c1b5b51b2
diff --git a/dev-db/mydumper/files/mydumper-mariadb-include-fix.patch b/dev-db/mydumper/files/mydumper-mariadb-include-fix.patch
new file mode 100644
index 000000000000..0914b3acff6a
--- /dev/null
+++ b/dev-db/mydumper/files/mydumper-mariadb-include-fix.patch
@@ -0,0 +1,24 @@
+--- a/mydumper.c 2017-09-07 14:53:02.000000000 +0000
++++ b/mydumper.c 2017-10-06 17:39:34.962315949 +0000
+@@ -22,6 +22,9 @@
+ #define _FILE_OFFSET_BITS 64
+
+ #include <mysql.h>
++#if defined(MARIADB_BASE_VERSION) && defined(MARIADB_VERSION_ID)
++ #include <server/mysql_version.h>
++#endif
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <string.h>
+--- a/myloader.c 2017-09-07 14:53:02.000000000 +0000
++++ b/myloader.c 2017-10-06 17:39:28.962315949 +0000
+@@ -19,6 +19,9 @@
+ #define _FILE_OFFSET_BITS 64
+
+ #include <mysql.h>
++#if defined(MARIADB_BASE_VERSION) && defined(MARIADB_VERSION_ID)
++ #include <server/mysql_version.h>
++#endif
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <string.h>
diff --git a/dev-db/mydumper/metadata.xml b/dev-db/mydumper/metadata.xml
new file mode 100644
index 000000000000..b7a839d9622c
--- /dev/null
+++ b/dev-db/mydumper/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hydrapolic@gmail.com</email>
+ <name>Tomáš Mózes</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">maxbube/mydumper</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mydumper/mydumper-0.6.2.ebuild b/dev-db/mydumper/mydumper-0.6.2.ebuild
new file mode 100644
index 000000000000..b28500bd888b
--- /dev/null
+++ b/dev-db/mydumper/mydumper-0.6.2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit cmake-utils versionator
+
+DESCRIPTION="A high-performance multi-threaded backup toolset for MySQL and Drizzle"
+HOMEPAGE="https://launchpad.net/mydumper"
+SRC_URI="https://launchpad.net/mydumper/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+RDEPEND="dev-libs/libpcre
+ virtual/mysql
+ dev-libs/glib:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( <dev-python/sphinx-1.3 )"
+
+DOCS=( README )
+
+src_prepare() {
+ # respect user cflags; do not expand ${CMAKE_C_FLAGS} (!)
+ sed -i -e 's:-Werror -O3 -g:${CMAKE_C_FLAGS}:' CMakeLists.txt
+ # fix doc install path
+ sed -i -e "s:share/doc/mydumper:share/doc/${PF}:" docs/CMakeLists.txt
+}
+
+src_configure() {
+ mycmakeargs=( $(cmake-utils_use doc BUILD_DOCS) )
+
+ cmake-utils_src_configure
+}
diff --git a/dev-db/mydumper/mydumper-0.9.3.ebuild b/dev-db/mydumper/mydumper-0.9.3.ebuild
new file mode 100644
index 000000000000..b4970ec03bf0
--- /dev/null
+++ b/dev-db/mydumper/mydumper-0.9.3.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils
+
+DESCRIPTION="A high-performance multi-threaded backup (and restore) toolset for MySQL"
+HOMEPAGE="https://github.com/maxbube/mydumper"
+SRC_URI="https://github.com/maxbube/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+CDEPEND="dev-libs/glib:=
+ dev-libs/libpcre:=
+ dev-libs/openssl:=
+ sys-libs/zlib:=
+ virtual/mysql"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/sphinx )"
+RDEPEND="${CDEPEND}"
+
+PATCHES=( "${FILESDIR}/${PN}-mariadb-include-fix.patch" )
+
+src_prepare() {
+ # respect user cflags; do not expand ${CMAKE_C_FLAGS} (!)
+ sed -i -e 's:-Werror -O3 -g:${CMAKE_C_FLAGS}:' CMakeLists.txt || die
+
+ # fix doc install path
+ sed -i -e "s:share/doc/mydumper:share/doc/${PF}:" docs/CMakeLists.txt || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=("-DBUILD_DOCS=$(usex doc)")
+
+ cmake-utils_src_configure
+}
diff --git a/dev-db/myodbc/Manifest b/dev-db/myodbc/Manifest
new file mode 100644
index 000000000000..e2b563d4bcd4
--- /dev/null
+++ b/dev-db/myodbc/Manifest
@@ -0,0 +1,21 @@
+AUX 5.2.7-mariadb-dynamic-array.patch 3053 SHA256 132b49d939fe26939e3c794a1db7dc50f28e552c81db7913006dfee45cb4b503 SHA512 26d35effbf4e74ef634c6e42dced40830402aa0925571f4bd55acd3dfe06f1c8c8f3bab4e9bb4bcd3f72dc87ecc3a093b984df4837548710899f97d8bdeca7b6 WHIRLPOOL a778ec270547a4fd0f7907f7eb5005da966575f77c9c886f545c393e4a21ac58656316202d5bd48cc7523d35e61a97c806564dbf7a7573009780c8c936d502ee
+AUX 5.2.7-my_malloc.patch 594 SHA256 288e79c561f40213b2f2290a5fd39993ea8ab7273b8114de156707ba5bf30687 SHA512 bcd26b2f8de21404c741fec51bb7e7bec32a5d3fbc90471c157ee275dc6136a44a6ef4d2ad8dd170e2852679d3fcb0cc74cf4acca0570702206b4cded1cb1fa5 WHIRLPOOL 99936627e17eb2b77b2fac5ff6eb779a23d67131efec705f59b72b8a402059fdf76f982b4a52c157697df6658f6ae372a201fb193c28e6dc4dd0af209dde99cb
+AUX 5.2.7-r1-cxxlinkage.patch 1707 SHA256 323beef3086506a7313507403ff632ac00ab86a082eb71e44bdffd5dc2f176dd SHA512 3d0f1839e1b200d7746d2c7161ee2a85813bf40517a70777d361e482efd6d6b0be88415d339d6dccc49de865a0d714fbbce2b74abb1bbc12c4f4681a5bd5abf8 WHIRLPOOL 2823b2bf237c999ddb0caac94abd7bcd3ec04dda01d3440982d537557aee29f4cf14b464607dcc6681c8b990b87caedc9864a04ebe3fe831bb4e0dab9a1c1e80
+AUX 5.3-cmake-doc-path.patch 1480 SHA256 651402ff7247b0412f80beb8b511083dd2383ffc576d18f1d2d1d014b252a2ef SHA512 aa2303161af2b53608acc127464951cf77492a1a90e869a58893ba10a014077d7f8f319325b77713fffceeaa002943f4ce52b6cb9571b0b3d3d7ab562601968d WHIRLPOOL 890c50110dfd50dd5da8074a2cdd3f2eae637d1bdb7744b506f43e877d52d06706fe1dafaeeb224982d57952724285b1eaf839baeb498ad0447fb8394775aee2
+AUX 5.3-cxxlinkage.patch 1687 SHA256 319fa52311bf0e61f65ba6e656528a09bb882a735e6b755b959e3ef85cb459ec SHA512 404242e009e3c22000d599be20856e7610f845abc086519082d9b45ad3a904cfcc569cdcab5eade904a8b27b59af954df0cba870520792290187259a9b0012bc WHIRLPOOL 634cd57264ebd67cb0cd2b20b86245bff1cca0631499412a2d3d87f78cd18a9800689cba5e25512ffe69faa8277ea66c3381b229e99643e0d9ea92b454367be9
+AUX 5.3-mariadb-buffer_length.patch 3242 SHA256 6794dc5eea55fb3d5dda50a2b610c2e49bfc0e503a93278e76fd812dd15a3015 SHA512 b267c76da77594715edff83aa223d0e45f7b369a142707f91f44a7c862fdf319d6ffd8726927fd7f44b32a779a0fc96b87e04f882d6cf99f7df0385eaa8021c2 WHIRLPOOL 62d3eb8d937902026143d2f94c9a19976a91ec7e5d5a497560992dd11946c2ceca87a5c7071a5f778340656d42b299e638e98dfbed10381b1611aada0a60fdb8
+AUX 5.3-mariadb-dynamic-array.patch 3654 SHA256 ffb6402a4352c510913e9c74cbebeb370146c6905d7f052a83f8125d66e1129c SHA512 8599fb01062db680dbfd0f054eab0f91b5ca8f1799fd602ff4634241936ab4d8f5e26e6149f6d92e97241c953369259a142b1ab02e9b8bbe6fb16cd44d78ffff WHIRLPOOL 11b8da64803a72f5ca4958d734be22fc7a43525f547cf61df74946e6009eb72b94625767de2958ec7940fe505fc718cd46636303babc9710aed148db44906c51
+AUX cmake-doc-path.patch 1498 SHA256 75477998ba483fb1f6a5dde6cbd4719ac2e98e32540e7eb46bd334a0b354abe2 SHA512 2e48af11efb55a1508402d5d1d717a3dfc9897bf0ccce5aa190792fb673ac78b27a9480e951a6347a2c8d0e2fe08a28c11fd08c55dbea835a93f525decaaf09e WHIRLPOOL 0631c7cef81bb8541ca0af96afcf9ed8118aef87702d89d5237a8744bc6d9324b6cb148f3c32e4d225df038d15ad5c8583d0a6a49e33e9fc7b9cd44b319982be
+AUX odbc.ini.m4 406 SHA256 e411dc47ade65b0c408dd37d6a390f0ee6b6997f34e79077e2b9684f69a1300e SHA512 84ab2a3aab594123d42b65205a7faf8e91fe9416a9e3c4c4c354533b9a298395f59172649c91dc0b671392bfbe5baeaddb6aa47119ce4c825917f3977d9dd521 WHIRLPOOL 79f919fd0da516b308d58dab2d98f6f7d65f76baf4a7d425fa95641b13081688aa82476ccd513b104ed09df4164884fcaecfef49992c40d5e275bab402d60930
+AUX odbcinst.ini.m4 118 SHA256 4e15c14ca1d16d1bea9a81601cee228405ccd1934a02d83e89cb695f7c24e69f SHA512 6d929bbffd602a9f060a05998149a6b16334f8a5e3db30d02ff5d38c0065085d085042521e700b87a63766e32aa27ae92be72cef33c2a7aa8f6767b6b71c82c8 WHIRLPOOL ec32bca678d1c7fbada53691feaaf28acc7a2e672a4544ad95c8da21296b2419b491e6e154060b90b4fe09241e02b86b8b0f22416569440a3eeb687a1340e33e
+DIST mysql-connector-odbc-5.2.7-src.tar.gz 606472 SHA256 0ad8fcccb4c41c7100fe02ec0aa87938d33329d23f7b68d1b9031c87750392c9 SHA512 f54ac8a23ade71da85e1335e95eccdccfd68a8687d17a584ced103812bdc5aee8014769a84eaa22724bb2cb23d34c7188c964d3283723defeaef5157a4b3c60f WHIRLPOOL 928808ac5b623ec345c8c1b8495ca1de7f10e65f0d14720e9bee6ab154ccf818ca690745a57fa7fa1c008ba57b24705657398cd9146fbf2e385c178deca0e499
+DIST mysql-connector-odbc-5.3.8-linux-debian8-x86-32bit.tar.gz 11295329 SHA256 67b7648f896c059aa7686b6384eadaddfe7043160b6f23edf3f78499e02cff45 SHA512 5d13d8545f3868eeaceb6e5d8b0f1a3ba8e5ce916ffa6d94467f0b5a0c057129d09fedb0084b25fe36da250aaf8bb21ba991696c1ed0def338792c2e4b592b56 WHIRLPOOL 00fd263c7eec68108b0f53c726a656f66a77627798c13ec9ec15aa3b6e4c51f8ef3562f7fbc3872b33320262b913fe646adc0013e8f8ba9c0dd931bc8f46b94f
+DIST mysql-connector-odbc-5.3.8-linux-debian8-x86-64bit.tar.gz 11782557 SHA256 e224456af3af1121e655c04cf809aad97471fcf2ff0082a21ed7b3ac69437776 SHA512 c28c1851a6ca560db78f96610b631edeeefb0006032eb17e3bd55da955abbbdfcf72d4a9b305a21151bb08a28b141ac89b3688cf778bfbc91393bfabb5e63783 WHIRLPOOL 4b9fd8169c77323247f61c6d2f3c843d5f8b3f5b89f9b134a3eec2d2a24c1b8a6a5b1d54241e6f3a6a05636d7701be5fac9a8f4b559555e7b12d65c4eda3172c
+DIST mysql-connector-odbc-5.3.8-src.tar.gz 690403 SHA256 eca40e1ad359cd1d7e23b6692e60179c8e3daa66337e7a0232de4162664d9885 SHA512 4703deab548f2953a58421b20977ced8dfd197d5274f89dd9e080cebdf35da007e558d5d52b6b09109744eddc2905c834f1e3e2ac83df4249d069d5e14fd34ee WHIRLPOOL 9286058a7d57e13e9a2e683682d87e0226e0e451880a20579867b673144d69f7941fbe16706267ca2caa058b1aef15fb4516445af8ab164fb745cd81a0c2814f
+EBUILD myodbc-5.2.7-r1.ebuild 3365 SHA256 beb1762ace59190dae72894cc53471a1e8b6bce2b476ce6f45b155f2db2aad3c SHA512 a88183fe7f51a2ba092b9128e686bfcc2e087e538e25d2a112b8854203f027e25f4119edae2ea8c6247697fa1dcbc678e6502daa480a84ca0bac983edcff3c45 WHIRLPOOL 89bcf6787cc1844e8bb7ced0a853f8a5cad600f89c22dda7fadd69870457cca462fd9a3861d1a562800b86271a43dcbbc6ebdef7a6c24687aae52ab5634152d6
+EBUILD myodbc-5.2.7-r2.ebuild 3484 SHA256 48d19a7e86803836f33f1395851c38053afe9547478f202682f280d465bef836 SHA512 af941381825c2bcc6de112ecf3fa928c178c41af43d29d708ac052f906591452ff0eb7c1e44eed27ee533826663699172ba321af7c27ba3705eaf8447149604f WHIRLPOOL bf867c41c25e8ccb43ba9ac577b83ffe3c614385fdcd2a7acdce9c53f08d1871226b408249a66460b7b4cf3bc9193bfc000fb359fc32d958ce700e28dbee5ee9
+EBUILD myodbc-5.3.8-r1.ebuild 3075 SHA256 deffff566e4f65458e1d5c094c318b8a0df82f7d8d095d477ae4c4fddb4fb5e9 SHA512 1629ffe70f9f960b7e9e9bba95193c9e75e20d77c90324c70fd259b7e983374d85fd2591e6fcab908480e82ec264ea1d5d27d21532de05a68fb1977465dd8b1e WHIRLPOOL 65e20a131a0170fe7941bb49fdac480b0434cb21d7f0a5fa55a3b88559fec04e3912073d9ea293092ff4bfd252a471a7b14eb135f00d1adf9981172558a15d47
+EBUILD myodbc-5.3.8.ebuild 3932 SHA256 a3b56805b7ea781ffc3ffe0bd9d809b687cb959fd8a60216f595274f00d6989c SHA512 9e8e780e7f5c190716a4568184e168b55912d9e079f810debbeba691ca9764200fc7a6f518063f86b1722609ed287f08375a7f2223b1eee955654cb5b0fd62f7 WHIRLPOOL b6fd8800d5f13ddea6b75720a8a97905c9494db304f9faef99ca5d93b42122db14238fc2f90aee9ad30e5e9387601c8e7e8b40bc84d8229be287e23a3942a86b
+MISC ChangeLog 2825 SHA256 89bf310dd222a30144be56460c6fb96d1c11e587930127bdaec28f0de2788836 SHA512 f5c55bde847b658bb57d5a0d33678c500e3ae2454b33f73198d6a8bc8721b41e72c1c8af6aafe8cc90be74f5fdecc60959395450efc46aadc8871b48aa14a304 WHIRLPOOL d420c0aa58cf427abdc3631982f7f5ed41bd9931cb5ec2cb11f38074ab7fcdf861634c5437d964b259ae861781097ee98b0f83fdd5c04796400facad4d22cd16
+MISC ChangeLog-2015 6332 SHA256 9d1fd022bebea13d7e022ae399c5bd9d7f6736d6861fc0bcca5d4a3100e089e0 SHA512 7dcf5931409c9570a1e9e328dfdc30974cd38a6e1207a81e6c8eb6a045e4f65d23b23fc1c3289f3cb25c5a9dc1f021ca566390e96e2c24a4d65ff6dc56ee5eed WHIRLPOOL d1ce37c34ad52b688a9a7493a787b3eae72d6498191600afdf7a3c1fb322ef491d28e7a87f84ac07a995d68f17225dea8a8c4fa622e305aa72ab0c7867b4cae4
+MISC metadata.xml 239 SHA256 a35e1476a1677a91f06dd6e4f955fcebc58c3a07f934b5e62fbf801573a5c82b SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b WHIRLPOOL 3ed1945907fa58cbc9997c311d1d0431d481586576ce45b4bc5caf7704ddefe2117305879a97e8021694b86af0d570a34517212b6cc9528224b85e568eee3d75
diff --git a/dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch b/dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch
new file mode 100644
index 000000000000..6cfe7cd274b3
--- /dev/null
+++ b/dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch
@@ -0,0 +1,79 @@
+diff -aurN a/driver/catalog_no_i_s.c b/driver/catalog_no_i_s.c
+--- a/driver/catalog_no_i_s.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/catalog_no_i_s.c 2014-08-20 14:08:33.997339096 -0400
+@@ -1093,7 +1093,11 @@
+ unsigned long *lengths;
+ SQLRETURN rc= SQL_SUCCESS;
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ my_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0, MYF(0));
++#else
+ my_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0);
++#endif
+
+ /* Get the list of tables that match szCatalog and szTable */
+ pthread_mutex_lock(&stmt->dbc->lock);
+diff -aurN a/driver/desc.c b/driver/desc.c
+--- a/driver/desc.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/desc.c 2014-08-20 14:07:37.409169269 -0400
+@@ -63,8 +63,12 @@
+ but in desc_get_rec we manually get a pointer to it. This avoids
+ having to call set_dynamic after modifying the DESCREC.
+ */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (my_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (my_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ x_free((char *)desc);
+ return NULL;
+ }
+@@ -995,9 +1003,15 @@
+
+ /* copy the records */
+ delete_dynamic(&dest->records);
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (my_init_dynamic_array(&dest->records, sizeof(DESCREC),
++ src->records.max_element,
++ src->records.alloc_increment, MYF(0)))
++#else
+ if (my_init_dynamic_array(&dest->records, sizeof(DESCREC),
+ src->records.max_element,
+ src->records.alloc_increment))
++#endif
+ {
+ return set_desc_error(dest, "HY001",
+ "Memory allocation error",
+diff -aurN a/driver/handle.c b/driver/handle.c
+--- a/driver/handle.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/handle.c 2014-08-20 14:05:00.364248403 -0400
+@@ -403,7 +403,11 @@
+ }
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ my_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10, MYF(0));
++#else
+ my_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10);
++#endif
+ memset((*param_bind)->buffer, 0, sizeof(MYSQL_BIND) *
+ (*param_bind)->max_element);
+
+diff -aurN a/driver/parse.c b/driver/parse.c
+--- a/driver/parse.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/parse.c 2014-08-20 14:03:54.336383876 -0400
+@@ -129,8 +129,13 @@
+
+ /* TODO: Store offsets rather than ptrs. In this case we will be fine
+ if work with copy of the originally parsed string */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ my_init_dynamic_array(&pq->token, sizeof(uint), 20, 10, MYF(0));
++ my_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10, MYF(0));
++#else
+ my_init_dynamic_array(&pq->token, sizeof(uint), 20, 10);
+ my_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10);
++#endif
+ }
+
+ return pq;
diff --git a/dev-db/myodbc/files/5.2.7-my_malloc.patch b/dev-db/myodbc/files/5.2.7-my_malloc.patch
new file mode 100644
index 000000000000..bc6c65ef3011
--- /dev/null
+++ b/dev-db/myodbc/files/5.2.7-my_malloc.patch
@@ -0,0 +1,18 @@
+diff -Brau a/util/odbcinstw.c b/util/odbcinstw.c
+--- a/util/odbcinstw.c 2014-04-23 21:54:40.000000000 +0200
++++ b/util/odbcinstw.c 2015-05-08 15:29:09.400568356 +0200
+@@ -68,13 +68,7 @@
+
+ if (lpszRetBuffer && cbRetBuffer)
+ {
+- ret= malloc(cbRetBuffer + 1);
+- /*
+- We cannot rely on getting correct results from the next call of
+- SQLGetPrivateProfileString. So, taking precautions against unititialized
+- values in the allocated buffer.
+- */
+- memset(ret, 0, cbRetBuffer + 1);
++ ret= my_malloc(cbRetBuffer + 1, MYF(MY_ZEROFILL));
+ }
+ else
+ ret= NULL;
diff --git a/dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch b/dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch
new file mode 100644
index 000000000000..2bdb4a581c89
--- /dev/null
+++ b/dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch
@@ -0,0 +1,40 @@
+diff -uarN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake 2014-06-18 18:50:16.000000000 -0400
++++ b/cmake/FindMySQL.cmake 2014-08-20 10:05:00.191485304 -0400
+@@ -105,16 +105,16 @@
+ # Finally remove the dot
+ STRING(REGEX REPLACE "[.]" "" MYSQL_NUM_VERSION "${MYSQL_NUM_VERSION}")
+
+- IF(MYSQL_CXX_LINKAGE OR MYSQL_NUM_VERSION GREATER 50603)
++ IF(MYSQL_CXX_LINKAGE)
+ EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--cxxflags"
+ OUTPUT_VARIABLE _mysql_config_output
+ )
+ SET(MYSQL_CXX_LINKAGE 1)
+- ELSE (MYSQL_CXX_LINKAGE OR MYSQL_NUM_VERSION GREATER 50603)
++ ELSE (MYSQL_CXX_LINKAGE)
+ EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--cflags"
+ OUTPUT_VARIABLE _mysql_config_output
+ )
+- ENDIF(MYSQL_CXX_LINKAGE OR MYSQL_NUM_VERSION GREATER 50603)
++ ENDIF(MYSQL_CXX_LINKAGE)
+
+ # Remove the stl4port dependency
+ STRING(REGEX REPLACE "-library=stlport4" "" _mysql_config_output "${_mysql_config_output}")
+diff -aurN mysql-connector-odbc-5.2.7-src.orig/CMakeLists.txt mysql-connector-odbc-5.2.7-src/CMakeLists.txt
+--- a/CMakeLists.txt 2014-08-27 13:51:27.050553560 -0400
++++ b/CMakeLists.txt 2014-08-27 13:55:41.702359680 -0400
+@@ -256,10 +256,9 @@
+ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+ SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
+
+-SET(LIB_SUBDIR "lib")
+-IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|ppc64|ppc64p7|s390x|sparc64)")
+- SET(LIB_SUBDIR "lib64")
+-ENDIF()
++IF(NOT LIB_SUBDIR)
++ MESSAGE(ERROR "LIB_SUBDIR is not set")
++ENDIF(NOT LIB_SUBDIR)
+ MESSAGE(STATUS "Installation library subdir: ${LIB_SUBDIR}")
+
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
diff --git a/dev-db/myodbc/files/5.3-cmake-doc-path.patch b/dev-db/myodbc/files/5.3-cmake-doc-path.patch
new file mode 100644
index 000000000000..54f35d41d96a
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-cmake-doc-path.patch
@@ -0,0 +1,43 @@
+=== modified file 'CMakeLists.txt'
+--- a/CMakeLists.txt 2013-03-09 09:51:06 +0000
++++ b/CMakeLists.txt 2013-03-09 11:05:27 +0000
+@@ -33,6 +33,12 @@
+
+ INCLUDE(version.cmake)
+
++IF(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${WITH_DOCUMENTATION_INSTALL_PATH})
++ELSE(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/myodbc-${CONNECTOR_MAJOR}.${CONNECTOR_MINOR})
++ENDIF(WITH_DOCUMENTATION_INSTALL_PATH)
++
+ #Default is to build both drivers
+ IF(UNICODE OR NOT ANSI)
+ MESSAGE(STATUS "Configuring to build Unicode driver")
+@@ -329,19 +335,17 @@
+
+ ELSE(WIN32)
+
+- INSTALL(FILES ChangeLog DESTINATION .)
+- INSTALL(FILES README DESTINATION .)
+- INSTALL(FILES README.debug DESTINATION .)
+- INSTALL(FILES INSTALL DESTINATION .)
++ INSTALL(FILES ChangeLog DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README.debug DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES INSTALL DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
+- INSTALL(FILES COPYING DESTINATION .)
+ ELSE()
+- INSTALL(FILES LICENSE.mysql DESTINATION .)
+ ENDIF()
+
+ ENDIF(WIN32)
+
+-INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION .)
++INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+
+ INCLUDE(CPack)
+
+
+
diff --git a/dev-db/myodbc/files/5.3-cxxlinkage.patch b/dev-db/myodbc/files/5.3-cxxlinkage.patch
new file mode 100644
index 000000000000..319262c81ca3
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-cxxlinkage.patch
@@ -0,0 +1,43 @@
+diff -aurN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake 2016-11-29 07:40:13.000000000 -0500
++++ b/cmake/FindMySQL.cmake 2017-02-17 13:59:18.115389096 -0500
+@@ -747,7 +747,7 @@
+ endif()
+
+ if(NOT MYSQL_CXXFLAGS)
+- if(MYSQL_CXX_LINKAGE OR MYSQL_VERSION_ID GREATER 50603)
++ if(MYSQL_CXX_LINKAGE)
+ _mysql_conf(MYSQL_CXXFLAGS "--cxxflags")
+ set(MYSQL_CXX_LINKAGE 1)
+ else()
+diff -aurN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2017-02-17 13:50:43.556006202 -0500
++++ b/CMakeLists.txt 2017-02-17 13:57:15.745676184 -0500
+@@ -242,10 +242,9 @@
+ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+ SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
+
+-SET(LIB_SUBDIR "lib")
+-IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|ppc64|ppc64p7|s390x|sparc64)")
+- SET(LIB_SUBDIR "lib64")
+-ENDIF()
++IF(NOT LIB_SUBDIR)
++ MESSAGE(ERROR "LIB_SUBDIR is not set")
++ENDIF(NOT LIB_SUBDIR)
+
+ MESSAGE(STATUS "Installation library subdir: ${LIB_SUBDIR}")
+
+diff -aurN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake 2017-02-17 14:44:29.532733308 -0500
++++ b/cmake/FindMySQL.cmake 2017-02-17 14:48:56.756740330 -0500
+@@ -270,8 +270,8 @@
+ set(_static_lib_ext ".lib") # Careful, can be import library for DLL
+ elseif(MYSQLCLIENT_NO_THREADS)
+ # In 5.1 and below there is a single threaded library
+- set(_dynamic_libs "mysqlclient")
+- set(_static_libs "libmysqlclient.a")
++ set(_dynamic_libs "${MYSQLCLIENT_LIB_NAME}")
++ set(_static_libs "lib${MYSQLCLIENT_LIB_NAME}.a")
+ set(_static_lib_ext ".a")
+ else()
+ # We try the multithreaded "libmysqlclient_r" first and if not
diff --git a/dev-db/myodbc/files/5.3-mariadb-buffer_length.patch b/dev-db/myodbc/files/5.3-mariadb-buffer_length.patch
new file mode 100644
index 000000000000..1be9cc466b65
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-mariadb-buffer_length.patch
@@ -0,0 +1,93 @@
+diff -aurN a/driver/connect.c b/driver/connect.c
+--- a/driver/connect.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/connect.c 2017-02-17 16:14:48.116640371 -0500
+@@ -510,11 +510,11 @@
+ }
+ }
+
+-#if MYSQL_VERSION_ID >= 50709
+- mysql_get_option(mysql, MYSQL_OPT_NET_BUFFER_LENGTH, &dbc->net_buffer_length);
++#if MYSQL_VERSION_ID >= 50709 && !defined(MARIADB_BASE_VERSION)
++ mysql_get_option(mysql, MYSQL_OPT_NET_BUFFER_LENGTH, &dbc->net_buffer_length_value);
+ #else
+ // for older versions just use net_buffer_length() macro
+- dbc->net_buffer_length = net_buffer_length;
++ dbc->net_buffer_length_value = net_buffer_length;
+ #endif
+ return rc;
+
+diff -aurN a/driver/cursor.c b/driver/cursor.c
+--- a/driver/cursor.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/cursor.c 2017-02-17 16:13:19.163299885 -0500
+@@ -1485,7 +1485,7 @@
+ We have a limited capacity to shove data across the wire, but
+ we handle this by sending in multiple calls to exec_stmt_query()
+ */
+- if (ext_query->length + length >= (SQLULEN) stmt->dbc->net_buffer_length)
++ if (ext_query->length + length >= (SQLULEN) stmt->dbc->net_buffer_length_value)
+ {
+ break_insert= TRUE;
+ break;
+diff -aurN a/driver/driver.h b/driver/driver.h
+--- a/driver/driver.h 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/driver.h 2017-02-17 16:10:57.072950723 -0500
+@@ -378,7 +378,7 @@
+ int txn_isolation;
+ uint port;
+ uint cursor_count;
+- ulong net_buffer_length;
++ ulong net_buffer_length_value;
+ uint commit_flag;
+ #ifdef THREAD
+ myodbc_mutex_t lock;
+diff -aurN a/driver/info.c b/driver/info.c
+--- a/driver/info.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/info.c 2017-02-17 16:12:54.315763441 -0500
+@@ -587,7 +587,7 @@
+ MYINFO_SET_USHORT(0);
+
+ case SQL_MAX_STATEMENT_LEN:
+- MYINFO_SET_ULONG(dbc->net_buffer_length);
++ MYINFO_SET_ULONG(dbc->net_buffer_length_value);
+
+ case SQL_MAX_TABLE_NAME_LEN:
+ MYINFO_SET_USHORT(NAME_LEN);
+diff -aurN a/driver/connect.c b/driver/connect.c
+--- a/driver/connect.c 2017-02-17 16:16:14.609026769 -0500
++++ b/driver/connect.c 2017-02-17 16:34:29.637592664 -0500
+@@ -179,7 +179,7 @@
+ /* Set other connection options */
+
+ if (ds->allow_big_results || ds->safe)
+-#if MYSQL_VERSION_ID >= 50709
++#if MYSQL_VERSION_ID >= 50709 && !defined(MARIADB_BASE_VERSION)
+ mysql_options(mysql, MYSQL_OPT_MAX_ALLOWED_PACKET, &max_long);
+ #else
+ /* max_allowed_packet is a magical mysql macro. */
+@@ -252,7 +252,7 @@
+ ds_get_utf8attr(ds->rsakey, &ds->rsakey8));
+ }
+
+-#if MYSQL_VERSION_ID >= 50710
++#if MYSQL_VERSION_ID >= 50710 && !defined(MARIADB_BASE_VERSION)
+ {
+ char tls_options[128] = { 0 };
+ if (!ds->no_tls_1)
+@@ -323,7 +323,7 @@
+ #endif
+
+ mysql->options.use_ssl = !ds->disable_ssl_default;
+-#if MYSQL_VERSION_ID >= 50703
++#if MYSQL_VERSION_ID >= 50703 && !defined(MARIADB_BASE_VERSION)
+ {
+ if (ds->ssl_enforce)
+ {
+@@ -332,7 +332,7 @@
+ }
+ #endif
+
+-#if MYSQL_VERSION_ID >= 50711
++#if MYSQL_VERSION_ID >= 50711 && !defined(MARIADB_BASE_VERSION)
+ if (ds->sslmode)
+ {
+ unsigned int mode = 0;
diff --git a/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch b/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch
new file mode 100644
index 000000000000..96720618a586
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch
@@ -0,0 +1,96 @@
+diff -aurN a/driver/catalog_no_i_s.c b/driver/catalog_no_i_s.c
+--- a/driver/catalog_no_i_s.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/catalog_no_i_s.c 2017-02-17 14:07:03.979683613 -0500
+@@ -1093,7 +1093,11 @@
+ unsigned long *lengths;
+ SQLRETURN rc= SQL_SUCCESS;
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0, MYF(0));
++#else
+ myodbc_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0);
++#endif
+
+ /* Get the list of tables that match szCatalog and szTable */
+ myodbc_mutex_lock(&stmt->dbc->lock);
+diff -aurN a/driver/desc.c b/driver/desc.c
+--- a/driver/desc.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/desc.c 2017-02-17 14:09:30.139954232 -0500
+@@ -63,13 +63,21 @@
+ but in desc_get_rec we manually get a pointer to it. This avoids
+ having to call set_dynamic after modifying the DESCREC.
+ */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (myodbc_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (myodbc_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ x_free((char *)desc);
+ return NULL;
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (myodbc_init_dynamic_array(&desc->bookmark, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (myodbc_init_dynamic_array(&desc->bookmark, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ delete_dynamic(&desc->records);
+ x_free((char *)desc);
+@@ -997,7 +1005,11 @@
+ delete_dynamic(&dest->records);
+ if (myodbc_init_dynamic_array(&dest->records, sizeof(DESCREC),
+ src->records.max_element,
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ src->records.alloc_increment, MYF(0)))
++#else
+ src->records.alloc_increment))
++#endif
+ {
+ return set_desc_error(dest, "HY001",
+ "Memory allocation error",
+diff -aurN a/driver/handle.c b/driver/handle.c
+--- a/driver/handle.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/handle.c 2017-02-17 14:10:32.078797593 -0500
+@@ -409,7 +409,11 @@
+ }
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10, MYF(0));
++#else
+ myodbc_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10);
++#endif
+ memset((*param_bind)->buffer, 0, sizeof(MYSQL_BIND) *
+ (*param_bind)->max_element);
+
+diff -aurN a/driver/parse.c b/driver/parse.c
+--- a/driver/parse.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/parse.c 2017-02-17 14:12:00.638143846 -0500
+@@ -139,8 +139,13 @@
+
+ /* TODO: Store offsets rather than ptrs. In this case we will be fine
+ if work with copy of the originally parsed string */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(&pq->token, sizeof(uint), 20, 10, MYF(0));
++ myodbc_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10, MYF(0));
++#else
+ myodbc_init_dynamic_array(&pq->token, sizeof(uint), 20, 10);
+ myodbc_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10);
++#endif
+ }
+
+ return pq;
+diff -aurN a/MYODBC_MYSQL.h b/MYODBC_MYSQL.h
+--- a/MYODBC_MYSQL.h 2016-11-29 07:40:13.000000000 -0500
++++ b/MYODBC_MYSQL.h 2017-02-17 15:04:47.153994839 -0500
+@@ -44,7 +44,7 @@
+ #endif
+
+ #ifdef THREAD
+-#if MYSQL_VERSION_ID < 50703
++#if MYSQL_VERSION_ID < 50703 || defined(MARIADB_BASE_VERSION)
+ #include <my_pthread.h>
+ #define myodbc_mutex_t pthread_mutex_t
+ #define myodbc_key_t pthread_key_t
diff --git a/dev-db/myodbc/files/cmake-doc-path.patch b/dev-db/myodbc/files/cmake-doc-path.patch
new file mode 100644
index 000000000000..c7f7d9d37ce7
--- /dev/null
+++ b/dev-db/myodbc/files/cmake-doc-path.patch
@@ -0,0 +1,43 @@
+=== modified file 'CMakeLists.txt'
+--- CMakeLists.txt 2013-03-09 09:51:06 +0000
++++ CMakeLists.txt 2013-03-09 11:05:27 +0000
+@@ -33,6 +33,12 @@
+ SET(CONNECTOR_MAJOR "5")
+ SET(CONNECTOR_MINOR "2")
+
++IF(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${WITH_DOCUMENTATION_INSTALL_PATH})
++ELSE(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/myodbc-${CONNECTOR_MAJOR}.${CONNECTOR_MINOR})
++ENDIF(WITH_DOCUMENTATION_INSTALL_PATH)
++
+ IF(CONNECTOR_MINOR LESS 10)
+ SET(CONNECTOR_MINOR_PADDED "0${CONNECTOR_MINOR}")
+ ELSE(CONNECTOR_MINOR LESS 10)
+@@ -329,19 +335,17 @@
+
+ ELSE(WIN32)
+
+- INSTALL(FILES ChangeLog DESTINATION .)
+- INSTALL(FILES README DESTINATION .)
+- INSTALL(FILES README.debug DESTINATION .)
+- INSTALL(FILES INSTALL DESTINATION .)
++ INSTALL(FILES ChangeLog DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README.debug DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES INSTALL DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
+- INSTALL(FILES COPYING DESTINATION .)
+ ELSE()
+- INSTALL(FILES LICENSE.mysql DESTINATION .)
+ ENDIF()
+
+ ENDIF(WIN32)
+
+-INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION .)
++INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+
+ INCLUDE(CPack)
+
+
+
diff --git a/dev-db/myodbc/files/odbc.ini.m4 b/dev-db/myodbc/files/odbc.ini.m4
new file mode 100644
index 000000000000..4255730a3e21
--- /dev/null
+++ b/dev-db/myodbc/files/odbc.ini.m4
@@ -0,0 +1,17 @@
+# vim:ts=4 noexpandtab ft=dosini:
+#
+[ODBC Data Sources]
+__PN__-test = MySQL ODBC __PF__ Driver Testing DSN
+
+# see http://www.mysql.com/products/myodbc/faq_toc.html
+# for details about the following entry
+[__PN__-test]
+Description = MySQL ODBC __PF__ Driver Testing DSN
+Driver = __PN__
+Socket = /var/run/mysqld/mysqld.sock
+Server = localhost
+User = root
+Database = test
+Option = 3
+#Port =
+#Password =
diff --git a/dev-db/myodbc/files/odbcinst.ini.m4 b/dev-db/myodbc/files/odbcinst.ini.m4
new file mode 100644
index 000000000000..744503c5ac05
--- /dev/null
+++ b/dev-db/myodbc/files/odbcinst.ini.m4
@@ -0,0 +1,5 @@
+# vim:ts=4 noexpandtab ft=dosini:
+#
+[__PN__]
+Description = MySQL ODBC __PF__ Driver
+Driver = /usr/lib/libmyodbc3.so
diff --git a/dev-db/myodbc/metadata.xml b/dev-db/myodbc/metadata.xml
new file mode 100644
index 000000000000..709689b06053
--- /dev/null
+++ b/dev-db/myodbc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/myodbc/myodbc-5.2.7-r1.ebuild b/dev-db/myodbc/myodbc-5.2.7-r1.ebuild
new file mode 100644
index 000000000000..22819c507ced
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.2.7-r1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit cmake-multilib eutils flag-o-matic versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="mirror://mysql/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+RESTRICT="primaryuri"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ >=virtual/mysql-5.5[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+src_prepare() {
+ # Remove Tests
+ sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+ "${S}/CMakeLists.txt"
+
+ # Fix as-needed on the installer binary
+ echo "TARGET_LINK_LIBRARIES(myodbc-installer odbc)" >> "${S}/installer/CMakeLists.txt"
+
+ # Patch document path so it doesn't install files to /usr
+ epatch "${FILESDIR}/cmake-doc-path.patch" \
+ "${FILESDIR}/${PVR}-cxxlinkage.patch" \
+ "${FILESDIR}/${PV}-mariadb-dynamic-array.patch"
+
+ # Fix undefined references due to standards change
+ append-cflags -std=gnu89
+}
+
+multilib_src_configure() {
+ # The RPM_BUILD flag does nothing except install to /usr/lib64 when "x86_64"
+ # MYSQL_CXX_LINKAGE expects "mysql_config --cxxflags" which doesn't exist on MariaDB
+ mycmakeargs+=(
+ -DMYSQL_CXX_LINKAGE=0
+ -DWITH_UNIXODBC=1
+ -DMYSQLCLIENT_LIB_NAME="libmysqlclient_r.so"
+ -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+ -DMYSQL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
+ -DLIB_SUBDIR="$(get_libdir)"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+ mv "${D}/usr/bin/myodbc-installer" \
+ "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/myodbc/myodbc-5.2.7-r2.ebuild b/dev-db/myodbc/myodbc-5.2.7-r2.ebuild
new file mode 100644
index 000000000000..e475faca21ee
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.2.7-r2.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit cmake-multilib eutils flag-o-matic versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="mirror://mysql/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+RESTRICT="primaryuri"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+# Does not build with mysql-connector-c
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ ~virtual/libmysqlclient-18[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+ !dev-db/mysql-connector-c
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+src_prepare() {
+ # Remove Tests
+ sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+ "${S}/CMakeLists.txt"
+
+ # Fix as-needed on the installer binary
+ echo "TARGET_LINK_LIBRARIES(myodbc-installer odbc)" >> "${S}/installer/CMakeLists.txt"
+
+ # Patch document path so it doesn't install files to /usr
+ epatch "${FILESDIR}/cmake-doc-path.patch" \
+ "${FILESDIR}/${PV}-r1-cxxlinkage.patch" \
+ "${FILESDIR}/${PV}-mariadb-dynamic-array.patch" \
+ "${FILESDIR}/${PV}-my_malloc.patch"
+
+ # Fix undefined references due to standards change
+ append-cflags -std=gnu89
+}
+
+multilib_src_configure() {
+ # The RPM_BUILD flag does nothing except install to /usr/lib64 when "x86_64"
+ # MYSQL_CXX_LINKAGE expects "mysql_config --cxxflags" which doesn't exist on MariaDB
+ mycmakeargs+=(
+ -DMYSQL_CXX_LINKAGE=0
+ -DWITH_UNIXODBC=1
+ -DMYSQLCLIENT_LIB_NAME="libmysqlclient_r.so"
+ -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+ -DMYSQL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
+ -DLIB_SUBDIR="$(get_libdir)"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+ mv "${D}/usr/bin/myodbc-installer" \
+ "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/myodbc/myodbc-5.3.8-r1.ebuild b/dev-db/myodbc/myodbc-5.3.8-r1.ebuild
new file mode 100644
index 000000000000..8dafc3edf903
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.3.8-r1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit multilib-minimal versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-linux-debian8-x86"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+BASE_URI="https://cdn.mysql.com/Downloads/Connector-ODBC/${MAJOR}/${MY_P}"
+#https://cdn.mysql.com//Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.8-linux-debian8-x86-64bit.tar.gz
+SRC_URI="amd64? ( ${BASE_URI}-64bit.tar.gz abi_x86_32? ( ${BASE_URI}-32bit.tar.gz ) )
+ x86? ( ${BASE_URI}-32bit.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+"
+S=${WORKDIR}
+
+#src_configure(){ :; }
+
+src_compile(){ :; }
+
+multilib_src_install() {
+ cd "${S}" || die
+ local prefix
+ if use amd64 && multilib_is_native_abi ; then
+ prefix="${MY_P}-64bit"
+ else
+ prefix="${MY_P}-32bit"
+ fi
+ exeinto /usr/$(get_libdir)/${PN}-${MAJOR}
+ doexe ${prefix}/lib/libmyodbc5a.so ${prefix}/lib/libmyodbc5w.so
+# use gtk && doexe ${prefix}/lib/libmyodbc5S.so
+}
+
+multilib_src_install_all() {
+ local DRIVER_NAME="${PN}-${SLOT}"
+ local prefix
+ if use amd64 ; then
+ prefix="${MY_P}-64bit"
+ else
+ prefix="${MY_P}-32bit"
+ fi
+ exeinto /usr/bin
+ newexe "${prefix}/bin/myodbc-installer" myodbc-installer-${MAJOR}
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}/usr/share/${DRIVER_NAME}/${i}" \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+
+ dodoc ${prefix}/{ChangeLog,INSTALL,README,Licenses_for_Third-Party_Components.txt}
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/myodbc/myodbc-5.3.8.ebuild b/dev-db/myodbc/myodbc-5.3.8.ebuild
new file mode 100644
index 000000000000..228a5be73d57
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.3.8.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib flag-o-matic versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+# Does not build with mysql-connector-c
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ ~virtual/libmysqlclient-18[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+ !dev-db/mysql-connector-c
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+# Patch document path so it doesn't install files to /usr
+PATCHES=(
+ "${FILESDIR}/${MAJOR}-cmake-doc-path.patch"
+ "${FILESDIR}/${MAJOR}-cxxlinkage.patch"
+ "${FILESDIR}/${MAJOR}-mariadb-dynamic-array.patch"
+ "${FILESDIR}/5.2.7-my_malloc.patch"
+ "${FILESDIR}/${MAJOR}-mariadb-buffer_length.patch"
+)
+
+src_prepare() {
+ # Fix undefined references due to standards change
+ append-cflags -std=gnu89
+
+ # Remove Tests
+ sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+ "${S}/CMakeLists.txt"
+
+ # Fix as-needed on the installer binary
+ echo "TARGET_LINK_LIBRARIES(myodbc-installer odbc)" >> "${S}/installer/CMakeLists.txt"
+ default
+}
+
+multilib_src_configure() {
+ local clientlib
+ for clientlib in "mariadb" "perconaclient" "mysqlclient" "notfound" ; do
+ [[ -x "${EPREFIX}/usr/$(get_libdir)/lib${clientlib}.so" ]] && break
+ done
+ [[ "${clientlib}x" == "notfoundx" ]] && \
+ die "Installed client library name could not be determined"
+
+ # The RPM_BUILD flag does nothing except install to /usr/lib64 when "x86_64"
+ # MYSQL_CXX_LINKAGE expects "mysql_config --cxxflags" which doesn't exist on MariaDB
+ mycmakeargs+=(
+ -DMYSQL_CXX_LINKAGE=0
+ -DWITH_UNIXODBC=1
+ -DMYSQLCLIENT_LIB_NAME="${clientlib}"
+ -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+ -DMYSQL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
+ -DLIB_SUBDIR="$(get_libdir)/${PN}-${MAJOR}"
+ -DMYSQL_INCLUDE_DIR="$(mysql_config --variable=pkgincludedir)"
+ -DMYSQLCLIENT_NO_THREADS=ON
+ -DDISABLE_GUI=ON
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+ mv "${D}/usr/bin/myodbc-installer" \
+ "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/mysql++/Manifest b/dev-db/mysql++/Manifest
new file mode 100644
index 000000000000..ef8b0a91ba08
--- /dev/null
+++ b/dev-db/mysql++/Manifest
@@ -0,0 +1,17 @@
+AUX mysql++-2.3.2-gcc-4.3.patch 358 SHA256 0251cb84e6a768f2a2a4a280f1aa8988b314770993aceeb204c5d6a7afbb11d1 SHA512 09ef458ea4e85e251bca585fec84b53c5b7937d06b9843ddb7d12fef9250c042a46738f6fa27866e171f0107de48df9b5b22416c0eeb86eebdff583438404a51 WHIRLPOOL ad72c308896c4c2ef1ce54806aa961eb7314847fb45a0ef9af7778ed3cfe11e6e7981dea850aede25f06b800c8a4f663148f2e6ea8df91d8c28b3d840f32a933
+AUX mysql++-3.0-gcc-as-needed.patch 7699 SHA256 863c19fccc1136a075f1e86389221f766f28f6a42c9f94f8a6db490ad35e796a SHA512 937cceaa198a42a69fbaad2019de4f825f60cbf2443cb07f85b9fa0555711f7639f47b7aa2442d68b4d6e8c40a99c78a930e76ae26e28900f885d35a7e7679c6 WHIRLPOOL e40d16c9f0763c38760ddab22fd3cdb2d6372579de35b246a47ff3e9ffdf69e9010d3e8ced394e7a8d4eb94fa051e90b9b2417fb9c2578f3108e3960a5b6c319
+AUX mysql++-3.2.1-gold.patch 273 SHA256 ffe1cff166f129ef45f2c4e6f2491e4b9e821ed36df57814831172dc652feeae SHA512 c494c0118c29dbe488621d6da101bbf0dccc9b4d0407189c50ec8d204a0aa5865e78557812553bf636213ea39c86522715fc627c82954593b0f4388f9f24beb6 WHIRLPOOL 5e6e7f372df8da74b270ab08e5d13c5043138c6f87e89e830221a22a00c7743734faeda0eb60d9d3d612385fc4225ea47d535c4d895a6405c18015d33bfb55e8
+AUX mysql++-3.2.3-mariadb-10.2.patch 922 SHA256 18e407dcd9004a8b7c1c238659d0cdd494220a58d5cbbebec278daf41a6cf7f8 SHA512 a346b01095fd61baf73f6a9f93c7ddedc872d79780173adab45faae0c5134cffb5b6cbd8d379fb4f8c670007b961e8dfe0562cfe802cfa8b3a6b86f8d9c0b874 WHIRLPOOL 6f7a7d13ddb9c4fe1df1a218c343fe09442fb70ab881e1b2ef7e554d73dc56aa8d5d2814c382ca25e45e62becfca9537866dcf5f98e36030795e5a1021945c39
+DIST mysql++-2.3.2.tar.gz 1627115 SHA256 3544b964964bc8981118119e82e4883dc9d1de8a72861a19e6687719ed3efce9 SHA512 b546c8369550e541c1a0b1b0e301fdd298a771cb709ad6c6ea3450a8f8bbe7533989a82d1c19cd9bf9a261d7a1fc4c3760919d3d5e3e43b5d698b75b7abf07f7 WHIRLPOOL 2bfc961193baad0053ff9909075db9f5ccfc7c00334483842bc25a94044a1331392f3dc0283bf5f33e69f67c20505bf5b12a01635a0f92716a0c341af5fe637e
+DIST mysql++-3.1.0.tar.gz 1944101 SHA256 256c39a583e7d60947916851754c626312428e9b1d8af3309e34d64ff8404e92 SHA512 bb57bbf03c80edabff701132877f407ecfa1b76958d7655415c59ec939e80fbe250951a16c3d5ea6988dd2c778b623605cb65bf810501f392be2f6b6ad07ad90 WHIRLPOOL 0b5274e0fbc1b2cb40ade9699ddc46d5837e66f3a506502f4dae5f5de4689ac2ccf3989a674db073a36075c541046b174e80bbac3d7df393bd61ef3bfc99fd32
+DIST mysql++-3.2.1.tar.gz 2256735 SHA256 aee521873d4dbb816d15f22ee93b6aced789ce4e3ca59f7c114a79cb72f75d20 SHA512 936021dcf8568d3ee0c935e5c552acc6fd2b57849d1cc60e68b45b690d798d7bfbc1dedc04e21417d1b4c27017b471e4f6cb70de7f1904949b9222090a777de9 WHIRLPOOL 56579d4a1afb5985dc8487d211ea7e5aedfe7acfbcd6130b28b07364e66d6b0142831296a6c6ce2f4de78f45e94572c1ef289db41ee504b05d04f3623d48b2aa
+DIST mysql++-3.2.2.tar.gz 3257359 SHA256 55667bee79a5981b1a04e57e3a4fd8b03bf330e4e3371b023c2bf5ba0f50ed17 SHA512 eb4250394027f1baafa660711d8221c9eb3a70ff2a37331c58807a97a67b84f792290b24830e851b2421f6ccf2867e9f3597af3af41530256c44521a4c4a55b1 WHIRLPOOL c344e77edf8fb5d09fc82c716441ecc53b00b97076d696c52072c79b0c754b7852959c4adac02240cf37ca9159a8f8174a086d43f7cd36388a2c26f2bec38a12
+DIST mysql++-3.2.3.tar.gz 3241023 SHA256 c804c38fe229caab62a48a6d0a5cb279460da319562f41a16ad2f0a0f55b6941 SHA512 b6b0a9856ede9e5e08be0f5ed1689b1256f8cf31c3afbb9c9e7f68d0734380e25909ef31cd04be6b253c86b2f881df10f3793a2d3e32042375dbbab4b0700d0a WHIRLPOOL ea45deaa9a1c7c94e7790117b5f964d7af2e4b85be90dff444eeac4023295d2c076f1f6e8539182b502200c818b50f08543e0e9c7aa7cd9038b1084e1af64ce3
+EBUILD mysql++-2.3.2.ebuild 1317 SHA256 7ecb90a2e47e9bb9b608439059184e32194e922469d7194ad47651012c190a77 SHA512 1997f7bde76e53456ef0191859ac04391fd9a32a40cb07766a0876f1e4810bd29d8b480e0ba8474dc52ec4680c748448ae798f04e67e5dbfb21701c93b475f3c WHIRLPOOL f421f81daeebd32f1cb451a7bf630f111744a27fb5ec1041d4b6fd57897b102cd210b1c5c13a37646e691fd7d558c14c779653cf57e76cae5ae0c441d150af72
+EBUILD mysql++-3.1.0.ebuild 1238 SHA256 a58b2ab1ede7d02d392168f9d46edc78464dab6663e3cfe2bddadd88d2d061fc SHA512 0915d6f160bb38a02d6bdf7bffc7fc912361db8ccc85c7f3c4c425ff5528b92b38d933f9945fe41f5bd457cc991cd848bf85a96360b82de5a0362391aa8d4fce WHIRLPOOL 885478bfe103b7a701a130dffbfaf57697b5df2b1f7125558e50c04c3a9ecb5e1298f7d3e5fc22fec736759815e44a0eed36b5ce331f6cfb0be43a61b74a4896
+EBUILD mysql++-3.2.1.ebuild 901 SHA256 98f3c2f297749af5ec27cbeb828ea27d2de5a85966fc75b3e3ac9a64ed7ed14d SHA512 136c1c7776514af3013eef5093b5c7a078297ecdd5e08394e02d0554458cc5e234576bfc63e020e6e668a0da179bc1846cd10981793f7b93f00b047eff63fd7e WHIRLPOOL 4cf537d22c8e6cf66810c4b1136452c97cb5d5e6683a642bd42cc4414cc9f7af97772575427d49d03032e55ebec53872f8a5337bebbe2cf957e6699300cb08c9
+EBUILD mysql++-3.2.2.ebuild 853 SHA256 a60801a6ff0712a0f4bdfa52e4f120406db77d625dd62aebde63245f9abd38ef SHA512 ef929d98d318f118fdaeba972dc43b755809563d49537fdb97d23f324dfa63788bf03a22d8c89eafbdeb04c971c6cb8efd58f915d0008cba9094df71494b7254 WHIRLPOOL c85a521d4808affc840eceee6a5775e0af60a23e2264ccd3d1430b83ebfc2d406b63d2075fc34a0590feead9f609c99022fd804bfeb2ba97de489557fce6d415
+EBUILD mysql++-3.2.3.ebuild 1526 SHA256 8de48c5a26bb31516643cfbeb11dbf8c351807064cff3ea4c3d88cc1d530abca SHA512 e2d81dae3b02f03d684d0c66d48e998ab869d77f32168ae886b270fa19c520a6ca5bab09dd7d1427e688df0c574a7cef60dcd6e0117b7a16e17807bd9914dc33 WHIRLPOOL 3196d58d17147bd373973b6ddaccc8208232f6436f7199f65b56a97410bcad7dd5d7c722e6655a5a725f62c5bcca5a0cd9fb08ba2538afc31df5e690e2332f11
+MISC ChangeLog 2797 SHA256 cfd626e589d5df15494c538d2c8511645be1d89788e63fcfb2e6de55ba424c8b SHA512 fe65c61a75373bf13b88c7db3b597ebe12324ca5730aebf0e6bfa376cd560e49f7c1e76d490f0ab7142fd4ac61c3fe0d83dfc0e908240b46291762df44122ab4 WHIRLPOOL 0e83632797437426fb0954af96973d98c7e4a84938758723b3d9587a18c82811a9eba181f5e64cb11722ec02849a0d07283cc03564344bfaba81a3a882fa5d24
+MISC ChangeLog-2015 11700 SHA256 69f7c9e777997bc91e9b69a228017c1259fc1f83aee0b017c22f1a223e352c7f SHA512 511705ac466c3d4cf7f5a26adf8745efc4daaa846e1dc58b78cb23aba5ec4eea7848cd565d2521a68400f197d447535002170619e935342750cfe7b3cf04e853 WHIRLPOOL 3377de4dbae18f26d9c0181ef6e338c129efa232f9431b2a85d43b8e2f9b8c8ebe2061b9b1dfe14b1c12926e50555025d6eee473af167c44e8df4bd255e900c3
+MISC metadata.xml 239 SHA256 a35e1476a1677a91f06dd6e4f955fcebc58c3a07f934b5e62fbf801573a5c82b SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b WHIRLPOOL 3ed1945907fa58cbc9997c311d1d0431d481586576ce45b4bc5caf7704ddefe2117305879a97e8021694b86af0d570a34517212b6cc9528224b85e568eee3d75
diff --git a/dev-db/mysql++/files/mysql++-2.3.2-gcc-4.3.patch b/dev-db/mysql++/files/mysql++-2.3.2-gcc-4.3.patch
new file mode 100644
index 000000000000..f9456e8f88e5
--- /dev/null
+++ b/dev-db/mysql++/files/mysql++-2.3.2-gcc-4.3.patch
@@ -0,0 +1,11 @@
+diff -Naur mysql++-2.3.2-orig/lib/const_string.h mysql++-2.3.2/lib/const_string.h
+--- mysql++-2.3.2-orig/lib/const_string.h 2008-03-22 16:16:39.000000000 -0600
++++ mysql++-2.3.2/lib/const_string.h 2008-03-22 16:18:47.000000000 -0600
+@@ -35,6 +35,7 @@
+ #include <iostream>
+ #include <stdexcept>
+ #include <string>
++#include <cstring>
+
+ namespace mysqlpp {
+
diff --git a/dev-db/mysql++/files/mysql++-3.0-gcc-as-needed.patch b/dev-db/mysql++/files/mysql++-3.0-gcc-as-needed.patch
new file mode 100644
index 000000000000..d240761ec7a8
--- /dev/null
+++ b/dev-db/mysql++/files/mysql++-3.0-gcc-as-needed.patch
@@ -0,0 +1,130 @@
+=== modified file 'lib/refcounted.h'
+--- a/lib/refcounted.h 2012-10-18 11:37:55.322732178 -0300
++++ b/lib/refcounted.h 2012-10-18 11:40:10.303349659 -0300
+@@ -29,6 +29,7 @@
+ #define MYSQLPP_REFCOUNTED_H
+
+ #include <memory>
++#include <cstddef>
+
+ namespace mysqlpp {
+
+=== modified file 'ssx/genv2.cpp'
+--- a/ssx/genv2.cpp 2013-02-14 12:29:16.523261203 -0500
++++ b/ssx/genv2.cpp 2013-02-14 12:29:29.983070930 -0500
+@@ -35,6 +35,7 @@
+ #include <iostream>
+ #include <fstream>
+ #include <typeinfo>
++#include <cstring>
+
+ using namespace std;
+
+== modified file 'Makefile.in'
+--- a/Makefile.in 2013-02-14 13:14:10.954718894 -0500
++++ b/Makefile.in 2013-02-14 13:15:23.463679996 -0500
+@@ -471,87 +471,87 @@
+ $(RANLIB) $@
+
+ ssqlsxlat$(EXEEXT): $(SSQLSXLAT_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3) $(LIBPREFIX)mysqlpp_ssqls2parse$(LIBEXT)
+- $(CXX) -o $@ $(SSQLSXLAT_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp -lmysqlpp_ssqls2parse $(LIBS)
++ $(CXX) -o $@ $(SSQLSXLAT_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp -lmysqlpp_ssqls2parse $(LDFLAGS) $(LIBS)
+
+ $(__ssqlsxlat___mac_setfilecmd)
+
+ test_array_index$(EXEEXT): $(TEST_ARRAY_INDEX_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_ARRAY_INDEX_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_ARRAY_INDEX_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_array_index___mac_setfilecmd)
+
+ test_cpool$(EXEEXT): $(TEST_CPOOL_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_CPOOL_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_CPOOL_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_cpool___mac_setfilecmd)
+
+ test_datetime$(EXEEXT): $(TEST_DATETIME_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_DATETIME_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_DATETIME_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_datetime___mac_setfilecmd)
+
+ test_inttypes$(EXEEXT): $(TEST_INTTYPES_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_INTTYPES_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_INTTYPES_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_inttypes___mac_setfilecmd)
+
+ test_insertpolicy$(EXEEXT): $(TEST_INSERTPOLICY_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_INSERTPOLICY_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_INSERTPOLICY_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_insertpolicy___mac_setfilecmd)
+
+ test_manip$(EXEEXT): $(TEST_MANIP_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_MANIP_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_MANIP_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_manip___mac_setfilecmd)
+
+ test_null_comparison$(EXEEXT): $(TEST_NULL_COMPARISON_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_NULL_COMPARISON_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_NULL_COMPARISON_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_null_comparison___mac_setfilecmd)
+
+ test_query_copy$(EXEEXT): $(TEST_QUERY_COPY_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_QUERY_COPY_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_QUERY_COPY_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_query_copy___mac_setfilecmd)
+
+ test_qssqls$(EXEEXT): $(TEST_QSSQLS_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_QSSQLS_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_QSSQLS_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_qssqls___mac_setfilecmd)
+
+ test_qstream$(EXEEXT): $(TEST_QSTREAM_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_QSTREAM_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_QSTREAM_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_qstream___mac_setfilecmd)
+
+ test_sqlstream$(EXEEXT): $(TEST_SQLSTREAM_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_SQLSTREAM_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_SQLSTREAM_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_sqlstream___mac_setfilecmd)
+
+ test_ssqls2$(EXEEXT): $(TEST_SSQLS2_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3) $(LIBPREFIX)mysqlpp_ssqls2parse$(LIBEXT)
+- $(CXX) -o $@ $(TEST_SSQLS2_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp -lmysqlpp_ssqls2parse $(LIBS)
++ $(CXX) -o $@ $(TEST_SSQLS2_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp -lmysqlpp_ssqls2parse $(LDFLAGS) $(LIBS)
+
+ $(__test_ssqls2___mac_setfilecmd)
+
+ test_string$(EXEEXT): $(TEST_STRING_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_STRING_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_STRING_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_string___mac_setfilecmd)
+
+ test_tcp$(EXEEXT): $(TEST_TCP_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_TCP_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_TCP_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_tcp___mac_setfilecmd)
+
+ test_uds$(EXEEXT): $(TEST_UDS_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_UDS_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_UDS_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_uds___mac_setfilecmd)
+
+ test_wnp$(EXEEXT): $(TEST_WNP_OBJECTS) $(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3)
+- $(CXX) -o $@ $(TEST_WNP_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ $(LDFLAGS) -lmysqlpp $(LIBS)
++ $(CXX) -o $@ $(TEST_WNP_OBJECTS) -L. -l@MYSQL_C_LIB_NAME@ @PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@ -lmysqlpp $(LDFLAGS) $(LIBS)
+
+ $(__test_wnp___mac_setfilecmd)
+
diff --git a/dev-db/mysql++/files/mysql++-3.2.1-gold.patch b/dev-db/mysql++/files/mysql++-3.2.1-gold.patch
new file mode 100644
index 000000000000..0f6bb7eb1f79
--- /dev/null
+++ b/dev-db/mysql++/files/mysql++-3.2.1-gold.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.in.orig 2013-09-27 09:51:48.646667442 -0400
++++ b/Makefile.in 2013-09-27 09:52:22.026603184 -0400
+@@ -36,7 +36,7 @@
+ CXX = @CXX@
+ CXXFLAGS = @CXXFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+-LDFLAGS = @LDFLAGS@
++LDFLAGS = @LDFLAGS@ @PTHREAD_CFLAGS@
+
+ ### Variables: ###
+
diff --git a/dev-db/mysql++/files/mysql++-3.2.3-mariadb-10.2.patch b/dev-db/mysql++/files/mysql++-3.2.3-mariadb-10.2.patch
new file mode 100644
index 000000000000..f461daac2a43
--- /dev/null
+++ b/dev-db/mysql++/files/mysql++-3.2.3-mariadb-10.2.patch
@@ -0,0 +1,31 @@
+diff -Naur mysql++-3.2.2-ORIG/lib/dbdriver.cpp mysql++-3.2.2/lib/dbdriver.cpp
+--- mysql++-3.2.2-ORIG/lib/dbdriver.cpp 2017-07-14 14:56:06.206629443 +0200
++++ mysql++-3.2.2/lib/dbdriver.cpp 2017-07-14 15:28:34.690826959 +0200
+@@ -257,7 +257,11 @@
+ }
+
+ if ((n == 1) &&
++#ifdef CLIENT_LONG_PASSWORD
+ (o >= CLIENT_LONG_PASSWORD) &&
++#else
++ (o >= CLIENT_MYSQL) &&
++#endif
+ #if MYSQL_VERSION_ID > 40000 // highest flag value varies by version
+ (o <= CLIENT_MULTI_RESULTS)
+ #else
+diff -aurN a/lib/common.h b/lib/common.h
+--- a/lib/common.h 2016-12-30 18:44:44.000000000 -0500
++++ b/lib/common.h 2017-09-01 09:12:12.270089396 -0400
+@@ -130,12 +130,6 @@
+ #define MYSQLPP_PATH_SEPARATOR '/'
+ #endif
+
+-#if defined(MYSQLPP_MYSQL_HEADERS_BURIED)
+-# include <mysql/mysql_version.h>
+-#else
+-# include <mysql_version.h>
+-#endif
+-
+ namespace mysqlpp {
+
+ /// \brief Alias for 'true', to make code requesting exceptions more
diff --git a/dev-db/mysql++/metadata.xml b/dev-db/mysql++/metadata.xml
new file mode 100644
index 000000000000..709689b06053
--- /dev/null
+++ b/dev-db/mysql++/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/mysql++/mysql++-2.3.2.ebuild b/dev-db/mysql++/mysql++-2.3.2.ebuild
new file mode 100644
index 000000000000..d6bdd7a79dcb
--- /dev/null
+++ b/dev-db/mysql++/mysql++-2.3.2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="C++ API interface to the MySQL database"
+HOMEPAGE="http://tangentsoft.net/mysql++/"
+SRC_URI="http://www.tangentsoft.net/mysql++/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ~mips ppc sparc x86"
+IUSE=""
+
+RDEPEND=">=virtual/mysql-4.0"
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-3"
+
+src_prepare() {
+
+ epatch "${FILESDIR}"/${P}-gcc-4.3.patch
+
+ for i in "${S}"/lib/*.h ; do
+ sed -i \
+ -e '/#include </s,mysql.h,mysql/mysql.h,g' \
+ -e '/#include </s,mysql_version.h,mysql/mysql_version.h,g' \
+ "${i}" || die "Failed to sed ${i} for fixing MySQL includes"
+ done
+}
+
+src_configure() {
+ local myconf
+ # we want C++ exceptions turned on
+ myconf="--enable-exceptions"
+ # give threads a try
+ myconf="${myconf} --enable-thread-check"
+ # not including the directives to where MySQL is because it seems to
+ # find it just fine without
+
+ # force the cflags into place otherwise they get totally ignored by
+ # configure
+ CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+ econf ${myconf}
+}
+
+src_install() {
+ default
+ # install the docs and HTML pages
+ dodoc README* CREDITS ChangeLog HACKERS Wishlist
+ dohtml -r doc/html/*
+ rm -r doc/html || die
+ dodoc -r doc/*
+}
diff --git a/dev-db/mysql++/mysql++-3.1.0.ebuild b/dev-db/mysql++/mysql++-3.1.0.ebuild
new file mode 100644
index 000000000000..3a2f4e8e8d4d
--- /dev/null
+++ b/dev-db/mysql++/mysql++-3.1.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="C++ API interface to the MySQL database"
+HOMEPAGE="http://tangentsoft.net/mysql++/"
+SRC_URI="http://www.tangentsoft.net/mysql++/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0/3"
+KEYWORDS="alpha amd64 hppa ~mips ppc sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND=">=virtual/mysql-4.0"
+DEPEND="${RDEPEND}
+ || ( >=sys-devel/gcc-3 >=sys-devel/gcc-apple-4 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.0-gcc-as-needed.patch
+ epatch "${FILESDIR}"/${PN}-3.2.1-gold.patch
+
+ for i in "${S}"/lib/*.h ; do
+ sed -i \
+ -e '/#include </s,mysql.h,mysql/mysql.h,g' \
+ -e '/#include </s,mysql_version.h,mysql/mysql_version.h,g' \
+ "${i}"
+ done
+ epatch_user
+}
+
+src_configure() {
+ local myconf
+ use prefix || local EPREFIX=
+ myconf="--enable-thread-check --with-mysql=${EPREFIX}/usr"
+
+ CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ # install the docs and HTML pages
+ dodoc README* CREDITS* ChangeLog HACKERS.txt Wishlist doc/ssqls-pretty
+ dodoc -r doc/pdf/ doc/refman/ doc/userman/
+ dohtml -r doc/html/
+}
diff --git a/dev-db/mysql++/mysql++-3.2.1.ebuild b/dev-db/mysql++/mysql++-3.2.1.ebuild
new file mode 100644
index 000000000000..35ff9881cab9
--- /dev/null
+++ b/dev-db/mysql++/mysql++-3.2.1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="C++ API interface to the MySQL database"
+HOMEPAGE="http://tangentsoft.net/mysql++/"
+SRC_URI="http://www.tangentsoft.net/mysql++/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0/3"
+KEYWORDS="alpha amd64 hppa ~mips ppc sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND=">=virtual/mysql-4.0"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-gold.patch"
+ epatch_user
+ sed -i -e "s/mysqlclient_r/mysqlclient/" "${S}/configure" || die
+}
+
+src_configure() {
+ local myconf="--enable-thread-check --with-mysql=${EPREFIX}/usr"
+ econf ${myconf}
+}
+
+src_install() {
+ default
+ # install the docs and HTML pages
+ dodoc CREDITS* HACKERS.txt Wishlist doc/ssqls-pretty
+ dodoc -r doc/pdf/ doc/refman/ doc/userman/
+ dohtml -r doc/html/
+}
diff --git a/dev-db/mysql++/mysql++-3.2.2.ebuild b/dev-db/mysql++/mysql++-3.2.2.ebuild
new file mode 100644
index 000000000000..c84fd8d97a30
--- /dev/null
+++ b/dev-db/mysql++/mysql++-3.2.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="C++ API interface to the MySQL database"
+HOMEPAGE="http://tangentsoft.net/mysql++/"
+SRC_URI="http://www.tangentsoft.net/mysql++/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0/3"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND="virtual/libmysqlclient:="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-gold.patch"
+ epatch_user
+}
+
+src_configure() {
+ local myconf="--enable-thread-check --with-mysql=${EPREFIX}/usr"
+ econf ${myconf}
+}
+
+src_install() {
+ default
+ # install the docs and HTML pages
+ dodoc CREDITS* HACKERS.txt Wishlist doc/ssqls-pretty
+ dodoc -r doc/pdf/ doc/refman/ doc/userman/
+ dohtml -r doc/html/
+}
diff --git a/dev-db/mysql++/mysql++-3.2.3.ebuild b/dev-db/mysql++/mysql++-3.2.3.ebuild
new file mode 100644
index 000000000000..7491c26b1fbc
--- /dev/null
+++ b/dev-db/mysql++/mysql++-3.2.3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools libtool flag-o-matic
+
+DESCRIPTION="C++ API interface to the MySQL database"
+HOMEPAGE="http://tangentsoft.net/mysql++/"
+SRC_URI="http://www.tangentsoft.net/mysql++/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0/3"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="doc"
+
+RDEPEND="virtual/libmysqlclient:="
+DEPEND="${RDEPEND}"
+DOCS=( CREDITS.txt HACKERS.txt Wishlist doc/ssqls-pretty )
+
+src_prepare() {
+ # Bug filed upstream about deprecated std::auto_ptr
+ append-cxxflags $(test-flags-CXX -Wno-deprecated-declarations)
+ # Bad symlink for libtool in the archive
+ rm "${S}/ltmain.sh" || die
+ eapply "${FILESDIR}/${PN}-3.2.1-gold.patch"
+ eapply "${FILESDIR}/${PN}-3.2.3-mariadb-10.2.patch"
+ eapply_user
+ _elibtoolize --auto-ltdl --install --copy --force
+ elibtoolize
+ # Current MySQL libraries are always with threads and slowly being removed
+ sed -i -e "s/mysqlclient_r/mysqlclient/" "${S}/configure" || die
+ rm "${S}/doc/"README-*-RPM.txt || die
+}
+
+src_configure() {
+ local myconf=(
+ --enable-thread-check
+ --with-mysql="${EPREFIX}/usr"
+ --with-mysql-lib="${EPREFIX}$(mysql_config --variable=pkglibdir)"
+ --with-mysql-include="${EPREFIX}$(mysql_config --variable=pkgincludedir)"
+ )
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ # install the docs and HTML pages
+ use doc && dodoc -r doc/pdf/ doc/refman/ doc/userman/ doc/html/
+}
diff --git a/dev-db/mysql-cluster/Manifest b/dev-db/mysql-cluster/Manifest
new file mode 100644
index 000000000000..cf63276dfc0f
--- /dev/null
+++ b/dev-db/mysql-cluster/Manifest
@@ -0,0 +1,10 @@
+AUX my.cnf-5.5 4732 SHA256 c016291a43c4fddd535fe8b6a27dcdb6b960cc41be47ee8f4494928cf7858c59 SHA512 617d5be2b84eb6207c8e26db15597f3477d69aed756b05897f5ac3b7df4bef599ed932e4b27f39ac20272ea5907b31ca42e01f2b317899bdbe19db7b7c4dfc2d WHIRLPOOL 8d6d9a6356f4834a3676019ad862ad24aebc77ef8c211ef02719f41e143648da81608328d1e030107faf6f2a3792dcd731ea3a8cabc2a786608604ec62775b85
+AUX my.cnf-5.6 4504 SHA256 d6bfb754105464643f8f2efa14337c2f78a6a6e7e812e998b2ebcdd4b7c6f450 SHA512 866aa700460c2962bad6294b271efad09ef285dd428ab01551078be9972d2f961fbdf56aef7927439784711022e92a96f2eba30cd297f056f6562e8817c89aae WHIRLPOOL c91bb1ea6ef0b974377a60ef7ceb434ffcbf46d3fb57412deaa92930ab83e57bee3771b44a7b374f1df02211562ed5296182a218763145a7c41d96aa9b709afd
+DIST mysql-cluster-gpl-7.2.22.tar.gz 26075142 SHA256 404b80192c488791cedf6251e64bb01310b20f13fcdb28721e108e92985ae999 SHA512 b3370725f17a5b6577c9822097b6c39e4375bdabca2a403bd45dfeb9fd5920c0e213c894eed33dadba69d9c066427ab5065c587869d82bf2e3438d3bdeb1aa8e WHIRLPOOL 1275fc2a181011c5ea2ac392c94027f399a5ce4fd499ff23790bfad142b1c7d67bc421e7c6a4e64e6bb409f04016196417535d5704d21165c1120bf46ab68544
+DIST mysql-cluster-gpl-7.3.11.tar.gz 42806929 SHA256 6c8cfc99ccbf47cd4304996559de6fb330e9cdf754bec37ff7347be72e50c646 SHA512 89e5b6e845b71ed6945529b7f515d3af96ec6daf79c0085f1d0ea6e4426f61eb3626b688e5edda668be4615df1b8cec4e71acdf0d21150fa2775c79ea09563e5 WHIRLPOOL f03d3b62da793becd6aab775293e5963697f9b4147bf6d662274f689b1a48692b1f4de0ad196e74cb02a07ce2a69b608a4d420ad5dc153b20888ba69dc361dc4
+DIST mysql-extras-20151117-2040Z.tar.bz2 294183 SHA256 2ca16597e869fb0fac4f6e48b779892569698ce83c898df3afaee63131f71833 SHA512 8edbc6a3812d17a2f1a827459867c0747387ff72be86b12fe0e790afca5e4b70e4f23c4098bdb61afa20ef292e2c3b154f16577d5c11999a3e2eec9e43b8d09a WHIRLPOOL f0df653216857527ffa3d31f07ab1c470614b53350f5dbd965ba3bdc398f36f37b506537f1070b03a54203a3847f6557a2ae6757327ce852833fa026de7b518d
+EBUILD mysql-cluster-7.2.22.ebuild 4072 SHA256 4542f954fc00d365ec22957fa29d4d08686a1a32756941d58b655b1ea0d3a082 SHA512 a4911a0abc8c7642704a3e40582e1b7d5f5b9fa900d51873c64f902d9f659b5bd4a87be155f92c3af8ffad441c4d9648aca5a5b30e1f9e59fc010435b2f31daf WHIRLPOOL 064279511fd791f3328f3c67df6e32247022efa983e43349d8f0234f6f79dbabb38cb7c4a5b0cad1ecbde4e637242f4a43879f2271d8c21c59178fbc2f56026c
+EBUILD mysql-cluster-7.3.11.ebuild 4704 SHA256 cce611435c5d31357ca28cee68df4ed55f78efc6b07a2a903605382f24fab4e2 SHA512 9a3fbc8757b0b8edf84253bd6309718787d4e04959734ba9193c69d94ddfc77dced361e096889f7aa8dc0838b73974a4db25e40b91222d8b35f8d5422f38e715 WHIRLPOOL e6c536bd86fc54e0d9f58386703b7be42a8e04fd0e1fb9de60724d8d12165dfadc38d5090ad8933627e47b87d3685d1be89a0b1f6202112681a0b7885e7620b4
+MISC ChangeLog 4144 SHA256 07b9aaf673d386476ecf94e5efd8f36b29bcd6c03a8ed98477705cf1b8a2a04f SHA512 b6ba5accdb4963a66fd2ec137c5d35850d15a8da7891252eec32c381cbb93ffaa92c36d1c49a0b7545063eb58c3f9b79a75d1e5815d9890a403563601634242e WHIRLPOOL fd6aee40cc89ac8da2e1b33acb992963e6bc60f6f9f722ca5779047abb696c26e7dfcd4c07094887639005eb80f8ec699960399022804cf2320b4efaaccf49aa
+MISC ChangeLog-2015 2348 SHA256 343f777d9569de16f5ff95232ebc908eabee68ce641474776aaa8665357e498c SHA512 cc53b01580c21a312d77b59e8d653dcf3c2a8576cf8cf664784d94c60d266224155ed5a2b409c457f8104e05be56bfa449ffb526e42226ece9abd2549d481468 WHIRLPOOL 13ef8138e6c990e173c1042a8b146bcdb6d86121636c79f48226c75931bd3f36f0db0c9d55a348be4ef3e9ef3e7d3a4b00cd6450c524bcbb3472a474c48dc65c
+MISC metadata.xml 1480 SHA256 5f8896f7960f7c265619b41261ff6fccfbcedd29d9a70c4d6f63f960e40d7c50 SHA512 cfb6a753bb071b39f52e8db35b07f70efeae4cb943d57d010a6d42a641c50b6f28b38bf4068536b3c70604da1cb5a428ea5525d0c776ef46cfc4c4c5a37cbbe4 WHIRLPOOL 76bea8ae26e55982611ee7fa24767692327eb53ef386fa11cd128d5e1918e1eb25f639b9a581e83b4c0ce51b8c03630e80ccd3f0a6b1dfb15cc17ba7fc7d6935
diff --git a/dev-db/mysql-cluster/files/my.cnf-5.5 b/dev-db/mysql-cluster/files/my.cnf-5.5
new file mode 100644
index 000000000000..edb71e86e85e
--- /dev/null
+++ b/dev-db/mysql-cluster/files/my.cnf-5.5
@@ -0,0 +1,147 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
+
diff --git a/dev-db/mysql-cluster/files/my.cnf-5.6 b/dev-db/mysql-cluster/files/my.cnf-5.6
new file mode 100644
index 000000000000..df462ab69a14
--- /dev/null
+++ b/dev-db/mysql-cluster/files/my.cnf-5.6
@@ -0,0 +1,139 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 4M
+table_open_cache = 400
+sort_buffer_size = 512K
+net_buffer_length = 16K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 128M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 48M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/mysql-cluster/metadata.xml b/dev-db/mysql-cluster/metadata.xml
new file mode 100644
index 000000000000..9dc67c64a895
--- /dev/null
+++ b/dev-db/mysql-cluster/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+<use>
+ <flag name="cluster">Add support for NDB clustering</flag>
+ <flag name="community">Enables the community features from upstream.</flag>
+ <flag name="embedded">Build embedded server (libmysqld)</flag>
+ <flag name="extraengine">Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
+ <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
+ <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
+ <flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag>
+ <flag name="max-idx-128">Raise the max index per table limit from 64 to 128</flag>
+ <flag name="minimal">Install client programs only, no server</flag>
+ <flag name="profiling">Add support for statement profiling (requires USE=community).</flag>
+ <flag name="systemtap">Build support for profiling and tracing using <pkg>dev-util/systemtap</pkg></flag>
+ <flag name="test">Install upstream testsuites for end use.</flag>
+ <flag name="yassl">Enable SSL connections and crypto functions using the bundled yaSSL</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/mysql-cluster/mysql-cluster-7.2.22.ebuild b/dev-db/mysql-cluster/mysql-cluster-7.2.22.ebuild
new file mode 100644
index 000000000000..264df8423382
--- /dev/null
+++ b/dev-db/mysql-cluster/mysql-cluster-7.2.22.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+MY_EXTRAS_VER="20151117-2040Z"
+BUILD="cmake"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-v2
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~amd64 ~x86"
+
+# When MY_EXTRAS is bumped, the index should be revised to exclude these.
+# This is often broken still
+#EPATCH_EXCLUDE=''
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="!media-sound/amarok[embedded]"
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+# Official test instructions:
+# USE='cluster extraengine perl ssl community' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-cluster-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+
+ local TESTDIR="${CMAKE_BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if ! use "minimal" ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # These are failing in MySQL 5.5 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help-notwin, ndb.ndbinfo, ndb_binlog.ndb_binlog_index
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # sys_vars.plugin_dir_basic
+ # fails because PLUGIN_DIR is set to MYSQL_LIBDIR64/plugin
+ # instead of MYSQL_LIBDIR/plugin
+ #
+ # main.flush_read_lock_kill
+ # fails because of unknown system variable 'DEBUG_SYNC'
+ #
+ # main.openssl_1
+ # error message changing
+ # -mysqltest: Could not open connection 'default': 2026 SSL connection
+ # error: ASN: bad other signature confirmation
+ # +mysqltest: Could not open connection 'default': 2026 SSL connection
+ # error: error:00000001:lib(0):func(0):reason(1)
+ #
+
+ for t in main.mysql_client_test \
+ binlog.binlog_statement_insert_delayed main.information_schema \
+ main.mysqld--help-notwin main.flush_read_lock_kill \
+ sys_vars.plugin_dir_basic main.openssl_1 \
+ main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ ndb.ndbinfo ndb_binlog.ndb_binlog_index ; do
+ mysql-v2_disable_test "$t" "False positives in Gentoo"
+ done
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --parallel=auto
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mysql-cluster/mysql-cluster-7.3.11.ebuild b/dev-db/mysql-cluster/mysql-cluster-7.3.11.ebuild
new file mode 100644
index 000000000000..bb3d2a244216
--- /dev/null
+++ b/dev-db/mysql-cluster/mysql-cluster-7.3.11.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+MY_EXTRAS_VER="20151117-2040Z"
+SUBSLOT="18"
+
+inherit toolchain-funcs java-pkg-opt-2 mysql-multilib
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~amd64 ~x86"
+
+# When MY_EXTRAS is bumped, the index should be revised to exclude these.
+# This is often broken still
+#EPATCH_EXCLUDE=''
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="!media-sound/amarok[embedded]"
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+src_prepare() {
+ mysql-multilib_src_prepare
+ if use libressl ; then
+ sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+ "${S}/cmake/ssl.cmake" || die
+ fi
+}
+
+# Official test instructions:
+# USE='extraengine perl openssl' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-cluster-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${CMAKE_BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if ! use "minimal" ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # These are failing in MySQL 5.5/5.6 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help-notwin, funcs_1.is_triggers funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
+ # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
+ # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
+ # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ for t in \
+ binlog.binlog_mysqlbinlog_filter \
+ binlog.binlog_statement_insert_delayed \
+ funcs_1.is_columns_mysql \
+ funcs_1.is_tables_mysql \
+ funcs_1.is_triggers \
+ main.information_schema \
+ main.mysqld--help-notwinfuncs_1.is_triggers \
+ main.mysql_client_test \
+ mysqld--help-notwin \
+ main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ perfschema.binlog_edge_mix \
+ perfschema.binlog_edge_stmt \
+ ; do
+ mysql-multilib_disable_test "$t" "False positives in Gentoo"
+ done
+ # ndb.ndbinfo, ndb_binlog.ndb_binlog_index: latin1/utf8
+ for t in \
+ ndb.ndbinfo \
+ ndb_binlog.ndb_binlog_index ; do
+ mysql-multilib_disable_test "$t" "False positives in Gentoo (NDB)"
+ done
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests"
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mysql-connector-c++/Manifest b/dev-db/mysql-connector-c++/Manifest
new file mode 100644
index 000000000000..feb859b6a903
--- /dev/null
+++ b/dev-db/mysql-connector-c++/Manifest
@@ -0,0 +1,15 @@
+AUX mysql-connector-c++-1.1.3-fix-cmake.patch 4949 SHA256 78c442e7d2518bf5d40d48a2a408c9540d4dbb0281c6875ee1b4f4eef6de271d SHA512 985e5dd9f9f4aaae3b34ff05e32cb0d9ddb108aa20be32e14786b5b2664263149907b46828cb01d491ef07934b73b18ee715185c59bce940370955a544325f3f WHIRLPOOL 13955fc649b370bf630b5975ee8363ff7d0b21b8251e140a927ddc82d7920258df4ff7e46d641cbede0d4b00fe1cea8a5310a7ca752a09a88e877a7299059362
+AUX mysql-connector-c++-1.1.5-fix-mariadb.patch 1793 SHA256 7576b78e3688f14d34a1b50a3b223ba063910657af06fc74e0d32a02a1c4195a SHA512 a2b23164d9632b84df233dfb0ae52c809256a9ec163deaa663eb3512ffb622a6885c21c67998e51e848772170966bb74322d4ab8d6816dda686c5d6ab9fa300a WHIRLPOOL 109399d6a73295add33e2e4f0d67b61d18397f549aeb38270155f87f26d2b80743c0ca94c6df71c3708ff62aa12187170dfb03b091c6cb19876a659b51dc02eb
+AUX mysql-connector-c++-1.1.6-fix-cmake.patch 762 SHA256 8d27b8c70afecb439b3809adff71a8386d2acf00a695be6d958434425b4284b7 SHA512 c4c89b398aa88a9e7b4ed4cf42b055b79670dc70685775afd1ef2d683e5b3754575c831a6083ef0d097431e796513597e1daf7737e3ade710abad917f63ed32f WHIRLPOOL a97f4afe9c6c5fac2a14732704837e19ad7288e5278b022b5a0ae9f28303cdd5f10e8c414c967b0447d9ac37a29d0ea3b858e989b73ca2f9866bfe2e557861f3
+AUX mysql-connector-c++-1.1.8-fix-mariadb.patch 1939 SHA256 f3fbb5d5bbf46ef050993347786f89850e1f3a9e82b5974c06edeeabda34148c SHA512 66e4783b2ad2db463b243d2fcd7c4f89f1ddbb02f6c5711adb09b402bb448e4ee69b50f635c60201cf63048aebaea25b5db6a18f46b35b25e8d7920dbcfde9bd WHIRLPOOL d0db5f76a53c975ee5c8ae43b40cee1ed83d90b558af4437b23e09135916edf6a5754e8205c4d61249443693f4faf31187d85e763cfa4bea455ad3ce17f0a765
+DIST mysql-connector-c++-1.1.3.tar.gz 496226 SHA256 4b1516f183f29c011c1677d5a9b174d0f5c3b761d2e8056e79690c55c01ea690 SHA512 c03a4ae25e9d189a5114ab630bef6edaefd1aee809dbb1ec26b765f5e84b93fbe17e5f7357a4fe2a95c179cd2028b676151df4baf4e3da7515543ecc0834afd7 WHIRLPOOL 5f04231cec63de16c2a076143b2e0409544ebdf600d7423f63c8c2db45f1b63048e1da108a9f374dda6b6ff0d4c13b509190390e797f4674e14284acbaa9e2e5
+DIST mysql-connector-c++-1.1.6.tar.gz 522236 SHA256 ad710b3900cae3be94656825aa70319cf7a96e1ad46bf93e07275f3606f69447 SHA512 e940b6ee090f792bad8acbbfa3dacd46310ac40c7993c4097eeebb6be4b792d3f1856574e603a71e2795773db97169f47c9ed76a127654472370c726bcb291c7 WHIRLPOOL b3027423cf2e250f1fd7340b58ff5ff55ce771c91cc435e37cddd156f681621206438b6329a49df760dce660ef983b3cf3e5060af527668de64ed06e69830d12
+DIST mysql-connector-c++-1.1.8.tar.gz 528954 SHA256 85ff10bd056128562f92b440eb27766cfcd558b474bfddc1153f7dd8feb5f963 SHA512 c3ab5c1e805598d557a449c44f77ce44cc110e5b529075e38b4f775d3726ebd16a2155f61e47a378a375a9d9362d1520334ea25376636151ddd087291aafd85d WHIRLPOOL 6cb88c3b28a8b0bf072b97c55c8b24de016e8bc5f4d66dce7597cfee2f6c2e83fc88f5d1203df60b3425af5881834635ab3f2053bea6a4c16c7eb73be1f3950c
+DIST mysql-connector-c++-1.1.9.tar.gz 508255 SHA256 3e31847a69a4e5c113b7c483731317ec4533858e3195d3a85026a0e2f509d2e4 SHA512 ec4d6cb7f21d52e786de3bff951e65ea5ad7391ba097b599d0094d3e8356cf17f700dee618e38e79d7a9e562684a6c51cca95fb8e2e225942766d33f8d0a5646 WHIRLPOOL b8dbd1f12a6efac5e337c85ff9f32b53a0185af9ae4fd281d4c2e3f68749dabf0e361f775f3bbea44699b8d686a277ea123cb22b6b11ff6222d84b5e111bb74d
+EBUILD mysql-connector-c++-1.1.3.ebuild 1411 SHA256 c6ae65a9179206b552d7786cb7b527e385ced287550c85b34bb193cc4867d6e4 SHA512 ecffb736efeadcce8c93290821f1323c7e37a8f45ad606d0e8f1a6440af75ee6b9b1863affdd0c91a56255e566d534ed9175400cc56c5071b8af2430b2b0af5e WHIRLPOOL ed5fc45ecc5d3adf93b409eea5fc5e6436df6ac7a9834910ac4ec0cf3beebba1bb56508a8e0568950cda7eefd9cf8cd18c8190636f5de5a2651965e454c5e687
+EBUILD mysql-connector-c++-1.1.6.ebuild 1541 SHA256 09ce4c5a42a6d2a802ec4adec9c99ee8d6cfd4bd4982d0bbb23deffcda3e8dd1 SHA512 b8f5eb48edb0c8baade552ef9126badaa72abba78f1b7e9cd875b4f71bbd58c2619ed2cb2c37edb47ef90699ba942b0e02e310e7ed908f90b891a1807ea05a5f WHIRLPOOL 29675c71d36a1e2d1391e0a5ed7de7d853854ff4c4a6a4689e415b97a0fd3a421df9a480bb1e89db0b1b4f8de92f851a23b20949d566cf4fa5b8f360ff316a23
+EBUILD mysql-connector-c++-1.1.8.ebuild 1569 SHA256 ed7b496e16325fd12c39e6e66395b37deb269d9e12885eabfb8d0ccb2f7d55bf SHA512 ab305ddc37dae3d8d32b894c1a100e2eab029362eb9a14806279df6426098a53764cdaa40b82f9f17b54b2f087ff29b29e479a775ff9a1a0cb4e1438032e8621 WHIRLPOOL 1921c086f4db25afe7dcf9043d4dd91ce686ecb802819cc0137e063d8a0f75e97254e235af9a9e1de2b56b6811942eb8b7b0a46c31befa6c2fd80bdf142d57e8
+EBUILD mysql-connector-c++-1.1.9.ebuild 1576 SHA256 9ce229bb3cd8b5265472d4951c7978637d6f8c88f25186b23618fa671ec5c6ef SHA512 ed01ef8f9b63c63e4ef148cb9945d75df4da111e2689a0d04b20eed62af0395868b9fb2429d6f4b692811c7358830f0ca224c16837ba18d4e0091f14d269171e WHIRLPOOL 181b7a3d03639cc620980436efe0e5499334a2fff3c9d0a089c14e106ccd23461e5a33f0bd498d01bafef6afbc0004db31bb0e61bfb4af8edd06113f7981e228
+MISC ChangeLog 5664 SHA256 85801285594a20bfacf97ca7705669cd9fa9580baf35a22a32f83d9fce2b1519 SHA512 d2ad7494c8bc6483a6aa7336581f08b9211eaeded7fda487e82a9695ab22c0fe76cf6df0f41f1c54ae1e6949748972a00932cdf79e3bbfa10dc2fdb1a45c5834 WHIRLPOOL e237f1d45431ed6a628c85c99b384587528033b49bef2426130c2b7605a23ce5e884abd2e67d4aaf65732a55532436e77c4de3149f5155b9522eaf129651119a
+MISC ChangeLog-2015 4494 SHA256 254376d667054085d8ab01dbe3c239eb3a4ec7981a1864d9e42c43788629f07e SHA512 9a49703b510adf3eb7560e450ad08224a71f34335bcb84a37b333b3723bdad9f66d97d980f818115af1f6c2c01a80cca10dd04ae7c008627a489af66ad1954d0 WHIRLPOOL 34ae8cf5ae51d7c3e3c352229789b11214bf7d8558105967c86d7da37e0c7a56c9cab0b4bb07175048157f3e108d9cfb651ecb47731e43da65d8670b16241e56
+MISC metadata.xml 419 SHA256 95b8e5045d7498670ca90c681356e0ad4b991319c6327cac46f7b404516dc86d SHA512 81bb84bb08c240b6bb8aa9d6f749eb3a2b0e433da4cc61fec7c261d68b2239f2ca374d3a273fbcc5be786fe33d42330835d1877fbbbe2ce3c3374a49e4a4f35c WHIRLPOOL 1a878d5ac0791a787acdd1af0243df076dc305eeb09cc32206289ce16bb5c1eae87308b4ba636b821b5abf746a1a1595db85f3b6c0a6cd82581ca35ebaf94ea3
diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.3-fix-cmake.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.3-fix-cmake.patch
new file mode 100644
index 000000000000..5f0669ca3381
--- /dev/null
+++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.3-fix-cmake.patch
@@ -0,0 +1,123 @@
+--- a/CMakeLists.txt 2014-05-04 21:27:59.000000000 -0400
++++ b/CMakeLists.txt 2014-05-04 21:47:31.460572470 -0400
+@@ -38,7 +38,7 @@
+
+ if(COMMAND cmake_policy AND POLICY CMP0015)
+ cmake_policy(SET CMP0015 NEW)
+-endif(COMMAND cmake_policy)
++endif(COMMAND cmake_policy AND POLICY CMP0015)
+
+ #-----------------
+ # CPPFLAGS, CXXFLAGS and LDFLAGS from the environment
+@@ -258,14 +258,14 @@
+ ${CPACK_RESOURCE_FILE_LICENSE}
+ "${CMAKE_SOURCE_DIR}/Licenses_for_Third-Party_Components.txt"
+ "${CMAKE_SOURCE_DIR}/ANNOUNCEMENT"
+- DESTINATION "." OPTIONAL)
++ DESTINATION "${INSTALL_DOCS}" OPTIONAL)
+
+ SET(COMMON_IGNORE_FILES "/CMakeFiles/" "/Testing/" "/.bzr/" "_CPack_Packages/"
+ ".cmake$" "~" ".swp" ".log" ".gz" ".directory$" "CMakeCache.txt" "Makefile"
+ "install_manifest.txt")
+ SET(PRJ_COMMON_IGNORE_FILES ${COMMON_IGNORE_FILES} "ANNOUNCEMENT_102_ALPHA" "ANNOUNCEMENT_103_ALPHA" "ANNOUNCEMENT_104_BETA" "ANNOUNCEMENT_105_GA" "ANNOUNCEMENT_110_GA" "ANNOUNCEMENT_111_GA" "ANNOUNCEMENT_DRAFT" )
+
+-SET(CPACK_SOURCE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} "./cppconn/config.h$" "./driver/nativeapi/binding_config.h$")
++SET(CPACK_SOURCE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/cppconn/config.h$" "${CMAKE_CURRENT_SOURCE_DIR}/driver/nativeapi/binding_config.h$")
+ SET(CPACK_PACKAGE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} "something_there" )
+ SET(CPACK_SOURCE_GENERATOR "TGZ")
+
+@@ -292,10 +292,6 @@
+ ADD_SUBDIRECTORY(cppconn)
+ ADD_SUBDIRECTORY(driver)
+ ADD_SUBDIRECTORY(examples)
+-ADD_SUBDIRECTORY(test)
+-ADD_SUBDIRECTORY(test/framework)
+-ADD_SUBDIRECTORY(test/CJUnitTestsPort)
+-ADD_SUBDIRECTORY(test/unit)
+
+ IF(DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
+ # see also README
+--- a/FindMySQL.cm 2014-05-04 22:20:50.000000000 -0400
++++ b/FindMySQL.cm 2014-05-04 22:21:40.325384447 -0400
+@@ -58,7 +58,7 @@
+ EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--cflags"
+ OUTPUT_VARIABLE _mysql_config_output
+ )
+- STRING(REGEX MATCHALL "-m([^\r\n]+)" MYSQL_LINK_FLAGS "${_mysql_config_output}")
++ STRING(REGEX MATCHALL " -m([^\r\n]+)" MYSQL_LINK_FLAGS "${_mysql_config_output}")
+ STRING(REGEX REPLACE "[\r\n]$" "" MYSQL_CXXFLAGS "${_mysql_config_output}")
+ # ADD_DEFINITIONS("${MYSQL_CXXFLAGS}")
+ ELSE (MYSQL_CONFIG_EXECUTABLE AND NOT WIN32)
+diff -urN a/cppconn/CMakeLists.txt b/cppconn/CMakeLists.txt
+--- a/cppconn/CMakeLists.txt 2011-07-30 13:15:44.000000000 +0200
++++ b/cppconn/CMakeLists.txt 2011-07-30 14:10:34.000000000 +0200
+@@ -55,7 +55,7 @@
+
+ SET(MYSQLCPPCONN_INSTALL_HEADERS
+ build_config.h
+- config.h
++ ${CMAKE_CURRENT_BINARY_DIR}/config.h
+ connection.h
+ datatype.h
+ driver.h
+diff -urN mysql-connector-c++-1.1.0.old/driver/CMakeLists.txt mysql-connector-c++-1.1.0/driver/CMakeLists.txt
+--- a/driver/CMakeLists.txt 2011-07-30 13:15:44.000000000 +0200
++++ b/driver/CMakeLists.txt 2011-07-30 13:20:36.000000000 +0200
+@@ -26,6 +26,9 @@
+
+ INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
+ INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR}/cppconn)
++INCLUDE_DIRECTORIES(${MYSQLCPPCONN_BINARY_DIR})
++INCLUDE_DIRECTORIES(${MYSQLCPPCONN_BINARY_DIR}/cppconn)
++INCLUDE_DIRECTORIES(${MYSQLCPPCONN_BINARY_DIR}/driver/nativeapi)
+ INCLUDE_DIRECTORIES(${MYSQLCPPCONN_BOOST_INCLUDE_DIRS})
+ MESSAGE(STATUS "BOOST_INCLUDE_DIRS=${MYSQLCPPCONN_BOOST_INCLUDE_DIRS}")
+
+@@ -149,20 +152,22 @@
+ nativeapi/native_statement_wrapper.h
+ nativeapi/mysql_native_resultset_wrapper.h
+ nativeapi/native_resultset_wrapper.h
+- ../cppconn/warning.h
+- ../cppconn/statement.h
+- ../cppconn/sqlstring.h
+- ../cppconn/resultset_metadata.h
+- ../cppconn/resultset.h
+- ../cppconn/prepared_statement.h
+- ../cppconn/parameter_metadata.h
+- ../cppconn/metadata.h
+- ../cppconn/exception.h
+- ../cppconn/driver.h
+- ../cppconn/datatype.h
+- ../cppconn/connection.h
+- ../cppconn/config.h
+- ../cppconn/build_config.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/warning.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/statement.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/sqlstring.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/resultset_metadata.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/resultset.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/prepared_statement.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/parameter_metadata.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/metadata.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/exception.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/driver.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/datatype.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/connection.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/config.h
++ ${CMAKE_CURRENT_BINARY_DIR}/cppconn/config.h
++ ${CMAKE_CURRENT_SOURCE_DIR}/cppconn/build_config.h
++ ${CMAKE_CURRENT_BINARY_DIR}/cppconn/build_config.h
+
+ )
+
+@@ -271,8 +276,8 @@
+ )
+ ELSE(WIN32)
+ INSTALL(TARGETS mysqlcppconn mysqlcppconn-static
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+ ENDIF(WIN32)
+
diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.5-fix-mariadb.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.5-fix-mariadb.patch
new file mode 100644
index 000000000000..fa36e3bad936
--- /dev/null
+++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.5-fix-mariadb.patch
@@ -0,0 +1,45 @@
+diff -aruN a/driver/nativeapi/libmysql_static_proxy.cpp b/driver/nativeapi/libmysql_static_proxy.cpp
+--- a/driver/nativeapi/libmysql_static_proxy.cpp 2014-11-19 08:37:11.000000000 -0500
++++ b/driver/nativeapi/libmysql_static_proxy.cpp 2015-02-21 22:19:50.119234140 -0500
+@@ -319,7 +319,7 @@
+ int
+ LibmysqlStaticProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg)
+ {
+-#if MYSQL_VERSION_ID >= 50703
++#if MYSQL_VERSION_ID >= 50703 && !defined( MARIADB_BASE_VERSION )
+ if (::mysql_get_option(mysql, option, arg)) {
+ throw sql::InvalidArgumentException("Unsupported option provided to mysql_get_option()");
+ } else {
+diff -aruN a/driver/mysql_connection.cpp b/driver/mysql_connection.cpp
+--- a/driver/mysql_connection.cpp 2014-11-19 08:37:11.000000000 -0500
++++ b/driver/mysql_connection.cpp 2015-02-21 22:28:48.920210376 -0500
+@@ -1015,6 +1015,7 @@
+ MY_CHARSET_INFO cs;
+ proxy->get_character_set_info(&cs);
+ *(static_cast<int *>(optionValue)) = cs.mbmaxlen;
++#ifndef MARIADB_BASE_VERSION
+ /* mysql_get_option() was added in mysql 5.7.3 version */
+ } else if ( proxy->get_server_version() >= 50703 ) {
+ try {
+@@ -1029,6 +1030,7 @@
+ CPP_ERR_FMT("Unsupported option : %d:(%s) %s", proxy->errNo(), proxy->sqlstate().c_str(), proxy->error().c_str());
+ throw e;
+ }
++#endif /* MARIADB_BASE_VERSION */
+ }
+ }
+ /* }}} */
+@@ -1046,11 +1048,13 @@
+ MY_CHARSET_INFO cs;
+ proxy->get_character_set_info(&cs);
+ return cs.dir ? sql::SQLString(cs.dir) : "";
++#ifndef MARIADB_BASE_VERSION
+ } else if ( proxy->get_server_version() >= 50703 ) {
+ const char* optionValue= NULL;
+ if (GET_CONN_OPTION(optionName, &optionValue, stringOptions)) {
+ return optionValue ? sql::SQLString(optionValue) : "";
+ }
++#endif /* MARIADB_BASE_VERSION */
+ }
+ return "";
+ }
diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.6-fix-cmake.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.6-fix-cmake.patch
new file mode 100644
index 000000000000..18d4e9a80410
--- /dev/null
+++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.6-fix-cmake.patch
@@ -0,0 +1,23 @@
+diff -aurN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2015-06-04 08:58:30.000000000 -0400
++++ b/CMakeLists.txt 2015-07-21 10:41:59.081091000 -0400
+@@ -300,7 +300,7 @@
+ SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+ ENDIF(WIN32)
+
+-SET(DOC_DESTINATION ".")
++SET(DOC_DESTINATION ${INSTALL_DOCS})
+ IF(RPM_LAYOUT)
+ SET(DOC_DESTINATION "share/doc/${CPACK_PACKAGE_NAME}-${MYSQLCPPCONN_VERSION}")
+ ENDIF()
+@@ -373,10 +373,6 @@
+ ADD_SUBDIRECTORY(cppconn)
+ ADD_SUBDIRECTORY(driver)
+ ADD_SUBDIRECTORY(examples)
+-ADD_SUBDIRECTORY(test)
+-ADD_SUBDIRECTORY(test/framework)
+-ADD_SUBDIRECTORY(test/CJUnitTestsPort)
+-ADD_SUBDIRECTORY(test/unit)
+
+ IF(DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
+ # see also README
diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch
new file mode 100644
index 000000000000..35ed218e18dc
--- /dev/null
+++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch
@@ -0,0 +1,45 @@
+diff -aurN a/driver/mysql_connection.cpp b/driver/mysql_connection.cpp
+--- a/driver/mysql_connection.cpp 2016-12-14 04:58:54.000000000 -0500
++++ b/driver/mysql_connection.cpp 2017-01-26 16:33:58.086005627 -0500
+@@ -1023,6 +1023,7 @@
+ proxy->get_character_set_info(&cs);
+ *(static_cast<int *>(optionValue)) = cs.mbmaxlen;
+ /* mysql_get_option() was added in mysql 5.7.3 version */
++#if !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID )
+ } else if ( proxy->get_server_version() >= 50703 ) {
+ try {
+ if (GET_CONN_OPTION(optionName, optionValue, intOptions)) {
+@@ -1036,6 +1037,7 @@
+ CPP_ERR_FMT("Unsupported option : %d:(%s) %s", proxy->errNo(), proxy->sqlstate().c_str(), proxy->error().c_str());
+ throw e;
+ }
++#endif
+ }
+ }
+ /* }}} */
+@@ -1053,11 +1055,13 @@
+ MY_CHARSET_INFO cs;
+ proxy->get_character_set_info(&cs);
+ return cs.dir ? sql::SQLString(cs.dir) : "";
++#if !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID )
+ } else if ( proxy->get_server_version() >= 50703 ) {
+ const char* optionValue= NULL;
+ if (GET_CONN_OPTION(optionName, &optionValue, stringOptions)) {
+ return optionValue ? sql::SQLString(optionValue) : "";
+ }
++#endif
+ }
+ return "";
+ }
+diff -aurN a/driver/nativeapi/libmysql_static_proxy.cpp b/driver/nativeapi/libmysql_static_proxy.cpp
+--- a/driver/nativeapi/libmysql_static_proxy.cpp 2017-01-26 16:35:46.256038741 -0500
++++ b/driver/nativeapi/libmysql_static_proxy.cpp 2017-01-26 16:28:34.114915809 -0500
+@@ -319,7 +319,7 @@
+ int
+ LibmysqlStaticProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg)
+ {
+-#if MYSQL_VERSION_ID >= 50703
++#if MYSQL_VERSION_ID >= 50703 && !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID )
+ if (::mysql_get_option(mysql, option, arg)) {
+ throw sql::InvalidArgumentException("Unsupported option provided to mysql_get_option()");
+ } else {
diff --git a/dev-db/mysql-connector-c++/metadata.xml b/dev-db/mysql-connector-c++/metadata.xml
new file mode 100644
index 000000000000..ded2dec8ab9d
--- /dev/null
+++ b/dev-db/mysql-connector-c++/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<use>
+<flag name="gcov">Build coverage support</flag>
+</use>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+<maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.3.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.3.ebuild
new file mode 100644
index 000000000000..57d25d9de98d
--- /dev/null
+++ b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.3.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils cmake-utils flag-o-matic multilib
+
+DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)"
+HOMEPAGE="http://dev.mysql.com/downloads/connector/cpp/"
+URI_DIR="Connector-C++"
+SRC_URI="https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 sparc x86"
+IUSE="debug examples gcov static-libs"
+
+DEPEND=">=virtual/mysql-5.1:=
+ dev-libs/boost:0=
+ dev-libs/openssl:0="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.3-fix-cmake.patch"
+)
+
+src_configure() {
+ # native lib/wrapper needs this!
+ append-flags "-fno-strict-aliasing"
+
+ local mycmakeargs=(
+ "-DMYSQLCPPCONN_BUILD_EXAMPLES=OFF"
+ "-DMYSQLCPPCONN_ICU_ENABLE=OFF"
+ $(cmake-utils_use debug MYSQLCPPCONN_TRACE_ENABLE)
+ $(cmake-utils_use gcov MYSQLCPPCONN_GCOV_ENABLE)
+ -DINSTALL_DOCS="/usr/share/doc/${PF}"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # static lib has wrong name so we need to rename it
+ if use static-libs; then
+ mv "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a \
+ "${ED}"/usr/$(get_libdir)/libmysqlcppconn.a || die
+ else
+ rm -f "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a
+ fi
+
+ # examples
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins "${S}"/examples/*
+ fi
+}
diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.6.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.6.ebuild
new file mode 100644
index 000000000000..e5de51d1a0fe
--- /dev/null
+++ b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.6.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils cmake-utils flag-o-matic multilib
+
+DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)"
+HOMEPAGE="http://dev.mysql.com/downloads/connector/cpp/"
+URI_DIR="Connector-C++"
+SRC_URI="https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 sparc x86"
+IUSE="debug examples gcov static-libs"
+
+DEPEND="virtual/libmysqlclient:=
+ dev-libs/boost:=
+ dev-libs/openssl:0="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.6-fix-cmake.patch"
+ "${FILESDIR}/${PN}-1.1.5-fix-mariadb.patch"
+)
+
+src_configure() {
+ # native lib/wrapper needs this!
+ append-flags "-fno-strict-aliasing"
+
+ local mycmakeargs=(
+ -DMYSQLCPPCONN_BUILD_EXAMPLES=OFF
+ -DMYSQLCPPCONN_ICU_ENABLE=OFF
+ $(cmake-utils_use debug MYSQLCPPCONN_TRACE_ENABLE)
+ $(cmake-utils_use gcov MYSQLCPPCONN_GCOV_ENABLE)
+ -DINSTALL_DOCS="/usr/share/doc/${PF}"
+ -DMYSQL_CXX_LINKAGE=0
+ -DMYSQL_INCLUDE_DIR=$(mysql_config --variable=pkgincludedir)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # static lib has wrong name so we need to rename it
+ if use static-libs; then
+ mv "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a \
+ "${ED}"/usr/$(get_libdir)/libmysqlcppconn.a || die
+ else
+ rm -f "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a
+ fi
+
+ # examples
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins "${S}"/examples/*
+ fi
+}
diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.8.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.8.ebuild
new file mode 100644
index 000000000000..1120d852cbed
--- /dev/null
+++ b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.8.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils flag-o-matic
+
+DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)"
+HOMEPAGE="http://dev.mysql.com/downloads/connector/cpp/"
+URI_DIR="Connector-C++"
+SRC_URI="https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug examples gcov static-libs"
+
+DEPEND="virtual/libmysqlclient:=
+ dev-libs/boost:=
+ dev-libs/openssl:0=
+ !<dev-db/mysql-connector-c-6.1.8"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.6-fix-cmake.patch"
+ "${FILESDIR}/${PN}-1.1.8-fix-mariadb.patch"
+)
+
+src_configure() {
+ # native lib/wrapper needs this!
+ append-flags "-fno-strict-aliasing"
+
+ local mycmakeargs=(
+ -DMYSQLCPPCONN_BUILD_EXAMPLES=OFF
+ -DMYSQLCPPCONN_ICU_ENABLE=OFF
+ -DUSE_MYSQLCPPCONN_TRACE_ENABLE=$(usex debug ON OFF)
+ -DUSE_MYSQLCPPCONN_GCOV_ENABLE=$(usex gcov ON OFF)
+ -DINSTALL_DOCS="/usr/share/doc/${PF}"
+ -DMYSQL_CXX_LINKAGE=0
+ -DMYSQL_INCLUDE_DIR=$(mysql_config --variable=pkgincludedir)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # static lib has wrong name so we need to rename it
+ if use static-libs; then
+ mv "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a \
+ "${ED}"/usr/$(get_libdir)/libmysqlcppconn.a || die
+ else
+ rm -f "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a
+ fi
+
+ # examples
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins "${S}"/examples/*
+ fi
+}
diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.9.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.9.ebuild
new file mode 100644
index 000000000000..2f1872df3f0b
--- /dev/null
+++ b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.9.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils flag-o-matic
+
+DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)"
+HOMEPAGE="http://dev.mysql.com/downloads/connector/cpp/"
+URI_DIR="Connector-C++"
+SRC_URI="https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug examples gcov static-libs"
+
+DEPEND="virtual/libmysqlclient:=
+ dev-libs/boost:=
+ dev-libs/openssl:0=
+ !<dev-db/mysql-connector-c-6.1.8"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.6-fix-cmake.patch"
+ "${FILESDIR}/${PN}-1.1.8-fix-mariadb.patch"
+)
+
+src_configure() {
+ # native lib/wrapper needs this!
+ append-flags "-fno-strict-aliasing"
+
+ local mycmakeargs=(
+ -DMYSQLCPPCONN_BUILD_EXAMPLES=OFF
+ -DMYSQLCPPCONN_ICU_ENABLE=OFF
+ -DUSE_MYSQLCPPCONN_TRACE_ENABLE=$(usex debug ON OFF)
+ -DUSE_MYSQLCPPCONN_GCOV_ENABLE=$(usex gcov ON OFF)
+ -DINSTALL_DOCS="/usr/share/doc/${PF}"
+ -DMYSQL_CXX_LINKAGE=0
+ -DMYSQL_INCLUDE_DIR=$(mysql_config --variable=pkgincludedir)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # static lib has wrong name so we need to rename it
+ if use static-libs; then
+ mv "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a \
+ "${ED}"/usr/$(get_libdir)/libmysqlcppconn.a || die
+ else
+ rm -f "${ED}"/usr/$(get_libdir)/libmysqlcppconn-static.a
+ fi
+
+ # examples
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins "${S}"/examples/*
+ fi
+}
diff --git a/dev-db/mysql-connector-c/Manifest b/dev-db/mysql-connector-c/Manifest
new file mode 100644
index 000000000000..cb06ee916bf3
--- /dev/null
+++ b/dev-db/mysql-connector-c/Manifest
@@ -0,0 +1,14 @@
+AUX conn-c-includes.patch 386 SHA256 ff1107769ef8eca55f27948b14fb7d70ca24d3b072c8a558331f27d7256f5164 SHA512 7601beb869ca55387790244fa5c0748eff1e5c6e3533aa4039cdbe3361d785f00a93b0ec43a6d96972c9c8c5bebb09a94fa6508eb5ce05f383522c4ab29ea11f WHIRLPOOL 1e6a2155cef46753366df3b13dd5fde709473e408906c5c485b03f8603e2a35a697d9cbb0a9d5b29c887b55c265853a4e3129c1152386bfe23894264865914bf
+AUX mysql_com.patch 1787 SHA256 faa8711e119def5a6c8106b6efa3d1a479ff68583809a9dc0e9f900ebf0e2d8b SHA512 340365b05d72045af0ef12fd5c260a796be547d9abb97a6ef3d6aaf30aecf29368c1dfa28f1284da544a81656f0436f11ada2f8c5cb481540d1f1c90dd354b49 WHIRLPOOL 9db197670b891d2661c2777671da30d72e8de477e16d4ab09fb501a9afc7d12326958ccab34ac6463597bc112e64bf7bc0ebbf813d491af4c3eedbaf8243cce3
+AUX openssl-cmake-detection.patch 564 SHA256 4e44d7a94ca89cced30b41207b00c47cba819c2b9021e035fd498aa3ea5694c1 SHA512 29214f3e8351c857b73ad39267179f04e50beb28ef00cf59375145e1fdbd4ce73ac7b2dc54975aa8f9406a1fa996bdff4852692629166bd1bef1d8ac9b24d435 WHIRLPOOL 796e862f7913e896b8f8cb9be49136f417a9cb051e184dc23ae988c970fb07f8b3b2b06c00975c0ffe3197edeca5f4b7d87143d69f8e34e484c2f2c0d821b555
+DIST mysql-connector-c-6.1.5-src.tar.gz 3455028 SHA256 278f2b40f3980079bc7ad247cb2bf08967ce56ef79da468ae26ff2e2a560be66 SHA512 be47ed70865744ff9ecb9376972208504327514f03635e54c05e81d324bcf9ba777300a12738d8ca32b95c9c31d734dc9f6ebb7bb24fd11821560a6b0f09bb56 WHIRLPOOL bfdd17908cae63ef5b5006bdf28432bb12738044fe99960fdddab6da527ab41211a48396270a778ce500c5758c2f5d50c1fd850a92c684996612ab7c38637c61
+DIST mysql-connector-c-6.1.6-src.tar.gz 3475044 SHA256 2222433012c415871958b61bc4f3683e1ebe77e3389f698b267058c12533ea78 SHA512 2a3db4aec5b8e5357fa407d6e2b52534f7aa9c0b78c4ebe9a61e2e25dc5f7dc1f1962f6e6fd847107ce53ca369e0babe7118b947a87189495212596348cfd760 WHIRLPOOL 6a0a55a47a88606c12511f9fd155bafcf5d73b1ffa2c4877b838bca018f4a8a8f4427ac6af6e4c567eced7e1108dba4a613255f813ab481e8ea948b3a6cdff33
+DIST mysql-connector-c-6.1.9-src.tar.gz 3494748 SHA256 4e808704443365ad5b649673d03eca8fbebc0a4da9f1f96616c6bd1b1901ab2b SHA512 3127d08428e820044e25ab5ebb741a128325be6ca0fca0300cab33891693e11e57d4ded5a25918a67d23cceb8a2c6ee99879ffb50c31bc4c2e225a9dba9674dc WHIRLPOOL 7f0cb1fa7bb0f77447f4884b567e7881d8d9c1dda2e27250838fe8a51ac4ddcb8f7aa683fe11a3f7f9545f90918b15fe9e033da138c86e5bd4f360164ebaeb2e
+EBUILD mysql-connector-c-6.1.5.ebuild 1455 SHA256 43185fbcf3fcf92544003105a05ec3da9201b4da577c08c0f4a64aa308077699 SHA512 3d11b764f57ce83fbb3e3999827a10330b90d44a311693f71aea8b941685781d72a251897f1d510b4dbdab8a333dc4570c43b442df124b92b2dc87d738e75c8c WHIRLPOOL 0e3d9fbb6c283e84432118a28129fb10f3ecd72634a81cefb6b16d8f545a88d21b04b5ff60e639ffbfde2012f7f0446e0c175a22bafd8f87e93c0db07f25ec5c
+EBUILD mysql-connector-c-6.1.6-r1.ebuild 1615 SHA256 c13dfe2e7b5694fa35bad1a0fd2b4da894e0065a9f504f9d712e33a2c5e5c2e7 SHA512 85bea81c9c6876dd76ec3c5046496c25ca16e2045225e2820f25be7160d29a55dc310a67c5bdf19c45cf3ec741f2aa7c45fcc0b59bd66cfba874ffc29eb9b928 WHIRLPOOL 1c6b7eca37f4a1c3757dc97048e32bef5858aa9363d8d71f5085f885d67624584afb9b6df69b330b4a8446e3fadd9d236a7bde06bd500d408a89b0275cec4a75
+EBUILD mysql-connector-c-6.1.6-r2.ebuild 2105 SHA256 2c282188b26b8805ac9fc73d90940d303e5bb9b5b0364badff8406312969d24f SHA512 a9811b44813edada99de6283fa0b04875167273683d26b0c1c54cdb355002985481b0d333437f79866502464ebdaf72ad9eb19b505c1701d7d8a5beabb777da3 WHIRLPOOL 25e489f050688ee564d15f7e093c67fce3aa60701fecf50b051faff7fccec9c8625c5811985325ed20b98c8611edf2c858120bc959582f902ab7c8d4524a48b5
+EBUILD mysql-connector-c-6.1.9-r1.ebuild 2159 SHA256 f0fb51274550ff7fafb4e5dadb700b4708ef1e4168e58a063ccb9e288f1a6cef SHA512 734240efbf263b39c34d0b8be8b9641fe8d3915d829e0f00f5014560a0671e614bc01b6f749e436d140cc0a2abe7e7b142ff977188dcd579dcce0ae755d11ea6 WHIRLPOOL f3c77f8b6fed3dea186e6869e20c73ae0a21ca01287734ef44c037f6b0b66521a635ca8ad6318c5d6291db0caf10650c4859e94e8ceade018338a917e6639b23
+EBUILD mysql-connector-c-6.1.9.ebuild 1974 SHA256 1ae8455216fde95576bf042bed21062a9d648a027bc6884ac9585bb37da76fb8 SHA512 f13c7e3bb1f8443f3ef07e40d33b3efcb040a25246bdce34331d3fe3c5a0e797f062857e6617a75847b3cf64c85b9554c7238dce205ff0612295c2ff0c4628f4 WHIRLPOOL f8a5857ce1f38fa1a1d7ad0047be903cfa1af67571598a8bbc032c21588124afa6d521d166bafa0abe768e02a0694be945b5294ebab96fa03720211ee0286bc4
+MISC ChangeLog 4210 SHA256 49bc4ddbe5d7b9861a0a47da0dff8439545aa1254e658f874eaabd682ea0a014 SHA512 2f40b4f4b12d226a535600df73b4579ef7d454c1f107d1e44b06f82437fe06b597a96e833b6811139bb717694066ac656f3533bddb7bb60044b0d9375dac816e WHIRLPOOL 8050a7b12e04c132413742de717d714b2cc145ada7a0c22379809b6b53c505da1e0d5cf8208b9074c8505bdfedea0754aa3401a857d04ae1342d8c50c3e4957b
+MISC ChangeLog-2015 601 SHA256 828e88df369701275ead137ce3a91c3d58da90f775583f5a06d3786f110d27cf SHA512 1e57ce1e1625114b48c7f4a410fea944098abe1dfca815a14e78df338dd2ccaa4ffa8e0db1225e194ecc7866262a2b9b618a79f5aa0e229fcb57d5aae4908ffa WHIRLPOOL b18260020190129b7ed3a43b70694697773b0d3e42bd0d8093accd4af678e60b856bc0eeb4da4633bd5a0709090a774397ead334c78a145d99ce1324e945403e
+MISC metadata.xml 239 SHA256 a35e1476a1677a91f06dd6e4f955fcebc58c3a07f934b5e62fbf801573a5c82b SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b WHIRLPOOL 3ed1945907fa58cbc9997c311d1d0431d481586576ce45b4bc5caf7704ddefe2117305879a97e8021694b86af0d570a34517212b6cc9528224b85e568eee3d75
diff --git a/dev-db/mysql-connector-c/files/conn-c-includes.patch b/dev-db/mysql-connector-c/files/conn-c-includes.patch
new file mode 100644
index 000000000000..fcde71f3f4ee
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/conn-c-includes.patch
@@ -0,0 +1,15 @@
+diff -aurN a/include/CMakeLists.txt b/include/CMakeLists.txt
+--- a/include/CMakeLists.txt 2015-07-14 13:06:04.424091000 -0400
++++ b/include/CMakeLists.txt 2015-07-14 13:24:43.434091000 -0400
+@@ -55,6 +55,11 @@
+ byte_order_generic_x86.h
+ little_endian.h
+ big_endian.h
++ my_thread_local.h
++ thr_cond.h
++ thr_lock.h
++ thr_mutex.h
++ thr_rwlock.h
+ ${HEADERS_GEN_CONFIGURE}
+ )
+
diff --git a/dev-db/mysql-connector-c/files/mysql_com.patch b/dev-db/mysql-connector-c/files/mysql_com.patch
new file mode 100644
index 000000000000..36a7d5a23791
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/mysql_com.patch
@@ -0,0 +1,31 @@
+--- a/include/mysql_com.h 2014-06-10 23:10:43.000000000 -0400
++++ b/include/mysql_com.h 2015-08-11 15:20:54.487091000 -0400
+@@ -179,7 +171,7 @@
+ #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
+ #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
+ #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
+-#define CLIENT_RESERVED2 32768 /* Old flag for 4.1 authentication */
++#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
+ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
+ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
+ #define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
+@@ -226,7 +216,7 @@
+ | CLIENT_IGNORE_SIGPIPE \
+ | CLIENT_TRANSACTIONS \
+ | CLIENT_RESERVED \
+- | CLIENT_RESERVED2 \
++ | CLIENT_SECURE_CONNECTION \
+ | CLIENT_MULTI_STATEMENTS \
+ | CLIENT_MULTI_RESULTS \
+ | CLIENT_PS_MULTI_RESULTS \
+--- a/libmysql/client_settings.h 2015-02-25 16:09:49.000000000 -0500
++++ b/libmysql/client_settings.h 2015-08-11 15:44:10.804091000 -0400
+@@ -31,7 +31,7 @@
+ CLIENT_LONG_FLAG | \
+ CLIENT_TRANSACTIONS | \
+ CLIENT_PROTOCOL_41 | \
+- CLIENT_RESERVED2 | \
++ CLIENT_SECURE_CONNECTION | \
+ CLIENT_MULTI_RESULTS | \
+ CLIENT_PS_MULTI_RESULTS | \
+ CLIENT_PLUGIN_AUTH | \
diff --git a/dev-db/mysql-connector-c/files/openssl-cmake-detection.patch b/dev-db/mysql-connector-c/files/openssl-cmake-detection.patch
new file mode 100644
index 000000000000..3a5f53e7ba35
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/openssl-cmake-detection.patch
@@ -0,0 +1,12 @@
+diff -aurN a/cmake/ssl.cmake b/cmake/ssl.cmake
+--- a/cmake/ssl.cmake 2014-11-21 00:39:51.000000000 -0500
++++ b/cmake/ssl.cmake 2015-01-27 08:45:36.771744344 -0500
+@@ -166,7 +166,7 @@
+ # Encoded as MNNFFPPS: major minor fix patch status
+ FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h"
+ OPENSSL_VERSION_NUMBER
+- REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*"
++ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*"
+ )
+ STRING(REGEX REPLACE
+ "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1"
diff --git a/dev-db/mysql-connector-c/metadata.xml b/dev-db/mysql-connector-c/metadata.xml
new file mode 100644
index 000000000000..709689b06053
--- /dev/null
+++ b/dev-db/mysql-connector-c/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.5.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.5.ebuild
new file mode 100644
index 000000000000..f865e84f6663
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.5.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-multilib eutils
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="~amd64 ~x86"
+
+SLOT="0/18"
+IUSE="+ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README Docs/ChangeLog )
+
+src_prepare() {
+ epatch "${FILESDIR}/openssl-cmake-detection.patch"
+ epatch_user
+}
+
+multilib_src_configure() {
+ mycmakeargs+=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r1.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r1.ebuild
new file mode 100644
index 000000000000..ae0938c61b5e
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-multilib eutils
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="~amd64 ~ia64 ~ppc64 ~x86"
+
+SLOT="0/18"
+IUSE="+ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README Docs/ChangeLog )
+
+src_prepare() {
+ epatch "${FILESDIR}/openssl-cmake-detection.patch" \
+ "${FILESDIR}/conn-c-includes.patch" \
+ "${FILESDIR}/mysql_com.patch"
+ epatch_user
+}
+
+multilib_src_configure() {
+ mycmakeargs+=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r2.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r2.ebuild
new file mode 100644
index 000000000000..32e4df87bd45
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.6-r2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-multilib eutils multilib
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc64 ~x86"
+
+SUBSLOT="18"
+SLOT="0/${SUBSLOT}"
+IUSE="+ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README Docs/ChangeLog )
+
+src_prepare() {
+ epatch "${FILESDIR}/openssl-cmake-detection.patch" \
+ "${FILESDIR}/conn-c-includes.patch" \
+ "${FILESDIR}/mysql_com.patch"
+ epatch_user
+}
+
+multilib_src_configure() {
+ mycmakeargs+=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
+
+pkg_preinst() {
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library libmysqlclient.so.${SUBSLOT}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.9-r1.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.9-r1.ebuild
new file mode 100644
index 000000000000..5222a52edcdb
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.9-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc64 ~x86"
+
+SUBSLOT="18"
+SLOT="0/${SUBSLOT}"
+IUSE="+ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README Docs/ChangeLog )
+PATCHES=(
+ "${FILESDIR}/mysql_com.patch" )
+
+src_prepare() {
+ sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die
+ default
+}
+
+multilib_src_configure() {
+ mycmakeargs+=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient
+ -DSHARED_LIB_PATCH_VERSION="0"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
+
+pkg_preinst() {
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library libmysqlclient.so.${SUBSLOT}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.9.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.9.ebuild
new file mode 100644
index 000000000000..2868be92897b
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.9.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc64 ~x86"
+
+SUBSLOT="18"
+SLOT="0/${SUBSLOT}"
+IUSE="+ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README Docs/ChangeLog )
+PATCHES=(
+ "${FILESDIR}/mysql_com.patch" )
+
+multilib_src_configure() {
+ mycmakeargs+=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
+
+pkg_preinst() {
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library libmysqlclient.so.${SUBSLOT}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}
diff --git a/dev-db/mysql-init-scripts/Manifest b/dev-db/mysql-init-scripts/Manifest
new file mode 100644
index 000000000000..1a0722a0a77e
--- /dev/null
+++ b/dev-db/mysql-init-scripts/Manifest
@@ -0,0 +1,18 @@
+AUX conf.d-2.0 2944 SHA256 b94756f2a5fe43893dea90fadbe47308e50fb4dbe2cbaa2676f34fa88181d8e7 SHA512 2781e2caefed0c8be9c612f92cecf5a572dc17b97519034637a2b3f98a88af02dd8973f6c6b2af524d235067df6866409d1fe9d56740bfd0efb09948073c8d3b WHIRLPOOL d174ea0c58217b4403a640c06dba06db3d6ecd650ae66a24051e4319f13fb8e6f603c01dee6e9af5b91c645e67f186817182c808e0ba7d7282d51d3ac932ea86
+AUX init.d-2.0 4534 SHA256 b6eb4576e654b1f4a8138df04408935a07fab69775e9663f736133c71bbb414b SHA512 f3ba5b3f9b6d60ecdcda3a3aa38f62991969d597586ca0bdc70f2c2901409298f88cab7f98665edd486a6ce312f27c74796afa9c2d880a132516c3b2c002d69c WHIRLPOOL 13bff6f9c7882f7bbc8f755d862f0eea80d7d9e40edf308b3347035cb324f12e649253eafceff8332fa4219f62dab2588740079bb68f0d68c504f3a594a95ac8
+AUX init.d-2.2 5603 SHA256 9216a101ce10924f577c8a165c738b1a880eacd143b2188a9a859c47326904bf SHA512 5e65261228d09d479478f71aaa2272934e893cf2d462d8ed3a3ceaffaae479e5bb61ba84d10722bb4810d36a674aebf0981d318f1f3fb70964fad9981c154883 WHIRLPOOL 5fa32aac0143f01f4f0dc4332b6f835ad3c693167ad8998ae2f2e131d1c92c996b59f8deea4b6d666b81965009607f9a4aab8c89918336f936af2f64a2259171
+AUX init.d-s6 3879 SHA256 4499808045497addaf504abeb2de80de7259e2f2f8468762157ff4612e40d602 SHA512 dc3b7bb441b3df58ecb99d977773365324b43474b1c2d3f9bbd8e18542579008445bbe788e78bc4ef6c1cd0cb51d0c2f16a5577d3840aa125383715f1938b8d9 WHIRLPOOL 7961756c3cc888bd52b321452a2c68bdd6bbc3ed1cedc76e5bab5ced7f4d1d6d910e75886be3d0388c9ecaaf341a7bc17374705efafbf67dc1dc27f9438cb028
+AUX init.d-s6-2.2 4977 SHA256 b254c2e55203fa74d8f370f869ba1e37a6d098457e3346f9bae7a468336b0dda SHA512 6c08421ee1379bde500f3bdddb8d7c997c088241e5feb5ea7ebde4727ffee7ed1489e8d71b968fcb8f7f2e180aef94fc9542bff261c6ac3e67bdee491cc7a52b WHIRLPOOL 4c161cbef84c88a1181ad9dbe3d69ac2eba59b03f7b84fa4e90014a00ec1688ded2098a1dcb73ef251c425e69e3031b1776ff373922409c0e4bc238c1a012d78
+AUX init.d-supervise 5303 SHA256 1d3472f50efe242938a3d5f8b5870355a72ec86125b91173543db768fdbe8af5 SHA512 149710600ca4780434e07101aa164e84d7decd86fdc4c2a8c5c37d2a965aff4626408885f98456773c6f8fb27eeeb5ab7028ccf73088739368c45f8ad9d587c4 WHIRLPOOL c36cbff57fb23183d2ed3b9be758a552c5023d64fcef5f3d19a1135574e90f8e38e341207065f22c9c08560fd849b8d68faacd81c18b412bd7aaabc4a8a910f3
+AUX log-s6 373 SHA256 e66f40cb4b575fdc0b473dd9e51afca799a317ab317afe5a78267560ffe90776 SHA512 e686bc0a4d9d5daf263c5a5f6bb883da1495feb9910f93c791af2d858b2adbf7cfc785c336ce470609f3f7bd12dabb97b470453bd67316feef5ed4df9ee9307d WHIRLPOOL d836d833e1c6f06515ec0b26a14ac4e89008403c8e01db6a833877d0954a7fffca96ff274b3a3a1c7a7d37eab9f394a107a0ac6424a1f79b91dadc20bb6f87ee
+AUX logrotate.mysql 368 SHA256 a25ba0df7782e9a2dceac69e808c304e97a10119f5c0c2b539113a41576b5ca3 SHA512 71e6aeec21e220157fb07a609475c626e0698f556db20f5e2876117d1d46a2f297520b2124458e8b8077f9a128e27540ffa1b77cadc5eb372a502edfb804fed1 WHIRLPOOL e2012c56148e24339a7b70f7f7674071c3600ac94ae3c4dcaf1f4bc548f89764dd0099673e11b35f95936bf8bb72b3e65e53f70f1492c09707af3d5d0196e19b
+AUX mysql.conf 37 SHA256 08daa863ddd50aff0b608621ed26936919211e286440951dca5866141291004d SHA512 7b4940666d21f09fda47e2b24bd252c83af4372f34f1b3410c59d8f439fb7c0166d5a1b8d857bf67f2263f15d95a0fa0b67f225152a18c180b67d28f4ceb5f00 WHIRLPOOL e2765bf32478fa6d3362760845188bc25b5e2a280cac66dc453b593445d8eaa0af4c92704ed20b4561377771b354605477d8cb5420937d1e9f970e0b4b106d85
+AUX mysqld-v2.service 1208 SHA256 fcf720ea5953939279dec5a2dfa5c52230960f625a9031bfe9f951e36d1cb723 SHA512 2016ea7d9c8fe9447675ec9612655f1b955a3f04ce417ebb1c7a8a86a29ef176a5737a9bd3bc5e45508e2e23a764a763897881b511f65635193291e212fd58aa WHIRLPOOL 98a3e3e0677bcaa152d538745414288c8b2d32b698933a85c52175ba8f3e9fca8ef0654363a27ddce449c8ba1204b25b83d97a64468dcf693981a738d8697727
+AUX mysqld-wait-ready 1758 SHA256 98d845897c4098e4a3ca62cd3bad26a6fc2565a33737f1d1c91f9c98006c7157 SHA512 ad4a850d045149df156c8236ae114e94887626e3ca803dea9bcc3909349043b51357a71ac17d694e0217f7856e076a0736267fc1ea3dedbef8a319fc9014c01b WHIRLPOOL fb748c13658d276c061a44ffd488eeb2cf002df20ee94b5aa600175fa776e099211f89343d1322bbf03ddaebbafb30208e615ad78eb1fbedb26f77232662907b
+AUX mysqld_at-v2.service 1170 SHA256 e6d19a8414fdf78f1eaaf7f5ec2de57864f9fed86f193870fc0a8f108aec9b3e SHA512 a91eb574925afc0096e668799f9806b1cfa4c808ffab26dab5df1934db0dd8059a5e7913b0fdc3374f41e14cc72a6450890c9d746d3ff2de873af91199a71ee0 WHIRLPOOL 7c42bdd333f578b9a5443ae13383539cc116c0b2f32283c0e09ca20e46076b59f5eea40f6be0dd296fb56de04097ee6eded4ae7d1fb345481eb66a5527ddc254
+AUX run-s6 268 SHA256 387eff4eeef85711e052cc5ee7f532f5574e35ff1875c490316b65203009e750 SHA512 82be247195f6d9d230b063e9bda393bab8855382c2f3e5eb4d427fc1eb7e23dbd8c90939224ff2b5e4116a5c9d3f26ebdc9b9f548cde91e7c1217f4f8500c0d3 WHIRLPOOL e7ea48cf98bf7c2a4dd433db0fd64344e62da19f8d7f3b0d092fcd145d69ff1794b432da7a122fef5738684674986e8743141c328e02d1b789a0e4cc8abb32bb
+EBUILD mysql-init-scripts-2.1-r1.ebuild 1821 SHA256 c9bc91af814c1c774e18c6d420c0922d0c144a8a6257dfc626e57c924f17689a SHA512 22ded8b5a54f56a24f15e9285cb5900dd2cda89b21c78eebc0e7b8fd04ba5cde0b4a50f2d2ba51a520263d3ee97f6f5a0dacd30a754af3c5c992ba498be5d657 WHIRLPOOL 3ee855a1b7aedeff173a233f0a5ce56898524734e60f7f7182d5b4e354042c9b57dd3960551dbee9de71544731480ebcfbad49778ffc723e95165dc1bdcee2a3
+EBUILD mysql-init-scripts-2.2-r1.ebuild 1893 SHA256 a18369bc2ed7fcbac0008d0ef3e1192be9eab0acf589158d9a609371d9e63ad9 SHA512 210347f43ef41525f34b2ec6b856ad2b3c55535b0363283554f027ee8b8ba00e0683c488f5afee98b93a9ab5797844e28d02c46d9d98a679cad4986b33bff582 WHIRLPOOL 7ac5eede920bfc9c8ba5d13c90572f63985659524f5bd4f592287d559298b863efe4331efc5615b12a32977fd7cc9ab32880e23203b4c169fd1612f622c132e1
+MISC ChangeLog 5075 SHA256 44ff68e70c3fc274340328cfa85036b4f6f76fc56d9407ce625b5f2899b318b8 SHA512 bdde86bbb6e5411fcac587bbfe3224c860903cde1ea87ef5c47a0f8e21fe70d43601ceb8973c9d4d0f35cd139d361ed40d11f158d4634fff757ffb4c4a96e676 WHIRLPOOL 4fa50bc76b94aceaf16222d44af2efe06d4a1a79645dc1ff095ec7a05ea043395113eabfc0c837539a63513d1e150df4d5042b4d8c1e0e4605ead5f6e42720c9
+MISC ChangeLog-2015 10019 SHA256 bc664645c2510ff8077652c36fdd804b29f4f2c2d84915f75323996d02088be4 SHA512 c7112d3e3695c89f06422f7af6e1b9ed723961c43d5d9cdf5a97ed32943faa66f035b0e04a6ea95499a8b596bc710361d7235c5dae780ab7fed6bc7ff979b2b7 WHIRLPOOL 697811e2925bf4501f4be76e7b48b50def027a8ffd1a01b4d726ff0d4b37ec280c1597f5632a8f90bab3680f0596b6a25ae5b3d11e003a2902f1c6c647d1ffbd
+MISC metadata.xml 243 SHA256 441acc023219e6b01e567b9d627a53793c43f3f2fd1dbe3be0eced9885b70385 SHA512 7c227a1fadd8d61aae9baabeb5d964c93fe0c4d82fb838c83fe0360cf38b24bebf51037726f13188ecd8f52c335368a693b81e74d79ba949576a6dbcb54887a9 WHIRLPOOL f3d0d5ea02babbb1d947f0d274afcdb548af3c4356bc049be314e561f3f6e3ae9503599a44bc8da1e305aa18cb671950adb2fb284060a4b98b67a8a6d16bef73
diff --git a/dev-db/mysql-init-scripts/files/conf.d-2.0 b/dev-db/mysql-init-scripts/files/conf.d-2.0
new file mode 100644
index 000000000000..cecb9a940f14
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/conf.d-2.0
@@ -0,0 +1,78 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# If you want a non-stock location for the config file, uncomment or update
+# either of these as needed. If you do use it, you must make sure that none of
+# your socket, pidfile, datadir, logfiles, binary logs, relay logs or InnoDB
+# files collide with each other.
+MY_CNF="/etc/mysql/my.cnf"
+#MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+#MY_CNF="${MY_CNF:-/etc/mysql/my-${SVCNAME/mysql.}.cnf}"
+
+# Place any additional arguments here that you might need
+# Common/useful options:
+# --skip-slave-start=1 - For bringing up replication initially
+# --server-id=NNN - Server ID for replication
+# --skip-networking - lock it down to UNIX sockets only
+MY_ARGS=""
+
+# This setting (in seconds) should be high enough to allow InnoDB to do a full
+# checkpoint recovery. 900 is the default used in the upstream RPM startup
+# scripts. 30 seconds should be sufficent if you just have a tiny <1GiB
+# database. After the core startup is done, we wait this long for the UNIX
+# socket to appear.
+STARTUP_TIMEOUT="900"
+
+# This is how long, in milliseconds, we wait for pidfile to be created, early
+# in the startup.
+STARTUP_EARLY_TIMEOUT="1000"
+
+# How long (in seconds) should we wait for shutdown?
+STOP_TIMEOUT=120
+
+# integer [-20 .. 19 ] default 0
+# change the priority of the server -20 (high) to 19 (low)
+# see nice(1) for description
+#NICE=0
+
+# See start-stop-daemon(8) for possible settings
+#IONICE=2
+
+# If defined, --verbose gets passed to S-S-D
+#DEBUG=1
+
+# Depending on your usage of MySQL, you may also wish to start it after some
+# other services are up. Uncomment the lines below as needed. If these aren't
+# enough for you, we encourage you to file a bug, and help us understand how
+# you are using MySQL.
+
+# Do your MySQL ACLs refer to hostnames not in your /etc/hosts?
+# If so, you need DNS before you can accept connections.
+# Avoid dependency circular loops if you use MySQL to power a local DNS server.
+#rc_use="dns"
+#rc_after="dns"
+
+# Does your MySQL bind to an IP on an interface other than net.lo?
+# Alternatively you might wish to specify the exact interface here.
+#rc_use="net"
+#rc_after="net"
+
+# Do you store your MySQL files on a SAN or other network filesystem, that is
+# provided by the netmount init script?
+#rc_need="netmount"
+
+# Or from NFS? P.S. This is not a good idea in most cases, but does have some
+# valid usage cases, so we provide the option.
+#rc_need="nfsmount"
+
+# Should any one of the instances satisfy the requirement for MySQL coming up?
+# By default, we say no.
+[ "${SVCNAME}" != mysql ] && rc_provide="!mysql"
+# But uncomment this next instead if you think it should.
+#rc_provide="mysql"
+
+# The conditional above has a false-positive "failure" return value as a
+# side-effect, and since it's the last statement, without the next line, this
+# script returns failure.
+return 0
+# vim: ft=gentoo-conf-d et ts=4 sw=4:
diff --git a/dev-db/mysql-init-scripts/files/init.d-2.0 b/dev-db/mysql-init-scripts/files/init.d-2.0
new file mode 100644
index 000000000000..ac94a9dd39b3
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/init.d-2.0
@@ -0,0 +1,159 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="checkconfig"
+
+depend() {
+ use net.lo
+ # localmount needed for $basedir
+ need localmount
+}
+
+get_config() {
+ my_print_defaults --config-file="$1" mysqld |
+ sed -n -e "s/^--$2=//p"
+}
+
+mysql_svcname() {
+ local ebextra=
+ case "${SVCNAME}" in
+ mysql*) ;;
+ *) ebextra=" (mysql)" ;;
+ esac
+ echo "${SVCNAME}${ebextra}"
+}
+
+start() {
+ # Check for old conf.d variables that mean migration was not yet done.
+ set | egrep -sq '^(mysql_slot_|MYSQL_BLOG_PID_FILE|STOPTIMEOUT)'
+ rc=$?
+ # Yes, MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING is a hidden variable.
+ # It does have a use in testing, as it is possible to build a config file
+ # that works with both the old and new init scripts simulateously.
+ if [ "${rc}" = 0 -a -z "${MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING}" ]; then
+ eerror "You have not updated your conf.d for the new mysql-init-scripts-2 revamp."
+ eerror "Not proceeding because it may be dangerous."
+ return 1
+ fi
+
+ # Check the config or die
+ checkconfig || return 1
+
+ # Now we can startup
+ ebegin "Starting $(mysql_svcname)"
+
+ MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+
+ if [ ! -r "${MY_CNF}" ] ; then
+ eerror "Cannot read the configuration file \`${MY_CNF}'"
+ return 1
+ fi
+
+ # tail -n1 is critical as these we only want the last instance of the option
+ local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
+ local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
+ local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ pidfile="${chroot}/${pidfile}"
+ fi
+
+ if [ ! -d "${datadir}" ] ; then
+ eerror "MySQL datadir \`${datadir}' is empty or invalid"
+ eerror "Please check your config file \`${MY_CNF}'"
+ return 1
+ fi
+
+ if [ ! -d "${datadir}"/mysql ] ; then
+ # find which package is installed to report an error
+ local EROOT=$(portageq envvar EROOT)
+ local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
+ if [ -z ${DBPKG_P} ] ; then
+ eerror "You don't appear to have a server package installed yet."
+ else
+ eerror "You don't appear to have the mysql database installed yet."
+ eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
+ fi
+ return 1
+ fi
+
+ local piddir="${pidfile%/*}"
+ checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+
+ local startup_timeout=${STARTUP_TIMEOUT:-900}
+ local startup_early_timeout=${STARTUP_EARLY_TIMEOUT:-1000}
+ local tmpnice="${NICE:+"--nicelevel "}${NICE}"
+ local tmpionice="${IONICE:+"--ionice "}${IONICE}"
+ start-stop-daemon \
+ ${DEBUG:+"--verbose"} \
+ --start \
+ --exec "${basedir}"/sbin/mysqld \
+ --pidfile "${pidfile}" \
+ --background \
+ --wait ${startup_early_timeout} \
+ ${tmpnice} \
+ ${tmpionice} \
+ -- --defaults-file="${MY_CNF}" ${MY_ARGS}
+ local ret=$?
+ if [ ${ret} -ne 0 ] ; then
+ eend ${ret}
+ return ${ret}
+ fi
+
+ ewaitfile ${startup_timeout} "${socket}"
+ eend $? || return 1
+
+ save_options pidfile "${pidfile}"
+ save_options basedir "${basedir}"
+}
+
+stop() {
+ ebegin "Stopping $(mysql_svcname)"
+
+ local pidfile="$(get_options pidfile)"
+ local basedir="$(get_options basedir)"
+ local stop_timeout=${STOP_TIMEOUT:-120}
+
+ start-stop-daemon \
+ ${DEBUG:+"--verbose"} \
+ --stop \
+ --exec "${basedir}"/sbin/mysqld \
+ --pidfile "${pidfile}" \
+ --retry ${stop_timeout}
+ eend $?
+}
+
+checkconfig() {
+ local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+ local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+ local svc_name=$(mysql_svcname)
+ ebegin "Checking mysqld configuration for ${svc_name}"
+
+ if [ ${RC_CMD} = "checkconfig" ] ; then
+ # We are calling checkconfig specifically. Print warnings regardless.
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ else
+ # Suppress output to check the return value
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+ # If the above command does not return 0,
+ # then there is an error to echo to the user
+ if [ $? -ne 0 ] ; then
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ fi
+ fi
+
+ eend $? "${svc_name} config check failed"
+}
+
+# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
+
diff --git a/dev-db/mysql-init-scripts/files/init.d-2.2 b/dev-db/mysql-init-scripts/files/init.d-2.2
new file mode 100644
index 000000000000..124d2e993eb1
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/init.d-2.2
@@ -0,0 +1,191 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="checkconfig"
+extra_stopped_commands="boostrap_galera"
+
+description_checkconfig="Verify the server's configuration"
+description_boostrap_galera="Start a new Galera cluster with this server as the initial node"
+
+depend() {
+ use net.lo
+ # localmount needed for $basedir
+ need localmount
+}
+
+get_config() {
+ my_print_defaults --defaults-file="$1" mysqld server mariadb |
+ sed -n -e "s/^--$2=//p"
+}
+
+mysql_svcname() {
+ local ebextra=
+ case "${SVCNAME}" in
+ mysql*) ;;
+ *) ebextra=" (mysql)" ;;
+ esac
+ echo "${SVCNAME}${ebextra}"
+}
+
+stringContain() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; }
+
+bootstrap_galera() {
+ MY_ARGS="--wsrep-new-cluster ${MY_ARGS}"
+ mark_service_starting
+ if start ; then
+ mark_service_started
+ return 0
+ else
+ mark_service_stopped
+ return 1
+ fi
+}
+
+start() {
+ # Check for old conf.d variables that mean migration was not yet done.
+ set | egrep -sq '^(mysql_slot_|MYSQL_BLOG_PID_FILE|STOPTIMEOUT)'
+ rc=$?
+ # Yes, MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING is a hidden variable.
+ # It does have a use in testing, as it is possible to build a config file
+ # that works with both the old and new init scripts simulateously.
+ if [ "${rc}" = 0 -a -z "${MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING}" ]; then
+ eerror "You have not updated your conf.d for the new mysql-init-scripts-2 revamp."
+ eerror "Not proceeding because it may be dangerous."
+ return 1
+ fi
+
+ # Check the config or die
+ if [ ${RC_CMD} != "restart" ] ; then
+ checkconfig || return 1
+ fi
+
+ # Now we can startup
+ ebegin "Starting $(mysql_svcname)"
+
+ MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+
+ if [ ! -r "${MY_CNF}" ] ; then
+ eerror "Cannot read the configuration file \`${MY_CNF}'"
+ return 1
+ fi
+
+ # tail -n1 is critical as these we only want the last instance of the option
+ local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
+ local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+ local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')"
+ local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1)
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ pidfile="${chroot}/${pidfile}"
+ fi
+
+ # Galera: Only check datadir if not starting a new cluster and galera is enabled
+ # wsrep_on is not on or wsrep-new-cluster exists in the config or MY_ARGS
+ [ "${wsrep}" = "1" ] && wsrep="on"
+ if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then
+
+ local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
+ if [ ! -d "${datadir}" ] ; then
+ eerror "MySQL datadir \`${datadir}' is empty or invalid"
+ eerror "Please check your config file \`${MY_CNF}'"
+ return 1
+ fi
+
+ if [ ! -d "${datadir}"/mysql ] ; then
+ # find which package is installed to report an error
+ local EROOT=$(portageq envvar EROOT)
+ local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
+ if [ -z ${DBPKG_P} ] ; then
+ eerror "You don't appear to have a server package installed yet."
+ else
+ eerror "You don't appear to have the mysql database installed yet."
+ eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
+ fi
+ return 1
+ fi
+ fi
+
+ local piddir="${pidfile%/*}"
+ checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+
+ local startup_timeout=${STARTUP_TIMEOUT:-900}
+ local startup_early_timeout=${STARTUP_EARLY_TIMEOUT:-1000}
+ local tmpnice="${NICE:+"--nicelevel "}${NICE}"
+ local tmpionice="${IONICE:+"--ionice "}${IONICE}"
+ start-stop-daemon \
+ ${DEBUG:+"--verbose"} \
+ --start \
+ --exec "${basedir}"/sbin/mysqld \
+ --pidfile "${pidfile}" \
+ --background \
+ --wait ${startup_early_timeout} \
+ ${tmpnice} \
+ ${tmpionice} \
+ -- --defaults-file="${MY_CNF}" ${MY_ARGS}
+ local ret=$?
+ if [ ${ret} -ne 0 ] ; then
+ eend ${ret}
+ return ${ret}
+ fi
+
+ ewaitfile ${startup_timeout} "${socket}"
+ eend $? || return 1
+
+ save_options pidfile "${pidfile}"
+ save_options basedir "${basedir}"
+}
+
+stop() {
+ if [ ${RC_CMD} = "restart" ] ; then
+ checkconfig || return 1
+ fi
+
+ ebegin "Stopping $(mysql_svcname)"
+
+ local pidfile="$(get_options pidfile)"
+ local basedir="$(get_options basedir)"
+ local stop_timeout=${STOP_TIMEOUT:-120}
+
+ start-stop-daemon \
+ ${DEBUG:+"--verbose"} \
+ --stop \
+ --exec "${basedir}"/sbin/mysqld \
+ --pidfile "${pidfile}" \
+ --retry ${stop_timeout}
+ eend $?
+}
+
+checkconfig() {
+ local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+ local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+ local svc_name=$(mysql_svcname)
+ ebegin "Checking mysqld configuration for ${svc_name}"
+
+ if [ ${RC_CMD} = "checkconfig" ] ; then
+ # We are calling checkconfig specifically. Print warnings regardless.
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ else
+ # Suppress output to check the return value
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+ # If the above command does not return 0,
+ # then there is an error to echo to the user
+ if [ $? -ne 0 ] ; then
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ fi
+ fi
+
+ eend $? "${svc_name} config check failed"
+}
+
+# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
+
diff --git a/dev-db/mysql-init-scripts/files/init.d-s6 b/dev-db/mysql-init-scripts/files/init.d-s6
new file mode 100644
index 000000000000..74ff34b04fcf
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/init.d-s6
@@ -0,0 +1,128 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use net.lo
+ # localmount needed for $basedir
+ need localmount s6-svscan
+}
+
+get_config() {
+ my_print_defaults --config-file="$1" mysqld |
+ sed -n -e "s/^--$2=//p"
+}
+
+mysql_svcname() {
+ local ebextra=
+ case "${svc_name}" in
+ mysql*) ;;
+ *) ebextra=" (mysql)" ;;
+ esac
+ echo "${svc_name}${ebextra}"
+}
+
+extra_commands="checkconfig"
+supervisor=s6
+name=$(mysql_svcname)
+s6_service_timeout_stop="$((1000*${STOP_TIMEOUT:-120}))"
+#s6_svwait_options_start="-U -t $((1000*${STARTUP_EARLY_TIMEOUT:-1000}))"
+svc_name=${RC_SVCNAME%-s6}
+s6_service_path=/var/svc.d/${svc_name}
+
+start_pre() {
+ # Check the config or die
+ checkconfig || return 1
+
+ MY_CNF="${MY_CNF:-/etc/${svc_name}/my.cnf}"
+
+ if [ ! -r "${MY_CNF}" ] ; then
+ eerror "Cannot read the configuration file \`${MY_CNF}'"
+ return 1
+ fi
+
+ # tail -n1 is critical as these we only want the last instance of the option
+ local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
+ local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
+ local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ pidfile="${chroot}/${pidfile}"
+ fi
+
+ if [ ! -d "${datadir}" ] ; then
+ eerror "MySQL datadir \`${datadir}' is empty or invalid"
+ eerror "Please check your config file \`${MY_CNF}'"
+ return 1
+ fi
+
+ if [ ! -d "${datadir}"/mysql ] ; then
+ # find which package is installed to report an error
+ local EROOT=$(portageq envvar EROOT)
+ local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
+ if [ -z ${DBPKG_P} ] ; then
+ eerror "You don't appear to have a server package installed yet."
+ else
+ eerror "You don't appear to have the mysql database installed yet."
+ eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
+ fi
+ return 1
+ fi
+
+ local piddir="${pidfile%/*}"
+ checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+
+ # Prepare env files to source
+ mkdir -p "/var/svc.d/${svc_name}"
+ echo "MY_CNF=\"${MY_CNF}\"" > "/var/svc.d/${svc_name}/env"
+ echo "MY_ARGS=\"${MY_ARGS}\"" >> "/var/svc.d/${svc_name}/env"
+ echo "basedir=\"${basedir}\"" >> "/var/svc.d/${svc_name}/env"
+ mkdir -p "/var/svc.d/${svc_name}/log"
+ echo "SVCNAME=\"${svc_name}\"" > "/var/svc.d/${svc_name}/log/env"
+ echo "S6_LOG_OPTIONS=\"${S6_LOG_OPTIONS}\"" > "/var/svc.d/${svc_name}/log/env"
+}
+
+start_post() {
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+ local startup_timeout=${STARTUP_TIMEOUT:-900}
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ fi
+ ewaitfile ${startup_timeout} "${socket}"
+}
+
+checkconfig() {
+ local my_cnf="${MY_CNF:-/etc/${svc_name}/my.cnf}"
+ local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+ local svc_name=$(mysql_svcname)
+ ebegin "Checking mysqld configuration for ${svc_name}"
+
+ if [ ${RC_CMD} = "checkconfig" ] ; then
+ # We are calling checkconfig specifically. Print warnings regardless.
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ else
+ # Suppress output to check the return value
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+ # If the above command does not return 0,
+ # then there is an error to echo to the user
+ if [ $? -ne 0 ] ; then
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ fi
+ fi
+
+ eend $? "${svc_name} config check failed"
+}
+
+# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
+
diff --git a/dev-db/mysql-init-scripts/files/init.d-s6-2.2 b/dev-db/mysql-init-scripts/files/init.d-s6-2.2
new file mode 100644
index 000000000000..46980fab9c37
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/init.d-s6-2.2
@@ -0,0 +1,163 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use net.lo
+ # localmount needed for $basedir
+ need localmount s6-svscan
+}
+
+get_config() {
+ my_print_defaults --defaults-file="$1" mysqld server mariadb |
+ sed -n -e "s/^--$2=//p"
+}
+
+mysql_svcname() {
+ local ebextra=
+ case "${svc_name}" in
+ mysql*) ;;
+ *) ebextra=" (mysql)" ;;
+ esac
+ echo "${svc_name}${ebextra}"
+}
+
+stringContain() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; }
+
+bootstrap_galera() {
+ MY_ARGS="--wsrep-new-cluster ${MY_ARGS}"
+ mark_service_starting
+ if start_pre && start ; then
+ mark_service_started
+ return 0
+ else
+ mark_service_stopped
+ return 1
+ fi
+}
+
+
+extra_commands="checkconfig"
+extra_stopped_commands="boostrap_galera"
+
+description_checkconfig="Verify the server's configuration"
+description_boostrap_galera="Start a new Galera cluster with this server as the initial node"
+supervisor=s6
+name=$(mysql_svcname)
+s6_service_timeout_stop="$((1000*${STOP_TIMEOUT:-120}))"
+#s6_svwait_options_start="-U -t $((1000*${STARTUP_EARLY_TIMEOUT:-1000}))"
+svc_name=${RC_SVCNAME%-s6}
+s6_service_path=/var/svc.d/${svc_name}
+
+start_pre() {
+ # Check the config or die
+ if [ ${RC_CMD} != "restart" ] ; then
+ checkconfig || return 1
+ fi
+
+ MY_CNF="${MY_CNF:-/etc/${svc_name}/my.cnf}"
+
+ if [ ! -r "${MY_CNF}" ] ; then
+ eerror "Cannot read the configuration file \`${MY_CNF}'"
+ return 1
+ fi
+
+ # tail -n1 is critical as these we only want the last instance of the option
+ local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
+ local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+ local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')"
+ local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1)
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ pidfile="${chroot}/${pidfile}"
+ fi
+
+ # Galera: Only check datadir if not starting a new cluster and galera is enabled
+ # wsrep_on is not on or wsrep-new-cluster exists in the config or MY_ARGS
+ [ "${wsrep}" = "1" ] && wsrep="on"
+ if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then
+
+ local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
+ if [ ! -d "${datadir}" ] ; then
+ eerror "MySQL datadir \`${datadir}' is empty or invalid"
+ eerror "Please check your config file \`${MY_CNF}'"
+ return 1
+ fi
+
+ if [ ! -d "${datadir}"/mysql ] ; then
+ # find which package is installed to report an error
+ local EROOT=$(portageq envvar EROOT)
+ local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
+ if [ -z ${DBPKG_P} ] ; then
+ eerror "You don't appear to have a server package installed yet."
+ else
+ eerror "You don't appear to have the mysql database installed yet."
+ eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
+ fi
+ return 1
+ fi
+ fi
+
+ local piddir="${pidfile%/*}"
+ checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+
+ # Prepare env files to source
+ mkdir -p "/var/svc.d/${svc_name}"
+ echo "MY_CNF=\"${MY_CNF}\"" > "/var/svc.d/${svc_name}/env"
+ echo "MY_ARGS=\"${MY_ARGS}\"" >> "/var/svc.d/${svc_name}/env"
+ echo "basedir=\"${basedir}\"" >> "/var/svc.d/${svc_name}/env"
+ mkdir -p "/var/svc.d/${svc_name}/log"
+ echo "SVCNAME=\"${svc_name}\"" > "/var/svc.d/${svc_name}/log/env"
+ echo "S6_LOG_OPTIONS=\"${S6_LOG_OPTIONS}\"" > "/var/svc.d/${svc_name}/log/env"
+}
+
+start_post() {
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+ local startup_timeout=${STARTUP_TIMEOUT:-900}
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ fi
+ ewaitfile ${startup_timeout} "${socket}"
+}
+
+checkconfig() {
+ local my_cnf="${MY_CNF:-/etc/${svc_name}/my.cnf}"
+ local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+ local svc_name=$(mysql_svcname)
+ ebegin "Checking mysqld configuration for ${svc_name}"
+
+ if [ ${RC_CMD} = "checkconfig" ] ; then
+ # We are calling checkconfig specifically. Print warnings regardless.
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ else
+ # Suppress output to check the return value
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+ # If the above command does not return 0,
+ # then there is an error to echo to the user
+ if [ $? -ne 0 ] ; then
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ fi
+ fi
+
+ eend $? "${svc_name} config check failed"
+}
+
+stop_pre() {
+ if [ ${RC_CMD} = "restart" ] ; then
+ checkconfig || return 1
+ fi
+}
+
+# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
+
diff --git a/dev-db/mysql-init-scripts/files/init.d-supervise b/dev-db/mysql-init-scripts/files/init.d-supervise
new file mode 100644
index 000000000000..5341a6a18d64
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/init.d-supervise
@@ -0,0 +1,180 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="checkconfig"
+extra_stopped_commands="boostrap_galera"
+
+description_checkconfig="Verify the server's configuration"
+description_boostrap_galera="Start a new Galera cluster with this server as the initial node"
+
+depend() {
+ use net.lo
+ # localmount needed for $basedir
+ need localmount
+}
+
+get_config() {
+ my_print_defaults --defaults-file="$1" mysqld server mariadb |
+ sed -n -e "s/^--$2=//p"
+}
+
+mysql_svcname() {
+ local ebextra=
+ case "${SVCNAME}" in
+ mysql*) ;;
+ *) ebextra=" (mysql)" ;;
+ esac
+ echo "${SVCNAME}${ebextra}"
+}
+
+stringContain() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; }
+
+bootstrap_galera() {
+ MY_ARGS="--wsrep-new-cluster ${MY_ARGS}"
+ mark_service_starting
+ if start ; then
+ mark_service_started
+ return 0
+ else
+ mark_service_stopped
+ return 1
+ fi
+}
+
+start() {
+ # Check for old conf.d variables that mean migration was not yet done.
+ set | egrep -sq '^(mysql_slot_|MYSQL_BLOG_PID_FILE|STOPTIMEOUT)'
+ rc=$?
+ # Yes, MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING is a hidden variable.
+ # It does have a use in testing, as it is possible to build a config file
+ # that works with both the old and new init scripts simulateously.
+ if [ "${rc}" = 0 -a -z "${MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING}" ]; then
+ eerror "You have not updated your conf.d for the new mysql-init-scripts-2 revamp."
+ eerror "Not proceeding because it may be dangerous."
+ return 1
+ fi
+
+ # Check the config or die
+ if [ ${RC_CMD} != "restart" ] ; then
+ checkconfig || return 1
+ fi
+
+ # Now we can startup
+ ebegin "Starting $(mysql_svcname)"
+
+ MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+
+ if [ ! -r "${MY_CNF}" ] ; then
+ eerror "Cannot read the configuration file \`${MY_CNF}'"
+ return 1
+ fi
+
+ # tail -n1 is critical as these we only want the last instance of the option
+ local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
+ local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
+ local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+ local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')"
+ local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1)
+
+ if [ -n "${chroot}" ] ; then
+ socket="${chroot}/${socket}"
+ pidfile="${chroot}/${pidfile}"
+ fi
+
+ # Galera: Only check datadir if not starting a new cluster and galera is enabled
+ # wsrep_on is not on or wsrep-new-cluster exists in the config or MY_ARGS
+ [ "${wsrep}" = "1" ] && wsrep="on"
+ if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then
+
+ local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
+ if [ ! -d "${datadir}" ] ; then
+ eerror "MySQL datadir \`${datadir}' is empty or invalid"
+ eerror "Please check your config file \`${MY_CNF}'"
+ return 1
+ fi
+
+ if [ ! -d "${datadir}"/mysql ] ; then
+ # find which package is installed to report an error
+ local EROOT=$(portageq envvar EROOT)
+ local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
+ if [ -z ${DBPKG_P} ] ; then
+ eerror "You don't appear to have a server package installed yet."
+ else
+ eerror "You don't appear to have the mysql database installed yet."
+ eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
+ fi
+ return 1
+ fi
+ fi
+
+ local piddir="${pidfile%/*}"
+ checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+
+ local startup_timeout=${STARTUP_TIMEOUT:-900}
+# local startup_early_timeout=${STARTUP_EARLY_TIMEOUT:-1000}
+ local tmpnice="${NICE:+"--nicelevel "}${NICE}"
+ local tmpionice="${IONICE:+"--ionice "}${IONICE}"
+ supervise-daemon \
+ ${DEBUG:+"--verbose"} \
+ --pidfile "/run/${SVCNAME}.pid" \
+ ${tmpnice} \
+ ${tmpionice} \
+ --start \
+ "${basedir}"/sbin/mysqld \
+ -- --defaults-file="${MY_CNF}" ${MY_ARGS}
+ local ret=$?
+ if [ ${ret} -ne 0 ] ; then
+ eend ${ret}
+ return ${ret}
+ fi
+
+ ewaitfile ${startup_timeout} "${socket}"
+ eend $? || return 1
+}
+
+stop() {
+ if [ ${RC_CMD} = "restart" ] ; then
+ checkconfig || return 1
+ fi
+
+ ebegin "Stopping $(mysql_svcname)"
+
+ supervise-daemon \
+ ${DEBUG:+"--verbose"} \
+ --stop \
+ --pidfile "/run/${SVCNAME}.pid"
+ eend $?
+}
+
+checkconfig() {
+ local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+ local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+ local svc_name=$(mysql_svcname)
+ ebegin "Checking mysqld configuration for ${svc_name}"
+
+ if [ ${RC_CMD} = "checkconfig" ] ; then
+ # We are calling checkconfig specifically. Print warnings regardless.
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ else
+ # Suppress output to check the return value
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+ # If the above command does not return 0,
+ # then there is an error to echo to the user
+ if [ $? -ne 0 ] ; then
+ "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+ fi
+ fi
+
+ eend $? "${svc_name} config check failed"
+}
+
+# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
+
diff --git a/dev-db/mysql-init-scripts/files/log-s6 b/dev-db/mysql-init-scripts/files/log-s6
new file mode 100644
index 000000000000..d135c530cd4e
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/log-s6
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
+mkdir -p "/var/log/mysql/${SVCNAME}"
+if [ ${S6_LOG_OPTIONS} ] ; then
+ exec s6-log ${S6_LOG_OPTIONS}
+else
+ exec s6-log -b n20 S15000000 !"gzip -nq9" "/var/log/mysql/${SVCNAME}"
+fi
diff --git a/dev-db/mysql-init-scripts/files/logrotate.mysql b/dev-db/mysql-init-scripts/files/logrotate.mysql
new file mode 100644
index 000000000000..afb20c66d479
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/logrotate.mysql
@@ -0,0 +1,14 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+/var/log/mysql/mysql.err /var/log/mysql/mysql.log /var/log/mysql/mysqld.err {
+monthly
+create 660 mysql mysql
+notifempty
+size 5M
+sharedscripts
+missingok
+postrotate
+[ -f /var/run/mysqld/mysqld.pid ] && /bin/kill -HUP `cat /var/run/mysqld/mysqld.pid`
+endscript
+}
diff --git a/dev-db/mysql-init-scripts/files/mysql.conf b/dev-db/mysql-init-scripts/files/mysql.conf
new file mode 100644
index 000000000000..74cd5f836e76
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/mysql.conf
@@ -0,0 +1 @@
+d /var/run/mysqld 0755 mysql mysql -
diff --git a/dev-db/mysql-init-scripts/files/mysqld-v2.service b/dev-db/mysql-init-scripts/files/mysqld-v2.service
new file mode 100644
index 000000000000..641abf733098
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/mysqld-v2.service
@@ -0,0 +1,47 @@
+[Unit]
+Description=MySQL database server
+After=syslog.target
+After=network.target
+Conflicts=mariadb.service
+
+[Service]
+Type=simple
+User=mysql
+Group=mysql
+
+# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
+# https://bugzilla.redhat.com/show_bug.cgi?id=547485
+ExecStart=/usr/sbin/mysqld --basedir=/usr
+ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+# We rely on systemd, not mysqld_safe, to restart mysqld if it dies
+# Restart crashed server only, on-failure would also restart, for example, when
+# my.cnf contains unknown option
+Restart=on-abort
+RestartSec=5s
+
+# Place temp files in a secure directory, not /tmp
+PrivateTmp=true
+
+# To allow memlock to be used as non-root user if set in configuration
+CapabilityBoundingSet=CAP_IPC_LOCK
+
+# Prevent writes to /usr, /boot, and /etc
+ProtectSystem=full
+
+# Currently has issues with SELinux https://jira.mariadb.org/browse/MDEV-10404
+# This is safe to uncomment when not using SELinux
+#NoNewPrivileges=true
+
+PrivateDevices=true
+
+# Prevent accessing /home, /root and /run/user
+ProtectHome=true
+
+UMask=007
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/mysql-init-scripts/files/mysqld-wait-ready b/dev-db/mysql-init-scripts/files/mysqld-wait-ready
new file mode 100644
index 000000000000..9e5d3e4d85e0
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/mysqld-wait-ready
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# This script waits for mysqld to be ready to accept connections
+# (which can be many seconds or even minutes after launch, if there's
+# a lot of crash-recovery work to do).
+# Running this as ExecStartPost is useful so that services declared as
+# "After mysqld" won't be started until the database is really ready.
+
+# Service file passes us the daemon's PID (actually, mysqld_safe's PID)
+daemon_pid="$1"
+
+# extract value of a MySQL option from config files
+# Usage: get_mysql_option SECTION VARNAME DEFAULT
+# result is returned in $result
+# We use my_print_defaults which prints all options from multiple files,
+# with the more specific ones later; hence take the last match.
+get_mysql_option(){
+ result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
+ if [ -z "$result" ]; then
+ # not found, use default
+ result="$3"
+ fi
+}
+
+# Defaults here had better match what mysqld_safe will default to
+get_mysql_option mysqld datadir "/var/lib/mysql"
+datadir="$result"
+get_mysql_option mysqld socket "/var/lib/mysql/mysql.sock"
+socketfile="$result"
+
+# Wait for the server to come up or for the mysqld process to disappear
+ret=0
+while /bin/true; do
+ RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
+ mret=$?
+ if [ $mret -eq 0 ]; then
+ break
+ fi
+ # exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
+ # anything else suggests a configuration error
+ if [ $mret -ne 1 -a $mret -ne 11 ]; then
+ ret=1
+ break
+ fi
+ # "Access denied" also means the server is alive
+ echo "$RESPONSE" | grep -q "Access denied for user" && break
+
+ # Check process still exists
+ if ! /bin/kill -0 $daemon_pid 2>/dev/null; then
+ ret=1
+ break
+ fi
+ sleep 1
+done
+
+exit $ret
diff --git a/dev-db/mysql-init-scripts/files/mysqld_at-v2.service b/dev-db/mysql-init-scripts/files/mysqld_at-v2.service
new file mode 100644
index 000000000000..26964ea8a768
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/mysqld_at-v2.service
@@ -0,0 +1,45 @@
+[Unit]
+Description=MySQL database server
+ConditionPathExists=/etc/mysql/my%I.cnf
+After=network.target
+
+[Service]
+Type=simple
+User=mysql
+Group=mysql
+
+# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
+# https://bugzilla.redhat.com/show_bug.cgi?id=547485
+ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my%I.cnf --basedir=/usr
+ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+# Restart crashed server only, on-failure would also restart, for example, when
+# my.cnf contains unknown option
+Restart=on-abort
+RestartSec=5s
+
+# Place temp files in a secure directory, not /tmp
+PrivateTmp=true
+
+# To allow memlock to be used as non-root user if set in configuration
+CapabilityBoundingSet=CAP_IPC_LOCK
+
+# Prevent writes to /usr, /boot, and /etc
+ProtectSystem=full
+
+# Currently has issues with SELinux https://jira.mariadb.org/browse/MDEV-10404
+# This is safe to uncomment when not using SELinux
+#NoNewPrivileges=true
+
+PrivateDevices=true
+
+# Prevent accessing /home, /root and /run/user
+ProtectHome=true
+
+UMask=007
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/mysql-init-scripts/files/run-s6 b/dev-db/mysql-init-scripts/files/run-s6
new file mode 100644
index 000000000000..1ab2253cd823
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/run-s6
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
+exec "${basedir}/sbin/mysqld" --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
diff --git a/dev-db/mysql-init-scripts/metadata.xml b/dev-db/mysql-init-scripts/metadata.xml
new file mode 100644
index 000000000000..357d7d00f109
--- /dev/null
+++ b/dev-db/mysql-init-scripts/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1-r1.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1-r1.ebuild
new file mode 100644
index 000000000000..1d910869dcbc
--- /dev/null
+++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit systemd s6
+
+DESCRIPTION="Gentoo MySQL init scripts."
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+# This _will_ break with MySQL 5.0, 4.x, 3.x
+# It also NEEDS openrc for the save_options/get_options builtins.
+# The s6 support was added after openrc 0.16.2
+RDEPEND="
+ !<dev-db/mysql-5.1
+ !<sys-apps/openrc-0.16.2
+ "
+# Need to set S due to PMS saying we need it existing, but no SRC_URI
+S=${WORKDIR}
+
+src_install() {
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql"
+
+ # s6 init scripts
+ if use amd64 || use x86 ; then
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
+ newinitd "${FILESDIR}/init.d-s6" "mysql-s6"
+ s6_install_service mysql "${FILESDIR}/run-s6"
+ s6_install_service mysql/log "${FILESDIR}/log-s6"
+ fi
+
+ newinitd "${FILESDIR}/init.d-2.0" "mysql"
+
+ # systemd unit installation
+ exeinto /usr/libexec
+ doexe "${FILESDIR}"/mysqld-wait-ready
+ systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
+ systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
+ systemd_dotmpfilesd "${FILESDIR}/mysql.conf"
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate.mysql" "mysql"
+}
+
+pkg_postinst() {
+ if use amd64 || use x86 ; then
+ einfo ""
+ elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
+ elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
+ fi
+
+ einfo ""
+ elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
+ elog "You should prefer that unit over this package's mysqld.service."
+ einfo ""
+}
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r1.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r1.ebuild
new file mode 100644
index 000000000000..75b8390652f6
--- /dev/null
+++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd s6
+
+DESCRIPTION="Gentoo MySQL init scripts."
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+# This _will_ break with MySQL 5.0, 4.x, 3.x
+# It also NEEDS openrc for the save_options/get_options builtins.
+# The s6 support was added after openrc 0.16.2
+RDEPEND="
+ !<dev-db/mysql-5.1
+ !<sys-apps/openrc-0.16.2
+ "
+# Need to set S due to PMS saying we need it existing, but no SRC_URI
+S=${WORKDIR}
+
+src_install() {
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql"
+
+ # s6 init scripts
+ if use amd64 || use x86 ; then
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
+ newinitd "${FILESDIR}/init.d-s6-2.2" "mysql-s6"
+ s6_install_service mysql "${FILESDIR}/run-s6"
+ s6_install_service mysql/log "${FILESDIR}/log-s6"
+ fi
+
+ newinitd "${FILESDIR}/init.d-2.2" "mysql"
+ newinitd "${FILESDIR}/init.d-supervise" "mysql-supervise"
+
+ # systemd unit installation
+ exeinto /usr/libexec
+ doexe "${FILESDIR}"/mysqld-wait-ready
+ systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
+ systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
+ systemd_dotmpfilesd "${FILESDIR}/mysql.conf"
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate.mysql" "mysql"
+}
+
+pkg_postinst() {
+ if use amd64 || use x86 ; then
+ einfo ""
+ elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
+ elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
+ fi
+
+ einfo ""
+ elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
+ elog "You should prefer that unit over this package's mysqld.service."
+ einfo ""
+}
diff --git a/dev-db/mysql-proxy/Manifest b/dev-db/mysql-proxy/Manifest
new file mode 100644
index 000000000000..5d2038c14c14
--- /dev/null
+++ b/dev-db/mysql-proxy/Manifest
@@ -0,0 +1,9 @@
+AUX mysql-proxy.cnf 1120 SHA256 ae0e763dc1e5ef37d1b8708dc7a2c49c063843268a57e1fc0294678d173330af SHA512 5f889422d7232608dcde5f332577c563b0c29b0db5a327659ce7b30cef7e4d498eca641159d49671b7368080ff2113511b6b362b44fb75ddd781a00e2879246b WHIRLPOOL 2dd62bf08eefed090e6d6db161925201daad44c443d0f314472ecd5a435a90384d78b3c7cc3b2fbf229b158d4a7182606d56375583e78a2de35dcf040e18955b
+AUX mysql-proxy.confd 365 SHA256 4828001b27499b5de40810ed74dbfe907a6369a11670c523ea3b4898bbb56b5f SHA512 9a4a6499e03d939fcc5fbd5f71d1e377a1d003e542be7fab47d810899649f58e518aa34617c67b207477c7b1a85b75ce3045eb5959156c673b4c28c2c101185b WHIRLPOOL 57ac502c0b9763bfb0b804d25f3d55b53700359d396315627894de4e1fb6d18b8ed2f799b67ca16d0e9da4fb0354faa582a68606000ee314cafbf61eb89eb937
+AUX mysql-proxy.confd-0.8.0-r1 391 SHA256 68301473edd001349639dd4b2c826c0f6c5f68b59a32843e9bd4d9429258d2ac SHA512 e07afd8502d87006cfd4640e83c1ecab98b862d0916ee351c9c60aaaa01f0766d51d0749d3f63f33df9f8bbbbc45ef21517fa0dbc87bf3ade8e3e6c4048c8a5b WHIRLPOOL 038ec55217d58de957d00f768a85088cd214918f52e4a1d6250e8ede4c9b9a21cdfc20f17a72f7c6d399135e7f2d21f4e7acf4dbf52171147004c531887563d4
+AUX mysql-proxy.initd 431 SHA256 c7fe4c6b42fb369dc552fcd698e48fb4a1957bbecf64060761ea940bd727357a SHA512 184850991fbc7c2c625e28f217b12a6e44a38392d1f054dfd25ab6b4c298fb5c53177d6590f536ec3b23bf03b127ae7ee144cc5402bcd2cc8be44a478bc82af3 WHIRLPOOL cf92cc161c9f6524a8695228ec8fe183eb066b9e7cab1d132c216deeb3ac94a71e649f718731c44acf71c502c33ce3b016a67ca68aca734475145606e6f7ecc7
+DIST mysql-proxy-0.8.2.tar.gz 861995 SHA256 3955d9a60249d36b2c5c949706f7a3294419d2563c1e8474164a3a307865f550 SHA512 e083ea6344bf2d3b85a38127e42cbab659a959684f7f0f63272fa0df926d6d32dbbaaab2b6479ee8fc227fbc9af6f24e855d19700ec1ab4b904c5e638b4d64c8 WHIRLPOOL e7c3355b221c7d150004a3bcb02db28c67759d9c83f9d8d4219c2b8e403d176fdbe562e05f5e7ea1e6768f78144a4438678991fcc974448e2c271405d8c6f3a2
+EBUILD mysql-proxy-0.8.2-r1.ebuild 1268 SHA256 de37204e72cb7781acbeba7896e3a571a154ebc15fa925787edc0f8c4a4dc261 SHA512 491326aa07da2e83e440420950c687162d33c3393dd33ae845259a4e663726258f2bc2ba4783ad03289e99cd4164d008d0c8805e36358fa519fe528697d95c76 WHIRLPOOL 582a5db112901a8f3d774d5f9069b9b6bb020cbd039e5f7b1a0783ce0e128177d414419fc6b3a819bf090e68562351fb4852bb6ea234cbc416c8b7d83f4e823f
+MISC ChangeLog 2686 SHA256 a7f63773a48a6bbc42b765feae7ac0118df71ea23851b69d7c6e971b2c900426 SHA512 5043242ee334c4e1bf57246f4cb2ff8b40e9ba633e9e63c7e25be324d3a8ce16c3fa5bfc16351d6072574be8b06839a1d2a8df054b6df494d8085db0b0b197a3 WHIRLPOOL cb9110e8208e618aacb4a1e71737a089f43c633d429df2a015e522abe8073c73a160515534d1a038555a5cf02b0c9906c75a7cbe17275f4611276c76d8c468aa
+MISC ChangeLog-2015 3136 SHA256 b1e6551e1987aab3eb3820177869d8a5068698654d98baf3e4341186a3aadb47 SHA512 3aa5e8cac7dea7079a5ccfd16767401e27e91a11136045e7eee843814f2a8669070f971d512bb959f4390f9461e4ec53ec7a3401ed1cd11921572c7a39048646 WHIRLPOOL 2d649517e46406d58c17ad746362e372b49892f84558157f9add4ea411a146675bb221f4edcbaec53fe6a0084f188303ffacf615b988fcbd4e979ad0e3a82527
+MISC metadata.xml 553 SHA256 906baee9822534af75c70dcb1c773e285475b0e2de7458855345dd135cf4d4f1 SHA512 ea9b0711830e204234c0395e2637005cbf83187c7554435351447871ca99595756893ab4113adcac3deaa6df5495fdf9bf4d3091140c6d2ef498e832cc520388 WHIRLPOOL 5c96a1c8b2de41d3c3057c0344bb97273990a680fb7db797871c8d469880f40e96b4af940feac4b95d0e8299e2aeaf74661a2ebc8a271f09235c8cebe5fd9cb9
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.cnf b/dev-db/mysql-proxy/files/mysql-proxy.cnf
new file mode 100644
index 000000000000..7d15674f6b9d
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.cnf
@@ -0,0 +1,47 @@
+# MySQL Proxy's configuration file (mysql-proxy.cnf)
+# This file must be 0660 or more restrictive
+# otherwise mysql-proxy will refuse to load
+[mysql-proxy]
+#basedir = ...
+#daemon = true
+#defaults-file = ...
+#event-threads = ...
+keepalive = true
+log-backtrace-on-crash = true
+log-file = /var/log/mysql/mysql-proxy.log
+log-level = warning
+#log-use-syslog = true
+#lua-cpath = ...
+#lua-path = ...
+#max-open-files = ...
+pid-file = /var/run/mysql-proxy.pid
+#plugin-dir = ...
+#plugins = admin,proxy,debug,replicant
+#plugins = admin,proxy
+plugins = proxy
+#user = ...
+
+# module: admin
+admin-address = 127.0.0.1:4041
+#admin-lua-script = ...
+#admin-password = ...
+#admin-username = ...
+
+# module: proxy
+#no-proxy = false
+proxy-address = 127.0.0.1:4040
+proxy-backend-addresses = 127.0.0.1:3306
+proxy-fix-bug-25371 = false
+#proxy-lua-script = ...
+#proxy-pool-no-change-user = ...
+#proxy-read-only-backend-addresses = ...
+proxy-skip-profiling = false
+
+# module: replicant
+#replicant-master-address = ...
+#replicant-username = ...
+#replicant-password = ...
+#replicant-read-binlogs = ...
+
+# module: debug
+debug-address = 127.0.0.1:4043
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.confd b/dev-db/mysql-proxy/files/mysql-proxy.confd
new file mode 100644
index 000000000000..079530159f82
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.confd
@@ -0,0 +1,12 @@
+# /etc/conf.d/mysql-proxy: config file for /etc/init.d/mysql-proxy
+
+# location of pidfile
+PIDFILE="/var/run/mysql-proxy.pid"
+
+# general options for mysql-proxy
+# do NOT specify --daemon or --pid-file=... here!
+OPTS="--log-use-syslog"
+
+# if you want mysql-proxy to depend on mysql, enable this:
+#RC_NEED="mysql" # baselayout-1
+#rc_need="mysql" # baselayout-2/OpenRC
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r1 b/dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r1
new file mode 100644
index 000000000000..8b86431a3d8f
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r1
@@ -0,0 +1,12 @@
+# /etc/conf.d/mysql-proxy: config file for /etc/init.d/mysql-proxy
+
+# location of pidfile
+PIDFILE="/var/run/mysql-proxy.pid"
+
+# general options for mysql-proxy
+# do NOT specify --daemon or --pid-file=... here!
+OPTS="--defaults-file=/etc/mysql/mysql-proxy.cnf"
+
+# if you want mysql-proxy to depend on mysql, enable this:
+#RC_NEED="mysql" # baselayout-1
+#rc_need="mysql" # baselayout-2/OpenRC
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.initd b/dev-db/mysql-proxy/files/mysql-proxy.initd
new file mode 100644
index 000000000000..7107facfd6f8
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting MySQL Proxy"
+ start-stop-daemon --start --quiet \
+ --exec /usr/bin/mysql-proxy \
+ -- --daemon --pid-file="${PIDFILE}" ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping MySQL Proxy"
+ start-stop-daemon --stop --quiet \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/dev-db/mysql-proxy/metadata.xml b/dev-db/mysql-proxy/metadata.xml
new file mode 100644
index 000000000000..dc0c708273db
--- /dev/null
+++ b/dev-db/mysql-proxy/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+MySQL Proxy is a simple program that sits between your client and MySQL
+server(s) that can monitor, analyze or transform their communication. Its
+flexibility allows for unlimited uses; common ones include: load balancing;
+failover; query analysis; query filtering and modification; and many more.
+</longdescription>
+ <upstream>
+ <remote-id type="launchpad">mysql-proxy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild b/dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild
new file mode 100644
index 000000000000..6a7abae6bab8
--- /dev/null
+++ b/dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils versionator
+
+MY_PV=$(get_version_component_range 1-2)
+DESCRIPTION="A Proxy for the MySQL Client/Server protocol"
+HOMEPAGE="http://dev.mysql.com/doc/mysql-proxy/en/"
+SRC_URI="https://launchpad.net/${PN}/${MY_PV}/${PV}/+download/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples"
+RDEPEND=">=dev-libs/libevent-2.1
+ >=dev-libs/glib-2.16
+ >=dev-lang/lua-5.1:0"
+DEPEND="${RDEPEND}
+ >=virtual/mysql-5.0
+ virtual/pkgconfig"
+
+src_prepare() {
+ sed -i \
+ -e 's|_EVENT_VERSION|LIBEVENT_VERSION|g' \
+ src/chassis-mainloop.c || die
+}
+
+src_configure() {
+ econf \
+ --includedir=/usr/include/${PN} \
+ --with-mysql \
+ --with-lua \
+ || die "econf failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ newinitd "${FILESDIR}"/${PN}.initd ${PN} || die
+ newconfd "${FILESDIR}"/${PN}.confd-0.8.0-r1 ${PN} || die
+ dodoc ChangeLog NEWS README
+ if use examples; then
+ docinto examples
+ dodoc examples/*.lua || die
+ dodoc lib/*.lua || die
+ fi
+ # mysql-proxy will refuse to start unless the config file is at most 0660.
+ insinto /etc/mysql
+ insopts -m0660
+ doins "${FILESDIR}"/${PN}.cnf || die
+}
diff --git a/dev-db/mysql-super-smack/Manifest b/dev-db/mysql-super-smack/Manifest
new file mode 100644
index 000000000000..2fd248946298
--- /dev/null
+++ b/dev-db/mysql-super-smack/Manifest
@@ -0,0 +1,10 @@
+AUX mysql-super-smack-1.2.destdir.patch 420 SHA256 584454ce2cf04dddb37a05785a2544e79e7fb141e7619298444969ecdd47b3b7 SHA512 9319fb29af0e91bedc969a0c5f02bcac386274aa179af7ef3130b18ac9bfa36a0a422a76e50abb777323cac242283c1b680051689a6269ab7e567b5ae53a216b WHIRLPOOL 479cbd6ec4a0a9c69f70ac120cfaf5e479455aea84fc1fce8b97ac795c6e1e65642bffff7a789acd1e0e173a367cdef1d2d00b3ea37e94a6e8cc8c68020113c9
+AUX mysql-super-smack-1.3-automake-1.13.patch 7680 SHA256 72c1513f4327c1aac4dc70f99a0afd8b6bb1118928fc06318a1558a26c4fca64 SHA512 b74994f03b136c7642423ee5eb1346134ed127a9ca0996df83ed777f49f9dff3efe93889bc3a375868afec38be20303ffbede98dcfd3b6ec5921f0e417b5a000 WHIRLPOOL ec76e83d4e6c886defa05b7e0111878ec3e084fba29ba745e5debcb248ae7f8c5716c5098ed73bbfe58f20fedbabb74b00ff0a069c27c3899432ce67549bc4a7
+AUX mysql-super-smack-1.3-gen-data.patch 2265 SHA256 d52d4c69f7b2c16b37ea412b5bedd54b668e908a70779cd5af1292daf28f1b11 SHA512 6a08a3ccc158e7c8e0500a8d3231d0b1fc0d0f4a41e2a5bf40426e480c6fc373b0fa7ff5c08b5d40afe559a34b97fd00412c43fe9212047f2c4d063b98ac2154 WHIRLPOOL bb6e93c91c1222eb554d1b62bdcd822be4c819baedc10d4203d2b38514431aa601dfdbcdfe338c3d2c0dd5c35be4a93aa09a7e0dc6f41258d19ae09d5ba8a8ec
+AUX mysql-super-smack-1.3.amd64.patch 702 SHA256 c88a75a35851433689bfa2f2922bd389344643a3ad6bcafa1ce3f4a80e4ef564 SHA512 5ac9c130534d5cea6caa70f6373850181ae81c68c1eb3cb9e7a774bdeeafdf822582fe9cb548b9eb1268a2b4edc516461b95238454abefcdd25677066d720da9 WHIRLPOOL d1dde988b58830573af51ea3c1e8183a195b37a399dec336e5f3cc01f473620acd27a28cc0ff5e1ea18a500ba7fdfc1b0aceae0cb3ee35ad2381f96936e02125
+AUX mysql-super-smack-1.3.gcc4.3.patch 237 SHA256 aabdc73cdf00b547a7cb512cee1f30ba460bb4be98f022cf9401aec29232876b SHA512 2682770012d8e429b8fe93bb77e274e1d9570cf4ff2301511f4a3b8e0ab56dc5fb5c2b3f46ee94a6aad79a84c740c0f352399f304d58eba1efe3ed6c870269a1 WHIRLPOOL 45d2ab3bc8d934acd57a3a6a88c020dd9d767d0ccbd5bffd4b312cbb7819f1f905c590a527e34214bd0f5d6febbda4684b9edea414400da4205f4529b975d885
+DIST super-smack-1.3.tar.gz 155375 SHA256 969d40e772faa8580f8e8f2dfa2a381fbadbd79fc0c94304347d594dba2a9bd9 SHA512 5343fa78bdf483c1019c9e25d1fdb15581342d49b863a536eb1cf8c38bde5641fdf135fe5a8ec87f74051fd9766b2f5e4f09f963afe2eb1cd7ea41edfa260920 WHIRLPOOL df63a45d1b860d888b1d2abcd6d82c17f1551554416d249f4ad86a11e82e5ca7de61bb855e94472fe447b08ce37c6de86f3e2c64cc7dc7de52913bf3e43d66c1
+EBUILD mysql-super-smack-1.3-r3.ebuild 1506 SHA256 35113ce51884ea87f0ebc223dd9bce248e59f47d30c28be0beceda76f57ce746 SHA512 7cf407a3535cbe44071fc52443ed01443970c264b83dc84de646408a924a9ea7f6951a720a83bb45f65a6721096f3d4290b85aecc52c4f3eb08a1138533fadfa WHIRLPOOL 91bbd94843d55a4b92749651bec915b377a10122f4ce5248f529cb5bb85d77f1597c3872f652c92baaee54201a7136e8dc3968dacff0d95d566a369309db0899
+MISC ChangeLog 2691 SHA256 e3e0e7af243e5fc49e97998c8112443d4c04e39ff84e57960cf7b0d100cabd3f SHA512 6e7be1dd2361159a82080cb3176149e3708ca4143c41d703c9d5e33775f89561de477e9152d97b828e6d76e8a7d905da3e3a2e0f182aa28934e35053e7c7ece6 WHIRLPOOL 5bbb1bd883ff67bc8cc7c714eb6d2c866d6a08362c71700eecb6f739048a716ebe63034ed826b904022b12353620b96f9355db94a9aa2c3e5e103782548ac21e
+MISC ChangeLog-2015 4532 SHA256 4bbeea5ef87db8ca89301847d2713f84a8fa36567afd7b0257f6b2d7fb580497 SHA512 5d2958eba1f8d9a5e9cfe8739562d15507d0d0779345929061e534c85b3ac78c7f002b77b2d1d3a59024e376388d9389f5fd8c097a7b60dd80ab2dacb7a78665 WHIRLPOOL 5f2c355b41e0963bd1446821f8fa94c703673f5da54bc0ff6bf29a54fa4c66e47f6c274f5aa85a76531f259182b96399aee753aae7bba019470c6e307b11e40e
+MISC metadata.xml 318 SHA256 09bc6364e75d2101dd914606ea642a02292884776641d4b225a95135420ac725 SHA512 4c4e7510b5c21355fc41f1a4b2b11400a1367b6e6420b3ae4607a2797cbad29ab5385b5c6b1845f126598a94b070efdd6c16cccf255a15a0154c36ed383ff122 WHIRLPOOL 3f62dcb6875a1883bce342b93fb7cf0a824efa9d05484bb81fb9676a4558eb0282834033ff8ed47496b7b1a0f8d8feeaf7da4bc457b02915a08c6c9162b08edc
diff --git a/dev-db/mysql-super-smack/files/mysql-super-smack-1.2.destdir.patch b/dev-db/mysql-super-smack/files/mysql-super-smack-1.2.destdir.patch
new file mode 100644
index 000000000000..02399905a11e
--- /dev/null
+++ b/dev-db/mysql-super-smack/files/mysql-super-smack-1.2.destdir.patch
@@ -0,0 +1,13 @@
+--- super-smack-1.2/Makefile.am.orig 2004-02-23 19:57:22.000000000 -0800
++++ super-smack-1.2/Makefile.am 2004-02-23 19:57:40.000000000 -0800
+@@ -23,8 +23,8 @@
+ DATADIR= @DATADIR@
+
+ install-data-local:
+- $(mkinstalldirs) $(SMACKS_DIR) $(DATADIR)
+- cp -rp $(srcdir)/smacks/* $(SMACKS_DIR)
++ $(mkinstalldirs) $(DESTDIR)$(SMACKS_DIR) $(DESTDIR)$(DATADIR)
++ cp -rp $(srcdir)/smacks/* $(DESTDIR)$(SMACKS_DIR)
+
+
+ dist-hook:
diff --git a/dev-db/mysql-super-smack/files/mysql-super-smack-1.3-automake-1.13.patch b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3-automake-1.13.patch
new file mode 100644
index 000000000000..6cf69580b887
--- /dev/null
+++ b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3-automake-1.13.patch
@@ -0,0 +1,256 @@
+diff -aurwN a/configure.ac b/configure.ac
+--- a/configure.ac 2014-06-20 14:43:52.744753334 -0400
++++ b/configure.ac 2014-06-20 14:59:51.263609319 -0400
+@@ -16,9 +16,9 @@
+
+ # Process this file with autoconf to produce a configure script.
+
+-AC_INIT()
++AC_INIT([super-smack], [1.1])
+ AM_CONFIG_HEADER(config.h)
+-AM_INIT_AUTOMAKE(super-smack, 1.1)
++AM_INIT_AUTOMAKE
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+
+ # Checks for programs.
+@@ -31,6 +31,14 @@
+ AM_PROG_LEX
+ AC_PROG_YACC
+
++AH_TEMPLATE([HAVE_CRYPT], [Define if we have a crypt()])
++AH_TEMPLATE([HAVE_MYSQL], [MySQL Support])
++AH_TEMPLATE([HAVE_ORACLE], [PostgreSQL Support])
++AH_TEMPLATE([HAVE_PGSQL], [Oracle Support])
++AH_TEMPLATE([SMACK_DATADIR], [Sample .smack data files])
++
++AC_CONFIG_MACRO_DIRS([m4])
++
+ # get super-smack datadir
+ AC_ARG_WITH(datadir,
+ [ --with-datadir=DIR Specify default smack datadir],
+diff -aurwN a/m4/crypt.m4 b/m4/crypt.m4
+--- a/m4/crypt.m4 1969-12-31 19:00:00.000000000 -0500
++++ b/m4/crypt.m4 2014-06-20 15:06:42.289976907 -0400
+@@ -0,0 +1,5 @@
++AC_DEFUN([AC_FUNC_CRYPT], [
++ AC_CHECK_LIB(crypt, crypt)
++ AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
++])
++
+diff -aruwN a/m4/lex.m4 b/m4/lex.m4
+--- a/m4/lex.m4 1969-12-31 19:00:00.000000000 -0500
++++ b/m4/lex.m4 2014-06-20 16:51:23.548854098 -0400
+@@ -0,0 +1,6 @@
++AC_DEFUN([AM_PROG_LEX],
++[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
++AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
++AC_PROG_LEX
++AC_DECL_YYTEXT])
++
+diff -aurwN a/m4/libz.m4 b/m4/libz.m4
+--- a/m4/libz.m4 1969-12-31 19:00:00.000000000 -0500
++++ b/m4/libz.m4 2014-06-20 15:06:24.260569878 -0400
+@@ -0,0 +1,4 @@
++AC_DEFUN([AC_LIB_Z], [
++ AC_CHECK_LIB(z, compress)
++])
++
+diff -aurwN a/m4/mysql.m4 b/m4/mysql.m4
+--- a/m4/mysql.m4 1969-12-31 19:00:00.000000000 -0500
++++ b/m4/mysql.m4 2014-06-20 15:10:48.291892456 -0400
+@@ -0,0 +1,76 @@
++#serial 1
++AC_DEFUN([AC_LIB_MYSQL], [
++ AC_ARG_WITH(mysql-lib,
++ [ --with-mysql-lib=DIR Look for MySQL client library in DIR],
++ mysql_lib=$withval, mysql_lib="")
++
++ if test "x$want_mysql" = "xyes"
++ then
++ AC_MSG_CHECKING([for libmysqlclient])
++ AC_MSG_RESULT()
++
++ mysql_ok=no
++
++ SAVE_LIBS=$LIBS
++
++ mysql_lib="$mysql_lib /usr/lib /usr/lib/mysql \
++ /usr/local/lib /usr/local/lib/mysql \
++ /usr/local/mysql/lib"
++
++ for dir in $mysql_lib; do
++ if test "x$mysql_found" != "xyes"
++ then
++ if test -f "$dir/libmysqlclient.so" ;
++ then
++ LIBS="-L$dir $SAVE_LIBS $LIBZ_LIB"
++ MYSQL_LIB="-L$dir -lmysqlclient $LIBZ_LIB"
++ AC_SUBST(MYSQL_LIB)
++ AC_CHECK_LIB(mysqlclient, mysql_real_connect,
++ mysql_ok=yes, mysql_ok=no)
++ fi
++ fi
++ done
++
++ if test "x$mysql_ok" != "xyes"
++ then
++ AC_MSG_ERROR([Could not find libmysqlclient in '$mysql_lib'])
++ fi
++ fi
++])
++
++AC_DEFUN([AC_HEADER_MYSQL], [
++ AC_ARG_WITH(mysql-include,
++ [ --with-mysql-include=DIR
++ Look for MySQL include files in DIR],
++ mysql_include=$withval, mysql_include="")
++
++ if test "x$want_mysql" = "xyes"
++ then
++ AC_MSG_CHECKING([for mysql.h])
++ AC_MSG_RESULT()
++
++ mysql_found=no
++
++ mysql_include="$mysql_include /usr/include /usr/include/mysql \
++ /usr/local/include /usr/local/include/mysql \
++ /usr/local/mysql/include"
++
++ for dir in $mysql_include; do
++ if test "x$mysql_found" != "xyes"
++ then
++ if test -f "$dir/mysql.h"
++ then
++ MYSQL_INCLUDE="-I$dir"
++ AC_SUBST(MYSQL_INCLUDE)
++ mysql_found=yes
++ fi
++ fi
++ done
++
++ if test "x$mysql_found" != "xyes"
++ then
++ AC_MSG_ERROR([Could not find mysql.h in '$mysql_include'])
++ fi
++ fi
++])
++
+diff -aurwN a/m4/oracle.m4 b/m4/oracle.m4
+--- a/m4/oracle.m4 1969-12-31 19:00:00.000000000 -0500
++++ b/m4/oracle.m4 2014-06-20 15:05:05.543169365 -0400
+@@ -0,0 +1,10 @@
++AC_DEFUN([AC_LIB_ORACLE], [
++ ORACLE_LIB=""
++ AC_SUBST(ORACLE_LIB)
++])
++
++AC_DEFUN([AC_HEADER_ORACLE], [
++ ORACLE_INCLUDE=""
++ AC_SUBST(ORACLE_INCLUDE)
++])
++
+diff -aurwN a/m4/postgresql.m4 b/m4/postgresql.m4
+--- a/m4/postgresql.m4 1969-12-31 19:00:00.000000000 -0500
++++ b/m4/postgresql.m4 2014-06-20 15:06:09.311064874 -0400
+@@ -0,0 +1,75 @@
++AC_DEFUN([AC_LIB_PGSQL], [
++ AC_ARG_WITH(pgsql-lib,
++ [ --with-pgsql-lib=DIR Look for PostgreSQL client library in DIR],
++ pgsql_lib=$withval, pgsql_lib="")
++
++ if test "x$want_pgsql" = "xyes"
++ then
++ AC_MSG_CHECKING([for libpq])
++ AC_MSG_RESULT()
++
++ pgsql_ok=no
++
++ SAVE_LIBS=$LIBS
++
++ pgsql_lib="$pgsql_lib /usr/lib /usr/lib/pgsql \
++ /usr/local/lib /usr/local/lib/pgsql \
++ /usr/local/pgsql/lib"
++
++ for dir in $pgsql_lib; do
++ if test "x$pgsql_found" != "xyes"
++ then
++ if test -f "$dir/libpq.so"
++ then
++ LIBS="-L$dir $SAVE_LIBS"
++ PGSQL_LIB="-L$dir -lpq"
++ AC_SUBST(PGSQL_LIB)
++ AC_CHECK_LIB(pq, PQconnectdb,
++ pgsql_ok=yes, pgsql_ok=no)
++ fi
++ fi
++ done
++
++ if test "x$pgsql_ok" != "xyes"
++ then
++ AC_MSG_ERROR([Could not find libpq in '$pgsql_lib'])
++ fi
++ fi
++])
++
++AC_DEFUN([AC_HEADER_PGSQL], [
++ AC_ARG_WITH(pgsql-include,
++ [ --with-pgsql-include=DIR
++ Look for PostgreSQL include files in DIR],
++ pgsql_include=$withval, pgsql_include="")
++
++ if test "x$want_pgsql" = "xyes"
++ then
++ AC_MSG_CHECKING([for libpq-fe.h])
++ AC_MSG_RESULT()
++
++ pgsql_found=no
++
++ pgsql_include="$pgsql_include /usr/include /usr/include/pgsql \
++ /usr/local/include /usr/local/include/pgsql \
++ /usr/local/pgsql/include"
++
++ for dir in $pgsql_include; do
++ if test "x$pgsql_found" != "xyes"
++ then
++ if test -f "$dir/libpq-fe.h"
++ then
++ PGSQL_INCLUDE="-I$dir"
++ AC_SUBST(PGSQL_INCLUDE)
++ pgsql_found=yes
++ fi
++ fi
++ done
++
++ if test "x$pgsql_found" != "xyes"
++ then
++ AC_MSG_ERROR([Could not find libpq-fe.h in '$pgsql_include'])
++ fi
++ fi
++])
++
+diff -aurwN a/src/Makefile.am b/src/Makefile.am
+--- a/src/Makefile.am 2014-06-20 14:37:35.266956252 -0400
++++ b/src/Makefile.am 2014-06-20 15:12:40.278227315 -0400
+@@ -16,7 +16,8 @@
+
+ # Process this file with automake to create Makefile.in
+
+-INCLUDES = @MYSQL_INCLUDE@ @PGSQL_INCLUDE@ @ORACLE_INCLUDE@
++AM_CPPFLAGS = @MYSQL_INCLUDE@ @PGSQL_INCLUDE@ @ORACLE_INCLUDE@
++BUILT_SOURCES = super-smack-yacc.hh
+
+ noinst_PROGRAMS=test-dictionary test-client test_tcp_client
+ bin_PROGRAMS=super-smack super-smack-gen-data
+diff -aurN a/src/super-smack-lex.ll b/src/super-smack-lex.ll
+--- a/src/super-smack-lex.ll 2003-05-14 21:08:34.000000000 -0400
++++ b/src/super-smack-lex.ll 2014-06-24 08:56:05.970614176 -0400
+@@ -6,7 +6,7 @@
+ #include <ctype.h>
+ #include "query.h"
+ #include "parse.h"
+- #include "super-smack-yacc.h"
++ #include "super-smack-yacc.hh"
+
+ static string q_str = "";
+ %}
+
diff --git a/dev-db/mysql-super-smack/files/mysql-super-smack-1.3-gen-data.patch b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3-gen-data.patch
new file mode 100644
index 000000000000..37abfe35ec97
--- /dev/null
+++ b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3-gen-data.patch
@@ -0,0 +1,45 @@
+diff -Nuar super-smack-1.3.orig/smacks/select-key.smack super-smack-1.3/smacks/select-key.smack
+--- super-smack-1.3.orig/smacks/select-key.smack 2005-05-30 03:04:38.000000000 -0700
++++ super-smack-1.3/smacks/select-key.smack 2008-11-13 22:27:48.125627179 -0800
+@@ -24,7 +24,7 @@
+ min_rows "90000"; // the table must have at least that many rows
+ data_file "words.dat"; // if the table is empty, load the data from
+ //this file
+- gen_data_file "gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d";
++ gen_data_file "super-smack-gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d";
+ // if the file above does not exist, generate it with the above shell command
+ // you can replace this command with anything that prints comma-delimited
+ // data to stdout, just make sure you have the right number of columns
+diff -Nuar super-smack-1.3.orig/smacks/update-select.smack super-smack-1.3/smacks/update-select.smack
+--- super-smack-1.3.orig/smacks/update-select.smack 2005-05-30 03:04:51.000000000 -0700
++++ super-smack-1.3/smacks/update-select.smack 2008-11-13 22:27:45.070167829 -0800
+@@ -24,7 +24,7 @@
+ min_rows "90000"; // the table must have at least that many rows
+ data_file "words.dat"; // if the table is empty, load the data from
+ //this file
+- gen_data_file "gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d";
++ gen_data_file "super-smack-gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d";
+ // if the file above does not exist, generate it with the above command
+ }
+
+diff -Nuar super-smack-1.3.orig/src/Makefile.am super-smack-1.3/src/Makefile.am
+--- super-smack-1.3.orig/src/Makefile.am 2001-02-24 03:44:30.000000000 -0800
++++ super-smack-1.3/src/Makefile.am 2008-11-13 22:27:37.693573246 -0800
+@@ -19,7 +19,7 @@
+ INCLUDES = @MYSQL_INCLUDE@ @PGSQL_INCLUDE@ @ORACLE_INCLUDE@
+
+ noinst_PROGRAMS=test-dictionary test-client test_tcp_client
+-bin_PROGRAMS=super-smack gen-data
++bin_PROGRAMS=super-smack super-smack-gen-data
+ test_dictionary_SOURCES=test-dictionary.cc \
+ dictionary.cc dictionary.h \
+ die.cc die.h \
+@@ -57,7 +57,7 @@
+ tcp_client.h tcp_client.cc
+ super_smack_LDADD = @MYSQL_LIB@ @PGSQL_LIB@ @ORACLE_LIB@
+
+-gen_data_SOURCES=gen-data.cc die.cc die.h
++super_smack_gen_data_SOURCES=gen-data.cc die.cc die.h
+
+ # yacc needs to generate a y.tab.h
+ YFLAGS = -d
diff --git a/dev-db/mysql-super-smack/files/mysql-super-smack-1.3.amd64.patch b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3.amd64.patch
new file mode 100644
index 000000000000..c2c5db0c56f0
--- /dev/null
+++ b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3.amd64.patch
@@ -0,0 +1,20 @@
+--- supesmack-1.3/src/query.cc.orig 2005-04-30 14:51:29.000000000 +0100
++++ supesmack-1.3/src/query.cc 2006-08-15 22:06:06.000000000 +0100
+@@ -197,7 +197,7 @@
+ {
+ string s((*i).first);
+ int str_len = (*i).first.length();
+- if((unsigned)p + str_len + 3 *sizeof(int) < (unsigned)p_end )
++ if((unsigned long)p + str_len + 3 *sizeof(int) < (unsigned long)p_end )
+ {
+ *p++ = (char) str_len;
+ const char* q_type_name = s.c_str();
+@@ -216,7 +216,7 @@
+ die(0, "report buffer overflow -- too many query types");
+ }
+
+- len = (unsigned)p - (unsigned)buf;
++ len = (unsigned long)p - (unsigned long)buf;
+ *(buf) = num_recs;
+
+ if(write(fd, buf, len) != len)
diff --git a/dev-db/mysql-super-smack/files/mysql-super-smack-1.3.gcc4.3.patch b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3.gcc4.3.patch
new file mode 100644
index 000000000000..23bcd56e019c
--- /dev/null
+++ b/dev-db/mysql-super-smack/files/mysql-super-smack-1.3.gcc4.3.patch
@@ -0,0 +1,9 @@
+--- src/dictionary.h.orig 2008-10-31 19:12:51.000000000 +0100
++++ src/dictionary.h 2008-10-31 19:13:12.000000000 +0100
+@@ -23,6 +23,7 @@
+
+ #include <string>
+ #include <vector>
++#include <cstring>
+ #include <time.h>
+ #include <stdlib.h>
diff --git a/dev-db/mysql-super-smack/metadata.xml b/dev-db/mysql-super-smack/metadata.xml
new file mode 100644
index 000000000000..c78c5193bd0d
--- /dev/null
+++ b/dev-db/mysql-super-smack/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person"><email>robbat2@gentoo.org</email></maintainer>
+<maintainer type="project">
+<email>mysql-bugs@gentoo.org</email>
+<name>MySQL</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/mysql-super-smack/mysql-super-smack-1.3-r3.ebuild b/dev-db/mysql-super-smack/mysql-super-smack-1.3-r3.ebuild
new file mode 100644
index 000000000000..d7cbc48eae64
--- /dev/null
+++ b/dev-db/mysql-super-smack/mysql-super-smack-1.3-r3.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+WANT_AUTOMAKE="1.13"
+AUTOTOOLS_AUTORECONF="YES"
+#AUTOTOOLS_IN_SOURCE_BUILD="YES"
+
+inherit eutils autotools-utils
+
+MY_PN="super-smack"
+MY_P="${MY_PN}-${PV}"
+DESCRIPTION="Benchmarking, stress testing, and load generation tool for MySQL & PostGreSQL"
+HOMEPAGE="http://vegan.net/tony/supersmack/"
+SRC_URI="http://vegan.net/tony/supersmack/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="+mysql postgres"
+REQUIRED_USE="|| ( mysql postgres )"
+
+DEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql[server] )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.2.destdir.patch
+ "${FILESDIR}"/${PN}-1.3.amd64.patch
+ "${FILESDIR}"/${PN}-1.3.gcc4.3.patch
+ "${FILESDIR}"/${PN}-1.3-gen-data.patch
+ "${FILESDIR}"/${PN}-1.3-automake-1.13.patch
+)
+DOCS=( CHANGES INSTALL MANUAL README TUTORIAL )
+
+src_prepare() {
+ # Clean up files so eautoreconf does not pick up any
+ # deprecated autotools macros.
+ rm acinclude.m4 aclocal.m4 acconfig.h config.status config.h || die
+ mv configure.in configure.ac || die
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(usex mysql --with-mysql "")
+ $(usex postgres --with-pgsql "")
+ --with-datadir=/var/tmp/${MY_PN}
+ --with-smacks-dir=/usr/share/${MY_PN}
+ )
+ autotools-utils_src_configure
+}
+
+pkg_postinst() {
+ elog "The gen-data binary is now installed as super-smack-gen-data"
+}
diff --git a/dev-db/mysql-udf-base64/Manifest b/dev-db/mysql-udf-base64/Manifest
new file mode 100644
index 000000000000..eea22ec5cd50
--- /dev/null
+++ b/dev-db/mysql-udf-base64/Manifest
@@ -0,0 +1,8 @@
+AUX mysql-udf-base64-signedness.patch 879 SHA256 f91151971fc53032f402d92184ca24db879c72f62dd7a864133d935d6524a759 SHA512 7bbd3c477feacecf2bcb8297e1ab482c5b67efbec8cc475627886d4bc48105ca31d32b49fa9ee0d7d0948d94d9d202a2d48c82ebf0e19dd2f3f3da1da362a7ba WHIRLPOOL e7fa4fdd3f6e0df7952d82205789acf75a204a03c13a064a9a1f1dacaaf576d58692c11f776bc42b9c9dbc8520f6dc246f741abf6bd7e0138a276960aedde0cf
+AUX mysql-udf-base64.sql 205 SHA256 77d88be8ee6f5744169111bebf141cee32df1e9877b05599795444b4e5c092bf SHA512 d223b2dc206930a46c6c2c5311f4cbeb5757c7a66b5c5f345533e2d319dc6185eada25b98ef1d5b05c2b804c0f92f22e99b3a340a8b9bb332d8adc00585997d2 WHIRLPOOL dc45d0a74a7234172027c2ba5cedadd1a520f320bb09048bf2454e3e540bcade43631923a448d92d31b6792681c38d7a394051f873604a364cbcc51e77eeb2f8
+DIST mysql-udf-base64-20010618.c 7106 SHA256 6d1efdee8489ee2b5d133d0d8997dce08d417d511b8dc80019bed2ca44a56472 SHA512 23d2d1da7481626ebdb8ca3e31d01ae17903ff431415c7bca6ab20e414dc8751ab105a73e55b66a380e0e11ac0fc949b79d5f3c34f3d353abc1a52627be45f86 WHIRLPOOL 2ed00abd547ed54a38adece50682f4866bcdae8d5e72aaa9b113bfdafbfcab20ed8d321b4cd664d145bf4f8d193dca85a175bc8e40cf3163a4f04514f5c297b8
+DIST mysql-udf-base64-20010618.readme 222 SHA256 39f41fd56716021358b2f49c290871ca6618fba77ad45ce8c904250a569c09a9 SHA512 2e2a17d7d1f1435bda59c89529e38a4843be814de5cb0db57643f8feb99a59cadf1e518e2903c470cd5931a964541dc5cc5d1b7f9041e7ed49442c37f139b2aa WHIRLPOOL 3f3abbc448e23a0642e43f70bffa81771eea344b266d41859b91f0d1ced6c9ba16229e4c5109a8e29f2df2c4b6671c8f84ce95bb410aac7ec1aa2d1bef6b92ac
+EBUILD mysql-udf-base64-20010618.ebuild 1429 SHA256 019711808dd6f2e7f528d48a56f71b9fe9d4e249f82267ec699a9e9a15b1940e SHA512 6ac0dd2e8128945f8d8ace8ae5c9227a2224fcd51513b4a52f24f238f75511b9ca1d5b1076807356ea36ac3c83157b7dea42fd6f856e4b25085028c7d49eabf3 WHIRLPOOL 97bf532892bb35a6627fb246ac08f738f7866f248ff78b44006fa98978ee11fabd02cc044962a4377d7955230ff7e201c9997f3ef2bad0623f7cf0f5bee4132e
+MISC ChangeLog 2626 SHA256 22dd6b7d25e304837896907ebc5cba1a389ee860c277dc61dcd2e182fac186b4 SHA512 746c5e45e1c9c09b7c087f99dd4cda6c15cf948315f388c71a4f564b1d7aba1166a0ade39af9ef8d497e23729e372cd6af304d65d340945cf76b3bd35b13e299 WHIRLPOOL a3e21f23a54cd4387e227999b5944f1e32f4a16b796b8fa407089bc6266c54ff3e99b4b759725745730d221138200ef1971a0e789f33b1e0d3c7b6fb91b9f521
+MISC ChangeLog-2015 657 SHA256 432bbd55d943209c2e879439fbf526d778c6efd0b82cabd0eba6ac4d1e715175 SHA512 e141d5cb108d6c301f0a4e904773bb6457119a2282a4904f937b2949615498f4aad24379905c6126618ba3077ddb06556a9bac45817d6f3fe713dcda16d5f818 WHIRLPOOL a76e901fe77c319d69a883035f484907e52c9af96f0fbe255df04e3ede5e08a8b8b1b804d75ecbb50b249cc87ce557a05f2c6eccc71ee99102a15458d1811551
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/mysql-udf-base64/files/mysql-udf-base64-signedness.patch b/dev-db/mysql-udf-base64/files/mysql-udf-base64-signedness.patch
new file mode 100644
index 000000000000..5084a9dd0128
--- /dev/null
+++ b/dev-db/mysql-udf-base64/files/mysql-udf-base64-signedness.patch
@@ -0,0 +1,29 @@
+--- mysql-udf-base64.c.orig 2011-10-16 14:17:13.000000000 +0200
++++ mysql-udf-base64.c 2011-10-16 14:18:41.000000000 +0200
+@@ -49,7 +49,7 @@
+ #include <string.h>
+ #include <mysql/mysql.h>
+
+-static char base64_table[] =
++static const char base64_table[] =
+ { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+@@ -101,7 +101,7 @@
+ unsigned long len;
+
+ /* *is_null=0; */
+- current = args->args[0];
++ current = (unsigned char*) args->args[0];
+ len = args->lengths[0];
+
+ if (len <= 0 || args->arg_type[0] != STRING_RESULT )
+@@ -211,7 +211,7 @@
+ }
+ }
+
+- current = args->args[0];
++ current = (unsigned char*) args->args[0];
+ len = args->lengths[0];
+
+ if (len <= 0 || args->arg_type[0] != STRING_RESULT )
diff --git a/dev-db/mysql-udf-base64/files/mysql-udf-base64.sql b/dev-db/mysql-udf-base64/files/mysql-udf-base64.sql
new file mode 100644
index 000000000000..619d4b0013d2
--- /dev/null
+++ b/dev-db/mysql-udf-base64/files/mysql-udf-base64.sql
@@ -0,0 +1,5 @@
+drop function base64encode;
+drop function base64decode;
+
+create function base64encode returns string soname 'mysql_udf_base64.so';
+create function base64decode returns string soname 'mysql_udf_base64.so';
diff --git a/dev-db/mysql-udf-base64/metadata.xml b/dev-db/mysql-udf-base64/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/mysql-udf-base64/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/mysql-udf-base64/mysql-udf-base64-20010618.ebuild b/dev-db/mysql-udf-base64/mysql-udf-base64-20010618.ebuild
new file mode 100644
index 000000000000..a7b4b06a6907
--- /dev/null
+++ b/dev-db/mysql-udf-base64/mysql-udf-base64-20010618.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_PN="${PN//-/_}"
+
+DESCRIPTION="MySQL UDFs that provide base64 encode/decode"
+HOMEPAGE="http://mirrors.sohu.com/mysql/Contrib/Old-Versions/"
+SRC_URI="http://mirrors.sohu.com/mysql/Contrib/Old-Versions/${PN}.c -> ${P}.c
+ http://mirrors.sohu.com/mysql/Contrib/Old-Versions/${PN}.readme -> ${P}.readme"
+
+LICENSE="PHP-2.02"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_unpack() {
+ cp -f "${DISTDIR}/${P}.c" "${S}/${PN}.c"
+ cp -f "${DISTDIR}/${P}.readme" "${S}/${PN}.readme"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-signedness.patch"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${MY_PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${MY_PN}.so
+ newdoc ${PN}.readme README
+ newdoc "${FILESDIR}/${PN}.sql" ${MY_PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/mysql-udf-http/Manifest b/dev-db/mysql-udf-http/Manifest
new file mode 100644
index 000000000000..22fbbbac79a4
--- /dev/null
+++ b/dev-db/mysql-udf-http/Manifest
@@ -0,0 +1,6 @@
+AUX mysql-udf-http-stdlib.patch 262 SHA256 e1341833a06d14502cc257e011216a7655f9c6106742a65faf804f78a7fc8b54 SHA512 9e914bafffa08ace217ffab6de9497cf0cbe4bcc2f5c10fb9c381e540cc700bdf356fdde8edcce539e3e0d2728083451e5ec147c24bf63c9861d35b3030a6b77 WHIRLPOOL 9128ced7781c05a17f84048122e270cb8be5e488361ed2f882c0bf97dc5aa934a0b2b910015b632f63f17e1f1003d9d7806e86f805d161a273bc544aafb4b0ce
+DIST mysql-udf-http-1.0.tar.gz 322160 SHA256 c487b140bcf030e080279e5274e0de71838241a0ef0ac464bcf0d93a31a3c26a SHA512 84feb7cfec052e368131bdf44937868339d9d8694128cd5257aa248ce3d1e2e660f3df1e7da99f64b3954fa66c29ed7af5a809fa5ebbd93a96c6cd2ec2ec81de WHIRLPOOL dd3954d530c4c46238c8102ba2feed0d8dafe180b70767ba260ec3396ba6afa7ce11756292434749ff7553e3cfdbabb51eeb0b7382d6f1a0a38a37e980be7bda
+EBUILD mysql-udf-http-1.0.ebuild 1303 SHA256 ec6eed912f035623b2aa5b9713d9d52fbf066acb6caa596a5f759b8a428d8946 SHA512 bdbbc1ddb92411972cfd1365cf3745669006f86710a17a5d3adc6232c33e2e5868b3ca1f272a9dcd57a444cac1ced5cad38dc2a28a97a403c09302af73a64306 WHIRLPOOL e6b75ba9268a71d52e829ec2ea9cbe2f3996dffc48e8539fb5279f4f745a14665b7fda590ade8518be196d2d1cfa36bbbcc98c50fd4ba86fd4d8c981987c7755
+MISC ChangeLog 2903 SHA256 5b2129325b44f8eb40b512369a603018d76e7105cec2ef50349f8ba835681360 SHA512 0957fb916c332754dd96f69e8c4c7f759f7c131634fbd7ac153dd475e1efdf4117173dee4b543b3bb71562dc6b8287b2faf2b7a6ca4e38f412f1a376a35ea1d2 WHIRLPOOL 3a6ec89a97ec065e99611f66b11bb1a3e41a3382b3edfcb1872a5da2265375d3df6759950a36e70666689a49c179f0ae7cf93726da1c4b2304ce8a24e90e7773
+MISC ChangeLog-2015 600 SHA256 f6f1760a549c97387ddb69c8fd37af51f85dae209afcc4f898a9e2b75e611aa8 SHA512 3f575fdcb1c376c2a169b959c59b1d14a3682e1d971cc93c7168b228c8d3b3ddc24fe91a31309310e4c7c06b019b2ad96ed3de67c3325d447cd86c6e4cd60d22 WHIRLPOOL 79b345e5bbbc9f7de26912f70f29800f0e50b313b479608817fcbd354f946839fecb3f328488564b221a144ede7228616a2b1f1b3d1fc5050fd2b4379621f904
+MISC metadata.xml 251 SHA256 800c8ed0fce04ce2e9bb3acd214911f3548e28f026e55bdc04ba7cd23ba03df7 SHA512 e1e841d7dcee0bb517f95e3e36a03deb356ff186b63674f3f4b87cf29daed5b3070ac9442eec72c84820a4c01ef0f715b8589f496495a4a8eac2c4d4be48815d WHIRLPOOL 9105208fb8cb6cbb6b9e6da1f92d5f0498a611531d01e882cb9acdbcfcff8de1f2262eb70fe8a54187618697e426d603e9fb29020941c088faf51801e12c7463
diff --git a/dev-db/mysql-udf-http/files/mysql-udf-http-stdlib.patch b/dev-db/mysql-udf-http/files/mysql-udf-http-stdlib.patch
new file mode 100644
index 000000000000..6e371fc4a835
--- /dev/null
+++ b/dev-db/mysql-udf-http/files/mysql-udf-http-stdlib.patch
@@ -0,0 +1,10 @@
+--- src/mysql-udf-http.c.orig 2010-09-06 06:00:32.000000000 +0200
++++ src/mysql-udf-http.c 2011-10-18 16:36:37.000000000 +0200
+@@ -2,6 +2,7 @@
+ #include <string.h>
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <curl/curl.h>
+ #include "mysql-udf-http.h"
+
diff --git a/dev-db/mysql-udf-http/metadata.xml b/dev-db/mysql-udf-http/metadata.xml
new file mode 100644
index 000000000000..c28680ca19b4
--- /dev/null
+++ b/dev-db/mysql-udf-http/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="google-code">mysql-udf-http</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild b/dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild
new file mode 100644
index 000000000000..76152f4b2812
--- /dev/null
+++ b/dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL User-defined function (UDF) for HTTP REST"
+HOMEPAGE="https://code.google.com/p/mysql-udf-http/"
+SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ net-misc/curl"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # fix README
+ sed -i -e "s|${PN}\(\.so\)|${PN//-/_}\1|g" README
+
+ # fix Makefile.am
+ sed -i -e "s|${PN}\([_\.]la\)|${PN//-/_}\1|g" \
+ -e "s|\(-module\)|\1 -avoid-version|g" src/Makefile.am
+
+ epatch "${FILESDIR}/${PN}-stdlib.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}" \
+ --with-mysql="$(type -p mysql_config)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/mysql-udf-infusion/Manifest b/dev-db/mysql-udf-infusion/Manifest
new file mode 100644
index 000000000000..59a26afe2dfe
--- /dev/null
+++ b/dev-db/mysql-udf-infusion/Manifest
@@ -0,0 +1,5 @@
+DIST infusion-udf_infusion-8599a9c.tar.gz 5470 SHA256 46e924a7d22d61bbede7f22cb87c06b8c1c7cdc5357a9b2ad199f234f9a23441 SHA512 4a9cee8b45b0cd8e7e00210de79f8a42cc3154185c1b31e441f27d51300c113a46639ecce98d0c748aada0538e9bbfc55ef71f017c19c403a84c2e5d478c09fe WHIRLPOOL c55a070c2010afa248127848f0807c45b622f00f0e1389ae541463cde419e7b0de298873450e9fa790b024c22dd7efdb43f886c5939fb8aafb7b711a8aac73d7
+EBUILD mysql-udf-infusion-20110109.ebuild 1358 SHA256 d12438241a708c518432d0615b3b4e1d007d898003f0ad56e91b8130f156abd2 SHA512 762cb37fe49cdbb392455301333f4e3fe99f800b7994b096eeef98a33ae377fbe3b7294a58e0703182232ec13d253124c06ab58196bcf4d0350a28af9dd92168 WHIRLPOOL 2e2ae97df2df54caf6e7722fa20d1ede2270569c679f1bb5e330b6bc5f268a1f910a1f908b8fe6e9b93bc41f40030efec9744bdd55083000571644d594f3ac7c
+MISC ChangeLog 2559 SHA256 c3558a73de3ce7e0c0f6212e8d400ef39d4a24dc97febbd335208744b447507b SHA512 3855096ccd0fde63d1ee70d3a3322316f93d24c47569cc0e36ddda933cf87f98e16c0bb4b93fcea62c43d826f201d9a1c40e76a8f88144d52d2b9ff681eeae57 WHIRLPOOL 9ef1c41fc552c680d0918afb31c196d8aeceeebbd88edb31da120fcd70942502f33b4783fdc54185d3904df19b87820a7fb1b1dcfa60ee75d9c74c6bdf5ec112
+MISC ChangeLog-2015 577 SHA256 298a80216edff4c7191e27b4c7b858c1a4927de0947ab27eadbcf74061a9c04b SHA512 3bb48ea82416db8a54cf5a6555c1115e0110f20a296f721873bdcd0d59b4247c33a4fa5e14c8530216e9ac7e82139d9587b979a3a8445943779fc47f2dcb9501 WHIRLPOOL b56a3c7c17e5a50681750d66887ad9c3379ad870042fdf6fa897fbdf24c2d943ea294ba83896fb77f8895d5089493121eaec72ba73336625817c2ab91dae00cc
+MISC metadata.xml 258 SHA256 eb7a577f5d07cc0bec724520d24393c98389e72d29fdb90a03accfadc47ea62a SHA512 5d8b9c6562884a78120acc0dfb30395be2da68c3ab08cdc62f19089ef5235fd58b07201b117dfb755b5e7404f1faa4add30d21e0bc5bb4c14b5f8b4084d0461b WHIRLPOOL 5a97d4f9e8125e791afe31a784ffddbceb41def96465b9df97c358cc47b1898e786479550d5efd19d9effc504c67a67d9beeaf325372eaa9df65f01db4cc1fdf
diff --git a/dev-db/mysql-udf-infusion/metadata.xml b/dev-db/mysql-udf-infusion/metadata.xml
new file mode 100644
index 000000000000..0355f8ad4e3d
--- /dev/null
+++ b/dev-db/mysql-udf-infusion/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="github">infusion/udf_infusion</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysql-udf-infusion/mysql-udf-infusion-20110109.ebuild b/dev-db/mysql-udf-infusion/mysql-udf-infusion-20110109.ebuild
new file mode 100644
index 000000000000..5a9aa63ff702
--- /dev/null
+++ b/dev-db/mysql-udf-infusion/mysql-udf-infusion-20110109.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_REV="8599a9c" # checkout revision
+MY_USR="infusion" # user name
+
+MY_PN="udf_infusion"
+MY_P="${MY_USR}-${MY_PN}-${MY_REV}"
+
+DESCRIPTION="New functions for MySQL implemented as UDF"
+HOMEPAGE="http://www.xarg.org/2010/11/mysql-my-new-playground/"
+SRC_URI="https://github.com/${MY_USR}/${MY_PN}/tarball/${MY_REV} -> ${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # fix soname
+ sed -i -e "s|${MY_PN}\.so|${PN//-/_}.so|g" *.sql
+
+ # add LF
+ echo >> create.sql
+ echo >> delete.sql
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN//-/_}.so ${MY_PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe *.so
+ dodoc *.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/mysql-udf-ipv6/Manifest b/dev-db/mysql-udf-ipv6/Manifest
new file mode 100644
index 000000000000..1cb8b1d65b63
--- /dev/null
+++ b/dev-db/mysql-udf-ipv6/Manifest
@@ -0,0 +1,6 @@
+AUX mysql-udf-ipv6-warnings.patch 767 SHA256 a57e06b9e72b81d096ac0584a27282a87c2fda5e8a5758a99c6e1badba8e6aa5 SHA512 6a8c3e771b49c9bb6b59b9eb460128cba37de16aaec8d52dab2d707e23163200be68b39e95290d0f773e1349a088877405fd8d86446e74e60bccb84a82435f9c WHIRLPOOL 963ec836cc986550ee65d1f42ccbaa8c6beb661724392e096582051a05fc6c528650d6037ece5a12d85a2de30a242844cd4b7893191bcbe7ea22aa68853c3e84
+DIST watchmouse-mysql-udf-ipv6-01c591b05b79.tar.bz2 10105 SHA256 4975c8edbea6c44eccb967697ba43becd6d105c63ace7af01db0482d20d3b251 SHA512 21bcd207076dfbab251b343eb4bf9dd8f783f0ce666ba266b2b9101acfcb764dbb1b4cc2f4b0608a128d0e684b31e9d97d58978b2cdb3a5452c1656780671287 WHIRLPOOL fc6397eee33da05f1164f522abdd8dd7ea16a4ee17eddef3fc6c59f656038762ae4ea9ae934943f9e7576961cd61699eb428804fa2c082e84a23a765b3eeb4dd
+EBUILD mysql-udf-ipv6-0.4.ebuild 1535 SHA256 9f9c8f1cfad5d861e2555708b2f55f0061dba65633a35a65b50fc3f1db9191c0 SHA512 ad6ad66d4aa9b40b631a51909182a6306a9847d60f05e8c00532a33d7198a98f222426c519d75b1b14db22b8ff6ba036b0031003b3450cdd10d89bc45ac84449 WHIRLPOOL bc73abf4b69bcc36ce39f398d40d0b45ec010b489fd2c0e5f1f1115582638d75fbe75a048eadc4dc465364a769046793f20eff06731f7e6cc8726dd333b2915d
+MISC ChangeLog 3102 SHA256 4a8a7aa5673e50eadbc458434776e4c0d3d4d70a08a3ad1893d2349387e8a258 SHA512 03ce29bc89b27addd65065efab747a4e4a3b6db34c0acc9afd58714e873804e2e5dd564a48e6ce9b6f4ecdb6227ec7797e3a7e6323e287ebd06f55df193503ef WHIRLPOOL cfdf4bbd83ba3c6c36a4ad07443b7dce21f256dbfaad8b479881827f3398eaae2adea242b064d16fda6c8bc8808b2c44d40ce8266be6c620642891116057ab4f
+MISC ChangeLog-2015 488 SHA256 9ee23ea4e5c22facd4f551224089cf6f7f21ec9e950214a82619a1a6fbb10328 SHA512 dd2f34e1e52c50f4604868fe2ee0c1b5165d79d594c6fb9ca87d0251456d5dab272157cc932351502799b4ca07d8b86cc1d244f49ee01fd6bf5f752ab979b7ae WHIRLPOOL 0217694721a75070579137a52d218e028dab183fb92ba8d8fa9a18ad8ff2ce013256ca8afa8108138224d6ac7a55061b2c95bce30148a2700eccadd76b469950
+MISC metadata.xml 260 SHA256 d49c5856e5300cfb6738f44a87a49990533a21cda6153423d4599cdd707b1c4b SHA512 0c8d4eac647683711cc2f9a1c2c273bee8fd5a1a9694a0f182bd2b63f0be8beb0468e7fdc704babf10f531099e50cac0700ea39402583847eb28cd909832e370 WHIRLPOOL a0c89216dedbfb04d9c20024c5e7bf58dbb964fb0ba458af4164d8402002bca03b7342a9d7a72815d46ee603185e9c96d5cb610cbe8237b077c464265d6d8dcb
diff --git a/dev-db/mysql-udf-ipv6/files/mysql-udf-ipv6-warnings.patch b/dev-db/mysql-udf-ipv6/files/mysql-udf-ipv6-warnings.patch
new file mode 100644
index 000000000000..392ecd3c4f53
--- /dev/null
+++ b/dev-db/mysql-udf-ipv6/files/mysql-udf-ipv6-warnings.patch
@@ -0,0 +1,28 @@
+--- mysql_udf_ipv6.c.orig 2011-08-10 10:45:49.000000000 +0200
++++ mysql_udf_ipv6.c 2011-10-18 16:27:58.000000000 +0200
+@@ -282,7 +282,7 @@
+ {
+ unsigned long length = args->lengths[0];
+ long long mask = *((long long *) args->args[1]);
+- unsigned char mask8, i;
++ unsigned char i;
+
+ if (!args->args[0] || !length)
+ {
+@@ -299,7 +299,7 @@
+
+ // my ugly get-the-job-done 128-bit masking
+ memset(result, 0, INET6_ADDRLEN);
+- for (i = 0; i < INET6_ADDRLEN, mask >= 8; i++, mask -= 8)
++ for (i = 0; i < INET6_ADDRLEN && mask >= 8; i++, mask -= 8)
+ {
+ result[i] = args->args[0][i];
+ }
+@@ -347,7 +347,6 @@
+ {
+ struct addrinfo *info;
+ char *addr;
+- ushort i;
+
+ if (!args->args[0] || !args->lengths[0])
+ {
diff --git a/dev-db/mysql-udf-ipv6/metadata.xml b/dev-db/mysql-udf-ipv6/metadata.xml
new file mode 100644
index 000000000000..e3473b0dd86d
--- /dev/null
+++ b/dev-db/mysql-udf-ipv6/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="bitbucket">watchmouse/mysql-udf-ipv6</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild b/dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild
new file mode 100644
index 000000000000..e7bcc4490033
--- /dev/null
+++ b/dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_REV="01c591b05b79" # checkout revision
+MY_USR="watchmouse" # user name
+
+MY_P="${MY_USR}-${PN}-${MY_REV}"
+
+DESCRIPTION="IPv6 and internationalized domain (IDNA) functions for MySQL"
+HOMEPAGE="http://labs.watchmouse.com/2009/10/extending-mysql-5-with-ipv6-functions/"
+SRC_URI="https://bitbucket.org/${MY_USR}/${PN}/get/${MY_REV}.tar.bz2 -> ${MY_P}.tar.bz2"
+
+LICENSE="EUPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="idn"
+
+DEPEND=">=virtual/mysql-5.1
+ idn? ( net-dns/libidn )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o mysql_udf_ipv6.so mysql_udf_ipv6.c
+
+ if use idn; then
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} -lidn \
+ -shared ${LDFLAGS} -o mysql_udf_idna.so mysql_udf_idna.c
+ fi
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe mysql_udf_*.so
+ newdoc Changelog ChangeLog
+ dodoc README
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
diff --git a/dev-db/mysql-workbench/Manifest b/dev-db/mysql-workbench/Manifest
new file mode 100644
index 000000000000..d909151d95a5
--- /dev/null
+++ b/dev-db/mysql-workbench/Manifest
@@ -0,0 +1,15 @@
+AUX mysql-workbench-6.2.3-CMakeLists.patch 1455 SHA256 9587f436d73ab366e77109b19e2b21099e0b0003db88662c113a1686e847839b SHA512 8a38b0fa7be0ac982b1d501964727fcb6bd0c7ab5179e2a69a1926c1abe56e2f30c6d9a046b48cdcaaec948d5c9deadb62e14331d52cf39e91f26ee90104c812 WHIRLPOOL 89235917ab608876b916933259f1970ad2c01fd1e51c57781def880291280bd4a3095014b69ec97e07cf6d97a34b4a5cd5ae9c4e89587803f2a2f7d2159808a9
+AUX mysql-workbench-6.2.5-wbcopytables.patch 496 SHA256 a578e303614387eeeeae5383d0a90a88abcab1ddfb85c602dbd5a0bc8b8d58cf SHA512 c0766315cd345893af57880eccdc2c1dd9ffa456a27d0c736af1382ca24c507de865188588753f212f35d8781305dcbd8d555f128edd6454dc2299bd0357fd5b WHIRLPOOL 020499280d5fe3f0f99e934e3303d8ea30b0ed9993780c1d0aed98750ea411fc5f58a94eda366f2e0e306e7bf8079c300ada4f9b5714fcf7a10266f197f71a76
+AUX mysql-workbench-6.3.3-mysql_options4.patch 1713 SHA256 e47ee64a732ec5b85c32aaa2a54ced4ce1162d954b35c318d07e1574a7e93dd3 SHA512 6371903765be6eb2f489523d10f6662e20903da2dd5755445c2cc8dcdcf07f0b5aa7b694b89fa7b625452d5a3f8b9157bad2278dc875de2b7b6c23daf4438539 WHIRLPOOL a39fd89838637ad801a0a1d2524ef0acb0f54821c05433b199769ea5fff1f15fa51f85115c60f86864c1dddb34863a7c06a6a0280bf310332060e44b1f46d848
+AUX mysql-workbench-6.3.4-cxx11.patch 1550 SHA256 53f63681ece9f2efaf45782ac816f79f792e68e602870eae80a7a495045e3089 SHA512 e312edede63f2308c466300e34c2d9ff19451fff9daca265219b9b074b2e28f5f8fb0799efbe825f5aaedd5515f2e99a4d1ab2dff6018e5140a5f4c9ab3c9d41 WHIRLPOOL 6778a007d20047cf0239540fa5756ce3dddde9e766c2b6188b49ee9262187d8f725ade0b594b529326e8689da7619f02c853f9d3ae20194493991dc0f7b3233e
+AUX mysql-workbench-6.3.4-gtk.patch 1190 SHA256 82376441bc452d2afe7ce55dc66edd69e8ccdc218f094c50ad30e5e906257618 SHA512 81af1d9dbe40b0ad04e9d8e317a1b47832b864071e26ab954237f850685bdb53ad84fedf4aa546e83f4dd122e368d1bc90e46e9b6261104b86998607b7830d33 WHIRLPOOL 7af06b97839a5e2a561649be0c5d67db5b7c57201ac57febc54e5d645194eec9c4e02ed93ef52e9af1078e1f23e00e48c0773bef3d61f30df14fcba102631b65
+AUX mysql-workbench-6.3.9-mariadb-json.patch 2320 SHA256 f176881b7f75db8fdcb3bf523116132b57a2cbf07c41b22b4f7a97855cf68f1c SHA512 23e4135ee5c8b7cc7b70cc6b5170209c9a6350cfc7e8450d29a1098c31472b68494147ec4f1286365f7802af72570f4822b0078ae269affbbaf98e3ad9e99eb4 WHIRLPOOL 5b19c530ceeaf0273db116881ecd2ff4abbf9b2e8ddc28ccb05f108004efb20013bb7f351feafc892610d286fc7452f913d0db4604ff22cba23dd51fcee7b794
+DIST antlr-3.4-complete.jar 2388361 SHA256 9d3e866b610460664522520f73b81777b5626fb0a282a5952b9800b751550bf7 SHA512 04be4dfba3a21f3ab9d9e439a64958bd8e844a9f151b798383bd9e0dd6ebc416783ae7cb1d1dbb27fb7288ab9756b13b8338cdb8ceb41a10949c852ad45ab1f2 WHIRLPOOL 488b7b9af1d1d06cca163d43e7be190730e2f0421796c21a26ace11196ee37a16b1bdeea78a1e2e64f8ca0e87f67a2aecd066af21505f3dd92dd76de40a94fa0
+DIST mysql-workbench-community-6.3.4-src.tar.gz 14954524 SHA256 be47f30c48c04f951a1be9b6496e4d94d5b975d6c693933ba2fa6e96718179d3 SHA512 8d7eacd46fd3cac912dac2fdbc0669759f9411796507cca76b0ad47228381b15b7f88e60a7a5a8763e704b456884828783cb0c7ed218025edb35aa5033d7d02f WHIRLPOOL 9e00ce475e573ee8b875d9f25d73d488cf68ff96b2eb006dba1dc7e424c70a0650cac42dcc3ed34648c5879354cab5311eaf6729e9b307718935d543c4f43bf5
+DIST mysql-workbench-community-6.3.9-src.tar.gz 14634678 SHA256 607af29481821b25c13c8b28011162c9d6d5e9ef96df5f664408116b88308951 SHA512 a3df060114adb0c4f95423dc2732a39917be4eb2281cc2d811cc68c2d43cfa28eea52c4ab743018e91c8c58b0ad7d4b34a9936df8c17381accee8159afe19901 WHIRLPOOL 654eaa76d6f132e50ca904aae54c07a7d2aabe746e519f5c6c8cd5d40529ebe022616d5ef28be8dd322aba19e589dc8d9dd2bb4c5f2356fa7b5698a84190208e
+EBUILD mysql-workbench-6.3.4-r1.ebuild 2823 SHA256 866fff18e03b405280508bf8c84223e74742bdd5d5d5c4f70dfe7b0d2f284ead SHA512 b3865e92b552dbaedb60989602401608fd792908f6abf9cdc44786242b765120e36029a86e6169aef8c87c3ed0392ca1655596603fb06591931717da942d3ccc WHIRLPOOL 1b8ec2a2209b934133de3fe535e936429cccdda8394f730671dcdb8a4cdbd8cc5fa215896fedcb833e888fc4fd5d549d1ddba159b7e02478ecccc0c13e7e66b2
+EBUILD mysql-workbench-6.3.4-r2.ebuild 2644 SHA256 4841553433623e4e17c50636e21dcfb497f8c3dc95102835862fa2907a19ef08 SHA512 18873a92067d037bfcf2f69e95acda490968a8ca752bc34a83c925f29c894a2c721d01418046b983827b93aeb7cbf7695fe4ff5563a33e60b1775a8280fe1f3e WHIRLPOOL 5c0058348e671a5d2ac527f68e39a009511ff32f9b15e64aa095fd5b96cf4e28aa12e62e9ca842db1ebe2a93d0a9b92cc899e13e6627d2370b003e4464cf7b50
+EBUILD mysql-workbench-6.3.9.ebuild 2621 SHA256 c894ad19d032f22379c090f943c149b9b21ac527093cd01c7b5a5bcf169f3ebd SHA512 26f05929ce84c1e64e5d3aadf95d19431ba129528bff947646a9b952a155887f773370caca1d44d68f7d09d7b0b9184d77d44ef3eb6ceb016976a549369bc1cb WHIRLPOOL 60ef55be7f05c59b34ce988e5e086182fe29feb753eae69f52f1c93635b887e68695211f987c4e045df277abcd7047c3a096835f8ff7c413dbfee2f06b8c87a4
+MISC ChangeLog 5661 SHA256 7b4d34d04cff06d0616c891886481375c4e00d5284c7323b5da57d541ca65ef5 SHA512 6d87080e959ebb6504ff88be8b428286d3a4977a520372b710274ba14f9f0d17ee6f3daef48aca58e7db30bb828cd60bb199277634998cd786d74353a32aa4cf WHIRLPOOL 95d3b6e0a66d490edc78cdb5430811be3587eade346526f61d2e34831cd3857701446a09bae78336398374ef04e8c1c36cbded68431d8013ef1131cc5acaed3f
+MISC ChangeLog-2015 21143 SHA256 bb8dd56f0d24836768a4ebea70fa3e8759018aa84ccf8c828f52538db79f1834 SHA512 66a6a26c398066a285d6e89284a7dab4e89b850258066d1a048553221a9e4f51795f76479aee6a456a9bc044696a984f868d7a839d9ade7e870c6cd6b5565d25 WHIRLPOOL 8f6cdf546140ad301accc15d4e9d37e4ffc3d807e963c3bca97d992a3ca644f7fcde6a4541efc63e877d8f8e88a19f797d3407fee9b2fb26e49f5855e5237dfe
+MISC metadata.xml 310 SHA256 b3b1f6c9ef5625f9e1eaf450f9ed0938cf0a869e6b5754a75d081b937c27cb79 SHA512 f284063d72f2218f8ed60a74b43f252d608865682b8c0447f52016a02a7cbf6d45a226787d893328dd31946ade1cca78ff7556896183b4422c4142a8935a2193 WHIRLPOOL e19ae85b220862f06a6806647cf5200de8c8463cabb9c299976772fe4736daeac2743dc6f304b0644d43ab781c6c508c267579ca9150e02ebcb601f1c42f191d
diff --git a/dev-db/mysql-workbench/files/mysql-workbench-6.2.3-CMakeLists.patch b/dev-db/mysql-workbench/files/mysql-workbench-6.2.3-CMakeLists.patch
new file mode 100644
index 000000000000..6e9a4d5e1410
--- /dev/null
+++ b/dev-db/mysql-workbench/files/mysql-workbench-6.2.3-CMakeLists.patch
@@ -0,0 +1,43 @@
+--- mysql-workbench-community-6.0.7-src/CMakeLists.txt 2013-08-30 18:05:12.000000000 +0200
++++ mysql-workbench-community-6.0.7-src/CMakeLists.txt 2013-09-08 11:41:18.723838826 +0200
+@@ -18,6 +18,9 @@
+ find_package(PkgConfig REQUIRED)
+
+ find_package(GTK2 2.20 REQUIRED gtk gtkmm)
++if (NOT GTK2_FOUND)
++ message( FATAL_ERROR "Not all GTK2 components were found!" )
++endif()
+ pkg_check_modules(GTHREAD REQUIRED gthread-2.0)
+ pkg_check_modules(GMODULE REQUIRED gmodule-2.0)
+ set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${GTHREAD_INCLUDE_DIRS} ${GMODULE_INCLUDE_DIRS})
+@@ -32,7 +35,8 @@
+ endif ()
+
+ # All known publicly available versions of Antlr3C are buggy
+-
++# see: https://bugzilla.redhat.com/show_bug.cgi?id=966973
++# patch seems to be only applied partially to antlr-3.4, bug is present in antlr-3.5, too
+ if (SKIP_BUNDLED_ANTLR)
+ find_package(Antlr3C)
+ endif ()
+@@ -89,7 +93,8 @@
+ pkg_check_modules(CAIRO REQUIRED cairo>=1.5.12)
+ pkg_check_modules(UUID REQUIRED uuid)
+ pkg_check_modules(LIBZIP REQUIRED libzip)
+-if (UNIX)
++
++if (UNIX AND USE_GNOME_KEYRING)
+ pkg_check_modules(GNOME_KEYRING gnome-keyring-1)
+ if (GNOME_KEYRING_FOUND)
+ set(KEYRING_DEFINITION "HAVE_GNOME_KEYRING")
+@@ -99,7 +104,10 @@
+ set(KEYRING_DEFINITION "HAVE_OLD_GNOME_KEYRING")
+ endif()
+ endif()
++ if (NOT GNOME_KEYRING_FOUND)
++ message( FATAL_ERROR "Gnome keyring libraries could not be found" )
++ endif()
+ endif()
+
+ include (CheckFunctionExists)
+
diff --git a/dev-db/mysql-workbench/files/mysql-workbench-6.2.5-wbcopytables.patch b/dev-db/mysql-workbench/files/mysql-workbench-6.2.5-wbcopytables.patch
new file mode 100644
index 000000000000..2d3d8db243f8
--- /dev/null
+++ b/dev-db/mysql-workbench/files/mysql-workbench-6.2.5-wbcopytables.patch
@@ -0,0 +1,12 @@
+--- a/plugins/migration/CMakeLists.txt.~1~ 2015-02-25 09:08:47.000000000 +0100
++++ b/plugins/migration/CMakeLists.txt 2015-03-07 07:28:56.745378152 +0100
+@@ -10,7 +10,8 @@
+ if (UNIX)
+ configure_file(wbcopytables.in wbcopytables)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/wbcopytables DESTINATION ${WB_INSTALL_BIN_DIR})
+-
++
++ SET(CMAKE_INSTALL_RPATH "${WB_INSTALL_LIB_DIR}")
+ add_executable(wbcopytables-bin
+ copytable/copytable.cpp
+ copytable/python_copy_data_source.cpp
diff --git a/dev-db/mysql-workbench/files/mysql-workbench-6.3.3-mysql_options4.patch b/dev-db/mysql-workbench/files/mysql-workbench-6.3.3-mysql_options4.patch
new file mode 100644
index 000000000000..7fb9c8d57fc5
--- /dev/null
+++ b/dev-db/mysql-workbench/files/mysql-workbench-6.3.3-mysql_options4.patch
@@ -0,0 +1,40 @@
+--- plugins/migration/copytable/copytable.cpp.~1~ 2015-04-15 15:54:19.000000000 +0200
++++ plugins/migration/copytable/copytable.cpp 2015-04-26 08:53:08.871167725 +0200
+@@ -1920,12 +1920,17 @@
+ _incoming_data_charset = "latin1";
+
+ mysql_init(&_mysql);
++/* This is optional has compiled in for MySQL >= 5.6.6
++ * Looks like MariaDB does not support this as supposed,
++ * so disable completly. */
++#ifndef MARIADB_BASE_VERSION
+ #if defined(MYSQL_VERSION_MAJOR) && defined(MYSQL_VERSION_MINOR) && defined(MYSQL_VERSION_PATCH)
+ #if MYSQL_CHECK_VERSION(5,6,6)
+ if (is_mysql_version_at_least(5,6,6))
+ mysql_options4(&_mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", app_name.c_str());
+ #endif
+ #endif
++#endif
+
+ // _bulk_insert_record is used to prepare a single record string, the connection
+ // is needed to escape binary data properly
+--- plugins/migration/copytable/copytable.cpp.~1~ 2015-04-26 08:57:30.444285953 +0200
++++ plugins/migration/copytable/copytable.cpp 2015-04-26 10:16:39.234711324 +0200
+@@ -2875,6 +2875,9 @@
+
+ // This function is used to create a legal SQL string that you can use in an SQL statement
+ // This is needed because the escaping depends on the character set in use by the server
++ #ifdef MARIADB_BASE_VERSION
++ length += mysql_real_escape_string(_mysql, buffer + length, data, (unsigned long)dlength);
++ #else
+ #if defined(MYSQL_VERSION_MAJOR) && defined(MYSQL_VERSION_MINOR) && defined(MYSQL_VERSION_PATCH)
+ #if MYSQL_CHECK_VERSION(5,7,6)
+ if (is_mysql_version_at_least(5,7,6))
+@@ -2885,6 +2888,7 @@
+ length += mysql_real_escape_string(_mysql, buffer + length, data, (unsigned long)dlength);
+ #endif
+ #endif
++ #endif
+
+ return true;
+ }
diff --git a/dev-db/mysql-workbench/files/mysql-workbench-6.3.4-cxx11.patch b/dev-db/mysql-workbench/files/mysql-workbench-6.3.4-cxx11.patch
new file mode 100644
index 000000000000..e8ed54a8c705
--- /dev/null
+++ b/dev-db/mysql-workbench/files/mysql-workbench-6.3.4-cxx11.patch
@@ -0,0 +1,39 @@
+Last-Update: 2015-10-24
+Forwarded: not-needed
+Bug-Upstream: https://bugs.mysql.com/bug.php?id=78668
+From: Marcin Szalowicz
+Author: Dmitry Smirnov <onlyjob@member.fsf.org>
+Description: fix FTBFS
+ ~~~~
+ library/forms/view.cpp:515:32: error: cannot convert 'boost::signals2::signal<bool()>::result_type {aka boost::optional<bool>}' to 'bool' in return
+ return _signal_mouse_leave();
+ ^
+ library/forms/CMakeFiles/mforms.dir/build.make:1865: recipe for target 'library/forms/CMakeFiles/mforms.dir/view.cpp.o' failed
+ ~~~~
+
+--- a/library/forms/swig/mforms.i
++++ b/library/forms/swig/mforms.i
+@@ -532,9 +532,9 @@
+ void add_##method(PyObject *callback) { signal->connect(pycall_void_toolbaritem_fun(callback)); }
+
+ #define SWIG_ADD_SIGNAL_BOOL_INT_CALLBACK(method, signal)\
+ void add_##method(PyObject *callback) { signal->connect(pycall_bool_int_fun(callback)); }\
+- bool call_##method(int i) { return (*signal)(i); }
++ bool call_##method(int i) { return *( (*signal)(i) ); }
+
+ #define SWIG_ADD_SIGNAL_VOID_ENTRYACTION_CALLBACK(method, signal)\
+ void add_##method(PyObject *callback) { signal->connect(pycall_void_entryaction_fun(callback)); }
+
+--- a/library/forms/view.cpp
++++ b/library/forms/view.cpp
+@@ -511,9 +511,9 @@
+
+ bool View::mouse_leave()
+ {
+ if (_signal_mouse_leave.num_slots() > 0)
+- return _signal_mouse_leave();
++ return *_signal_mouse_leave();
+ return false;
+ }
+
+ //--------------------------------------------------------------------------------------------------
diff --git a/dev-db/mysql-workbench/files/mysql-workbench-6.3.4-gtk.patch b/dev-db/mysql-workbench/files/mysql-workbench-6.3.4-gtk.patch
new file mode 100644
index 000000000000..e975906e19ab
--- /dev/null
+++ b/dev-db/mysql-workbench/files/mysql-workbench-6.3.4-gtk.patch
@@ -0,0 +1,38 @@
+Last-Update: 2016-11-13
+Forwarded: not-needed
+Author: Dmitry Smirnov <onlyjob@debian.org>
+Bug-Debian: https://bugs.debian.org/839356
+Description: fix FTBFS
+
+--- mysql-workbench-6.3.4+dfsg.orig/library/forms/gtk/src/lf_popover.cpp
++++ mysql-workbench-6.3.4+dfsg/library/forms/gtk/src/lf_popover.cpp
+@@ -380,7 +380,7 @@ void PopoverWidget::show_popover(const i
+ if (_style == mforms::PopoverStyleTooltip)
+ {
+ Glib::RefPtr<Gdk::Window> wnd = this->get_window();
+- if (wnd != 0)
++ if (wnd)
+ {
+ int xx;
+ int yy;
+@@ -396,7 +396,7 @@ void PopoverWidget::show_popover(const i
+ {
+ Gdk::ModifierType mask;
+ Glib::RefPtr<Gdk::Display> dsp = Gdk::Display::get_default();
+- if (dsp != 0)
++ if (dsp)
+ dsp->get_pointer(x, y, mask);
+ }
+
+--- mysql-workbench-6.3.4+dfsg.orig/library/forms/gtk/src/lf_popup.cpp
++++ mysql-workbench-6.3.4+dfsg/library/forms/gtk/src/lf_popup.cpp
+@@ -81,7 +81,8 @@ void PopupImpl::on_screen_changed(const
+ {
+ d("\n");
+ Glib::RefPtr<Gdk::Colormap> colormap = screen->get_rgba_colormap();
+- _have_rgba = colormap;
++ if (colormap)
++ _have_rgba = true;
+
+ if (!_have_rgba)
+ colormap = screen->get_rgb_colormap();
diff --git a/dev-db/mysql-workbench/files/mysql-workbench-6.3.9-mariadb-json.patch b/dev-db/mysql-workbench/files/mysql-workbench-6.3.9-mariadb-json.patch
new file mode 100644
index 000000000000..e785d6fb0976
--- /dev/null
+++ b/dev-db/mysql-workbench/files/mysql-workbench-6.3.9-mariadb-json.patch
@@ -0,0 +1,55 @@
+--- a/plugins/migration/copytable/copytable.cpp
++++ b/plugins/migration/copytable/copytable.cpp
+@@ -109,8 +109,10 @@
+ return "MYSQL_TYPE_STRING";
+ case MYSQL_TYPE_GEOMETRY:
+ return "MYSQL_TYPE_GEOMETRY";
++#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined MARIADB_BASE_VERSION
+ case MYSQL_TYPE_JSON:
+ return "MYSQL_TYPE_JSON";
++#endif
+ default:
+ return "UNKNOWN";
+ }
+@@ -295,7 +297,9 @@
+ case MYSQL_TYPE_STRING:
+ case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_BIT:
++#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined MARIADB_BASE_VERSION
+ case MYSQL_TYPE_JSON:
++#endif
+ if (!col->is_long_data)
+ bind.buffer_length = (unsigned)col->source_length + 1;
+
+@@ -1392,7 +1396,11 @@
+ rowbuffer[index].buffer_type == MYSQL_TYPE_MEDIUM_BLOB ||
+ rowbuffer[index].buffer_type == MYSQL_TYPE_LONG_BLOB || rowbuffer[index].buffer_type == MYSQL_TYPE_BLOB ||
+ rowbuffer[index].buffer_type == MYSQL_TYPE_STRING ||
+- rowbuffer[index].buffer_type == MYSQL_TYPE_GEOMETRY || rowbuffer[index].buffer_type == MYSQL_TYPE_JSON) {
++ rowbuffer[index].buffer_type == MYSQL_TYPE_GEOMETRY
++#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined MARIADB_BASE_VERSION
++ || rowbuffer[index].buffer_type == MYSQL_TYPE_JSON
++#endif
++ ) {
+ if (rowbuffer[index].buffer_length)
+ free(rowbuffer[index].buffer);
+
+@@ -2162,7 +2170,9 @@
+ case MYSQL_TYPE_STRING:
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_SET:
++#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined MARIADB_BASE_VERSION
+ case MYSQL_TYPE_JSON:
++#endif
+ _bulk_insert_record.append("'", 1);
+ ret_val = _bulk_insert_record.append_escaped((char *)(*_row_buffer)[col_index].buffer,
+ *(*_row_buffer)[col_index].length);
+@@ -2621,7 +2621,7 @@
+ // This is needed because the escaping depends on the character set in use by the server
+ unsigned long ret_length = 0;
+
+-#if MYSQL_CHECK_VERSION(5, 7, 6)
++#if MYSQL_CHECK_VERSION(5, 7, 6) && ! defined MARIADB_BASE_VERSION
+ if (_target->is_mysql_version_at_least(5, 7, 6))
+ ret_length += mysql_real_escape_string_quote(_mysql, buffer + length, data, (unsigned long)dlength, '"');
+ else
diff --git a/dev-db/mysql-workbench/metadata.xml b/dev-db/mysql-workbench/metadata.xml
new file mode 100644
index 000000000000..64e908505cd8
--- /dev/null
+++ b/dev-db/mysql-workbench/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>graaff@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">antlr/website-antlr3</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysql-workbench/mysql-workbench-6.3.4-r1.ebuild b/dev-db/mysql-workbench/mysql-workbench-6.3.4-r1.ebuild
new file mode 100644
index 000000000000..1d3b557c13c5
--- /dev/null
+++ b/dev-db/mysql-workbench/mysql-workbench-6.3.4-r1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+GCONF_DEBUG="no"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit gnome2 eutils flag-o-matic python-single-r1 cmake-utils
+
+MY_P="${PN}-community-${PV}-src"
+
+DESCRIPTION="MySQL Workbench"
+HOMEPAGE="http://dev.mysql.com/workbench/"
+SRC_URI="mirror://mysql/Downloads/MySQLGUITools/${MY_P}.tar.gz https://github.com/antlr/website-antlr3/blob/gh-pages/download/antlr-3.4-complete.jar?raw=true -> antlr-3.4-complete.jar"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="debug doc gnome-keyring"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# glibc: deprecated mutex functions, removed in 2.36.0
+CDEPEND="${PYTHON_DEPS}
+ dev-libs/glib:2
+ dev-cpp/atkmm
+ dev-cpp/pangomm
+ >=dev-cpp/glibmm-2.14:2
+ >=dev-cpp/gtkmm-2.14:2.4
+ dev-libs/atk
+ x11-libs/pango
+ >=x11-libs/gtk+-2.20:2
+ gnome-base/libglade:2.0
+ >=x11-libs/cairo-1.5.12[glib,svg]
+ dev-libs/libsigc++:2
+ >=dev-libs/boost-1.55.0[nls]
+ >=dev-cpp/ctemplate-0.95
+ >=dev-libs/libxml2-2.6.2:2
+ dev-libs/libzip
+ >=virtual/mysql-5.1
+ dev-libs/libpcre[cxx]
+ >=sci-libs/gdal-1.11.1-r1[-mdb]
+ virtual/opengl
+ >=dev-lang/lua-5.1:0[deprecated]
+ || ( sys-libs/e2fsprogs-libs dev-libs/ossp-uuid )
+ dev-libs/tinyxml[stl]
+ dev-db/mysql-connector-c++
+ dev-db/vsqlite++
+ || ( dev-db/libiodbc dev-db/unixODBC )
+ gnome-keyring? ( gnome-base/libgnome-keyring )
+ dev-python/pexpect
+ >=dev-python/paramiko-1.7.4
+ "
+
+# lua perhaps no longer needed? Was used via libgrt only
+
+RDEPEND="${CDEPEND}
+ app-admin/sudo
+ >=sys-apps/net-tools-1.60_p20120127084908"
+
+DEPEND="${CDEPEND}
+ dev-lang/swig
+ virtual/jre
+ virtual/pkgconfig"
+
+S="${WORKDIR}"/"${MY_P}"
+
+src_unpack() {
+ unpack ${PN}-community-${PV}-src.tar.gz
+}
+
+src_prepare() {
+ ## Patch CMakeLists.txt
+ epatch "${FILESDIR}/${PN}-6.2.3-CMakeLists.patch" \
+ "${FILESDIR}/${PN}-6.2.5-wbcopytables.patch" \
+ "${FILESDIR}/${PN}-6.3.3-mysql_options4.patch" \
+ "${FILESDIR}/${PN}-6.3.4-cxx11.patch" \
+ "${FILESDIR}/${PN}-6.3.4-gtk.patch"
+
+ sed -i -e '/target_link_libraries/ s/sqlparser.grt/sqlparser.grt sqlparser/' \
+ modules/db.mysql.sqlparser/CMakeLists.txt
+
+ ## remove hardcoded CXXFLAGS
+ sed -i -e 's/-O0 -g3//' ext/scintilla/gtk/CMakeLists.txt || die
+
+ ## package is very fragile...
+ strip-flags
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ local mycmakeargs=(
+ $(cmake-utils_use_use gnome-keyring GNOME_KEYRING)
+ -DLIB_INSTALL_DIR="/usr/$(get_libdir)"
+ -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
+ -DPYTHON_LIBRARY="$(python_get_library_path)"
+ )
+ ANTLR_JAR_PATH="${DISTDIR}/antlr-3.4-complete.jar" cmake-utils_src_configure
+}
+
+src_compile() {
+ # Work around parallel build issues, bug 507838
+ cmake-utils_src_compile -j1
+}
diff --git a/dev-db/mysql-workbench/mysql-workbench-6.3.4-r2.ebuild b/dev-db/mysql-workbench/mysql-workbench-6.3.4-r2.ebuild
new file mode 100644
index 000000000000..4d9464660152
--- /dev/null
+++ b/dev-db/mysql-workbench/mysql-workbench-6.3.4-r2.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+GCONF_DEBUG="no"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit gnome2 eutils flag-o-matic python-single-r1 cmake-utils
+
+MY_P="${PN}-community-${PV}-src"
+
+DESCRIPTION="MySQL Workbench"
+HOMEPAGE="http://dev.mysql.com/workbench/"
+SRC_URI="mirror://mysql/Downloads/MySQLGUITools/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="debug doc gnome-keyring"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# glibc: deprecated mutex functions, removed in 2.36.0
+CDEPEND="${PYTHON_DEPS}
+ dev-libs/glib:2
+ dev-cpp/atkmm
+ dev-cpp/pangomm
+ >=dev-cpp/glibmm-2.14:2
+ >=dev-cpp/gtkmm-2.14:2.4
+ dev-libs/atk
+ x11-libs/pango
+ >=x11-libs/gtk+-2.20:2
+ gnome-base/libglade:2.0
+ >=x11-libs/cairo-1.5.12[glib,svg]
+ dev-libs/libsigc++:2
+ >=dev-libs/boost-1.55.0[nls]
+ >=dev-cpp/ctemplate-0.95
+ >=dev-libs/libxml2-2.6.2:2
+ dev-libs/libzip
+ >=virtual/mysql-5.1
+ dev-libs/libpcre[cxx]
+ >=sci-libs/gdal-1.11.1-r1[-mdb]
+ virtual/opengl
+ >=dev-lang/lua-5.1:0[deprecated]
+ || ( sys-libs/e2fsprogs-libs dev-libs/ossp-uuid )
+ dev-libs/tinyxml[stl]
+ dev-db/mysql-connector-c++
+ dev-db/vsqlite++
+ || ( dev-db/libiodbc dev-db/unixODBC )
+ gnome-keyring? ( gnome-base/libgnome-keyring )
+ dev-python/pexpect
+ >=dev-python/paramiko-1.7.4
+ "
+
+# lua perhaps no longer needed? Was used via libgrt only
+
+RDEPEND="${CDEPEND}
+ app-admin/sudo
+ >=sys-apps/net-tools-1.60_p20120127084908"
+
+DEPEND="${CDEPEND}
+ dev-lang/swig
+ virtual/pkgconfig"
+
+S="${WORKDIR}"/"${MY_P}"
+
+src_unpack() {
+ unpack ${PN}-community-${PV}-src.tar.gz
+}
+
+src_prepare() {
+ ## Patch CMakeLists.txt
+ epatch "${FILESDIR}/${PN}-6.2.3-CMakeLists.patch" \
+ "${FILESDIR}/${PN}-6.2.5-wbcopytables.patch" \
+ "${FILESDIR}/${PN}-6.3.3-mysql_options4.patch" \
+ "${FILESDIR}/${PN}-6.3.4-cxx11.patch" \
+ "${FILESDIR}/${PN}-6.3.4-gtk.patch"
+
+ sed -i -e '/target_link_libraries/ s/sqlparser.grt/sqlparser.grt sqlparser/' \
+ modules/db.mysql.sqlparser/CMakeLists.txt
+
+ ## remove hardcoded CXXFLAGS
+ sed -i -e 's/-O0 -g3//' ext/scintilla/gtk/CMakeLists.txt || die
+
+ ## package is very fragile...
+ strip-flags
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ local mycmakeargs=(
+ $(cmake-utils_use_use gnome-keyring GNOME_KEYRING)
+ -DLIB_INSTALL_DIR="/usr/$(get_libdir)"
+ -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
+ -DPYTHON_LIBRARY="$(python_get_library_path)"
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ # Work around parallel build issues, bug 507838
+ cmake-utils_src_compile -j1
+}
diff --git a/dev-db/mysql-workbench/mysql-workbench-6.3.9.ebuild b/dev-db/mysql-workbench/mysql-workbench-6.3.9.ebuild
new file mode 100644
index 000000000000..efa53cd769f5
--- /dev/null
+++ b/dev-db/mysql-workbench/mysql-workbench-6.3.9.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+GCONF_DEBUG="no"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit gnome2 eutils flag-o-matic python-single-r1 cmake-utils
+
+MY_P="${PN}-community-${PV}-src"
+
+DESCRIPTION="MySQL Workbench"
+HOMEPAGE="https://www.mysql.com/products/workbench/"
+SRC_URI="mirror://mysql/Downloads/MySQLGUITools/${MY_P}.tar.gz https://github.com/antlr/website-antlr3/blob/gh-pages/download/antlr-3.4-complete.jar?raw=true -> antlr-3.4-complete.jar"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="debug doc gnome-keyring"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# glibc: deprecated mutex functions, removed in 2.36.0
+CDEPEND="${PYTHON_DEPS}
+ dev-libs/glib:2
+ dev-cpp/atkmm
+ dev-cpp/pangomm
+ >=dev-cpp/glibmm-2.14:2
+ dev-cpp/gtkmm:3.0
+ dev-libs/atk
+ x11-libs/pango
+ x11-libs/gtk+:3
+ gnome-base/libglade:2.0
+ >=x11-libs/cairo-1.5.12[glib,svg]
+ dev-libs/libsigc++:2
+ >=dev-libs/boost-1.55.0[nls]
+ >=dev-cpp/ctemplate-0.95
+ >=dev-libs/libxml2-2.6.2:2
+ dev-libs/libzip
+ >=virtual/mysql-5.6
+ dev-libs/libpcre[cxx]
+ >=sci-libs/gdal-1.11.1-r1[-mdb]
+ virtual/opengl
+ || ( sys-libs/e2fsprogs-libs dev-libs/ossp-uuid )
+ dev-libs/tinyxml[stl]
+ >=dev-db/mysql-connector-c++-1.1.8
+ dev-db/vsqlite++
+ || ( dev-db/libiodbc dev-db/unixODBC )
+ gnome-keyring? ( gnome-base/libgnome-keyring )
+ dev-python/pexpect
+ >=dev-python/paramiko-1.7.4
+ "
+
+RDEPEND="${CDEPEND}
+ app-admin/sudo
+ >=sys-apps/net-tools-1.60_p20120127084908"
+
+DEPEND="${CDEPEND}
+ dev-lang/swig
+ virtual/jre
+ virtual/pkgconfig"
+
+S="${WORKDIR}"/"${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.2.5-wbcopytables.patch"
+ "${FILESDIR}/${PN}-6.3.9-mariadb-json.patch"
+)
+
+src_unpack() {
+ unpack ${PN}-community-${PV}-src.tar.gz
+}
+
+src_prepare() {
+ sed -i -e '/target_link_libraries/ s/sqlparser.grt/sqlparser.grt sqlparser/' \
+ modules/db.mysql.sqlparser/CMakeLists.txt
+
+ ## remove hardcoded CXXFLAGS
+ sed -i -e 's/-O0 -g3//' ext/scintilla/gtk/CMakeLists.txt || die
+
+ ## package is very fragile...
+ strip-flags
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ local mycmakeargs=(
+ -DUSE_GNOME_KEYRING="$(usex gnome-keyring)"
+ -DLIB_INSTALL_DIR="/usr/$(get_libdir)"
+ -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
+ -DPYTHON_LIBRARY="$(python_get_library_path)"
+ -DMySQL_CONFIG_PATH="/usr/bin/mysql_config"
+ )
+ ANTLR_JAR_PATH="${DISTDIR}/antlr-3.4-complete.jar" cmake-utils_src_configure
+}
+
+src_compile() {
+ # Work around parallel build issues, bug 507838
+ cmake-utils_src_compile -j1
+}
diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
new file mode 100644
index 000000000000..324417891e22
--- /dev/null
+++ b/dev-db/mysql/Manifest
@@ -0,0 +1,19 @@
+AUX my.cnf-5.1 4658 SHA256 def067f194436548d9d41e2480d309a3727ba8bbfa7328798319fbf37ad5468c SHA512 6499e2cc1382e64be1f59d1e7855737067bfcf360f0acaede5dd357d97678eb55964de66ac0bece2bd0bfd2283997c7f335359242cfe396e21f0391de68c62ee WHIRLPOOL b90ed6abf8c0f71e6bd762f3b66b8ecdef95811eaa8c3374cd5819148e98dc1d5410ca36fce89c976e4997830cd1937f08162f8d2462173468368dd1767e9c08
+AUX my.cnf-5.5 4733 SHA256 197e84650b514dd4792df0bea3c27f9f23dee25b6363751562695f006a38e626 SHA512 6a5d183f1aeb30d9096838ac010c8f2dc004448924b3606bd03c1a5e0336a20fe5fcef1d2cd772977a167268fcff51a4b663f1f73a37d3066983621a8ca6c004 WHIRLPOOL 224e82ee0cd38c7d363dd6542d380e94638e2736767e4562c30efeb5afaf7bff086e964f330a5d26b1c2e061ac164410b96e76b44bc1de13b5f8539c9caeaba4
+AUX my.cnf-5.6 4504 SHA256 d6bfb754105464643f8f2efa14337c2f78a6a6e7e812e998b2ebcdd4b7c6f450 SHA512 866aa700460c2962bad6294b271efad09ef285dd428ab01551078be9972d2f961fbdf56aef7927439784711022e92a96f2eba30cd297f056f6562e8817c89aae WHIRLPOOL c91bb1ea6ef0b974377a60ef7ceb434ffcbf46d3fb57412deaa92930ab83e57bee3771b44a7b374f1df02211562ed5296182a218763145a7c41d96aa9b709afd
+DIST mysql-5.5.57.tar.gz 21044615 SHA256 c1c2bd321e524f92e43fe73d0d6745badd538c984c7561b273ae10e9aef57384 SHA512 493e6345a2d8ec407fcfc6ed5b67599c77b6351b7cfb1d676b39f68ac9446959cf0822c0d0bcd2206cea07b8c06c85734aa8501c938d6393ffab220f3f5ee6e8 WHIRLPOOL c321bfc26c7b5a1bdaddf2be9de84c174869743034f4d5b483767c0308875bc583f6705982ccb4935794b8ce94a1234b2b8561c933cced5aba11f48e93fbfe15
+DIST mysql-5.6.35.tar.gz 32167628 SHA256 dddcba169b98844d7c65346cbd791c853edf942d78440381685087b84aa35020 SHA512 106c4b05c52cd2bb5378376e4a453aeb55eda0adce527862c435068597c3e60f44e3c64476011befefd688e6fdf30f2245e28320d57d9fccbb2415d87498e7f2 WHIRLPOOL e8972bba163453e54dc3859a7cfd07b4dc38125e0b5f7b41940afa6f1466820079f18e88769ea198b12645383d105340ab5ea998b32a95d083d08689658510bc
+DIST mysql-5.6.36.tar.gz 32192348 SHA256 0af81a5538fc7fe2b747295dfa96589ace8831d2a7d4a26660fca456babeb147 SHA512 b3e3bcb1d1e913994f274f4c6dc72c77f1f52b132389e784c675d1720b5913788ce035f045b99ef3754d1b257db55e8300b5c7622ec79c33afafec5968801c18 WHIRLPOOL 628e33a58532dcdca20e489c3120824604b8d51e10d609f1f9c2adb11552124a8f87f206df99766162d288d5877dac22d2cacffdba1458c73fb52b529245a1e6
+DIST mysql-5.6.37.tar.gz 32200158 SHA256 59c4ed39047279ddccd1bed9e247830d2bfad27d56dc2eb48d0b5695c94a1fbd SHA512 6935cf11490fb32832468e2a69a9d81a567b1b4ab0afaa0614896e3ddbb95a74b26406284f307637e4b2b9620ef4d96a167128ce7fcb1d338b0ebbc2cef2e597 WHIRLPOOL d5e7f6445bacfa7cb118a805f0efff5f4c22d96e77c174efa7ae2d286f3889ab7975ece8a0abe6232d278994d5991430d0d0ff89769883f278d2fa233341db25
+DIST mysql-extras-20160212-0233Z.tar.bz2 297332 SHA256 01a52587ef1335b2795197d2e547c0b3a1e4b705db09f96cdfb45d2152b6536b SHA512 956dbdcb987556c0625944848f97a36d096cd1f1712a2e051dd027f2856d3c6e94a18d23faca71882260c4b12ee329e3a5f569443b877a3c3e5e88146bfac916 WHIRLPOOL e3837d329ddd137be60fe9d0b37f35ed2e0e7fe1383f38ee45617be288ae318a444e6befdfbaf64b07d4a88ec47fec5cd88d733ecd5bb32ce40f3ba8d09573cd
+DIST mysql-extras-20170302-1359Z.tar.bz2 306816 SHA256 0375bffa8a7b26caab3a13be299b30231f20ad3e8dc82fba9384e5463763a105 SHA512 2c096c68e0d545c98fb5520f92b9e85f6bbc910853793f60f0e67979ee927410bbecadece3400364fdc2b5682f9105664f6a2de8fa0ee1818fb266e063e82869 WHIRLPOOL 6629f0069b77c9add86f4a40168a1dad7bcc0ae18a513f05e44619366a5fdfb82238df2e925de88c358fca2dd50f162ffefd8efea335cb544ccdcf74e73ed25f
+DIST mysql-extras-20170719-1335Z.tar.bz2 311350 SHA256 725dc29fa4a553cfc0bd07dcc1259e5a38a6d945f757e9f49f554a9a7773abe7 SHA512 3450725b4cdcf1e330aee775c1c169510bd7f06f19b874a3e94203227d393b136165eca1e77270bfc37c534f4120aeeeb3df8fbd71704312836b79a99d81a122 WHIRLPOOL f1606df56f82847a8b4b332c1b61cb695aba2a51aef895fa9596495d89208535f829b8fa69a6e97a26d0b9171d817115b83ce447c8232197353dda258a6d38d0
+DIST mysql-extras-20170719-1630Z.tar.bz2 311320 SHA256 d21f42035850a3208a89d4271d2c544b8ccbb3b8855390b882248561451ae4cc SHA512 a2369d512b8e490b5859403c4c15cf9d8ff589000e56785f0fb02ad99535af189fe93ba9590035bf0b8cc1d0c7f3656c56d86d94d62ef97fa63cdaeade609f38 WHIRLPOOL aec2eb79350008464499f74cff002589628fc8e4e81970cbcf1d7d3ca0a7714d9ebc6408c7f25e037f452fb0b3397e7885dac83277884692eb3a88a26d6625c4
+EBUILD mysql-5.5.57.ebuild 4402 SHA256 3d8d94b5182b29cddb804f3b20ec99307186801341d501f27a0aeae207987b86 SHA512 35a7ea9160109174197c258d504c929e04b094d8e5cd5bfeb47d1155480b8f665f9edfecc1e3a53024536f8be80604da2b06f24d26246410870144b453a672d8 WHIRLPOOL e26942baeab07d395e9cf031acd354471e7704262de623e8fb22e1e9990f8eb7d0641e4c0163ede64061ce118fba4735e5ca9e4e98a1daf6874c12a84037ceb7
+EBUILD mysql-5.6.35.ebuild 5423 SHA256 b531c77f6d65f2ac0f557cf799f191df2ca1a75cc7af703ba9eae37e0c55489c SHA512 2a59c6801263a127b0a6a00bcace61677a98edfee5c79b2ee83bd30d3cb9d55d89a4409d37a4af4af48310966ae0b04fd1461ce370e1278bcb8f24eba58cccab WHIRLPOOL d0281c0403b9f8fb9e7b90aac330f348a8b4f0337cbd51b6e289f3dac52822487ffa5b31c82e6d8417a846a89cf27a59b1b592165b047f1ce0db09e4540634aa
+EBUILD mysql-5.6.36.ebuild 5950 SHA256 aa2069134693657f666cbf7a100701e334a74f2acdeab5b609038d2ed79b6c57 SHA512 864b0a2be4a822855369c19a7c2879b9909caeb607181dc8e6b88617abd32c6ac93f006135a2ffc14a72f170d02a5ea9c80274e3c1cb0c00c253ca365583ae55 WHIRLPOOL b335dd3da99eb6d28a12d85ae1393aab72a9c9af67b3c8087d187fbb0b7f89cf3b69598e76c3f07e74636a0205808ce584d570bb6b9e2ed5b3dbca856876e730
+EBUILD mysql-5.6.37.ebuild 6169 SHA256 4ca65730c9608696fe46ef85933ce11076410aebacb5d0868665149c0664170f SHA512 97c04c4efc40db771592b0c5835b48520b3b5c6e99084f33c43cfae2f74883b99ecab35d8bd646bfe5e18717dd398ce946695d82bb8f7431b914e7060c8603d5 WHIRLPOOL edb2d8e3f65fb1be6a2480442aa72b027cb6fdafc1a541cad3a9d654aa75b18f2939512a747d1926593a9b62b0456191bd4a54dc1346b455575dde31ab32aed3
+MISC ChangeLog 18776 SHA256 3ff64ef7497a470510146081692817768857fd4f297b98a184202f5fd06f0a47 SHA512 bfcb679245574135e7e0b7f0592771954bba01b6977ca4ffc8a37de181fb7fb60e6bd8b7c23cee0d41c4397341d282f28d43fed11eb176f12178123e0f8032e4 WHIRLPOOL c4601fb0d1ac3238f2d69a439463d66a67d843c197a55f4d9b436493e979393047b9549053fa00b46a3ed3719d72565ebad38c35ace3abab145e751212c047a8
+MISC ChangeLog-2010 108404 SHA256 93dda53b8871d9040e6aebb59f095a8debd5c0a9437e78e5e949989e209ba5cd SHA512 5f54b7c2e25d27680a9313da2450851118e34a57202d9f36f59da52834ca3b587701d93868d71bf684ddc253d49f87837c8d7e2d442f2955dfde8a701150fbe5 WHIRLPOOL 55f758942e3012aa0ae7d529c2f8b6e0d8f4d7cbde09039f16cd05f0a58fc4e3e09ccd50e366effdcaab4641300eb0f494ddbe3a35a645ced8a9d747d80e9821
+MISC ChangeLog-2015 27542 SHA256 997fb94e9984a271cfd68316c0012c16f78234b1aad328c2c5e97e2940f7dcfa SHA512 f07244cfb59f613fcaed97ad0ed135857ba995b616962b145548ecf84176666986fc9fb5e55ec543110755e73d316ee5a733cfc1ce14eb1ca2a1449adfa50859 WHIRLPOOL aed27d4cb6a7cf33d354fb559268baac8c7977dd9cdc821b12af8008c94dc22d0dedace9e33caae6bd676405a3a02628e1a8ae8d3baac46af33b95251a94c70f
+MISC metadata.xml 1654 SHA256 16592a197951904e3eb76dd8c1d3aab1017ad91bc7f00075eee29739987ba324 SHA512 18a59971c3eb563ca835c61719b67a4466abbacbbf13139acda8fd3a3197eb40d15d1b230b0514472a53c7870a3dbdc1b875c83842737fc4e91a077b2507704b WHIRLPOOL e2aa493c466978bba4b1ff6b9ecdf9d7595f2930995e1da5c535d3a863881e174524138665762213ebe4794bc057082ee88344c5b96c460c59167bd2d4e14ead
diff --git a/dev-db/mysql/files/my.cnf-5.1 b/dev-db/mysql/files/my.cnf-5.1
new file mode 100644
index 000000000000..0ec0677aabc5
--- /dev/null
+++ b/dev-db/mysql/files/my.cnf-5.1
@@ -0,0 +1,144 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+language = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/english
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# uncomment the following directives if you are using BDB tables
+#bdb_cache_size = 4M
+#bdb_max_lock = 10000
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/mysql/files/my.cnf-5.5 b/dev-db/mysql/files/my.cnf-5.5
new file mode 100644
index 000000000000..83b9aaab2ecc
--- /dev/null
+++ b/dev-db/mysql/files/my.cnf-5.5
@@ -0,0 +1,147 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+#loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
+
diff --git a/dev-db/mysql/files/my.cnf-5.6 b/dev-db/mysql/files/my.cnf-5.6
new file mode 100644
index 000000000000..df462ab69a14
--- /dev/null
+++ b/dev-db/mysql/files/my.cnf-5.6
@@ -0,0 +1,139 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 4M
+table_open_cache = 400
+sort_buffer_size = 512K
+net_buffer_length = 16K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 128M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 48M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/mysql/metadata.xml b/dev-db/mysql/metadata.xml
new file mode 100644
index 000000000000..8e45aa661e8f
--- /dev/null
+++ b/dev-db/mysql/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+<!--
+Please note that this list is shared between the following packages:
+dev-db/mysql
+dev-db/mariadb
+-->
+<use>
+ <flag name="cluster">Add support for NDB clustering (deprecated)</flag>
+ <flag name="community">Enables the community features from upstream.</flag>
+ <flag name="embedded">Build embedded server (libmysqld)</flag>
+ <flag name="extraengine">Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
+ <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
+ <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
+ <flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag>
+ <flag name="max-idx-128">Raise the max index per table limit from 64 to 128</flag>
+ <flag name="minimal">Install client programs only, no server</flag>
+ <flag name="profiling">Add support for statement profiling (requires USE=community).</flag>
+ <flag name="server">Build the server program</flag>
+ <flag name="systemtap">Build support for profiling and tracing using <pkg>dev-util/systemtap</pkg></flag>
+ <flag name="test">Install upstream testsuites for end use.</flag>
+ <flag name="yassl">Enable SSL connections and crypto functions using the bundled yaSSL</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/mysql/mysql-5.5.57.ebuild b/dev-db/mysql/mysql-5.5.57.ebuild
new file mode 100644
index 000000000000..b34282c99920
--- /dev/null
+++ b/dev-db/mysql/mysql-5.5.57.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_EXTRAS_VER="20170719-1630Z"
+MY_PV="${PV//_alpha_pre/-m}"
+MY_PV="${MY_PV//_/-}"
+
+# Build type
+BUILD="cmake"
+#fails to build with ninja
+CMAKE_MAKEFILE_GENERATOR=emake
+
+inherit toolchain-funcs mysql-v2
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# Define the mysql-extras source
+EGIT_REPO_URI="git://anongit.gentoo.org/proj/mysql-extras.git"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+# When MY_EXTRAS is bumped, the index should be revised to exclude these.
+EPATCH_EXCLUDE=''
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="${RDEPEND}"
+
+SLOT="0/18"
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+# Official test instructions:
+# USE='embedded extraengine perl ssl static-libs community' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-X.X.XX.ebuild \
+# digest clean package
+src_test() {
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if ! use "minimal" ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # create symlink for the tests to find mysql_tzinfo_to_sql
+ ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
+
+ # These are failing in MySQL 5.5 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help-notwin
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+
+ for t in main.mysql_client_test main.openssl_1 \
+ binlog.binlog_statement_insert_delayed main.information_schema \
+ main.mysqld--help-notwin main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do
+ mysql-v2_disable_test "$t" "False positives in Gentoo"
+ done
+
+ for t in main.mysql main.mysql_upgrade ; do
+ mysql-v2_disable_test "$t" "Test $t broken upstream - error return value not updated"
+ done
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --testcase-timeout=30 --reorder
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+ has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mysql/mysql-5.6.35.ebuild b/dev-db/mysql/mysql-5.6.35.ebuild
new file mode 100644
index 000000000000..c173b55fdf5e
--- /dev/null
+++ b/dev-db/mysql/mysql-5.6.35.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+MY_EXTRAS_VER="20160212-0233Z"
+MY_PV="${PV//_alpha_pre/-m}"
+MY_PV="${MY_PV//_/-}"
+HAS_TOOLS_PATCH="1"
+SUBSLOT="18"
+
+inherit mysql-multilib-r1
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+# When MY_EXTRAS is bumped, the index should be revised to exclude these.
+EPATCH_EXCLUDE=''
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="${RDEPEND}"
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+# validate_password plugin uses exceptions when it shouldn't yet (until 5.7)
+# disable until we see what happens with it
+MYSQL_CMAKE_NATIVE_DEFINES=( -DWITHOUT_VALIDATE_PASSWORD=1 )
+
+src_prepare() {
+ mysql-multilib-r1_src_prepare
+ if use libressl ; then
+ sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+ "${S}/cmake/ssl.cmake" || die
+ fi
+}
+
+# Official test instructions:
+# USE='server embedded extraengine perl openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if use server ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # create symlink for the tests to find mysql_tzinfo_to_sql
+ ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
+
+ # These are failing in MySQL 5.5/5.6 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # funcs_1.is_triggers funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
+ # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
+ # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
+ # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # rpl.rpl_plugin_load
+ # fails due to included file not listed in expected result
+ # appears to be poor planning
+ #
+ # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+ for t in \
+ binlog.binlog_mysqlbinlog_filter \
+ binlog.binlog_statement_insert_delayed \
+ funcs_1.is_columns_mysql \
+ funcs_1.is_tables_mysql \
+ funcs_1.is_triggers \
+ main.information_schema \
+ main.mysql_client_test \
+ main.mysqld--help-notwin \
+ perfschema.binlog_edge_mix \
+ perfschema.binlog_edge_stmt \
+ rpl.rpl_plugin_load \
+ main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ if ! use extraengine ; then
+ # bug 401673, 530766
+ for t in federated.federated_plugin ; do
+ mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
+ done
+ fi
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # Set file limits higher so tests run
+ ulimit -n 3000
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --suite-timeout=5000 --reorder
+ retstatus_tests=$?
+# [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+# has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+# has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mysql/mysql-5.6.36.ebuild b/dev-db/mysql/mysql-5.6.36.ebuild
new file mode 100644
index 000000000000..3ced3a4395b2
--- /dev/null
+++ b/dev-db/mysql/mysql-5.6.36.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+MY_EXTRAS_VER="20170302-1359Z"
+MY_PV="${PV//_alpha_pre/-m}"
+MY_PV="${MY_PV//_/-}"
+HAS_TOOLS_PATCH="1"
+SUBSLOT="18"
+
+inherit mysql-multilib-r1
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="${RDEPEND}"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/01050_all_mysql_config_cleanup-5.6.patch
+ "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch
+ "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch
+ "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink.patch
+ "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch
+ "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch
+)
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+# validate_password plugin uses exceptions when it shouldn't yet (until 5.7)
+# disable until we see what happens with it
+MYSQL_CMAKE_NATIVE_DEFINES=( -DWITHOUT_VALIDATE_PASSWORD=1 )
+
+src_prepare() {
+ mysql-multilib-r1_src_prepare
+ if use libressl ; then
+ sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+ "${S}/cmake/ssl.cmake" || die
+ fi
+}
+
+# Official test instructions:
+# USE='server embedded extraengine perl openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if use server ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # create symlink for the tests to find mysql_tzinfo_to_sql
+ ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
+
+ # These are failing in MySQL 5.5/5.6 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # funcs_1.is_triggers funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
+ # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
+ # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
+ # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # rpl.rpl_plugin_load
+ # fails due to included file not listed in expected result
+ # appears to be poor planning
+ #
+ # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+ #
+ # main.events_2
+ # Fails on date in past without preserve causing the drop to fail
+
+ for t in \
+ binlog.binlog_mysqlbinlog_filter \
+ binlog.binlog_statement_insert_delayed \
+ funcs_1.is_columns_mysql \
+ funcs_1.is_tables_mysql \
+ funcs_1.is_triggers \
+ main.information_schema \
+ main.mysql_client_test \
+ main.mysqld--help-notwin \
+ perfschema.binlog_edge_mix \
+ perfschema.binlog_edge_stmt \
+ rpl.rpl_plugin_load \
+ main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ main.events_2 \
+ ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ if ! use extraengine ; then
+ # bug 401673, 530766
+ for t in federated.federated_plugin ; do
+ mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
+ done
+ fi
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # Set file limits higher so tests run
+ ulimit -n 3000
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --suite-timeout=5000 --reorder
+ retstatus_tests=$?
+# [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+# has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+# has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mysql/mysql-5.6.37.ebuild b/dev-db/mysql/mysql-5.6.37.ebuild
new file mode 100644
index 000000000000..016e3491ecf1
--- /dev/null
+++ b/dev-db/mysql/mysql-5.6.37.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+MY_EXTRAS_VER="20170719-1335Z"
+MY_PV="${PV//_alpha_pre/-m}"
+MY_PV="${MY_PV//_/-}"
+HAS_TOOLS_PATCH="1"
+SUBSLOT="18"
+#fails to build with ninja
+CMAKE_MAKEFILE_GENERATOR=emake
+
+inherit mysql-multilib-r1
+# only to make repoman happy. it is really set in the eclass
+IUSE="$IUSE"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha amd64 arm ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )"
+RDEPEND="${RDEPEND}"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/01050_all_mysql_config_cleanup-5.6.patch
+ "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-mysql-5.6.35.patch
+ "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch
+ "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch
+ "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch
+ "${MY_PATCH_DIR}"/20018_all_mysql-5.6.25-without-clientlibs-tools.patch
+)
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+# validate_password plugin uses exceptions when it shouldn't yet (until 5.7)
+# disable until we see what happens with it
+MYSQL_CMAKE_NATIVE_DEFINES=( -DWITHOUT_VALIDATE_PASSWORD=1 )
+
+src_prepare() {
+ mysql-multilib-r1_src_prepare
+ if use libressl ; then
+ sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+ "${S}/cmake/ssl.cmake" || die
+ fi
+}
+
+# Official test instructions:
+# USE='server embedded extraengine perl openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild mysql-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ local TESTDIR="${BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if use server ; then
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+ has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # create symlink for the tests to find mysql_tzinfo_to_sql
+ ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
+
+ # These are failing in MySQL 5.5/5.6 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # funcs_1.is_triggers funcs_1.is_tables_mysql,
+ # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
+ # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
+ # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
+ # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # rpl.rpl_plugin_load
+ # fails due to included file not listed in expected result
+ # appears to be poor planning
+ #
+ # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # fails due to bad cleanup of previous tests when run in parallel
+ # The tool is deprecated anyway
+ # Bug 532288
+ #
+ # main.events_2
+ # Fails on date in past without preserve causing the drop to fail
+
+ for t in \
+ binlog.binlog_mysqlbinlog_filter \
+ binlog.binlog_statement_insert_delayed \
+ funcs_1.is_columns_mysql \
+ funcs_1.is_tables_mysql \
+ funcs_1.is_triggers \
+ main.information_schema \
+ main.mysql_client_test \
+ main.mysqld--help-notwin \
+ perfschema.binlog_edge_mix \
+ perfschema.binlog_edge_stmt \
+ rpl.rpl_plugin_load \
+ main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
+ main.events_2 \
+ ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ if ! use extraengine ; then
+ # bug 401673, 530766
+ for t in federated.federated_plugin ; do
+ mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
+ done
+ fi
+
+ for t in main.mysql main.mysql_upgrade ; do
+ mysql-multilib-r1_disable_test "$t" "Test $t broken upstream - error return value not updated"
+ done
+
+ # Run mysql tests
+ pushd "${TESTDIR}"
+
+ # Set file limits higher so tests run
+ ulimit -n 3000
+
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --suite-timeout=5000 --reorder
+ retstatus_tests=$?
+# [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+# has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ popd
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+# has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
+
+ [[ -z "$failures" ]] || die "Test failures: $failures"
+ einfo "Tests successfully completed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
diff --git a/dev-db/mysqltuner/Manifest b/dev-db/mysqltuner/Manifest
new file mode 100644
index 000000000000..20f60a574dee
--- /dev/null
+++ b/dev-db/mysqltuner/Manifest
@@ -0,0 +1,9 @@
+DIST mysqltuner-1.2.0.tar.gz 24562 SHA256 54b743808f7f1d882cc912ffbb62dae57303e3e17f45aefd55a16825c016bc9d SHA512 b38277c31c1a870525f20bc1c023fe9675403834313a65c99c445a5fa1048c7aa3dc8ed5a9a9255c4844bdb001b28ee45be807306d0f1739c170d8ee9e0ab53f WHIRLPOOL 5290f77df91bcb23cc2bbb5097a08df54bc4e32560732ff078005bdd9acdf74a8f76647b893ab600dee4d848a70d6a6923e9806b30fb9504c6d3f5d31067be75
+DIST mysqltuner-1.6.0.tar.gz 53424 SHA256 dc3045b9ffae7837d187d2b1ef4c42648bf7ffc6bb9f69864a4bfeecd5205e37 SHA512 904022ef64eaf75f3294a9a5123dc5e00482d95378722df63140bc6859ec245c32d9b06d19955790a5e29b9335e6da3df2cebdeb4659cb9058561866f6ec69c2 WHIRLPOOL fa1cde57da2eb67ca6524aea6cae58864128ab7beebb9dab779ba6f44b7a38fb1a2b5a6a729f0b0c73e78e8bd61d3519ea0990885e992e00091b178d110cec3a
+DIST mysqltuner-1.6.18.tar.gz 169074 SHA256 ae2b2668198fb78a7685fc4a372bafcef0a91b1dca15d065dae73eeb74bcd6cb SHA512 8067b7ac4a4fe7398ee2cdc463a30042f46972f97680b49912dca46fd1d835989aa4115568dbe5473ff28c4d956bf0ad70537318db788dd56bc93ad220e6bcb6 WHIRLPOOL 0ffe6459f157cc4e7e015dde806f0e5086c546f14c53855b04f61edba3e2e8b4b98a57212d10d48722bb2277041561729b14ec870383df56bd32587fb6275c4b
+EBUILD mysqltuner-1.2.0.ebuild 610 SHA256 3a55849853b9b3ff6a6040d2e681fd9f02c3a4535b84f8e481ed4cb5d0859aac SHA512 1c1b7b88aab98615706e5593d325cdb437028bda1a5d2ee7b82d987e9146c0a7cf8396ff87e7ed96aa90eb9075a4291b19960dd27e50cd8be4284374d5785df4 WHIRLPOOL b3043a963bcf0a423b3fc1bc9456e166ab695ab0ce10958d8b06a0c1560346233da6578a047e9fb0e32bef5de2de7e6824a43208e798a584f8623d8e70ed8249
+EBUILD mysqltuner-1.6.0.ebuild 745 SHA256 8c542d6decc106fde56503ce5b116735559d9cf417e06610c37729bd978a7286 SHA512 2a3d3c301ffe70d15c125e279970d2ee2aa9a28e3f7146a6fc0c6ba15203962c1405839996df9eb0c35ef5ecad23993cc49d7b5645f17611e9b2bfaa83ff3e16 WHIRLPOOL 73527d7cb4e38dc2eebfb1e545aa15e2c15aa5e09b19d912efdfc3274ca0efb89a0ff33ccba0887e5d169a47cdd5728474d4173a3c13cd3c3f8e643c2acd7d5a
+EBUILD mysqltuner-1.6.18.ebuild 821 SHA256 4a25d72e6e76087b6595c70d4fd17fd562c5a6f26306461ff0a13d5fc6feba48 SHA512 0969eb735b46b9d44af586a6347d48af5ea666c569b2d251148e8864e806a4ac393e0a169b29aff546e75cd983014741ae7286ee903799d8c6d2e2663b58fc3a WHIRLPOOL 690102d43d2e9e78e7d7e379a7cf94347a9db8e3f3c91263140efdaebe8febd2eef7b5a51ad20a8916be824d962f5d7e461461f850dd27cbea7541f5082c4f7d
+MISC ChangeLog 2738 SHA256 2997bd82b925a91a296450d23d874d24308356ea09c26cdac91fbf49e04d97fb SHA512 1a26c6ccbdf2a18cac3d9106ccdab01468eac641343cd5624c1a167a9b9fdacd3efaaad53be65edc052649ca084ecdb70ed9a52cb2a5579cec4c3b12da1107a3 WHIRLPOOL 230c27c02696eb10172145a33bd30bdd67b2ca33b6d022b4411739b625e2848c0a13e41312e15e63ad387b2ff57c0c5dcbddccd9fc5ffb74e325cefb4a7b2f35
+MISC ChangeLog-2015 1710 SHA256 685cc8d4e76b7ca7b2991b195e0a672532c3518bc2bba7270b9f47e81131475a SHA512 074a312f34530ded6801078e91e5278c8783f294df28079fd473e00e12d730a6aa89e3a79c2def3dcb49cce0caa937a2c26806c5de868571f8adcfc3be638610 WHIRLPOOL 0601fd729a00c06ad0b386cb6d3f458160a9d4c0e6158cea20859b7e79b6f3441473a603c7b1f96b198b12c10392b122407b04405c4d6db2fa63097d49626b1b
+MISC metadata.xml 329 SHA256 649e148fe151f3a4183ab06c39084bdaca761724522652ae5c1bc8afc1b7094a SHA512 3bf9adc56a18f131c90d2524e83bb1e43a2cf49286e2c4c215cd95f1ff8792e0a4e325a36350a95e187396e0aa39640238ab57f57682c914e97c5663a815275f WHIRLPOOL 0687debb0c0eaa12eeb1b91718cc17958551c178ff971e092148a9835ce49990074653ab6b445ccaed3fc5c5f5050f9910fe9079e362257a76e0eda2b5f5e1aa
diff --git a/dev-db/mysqltuner/metadata.xml b/dev-db/mysqltuner/metadata.xml
new file mode 100644
index 000000000000..b5fa8bce6890
--- /dev/null
+++ b/dev-db/mysqltuner/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="github">major/MySQLTuner-perl</remote-id>
+ <bugs-to>https://github.com/major/MySQLTuner-perl/issues</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysqltuner/mysqltuner-1.2.0.ebuild b/dev-db/mysqltuner/mysqltuner-1.2.0.ebuild
new file mode 100644
index 000000000000..76e32ad535bf
--- /dev/null
+++ b/dev-db/mysqltuner/mysqltuner-1.2.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="MySQLTuner is a high-performance MySQL tuning script"
+HOMEPAGE="http://www.mysqltuner.com"
+SRC_URI="https://github.com/rackerhacker/MySQLTuner-perl/tarball/05813a1faa447fe16c2a7efdab9b22c3bcbc5485 -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6
+ virtual/perl-Getopt-Long
+ >=virtual/mysql-3.23"
+
+S="${WORKDIR}"/rackerhacker-MySQLTuner-perl-05813a1
+
+src_install() {
+ mv "${PN}".pl "${PN}"
+ dobin "${PN}"
+ dodoc README
+}
diff --git a/dev-db/mysqltuner/mysqltuner-1.6.0.ebuild b/dev-db/mysqltuner/mysqltuner-1.6.0.ebuild
new file mode 100644
index 000000000000..8f6371a0c1d7
--- /dev/null
+++ b/dev-db/mysqltuner/mysqltuner-1.6.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN=MySQLTuner-perl
+
+DESCRIPTION="MySQLTuner is a high-performance MySQL tuning script"
+HOMEPAGE="http://www.mysqltuner.com/"
+SRC_URI="https://github.com/major/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6
+ virtual/perl-Getopt-Long
+ >=virtual/mysql-3.23"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_install() {
+ newbin "${PN}.pl" "${PN}"
+
+ # The passwords are meant to be fed to the script uncompressed.
+ docompress -x "/usr/share/doc/${PF}/basic_passwords.txt"
+ dodoc README.* USAGE.md CONTRIBUTING.md INTERNALS.md basic_passwords.txt
+}
diff --git a/dev-db/mysqltuner/mysqltuner-1.6.18.ebuild b/dev-db/mysqltuner/mysqltuner-1.6.18.ebuild
new file mode 100644
index 000000000000..4bb2ed7b6a9b
--- /dev/null
+++ b/dev-db/mysqltuner/mysqltuner-1.6.18.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN=MySQLTuner-perl
+
+DESCRIPTION="MySQLTuner is a high-performance MySQL tuning script"
+HOMEPAGE="http://www.mysqltuner.com/"
+SRC_URI="https://github.com/major/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="dev-lang/perl
+ virtual/perl-Getopt-Long
+ virtual/mysql"
+
+DOCS=( USAGE.md CONTRIBUTING.md INTERNALS.md basic_passwords.txt vulnerabilities.csv )
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_install() {
+ newbin "${PN}.pl" "${PN}"
+
+ # The passwords and vulnerabilities are meant to be fed to the script uncompressed
+ docompress -x "/usr/share/doc/${PF}/basic_passwords.txt" "/usr/share/doc/${PF}/vulnerabilities.csv"
+ einstalldocs
+}
diff --git a/dev-db/mytop/Manifest b/dev-db/mytop/Manifest
new file mode 100644
index 000000000000..9916ece6b76f
--- /dev/null
+++ b/dev-db/mytop/Manifest
@@ -0,0 +1,12 @@
+AUX mytop-1.6-getopt-long-2.38-fixup.patch 578 SHA256 62ccc268d4e04d2476c817e591bcac91c849e08459cf964a4a1724cabbe4fc8a SHA512 a6f6bc9757112acc8cdeeb19e89487ad2ca79524c8d7a577b84c288addc283547837f390a7d7f43317d878e5be796be9d875fd57f548637a3d52aa1cabc5f3a8 WHIRLPOOL 52fd4e99d4e5514922597dc6be7b5c1d7e57b3484dc6f83695dd1ee5a610916314c1a1aa61ce8b0bfb962d8d21d733b3540cd46b4b02e504e594d42e1e5d52e9
+AUX mytop-1.6-global-status.patch 3694 SHA256 ebdbed74ed25213c2be00b86836ba38a45d84e721b60f3f97302fb3b646d1b06 SHA512 bf33682ed457acac751390f757b4b284cf68cae1facdc5d9f3980abae3a3a6580b0558cd114569e79cab2b4ede430fba1c8b426d8b6d500fe0edf833b74d17ab WHIRLPOOL 5d022fc17e2a3c5dbb4b5ff5249030438acad687af9a7df5e3279be9e3f90555567dbda1299274d0b17c926d94c2349ab080a2d479ca7ddee097b7fb481147ac
+AUX mytop-1.6-queries-vs-questions-mysql-5.0.76.patch 3365 SHA256 9ef308336a3cc51721456822d29fb91734e66f75efd3293038b42f0806820297 SHA512 a2735b157b81f702af09d6ee38003e4d15b6f901bc8f5e7013e8c73a1bd9ee798d0ed00ac0578b7e8ef36e5d4ddcc65489325937e9c2074004d2f69fb81fdcfb WHIRLPOOL 5ebe7405ee8bf738900cf8cce1fa61a729fd139965a67aa24101e9de9c67c56627cb64afd13be02e4a701befc09cffe543d0408f832c7f0d2655a2b828b8cdfe
+AUX mytop-1.9.1-global-status.patch 3459 SHA256 744b35b0411e4d1ab93d6725a1c109bd31932d21a4898eb7d8fb401065bbfb50 SHA512 68052535131147a446133fbc155e04e13c5f0195c8fd111059b2bc266aa7a79f72cb25ec1f453e051651783760e212349dc7c50e1de2768d45281d25582a0cc9 WHIRLPOOL e1a0461af27183676a4dbed49866930fcfbe27a3f10d265d7512f7114d2d0478fa146ce84e2af7cf5aee45cb49c1e1e33ef92e0642e05b8578feaba6c2a098bc
+AUX mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch 3431 SHA256 540b1ba6f2c9214580ba1244827c35690ca36adc933f468633d0f7bfe459fcbb SHA512 50f5373dda953ea7ac18aff65b1319999fe0c53471ebef548309e49e2c6f762d5d98f105280a2c58a324731ff3c1c1af123114acf09f6bb3c99e4580e6041473 WHIRLPOOL 444a802b9043c87c0ef14da46f610700ea9f3cdbbbbff2e8a1f72978a1b8c714b74db28bcf4af085843d10e3fe3505327583a06f5c9219cf456452670d521097
+DIST mytop-1.6.tar.gz 19720 SHA256 b17c702598b10bb0ce2695f609122637c799eaaaec1afaa73246b048f07be9bd SHA512 672209d828c70fd740a791f2e4dfac1e4c594adff197b8bc43322249f03f6c7b18a750da0892c1519fe29e24b661e41d40cdad3a29b546dec4b3a747155566e2 WHIRLPOOL 4fd03d2e871db6b56db2fa7f39046f415a668c3732f47c0668f73ab7109048a8872cfdc01704ba4152d92500f2ab5c5c66b8d2e948748e43ab56e508980c3b08
+DIST mytop-1.9.1.tar.gz 22095 SHA256 179d79459d0013ab9cea2040a41c49a79822162d6e64a7a85f84cdc44828145e SHA512 e6d38812dd69f5e330e5fe9206abe7e00c9e08dd61ba52a9dbd18a823bb09715832d27fb8db6fe1146d78eb56845cc0a7e2a72989ee56267d6482238fee84bc5 WHIRLPOOL 8d47b1067639f1d5464e63abb0ec10df2e98c17112f4ba6321849cea3a0a932e58e04edef83e358ae1cea01f9338509c40bf1e21ef8d46f4820c9f6b89f25b2e
+EBUILD mytop-1.6-r4.ebuild 897 SHA256 0dcee25054e9595e3f1cb5e05bf281547a8397326752e577403b81d6d230a6af SHA512 44c4b20f7dd17a0dd0686ce8250ad54d7d508fe94b41bcacbe5391ff003a37854e0d74e2ebee3cc243e8e94ecc8851a637b9615a3ddffa179173fa02685a7c75 WHIRLPOOL 362a5cce83745b4765ebc2c9bf91d0a1dccf4f65cd316488dea8a2ad89aa76d7b436195692ebf2f094429918a377bdc49355a94e0e50cadc7d6827b6db1b2327
+EBUILD mytop-1.9.1.ebuild 825 SHA256 d2393744d985c2d20f3072fe644f6fe92d95c3a090b2a45840525cdd36ac1cd0 SHA512 26d7b172c52e3056184a48feb381462c1094872aa23168cb3f9cdf9c9b69e4756b1313893c53ad1383438e867ecaa889a0a2fc27c33c9ce868c2cd35baf777e6 WHIRLPOOL 1b22d58ceda81b5740517de774b260c349894ee5e208118a97ec66341041d63aecc2361305b536f7321a8b544281a41cca511c7e2d77845c0a3406b4d814125a
+MISC ChangeLog 2570 SHA256 4d378b854e467027bfb7431a4faabe6d5fa85ad01c57ffb9af263806ed2c39c3 SHA512 ca140317a18625ab0a0803e71e4cfd23875dc90cc2573a3c396a91ae278e172159241530e5d25ef6ca609bbd3b3a4bccd3be57e2853ddd179c7db651260295bd WHIRLPOOL c57fde6c0e9bf244e997e5e995372547b608c9aa4722826964f06b57a3dc840fa658ad7477ee99dea8c5f08cdd357befc329873ddf5ba1b0a77cd5cbb3068926
+MISC ChangeLog-2015 4365 SHA256 734dd535a4200b9da391da460833ab78e62fb28ea40846e7774319e2be369b12 SHA512 60e6b4da4b4b8b771a4194c88e9e0110c22475175b4db0bb3aa1435466dab2e90149105ba20859a81e0e681b785fda420bf3b9ae51a4d63aaa89878aebe68bd9 WHIRLPOOL 74cbd63ac729c735c5ea3217edfeca2379a4502cc9ee63bbb223af7db51d35a510cb571e3c1a7b695a9079a032602b2b42bc3bd7b2b4deddeaa9966210a9d522
+MISC metadata.xml 239 SHA256 a35e1476a1677a91f06dd6e4f955fcebc58c3a07f934b5e62fbf801573a5c82b SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b WHIRLPOOL 3ed1945907fa58cbc9997c311d1d0431d481586576ce45b4bc5caf7704ddefe2117305879a97e8021694b86af0d570a34517212b6cc9528224b85e568eee3d75
diff --git a/dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch b/dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch
new file mode 100644
index 000000000000..b911f9067baa
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch
@@ -0,0 +1,14 @@
+Getopt-Long-2.38 is stricter about what it allows.
+
+diff -Nuar mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2009-04-10 00:47:31.007111359 -0700
++++ mytop-1.6/mytop 2009-04-10 00:50:39.875391905 -0700
+@@ -153,7 +153,7 @@
+ "idle|i" => \$config{idle},
+ "resolve|r" => \$config{resolve},
+ "prompt!" => \$config{prompt},
+- "long|!" => \$config{long_nums},
++ "long!" => \$config{long_nums},
+ "mode|m=s" => \$config{mode},
+ "sort=s" => \$config{sort},
+ );
diff --git a/dev-db/mytop/files/mytop-1.6-global-status.patch b/dev-db/mytop/files/mytop-1.6-global-status.patch
new file mode 100644
index 000000000000..ae75ac7867af
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-global-status.patch
@@ -0,0 +1,103 @@
+Use GLOBAL STATUS instead of implicit session status.
+
+As of MySQL-5.0.72, many of the status variables split for session and global
+variants. Importantly, the Com_* and Questions ones did, and this broke the
+statistics at the top of mytop.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+MySQL-Bug: 41131
+MySQL-Bug-URL: http://bugs.mysql.com/bug.php?id=41131
+
+diff -Nuar --exclude '*~' mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2007-02-16 20:57:46.000000000 -0800
++++ mytop-1.6/mytop 2008-11-30 15:18:05.818845253 -0800
+@@ -98,7 +98,7 @@
+ my %qcache = (); ## The query cache--used for full query info support.
+ my %ucache = (); ## The user cache--used for full killing by user
+ my %dbcache = (); ## The db cache. This should be merged at some point.
+-my %statcache = (); ## The show status cache for GetShowStatus()
++my %statcache = (); ## The show global status cache for GetShowStatus()
+
+ my (%STATUS, %OLD_STATUS); # header stuff.
+
+@@ -710,7 +710,7 @@
+ ##
+ if ($config{header})
+ {
+- my @recs = Hashes("show status");
++ my @recs = Hashes("show global status");
+
+ ## if the server died or we lost connectivity
+ if (not @recs)
+@@ -755,7 +755,7 @@
+
+ ## Query Cache info
+ ##
+- ## mysql> show status like 'qcache%';
++ ## mysql> show global status like 'qcache%';
+ ## +-------------------------+----------+
+ ## | Variable_name | Value |
+ ## +-------------------------+----------+
+@@ -1064,7 +1064,7 @@
+
+ sub GetQPS()
+ {
+- my($data) = Hashes('SHOW STATUS LIKE "Questions"');
++ my($data) = Hashes('SHOW GLOBAL STATUS LIKE "Questions"');
+ my $num = $data->{Value};
+
+ if (not defined $questions) ## first time?
+@@ -1126,7 +1126,7 @@
+ }
+
+ # Variable_name and Value pairs come back...
+- my @data = Hashes("SHOW STATUS LIKE 'Com_%'");
++ my @data = Hashes("SHOW GLOBAL STATUS LIKE 'Com_%'");
+ my %cmd_data;
+ my %cmd_delta;
+ my %cmd_pct;
+@@ -1216,7 +1216,7 @@
+ sub GetShowStatus()
+ {
+ Clear() unless $config{batchmode};
+- my @rows = Hashes("SHOW STATUS");
++ my @rows = Hashes("SHOW GLOBAL STATUS");
+
+ printf "%32s %10s %10s\n", 'Counter', 'Total', 'Change';
+ printf "%32s %10s %10s\n", '-------', '-----', '------';
+@@ -1543,7 +1543,7 @@
+
+ And you obviously need access to a MySQL server (version 3.22.x or
+ 3.23.x) with the necessary security to run the I<SHOW PROCESSLIST> and
+-I<SHOW STATUS> commands.
++I<SHOW GLOBAL STATUS> commands.
+
+ If you are a Windows user, using ActiveState's Perl, you can use PPM
+ (the Perl Package Manager) to install the MySQL and Term::ReadKey
+@@ -1599,7 +1599,7 @@
+ notice features from each of them here.
+
+ B<mytop> will connect to a MySQL server and periodically run the
+-I<SHOW PROCESSLIST> and I<SHOW STATUS> commands and attempt to
++I<SHOW PROCESSLIST> and I<SHOW GLOBAL STATUS> commands and attempt to
+ summarize the information from them in a useful format.
+
+ =head2 The Display
+@@ -1817,7 +1817,7 @@
+
+ =item B<c>
+
+-Show "command counters" based on the Com_* values in SHOW STATUS.
++Show "command counters" based on the Com_* values in SHOW GLOBAL STATUS.
+ This is a new feature. Feedback welcome.
+
+ =item B<d>
+@@ -1904,7 +1904,7 @@
+
+ Some performance information is not available when talking to a
+ version 3.22.x MySQL server. Additional information (about threads
+-mostly) was added to the output of I<SHOW STATUS> in MySQL 3.23.x and
++mostly) was added to the output of I<SHOW GLOBAL STATUS> in MySQL 3.23.x and
+ B<mytop> makes use of it. If the information is not available, you
+ will simply see zeros where the real numbers should be.
+
diff --git a/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch b/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch
new file mode 100644
index 000000000000..f1e139fe7471
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch
@@ -0,0 +1,72 @@
+In MySQL 5.0.72 the Questions variable was changed to only contain the number
+of client-initiated queries, NOT the number of overall queries. This caused
+problems with the select/insert/update/delete percentages because Com_* was
+still based on the overall queries.
+
+MySQL 5.0.76 introduced a new variable 'Queries' with the behavior of the old
+Questions variable.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+MySQL-Bug: 41131
+MySQL-Bug-URL: http://bugs.mysql.com/?id=41131
+
+====
+Revision 2:
+The first revision missed changing the instances of $OLD_STATUS{Questions}.
+
+diff -Nuar mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2009-02-14 17:28:38.696187159 -0800
++++ mytop-1.6/mytop 2009-02-14 17:36:31.192890507 -0800
+@@ -800,8 +800,15 @@
+
+ ## Queries per second...
+
+- my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Questions} / $STATUS{Uptime});
+- my $num_queries = $STATUS{Questions};
++ my ($num_queries, $old_num_queries);
++ if(defined($STATUS{Queries})) {
++ $num_queries = $STATUS{Queries};
++ $old_num_queries = $OLD_STATUS{Queries};
++ } else {
++ $num_queries = $STATUS{Questions};
++ $old_num_queries = $OLD_STATUS{Questions};
++ }
++ my $avg_queries_per_sec = sprintf("%.2f", $num_queries / $STATUS{Uptime});
+
+ my @t = localtime(time);
+
+@@ -820,25 +827,25 @@
+
+
+ printf " Queries: %-5s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n",
+- make_short( $STATUS{Questions} ), # q total
+- $STATUS{Questions} / $STATUS{Uptime}, # qps, average
++ make_short( $num_queries ), # q total
++ $num_queries / $STATUS{Uptime}, # qps, average
+ make_short( $STATUS{Slow_queries} ), # slow
+
+ # hmm. a Qcache hit is really a select and should be counted.
+- 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $STATUS{Questions},
+- 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $STATUS{Questions},
+- 100 * ($STATUS{Com_update} ) / $STATUS{Questions},
+- 100 * $STATUS{Com_delete} / $STATUS{Questions};
++ 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $num_queries,
++ 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $num_queries,
++ 100 * ($STATUS{Com_update} ) / $num_queries,
++ 100 * $STATUS{Com_delete} / $num_queries;
+
+ $lines_left--;
+
+ if ($t_delta)
+ {
+- my $q_diff = ( $STATUS{Questions} - $OLD_STATUS{Questions} );
+-# print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $t_delta = $q_diff\n");
++ my $q_diff = ( $num_queries - $old_num_queries );
++# print("q_diff: $num_queries - $old_num_queries / $t_delta = $q_diff\n");
+
+ printf(" qps now: %4.0f Slow qps: %3.1f Threads: %4.0f (%4.0f/%4.0f) %02.0f/%02.0f/%02.0f/%02.0f \n",
+- ( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta,
++ ( $num_queries - $old_num_queries ) / $t_delta,
+ ( # slow now (qps)
+ ($STATUS{Slow_queries} ) ?
+ ( $STATUS{Slow_queries} - $OLD_STATUS{Slow_queries} ) / $t_delta :
diff --git a/dev-db/mytop/files/mytop-1.9.1-global-status.patch b/dev-db/mytop/files/mytop-1.9.1-global-status.patch
new file mode 100644
index 000000000000..ae0163c31af4
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.9.1-global-status.patch
@@ -0,0 +1,94 @@
+Use GLOBAL STATUS instead of implicit session status.
+
+As of MySQL-5.0.72, many of the status variables split for session and global
+variants. Importantly, the Com_* and Questions ones did, and this broke the
+statistics at the top of mytop.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+MySQL-Bug: 41131
+MySQL-Bug-URL: http://bugs.mysql.com/bug.php?id=41131
+
+diff -Nuar --exclude '*~' mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2007-02-16 20:57:46.000000000 -0800
++++ mytop-1.6/mytop 2008-11-30 15:18:05.818845253 -0800
+@@ -98,7 +98,7 @@
+ my %qcache = (); ## The query cache--used for full query info support.
+ my %ucache = (); ## The user cache--used for full killing by user
+ my %dbcache = (); ## The db cache. This should be merged at some point.
+-my %statcache = (); ## The show status cache for GetShowStatus()
++my %statcache = (); ## The show global status cache for GetShowStatus()
+
+ my (%STATUS, %OLD_STATUS); # header stuff.
+
+@@ -755,7 +755,7 @@
+
+ ## Query Cache info
+ ##
+- ## mysql> show status like 'qcache%';
++ ## mysql> show global status like 'qcache%';
+ ## +-------------------------+----------+
+ ## | Variable_name | Value |
+ ## +-------------------------+----------+
+@@ -1064,7 +1064,7 @@
+
+ sub GetQPS()
+ {
+- my($data) = Hashes('SHOW STATUS LIKE "Questions"');
++ my($data) = Hashes('SHOW GLOBAL STATUS LIKE "Questions"');
+ my $num = $data->{Value};
+
+ if (not defined $questions) ## first time?
+@@ -1126,7 +1126,7 @@
+ }
+
+ # Variable_name and Value pairs come back...
+- my @data = Hashes("SHOW STATUS LIKE 'Com_%'");
++ my @data = Hashes("SHOW GLOBAL STATUS LIKE 'Com_%'");
+ my %cmd_data;
+ my %cmd_delta;
+ my %cmd_pct;
+@@ -1216,7 +1216,7 @@
+ sub GetShowStatus()
+ {
+ Clear() unless $config{batchmode};
+- my @rows = Hashes("SHOW STATUS");
++ my @rows = Hashes("SHOW GLOBAL STATUS");
+
+ printf "%32s %10s %10s\n", 'Counter', 'Total', 'Change';
+ printf "%32s %10s %10s\n", '-------', '-----', '------';
+@@ -1543,7 +1543,7 @@
+
+ And you obviously need access to a MySQL server (version 3.22.x or
+ 3.23.x) with the necessary security to run the I<SHOW PROCESSLIST> and
+-I<SHOW STATUS> commands.
++I<SHOW GLOBAL STATUS> commands.
+
+ If you are a Windows user, using ActiveState's Perl, you can use PPM
+ (the Perl Package Manager) to install the MySQL and Term::ReadKey
+@@ -1599,7 +1599,7 @@
+ notice features from each of them here.
+
+ B<mytop> will connect to a MySQL server and periodically run the
+-I<SHOW PROCESSLIST> and I<SHOW STATUS> commands and attempt to
++I<SHOW PROCESSLIST> and I<SHOW GLOBAL STATUS> commands and attempt to
+ summarize the information from them in a useful format.
+
+ =head2 The Display
+@@ -1817,7 +1817,7 @@
+
+ =item B<c>
+
+-Show "command counters" based on the Com_* values in SHOW STATUS.
++Show "command counters" based on the Com_* values in SHOW GLOBAL STATUS.
+ This is a new feature. Feedback welcome.
+
+ =item B<d>
+@@ -1904,7 +1904,7 @@
+
+ Some performance information is not available when talking to a
+ version 3.22.x MySQL server. Additional information (about threads
+-mostly) was added to the output of I<SHOW STATUS> in MySQL 3.23.x and
++mostly) was added to the output of I<SHOW GLOBAL STATUS> in MySQL 3.23.x and
+ B<mytop> makes use of it. If the information is not available, you
+ will simply see zeros where the real numbers should be.
+
diff --git a/dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch b/dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch
new file mode 100644
index 000000000000..0314c8ac82b2
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch
@@ -0,0 +1,73 @@
+In MySQL 5.0.72 the Questions variable was changed to only contain the number
+of client-initiated queries, NOT the number of overall queries. This caused
+problems with the select/insert/update/delete percentages because Com_* was
+still based on the overall queries.
+
+MySQL 5.0.76 introduced a new variable 'Queries' with the behavior of the old
+Questions variable.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+MySQL-Bug: 41131
+MySQL-Bug-URL: http://bugs.mysql.com/?id=41131
+
+====
+Revision 2:
+The first revision missed changing the instances of $OLD_STATUS{Questions}.
+
+diff -Nuar mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2009-02-14 17:28:38.696187159 -0800
++++ mytop-1.6/mytop 2009-02-14 17:36:31.192890507 -0800
+@@ -800,8 +800,15 @@
+
+ ## Queries per second...
+
+- my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Questions} / $STATUS{Uptime});
+- my $num_queries = $STATUS{Questions};
++ my ($num_queries, $old_num_queries);
++ if(defined($STATUS{Queries})) {
++ $num_queries = $STATUS{Queries};
++ $old_num_queries = $OLD_STATUS{Queries};
++ } else {
++ $num_queries = $STATUS{Questions};
++ $old_num_queries = $OLD_STATUS{Questions};
++ }
++ my $avg_queries_per_sec = sprintf("%.2f", $num_queries / $STATUS{Uptime});
+
+ my @t = localtime(time);
+
+@@ -924,26 +924,26 @@
+
+
+ printf " Queries: %-6s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n",
+- make_short( $STATUS{Questions} ), # q total
+- $STATUS{Questions} / $STATUS{Uptime}, # qps, average
++ make_short( $num_queries ), # q total
++ $num_queries / $STATUS{Uptime}, # qps, average
+ make_short( $STATUS{Slow_queries} ), # slow
+
+ # hmm. a Qcache hit is really a select and should be counted.
+- 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $STATUS{Questions},
+- 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $STATUS{Questions},
+- 100 * ($STATUS{Com_update} ) / $STATUS{Questions},
+- 100 * $STATUS{Com_delete} / $STATUS{Questions};
++ 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $num_queries,
++ 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $num_queries,
++ 100 * ($STATUS{Com_update} ) / $num_queries,
++ 100 * $STATUS{Com_delete} / $num_queries;
+
+ $lines_left--;
+
+ if ($t_delta)
+ {
+- my $q_diff = ( $STATUS{Questions} - $OLD_STATUS{Questions} );
+-# print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $t_delta = $q_diff\n");
++ my $q_diff = ( $num_queries - $old_num_queries );
++# print("q_diff: $num_queries - $old_num_queries / $t_delta = $q_diff\n");
+
+ printf(" Sorts: %5.0f qps now: %4.0f Slow qps: %3.1f Threads: %4.0f (%4.0f/%4.0f) %02.0f/%02.0f/%02.0f/%02.0f \n",
+ ( $STATUS{Sort_rows} - $OLD_STATUS{Sort_rows} ) / $t_delta,
+- ( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta,
++ ( $num_queries - $old_num_queries ) / $t_delta,
+ ( # slow now (qps)
+ ($STATUS{Slow_queries} ) ?
+ ( $STATUS{Slow_queries} - $OLD_STATUS{Slow_queries} ) / $t_delta :
diff --git a/dev-db/mytop/metadata.xml b/dev-db/mytop/metadata.xml
new file mode 100644
index 000000000000..709689b06053
--- /dev/null
+++ b/dev-db/mytop/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/mytop/mytop-1.6-r4.ebuild b/dev-db/mytop/mytop-1.6-r4.ebuild
new file mode 100644
index 000000000000..306d8d7102e1
--- /dev/null
+++ b/dev-db/mytop/mytop-1.6-r4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit perl-module
+
+DESCRIPTION="mytop - a top clone for mysql"
+HOMEPAGE="http://jeremy.zawodny.com/mysql/mytop/"
+SRC_URI="http://jeremy.zawodny.com/mysql/mytop/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+KEYWORDS="alpha amd64 ppc sparc x86"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-perl/DBD-mysql
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4"
+
+PATCHES=( "${FILESDIR}/${PN}-1.6-global-status.patch"
+ "${FILESDIR}/${PN}-1.6-queries-vs-questions-mysql-5.0.76.patch"
+ "${FILESDIR}/${PN}-1.6-getopt-long-2.38-fixup.patch"
+ )
+SRC_TEST="do"
+
+src_install() {
+ perl-module_src_install
+ sed -i -r\
+ -e "s|socket( +)=> '',|socket\1=> '/var/run/mysqld/mysqld.sock',|g" \
+ "${D}"/usr/bin/mytop
+}
diff --git a/dev-db/mytop/mytop-1.9.1.ebuild b/dev-db/mytop/mytop-1.9.1.ebuild
new file mode 100644
index 000000000000..050fb8117112
--- /dev/null
+++ b/dev-db/mytop/mytop-1.9.1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit perl-module
+
+DESCRIPTION="mytop - a top clone for mysql"
+HOMEPAGE="http://www.mysqlfanboy.com/mytop-3/"
+SRC_URI="http://www.mysqlfanboy.com/mytop-3/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-perl/DBD-mysql
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4"
+
+PATCHES=( "${FILESDIR}/${PN}-1.9.1-global-status.patch"
+ "${FILESDIR}/${PN}-1.9.1-queries-vs-questions-mysql-5.0.76.patch"
+ )
+SRC_TEST="do"
+
+src_install() {
+ perl-module_src_install
+ sed -i -r\
+ -e "s|socket( +)=> '',|socket\1=> '/var/run/mysqld/mysqld.sock',|g" \
+ "${D}"/usr/bin/mytop
+}
diff --git a/dev-db/ocp/Manifest b/dev-db/ocp/Manifest
new file mode 100644
index 000000000000..e229db3621e8
--- /dev/null
+++ b/dev-db/ocp/Manifest
@@ -0,0 +1,4 @@
+DIST ocp-0.2.tar.gz 144968 SHA256 d6afd26d5342ecb8444a610e21822c926f1af8e3b65ec0d3c0f0bf8a35bde39a SHA512 0ff132a368a615c2a8e8ecb391da138ce9fd52d638de82e5a4d1c9ec3340b117c9c4d8f971ee86724664f93b4073b189407c3c19a0c22c961922145d30221c85 WHIRLPOOL a21b575e668336b62b2fae418faa28bfd80e6f187dbdac2e150a458985ff940289e24fcd556e5fc0f48c6dccce27549772b6594a095d2eff940dd458215a41d1
+EBUILD ocp-0.2.ebuild 732 SHA256 2c964403464ffa466441c3e0db6fbc35bf8dcd68436762f9a082291b5c91e13f SHA512 447f0a33d07797e6dd5fbe5fc7f62ddbe853e4d038f5ba1da148c92311d38ba19289c17166c5f4a9fafacb7e22eb4ecbfafe60dfff18cfbc6ccfae29c73c287a WHIRLPOOL 0bef46084adc3c2d773f3c9beb99b03b10bfd68d39a2e45061dcfe6aac1b721622c37fee37986bab00878df732b9593e0fea8244461ae7ee3d70eb7265de0049
+EBUILD ocp-9999.ebuild 648 SHA256 d2c10bff48857c30721840eb13d2957b935bb40816859beb75bd1e088fe59b78 SHA512 7163ce5d60b0961e517f5cb19c344c35fb052f2a6524522bec6657d1816a8f0ea48eaf085b833e4ced42a5e2f369c0377081bebef73caae5be10d1203d1e6101 WHIRLPOOL 8c7ca3b45e8c31fb69d7285abb79c06e86114aa59d4e50dc6e009d72431f8c786176a0734d72f7a0e1916a6d49c8f0b5ae35b9548dbb0726b90d983d08293411
+MISC metadata.xml 614 SHA256 755e4550dc977e6c651cd68f48a44a3accd7cad7f420d4a11493e691f66650df SHA512 33281a9bb09cfd13ecae433df9612587d56befe35f81e50d88164b0b4caf997f404c613ae456b497fc934fae9b4837846a18a2cf714c49bbc0b0b6eb920fa77d WHIRLPOOL 32fb2a6b9faa077409e40a4336c233b2277667161b90a0ca0c0b32d17bd94e8dd9ecfaf66790cb94cbc7554a2d8043bd018725b8d62193d08d437cb2136d41fc
diff --git a/dev-db/ocp/metadata.xml b/dev-db/ocp/metadata.xml
new file mode 100644
index 000000000000..1d5044264397
--- /dev/null
+++ b/dev-db/ocp/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>maksym.satula@gmail.com</email>
+ <name>Max Satula</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://github.com/maxsatula/ocp/issues</bugs-to>
+ </upstream>
+ <longdescription lang="en">A tool for downloading and uploading files from/to Oracle Database directories using Oracle SQL Net connection only</longdescription>
+</pkgmetadata>
diff --git a/dev-db/ocp/ocp-0.2.ebuild b/dev-db/ocp/ocp-0.2.ebuild
new file mode 100644
index 000000000000..3745af1f5a87
--- /dev/null
+++ b/dev-db/ocp/ocp-0.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic
+
+DESCRIPTION="Oracle copy tool"
+HOMEPAGE="https://github.com/maxsatula/ocp"
+
+if [[ ${PV} == *9999 ]]; then
+ EGIT_REPO_URI="https://github.com/maxsatula/ocp.git"
+ EGIT_BRANCH="develop"
+ inherit git-r3 autotools
+else
+ SRC_URI="https://github.com/maxsatula/ocp/releases/download/v${PV}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+ dev-db/oracle-instantclient-basic
+ dev-libs/popt
+ sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == *9999 ]] ; then
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ append-ldflags $(no-as-needed)
+ default
+}
diff --git a/dev-db/ocp/ocp-9999.ebuild b/dev-db/ocp/ocp-9999.ebuild
new file mode 100644
index 000000000000..baab9a6071ec
--- /dev/null
+++ b/dev-db/ocp/ocp-9999.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Oracle copy tool"
+HOMEPAGE="https://github.com/maxsatula/ocp"
+
+if [[ ${PV} == *9999 ]]; then
+ EGIT_REPO_URI="https://github.com/maxsatula/ocp.git"
+ EGIT_BRANCH="develop"
+ inherit git-r3 autotools
+else
+ SRC_URI="https://github.com/maxsatula/ocp/releases/download/v${PV}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+ dev-db/oracle-instantclient-basic
+ dev-libs/popt
+ sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == *9999 ]] ; then
+ eautoreconf
+ fi
+}
diff --git a/dev-db/odbtp/Manifest b/dev-db/odbtp/Manifest
new file mode 100644
index 000000000000..d4de3ee78563
--- /dev/null
+++ b/dev-db/odbtp/Manifest
@@ -0,0 +1,6 @@
+AUX odbtp-1.1.4-amd64.patch 331 SHA256 edf3f9ccfef247a37e8994895bb317481aed0266c663245c26629593ae5ae8b1 SHA512 e2f9f6874ce9b40ba0c3e4d0619af8ade796fe5e03e25ff93d1bd94d2c43bcf8212d9dd4ebf9ff3fd462231cff6d7c59a755a9e5a58cc8de49e4e326950deaa7 WHIRLPOOL a56708836e6d4997a2e98389248c64ff6fc80752d754f75ac1da36a3510b376d345d8cb8dc4cecf2dd65c5ba3503a6f1a0f78f8d84ca488b9b6902e499a18e44
+DIST odbtp-1.1.4.tar.gz 1049975 SHA256 c4f4e0b01610d0e547dfe70e9e2184fc35c8944a44be6a70ec8c8fc28dffe705 SHA512 4b87c8733fc1f017546024901874b0ea2f410646ef39f9581cc170773639077c3f885813550422966e8797489c66b32b75de85fa658e3bb84da285b96c0a7b70 WHIRLPOOL b5443d5639e9d1f938d3708153cdc10a92ba6c2f8e4a1615c897ac05aebb88d59903ddde59092130373abcf8daefe59086c6eac9f686dce753be03cd68012d4a
+EBUILD odbtp-1.1.4.ebuild 832 SHA256 d33e28d7e3b0fc0722f2527aa8d8a8d4e01d3d5f0699421653f2fad66a37fb20 SHA512 758fcdd2027c7ab006a7840b403d9eed00a1f466b8ad260050a03e0dbb2e4a4c4cd4b311135852360254a1ec43d097881d56d7b143e8839e1569d256d6705b90 WHIRLPOOL 051b43273fbe6f9b484dbb60a2455ef77ace0d8e1496b74dd81a975fe6f7bb3c1f0d6ed681c57d93df5e59b5c653545507af35d124b57bea60ca9ae1117efda5
+MISC ChangeLog 2546 SHA256 8ca5e60d5179f8d67aba7b4c647632f8d6e9b20db9ed3063f728ea0416393048 SHA512 8e00ab4596312bfdef3c780cf33d562d44caf20b894efb5bb22a147b9ee4d11878a617efc02aff93c7e5a9f2408ae677bcf59039599a4eb038cd2c22a92c7061 WHIRLPOOL 90bd9b2719207fdb9f01d047898729f85c70f746d343580a82fe73ff23299f23049cde5f013d8944c30492596a1f7895d69e210c981ea727e43befa8799ba92e
+MISC ChangeLog-2015 1169 SHA256 5eae8e9edb75d8cc390c8927e139ec74d33e113253e26b561d7420dd930d4c48 SHA512 391aea5feadd6253cada57950cc25fefbfa8c295369a63d5753e70c50e4309fdf8e98846203ac23904ab8a77b2b8f33dcfa8f89765b4e3570ae2cd9944c93598 WHIRLPOOL f96a7ad5f648fc1a3f8eea07139e4b38d9f985a8ce1de563b8bcbbc6660d71984e04af1e8b7cf3235525cf7a7307ea2ba6d28760ff06fe2769a30a4c08c7f102
+MISC metadata.xml 242 SHA256 e315086005687564a7f9953d3161b8a44617d7ba4b06d23fd35c6271258a2490 SHA512 283656b4ec20f636e1ee18de3c598a3100abb2862c7117da8c5fe9ea47b63c1b47fc17ca11313164d5b1e341e4480b5841271ea35236652fbb3f971fef2c51ec WHIRLPOOL 1b26f8679684eff7244571e6ecdd88eb528cbf61c13ca7675f201117c9d7ebedb3f9a09d64cd40e1c29cdfadbe83bc3b0e1efa83c1f9627cb909003968d3ee77
diff --git a/dev-db/odbtp/files/odbtp-1.1.4-amd64.patch b/dev-db/odbtp/files/odbtp-1.1.4-amd64.patch
new file mode 100644
index 000000000000..1ba2cb3b71e5
--- /dev/null
+++ b/dev-db/odbtp/files/odbtp-1.1.4-amd64.patch
@@ -0,0 +1,11 @@
+--- odbtp-1.1.4/odbtp.h.old 2006-11-05 21:29:33.000000000 +0100
++++ odbtp-1.1.4/odbtp.h 2006-11-05 21:29:44.000000000 +0100
+@@ -22,7 +22,7 @@
+ #define _ODBTP_H_
+
+ /* The below line must be uncommented for 64-bit systems, such as Tru64. */
+-/* #define _C_LONG_64_ 1 */
++#define _C_LONG_64_ 1
+
+ #define ODBTP_LIB_VERSION "1.1.4"
+
diff --git a/dev-db/odbtp/metadata.xml b/dev-db/odbtp/metadata.xml
new file mode 100644
index 000000000000..c5e963f21d42
--- /dev/null
+++ b/dev-db/odbtp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="sourceforge">odbtp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/odbtp/odbtp-1.1.4.ebuild b/dev-db/odbtp/odbtp-1.1.4.ebuild
new file mode 100644
index 000000000000..03bf137759ef
--- /dev/null
+++ b/dev-db/odbtp/odbtp-1.1.4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Fast, efficient TCP/IP protocol for connecting to Win32-based databases"
+HOMEPAGE="http://odbtp.sourceforge.net/"
+SRC_URI="mirror://sourceforge/odbtp/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Patch according to the README.64bitOS
+ use amd64 && epatch "${FILESDIR}/${P}-amd64.patch"
+}
+
+src_compile() {
+ # respect $CC (bug #243768)
+ tc-export CC
+ econf || die "econf failed"
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ # Install various documentation
+ dodoc AUTHORS INSTALL NEWS README*
+ if use doc ; then
+ dohtml -r docs/*
+ fi
+}
diff --git a/dev-db/opendbx/Manifest b/dev-db/opendbx/Manifest
new file mode 100644
index 000000000000..2b7dd7a8d163
--- /dev/null
+++ b/dev-db/opendbx/Manifest
@@ -0,0 +1,9 @@
+DIST libopendbx-1.5.0.tar.gz 583894 SHA256 1a274939847c3b3d3614c19cad86539007737c60ba0d7259614a0967b1fd71d9 SHA512 7e4e9b8c62fd981276f6747f8184d7e34d743b866bfd76c8126a16371b50dc682177fd563212333d2dbebe2128d0b1527fc69029833329ba8cc0311308fa9bb5 WHIRLPOOL c5a933fcbffe6f7c7589a43d7f4148375b30d81d7221a0148bece6f3d3f1ea490fade6b8c160f4db0576ada31aab00a69d828418e67f2c8b0b4df6f31fcf184b
+DIST opendbx-1.4.5.tar.gz 582915 SHA256 206c998f370d1677a5692a64941470205dc6cd8ad95be1af6b033df50a6431cd SHA512 e46289f9a7eb8b6e4084863834f8c4ca080eb3343b5f9d5837c476bab0a39e798a6364c8648f9fb53e52ab60cae57749b9f7e9bd23cb95b8ff21160f1bf4247e WHIRLPOOL 0a518ee0993447c67731141bc105ff5c082cb434c575a64b3df53614ffc6a72e8734b2720ffa46697b52e81e544e4a3752517059b534faae5698060af71bc5ef
+DIST opendbx-1.4.6.tar.gz 587514 SHA256 2246a03812c7d90f10194ad01c2213a7646e383000a800277c6fb8d2bf81497c SHA512 dd6d53d29157057dbf4e273fd82c7694e8bc626d3409d6ab9c25627a0fec96418326550fa8004b5341facdc4cd8aae12516224e8bb84e2562482885780ff0e55 WHIRLPOOL b66761e99e04119f2aaefa071c8a35a9f0af84a012e7e2f908eb9fefc9bae99a26a9942c1adf3e5dc6061ff78fb4ae0d0397bebcb709ea10c7a7797f95f03aad
+EBUILD opendbx-1.4.5-r1.ebuild 1671 SHA256 b9326472f336172bf2f6ac4d62fa54fc6f9f8d88bd52751886fa89644bd56117 SHA512 e479ad53353f20a262c0110b0f6806f724e33ee52327ba4b7f0d0550ccbea0a81904cfa1ab762016bc5d9824555dd08d6ddb2107d2011def94e1bdc6bc9ec8d1 WHIRLPOOL 3e4330a5519da2655c319b9491f428d50dfc45040943bdfbcf8f1d1a2d8b1d3b556579de98d7954711ad1a9250718637ba9016452b9c81aea2507aa43ae50135
+EBUILD opendbx-1.4.6-r1.ebuild 1746 SHA256 ff00a0661f322eb9d0e15ededb8c457dd5b65267cca0f91521ac40a8aa29f887 SHA512 338e2fdb65758fa587295751731f385ddeb88abcc8f8f9ac95445c608311e958ffcba3579ee5e98f27ce5681b3c38c26864be7c6736f5049bfe06f3b0d6c1739 WHIRLPOOL 94693deab1e2536219bf4ba8c291a25f53bd05954905a1db0caf3eb5c14639705a7e831a890ef19b942ad5302f337ddee920fffd8d859c43ced48e09aa950594
+EBUILD opendbx-1.5.0-r1.ebuild 1814 SHA256 a3bdcb56464c7e39ea3aabe8422454091daf97c8cc1e9a1deeff765ec971bc7c SHA512 2e79653ab9fd037e1871c16b7f26857b759fc5d29cd3899feb17b7523f8342d5a5fa00a084c85f06e47448f6a7ced0ad08e922b769deeb7b4ac733556da3e842 WHIRLPOOL 1aead02bb0ba7a3ef4a1482f570a50b0ae59dc60a1ed884b130e4a2399ce94b4e9b769ad8221ef434f0a82ba484643f78969377915b3406298a020a34d7e9d34
+MISC ChangeLog 2298 SHA256 b5c0618d734d7296fb50b7e4b94c4f93c231b6b026eff0462ef201daf4be992c SHA512 da0fb07235ac2e36837606b08cf496d10d0561b52b691eec8ff3c9a415e49e31aa258610b7e7ed2aa1711a3e4cf233af741ceeb57a9a4757963bcacd90687b58 WHIRLPOOL 2af8f41bd90ce7fadea4ffaa5f2ad457e5f866daac3d9275254f70d3c8529ae0724c75a616021b40f5b14d895b47eda1f114d21ba47cba31501973fe43f9190c
+MISC ChangeLog-2015 7379 SHA256 88075e92c052e60aee7e104df02945060e3c1fa0ca3a304e841d4e9d3d0a009e SHA512 74880d936be29432c7b2b28b8d4cb5da43399b4174b4034287f07d859ddffe2d8affd94d3d10bfddb0d8c31b0df44367fa323c5e9e15bd49505b8727c7142b9f WHIRLPOOL 7fcebdf586295e09b56c67a0d95105edecef5b64c73df6f6423c3b820751b991d7a698b102ac4a6387d4a0b2830e8c0cba505fda98aa1b9b51ed562569cd88ed
+MISC metadata.xml 243 SHA256 ad9965d2353043921009d62dde09f7c11b5f66827bd178bdc9674eda8979a236 SHA512 2bbd30d145173aa1c10a47ec43bfc1f6b1aeda4b25ec40e534d08a35fc9a63ba9ba7826204cf4d561566ea0678f2d865cb7a947814f5e5e436a839d750f2db2e WHIRLPOOL 8f61a3695993d9e5021aa7581f4622253b7e16cfed725342159574818ce84df723a55ecf6ee15351ac6cdd6c34ef95da99bc36d2e7496f85b959d881c1dea091
diff --git a/dev-db/opendbx/metadata.xml b/dev-db/opendbx/metadata.xml
new file mode 100644
index 000000000000..92db6f744243
--- /dev/null
+++ b/dev-db/opendbx/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>alicef@gentoo.org</email>
+ <name>Alice Ferrazzi</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/opendbx/opendbx-1.4.5-r1.ebuild b/dev-db/opendbx/opendbx-1.4.5-r1.ebuild
new file mode 100644
index 000000000000..a2ecfee58acd
--- /dev/null
+++ b/dev-db/opendbx/opendbx-1.4.5-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit flag-o-matic multilib
+
+DESCRIPTION="OpenDBX - A database abstraction layer"
+HOMEPAGE="http://www.linuxnetworks.de/doc/index.php/OpenDBX"
+SRC_URI="http://www.linuxnetworks.de/opendbx/download/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="firebird +mysql oracle postgres sqlite"
+RESTRICT="firebird? ( bindist )"
+
+DEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql:* )
+ sqlite? ( dev-db/sqlite:3 )
+ oracle? ( dev-db/oracle-instantclient-basic )
+ firebird? ( dev-db/firebird )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ if ! ( use firebird || use mysql || use oracle || use postgres || use sqlite )
+ then
+ ewarn "You should enable at least one of the following USE flags:"
+ ewarn "firebird, mysql, oracle, postgres or sqlite"
+ fi
+
+ if use oracle && [[ ! -d ${ORACLE_HOME} ]]
+ then
+ die "Oracle support requested, but ORACLE_HOME not set to a valid directory!"
+ fi
+
+ use mysql && append-cppflags -I/usr/include/mysql
+ use firebird && append-cppflags -I/opt/firebird/include
+ use oracle && append-ldflags -L"${ORACLE_HOME}"/lib
+}
+
+src_configure() {
+ local backends=""
+
+ use firebird && backends="${backends} firebird"
+ use mysql && backends="${backends} mysql"
+ use oracle && backends="${backends} oracle"
+ use postgres && backends="${backends} pgsql"
+ use sqlite && backends="${backends} sqlite3"
+
+ econf --with-backends="${backends}"
+}
+
+src_compile() {
+ # bug #322221
+ emake -j1
+}
+
+src_install() {
+ emake -j1 install DESTDIR="${D}"
+ dodoc AUTHORS ChangeLog README
+
+ rm -f "${D}"/usr/$(get_libdir)/opendbx/*.{a,la}
+}
diff --git a/dev-db/opendbx/opendbx-1.4.6-r1.ebuild b/dev-db/opendbx/opendbx-1.4.6-r1.ebuild
new file mode 100644
index 000000000000..bdfc3aed5685
--- /dev/null
+++ b/dev-db/opendbx/opendbx-1.4.6-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit flag-o-matic multilib
+
+DESCRIPTION="OpenDBX - A database abstraction layer"
+HOMEPAGE="http://www.linuxnetworks.de/doc/index.php/OpenDBX"
+SRC_URI="http://www.linuxnetworks.de/opendbx/download/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="firebird +mysql oracle postgres sqlite"
+RESTRICT="firebird? ( bindist )"
+
+DEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql:* )
+ sqlite? ( dev-db/sqlite:3 )
+ oracle? ( dev-db/oracle-instantclient-basic )
+ firebird? ( dev-db/firebird )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ if ! ( use firebird || use mysql || use oracle || use postgres || use sqlite )
+ then
+ ewarn "You should enable at least one of the following USE flags:"
+ ewarn "firebird, mysql, oracle, postgres or sqlite"
+ fi
+
+ if use oracle && [[ ! -d ${ORACLE_HOME} ]]
+ then
+ die "Oracle support requested, but ORACLE_HOME not set to a valid directory!"
+ fi
+
+ use mysql && append-cppflags -I/usr/include/mysql
+ use firebird && append-cppflags -I/opt/firebird/include
+ use oracle && append-ldflags -L"${ORACLE_HOME}"/lib
+}
+
+src_configure() {
+ local backends=""
+
+ use firebird && backends="${backends} firebird"
+ use mysql && backends="${backends} mysql"
+ use oracle && backends="${backends} oracle"
+ use postgres && backends="${backends} pgsql"
+ use sqlite && backends="${backends} sqlite3"
+
+ econf --with-backends="${backends}" || die "econf failed"
+}
+
+src_compile() {
+ # bug #322221
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ emake -j1 install DESTDIR="${D}" || die "make install failed"
+ dodoc AUTHORS ChangeLog README
+
+ rm -f "${D}"/usr/$(get_libdir)/opendbx/*.{a,la}
+}
diff --git a/dev-db/opendbx/opendbx-1.5.0-r1.ebuild b/dev-db/opendbx/opendbx-1.5.0-r1.ebuild
new file mode 100644
index 000000000000..7a192ea82044
--- /dev/null
+++ b/dev-db/opendbx/opendbx-1.5.0-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit flag-o-matic multilib
+
+MY_PN="lib${PN}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="OpenDBX - A database abstraction layer"
+HOMEPAGE="http://www.linuxnetworks.de/doc/index.php/OpenDBX"
+SRC_URI="http://www.linuxnetworks.de/opendbx/download/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~x64-solaris"
+IUSE="firebird +mysql oracle postgres sqlite"
+RESTRICT="firebird? ( bindist )"
+
+DEPEND="mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql:* )
+ sqlite? ( dev-db/sqlite:3 )
+ oracle? ( dev-db/oracle-instantclient-basic )
+ firebird? ( dev-db/firebird )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${MY_P}
+
+pkg_setup() {
+ if ! ( use firebird || use mysql || use oracle || use postgres || use sqlite )
+ then
+ ewarn "You should enable at least one of the following USE flags:"
+ ewarn "firebird, mysql, oracle, postgres or sqlite"
+ fi
+
+ if use oracle && [[ ! -d ${ORACLE_HOME} ]]
+ then
+ die "Oracle support requested, but ORACLE_HOME not set to a valid directory!"
+ fi
+
+ use mysql && append-cppflags -I/usr/include/mysql
+ use firebird && append-cppflags -I/opt/firebird/include
+ use oracle && append-ldflags -L"${ORACLE_HOME}"/lib
+}
+
+src_configure() {
+ local backends=""
+
+ use firebird && backends="${backends} firebird"
+ use mysql && backends="${backends} mysql"
+ use oracle && backends="${backends} oracle"
+ use postgres && backends="${backends} pgsql"
+ use sqlite && backends="${backends} sqlite3"
+
+ econf --with-backends="${backends}" || die "econf failed"
+}
+
+src_compile() {
+ # bug #322221
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ emake -j1 install DESTDIR="${D}" || die "make install failed"
+ dodoc AUTHORS ChangeLog README
+
+ rm -f "${D}"/usr/$(get_libdir)/opendbx/*.{a,la}
+}
diff --git a/dev-db/oracle-instantclient-basic/Manifest b/dev-db/oracle-instantclient-basic/Manifest
new file mode 100644
index 000000000000..aa3052196fd3
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/Manifest
@@ -0,0 +1,27 @@
+AUX 11.2.0.3-makefile.patch 2250 SHA256 963139f3d41e7065e9ebd60b1b2f6ddbfc83358080fdef85713fdbf4ad322fd2 SHA512 1573f20608cf1e8a9c6dc94b40f4a7dac822f7888b2232ff13bf3db5456bbc0f653022acb194bdb2014698665042108d7f2b13e95ce00bd492c4c0eb03f4c9db WHIRLPOOL bd6474152c85c66b22cfe2d7d088d451e6dbf36fcb2e9f37e2387b211217cb42c01d05665017fd8e59c9b1b3d9656a14b4a546a09829825b3b75bef269db81d7
+AUX oracle-instantclient-basic-10.2.0.3-makefile.patch 356 SHA256 c28e41b5ac8842cfa6248df8936f0681f00eaa8d99206c640dbdd0fcaedcadf0 SHA512 7142d0e1ae320fe5efd8f15d3efa0a7ac073fe86b89e173ae33eea9095de92f72e65ceb21492e1c2b46a2922c0b87290ae4fea192b7cb69785318a81be263bf2 WHIRLPOOL b0d42b2bf6fd6ffc81155dca6b186609b8a2601e624c2ff69957b02ee6a68a31f4ad675890efd8dcd36de0ade57875794042e8d3a153040630959537f999f6c4
+AUX tnsnames.ora.sample 2939 SHA256 01b1f8625ae722d50e1f92aff5ae3f21c89631af4a06b6f85f8d83e821ff4da0 SHA512 25bb734bf4b7ea1d2ce2bddfd241204e796cad0d1d49036e567237d7ca92d158ab7bf69ff3abe210050c8ee0a0630f9217ced22dc31770814d822f93b2af5845 WHIRLPOOL 52cb14ec954568cbbd1c3a965a06cee4f2f52b6df95f211a65b9a320b748218d7d32e2c5697fa41a21399d3b3cd407c76777db98dfeb3a94012d0f40a6aac089
+DIST instantclient-basic-linux-11.2.0.3.0.zip 58502865 SHA256 1d5f9a3db6cdf91c332e75aa42995729e499f794bea6c5806ecba357c1258239 SHA512 c790f593e67bcc7c114a6287e1f064c03f292472e0a1a5e617a9f19017f06442f31502f66af8e6cfdf2235a18546104dc9aac164a3aa641db5728b66685c9302 WHIRLPOOL 5d2f256cfb39af3207698b261c12837a2b8385e4e11cee8d2bad6978899168962d396c2239d9a92f7656a44b9e3391057d23e176749fc74b6622a8d386d7241c
+DIST instantclient-basic-linux-11.2.0.4.0.zip 58793148 SHA256 462c300f43a87d053e8254982bf955d850ddc7b2801bbf6686dcf5ea8139b06d SHA512 b333c9334e960617ac7cc68ad1c7b45f990d5c24c7a5bc8e51b3bc8ff6476acfb6a032521f75ba39327c71ee9676d1163b252066d52e97c1dfe9c092a92a62a0 WHIRLPOOL efd4ea8c7c3fe52203f81b0c236d0da2b169069d5bb27e1ec985606051d4fa7ce95e1e53525b534a392b2e647916431a8b9cda34f408ce2c16c3740eaee0b098
+DIST instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip 36454483 SHA256 9195ab13e59365bfef6b2b43732a652d77d7ef8b93019f31104bc13832c6a491 SHA512 6fee52e3e9c4c234a6fd437643d7c5da7bcb5bcf8f4c4dc937c1b5894226a1288f3ec2a857ac5c6affed87157dadf9fb88d7f2228503227a10375f6ec902a5d2 WHIRLPOOL 81d34db84706cf4a87874ec6da14a43ff179743264b4e13bf8342f4f2d74a0a26f069cca95085ab558d48dfdec33dbf02c7232bc6735681ce03b47e777d9ac05
+DIST instantclient-basic-linux-x86-64-11.2.0.2.0.zip 59090676 SHA256 eeaa8101138b59c73c22bbb25e2a1cfd415dc830cafba6f9f19696789ab666e2 SHA512 27cc6e6b70b0f924f03d5ecb84a9cb9c8ac0adf9bd7b5a5b800e84a941732413621b8673216d135ff4fc69107223e31914afd5a04cdeb9c594a0a0314d2a28d9 WHIRLPOOL 8ff95baa8939def035a3a43d371ef6c74fd00c5d8ed6dd7279a29c051c87a75f85fb224933bd8ba5e1e15cb8b4af594adf0cd4d24e30399d814d1299122dff73
+DIST instantclient-basic-linux.x64-11.2.0.3.0.zip 60331694 SHA256 202d8abc5a3e626e00fdba805b60b3e4bd21aaa94a49cc3fc36bc4ed616ab436 SHA512 708940b5ca5bc4e0617da2c4da61d0a85834e3e0731ac328a201954558a624162f71d342d674b08ec2cf076e8f639c230f88a73f6d9bfe8908b0e76805e617b7 WHIRLPOOL 3b9653c2bebcd63177158d1a9520296368afbf63b1d7693ee15104b4869aa7573b9227d5958eda7c1a520a98ca98bae780209077487e0885bd09396071c90e95
+DIST instantclient-basic-linux.x64-11.2.0.4.0.zip 60704657 SHA256 77efd0021c3e122075bf994786646e123063af843475395eb95b139501387160 SHA512 01ed32f1771bfa2f8ef1b81314843fb2b7b81582f33c07d86670c959bbb08355dc7cc8da586852bb353a3a914658d1e7828d6b5df884215de8d76881c956a989 WHIRLPOOL 467612cc84bd40cf2871e4b4477c3a92d2926adbca2e1e47f5cfed9626f2d2e4a8d01bb8050e93ad1ff8302fa6b5b934389efdcff07ecd43fd263092997a25d2
+DIST instantclient-basic-linux32-10.2.0.3-20061115.zip 34556803 SHA256 11fce485c405afa4a30f34eba36ad0d566a599617f80dfc565bd08d8c421e1ae SHA512 7ebea6e7c4b2316affa6f5fd7ab821596d5ed236b10dbe6f42b8e8afed018e45dc9726b13a4f7a3c1fb9b699a03891355f538ee2848b3dfaada997d6cab71e1a WHIRLPOOL 8697af4060c9ebc9f4908d01fd67443ef808e1d2ffbc121555a9c9faf3153a32c4f299955925400c6404b893869e7d60839cd8a2b7f040081ff9aefd2c12f041
+DIST instantclient-basic-linux32-11.2.0.2.0.zip 57278802 SHA256 53f97a73991b2380e987f7cf4e1ba650a866044892c378b9340dc2e695160c14 SHA512 f854797b9baf2130a347a0e6a05707b1e959aa31db3817176641c5c2044f7c46c9e2e9968b4dc4856c8d16f75a4286f53103b8f8b81b3bf1ef7ce81233d94f57 WHIRLPOOL 3b726496c2b78ee9a83c1ea383d2341f66faefef3e36c0b7d85d4b6e4271fad9399fb3eed76188b58df48b314522a699ad82b913725dcfb862ceb3ef1431ff2f
+DIST instantclient-sdk-linux-11.2.0.3.0.zip 639306 SHA256 f51b3c91a63f176443a681881fb15281c4487dde637c9c6e5b0703462a330bee SHA512 fa0f98d4b2002982fab4438f734904e0ebfab777d601321423b454f9188c3b863e853fc5486c9958771f7ff8c9a544ce73e80750d745c3142872927ed1777ee1 WHIRLPOOL fb9c18785c62b2b6eef274c7c0e58d59b30491ef377eca4be4abbe263099660138bcb4d58da56b7184ad39d5226a3b16aedb9358eed252c3b46a3f7ae6f1a2cb
+DIST instantclient-sdk-linux-11.2.0.4.0.zip 643080 SHA256 672e4a73f6015fd744082f1c788df154c48d2e4efd1ca038a35c7dab6513ab9a SHA512 09e14a0ed88182b685a00b6370da4379710c4179fcf2d5ebdb43684b7099484122f7f5181a80352464f03ae9d0150f5c2ee5f20ede98faa9073294324b9faec8 WHIRLPOOL 4dd283fc2144af2cc164dd9756c84503210d9ce0032cd8e7c4c9a9ad733a2182334aeefddd9f3375e2c0a4bd83cd994042963a65198465fa325e014482e466de
+DIST instantclient-sdk-linux-x86-64-10.2.0.3-20070103.zip 603137 SHA256 d9da1494a9d19e96bff79c3ff77d079633d18c7d9b462a37eacc9a2a40641912 SHA512 25b00c407d4ed04287cc8473cf156c7c987e2c36787cf1bac229b902adc2781554f10f1a50b17bae96e2704b217ff60c4eb9f8c79ecdb3d44b13c9a84784a766 WHIRLPOOL 752ba8c748705b21048927b8204bf8696cb7b3c69157b9477af21fee666e8bf29c6110705fae6531e37244d72412808482ea711b9258a196e3db4fe4b0431bee
+DIST instantclient-sdk-linux-x86-64-11.2.0.2.0.zip 638214 SHA256 9faf4edec8806e8ed38419d17587e19de673a9e0bbdeb24a9e232e118681500e SHA512 5656da9e09fb35c16bed959d8746d5e4dfd4c6da2582a10a182442d83759739c3e71093cde63da1236bea04e92a8e15bda1b2e1468fed32d87f4f223ec65c495 WHIRLPOOL 52bef43ac900df01ebe88d652a3aea59d4f3a8cd273ed62d3f04cfccfbeb59f451bf208f9f8ac470b28f33b5bd64de70421320ced3837503c66b9498e74c8ece
+DIST instantclient-sdk-linux.x64-11.2.0.3.0.zip 641586 SHA256 6c7be8e2ad4288eb2e7453ca73a5ead89b6016dc4fd4e10b38bc95bbd2748ece SHA512 08b3fdc68e09f262549e2505867943aff5c3927d158569ea7e0bca4f958af725a46143d325dcf80a6d48d09f9240f147470439ac55ea848a27df3eeedd28f732 WHIRLPOOL e8a3c583b82c0adefff4200b5945704bfa6c106d32be82ce7c64adb10f92af0085b53f15836d4f92c177f20f33d5ca1fc60b6ddd972eb1ddb502f3091e9e9ff5
+DIST instantclient-sdk-linux.x64-11.2.0.4.0.zip 643089 SHA256 44473954a2e7031a4eec4692766cbf3c69e55c217bd1c5f8bee29a36da555dcc SHA512 7198ddc7d8804353900e45b36de79659d75dee0197c4dd58bd4d69408e7131c95025223bbd1f39ef208269bff379daa6e05f4371af83a82b83997cafadc1d642 WHIRLPOOL a673fa91683939c4a32aef3ccb8ab5374eee05d41478bfbfb6908ebe08ea624ac7661ccaed52a5ab55a3b87eaded4b6e6f6d2374e7f7c4b9f1ce802b15c4e69f
+DIST instantclient-sdk-linux32-10.2.0.3-20061115.zip 602897 SHA256 6893a784e1802e18300230dcac1ed2ecd6dc68a7060c02717f73bf268d43f6a5 SHA512 89fb0a1f58a46149ddcccc5205cb6b61988142d01df7de7c5dd76c4ef7a2c880a19d611efb8ae03e26d361d1f9a767bf58e2d113a20cd1b9e51a29f500be4cba WHIRLPOOL 1b68c8379d23a2b7e42a4a6f70cd306dc7c3e26c51860fe979de5bcdc64de21b6c9fed5a3edc595372385f6dcf7a490e2d0c5238523cf3ee0fe6259dd5367ad5
+DIST instantclient-sdk-linux32-11.2.0.2.0.zip 638200 SHA256 172c0116de16f55abd775aaf4dd1666d0e64eb1226b43388974ccf83235c8b18 SHA512 41d0f6e327a548c6ba152853a706d1630052f3710ad94015a1fad44cf149a260c389eb973ba49f9239e453a51ceace2c0d3b86ace764f2651dd45ad546084abe WHIRLPOOL 641c46e12162c83bb27f90f495d9511a01b652172756ed7b94fb14b5682d8597e6dac801dd0aef90bb75fef5207309069439d0173bbc03eb9ec46ece4282abe8
+EBUILD oracle-instantclient-basic-10.2.0.3-r1.ebuild 3774 SHA256 46c21e46698524477b4873c5b5e6f51f40226e93c53bc64a1e29bfd58cff163d SHA512 615765e2c2ccc51e16ec9c5c6563ba59b033764efae8b38ab6bd8125bf05c408f2e3ac1ba676328dc26de6a0a8cf03082323673fbbaa0a21c50ec0b54c9562b7 WHIRLPOOL 92f5bb1e6947e26b888b0910371fd2e7ae13485b2dd7ebf2b45a6132b7fb38be0f8b006c2485afbcc98081c327e184a071b25a6e906d677ed4b48773f1e0faa9
+EBUILD oracle-instantclient-basic-11.2.0.2.ebuild 3739 SHA256 72dba2848202e6f80fb966a045d4242d25bf5df6e1309c547cc759fc1fd87bc3 SHA512 c818a90735a0fdce00d51be936b427ca7801633c9dd686e07bddae3ebdc66aea47badd85d4e78b637d79560f4d9d80422f0cc1d3493a6728be5bfde8ddfb8e39 WHIRLPOOL f67f1d84f118ff341c77953763caaa98661c3686cde9090434cda96711c514206ee67479d99d98c1f6574a5b69c72bc87a41fc5777c7cf274644a89ae349f440
+EBUILD oracle-instantclient-basic-11.2.0.3.ebuild 5382 SHA256 919264752ac9aa0d7710bb9e79f88345d647be085560cdc8d1a68628f3af196c SHA512 c64cd1bff11ed6a11251bc3aca214b7b8a4d9a75d01702eb29ce935f9f02fb72bb9128247d2e32d87fbc1e042b0b19a72dfb6009f940bb69b455adc4f38128fe WHIRLPOOL e7a717755d18e9c85212a7c20cf9ac7c9f8892f860575c8e588fbe5fe00f1c0628bd7271ee5bd42327f67cb16dafaf2005ae129ebcfb2e9a8958b92afa2c3400
+EBUILD oracle-instantclient-basic-11.2.0.4.ebuild 5545 SHA256 9432715a20271ebf5f0bf0b3a0c854c42ce18c16d8ced39662092a20c1680e00 SHA512 f7f97eca82b62f43dd17170d5c9ee492f029f8e99b746511712b56cdc4cd45a96a68757101350ab05aab6e7ed5cfe2fd70154c8b28fa4e3c07bc6f961e1fec2b WHIRLPOOL 0d0f8328f50ac022910cb892bd389aa36347d29b87f04ced723b8486bcc24daafaed4d9cc29cc73a9dbe2b221e401d58bd64569ca065ce421feb8607daef7b8b
+EBUILD oracle-instantclient-basic-12.ebuild 402 SHA256 cc578a5d7e2622ae9d1fd99adc37883de4012b92206cb0a4ec4da0e62ae926b4 SHA512 374a6cf7a0aa7f2942a86dffcfdfa2ae52c637986f5920a295820e8ab13446962eff19653f347274c20b68c4466400fd2467da935bc0633fe12ba2fb3f1cf414 WHIRLPOOL 8db23ebc1b0fea91ff02402b638982504a576db74f17326867c385b3b731b85d69a60067408d7c66a3429e21ceb8eb7932b48ce13543a6e0f3add9f1fb46487f
+MISC ChangeLog 3030 SHA256 234fb3354bede6dbea79952160c84c9e3b85643754e0932c1a8cc820b009fead SHA512 74925bd5013a67d5ad91eeb6e9674b99247ff7a2f5b45331383b2fa261072874704ff11020ec8c458659c7d20080dbee0ab16fe3d5de508594ea8e3647581628 WHIRLPOOL 0f3392b0d04df4ad083d2e926ccb023aa0608c87f2c80165c7d56f388dbd261ec6e28f796caecff5597ee5dba724cc3576c2adb24cbb2be5a7f9e8f12ee65447
+MISC ChangeLog-2015 11875 SHA256 ec4e5bdb11f3c216d57a07d41ad56bdd85eef018965ecedb5d0fbb59a583e844 SHA512 02bfd0ce2f76751ca4d6dc80e82114c380e1bd4969b24d690e83b71ec6155d4046d5b27f41254dcbbd4829dafbb9b00244bc0815f824cc5bdae76bc9f42ba2ef WHIRLPOOL 917d4ad40f03e1963f3cbe60fb389cc6beb5568c10efc35aef42d7bd655add7470bdbb84dd6842d785e60ce8918ab38cab6813b34c0d1ce89e64c8b8f1599105
+MISC metadata.xml 344 SHA256 d174d68828743d3a86a8ef41b7191a0e129eedf2ad7b120598a3b0c10f72e2d2 SHA512 650f29483a89a65b3855aeb65fc486d38365660ed2a67e9ab18e96534c5dd453d7897b0443fd1b12dfceaee3b542840ab1648c36b07728014dfd57ac1c95e3e9 WHIRLPOOL c2fbc975d357d3ec1e47ebc7a44103745c119d46258274f84bafa939f2ddd2968fab0a4ae2ab55dc79bc54807c164960f6ba11e58edeb1aa1e398ce03594db0f
diff --git a/dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch b/dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch
new file mode 100644
index 000000000000..efcc2c6fac7c
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch
@@ -0,0 +1,57 @@
+Fake demo_xe.mk found in Oracle eXpress Edition,
+known by CPAN DBD::Oracle (bug#165834).
+This provides absolute paths for headers and libraries.
+
+Paranoia drops those REMOVE lines.
+--- sdk/demo/demo.mk.orig 2012-03-06 17:11:57.636990449 +0100
++++ sdk/demo/demo.mk 2012-03-06 17:19:37.985324293 +0100
+@@ -28,8 +28,9 @@
+ CC=/opt/SunProd/SUNWspro6.1/bin/CC
+ cc=/opt/SunProd/SUNWspro6.1/bin/cc
+
+-ICINCHOME=../
+-ICLIBHOME=../../
++LIBDIR=lib
++ICINCHOME=$(ORACLE_HOME)/
++ICLIBHOME=$(ORACLE_HOME)/$(LIBDIR)
+ ICLIBPATH=-L$(ICLIBHOME)
+ THREADLIBS=-lthread
+ CCLIB=$(ICLIBPATH) -locci -lclntsh $(THREADLIBS)
+@@ -64,18 +64,18 @@
+ all: clean buildoci $(OCCIDEMO) $(OCCIOBJDEMO)
+
+ buildoci: $(CLNCACHE) $(LIBCLNT) $(CDEMOOBJS)
+- $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
+ $(CC) -o $(CDEMOEXE) $(LDFLAGS) $(CDEMOOBJS) $(CCLIB)
+- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
+
+ buildocci: $(CLNCACHE) $(LIBCLNT) $(OBJS)
+- $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
+ $(CC) -o $(EXE) $(LDFLAGS) $(OBJS) $(CCLIB)
+- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
+
+ $(OCCIDEMO):
+ $(MAKE) -f $(MAKEFILE) buildocci OBJS=$@.o EXE=$@
+@@ -93,8 +93,8 @@
+
+ cleancache:
+ $(REMOVE) $(CACHEDIR)
+- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
+
+ clean: $(CLNCACHE)
+ $(REMOVE) cdemo81 cdemo81.o occidml occidml.o occiobj occiobj.o occiobjo* occiobjm* occiobj.h occiobjout.type
diff --git a/dev-db/oracle-instantclient-basic/files/oracle-instantclient-basic-10.2.0.3-makefile.patch b/dev-db/oracle-instantclient-basic/files/oracle-instantclient-basic-10.2.0.3-makefile.patch
new file mode 100644
index 000000000000..80df560a1014
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/files/oracle-instantclient-basic-10.2.0.3-makefile.patch
@@ -0,0 +1,11 @@
+--- instantclient_10_2/sdk/demo/demo.mk.orig 2007-02-06 17:51:47.018247041 -0800
++++ instantclient_10_2/sdk/demo/demo.mk 2007-02-06 17:52:35.374869934 -0800
+@@ -30,7 +30,7 @@
+
+ ICINCHOME=../
+ ICLIBHOME=../../
+-ICLIBPATH=-L$(ICLIBHOME)
++ICLIBPATH=-L$(ICLIBHOME) -L$(ORACLE_HOME)/lib
+ THREADLIBS=-lthread
+ CCLIB=$(ICLIBPATH) -locci -lclntsh $(THREADLIBS)
+
diff --git a/dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample b/dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample
new file mode 100644
index 000000000000..f0524f5993cd
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample
@@ -0,0 +1,93 @@
+# This file contains the syntax information for
+# the entries to be put in any tnsnames.ora file
+# The entries in this file are need based.
+# There are no defaults for entries in this file
+# that Sqlnet/Net3 use that need to be overridden
+#
+# Typically you could have two tnsnames.ora files
+# in the system, one that is set for the entire system
+# and is called the system tnsnames.ora file, and a
+# second file that is used by each user locally so that
+# he can override the definitions dictated by the system
+# tnsnames.ora file.
+
+# The entries in tnsnames.ora are an alternative to using
+# the names server with the onames adapter.
+# They are a collection of aliases for the addresses that
+# the listener(s) is(are) listening for a database or
+# several databases.
+
+# The following is the general syntax for any entry in
+# a tnsnames.ora file. There could be several such entries
+# tailored to the user's needs.
+
+<alias>= [ (DESCRIPTION_LIST = # Optional depending on whether u have
+ # one or more descriptions
+ # If there is just one description, unnecessary ]
+ (DESCRIPTION=
+ [ (SDU=2048) ] # Optional, defaults to 2048
+ # Can take values between 512 and 32K
+ [ (ADDRESS_LIST= # Optional depending on whether u have
+ # one or more addresses
+ # If there is just one address, unnecessary ]
+ (ADDRESS=
+ [ (COMMUNITY=<community_name>) ]
+ (PROTOCOL=tcp)
+ (HOST=<hostname>)
+ (PORT=<portnumber (1521 is a standard port used)>)
+ )
+ [ (ADDRESS=
+ (PROTOCOL=ipc)
+ (KEY=<ipckey (PNPKEY is a standard key used)>)
+ )
+ ]
+ [ (ADDRESS=
+ [ (COMMUNITY=<community_name>) ]
+ (PROTOCOL=decnet)
+ (NODE=<nodename>)
+ (OBJECT=<objectname>)
+ )
+ ]
+ ... # More addresses
+ [ ) ] # Optional depending on whether ADDRESS_LIST is used or not
+ [ (CONNECT_DATA=
+ (SID=<oracle_sid>)
+ [ (GLOBAL_NAME=<global_database_name>) ]
+ )
+ ]
+ [ (SOURCE_ROUTE=yes) ]
+ )
+ (DESCRIPTION=
+ [ (SDU=2048) ] # Optional, defaults to 2048
+ # Can take values between 512 and 32K
+ [ (ADDRESS_LIST= ] # Optional depending on whether u have more
+ # than one address or not
+ # If there is just one address, unnecessary
+ (ADDRESS
+ [ (COMMUNITY=<community_name>) ]
+ (PROTOCOL=tcp)
+ (HOST=<hostname>)
+ (PORT=<portnumber (1521 is a standard port used)>)
+ )
+ [ (ADDRESS=
+ (PROTOCOL=ipc)
+ (KEY=<ipckey (PNPKEY is a standard key used)>)
+ )
+ ]
+ ... # More addresses
+ [ ) ] # Optional depending on whether ADDRESS_LIST
+ # is being used
+ [ (CONNECT_DATA=
+ (SID=<oracle_sid>)
+ [ (GLOBAL_NAME=<global_database_name>) ]
+ )
+ ]
+ [ (SOURCE_ROUTE=yes) ]
+ )
+ [ (CONNECT_DATA=
+ (SID=<oracle_sid>)
+ [ (GLOBAL_NAME=<global_database_name>) ]
+ )
+ ]
+ ... # More descriptions
+ [ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not
diff --git a/dev-db/oracle-instantclient-basic/metadata.xml b/dev-db/oracle-instantclient-basic/metadata.xml
new file mode 100644
index 000000000000..8b032de8ebf6
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>haubi@gentoo.org</email>
+</maintainer>
+<longdescription>Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications</longdescription>
+</pkgmetadata>
diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-10.2.0.3-r1.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-10.2.0.3-r1.ebuild
new file mode 100644
index 000000000000..909f6b038e22
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-10.2.0.3-r1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}-20061115"
+MY_PSDK_x86="${MY_P_x86/basic/sdk}"
+
+MY_P_amd64="${PN/oracle-/}-linux-x86-64-${PV}-20070103"
+MY_PSDK_amd64="${MY_P_amd64/basic/sdk}"
+
+S=${WORKDIR}
+DESCRIPTION="Oracle 10g client installation for Linux with SDK"
+HOMEPAGE="http://www.oracle.com/technology/tech/oci/instantclient/index.html"
+SRC_URI="amd64? ( ${MY_P_amd64}.zip ${MY_PSDK_amd64}.zip )
+ x86? ( ${MY_P_x86}.zip ${MY_PSDK_x86}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+RESTRICT="fetch"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="~virtual/libstdc++-3.3"
+
+my_arch() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+ MY_PSDK=MY_PSDK_${ARCH}
+ export MY_PSDK=${!MY_PSDK}
+}
+
+pkg_setup() {
+ my_arch
+}
+
+pkg_nofetch() {
+ my_arch
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "select your platform and download the"
+ eerror "Basic client package with SDK, which are:"
+ eerror " ${MY_P}.zip"
+ eerror " ${MY_PSDK}.zip"
+ eerror "Then after downloading put them in:"
+ eerror " ${DISTDIR}"
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip || die "unsuccesful unzip ${MY_P}.zip"
+ unzip "${DISTDIR}"/${MY_PSDK}.zip || die "unsuccesful unzip ${MY_PSDK}.zip"
+}
+
+src_install() {
+ # Patch the SDK makefile
+ epatch "${FILESDIR}"/${P}-makefile.patch
+
+ # SDK makefile
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/rdbms/demo
+ cd "${S}"/instantclient_10_2/sdk/demo
+ mv demo.mk demo_xe.mk
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/rdbms/demo
+ doins demo_xe.mk
+
+ # library
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_10_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins *.jar *.so *.so.10.1
+
+ # fixes symlinks
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/lib/libocci.so.10.1 /usr/$(get_libdir)/oracle/${PV}/client/lib/libocci.so
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/lib/libclntsh.so.10.1 /usr/$(get_libdir)/oracle/${PV}/client/lib/libclntsh.so
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/include /usr/$(get_libdir)/oracle/${PV}/client/rdbms/public
+
+ # includes
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/include
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/include
+ cd "${S}"/instantclient_10_2/sdk/include
+ doins *.h
+ # link to original location
+ dodir /usr/include/oracle/${PV}/
+ ln -s "${D}"/usr/$(get_libdir)/oracle/${PV}/client/include "${D}"/usr/include/oracle/${PV}/client
+
+ # share info
+ cd "${S}"/instantclient_10_2/sdk/demo
+ dodoc *
+
+ # Add OCI libs to library path
+ dodir /etc/env.d
+ echo "ORACLE_HOME=/usr/$(get_libdir)/oracle/${PV}/client" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+ echo "LDPATH=/usr/$(get_libdir)/oracle/${PV}/client/lib" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+ echo "C_INCLUDE_PATH=/usr/$(get_libdir)/oracle/${PV}/client/include" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+ echo "TNS_ADMIN=/etc/oracle/" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+
+ # create path for tnsnames.ora
+ dodir /etc/oracle
+}
+
+pkg_postinst() {
+ elog "The Basic client page for Oracle 10g has been installed."
+ elog "You may also wish to install the oracle-instantclient-jdbc (for"
+ elog "supplemental JDBC functionality with Oracle) and the"
+ elog "oracle-instantclient-sqlplus (for running the SQL*Plus application)"
+ elog "packages as well."
+ elog
+ elog "Examples are located in /usr/share/doc/${PF}/"
+ elog
+ elog "oracle-instantclient-* packages aren't installed in different"
+ elog "SLOTs any longer. You may want to uninstall older versions."
+ elog
+ elog "TNS_ADMIN has been set to "${ROOT}"etc/oracle by default, put your"
+ elog "tnsnames.ora there or configure TNS_ADMIN to point to"
+ elog "your user specific configuration."
+}
diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.2.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.2.ebuild
new file mode 100644
index 000000000000..0a99877bfc33
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.2.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}.0"
+MY_PSDK_x86="${MY_P_x86/basic/sdk}"
+
+MY_PBASE_amd64="${PN/oracle-instantclient-basic/instantclient-basic-linux}-x86-64-${PV}.0"
+MY_P_amd64="${PN/oracle-instantclient-basic/instantclient-basic-linux}-x86-64-${PV}.0"
+MY_PSDK_amd64="${MY_PBASE_amd64/basic/sdk}"
+
+DESCRIPTION="Oracle 11g client installation for Linux with SDK"
+HOMEPAGE="http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html"
+SRC_URI="x86? ( ${MY_P_x86}.zip ${MY_PSDK_x86}.zip )
+ amd64? ( ${MY_P_amd64}.zip ${MY_PSDK_amd64}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="-* ~x86 ~amd64"
+RESTRICT="fetch"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="dev-libs/libaio"
+
+S="${WORKDIR}"
+
+my_arch() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+ MY_PSDK=MY_PSDK_${ARCH}
+ export MY_PSDK=${!MY_PSDK}
+}
+
+pkg_setup() {
+ my_arch
+}
+
+pkg_nofetch() {
+ my_arch
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "select your platform and download the"
+ eerror "Basic client package with SDK, which are:"
+ eerror " ${MY_P}.zip"
+ eerror " ${MY_PSDK}.zip"
+ eerror "Then after downloading put them in:"
+ eerror " ${DISTDIR}"
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip || die "unsuccesful unzip ${MY_P}.zip"
+ unzip "${DISTDIR}"/${MY_PSDK}.zip || die "unsuccesful unzip ${MY_PSDK}.zip"
+}
+
+src_install() {
+ # SDK makefile
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/rdbms/demo
+ cd "${S}"/instantclient_11_2/sdk/demo
+ mv demo.mk demo_xe.mk
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/rdbms/demo
+ doins demo_xe.mk
+
+ # library
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_11_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins *.jar *.so *.so.11.1
+
+ # fixes symlinks
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/lib/libocci.so.11.1 /usr/$(get_libdir)/oracle/${PV}/client/lib/libocci.so
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/lib/libclntsh.so.11.1 /usr/$(get_libdir)/oracle/${PV}/client/lib/libclntsh.so
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/include /usr/$(get_libdir)/oracle/${PV}/client/rdbms/public
+
+ # includes
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/include
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/include
+ cd "${S}"/instantclient_11_2/sdk/include
+ # Remove ldap.h, #299562
+ rm ldap.h || die "rm failed"
+ doins *.h
+ # link to original location
+ dodir /usr/include/oracle/${PV}/
+ ln -s "${D}"/usr/$(get_libdir)/oracle/${PV}/client/include "${D}"/usr/include/oracle/${PV}/client
+
+ # share info
+ cd "${S}"/instantclient_11_2/sdk/demo
+ dodoc *
+
+ # Add OCI libs to library path
+ dodir /etc/env.d
+ echo "ORACLE_HOME=/usr/$(get_libdir)/oracle/${PV}/client" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+ echo "LDPATH=/usr/$(get_libdir)/oracle/${PV}/client/lib" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+ echo "C_INCLUDE_PATH=/usr/$(get_libdir)/oracle/${PV}/client/include" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+ echo "TNS_ADMIN=/etc/oracle/" >> "${D}"/etc/env.d/50oracle-instantclient-basic
+
+ # create path for tnsnames.ora
+ dodir /etc/oracle
+}
+
+pkg_postinst() {
+ elog "The Basic client package for Oracle 11g has been installed."
+ elog "You may also wish to install the oracle-instantclient-jdbc (for"
+ elog "supplemental JDBC functionality with Oracle) and the"
+ elog "oracle-instantclient-sqlplus (for running the SQL*Plus application)"
+ elog "packages as well."
+ elog
+ elog "Examples are located in /usr/share/doc/${PF}/"
+ elog
+ elog "TNS_ADMIN has been set to "${ROOT}"etc/oracle by default, put your"
+ elog "tnsnames.ora there or configure TNS_ADMIN to point to"
+ elog "your user specific configuration."
+}
diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild
new file mode 100644
index 000000000000..a63d14bc52b8
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib
+
+MY_PLAT_x86="Linux x86"
+MY_BITS_x86=32
+MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
+MY_ASDK_x86="${MY_A_x86/basic/sdk}"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_BITS_amd64=64
+MY_A_amd64="${PN/oracle-}-linux.x64-${PV}.0.zip"
+MY_ASDK_amd64="${MY_A_amd64/basic/sdk}"
+
+DESCRIPTION="Oracle 11g Instant Client with SDK"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ x86? ( ${MY_A_x86} ${MY_ASDK_x86} )
+ amd64? ( ${MY_A_amd64} ${MY_ASDK_amd64} multilib? ( ${MY_A_x86} ) )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch"
+IUSE="multilib"
+
+EMULTILIB_PKG="true"
+
+DEPEND="app-arch/unzip"
+RDEPEND="
+ dev-libs/libaio
+ multilib? ( >=dev-libs/libaio-0.3.109-r3 )
+"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
+
+set_my_abivars() {
+ S="${WORKDIR}/${ABI}/instantclient_11_2"
+
+ local abi=${ABI}
+ [[ ${abi} == 'default' ]] && abi=${ARCH}
+ MY_PLAT=MY_PLAT_${abi}; MY_PLAT=${!MY_PLAT} # platform name
+ MY_BITS=MY_BITS_${abi}; MY_BITS=${!MY_BITS} # platform bitwidth
+ MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
+ MY_ASDK=MY_ASDK_${abi}; MY_ASDK=${!MY_ASDK} # sdk distfile
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+oic_distfile_status() {
+ if [[ -r ${DISTDIR}/${1} ]]; then
+ echo "already here"
+ else
+ echo "still absent"
+ fi
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ for ABI in $(get_install_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
+ if is_final_abi; then
+ eerror " SDK: ($(oic_distfile_status ${MY_ASDK})) ${MY_ASDK}"
+ fi
+ done
+ eerror "After downloading these files (for *all* shown architectures), put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ for ABI in $(get_install_abis)
+ do
+ set_my_abivars || continue
+ mkdir "${WORKDIR}"/${ABI} || die
+ cd "${WORKDIR}"/${ABI} || die
+ unpack ${MY_A}
+ if is_final_abi; then
+ unpack ${MY_ASDK}
+ fi
+ done
+}
+
+src_prepare() {
+ # need to patch for the final ABI only
+ set_my_abivars || die "${ABI} ABI not supported!"
+ cd "${S}" || die
+ epatch "${FILESDIR}"/11.2.0.3-makefile.patch
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ local ldpath=
+ for ABI in $(get_install_abis) # last iteration is final ABI
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${S}" || die
+
+ # shared libraries
+ dolib.so lib*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libocci$(get_libname) ]] ||
+ dosym libocci$(get_libname 11.1) \
+ "${oracle_home}"/$(get_libdir)/libocci$(get_libname)
+ [[ -e libclntsh$(get_libname) ]] ||
+ dosym libclntsh$(get_libname 11.1) \
+ "${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
+
+ # java archives
+ insinto "${oracle_home}"/$(get_libdir)
+ doins *.jar
+
+ # runtime library path
+ ldpath+=${ldpath:+:}${oracle_home}/$(get_libdir)
+
+ eend $?
+ done
+
+ # ensure ORACLE_HOME/lib exists
+ [[ -e ${ED}${oracle_home}/lib ]] ||
+ dosym $(get_libdir) "${oracle_home}"/lib
+
+ einfo "Installing SDK ..."
+ cd "${S}"/sdk || die
+
+ # SDK makefile, for #165834
+ # As we change the relative filesystem layout compared
+ # to vanilla instantclient.zip content, it feels easier
+ # to fake the layout found in Oracle eXpress Edition.
+ # Both layouts are known to DBD::Oracle (cpan).
+ insinto "${oracle_home}"/rdbms/demo
+ newins demo/demo.mk demo_xe.mk
+
+ # Remove ldap.h, #299562
+ rm include/ldap.h || die
+ # DBD::Oracle needs rdbms/public as real directory
+ insinto "${oracle_home}"/rdbms/public
+ doins include/*.h
+ dosym rdbms/public "${oracle_home}"/include
+ # ruby-oci8 expects the headers here
+ dosym "${oracle_home}"/rdbms/public /usr/include/oracle/${PV}/client
+
+ dodoc demo/*
+
+ eend $?
+
+ # create path for tnsnames.ora
+ insinto /etc/oracle
+ doins "${FILESDIR}"/tnsnames.ora.sample
+
+ # Add OCI libs to library path
+ {
+ echo "ORACLE_HOME=${EPREFIX}${oracle_home}"
+ echo "LDPATH=${ldpath}"
+# who does need this?
+# echo "C_INCLUDE_PATH=${oracle_home}/include"
+ echo "TNS_ADMIN=/etc/oracle/"
+ } > "${T}"/50oracle-instantclient-basic
+ doenvd "${T}"/50oracle-instantclient-basic
+}
+
+pkg_postinst() {
+ elog "${P} does not provide an sqlnet.ora"
+ elog "configuration file, redirecting oracle diagnostics for database-"
+ elog "and network-issues into ~USER/oradiag_USER/ instead."
+ elog "It should be safe to ignore this message in sqlnet.log there:"
+ elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
+ elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
+ elog "If you want to directly analyse low-level debug info or don't want"
+ elog "to see it at all, so you really need an sqlnet.ora file, please"
+ elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
+ elog ""
+ elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
+ elog "put your tnsnames.ora there or configure TNS_ADMIN"
+ elog "to point to your user specific configuration."
+ ewarn "Please re-source your shell settings for ORACLE_HOME"
+ ewarn " changes, such as: source /etc/profile"
+}
diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild
new file mode 100644
index 000000000000..0dfbc6395439
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib-minimal
+
+MY_PLAT_x86="Linux x86"
+MY_BITS_x86=32
+MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
+MY_ASDK_x86="${MY_A_x86/basic/sdk}"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_BITS_amd64=64
+MY_A_amd64="${PN/oracle-}-linux.x64-${PV}.0.zip"
+MY_ASDK_amd64="${MY_A_amd64/basic/sdk}"
+
+DESCRIPTION="Oracle 11g Instant Client with SDK"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ abi_x86_32? ( ${MY_A_x86} !abi_x86_64? ( ${MY_ASDK_x86} ) )
+ abi_x86_64? ( ${MY_A_amd64} ${MY_ASDK_amd64} )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch splitdebug"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND=">=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
+
+set_my_abivars() {
+ S="${WORKDIR}/${ABI}/instantclient_11_2"
+
+ local abi=${ABI}
+ [[ ${abi} == 'default' ]] && abi=${ARCH}
+ MY_PLAT=MY_PLAT_${abi}; MY_PLAT=${!MY_PLAT} # platform name
+ MY_BITS=MY_BITS_${abi}; MY_BITS=${!MY_BITS} # platform bitwidth
+ MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
+ MY_ASDK=MY_ASDK_${abi}; MY_ASDK=${!MY_ASDK} # sdk distfile
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+oic_distfile_status() {
+ if [[ -r ${DISTDIR}/${1} ]]; then
+ echo "already here"
+ else
+ echo "still absent"
+ fi
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
+ multilib_is_native_abi &&
+ eerror " SDK: ($(oic_distfile_status ${MY_ASDK})) ${MY_ASDK}"
+ done
+ eerror "After downloading these files (for *all* shown architectures), put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ mkdir "${WORKDIR}"/${ABI} || die
+ cd "${WORKDIR}"/${ABI} || die
+ unpack ${MY_A}
+ multilib_is_native_abi &&
+ unpack ${MY_ASDK}
+ done
+}
+
+src_prepare() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do : # need to patch for the final ABI only
+ done
+ set_my_abivars || die "${ABI} ABI not supported!"
+ cd "${S}" || die
+ epatch "${FILESDIR}"/11.2.0.3-makefile.patch
+}
+
+# suppress configure&compile messages from multilib-minimal
+src_configure() { :; }
+src_compile() { :; }
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ local ldpath= ABI
+ for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${S}" || die
+
+ # shared libraries
+ dolib.so lib*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libocci$(get_libname) ]] ||
+ dosym libocci$(get_libname 11.1) \
+ "${oracle_home}"/$(get_libdir)/libocci$(get_libname)
+ [[ -e libclntsh$(get_libname) ]] ||
+ dosym libclntsh$(get_libname 11.1) \
+ "${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
+
+ # java archives
+ insinto "${oracle_home}"/$(get_libdir)
+ doins *.jar
+
+ # runtime library path
+ ldpath+=${ldpath:+:}${oracle_home}/$(get_libdir)
+
+ eend $?
+ done
+
+ # ensure ORACLE_HOME/lib exists
+ [[ -e ${ED}${oracle_home}/lib ]] ||
+ dosym $(get_libdir) "${oracle_home}"/lib
+
+ einfo "Installing SDK ..."
+ cd "${S}"/sdk || die
+
+ # SDK makefile, for #165834
+ # As we change the relative filesystem layout compared
+ # to vanilla instantclient.zip content, it feels easier
+ # to fake the layout found in Oracle eXpress Edition.
+ # Both layouts are known to DBD::Oracle (cpan).
+ insinto "${oracle_home}"/rdbms/demo
+ newins demo/demo.mk demo_xe.mk
+
+ # Remove ldap.h, #299562
+ rm include/ldap.h || die
+ # DBD::Oracle needs rdbms/public as real directory
+ insinto "${oracle_home}"/rdbms/public
+ doins include/*.h
+ dosym rdbms/public "${oracle_home}"/include
+ # ruby-oci8 expects the headers here
+ dosym "${oracle_home}"/rdbms/public /usr/include/oracle/${PV}/client
+
+ dodoc demo/*
+
+ eend $?
+
+ # create path for tnsnames.ora
+ insinto /etc/oracle
+ doins "${FILESDIR}"/tnsnames.ora.sample
+
+ # Add OCI libs to library path
+ {
+ echo "ORACLE_HOME=${EPREFIX}${oracle_home}"
+ echo "LDPATH=${ldpath}"
+# who does need this?
+# echo "C_INCLUDE_PATH=${oracle_home}/include"
+ echo "TNS_ADMIN=/etc/oracle/"
+ } > "${T}"/50oracle-instantclient-basic
+ doenvd "${T}"/50oracle-instantclient-basic
+}
+
+pkg_postinst() {
+ elog "${P} does not provide an sqlnet.ora"
+ elog "configuration file, redirecting oracle diagnostics for database-"
+ elog "and network-issues into ~USER/oradiag_USER/ instead."
+ elog "It should be safe to ignore this message in sqlnet.log there:"
+ elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
+ elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
+ elog "If you want to directly analyse low-level debug info or don't want"
+ elog "to see it at all, so you really need an sqlnet.ora file, please"
+ elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
+ elog ""
+ elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
+ elog "put your tnsnames.ora there or configure TNS_ADMIN"
+ elog "to point to your user specific configuration."
+ ewarn "Please re-source your shell settings for ORACLE_HOME"
+ ewarn " changes, such as: source /etc/profile"
+}
diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-12.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-12.ebuild
new file mode 100644
index 000000000000..7125f39aec7e
--- /dev/null
+++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-12.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Transition package moving to single ${CATEGORY}/oracle-instantclient package"
+HOMEPAGE="https://bugs.gentoo.org/show_bug.cgi?id=524922#c12"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=dev-db/oracle-instantclient-12[sdk]"
diff --git a/dev-db/oracle-instantclient-jdbc/Manifest b/dev-db/oracle-instantclient-jdbc/Manifest
new file mode 100644
index 000000000000..c1ce806c8fa6
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/Manifest
@@ -0,0 +1,16 @@
+DIST instantclient-jdbc-linux-11.2.0.3.0.zip 1562543 SHA256 45f9b5ecfba90e3936418e8047660b7d2c90b276a78b5f51c70235abefc50acd SHA512 f78991e57eed2b095e8659825723bfc107d3c4519d1864769a0190f22e3d5667a1a4213a067470a8fb07c1f0562ec950c9fbe37f70e9475811dd1edfaf3f17f0 WHIRLPOOL f3eb7e031366fe1d9e396ed61acc89611715bbe4dcc8ecc32743229b2429708826c88d8f90d9362243067b5e4e43d65e01b6875ae56a88ed87efb7574ad002d2
+DIST instantclient-jdbc-linux-11.2.0.4.0.zip 1562440 SHA256 d933485f6f8a1d19b009ad9803ec4a7037bb6813a8b54668925534078df4cdd8 SHA512 0a92a6529642203d48846d3f22f3756ada22942ea5e7c36d779d220dc7195301d4016edd8ee5124f9e51429bb77d9890602c1a18884eec58ff40c2aed24e55f9 WHIRLPOOL a55b4a47f1f533d6a45932ea205b6ffeedd0cabc2e154269753759a28fdc93976792050bbec834a95e5057fb37a5aee593f8c2610be8a2a9de12048346686591
+DIST instantclient-jdbc-linux-x86-64-10.2.0.3-20070103.zip 1493549 SHA256 894a015af4105e2f65a415e597e62e6bd9702d6f75a99e27af74cd901f5e7ee9 SHA512 061c9b74f419d77dc5ef53ce7dfa784fd49724ea6de508b85c81f3c92fd6f97941cfccaa50c13f811dc8e0fed62bd00caa1b7015177327a3f483e75f77a36e8d WHIRLPOOL 94b96f4db4185916fbfdb78d3624a3dfa9da41fa09c9e88b5e43d34be55820a37426053c2aef4fed5e03a38e356ed6cc3882296e2043afa18343297777e0e41b
+DIST instantclient-jdbc-linux-x86-64-11.2.0.2.0.zip 1563157 SHA256 07fcfbd61a183588813fb755dafd04c052a771959fcbc4ee89e2180337d6c537 SHA512 f59a856263fbf60787b0014b52995616f2231f4da7b848d0732f870366963ac188e843c5d5fd254f1627e7db5f94a8df7d7e58de2ebbc2d205fda70ed8f86f1c WHIRLPOOL 40230d5a15435b585aa026a219fcdccf7390e8b52982d273e23a6a9ab34da74746bef23ebf690d8e88dcfd80735c3ae8f012c44bb1d27c1f39e45eb3d908358d
+DIST instantclient-jdbc-linux.x64-11.2.0.3.0.zip 1562504 SHA256 cfbcaacd85cd2964dae8478337e9020312b9827284ce86140db3c5e310436df1 SHA512 afb824786e01f316dfa244e304fae7d9a34f4175de8ff6622bed116a9810bfca9ec5eceda6a1de95d46f7170fb63f1345dc1886efd168f1daa8c8498d2b3c8d7 WHIRLPOOL 45f993dbe650009a25cf2ba684830eb4a0d17d479ccd91dbc919a3735f8f54f1bac00c503c3bde3e562a0789d1702ebeb62a904e596cf748cbb928be080b2d01
+DIST instantclient-jdbc-linux.x64-11.2.0.4.0.zip 1562474 SHA256 07df3f6fc76b0cba17534e1d79a4d14fca6e42a1fe803cc2f33edc6e5e2ab7ac SHA512 289a08bddc81687b73a42fb35ae6ea294dd8f536ae9d3e95142ab78ad72eeebf66947fa6f5585e48e35b7f92e65fe6a295fb564b8353d389e76bfecf35c48c18 WHIRLPOOL 6530de00fc8a2a30ed6f37a735355b65c068971f2e7f95b58a60a6d111161ce596715eeefc04dc7ee8d39deeaa2fb46bf3481e2dfe982e4696c4cd7d1fc2185d
+DIST instantclient-jdbc-linux32-10.2.0.3-20061115.zip 1482939 SHA256 23536b1bf8113f231e2f197e1011b6ddf04a79c5ccedae542cb6100eae28a547 SHA512 b43f9606abbd25f9acc9089d4ab8a2ce8da9b983f9f4577d23ee777a83de5debcf1e5dfd3a7ed0774a89a2fb1444d753e9ba554483fbbf397af21510b40d064d WHIRLPOOL 4533687485666220aa0bcf03d66ecfe89ffe7c3f71f347f41559b4fcd88ff4166c0e8b1bd9bea359124fd79a0dfe5993e576eea473024cc27e16c35e226d8605
+DIST instantclient-jdbc-linux32-11.2.0.2.0.zip 1562555 SHA256 25b58a2a42407d665af6e913066de716d9fe16ebda140954b8f03b71056871cb SHA512 0383eb44db329cc3dad9cebf8b84d7fe9b7e01271afb5aece34397184a89fc42b9c3cabe6319f0ac639c7883d3eb8cabe92aebcd3383a908a4aa9807a943bd3a WHIRLPOOL 9eb95eb102c7c41e629db9d9cb76c3ac922ad2e130f8d4b846c6e35cadd61951e52b067b67f3db3da2b3a06f32901cabd0615f1c81f73ff979780939a2a26b3c
+EBUILD oracle-instantclient-jdbc-10.2.0.3.ebuild 1479 SHA256 7b400d44dde899ce9637b11d4a17755cbe9770a7cf76ecb4d90c97d07b0ec955 SHA512 9116f09e2b492bbe5e9b4d820e17bffc5a0d76f3c746d38349830869a7d62c53bef2291b4f36f020ad77b39561e5319371c975c091723b5f7d99e8e6819cd4a5 WHIRLPOOL b562c0451e531ab3ac026f8042e9f904d2dd2c154896ce2e0c2375c1e889056e3eb6da1e90acf02552c23003eb826cee6cd7be09bc7b442448a6f75555532553
+EBUILD oracle-instantclient-jdbc-11.2.0.2.ebuild 1351 SHA256 fbfc56c2fb4d1a988ceb7f38a82a5e7840c46571e270f5ceaf75b412cdb654a0 SHA512 f79fb9478d13010017b1373b30209c9bf95ed4f57fabb8810556e3173b29f7e4734a7ab56cae5b8ce8a2ee3922e94d690597b4962b84b6d333d5b3ad1a5c8470 WHIRLPOOL d93653cd0245c0292bed9a62ed4c2013f81ab87348ed5fe76fb005e73cf9bfdf5a320e6f65bd7a36bca6b4e95604ab80d1f51478243103c76ac0af550f41a138
+EBUILD oracle-instantclient-jdbc-11.2.0.3.ebuild 2156 SHA256 7e2846f4107925fbc981b1b7708292251feb78d26570387282f82d0ea8902385 SHA512 ab75d9b8d07156987e55c734a2e4ae1f73f5ff8261f944481b3ad49885f15d9c3ed6c20cadf48081efde9b70f3b9bf3a6bb2546f172c02ab1955ed36fcfa137f WHIRLPOOL 3fb9dac9e064bbc54e82e156dfcaed793ed5870e79956b84ce9c11d2df164244ea4b01d3557d6b4964d7e6aa0f9f390ed08abd052b3647a772300ac720607204
+EBUILD oracle-instantclient-jdbc-11.2.0.4.ebuild 1940 SHA256 d2282a2ff9459b5fb7723072c79c73508e92b8215aa856e95e9a43ecade77d04 SHA512 02c6e4f6e355c47ca49f179ed5ba429e9129f7a23dbaa544f8e63c65e76d3aa9e9ce5e3d5ec72bda68eacfa7b368e7b00ef79daf0ed7e02ff9c125e47807f453 WHIRLPOOL 5fc1dfc8017fb492ca207b5fb7aa1ca2ed859308ed6b2dfa9ef237ccc4e9e581444148799c2a341ae8fd80abbebc7ddd3c9b528b90fea91a5b35e4f8af516a32
+EBUILD oracle-instantclient-jdbc-12.ebuild 446 SHA256 d43079e872675f689a2de594c513d1b67be97e2032892582de6835e71f5f5d23 SHA512 cf45109d2f12847fee0eb95f9de3b72607669dde197e3b1859847b1934568b29b0059c1eb2fb83e08e5ace86078d357df26ee0e8b3dbe44a6372ea9387ea720d WHIRLPOOL f7753c3630cb003274cb51ef28adb05c400e4099e092fe9220f3d9a83af47ee7b781e444c686eb490f4a184d01999027cd6e34ed69bf0b41cc3f8d54ab7ad709
+MISC ChangeLog 3055 SHA256 543b9ce4871fb82c308d3340227bfce7ce6afef19414552e03f98b4acaee9c01 SHA512 31df1fff72cf0fcf294a5e0efbe006cb4387467f665d44ece70efdd94563849f11efbaa6c3e7d82ad8e98cf51690da57b603d1c95a020eff1f1d9f6e9adecca5 WHIRLPOOL 64b0aface9d5ed41e4fc9fde413a412763a29ec97c62f13a3279d9f1f944081273364c34af297046d2050a9daea78778f01b5d58cb1e6102c396f12ecbb5bff6
+MISC ChangeLog-2015 7401 SHA256 7bb7a5e3113d9c1cca026cccbd8c1ad8f96e88348a047ebbe4e8ceb7a38f2b49 SHA512 ff9b5e2f4cd003eca60931abc2870591869a28697aa8fc188aa31ada5c07d9905620843abab62b54cc375d5d7f672e3a29e244bd2abb2a283f45bf7f4c54b9f3 WHIRLPOOL 95cece9cda579318e5d7d1758875e885af16e1afc2d3f27d6474316f55aa5eeff47af635b3abb6cd345d3e9eaa88fdde5593eee1b186d244b34e04e325bb751d
+MISC metadata.xml 344 SHA256 d174d68828743d3a86a8ef41b7191a0e129eedf2ad7b120598a3b0c10f72e2d2 SHA512 650f29483a89a65b3855aeb65fc486d38365660ed2a67e9ab18e96534c5dd453d7897b0443fd1b12dfceaee3b542840ab1648c36b07728014dfd57ac1c95e3e9 WHIRLPOOL c2fbc975d357d3ec1e47ebc7a44103745c119d46258274f84bafa939f2ddd2968fab0a4ae2ab55dc79bc54807c164960f6ba11e58edeb1aa1e398ce03594db0f
diff --git a/dev-db/oracle-instantclient-jdbc/metadata.xml b/dev-db/oracle-instantclient-jdbc/metadata.xml
new file mode 100644
index 000000000000..8b032de8ebf6
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>haubi@gentoo.org</email>
+</maintainer>
+<longdescription>Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications</longdescription>
+</pkgmetadata>
diff --git a/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-10.2.0.3.ebuild b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-10.2.0.3.ebuild
new file mode 100644
index 000000000000..0831b57dfc7f
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-10.2.0.3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}-20061115"
+MY_P_amd64="${PN/oracle-/}-linux-x86-64-${PV}-20070103"
+
+S=${WORKDIR}
+DESCRIPTION="Oracle 10g client installation for Linux: JDBC supplement"
+HOMEPAGE="http://www.oracle.com/technology/tech/oci/instantclient/index.html"
+SRC_URI="amd64? ( ${MY_P_amd64}.zip )
+ x86? ( ${MY_P_x86}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+RESTRICT="fetch"
+IUSE=""
+
+RDEPEND=">=dev-db/oracle-instantclient-basic-${PV}"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+pkg_setup() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+}
+
+pkg_nofetch() {
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "and download the JDBC supplemental package. Put it in:"
+ eerror " ${DISTDIR}"
+ eerror "after downloading it."
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip
+}
+
+src_install() {
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_10_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins libheteroxa10.so orai18n.jar
+}
+
+pkg_postinst() {
+ elog "The JDBC supplement package for Oracle 10g has been installed."
+ elog "You may wish to install the oracle-instantclient-sqlplus (for "
+ elog "running the SQL*Plus application) package as well."
+ elog
+ elog "oracle-instantclient-* packages aren't installed in different"
+ elog "SLOTs any longer. You may want to uninstall older versions."
+}
diff --git a/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.2.ebuild b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.2.ebuild
new file mode 100644
index 000000000000..b7ff03fbfc8b
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}.0"
+MY_P_amd64="${PN/oracle-instantclient-/instantclient-}-linux-x86-64-${PV}.0"
+
+S="${WORKDIR}"
+DESCRIPTION="Oracle 11g client installation for Linux: JDBC supplement"
+HOMEPAGE="http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html"
+SRC_URI="x86? ( ${MY_P_x86}.zip )
+ amd64? ( ${MY_P_amd64}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+RESTRICT="fetch"
+IUSE=""
+
+RDEPEND=">=dev-db/oracle-instantclient-basic-${PV}"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+pkg_setup() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+}
+
+pkg_nofetch() {
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "and download the JDBC supplemental package. Put it in:"
+ eerror " ${DISTDIR}"
+ eerror "after downloading it."
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip
+}
+
+src_install() {
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_11_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins libheteroxa11.so orai18n.jar
+}
+
+pkg_postinst() {
+ elog "The JDBC supplement package for Oracle 11g has been installed."
+ elog "You may wish to install the oracle-instantclient-sqlplus (for "
+ elog "running the SQL*Plus application) package as well."
+}
diff --git a/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.3.ebuild b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.3.ebuild
new file mode 100644
index 000000000000..303d9dbd2c5b
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.3.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN/oracle-/}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: JDBC supplement"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ x86? ( ${MY_A_x86} )
+ amd64? ( ${MY_A_amd64} multilib? ( ${MY_A_x86} ) )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch"
+IUSE="multilib"
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
+
+default_abi() {
+ [[ ${DEFAULT_ABI} == 'default' ]] && echo ${ARCH} || echo ${DEFAULT_ABI}
+}
+
+abi_list() {
+ if use multilib; then
+ echo ${MULTILIB_ABIS}
+ else
+ default_abi
+ fi
+ return 0
+}
+
+set_abivars() {
+ local abi=$1
+ # platform name
+ MY_PLAT=MY_PLAT_${abi}
+ MY_PLAT=${!MY_PLAT}
+ # runtime distfile
+ MY_A=MY_A_${abi}
+ MY_A=${!MY_A}
+ # abi sourcedir
+ MY_S="${S}/${abi}/instantclient_11_2"
+ # ABI might not need to be set at all
+ [[ -n ${ABI} ]] && MY_ABI=${abi} || MY_ABI=
+ # abi libdir
+ MY_LIBDIR=$(ABI=${MY_ABI} get_libdir)
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local abi
+ for abi in $(abi_list)
+ do
+ set_abivars ${abi}
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " JDBC: ${MY_A}"
+ done
+ eerror "After downloading, put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local abi
+ for abi in $(abi_list)
+ do
+ set_abivars ${abi}
+ mkdir -p "${MY_S%/*}" || die
+ cd "${MY_S%/*}" || die
+ unpack ${MY_A}
+ done
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ local abi
+ for abi in $(abi_list)
+ do
+ set_abivars ${abi}
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${MY_S}" || die
+
+ ABI=${MY_ABI} dolib.so lib*$(get_libname)*
+
+ insinto "${oracle_home}"/${MY_LIBDIR}
+ doins *.jar
+
+ eend $?
+ done
+}
diff --git a/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.4.ebuild b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.4.ebuild
new file mode 100644
index 000000000000..75696a7a33b6
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-11.2.0.4.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib-minimal
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN/oracle-/}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: JDBC supplement"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ abi_x86_32? ( ${MY_A_x86} )
+ abi_x86_64? ( ${MY_A_amd64} )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch splitdebug"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
+
+set_my_abivars() {
+ MY_PLAT=MY_PLAT_${ABI}; MY_PLAT=${!MY_PLAT} # platform name
+ MY_A=MY_A_${ABI} ; MY_A=${!MY_A} # runtime distfile
+ # ABI sourcedir
+ MY_S="${S}/${ABI}/instantclient_11_2"
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " JDBC: ${MY_A}"
+ done
+ eerror "After downloading, put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ mkdir -p "${MY_S%/*}" || die
+ cd "${MY_S%/*}" || die
+ unpack ${MY_A}
+ done
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${MY_S}" || die
+
+ dolib.so lib*$(get_libname)*
+
+ insinto "${oracle_home}"/$(get_libdir)
+ doins *.jar
+
+ eend $?
+ done
+}
diff --git a/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-12.ebuild b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-12.ebuild
new file mode 100644
index 000000000000..9936028925c9
--- /dev/null
+++ b/dev-db/oracle-instantclient-jdbc/oracle-instantclient-jdbc-12.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Transition package moving to single ${CATEGORY}/oracle-instantclient package"
+HOMEPAGE="https://bugs.gentoo.org/show_bug.cgi?id=524922#c12"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+ >=dev-db/oracle-instantclient-basic-12
+ >=dev-db/oracle-instantclient-12[jdbc]
+"
diff --git a/dev-db/oracle-instantclient-odbc/Manifest b/dev-db/oracle-instantclient-odbc/Manifest
new file mode 100644
index 000000000000..b23723160a38
--- /dev/null
+++ b/dev-db/oracle-instantclient-odbc/Manifest
@@ -0,0 +1,13 @@
+DIST instantclient-odbc-linux-11.2.0.3.0.zip 273840 SHA256 e327fc2627d792a296085d15638eb79df85ce4fcc16ed5c7d304d406131d5d3b SHA512 4d928e9eb3deb26db7a95a0e5417bd9355e97956d9394dc2792752fd45002b0abc3463fbb7f337f4731084aa6006d1ff635443c5503f94c6bd97d1bae7245885 WHIRLPOOL 8987a7dc11e3282eabf26b7c1db3127a940c20d95bb9423b39db5a982660b4c8071ec7d00d84edee64f94cb9dcdb22edb5fc545f738ad1f242125a2b9678c69d
+DIST instantclient-odbc-linux-11.2.0.4.0.zip 274999 SHA256 5d44811162df4647e67fceb9dfa48b8d96e30c9238e6c889dedb48b822251c74 SHA512 64d75c6f9aa4e5b74da12a2a293e6ee7017017a12a724596d51606d3a8d7a9d9653c158d389a5faeb02893ca6a6a93650605d71f885f9439427847583f5cc820 WHIRLPOOL bd2948f4b8076cb5c3381fb509d3b01c45d46b0f0571630c2196f98c710e403d3c8b2022fb11df6363f7d9ed04ba931b862028a51ff2361084a8f6f543a8de15
+DIST instantclient-odbc-linux-x86-64-11.2.0.2.0.zip 308445 SHA256 1d24d3f7b38a7d1cd1fa67c34a4c64aa556c0e4c93777bc7ceb0ee32e3504dc0 SHA512 05d38d08dca3a1ec3dab8cddfb3914c330fd0f737221005bd3c90aecda10117df08a592a8113feb397d9ea7ebb2cab05d427e278d5009b54ad25da7aed9c95b8 WHIRLPOOL a8f0e52a03f738120183f55866ed72a05a97898f346ced954cd7606d1d56e42b7a190238405fb0424e51ff7495a61f80d8c686bf0fdd4002756b9373ee6c7055
+DIST instantclient-odbc-linux.x64-11.2.0.3.0.zip 309061 SHA256 78584746ada1ed09e5587e3f39980e45c5c4d7c7fa4aaca3bd606be08c9f2e61 SHA512 a18c040fc780f893ea22fd6c79b3299d9327975a768a6518622a8ff522dd29a7019494ca7a1227483098f13afe1af1655611a32e06806bab94ab2fce2dc55e3a WHIRLPOOL 48a0c6d7cb6a892cbf492f62da8b1b0df5ffdcd0fd99012079c5fcae0e9b199fe68ed39160b50c12e4e6672ff7131c926f383709bb9853d7c9a33c195e792504
+DIST instantclient-odbc-linux.x64-11.2.0.4.0.zip 310560 SHA256 b6856d3bcc22715ba613cdf1b5d58b987bafcb0ee4fc79fa2106da118082c0f8 SHA512 19f999207e5ea2b5db18b40c0eb40c6ec1ea8a3117915a723338e5c423122b747c5e371446d631c00a5c01005453f85da1d2e680a2c1771a495dc0b68812df69 WHIRLPOOL ec813ad4736dc14fcd6073febf8559dc42a3612dec798e08ada972b53f4220ad76b4139cd74fc87547fd28ab24d9a21f4ffa2a4343e2f5e8e117063c64b044f5
+DIST instantclient-odbc-linux32-11.2.0.2.0.zip 273410 SHA256 a09d8c913bdb8d6afc84fe42b17505cceccac620077ce4a21c8db313773000a1 SHA512 eae68ebdd94f579761b0510fcac5e33b441833c0bdf957a9324e9d1c8146d7cea35419b18f72bb16730e95ad9e45a1c4c2d8085e252331e545f93657876a558f WHIRLPOOL 1548d56a9d51996b029dd44a462e20fcd1df7cd57b93f0ffbe392078d02f5d9cf902a55455cc9df7cfd66fe87467674dccfd17b6149685b2f63ef7bc6c9e3bfd
+EBUILD oracle-instantclient-odbc-11.2.0.2-r1.ebuild 1546 SHA256 c9b26101e2abf14d315efc08797014cd5dcae3f3adb9e1fc9060d728e2603c94 SHA512 c2ecd0075b1b9807080f44fee19a05a4c2b03135fbf715fb41d53655a59775d6ed427a22a4864c3c4edb2ece613e04fed4d06b287d52b3275e56af5e8e2cf14b WHIRLPOOL 784dce0f9fa00323642002e729d10c0420b7039398268c514055c7c82689e64db2672a2ef04e936d4fa00bba3d6259b45eb32c86c2406ccf739aa3a3d0d98c5a
+EBUILD oracle-instantclient-odbc-11.2.0.3.ebuild 2353 SHA256 3879dd7ffbb2889b4101a2aab1f5a57c7eddbfe4961ef6f833394ef2080c9707 SHA512 598894987ea0d942faf418f1041e0cd71929c748cb12e4f0039195cb06dff3de6a058ee59665b9981944c1565d0c4bb3face220f5f9c552804033053deac9f8f WHIRLPOOL 06abb2aed152d71f3b40e11d55faeea2913b3117a84fc6f1c9349654c17547bb2046dbae7c7f4db91529c7bf273b9451ce4eca1e176cf6399439b5e2ea87d428
+EBUILD oracle-instantclient-odbc-11.2.0.4.ebuild 2083 SHA256 6aab3d8833f033e9b598f15ccd00cb2d1efc29997de9571d16941e6dcf2e1cd7 SHA512 41b13fd6d264e51176e54496cbd149893649e6ffde2cf38098ee71adfb07b50eb20e00b840ec1f263910df0341d2ba33bd420ae51203102b93a2b3f1e1be3741 WHIRLPOOL f0544f10007553d2078b265214cdc18a03aac04f017fdcefe54dcb9e9ba1eb901c2d026d20997e1423be4ae5fa7ed06b2ce0dda939f23bfaf37a9eff8662e05e
+EBUILD oracle-instantclient-odbc-12.ebuild 446 SHA256 f04b88b11ac5f7c38fae04e7bdc6425c620a4132ea544d941a09fec8439db5f9 SHA512 093eea8b2f3c0873ca091a2a353132d35eb73ee707cca22b6b59ccbf3bcca72617b4a9f2f7d08db3a86f034b6f9a849aba9c09bb966f6f96a3ef9c92aaccfcac WHIRLPOOL c1b780b79fcaf7a7b0cfd23d064cae8362a107fe42ca514202376536dc4ae06138bb05fc5ba12a34f17378adc28d4839471cb1e57e50114aa7abb4983928940e
+MISC ChangeLog 2964 SHA256 e2d7c00c049a9e7e5af481c2a8e8d9db08bc12b325da53e0ca1626a48d9e80f1 SHA512 0f2c51fdd5d5500183946a7ad53e5fb579773597df5d792bb7abd3e36f7c548367cea564934b1bc68cb29b56984555510e7df348fc81a2572a8290522088865d WHIRLPOOL 3d12b3cdbaa8ab2a3d3096d73dd7ffdfb5e756903678f12cddd4749f6d607fd7df15957724b1c449e5e1e5305b28f19a12225c3c74b30b1530756226790fc86d
+MISC ChangeLog-2015 2967 SHA256 d013ecf3ffb29d907021b549ab2468328b03c624608d925fcd64efc28f89fc79 SHA512 632ebbf9ff2cc172be35b83a1fa9d0a6d1eb2a3f5eced1744ed779bf3b5745ca7fa2d2d3bcee1741f338a67f57c70308b7c824117d639899d19a70c525efb4f3 WHIRLPOOL b02523a8a82cce00138b8665509456fdd421fcbd34c4e0bc6ea467507091eb3c1b71f2dfea69b74a8be1e789dc890c2bc346422bbe3f2452c5f28fe19b60e287
+MISC metadata.xml 290 SHA256 9b425fe7545d8624fd6ac6f5992ef4e46c33df0dfa21d51aec5e3dca621bf312 SHA512 2aadc171bc54a828cc74443808808b03df115c72f6589d254bbe408c87a10bbdf6cff4da820aff86a917b4fdc95818d605293651085afcb876c8e3063778287b WHIRLPOOL b9c01e40a50f7b371cc091f7f16c616fdb36a5ffce80e11aa56a3e8150fbf9026d1110fd694d1d4b017391d87485e90f3519054a3c0c29576660beefbcddbf95
diff --git a/dev-db/oracle-instantclient-odbc/metadata.xml b/dev-db/oracle-instantclient-odbc/metadata.xml
new file mode 100644
index 000000000000..1e9748f0e268
--- /dev/null
+++ b/dev-db/oracle-instantclient-odbc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>haubi@gentoo.org</email>
+</maintainer>
+<longdescription>Instant Client Package - ODBC Supplement</longdescription>
+</pkgmetadata>
diff --git a/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.2-r1.ebuild b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.2-r1.ebuild
new file mode 100644
index 000000000000..2c2fc96ba9b9
--- /dev/null
+++ b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.2-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}.0"
+MY_P_amd64="${PN/oracle-/}-linux-x86-64-${PV}.0"
+
+DESCRIPTION="Oracle 11g client installation ODBC supplement"
+HOMEPAGE="http://www.oracle.com/technology/tech/oci/instantclient/index.html"
+SRC_URI="x86? ( ${MY_P_x86}.zip )
+ amd64? ( ${MY_P_amd64}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="-* ~x86 ~amd64"
+RESTRICT="fetch"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="dev-db/oracle-instantclient-basic"
+
+S="${WORKDIR}"
+
+my_arch() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+}
+
+pkg_setup() {
+ my_arch
+}
+
+pkg_nofetch() {
+ my_arch
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "select your platform and download the"
+ eerror "ODBC supplement, which is:"
+ eerror " ${MY_P}.zip"
+ eerror "Then after downloading put it in:"
+ eerror " ${DISTDIR}"
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip || die "unsuccesful unzip ${MY_P}.zip"
+}
+
+src_install() {
+ # library
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_11_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins *.so.11.1
+
+ # fixes symlinks
+ dosym /usr/$(get_libdir)/oracle/${PV}/client/lib/libsqora.so.11.1 /usr/$(get_libdir)/oracle/${PV}/client/lib/libsqora.so
+
+ # odbc_update_ini.sh
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/bin
+ cd "${S}"/instantclient_11_2
+ exeinto /usr/$(get_libdir)/oracle/${PV}/client/bin
+ doexe odbc_update_ini.sh
+
+ # documentation
+ dodoc *htm*
+}
diff --git a/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.3.ebuild b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.3.ebuild
new file mode 100644
index 000000000000..e0fbfdf509ab
--- /dev/null
+++ b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.3.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN/oracle-/}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: ODBC supplement"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ x86? ( ${MY_A_x86} )
+ amd64? ( ${MY_A_amd64} multilib? ( ${MY_A_x86} ) )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch"
+IUSE="multilib"
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
+
+default_abi() {
+ [[ ${DEFAULT_ABI} == 'default' ]] && echo ${ARCH} || echo ${DEFAULT_ABI}
+}
+
+abi_list() {
+ if use multilib; then
+ echo ${MULTILIB_ABIS}
+ else
+ default_abi
+ fi
+ return 0
+}
+
+set_abivars() {
+ local abi=$1
+ # platform name
+ MY_PLAT=MY_PLAT_${abi}
+ MY_PLAT=${!MY_PLAT}
+ # runtime distfile
+ MY_A=MY_A_${abi}
+ MY_A=${!MY_A}
+ # abi sourcedir
+ MY_S="${S}/${abi}/instantclient_11_2"
+ # ABI might not need to be set at all
+ [[ -n ${ABI} ]] && MY_ABI=${abi} || MY_ABI=
+ # abi libdir
+ MY_LIBDIR=$(ABI=${MY_ABI} get_libdir)
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local abi
+ for abi in $(abi_list)
+ do
+ set_abivars ${abi}
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " ODBC: ${MY_A}"
+ done
+ eerror "After downloading, put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local abi
+ for abi in $(abi_list)
+ do
+ set_abivars ${abi}
+ mkdir -p "${MY_S%/*}" || die
+ cd "${MY_S%/*}" || die
+ unpack ${MY_A}
+ done
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ local abi
+ for abi in $(abi_list)
+ do
+ set_abivars ${abi}
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${MY_S}" || die
+
+ ABI=${MY_ABI} dolib.so libsqora*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libsqora$(get_libname) ]] ||
+ dosym libsqora$(get_libname 11.1) \
+ "${oracle_home}"/${MY_LIBDIR}/libsqora$(get_libname)
+
+ eend $?
+ done
+
+ set_abivars $(default_abi)
+ cd "${MY_S}" || die
+ dobin odbc_update_ini.sh
+ dodoc *htm*
+}
diff --git a/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.4.ebuild b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.4.ebuild
new file mode 100644
index 000000000000..716c88d51cad
--- /dev/null
+++ b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-11.2.0.4.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib-minimal
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN/oracle-/}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: ODBC supplement"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ abi_x86_32? ( ${MY_A_x86} )
+ abi_x86_64? ( ${MY_A_amd64} )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch splitdebug"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
+
+set_my_abivars() {
+ MY_PLAT=MY_PLAT_${ABI}; MY_PLAT=${!MY_PLAT} # platform name
+ MY_A=MY_A_${ABI} ; MY_A=${!MY_A} # runtime distfile
+ # ABI sourcedir
+ MY_S="${S}/${ABI}/instantclient_11_2"
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " ODBC: ${MY_A}"
+ done
+ eerror "After downloading, put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ mkdir -p "${MY_S%/*}" || die
+ cd "${MY_S%/*}" || die
+ unpack ${MY_A}
+ done
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${MY_S}" || die
+
+ dolib.so libsqora*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libsqora$(get_libname) ]] ||
+ dosym libsqora$(get_libname 11.1) "${oracle_home}"/$(get_libdir)/libsqora$(get_libname)
+
+ eend $?
+ done
+
+ dobin odbc_update_ini.sh
+ dodoc *htm*
+}
diff --git a/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-12.ebuild b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-12.ebuild
new file mode 100644
index 000000000000..e6e33c8c69f7
--- /dev/null
+++ b/dev-db/oracle-instantclient-odbc/oracle-instantclient-odbc-12.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Transition package moving to single ${CATEGORY}/oracle-instantclient package"
+HOMEPAGE="https://bugs.gentoo.org/show_bug.cgi?id=524922#c12"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+ >=dev-db/oracle-instantclient-basic-12
+ >=dev-db/oracle-instantclient-12[odbc]
+"
diff --git a/dev-db/oracle-instantclient-sqlplus/Manifest b/dev-db/oracle-instantclient-sqlplus/Manifest
new file mode 100644
index 000000000000..08b68a956e9b
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/Manifest
@@ -0,0 +1,17 @@
+DIST instantclient-sqlplus-linux-11.2.0.3.0.zip 796570 SHA256 338de20fb4b52359c53969e8d6c5441629a0ddaf676ab98edb19206f21edce43 SHA512 241d812b3955b11efba7764f463417e79dd973ce7ad0624144e661403b71b1c4fb091c6e42d05759eaf74355dfe432970375064d4018cae9ae67cd1401095460 WHIRLPOOL 44543784f7671ad923fce517f451b797c5fe37fea14249689493b9b12846fce74dfa47fbc02461149dccba760ecf70efe833ab745a2050600dffb036de2b75e7
+DIST instantclient-sqlplus-linux-11.2.0.4.0.zip 792608 SHA256 b42d41cae8122be31048ab88693f23ceea0dc11a63dae94644fb36566a5fec4f SHA512 8f5ff27043a036eab038080bbdc056325cc2c197e12de34e74a8da17bf69b44e4fd4200b638881d86fdf1dc1450d8e1d033daaa56386bd2c8784d556ba0093ce WHIRLPOOL b993db311d46246ca04b3e8c1e967dd7587e7108eaeb3af6978bce45a7b7b5d1614392c69784950e489a0c73e08fc02d643fb200b59e420a0bf8830d176ef568
+DIST instantclient-sqlplus-linux-x86-64-10.2.0.3-20070103.zip 789884 SHA256 8dcc95e3bf5723a7b1d6deccce049490bc70d99c0b9ac6ef13320b6b426303f6 SHA512 5800c0f1c39a0ec4a2da1bc09a9102d62d4efb42618dfb5a2494da81c9268c1e29af5576dee72917019b12d1ed6c55ec0f80b96017a6812f6c20c660180c324b WHIRLPOOL e92c0e8529e248ea9b60d1d5c81acd11d569183e9459933ce08c0e815e2d43cef2f5a7ecec4c2c0fe3d9321c42c813a35d748107a9e58c15d2c7b0c36b0a3d44
+DIST instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip 837382 SHA256 6975856f27c66d44b5c57c9ffa877f8aa5648ae8e4bda925d719b8609bbbf285 SHA512 cf68f1280ef5094083c2b0f0e0f255b0b6e037f4e5a3e28e29b2cdf84a5561aaf23462eddbe46066f3f5015d95d79879637dd54b4a16bda2c9b56372de886aea WHIRLPOOL f5cce3d45c0e136771f8c2c43499eae7d84d8a0d59a3522160e79efad4151c9a3dede84eff43b95793b07ba0ee0191d6579919e42a11bb0fbf0a1193702b83e9
+DIST instantclient-sqlplus-linux.x64-11.2.0.3.0.zip 837574 SHA256 b1df9ed4d5a0e51caeed1641d973e4c90fce48604069ab9b7278a87dc2fc8547 SHA512 55bbac5e8267a4de2c7f9f6750f0e38dcf7c775bccc2e1e05df7fda9e6ffa7d394776e605980d8b67176acf52ba88f2dcaa959934740a1ca6f91d10b12d14024 WHIRLPOOL f172391bd05845ef88a0c4951e4d46b81e9fd5326709da057deb747cd34f4098ca22189dfc0d7de70a8da8adf86fd48086a2976d6397dfb7386d666f73ac218d
+DIST instantclient-sqlplus-linux.x64-11.2.0.4.0.zip 834491 SHA256 618357a8dc470de19214294f8fd8e2a466544355abc8ebfa2032c3c276e817e9 SHA512 b7180b5667e604564cf379b9eb55a2fc8994b87cfb993e728b4c1bdd297cab134a55580018429bdbb2b101ebdf8a350bacc1ddf5a30e1cc419092054c79a108b WHIRLPOOL 6d69932bc46a9a9475bf2df082566c0b2b285ceeefd10efec87e2899d9c30f4db032293020abb8a479c61dbb350079e2d2c4758f089f2f5cce03c485f5ca670a
+DIST instantclient-sqlplus-linux32-10.2.0.3-20061115.zip 741699 SHA256 aad12fd25a234fec76d672f7993911b9f267732b7bf244d76f44bc212edbd76a SHA512 7508ef2edef5a214d9c5ab12c282f57550167233d5b26256d6e1e054eb9c3993891191e69691f20064332fb41e6ffafcdd0b2423db44e4094660832a2796e0d3 WHIRLPOOL 0b79792d5fa0eb3f69b63f0ef4db2499f4e435b8375e3b9328557f00a9139f63b7532851004f5d8d822c93c62f4e82d5a68b34154782931b62d1044258103150
+DIST instantclient-sqlplus-linux32-11.2.0.2.0.zip 795691 SHA256 35f1d447b0b368bcafd4fcff6bb04139e568176f0081a60aea1939099754ea0a SHA512 c2be8bd4cd463c0463674b2665f9b5f55cf2a9dd396a99902d1a8e25424f6ac0d39ff45cf5b9c6c65e36cfaf77fb89acd786ee44b8092db7c1934cd51ad0099a WHIRLPOOL 04ef63f3a954a2bc1bec65f4a1d9741a45f1c42849c75151486d0ec6f97398df49e506950069efc68ce5b560f67784b67c08afa39c17a3479a888b45dbd91446
+EBUILD oracle-instantclient-sqlplus-10.2.0.3.ebuild 1882 SHA256 1a8efc9d9c6338d3d0b8fff78167caf055229d142232681d4102d5ba59ec9e3f SHA512 cff681edbfd775d7a48b2b650f33dfa99d59f56bfc84169a7aa84ac21832f5240143bfe9a8eaf0d9fa433167d49a768315b3bd8bd8601a867e5abe49c1124de1 WHIRLPOOL dca9888e8dff061792a0e51c921a5d9da1e08bd9ddb6e64fef55b760d9b305e4b5a39303184fd418fea84f2148a3aecaf98cfbd796e5b79dd73cb2d5185361f7
+EBUILD oracle-instantclient-sqlplus-11.2.0.2.ebuild 1821 SHA256 7d47ed747407ce0446022ea834f02b2a295b82632c0f3e90bce074b712c6f4dc SHA512 4b1e65c92028155ef92d5afcaaeeb33650635fdd334f541ae157298a81cd7af7adc3ca6b2beb0ffeed90e84b262033aa27bec2db3015cf7799d3d1710c813b56 WHIRLPOOL 5578100f36ee7c2f466db995112cefaadbc8dca52d4a507a319d0659b5bca29b15699f6bbba3736db403585491b222d8f905471a01f091f29de68109fd9346da
+EBUILD oracle-instantclient-sqlplus-11.2.0.3-r1.ebuild 1550 SHA256 8f2aa5f489897e6c6c0ae3004888e9ad256bdaf65985f6e6387c3705ef38e4e6 SHA512 09b716cbfa86620541cd8b9840c80e73b4b0de080421367fba7cade2ffd43426b63985ec9085fb7711bd257f65dcb34396f594ce5e6c3992f276a77836469dc7 WHIRLPOOL e52a482b6864a73c3c45fc950ac3f009ec64ff507c0ded9c8477cbd85946f5a7104feb7e7d93edec9900578a46c69945dee9547e1f792c7b965c22757c8bb137
+EBUILD oracle-instantclient-sqlplus-11.2.0.3.ebuild 1483 SHA256 05bb3055407b2f909f8382d9d31e524f5b93acdad89b6c0b6bbcbce5abc9bbc9 SHA512 c64c6d2e3f059bfeb0b4dfaf974952599327ff9af7045a51a4109a2b2505df441872effe01b4c4dfbe5a01e8ee58d65fa69e84c4b6943092fd3e6b377e35bd92 WHIRLPOOL e23c94e8bc5d4a973881b3f49a24551f3ec16030e92e6208dd6e20c8244365b2c9d15b0e8121bea6b35260e826cad7328ee284fa630a724eb4be0ec55c3de66b
+EBUILD oracle-instantclient-sqlplus-11.2.0.4.ebuild 1552 SHA256 b06dd29a9d5de6c9394bd458597e9316c80c49cd84a747db567c1f6f545720bd SHA512 dc5a6ea8f004fd66ea4e4a1cbe5c96ba9f1ccc573c208735c78eacd6b678b2b4cd3bb8c3da57f6fb0f45e3fe402cca0d4c4eaa4431e08dbeb973426134c1bfa8 WHIRLPOOL fff7a4f69ea70147893b59cd804f05492ede7ed9dc1cacd564d3111584b6dfc732b362504d6dd2059728f7e45e5f36d023b43f2801163f8f9247f863fde5f041
+EBUILD oracle-instantclient-sqlplus-12.ebuild 449 SHA256 ff6b6562f3065a261d16dec836964aef83c854ce8338261cc7a0964897af76a4 SHA512 d09d490d5b195a486ba5afd25fdbef0dd2e99f04cfadc17182dc52344c8620c6114a06c0cbcdba38fc59a578ac5e8468aa3fd81fbf4b4de15018c4103e7faed1 WHIRLPOOL c728c66253e07751ad2ebf33a5a5d2e0d72093aeaef3411339a65a690050287a02f98fda8bd5f60f3691f3fc60b84933386a2ea6e152b8cd8e0a4e730f260727
+MISC ChangeLog 3203 SHA256 f115ab36ad79c5f7ef5a31101a757c5f400e27bcf21bd13d3241470585b8eb79 SHA512 f60484c882ada7f8f0ade9aecfc6c0d55f89e65e9cfa622e59a5297b9a0ee847a9ad94c04190817fb340f567af6da9ba14b5323851441b8a7466ed9fa733a402 WHIRLPOOL 7398fa576a82a7438c6908b1da88f2768d33a5e3deb067cc6748904356b335f0b117e836934a42b8d95f9049973d2bb42d4af171f1315e2aa2b178a69f87831f
+MISC ChangeLog-2015 8371 SHA256 27d50bdca2a196ead05155b003b20e921d62cc1a49fd043763211c4c6233ca80 SHA512 4643639b3997f2902cd00c049b708da0eea865a9ef5918ace1ba67f26620dae969a3ea122124a708dcb51a460dd1787e1e2ad1f72782deb4428c4121f3ec63c3 WHIRLPOOL c010fc0ab135535422df9595c2a74581fa49457106789f11acbc2daecb60f6f0f613e230bad26ed5974fb3985e4e2b5ad4e945d03e85e0db0cc41180b9254bc6
+MISC metadata.xml 344 SHA256 d174d68828743d3a86a8ef41b7191a0e129eedf2ad7b120598a3b0c10f72e2d2 SHA512 650f29483a89a65b3855aeb65fc486d38365660ed2a67e9ab18e96534c5dd453d7897b0443fd1b12dfceaee3b542840ab1648c36b07728014dfd57ac1c95e3e9 WHIRLPOOL c2fbc975d357d3ec1e47ebc7a44103745c119d46258274f84bafa939f2ddd2968fab0a4ae2ab55dc79bc54807c164960f6ba11e58edeb1aa1e398ce03594db0f
diff --git a/dev-db/oracle-instantclient-sqlplus/metadata.xml b/dev-db/oracle-instantclient-sqlplus/metadata.xml
new file mode 100644
index 000000000000..8b032de8ebf6
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>haubi@gentoo.org</email>
+</maintainer>
+<longdescription>Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications</longdescription>
+</pkgmetadata>
diff --git a/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-10.2.0.3.ebuild b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-10.2.0.3.ebuild
new file mode 100644
index 000000000000..8015a318f8e7
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-10.2.0.3.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}-20061115"
+MY_P_amd64="${PN/oracle-/}-linux-x86-64-${PV}-20070103"
+
+S=${WORKDIR}
+DESCRIPTION="Oracle 10g client installation for Linux: SQL*Plus"
+HOMEPAGE="http://www.oracle.com/technology/tech/oci/instantclient/index.html"
+SRC_URI="amd64? ( ${MY_P_amd64}.zip )
+ x86? ( ${MY_P_x86}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+RESTRICT="fetch"
+IUSE=""
+
+RDEPEND=">=dev-db/oracle-instantclient-basic-${PV}"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+pkg_setup() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+}
+
+pkg_nofetch() {
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "select your platform and download the"
+ eerror "SQL*Plus package. Put it in:"
+ eerror " ${DISTDIR}"
+ eerror "after downloading it."
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip
+}
+
+src_install() {
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_10_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins glogin.sql libsqlplus.so libsqlplusic.so
+
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/bin
+ cd "${S}"/instantclient_10_2
+ exeinto /usr/$(get_libdir)/oracle/${PV}/client/bin
+ doexe sqlplus
+
+ dodir /usr/bin
+ dosym "${D}"/usr/$(get_libdir)/oracle/${PV}/client/bin/sqlplus /usr/bin/sqlplus
+}
+
+pkg_postinst() {
+ elog "The SQL*Plus package for Oracle 10g has been installed."
+ elog "You may wish to install the oracle-instantclient-jdbc (for"
+ elog "the supplemental JDBC functionality) package as well."
+ elog
+ elog "If you have any questions, be sure to read the README:"
+ elog "http://otn.oracle.com/docs/tech/sql_plus/10102/readme_ic.htm"
+ elog
+ elog "oracle-instantclient-* packages aren't installed in different"
+ elog "SLOTs any longer. You may want to uninstall older versions."
+}
diff --git a/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.2.ebuild b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.2.ebuild
new file mode 100644
index 000000000000..de823cc72977
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils multilib
+
+MY_P_x86="${PN/oracle-/}-linux32-${PV}.0"
+MY_P_amd64="${PN/oracle-instantclient-/instantclient-}-linux-x86-64-${PV}.0"
+
+S="${WORKDIR}"
+DESCRIPTION="Oracle 11g client installation for Linux: SQL*Plus"
+HOMEPAGE="http://www.oracle.com/technology/tech/oci/instantclient/index.html"
+SRC_URI="x86? ( ${MY_P_x86}.zip )
+ amd64? ( ${MY_P_amd64}.zip )"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+RESTRICT="fetch"
+IUSE=""
+
+RDEPEND=">=dev-db/oracle-instantclient-basic-${PV}"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+pkg_setup() {
+ MY_P=MY_P_${ARCH}
+ export MY_P=${!MY_P}
+}
+
+pkg_nofetch() {
+ eerror "Please go to:"
+ eerror " ${HOMEPAGE}"
+ eerror "select your platform and download the"
+ eerror "SQL*Plus package. Put it in:"
+ eerror " ${DISTDIR}"
+ eerror "after downloading it."
+}
+
+src_unpack() {
+ unzip "${DISTDIR}"/${MY_P}.zip
+}
+
+src_install() {
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/lib
+ cd "${S}"/instantclient_11_2
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/lib
+ doins libsqlplus.so libsqlplusic.so
+ insinto /usr/$(get_libdir)/oracle/${PV}/client/sqlplus/admin/
+ doins glogin.sql
+
+ dodir /usr/$(get_libdir)/oracle/${PV}/client/bin
+ cd "${S}"/instantclient_11_2
+ exeinto /usr/$(get_libdir)/oracle/${PV}/client/bin
+ doexe sqlplus
+
+ dodir /usr/bin
+ dosym "${D}"/usr/$(get_libdir)/oracle/${PV}/client/bin/sqlplus /usr/bin/sqlplus
+}
+
+pkg_postinst() {
+ elog "The SQL*Plus package for Oracle 11g has been installed."
+ elog "You may wish to install the oracle-instantclient-jdbc (for"
+ elog "the supplemental JDBC functionality) package as well."
+ elog
+ elog "If you have any questions, be sure to read the README:"
+ elog "http://otn.oracle.com/docs/tech/sql_plus/10102/readme_ic.htm"
+}
diff --git a/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3-r1.ebuild b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3-r1.ebuild
new file mode 100644
index 000000000000..2af3e70ae266
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib pax-utils
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN#oracle-}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN#oracle-}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: SQL*Plus"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ x86? ( ${MY_A_x86} )
+ amd64? ( ${MY_A_amd64} )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"/instantclient_11_2
+
+QA_PREBUILT="
+ usr/lib*/oracle/${PV}/client/lib*/lib*
+ usr/lib*/oracle/${PV}/client/bin/sqlplus
+"
+
+my_arch() {
+ # platform name
+ MY_PLAT=MY_PLAT_${ARCH}
+ export MY_PLAT=${!MY_PLAT}
+ # distfile
+ MY_A=MY_A_${ARCH}
+ export MY_A=${!MY_A}
+}
+
+pkg_nofetch() {
+ my_arch
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " SQL*Plus: ${MY_A}"
+ eerror "After downloading, put it in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=usr/$(get_libdir)/oracle/${PV}/client
+ into /"${oracle_home}"
+
+ dolib.so libsqlplus$(get_libname) libsqlplusic$(get_libname)
+ dobin sqlplus
+
+ insinto /"${oracle_home}"/sqlplus/admin
+ doins glogin.sql
+
+ pax-mark -c "${ED}${oracle_home}"/bin/sqlplus || die
+
+ dosym /"${oracle_home}"/bin/sqlplus /usr/bin/sqlplus
+}
diff --git a/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3.ebuild b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3.ebuild
new file mode 100644
index 000000000000..6df81c9c2bec
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN#oracle-}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN#oracle-}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: SQL*Plus"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ x86? ( ${MY_A_x86} )
+ amd64? ( ${MY_A_amd64} )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"/instantclient_11_2
+
+QA_PREBUILT="
+ usr/lib*/oracle/${PV}/client/lib*/lib*
+ usr/lib*/oracle/${PV}/client/bin/sqlplus
+"
+
+my_arch() {
+ # platform name
+ MY_PLAT=MY_PLAT_${ARCH}
+ export MY_PLAT=${!MY_PLAT}
+ # distfile
+ MY_A=MY_A_${ARCH}
+ export MY_A=${!MY_A}
+}
+
+pkg_nofetch() {
+ my_arch
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " SQL*Plus: ${MY_A}"
+ eerror "After downloading, put it in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
+ into "${oracle_home}"
+
+ dolib.so libsqlplus$(get_libname) libsqlplusic$(get_libname)
+ dobin sqlplus
+
+ insinto "${oracle_home}"/sqlplus/admin
+ doins glogin.sql
+
+ dosym "${oracle_home}"/bin/sqlplus /usr/bin/sqlplus
+}
diff --git a/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.4.ebuild b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.4.ebuild
new file mode 100644
index 000000000000..8cb35bf91e1f
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-11.2.0.4.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils pax-utils
+
+MY_PLAT_x86="Linux x86"
+MY_A_x86="${PN#oracle-}-linux-${PV}.0.zip"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_A_amd64="${PN#oracle-}-linux.x64-${PV}.0.zip"
+
+DESCRIPTION="Oracle 11g Instant Client: SQL*Plus"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ x86? ( ${MY_A_x86} )
+ amd64? ( ${MY_A_amd64} )
+"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+RESTRICT="fetch splitdebug"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
+
+S="${WORKDIR}"/instantclient_11_2
+
+QA_PREBUILT="
+ usr/lib*/oracle/${PV}/client/lib*/lib*
+ usr/lib*/oracle/${PV}/client/bin/sqlplus
+"
+
+my_arch() {
+ # platform name
+ MY_PLAT=MY_PLAT_${ARCH}
+ export MY_PLAT=${!MY_PLAT}
+ # distfile
+ MY_A=MY_A_${ARCH}
+ export MY_A=${!MY_A}
+}
+
+pkg_nofetch() {
+ my_arch
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " SQL*Plus: ${MY_A}"
+ eerror "After downloading, put it in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_install() {
+ # all binaries go here
+ local oracle_home=usr/$(get_libdir)/oracle/${PV}/client
+ into /"${oracle_home}"
+
+ dolib.so libsqlplus$(get_libname) libsqlplusic$(get_libname)
+ dobin sqlplus
+
+ insinto /"${oracle_home}"/sqlplus/admin
+ doins glogin.sql
+
+ pax-mark -c "${ED}${oracle_home}"/bin/sqlplus || die
+
+ dosym /"${oracle_home}"/bin/sqlplus /usr/bin/sqlplus
+}
diff --git a/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-12.ebuild b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-12.ebuild
new file mode 100644
index 000000000000..892487bdecdf
--- /dev/null
+++ b/dev-db/oracle-instantclient-sqlplus/oracle-instantclient-sqlplus-12.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Transition package moving to single ${CATEGORY}/oracle-instantclient package"
+HOMEPAGE="https://bugs.gentoo.org/show_bug.cgi?id=524922#c12"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+ >=dev-db/oracle-instantclient-basic-12
+ >=dev-db/oracle-instantclient-12[sqlplus]
+"
diff --git a/dev-db/oracle-instantclient/Manifest b/dev-db/oracle-instantclient/Manifest
new file mode 100644
index 000000000000..942ec22c52bf
--- /dev/null
+++ b/dev-db/oracle-instantclient/Manifest
@@ -0,0 +1,31 @@
+AUX 12.1.0.2-makefile.patch 2211 SHA256 dcc1e850acd0da754836d25a017347e952f30064fcfe22dee79fb6b56d98d89b SHA512 b42672e4c46f3f8a9e9bbb5bda935e20516a72ac71c9a7ba561f29fa7ff654da7abb7e6ddf3e4e236a29d29c1b7b35e469bbe60af62c5ff9065f7d8aa867b758 WHIRLPOOL 9ed0ae34c2d7d9da469e9ee8d977e66bf3ea1bd374a28f988f7fce51a8f4660c6666f3d8b5a2472db010aea5e58a10af48cd363071d20b624aeb0315e64a54b9
+AUX tnsnames.ora.sample 2939 SHA256 01b1f8625ae722d50e1f92aff5ae3f21c89631af4a06b6f85f8d83e821ff4da0 SHA512 25bb734bf4b7ea1d2ce2bddfd241204e796cad0d1d49036e567237d7ca92d158ab7bf69ff3abe210050c8ee0a0630f9217ced22dc31770814d822f93b2af5845 WHIRLPOOL 52cb14ec954568cbbd1c3a965a06cee4f2f52b6df95f211a65b9a320b748218d7d32e2c5697fa41a21399d3b3cd407c76777db98dfeb3a94012d0f40a6aac089
+DIST instantclient-basic-linux-12.1.0.2.0.zip 59727331 SHA256 96d210d1ff9575022644a8817696ed9e90374d98cabd2631b7b458689ca7511d SHA512 5d93c72c43ba2ca765209f4c1d518b9e93c80ff33625bf0bc33b974413e2b91ab22681e0922d2148fbfa6b6043fe84eee5334aa398e1ee7b1c2663ff2b3bb235 WHIRLPOOL 78b4902939ccc47540c4524e0a8326ab4a9c302a94c6a85790151ff9d83c400a0298436afab72c2b7b779f9f8606b5b4787fd4dbd496a0add171ae87461881d9
+DIST instantclient-basic-linux-12.2.0.1.0.zip 64594237 SHA256 32f5a53bdaf65e87b176a68fa0097e2a5249952be6f4afc3e0ef80345591a9cf SHA512 35cdd84765f1e020cd1e7fe3a765449bcad1c3b09189ab64f6a969da27d7ff2932bad319037ec066615e672d2b3105d4c36b42ec30ab60d6c577a2796908d22b WHIRLPOOL 1de40d5cfbe2e6846256c98f15a3a3ae8e68862bdbf6ebd73b16dd5e141179d6835656da3585695079defde05eb0c5e73a68f7ba0de2c7edb7e16940d32a2af3
+DIST instantclient-basic-linux.x64-12.1.0.2.0.zip 63352239 SHA256 c4e1b7201f23bc855782157ebeaaa3635eb6f5f01189bc1d3335bbdadfcb1fbb SHA512 e4cbdf40f00521651002f0753ead292b7a33352a7dae5d77635fbdb784451a1b9331ad614326dccdea34ecff3d44ddd0932b83c4bd405e69d95c7decae945f2c WHIRLPOOL 2463abbaa366a20b77b6800262b0b8692ad1e53b8f7e05c542d38e5e893d4e9fb466ef34fb839366991388eda7251654ee5b7fe3020b39692f798bea8e51e83b
+DIST instantclient-basic-linux.x64-12.2.0.1.0.zip 68965195 SHA256 5015e3c9fba84e009f7519893f798a1622c37d1ae2c55104ff502c52a0fe5194 SHA512 13f9b80d1021309fa48ca6c9dd6406ba6f97dcd611f786e940db42eeaba40cdf603b108954b9b3195f830e49377593e31b04f8d9310f619418bcd129b39f2ff1 WHIRLPOOL 244ab81ef2abf813ceb0f92fed25ad7bf05f25737a747ea194a5c61d4a81e9fb88f81136e0c8e7939e06c0d8b2c5a15014ee097e391d96e98c26edd834951a0a
+DIST instantclient-jdbc-linux-12.1.0.2.0.zip 1571004 SHA256 b40be90a26f27444ee6999ea05d7e62791ff0f01b943d48ceda51167e24f7e1d SHA512 ed3e5f831f1ac7351bd6eb7b3c10a09bba0f1989384ff1f041fdf94a5ca6acbf06e8285283f48731be6ece3dce55d307ac31e8bab57548dca0e3b3056060b5b2 WHIRLPOOL b17c5e25028b3c75719a42b77c43c10c346671632d582c8bd1ce31fa944690b3c883b357674407cb930cc4d7f0ba9054e53cd440842ac8be3951ea1dc32354bb
+DIST instantclient-jdbc-linux-12.2.0.1.0.zip 1572140 SHA256 c630ce7a4005bb354bf5c49744ec658046670d03b1064363aabf6a8a9f43eae7 SHA512 3b57ab454645f8719a75c8778ab33589548018ec09d187ca88252006f44b014d62659a622ae423f79f9bf0f11149cafaa33880e90278c94a847e69e409bd3dca WHIRLPOOL 269b2ad208ebbe2dde6db33593dad1abedf2f89eeb813ce8df895c81ea239383b9b2dc1c20dfba141c67ff084a99b68ca018d450c9193a7e07728c27487bb73f
+DIST instantclient-jdbc-linux.x64-12.1.0.2.0.zip 1571639 SHA256 444236c8881b4a6dc98342d8f2d95be5db6c2fa3ae925bdabc1d0cb684b0f20b SHA512 1e6aa33c159d5769d10b16da3c5ff16629dae049c7e7d3ab1504a0ad625968f4d3f655a83ff128bff726c3ed03eab9ef7603c897aad288d1dc4e557c03ac7e2a WHIRLPOOL 3f4adf8b631301f969e23651717be307c94ba2f6f8a7f0e53a086994c3e02a0643bfb69a3b9ec14914f3994cdbc0689e00a3c96f3f65db001e1c3382e380d130
+DIST instantclient-jdbc-linux.x64-12.2.0.1.0.zip 1572942 SHA256 1a18fcaa41984bc0499a3d3138843292550a5606556217adb47ddc59caa7a0fa SHA512 79c939442431e14b9f30e94821fc4d8eeb34cd35b887fd8fa90a045357a241a58a53d591d22a5f42b188540c50350b842391a3871c86eb4fe8169ea23001a21a WHIRLPOOL 204cc898bab739296dcf0404a19b8e13b11d302024a2ca6f860452947a2d2ce442708b254ed9777ac1cc101b7ed66cab24d870d805282b530be58582f8e2d275
+DIST instantclient-odbc-linux-12.1.0.2.0.zip 1100875 SHA256 bc686e56f544d465797a710af8ac39f49cfee1da13e4124dd080b13e49c6e573 SHA512 ff3b13a338f0acbae07f23d0e54f0ffa803afcda1a798b9cf38ced103201c0698a7240a062fb67af3547c17e906089e236cc3454685ca4645161a8b14414235e WHIRLPOOL 7dce918dcc16fc66f067a84540304948bd27ad38337518c5fa4c708112db3096da7037ac06e165b605f60c2f412f615dd9a511a6d7abaa1e9743e9f5823c3a89
+DIST instantclient-odbc-linux-12.2.0.1.0.zip 590235 SHA256 d6794428265756c72074c46d1fcb66f45d79600cb80954d7203c84b9fc0b7055 SHA512 bece0959fa126bf9e6e0104b3464cef466913c6af0ea77257415486a756b93428ddef41d1a5d97d08fffe092825ff69dbc2b5bf39e359a07f980bef1a2c82a9d WHIRLPOOL 6fb8701c9dae33ec127540a358b134855eb49dd8b9b42e83cc1ffbbca4560da5b6d3e0c20d5449cd21bf42cb990c5de8c31068146be6f73326986cde31a69e53
+DIST instantclient-odbc-linux.x64-12.1.0.2.0.zip 1289004 SHA256 ba2b50f8386b971b948b338ba2552b93511a1f515053a990dfb365d9bef35cba SHA512 b6dd02a2566aba66bbdd61e37e00f0c0ec2d466ad969658d4943657642e6e385cb08d0bee3a127b38a7077ec71c8f341aa4696f381e4d9978f807caa1f3ccb91 WHIRLPOOL 4fdda8d10aa3f744cb849f82e21f8d5d6ffc21e907bb0c659962a1d98d7456362108ccdf4b084d741d15177edf6a0233afe917f23adbe7d9af04b6f64a5ddab9
+DIST instantclient-odbc-linux.x64-12.2.0.1.0.zip 634997 SHA256 ead4f196080125114c6eb0c773f516c832bd55435b5eaba2fc9362dd0742f78b SHA512 03fc26db3cb07186b79bd7473d4b1f9c60f439c8b3c3653dbfa8f57fe3767ac4a233c91d31dea16b39db8170ee027913d7c4d86c0476a57ac9695a68b920f07c WHIRLPOOL 693605d1d9ccdd4585ae7f3d9e9f2f464f009996f7db373b129035d3573cdcab475b69e78bbb23b0f714cd903db212e8987d11950d061892a397be4195781492
+DIST instantclient-sdk-linux-12.1.0.2.0.zip 667183 SHA256 8a3d609230f02186c85cd39bef1e8b974a239254c5b12ba7e482c5a7c35ffb4a SHA512 fdc0111dba77aa88dc7a39c8d9afbd08c4ffde63890595501915be48a70f6fc623762657a1f3e3b54dd08b0d1e5ce00f99ec5ce40990bb17fab63ae38b986dc9 WHIRLPOOL ab4b2406d503381e5f0f878ebec7d03ff3fa748a0f7aa975dda567223327092452543c5a5568b0eea060d998f209092d7bc2d7d227ddd134cd6d259db5377a90
+DIST instantclient-sdk-linux-12.2.0.1.0.zip 674751 SHA256 38aa0c3961d44bec4819e04de1ab0642f2e9ec92dbbad327a7935224c7239d8b SHA512 b2e53e95aaee283f9077f422c7ea8e961a42decb0f58d438eeb32edb32e8c88321261ffd009ca453b531c4aa22a74b8cf71b9a91754c2bd082c83f644523c72e WHIRLPOOL ce3703933b2af85d8e05a9de7b11998adaa2860e0a7d796b13cb0d3e27d7cda7b7b8b3f2abe216d2e2739f0ef34f2739e5b75fd2f683ae3ff2ebf98841c9b91f
+DIST instantclient-sdk-linux.x64-12.1.0.2.0.zip 667174 SHA256 ba4b1b96b9f00bc36682542df575f1d52717f6ad48436f50c85b2e87b3a6961c SHA512 451918e34c4e41dcaea6d678cf10a20a3fb80be5c060aa1a2890f2eb528e6e4982bfd758598eaa115cd367cde0468f7f0f811bac2ef28671075868857eaf9f2e WHIRLPOOL e0cc5019eebf25c3db8debd207c85907937698a80e4ccea7c4eae0bde3c58bdfecb2d03f915dda870cc1d579146594d2720a7338a4466529bae20dd1a4e15aca
+DIST instantclient-sdk-linux.x64-12.2.0.1.0.zip 674743 SHA256 7f404c3573c062ce487a51ac4cfe650c878d7edf8e73b364ec852645ed1098cb SHA512 4a62ae1be31514664a0f442f65df633b93bea25f1ebe84e405865b9e363017726075bf2d5b2181600018ee122f74649aaa8ec5b507ee8938e33ae056a7f828b6 WHIRLPOOL ced978a6b668b6e435eac9c63c83587d197f64c40528fe54325f23e82a2c6d77b2e2596de524bbfedf02db909351674ca6c4483c7220b688d44d79955b2ffb7f
+DIST instantclient-sqlplus-linux-12.1.0.2.0.zip 828190 SHA256 03062efdb88423342657a679760581af14d936a897647bddcf248453bb01105f SHA512 e521f141f0bb4fe62bda6da389a9c1038be879f1456500a9e70ac0a41d4f35cf2051181a03223521aa24ee06a33b67614d3afd91f01099afa0081f2771876d43 WHIRLPOOL cd03b648dcc9340b09501b9af9da0d7c493983e304413fcc4a882524919a693a86d2d640009b9da125424c0dd9302546c2a5deeb569401c642b35a941d76e017
+DIST instantclient-sqlplus-linux-12.2.0.1.0.zip 869831 SHA256 c289ceaa6196e44a6e85d7342c9440b25c237018f6a1bdadb72d7cc2075f504c SHA512 83894a72192ea9ca86d361ba70a6c011f297afa5d186a49fbab7050d9615de300d54b12af8d948fe18a75dcf51bd04f9feaa8460a1c69df9c55f9854e3cee61e WHIRLPOOL b8275cf7e7fcde546fdbdd038afc8b55545106ae5512429ee5b352318d8647b34a816924dfb86a1e51954bf7acec770ac296d6bfabb6dcb560d45d48fce1355e
+DIST instantclient-sqlplus-linux.x64-12.1.0.2.0.zip 861284 SHA256 b52a7fca7279d4e9584674ea6f24464411f62f6ba95a2a16ec92979e99cac4bd SHA512 ad0af692bcae1231b58c7ea55fa79d85c7a5c9875a805565b1b5956ed30e608d753ac9210f6169ab3ff4e42ac2f1d871ccff47bd2656f7684925136fef1f30c2 WHIRLPOOL bad31c1135377f191adfb95861b171f286f2564023387c7d5fbb897624e0e15784157a052784985fcf42cb9e5d500067e71d1a8a6858ed65a179f6b4cc6c78ca
+DIST instantclient-sqlplus-linux.x64-12.2.0.1.0.zip 904309 SHA256 d49b2bd97376591ca07e7a836278933c3f251875c215044feac73ba9f451dfc2 SHA512 7d31a5262138f8ae0429cf08f0743b9c8c7863fc8e6abfa8ef089cee2059da75bf23503f9f1f09c28b82c5209aca27f81da6c890799236307395b59fea3bf012 WHIRLPOOL ad7ebdb2b643a98d500e0d2cf999cae8dc248b65aad40338ccf28b66f18ee2dd4e0ab89629dcc6b9024e0e5e4548218585ad160cae06e5df1d27e691701e14c2
+DIST instantclient-tools-linux-12.1.0.2.0.zip 187088 SHA256 2c73b8668ec5c99ec777110a5e33744540b8d394dcb934430d39dc507373126a SHA512 37a9eb3e2fdbbbf32f0fb5d017209db1b62d54efe48a875625e9d6162ea894d93d144358b2360989fa71704b346f86b36f1640a5c98f8aac7c1e6853b2d078fd WHIRLPOOL 156b434fc181cbd7832fc7646bb5c6ae73c69a748b8d76dd36481aea72db211d4524d290662cf0506f0fdc811035bb39eaf2a1a087b9de50cb943e5289d5ffe9
+DIST instantclient-tools-linux-12.2.0.1.0.zip 1032131 SHA256 8fae4cc5b74924be262513c3988655dabbe90c7092ec5c40a98dc2869212a514 SHA512 e547d571bf881e787dc19bf23f82c4396f14dbca35a51a21e4133ff463f3c3c2c308cc2263f55b49ce70604569158266cd88d7ebf8b5cf51c9cd58b2871133e2 WHIRLPOOL 06fbebacc13ece06c8f83bbd25a9ebf824f6bd8d69f8e50f46b672bfa08e6369df47634dbab52be760219d86eb870e27553cd3fff52fe6aba30902e2fcba384b
+DIST instantclient-tools-linux.x64-12.1.0.2.0.zip 203511 SHA256 cdddadf2fb7bba406a397e0dd47b53bffb9326265b874d1b17507c98a38afa16 SHA512 f18ca11300fc20925c72122d03fc00402b9a52b39f7f70cfd3fa97264a1a2a173e7f77059affba98e897546e05c6ac1e3a546ce1c7e63ef049130496d346342b WHIRLPOOL d98d728b917cdc368e859ec358ef35c1284b4a8e49b2e4d909a0d363bdaea10e80622dca19977afa3030d7930d2d1b37ce1983eb27da09f909c9c0a636b82206
+DIST instantclient-tools-linux.x64-12.2.0.1.0.zip 1132671 SHA256 9c5674a89bb4aad619fe0691a06d8984e5c0d450f2b895db975302dddc15e215 SHA512 1697289fc4b6a37277036dbef1892bd113892fcd3b0f347f0960ef8a1b90f3e91411bb237060e88bfdd418e50600372b710df08d97a4e847fd90d077ed0647d2 WHIRLPOOL 5536c43c3ef44ba14f82b79a59e6527e63a366e6701512bcec6c7723dbd37b0e4d60a98312c9111e9c36c1f106b516ab1fb335da7b14f8ae39cdabf83389fa13
+EBUILD oracle-instantclient-12.1.0.2.ebuild 8668 SHA256 de1c1ec00dadbd15e30344cd75c149f2ada3da22b53948bfef0167501845987d SHA512 6b395cc48970d9ee0401947a70306732688c2b8fc6c15b11139c395a31ba82cc66bcee8e16ea200468759709ad9bb0f1f270afda4507cf9d6c4fb698aa685706 WHIRLPOOL 631f4e6b161b79e4f69109ef2c2ffc82e68d6fb092048d8c07949fc17a425682c4bbb251861c8990d41f5ee9efc4ca4a41bbe798a2afec364ce40bf319a09eaa
+EBUILD oracle-instantclient-12.2.0.1-r1.ebuild 8695 SHA256 b9aecb9c66c8bc2534d8bdb31e082d0910e581d30a19398a58d8483c373d7847 SHA512 215433ed977aa9f0e5156e3cbe3617ffe7a47a170d4f189fe1fe9e0aaa34bd76c5669e073ea4ec782551b87c52bf59fee089baa43537b9ccb303d9c15aad8382 WHIRLPOOL 1149c53050ed25cd9d457a5982cf47ea831420843bbed83a3a59d31c04b1d3a2cf970ab7afb140dc4b2cfe18700d45f78a0bbc2a3e8c39d79aa0c6705ebb60f0
+EBUILD oracle-instantclient-12.2.0.1.ebuild 8668 SHA256 ba0e8ac8185618ed1460f4fd9c4a3991d19422ef0b2e5a5535d921390aff1d91 SHA512 f382466c1a1048b994fbc73dc8efd3164b7dc2dc339807683b93ff40ef14fb9ba0be363723f8710849ab22d8008e729ab79059eb6ec9ea64a73bcdd74460fe1e WHIRLPOOL 051112dbda5e8a051751f12ad37406a8dbd46090d18e10e3f5dfba0dc89519fe1286a04dc7f28e93cee836a1bbf4020089b27b4d2ca4072b6b92152ebdef233c
+MISC ChangeLog 949 SHA256 82ad532e7547f82fd28c6bb8292528746891f73f25435adf118690bcb447247b SHA512 d2f25468a4b1aad86817fa65f585435ec1efbe03c68da593f452f8238434864fc9139c46c84a54e681b2c04334f4168bb41d9b43bef9c9a3454f270de7d195c4 WHIRLPOOL 1c7eb1098fb9ee6191cfc47d02bb187d53644a9604b9553eee1b6d906810228bae5d500edfba6c2eacf43a51a7f3a5f8c6ba1d725d06dfdf1beacb37ff15d70d
+MISC metadata.xml 828 SHA256 89ac27e0b49759cc30638e5646b0450504dbaef8f127f8847b0d757832d71687 SHA512 50c7335c34b6a64f021a098f2545354701b97fe83daef042dd334e260e73cc6899f45186e833496331386d441d2afbcc671153c705837655621b1bc7a87fde31 WHIRLPOOL b71070dd987dccc175b6f66b915fc577f98c346c993bab8306f75e81e69669e75a31c478f8ab41226e4607c11d266651852635db81dafd4ba58fe7bf8aa74594
diff --git a/dev-db/oracle-instantclient/files/12.1.0.2-makefile.patch b/dev-db/oracle-instantclient/files/12.1.0.2-makefile.patch
new file mode 100644
index 000000000000..999d8c35f0d6
--- /dev/null
+++ b/dev-db/oracle-instantclient/files/12.1.0.2-makefile.patch
@@ -0,0 +1,57 @@
+Fake demo_xe.mk found in Oracle eXpress Edition,
+known by CPAN DBD::Oracle (bug#165834).
+This provides absolute paths for headers and libraries.
+
+Paranoia drops those REMOVE lines.
+--- instantclient_12_1/sdk/demo/demo.mk
++++ instantclient_12_1/sdk/demo/demo.mk
+@@ -28,8 +28,9 @@
+ CC=/opt/SunProd/SUNWspro6.1/bin/CC
+ cc=/opt/SunProd/SUNWspro6.1/bin/cc
+
+-ICINCHOME=../
+-ICLIBHOME=../../
++LIBDIR=lib
++ICINCHOME=$(ORACLE_HOME)/
++ICLIBHOME=$(ORACLE_HOME)/$(LIBDIR)
+ ICLIBPATH=-L$(ICLIBHOME)
+ THREADLIBS=-lthread
+ CCLIB=$(ICLIBPATH) -locci -lclntsh $(THREADLIBS)
+@@ -64,18 +65,18 @@
+ all: clean buildoci $(OCCIDEMO) $(OCCIOBJDEMO)
+
+ buildoci: $(CLNCACHE) $(LIBCLNT) $(CDEMOOBJS)
+- $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).12.1 $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).12.1 $(ICLIBHOME)libocci$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).12.1 $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).12.1 $(ICLIBHOME)libocci$(SO_EXT)
+ $(CC) -o $(CDEMOEXE) $(LDFLAGS) $(CDEMOOBJS) $(CCLIB)
+- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
+
+ buildocci: $(CLNCACHE) $(LIBCLNT) $(OBJS)
+- $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).12.1 $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).12.1 $(ICLIBHOME)libocci$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).12.1 $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).12.1 $(ICLIBHOME)libocci$(SO_EXT)
+ $(CC) -o $(EXE) $(LDFLAGS) $(OBJS) $(CCLIB)
+- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
+
+ $(OCCIDEMO):
+ $(MAKE) -f $(MAKEFILE) buildocci OBJS=$@.o EXE=$@
+@@ -93,8 +94,8 @@
+
+ cleancache:
+ $(REMOVE) $(CACHEDIR)
+- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
+- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
+
+ clean: $(CLNCACHE)
+ $(REMOVE) cdemo81 cdemo81.o occidml occidml.o occiobj occiobj.o occiobjo* occiobjm* occiobj.h occiobjout.type
diff --git a/dev-db/oracle-instantclient/files/tnsnames.ora.sample b/dev-db/oracle-instantclient/files/tnsnames.ora.sample
new file mode 100644
index 000000000000..f0524f5993cd
--- /dev/null
+++ b/dev-db/oracle-instantclient/files/tnsnames.ora.sample
@@ -0,0 +1,93 @@
+# This file contains the syntax information for
+# the entries to be put in any tnsnames.ora file
+# The entries in this file are need based.
+# There are no defaults for entries in this file
+# that Sqlnet/Net3 use that need to be overridden
+#
+# Typically you could have two tnsnames.ora files
+# in the system, one that is set for the entire system
+# and is called the system tnsnames.ora file, and a
+# second file that is used by each user locally so that
+# he can override the definitions dictated by the system
+# tnsnames.ora file.
+
+# The entries in tnsnames.ora are an alternative to using
+# the names server with the onames adapter.
+# They are a collection of aliases for the addresses that
+# the listener(s) is(are) listening for a database or
+# several databases.
+
+# The following is the general syntax for any entry in
+# a tnsnames.ora file. There could be several such entries
+# tailored to the user's needs.
+
+<alias>= [ (DESCRIPTION_LIST = # Optional depending on whether u have
+ # one or more descriptions
+ # If there is just one description, unnecessary ]
+ (DESCRIPTION=
+ [ (SDU=2048) ] # Optional, defaults to 2048
+ # Can take values between 512 and 32K
+ [ (ADDRESS_LIST= # Optional depending on whether u have
+ # one or more addresses
+ # If there is just one address, unnecessary ]
+ (ADDRESS=
+ [ (COMMUNITY=<community_name>) ]
+ (PROTOCOL=tcp)
+ (HOST=<hostname>)
+ (PORT=<portnumber (1521 is a standard port used)>)
+ )
+ [ (ADDRESS=
+ (PROTOCOL=ipc)
+ (KEY=<ipckey (PNPKEY is a standard key used)>)
+ )
+ ]
+ [ (ADDRESS=
+ [ (COMMUNITY=<community_name>) ]
+ (PROTOCOL=decnet)
+ (NODE=<nodename>)
+ (OBJECT=<objectname>)
+ )
+ ]
+ ... # More addresses
+ [ ) ] # Optional depending on whether ADDRESS_LIST is used or not
+ [ (CONNECT_DATA=
+ (SID=<oracle_sid>)
+ [ (GLOBAL_NAME=<global_database_name>) ]
+ )
+ ]
+ [ (SOURCE_ROUTE=yes) ]
+ )
+ (DESCRIPTION=
+ [ (SDU=2048) ] # Optional, defaults to 2048
+ # Can take values between 512 and 32K
+ [ (ADDRESS_LIST= ] # Optional depending on whether u have more
+ # than one address or not
+ # If there is just one address, unnecessary
+ (ADDRESS
+ [ (COMMUNITY=<community_name>) ]
+ (PROTOCOL=tcp)
+ (HOST=<hostname>)
+ (PORT=<portnumber (1521 is a standard port used)>)
+ )
+ [ (ADDRESS=
+ (PROTOCOL=ipc)
+ (KEY=<ipckey (PNPKEY is a standard key used)>)
+ )
+ ]
+ ... # More addresses
+ [ ) ] # Optional depending on whether ADDRESS_LIST
+ # is being used
+ [ (CONNECT_DATA=
+ (SID=<oracle_sid>)
+ [ (GLOBAL_NAME=<global_database_name>) ]
+ )
+ ]
+ [ (SOURCE_ROUTE=yes) ]
+ )
+ [ (CONNECT_DATA=
+ (SID=<oracle_sid>)
+ [ (GLOBAL_NAME=<global_database_name>) ]
+ )
+ ]
+ ... # More descriptions
+ [ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not
diff --git a/dev-db/oracle-instantclient/metadata.xml b/dev-db/oracle-instantclient/metadata.xml
new file mode 100644
index 000000000000..dcbd81f2598c
--- /dev/null
+++ b/dev-db/oracle-instantclient/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>haubi@gentoo.org</email>
+</maintainer>
+<longdescription>
+ Free, light-weight and easily installed Oracle Database libraries
+ and SDKs for building and connecting client applications to local
+ or remote Oracle Databases.
+</longdescription>
+<use>
+ <flag name="jdbc">Support for XA, Internationalization, and RowSet operations under JDBC.
+ </flag>
+ <flag name="odbc">Libraries for enabling ODBC applications.
+ </flag>
+ <flag name="sdk">Header files and an example makefile for developing Oracle applications.
+ </flag>
+ <flag name="sqlplus">Libraries and executable for running SQL*Plus.
+ </flag>
+ <flag name="tools">Workload Replay Client.
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/oracle-instantclient/oracle-instantclient-12.1.0.2.ebuild b/dev-db/oracle-instantclient/oracle-instantclient-12.1.0.2.ebuild
new file mode 100644
index 000000000000..a9ec364908a1
--- /dev/null
+++ b/dev-db/oracle-instantclient/oracle-instantclient-12.1.0.2.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils versionator pax-utils multilib-minimal
+
+MY_PVM=$(get_version_component_range 1-2)
+
+MY_PLAT_x86="Linux x86"
+MY_BITS_x86=32
+MY_A_x86="${PN/oracle-/}-basic-linux-${PV}.0.zip"
+MY_A_x86_sdk="${MY_A_x86/basic/sdk}"
+MY_A_x86_odbc="${MY_A_x86/basic/odbc}"
+MY_A_x86_jdbc="${MY_A_x86/basic/jdbc}"
+MY_A_x86_sqlplus="${MY_A_x86/basic/sqlplus}"
+MY_A_x86_tools="${MY_A_x86/basic/tools}"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_BITS_amd64=64
+MY_A_amd64="${PN/oracle-}-basic-linux.x64-${PV}.0.zip"
+MY_A_amd64_sdk="${MY_A_amd64/basic/sdk}"
+MY_A_amd64_odbc="${MY_A_amd64/basic/odbc}"
+MY_A_amd64_jdbc="${MY_A_amd64/basic/jdbc}"
+MY_A_amd64_sqlplus="${MY_A_amd64/basic/sqlplus}"
+MY_A_amd64_tools="${MY_A_amd64/basic/tools}"
+
+DESCRIPTION="Oracle 12c Instant Client with SDK"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ abi_x86_32? (
+ ${MY_A_x86}
+ odbc? ( ${MY_A_x86_odbc} )
+ jdbc? ( ${MY_A_x86_jdbc} )
+ !abi_x86_64? (
+ sdk? ( ${MY_A_x86_sdk} )
+ sqlplus? ( ${MY_A_x86_sqlplus} )
+ tools? ( ${MY_A_x86_tools} )
+ ) )
+ abi_x86_64? (
+ ${MY_A_amd64}
+ odbc? ( ${MY_A_amd64_odbc} )
+ jdbc? ( ${MY_A_amd64_jdbc} )
+ sdk? ( ${MY_A_amd64_sdk} )
+ sqlplus? ( ${MY_A_amd64_sqlplus} )
+ tools? ( ${MY_A_amd64_tools} )
+ )
+"
+
+LICENSE="OTN"
+SLOT="0/${MY_PVM}"
+KEYWORDS="~amd64 ~x86"
+RESTRICT="fetch splitdebug"
+IUSE="jdbc odbc +sdk +sqlplus tools"
+
+DEPEND="app-arch/unzip"
+RDEPEND="
+ >=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]
+ !<dev-db/oracle-instantclient-basic-12
+ !<dev-db/oracle-instantclient-odbc-12
+ !<dev-db/oracle-instantclient-jdbc-12
+ !<dev-db/oracle-instantclient-sqlplus-12
+"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/*/client/lib*/lib*"
+
+set_my_abivars() {
+ S="${WORKDIR}/${ABI}/instantclient_$(
+ replace_version_separator 1 "_" "${MY_PVM}"
+ )"
+
+ local abi=${ABI}
+ [[ ${abi} == 'default' ]] && abi=${ARCH}
+ MY_PLAT=MY_PLAT_${abi} ; MY_PLAT=${!MY_PLAT} # platform name
+ MY_BITS=MY_BITS_${abi} ; MY_BITS=${!MY_BITS} # platform bitwidth
+ MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
+ MY_A_sdk=MY_A_${abi}_sdk ; MY_A_sdk=${!MY_A_sdk} # sdk distfile
+ MY_A_odbc=MY_A_${abi}_odbc ; MY_A_odbc=${!MY_A_odbc} # odbc distfile
+ MY_A_jdbc=MY_A_${abi}_jdbc ; MY_A_jdbc=${!MY_A_jdbc} # jdbc distfile
+ MY_A_sqlplus=MY_A_${abi}_sqlplus; MY_A_sqlplus=${!MY_A_sqlplus} # sqlplus distfile
+ MY_A_tools=MY_A_${abi}_tools ; MY_A_tools=${!MY_A_tools} # tools distfile
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+oic_distfile_status() {
+ if [[ -r ${DISTDIR}/${1} ]]; then
+ echo "already here"
+ else
+ echo "still absent"
+ fi
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
+ use odbc &&
+ eerror " ODBC: ($(oic_distfile_status ${MY_A_odbc})) ${MY_A_odbc}"
+ use jdbc &&
+ eerror " JDBC: ($(oic_distfile_status ${MY_A_jdbc})) ${MY_A_jdbc}"
+ if multilib_is_native_abi; then
+ use sdk &&
+ eerror " SDK: ($(oic_distfile_status ${MY_A_sdk})) ${MY_A_sdk}"
+ use sqlplus &&
+ eerror " SQL*Plus: ($(oic_distfile_status ${MY_A_sqlplus})) ${MY_A_sqlplus}"
+ use tools &&
+ eerror " WRC: ($(oic_distfile_status ${MY_A_tools})) ${MY_A_tools}"
+ fi
+ done
+ eerror "After downloading these files (for *all* shown architectures), put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ mkdir "${WORKDIR}"/${ABI} || die
+ cd "${WORKDIR}"/${ABI} || die
+ unpack ${MY_A}
+ use odbc && unpack ${MY_A_odbc}
+ use jdbc && unpack ${MY_A_jdbc}
+ if multilib_is_native_abi; then
+ use sdk && unpack ${MY_A_sdk}
+ use sqlplus && unpack ${MY_A_sqlplus}
+ use tools && unpack ${MY_A_tools}
+ fi
+ done
+}
+
+src_prepare() {
+ use sdk && PATCHES=( "${FILESDIR}"/12.1.0.2-makefile.patch )
+ default
+}
+
+# silence configure&compile messages from multilib-minimal
+src_configure() { :; }
+src_compile() { :; }
+
+src_install() {
+ # all content goes here
+ local oracle_home=usr/$(get_libdir)/oracle/${MY_PVM}/client
+ into "/${oracle_home}"
+
+ local ldpath= ABI
+ for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${S}" || die
+
+ # shared libraries
+ dolib.so lib*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libocci$(get_libname) ]] ||
+ dosym libocci$(get_libname ${MY_PVM}) \
+ "/${oracle_home}"/$(get_libdir)/libocci$(get_libname)
+ [[ -e libclntsh$(get_libname) ]] ||
+ dosym libclntsh$(get_libname ${MY_PVM}) \
+ "/${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
+
+ # java archives
+ insinto "/${oracle_home}"/$(get_libdir)
+ doins *.jar
+
+ # runtime library path
+ ldpath+=${ldpath:+:}/${oracle_home}/$(get_libdir)
+
+ eend $?
+ done
+
+ local DOCS=()
+ local HTML_DOCS=()
+ local paxbins=( adrci genezi uidrvci )
+ local scripts=()
+
+ use sqlplus && paxbins+=( sqlplus )
+ use tools && paxbins+=( wrc )
+
+ if use odbc; then
+ scripts+=( odbc_update_ini.sh )
+ HTML_DOCS+=( ODBC_IC_Readme_Unix.html help )
+ fi
+
+ einfo "Installing binaries for ${MY_PLAT} ..."
+ dobin ${paxbins[@]} ${scripts}
+ cd "${ED}${oracle_home}"/bin || die
+ pax-mark -c ${paxbins[@]} || die
+ cd "${S}" || die
+ eend $?
+
+ if use sqlplus; then
+ insinto "/${oracle_home}"/sqlplus/admin
+ doins glogin.sql
+ dosym "/${oracle_home}"/bin/sqlplus /usr/bin/sqlplus
+ fi
+
+ if use sdk; then
+ einfo "Installing SDK ..."
+
+ DOCS+=( sdk/demo )
+ cd "${S}"/sdk || die
+
+ # SDK makefile, for #165834
+ # As we change the relative filesystem layout compared
+ # to vanilla instantclient.zip content, it feels easier
+ # to fake the layout found in Oracle eXpress Edition.
+ # Both layouts are known to DBD::Oracle (cpan).
+ insinto "/${oracle_home}"/rdbms/demo
+ newins demo/demo.mk demo_xe.mk
+
+ # Remove ldap.h, #299562
+ rm include/ldap.h || die
+ # DBD::Oracle needs rdbms/public as real directory
+ insinto "/${oracle_home}"/rdbms/public
+ doins include/*.h
+ dosym rdbms/public "/${oracle_home}"/include
+ # ruby-oci8 expects the headers here
+ dosym "/${oracle_home}"/rdbms/public /usr/include/oracle/${MY_PVM}/client
+
+ # ott
+ insinto "/${oracle_home}"/$(get_libdir)
+ dobin ott
+ doins *.zip
+
+ # more files found in the zip
+ insinto "/${oracle_home}"/admin
+ doins admin/oraaccess.xsd
+
+ eend $?
+ fi
+
+ cd "${S}" || die
+ einstalldocs
+
+ # create path for tnsnames.ora
+ insinto /etc/oracle
+ doins "${FILESDIR}"/tnsnames.ora.sample
+
+ # Add OCI libs to library path
+ {
+ echo "# ${EPREFIX}/etc/env.d/50${PN}"
+ echo "# Do not edit this file, but 99${PN} instead"
+ echo
+ echo "ORACLE_HOME=${EPREFIX}/${oracle_home}"
+ echo "LDPATH=${ldpath}"
+ echo "TNS_ADMIN=/etc/oracle/"
+ } > "${T}"/50${PN}
+
+ doenvd "${T}"/50${PN}
+
+ # ensure ORACLE_HOME/lib exists
+ [[ -e ${ED}${oracle_home}/lib/. ]] ||
+ dosym $(get_libdir) "${oracle_home}"/lib
+}
+
+pkg_preinst() {
+ if [[ -r ${EROOT}/etc/env.d/99${PN} ]]; then
+ cp "${EROOT}/etc/env.d/99${PN}" "${ED}/etc/env.d/" || die
+ else
+ {
+ echo "# ${EPREFIX}/etc/env.d/99${PN}"
+ echo "# Configure system-wide defaults for your Oracle Instant Client here"
+ echo
+ echo "#$(grep '^ORACLE_HOME=' "${ED}/etc/env.d/50${PN}")"
+ echo "#$(grep '^TNS_ADMIN=' "${ED}/etc/env.d/50${PN}")"
+ echo "#NLS_LANG="
+ } > "${ED}/etc/env.d/99${PN}"
+ fi
+}
+
+pkg_postinst() {
+ elog "${P} does not provide an sqlnet.ora"
+ elog "configuration file, redirecting oracle diagnostics for database-"
+ elog "and network-issues into ~USER/oradiag_USER/ instead."
+ elog "It should be safe to ignore this message in sqlnet.log there:"
+ elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
+ elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
+ elog "If you want to directly analyse low-level debug info or don't want"
+ elog "to see it at all, so you really need an sqlnet.ora file, please"
+ elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
+ elog ""
+ elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
+ elog "put your tnsnames.ora there or configure TNS_ADMIN"
+ elog "to point to your user specific configuration."
+ ewarn "Please re-source your shell settings for ORACLE_HOME"
+ ewarn " changes, such as: source /etc/profile"
+}
diff --git a/dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1-r1.ebuild b/dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1-r1.ebuild
new file mode 100644
index 000000000000..67a48f68db6c
--- /dev/null
+++ b/dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1-r1.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils versionator pax-utils multilib-minimal
+
+MY_PVM=$(get_version_component_range 1-2)
+MYLIB_PVM=12.1
+
+MY_PLAT_x86="Linux x86"
+MY_BITS_x86=32
+MY_A_x86="${PN/oracle-/}-basic-linux-${PV}.0.zip"
+MY_A_x86_sdk="${MY_A_x86/basic/sdk}"
+MY_A_x86_odbc="${MY_A_x86/basic/odbc}"
+MY_A_x86_jdbc="${MY_A_x86/basic/jdbc}"
+MY_A_x86_sqlplus="${MY_A_x86/basic/sqlplus}"
+MY_A_x86_tools="${MY_A_x86/basic/tools}"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_BITS_amd64=64
+MY_A_amd64="${PN/oracle-}-basic-linux.x64-${PV}.0.zip"
+MY_A_amd64_sdk="${MY_A_amd64/basic/sdk}"
+MY_A_amd64_odbc="${MY_A_amd64/basic/odbc}"
+MY_A_amd64_jdbc="${MY_A_amd64/basic/jdbc}"
+MY_A_amd64_sqlplus="${MY_A_amd64/basic/sqlplus}"
+MY_A_amd64_tools="${MY_A_amd64/basic/tools}"
+
+DESCRIPTION="Oracle 12c Instant Client with SDK"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ abi_x86_32? (
+ ${MY_A_x86}
+ odbc? ( ${MY_A_x86_odbc} )
+ jdbc? ( ${MY_A_x86_jdbc} )
+ !abi_x86_64? (
+ sdk? ( ${MY_A_x86_sdk} )
+ sqlplus? ( ${MY_A_x86_sqlplus} )
+ tools? ( ${MY_A_x86_tools} )
+ ) )
+ abi_x86_64? (
+ ${MY_A_amd64}
+ odbc? ( ${MY_A_amd64_odbc} )
+ jdbc? ( ${MY_A_amd64_jdbc} )
+ sdk? ( ${MY_A_amd64_sdk} )
+ sqlplus? ( ${MY_A_amd64_sqlplus} )
+ tools? ( ${MY_A_amd64_tools} )
+ )
+"
+
+LICENSE="OTN"
+SLOT="0/${MYLIB_PVM}"
+KEYWORDS="~amd64 ~x86"
+RESTRICT="fetch splitdebug"
+IUSE="jdbc odbc +sdk +sqlplus tools"
+
+DEPEND="app-arch/unzip"
+RDEPEND="
+ >=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]
+ !<dev-db/oracle-instantclient-basic-12
+ !<dev-db/oracle-instantclient-odbc-12
+ !<dev-db/oracle-instantclient-jdbc-12
+ !<dev-db/oracle-instantclient-sqlplus-12
+"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/*/client/lib*/lib*"
+
+set_my_abivars() {
+ S="${WORKDIR}/${ABI}/instantclient_$(
+ replace_version_separator 1 "_" "${MY_PVM}"
+ )"
+
+ local abi=${ABI}
+ [[ ${abi} == 'default' ]] && abi=${ARCH}
+ MY_PLAT=MY_PLAT_${abi} ; MY_PLAT=${!MY_PLAT} # platform name
+ MY_BITS=MY_BITS_${abi} ; MY_BITS=${!MY_BITS} # platform bitwidth
+ MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
+ MY_A_sdk=MY_A_${abi}_sdk ; MY_A_sdk=${!MY_A_sdk} # sdk distfile
+ MY_A_odbc=MY_A_${abi}_odbc ; MY_A_odbc=${!MY_A_odbc} # odbc distfile
+ MY_A_jdbc=MY_A_${abi}_jdbc ; MY_A_jdbc=${!MY_A_jdbc} # jdbc distfile
+ MY_A_sqlplus=MY_A_${abi}_sqlplus; MY_A_sqlplus=${!MY_A_sqlplus} # sqlplus distfile
+ MY_A_tools=MY_A_${abi}_tools ; MY_A_tools=${!MY_A_tools} # tools distfile
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+oic_distfile_status() {
+ if [[ -r ${DISTDIR}/${1} ]]; then
+ echo "already here"
+ else
+ echo "still absent"
+ fi
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
+ use odbc &&
+ eerror " ODBC: ($(oic_distfile_status ${MY_A_odbc})) ${MY_A_odbc}"
+ use jdbc &&
+ eerror " JDBC: ($(oic_distfile_status ${MY_A_jdbc})) ${MY_A_jdbc}"
+ if multilib_is_native_abi; then
+ use sdk &&
+ eerror " SDK: ($(oic_distfile_status ${MY_A_sdk})) ${MY_A_sdk}"
+ use sqlplus &&
+ eerror " SQL*Plus: ($(oic_distfile_status ${MY_A_sqlplus})) ${MY_A_sqlplus}"
+ use tools &&
+ eerror " WRC: ($(oic_distfile_status ${MY_A_tools})) ${MY_A_tools}"
+ fi
+ done
+ eerror "After downloading these files (for *all* shown architectures), put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ mkdir "${WORKDIR}"/${ABI} || die
+ cd "${WORKDIR}"/${ABI} || die
+ unpack ${MY_A}
+ use odbc && unpack ${MY_A_odbc}
+ use jdbc && unpack ${MY_A_jdbc}
+ if multilib_is_native_abi; then
+ use sdk && unpack ${MY_A_sdk}
+ use sqlplus && unpack ${MY_A_sqlplus}
+ use tools && unpack ${MY_A_tools}
+ fi
+ done
+}
+
+src_prepare() {
+ use sdk && PATCHES=( "${FILESDIR}"/12.1.0.2-makefile.patch )
+ default
+}
+
+# silence configure&compile messages from multilib-minimal
+src_configure() { :; }
+src_compile() { :; }
+
+src_install() {
+ # all content goes here
+ local oracle_home=usr/$(get_libdir)/oracle/${MY_PVM}/client
+ into "/${oracle_home}"
+
+ local ldpath= ABI
+ for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${S}" || die
+
+ # shared libraries
+ dolib.so lib*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libocci$(get_libname) ]] ||
+ dosym libocci$(get_libname ${MYLIB_PVM}) \
+ "/${oracle_home}"/$(get_libdir)/libocci$(get_libname)
+ [[ -e libclntsh$(get_libname) ]] ||
+ dosym libclntsh$(get_libname ${MYLIB_PVM}) \
+ "/${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
+
+ # java archives
+ insinto "/${oracle_home}"/$(get_libdir)
+ doins *.jar
+
+ # runtime library path
+ ldpath+=${ldpath:+:}/${oracle_home}/$(get_libdir)
+
+ eend $?
+ done
+
+ local DOCS=()
+ local HTML_DOCS=()
+ local paxbins=( adrci genezi uidrvci )
+ local scripts=()
+
+ use sqlplus && paxbins+=( sqlplus )
+ use tools && paxbins+=( wrc )
+
+ if use odbc; then
+ scripts+=( odbc_update_ini.sh )
+ HTML_DOCS+=( ODBC_IC_Readme_Unix.html help )
+ fi
+
+ einfo "Installing binaries for ${MY_PLAT} ..."
+ dobin ${paxbins[@]} ${scripts}
+ cd "${ED}${oracle_home}"/bin || die
+ pax-mark -c ${paxbins[@]} || die
+ cd "${S}" || die
+ eend $?
+
+ if use sqlplus; then
+ insinto "/${oracle_home}"/sqlplus/admin
+ doins glogin.sql
+ dosym "/${oracle_home}"/bin/sqlplus /usr/bin/sqlplus
+ fi
+
+ if use sdk; then
+ einfo "Installing SDK ..."
+
+ DOCS+=( sdk/demo )
+ cd "${S}"/sdk || die
+
+ # SDK makefile, for #165834
+ # As we change the relative filesystem layout compared
+ # to vanilla instantclient.zip content, it feels easier
+ # to fake the layout found in Oracle eXpress Edition.
+ # Both layouts are known to DBD::Oracle (cpan).
+ insinto "/${oracle_home}"/rdbms/demo
+ newins demo/demo.mk demo_xe.mk
+
+ # Remove ldap.h, #299562
+ rm include/ldap.h || die
+ # DBD::Oracle needs rdbms/public as real directory
+ insinto "/${oracle_home}"/rdbms/public
+ doins include/*.h
+ dosym rdbms/public "/${oracle_home}"/include
+ # ruby-oci8 expects the headers here
+ dosym "/${oracle_home}"/rdbms/public /usr/include/oracle/${MYLIB_PVM}/client
+
+ # ott
+ insinto "/${oracle_home}"/$(get_libdir)
+ dobin ott
+ doins *.zip
+
+ # more files found in the zip
+ insinto "/${oracle_home}"/admin
+ doins admin/oraaccess.xsd
+
+ eend $?
+ fi
+
+ cd "${S}" || die
+ einstalldocs
+
+ # create path for tnsnames.ora
+ insinto /etc/oracle
+ doins "${FILESDIR}"/tnsnames.ora.sample
+
+ # Add OCI libs to library path
+ {
+ echo "# ${EPREFIX}/etc/env.d/50${PN}"
+ echo "# Do not edit this file, but 99${PN} instead"
+ echo
+ echo "ORACLE_HOME=${EPREFIX}/${oracle_home}"
+ echo "LDPATH=${ldpath}"
+ echo "TNS_ADMIN=/etc/oracle/"
+ } > "${T}"/50${PN}
+
+ doenvd "${T}"/50${PN}
+
+ # ensure ORACLE_HOME/lib exists
+ [[ -e ${ED}${oracle_home}/lib/. ]] ||
+ dosym $(get_libdir) "${oracle_home}"/lib
+}
+
+pkg_preinst() {
+ if [[ -r ${EROOT}/etc/env.d/99${PN} ]]; then
+ cp "${EROOT}/etc/env.d/99${PN}" "${ED}/etc/env.d/" || die
+ else
+ {
+ echo "# ${EPREFIX}/etc/env.d/99${PN}"
+ echo "# Configure system-wide defaults for your Oracle Instant Client here"
+ echo
+ echo "#$(grep '^ORACLE_HOME=' "${ED}/etc/env.d/50${PN}")"
+ echo "#$(grep '^TNS_ADMIN=' "${ED}/etc/env.d/50${PN}")"
+ echo "#NLS_LANG="
+ } > "${ED}/etc/env.d/99${PN}"
+ fi
+}
+
+pkg_postinst() {
+ elog "${P} does not provide an sqlnet.ora"
+ elog "configuration file, redirecting oracle diagnostics for database-"
+ elog "and network-issues into ~USER/oradiag_USER/ instead."
+ elog "It should be safe to ignore this message in sqlnet.log there:"
+ elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
+ elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
+ elog "If you want to directly analyse low-level debug info or don't want"
+ elog "to see it at all, so you really need an sqlnet.ora file, please"
+ elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
+ elog ""
+ elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
+ elog "put your tnsnames.ora there or configure TNS_ADMIN"
+ elog "to point to your user specific configuration."
+ ewarn "Please re-source your shell settings for ORACLE_HOME"
+ ewarn " changes, such as: source /etc/profile"
+}
diff --git a/dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1.ebuild b/dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1.ebuild
new file mode 100644
index 000000000000..4eee326f922e
--- /dev/null
+++ b/dev-db/oracle-instantclient/oracle-instantclient-12.2.0.1.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils versionator pax-utils multilib-minimal
+
+MY_PVM=$(get_version_component_range 1-2)
+
+MY_PLAT_x86="Linux x86"
+MY_BITS_x86=32
+MY_A_x86="${PN/oracle-/}-basic-linux-${PV}.0.zip"
+MY_A_x86_sdk="${MY_A_x86/basic/sdk}"
+MY_A_x86_odbc="${MY_A_x86/basic/odbc}"
+MY_A_x86_jdbc="${MY_A_x86/basic/jdbc}"
+MY_A_x86_sqlplus="${MY_A_x86/basic/sqlplus}"
+MY_A_x86_tools="${MY_A_x86/basic/tools}"
+
+MY_PLAT_amd64="Linux x86-64"
+MY_BITS_amd64=64
+MY_A_amd64="${PN/oracle-}-basic-linux.x64-${PV}.0.zip"
+MY_A_amd64_sdk="${MY_A_amd64/basic/sdk}"
+MY_A_amd64_odbc="${MY_A_amd64/basic/odbc}"
+MY_A_amd64_jdbc="${MY_A_amd64/basic/jdbc}"
+MY_A_amd64_sqlplus="${MY_A_amd64/basic/sqlplus}"
+MY_A_amd64_tools="${MY_A_amd64/basic/tools}"
+
+DESCRIPTION="Oracle 12c Instant Client with SDK"
+HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
+SRC_URI="
+ abi_x86_32? (
+ ${MY_A_x86}
+ odbc? ( ${MY_A_x86_odbc} )
+ jdbc? ( ${MY_A_x86_jdbc} )
+ !abi_x86_64? (
+ sdk? ( ${MY_A_x86_sdk} )
+ sqlplus? ( ${MY_A_x86_sqlplus} )
+ tools? ( ${MY_A_x86_tools} )
+ ) )
+ abi_x86_64? (
+ ${MY_A_amd64}
+ odbc? ( ${MY_A_amd64_odbc} )
+ jdbc? ( ${MY_A_amd64_jdbc} )
+ sdk? ( ${MY_A_amd64_sdk} )
+ sqlplus? ( ${MY_A_amd64_sqlplus} )
+ tools? ( ${MY_A_amd64_tools} )
+ )
+"
+
+LICENSE="OTN"
+SLOT="0/${MY_PVM}"
+KEYWORDS="~amd64 ~x86"
+RESTRICT="fetch splitdebug"
+IUSE="jdbc odbc +sdk +sqlplus tools"
+
+DEPEND="app-arch/unzip"
+RDEPEND="
+ >=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]
+ !<dev-db/oracle-instantclient-basic-12
+ !<dev-db/oracle-instantclient-odbc-12
+ !<dev-db/oracle-instantclient-jdbc-12
+ !<dev-db/oracle-instantclient-sqlplus-12
+"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="usr/lib*/oracle/*/client/lib*/lib*"
+
+set_my_abivars() {
+ S="${WORKDIR}/${ABI}/instantclient_$(
+ replace_version_separator 1 "_" "${MY_PVM}"
+ )"
+
+ local abi=${ABI}
+ [[ ${abi} == 'default' ]] && abi=${ARCH}
+ MY_PLAT=MY_PLAT_${abi} ; MY_PLAT=${!MY_PLAT} # platform name
+ MY_BITS=MY_BITS_${abi} ; MY_BITS=${!MY_BITS} # platform bitwidth
+ MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
+ MY_A_sdk=MY_A_${abi}_sdk ; MY_A_sdk=${!MY_A_sdk} # sdk distfile
+ MY_A_odbc=MY_A_${abi}_odbc ; MY_A_odbc=${!MY_A_odbc} # odbc distfile
+ MY_A_jdbc=MY_A_${abi}_jdbc ; MY_A_jdbc=${!MY_A_jdbc} # jdbc distfile
+ MY_A_sqlplus=MY_A_${abi}_sqlplus; MY_A_sqlplus=${!MY_A_sqlplus} # sqlplus distfile
+ MY_A_tools=MY_A_${abi}_tools ; MY_A_tools=${!MY_A_tools} # tools distfile
+
+ [[ -n ${MY_PLAT} ]]
+}
+
+oic_distfile_status() {
+ if [[ -r ${DISTDIR}/${1} ]]; then
+ echo "already here"
+ else
+ echo "still absent"
+ fi
+}
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE%/*}/index-097480.html"
+ eerror " and download"
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ eerror "Instant Client for ${MY_PLAT}"
+ eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
+ use odbc &&
+ eerror " ODBC: ($(oic_distfile_status ${MY_A_odbc})) ${MY_A_odbc}"
+ use jdbc &&
+ eerror " JDBC: ($(oic_distfile_status ${MY_A_jdbc})) ${MY_A_jdbc}"
+ if multilib_is_native_abi; then
+ use sdk &&
+ eerror " SDK: ($(oic_distfile_status ${MY_A_sdk})) ${MY_A_sdk}"
+ use sqlplus &&
+ eerror " SQL*Plus: ($(oic_distfile_status ${MY_A_sqlplus})) ${MY_A_sqlplus}"
+ use tools &&
+ eerror " WRC: ($(oic_distfile_status ${MY_A_tools})) ${MY_A_tools}"
+ fi
+ done
+ eerror "After downloading these files (for *all* shown architectures), put them in:"
+ eerror " ${DISTDIR}/"
+}
+
+src_unpack() {
+ local ABI
+ for ABI in $(multilib_get_enabled_abis)
+ do
+ set_my_abivars || continue
+ mkdir "${WORKDIR}"/${ABI} || die
+ cd "${WORKDIR}"/${ABI} || die
+ unpack ${MY_A}
+ use odbc && unpack ${MY_A_odbc}
+ use jdbc && unpack ${MY_A_jdbc}
+ if multilib_is_native_abi; then
+ use sdk && unpack ${MY_A_sdk}
+ use sqlplus && unpack ${MY_A_sqlplus}
+ use tools && unpack ${MY_A_tools}
+ fi
+ done
+}
+
+src_prepare() {
+ use sdk && PATCHES=( "${FILESDIR}"/12.1.0.2-makefile.patch )
+ default
+}
+
+# silence configure&compile messages from multilib-minimal
+src_configure() { :; }
+src_compile() { :; }
+
+src_install() {
+ # all content goes here
+ local oracle_home=usr/$(get_libdir)/oracle/${MY_PVM}/client
+ into "/${oracle_home}"
+
+ local ldpath= ABI
+ for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
+ do
+ if ! set_my_abivars; then
+ elog "Skipping unsupported ABI ${ABI}."
+ continue
+ fi
+ einfo "Installing runtime for ${MY_PLAT} ..."
+
+ cd "${S}" || die
+
+ # shared libraries
+ dolib.so lib*$(get_libname)*
+
+ # ensure to be linkable
+ [[ -e libocci$(get_libname) ]] ||
+ dosym libocci$(get_libname ${MY_PVM}) \
+ "/${oracle_home}"/$(get_libdir)/libocci$(get_libname)
+ [[ -e libclntsh$(get_libname) ]] ||
+ dosym libclntsh$(get_libname ${MY_PVM}) \
+ "/${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
+
+ # java archives
+ insinto "/${oracle_home}"/$(get_libdir)
+ doins *.jar
+
+ # runtime library path
+ ldpath+=${ldpath:+:}/${oracle_home}/$(get_libdir)
+
+ eend $?
+ done
+
+ local DOCS=()
+ local HTML_DOCS=()
+ local paxbins=( adrci genezi uidrvci )
+ local scripts=()
+
+ use sqlplus && paxbins+=( sqlplus )
+ use tools && paxbins+=( wrc )
+
+ if use odbc; then
+ scripts+=( odbc_update_ini.sh )
+ HTML_DOCS+=( ODBC_IC_Readme_Unix.html help )
+ fi
+
+ einfo "Installing binaries for ${MY_PLAT} ..."
+ dobin ${paxbins[@]} ${scripts}
+ cd "${ED}${oracle_home}"/bin || die
+ pax-mark -c ${paxbins[@]} || die
+ cd "${S}" || die
+ eend $?
+
+ if use sqlplus; then
+ insinto "/${oracle_home}"/sqlplus/admin
+ doins glogin.sql
+ dosym "/${oracle_home}"/bin/sqlplus /usr/bin/sqlplus
+ fi
+
+ if use sdk; then
+ einfo "Installing SDK ..."
+
+ DOCS+=( sdk/demo )
+ cd "${S}"/sdk || die
+
+ # SDK makefile, for #165834
+ # As we change the relative filesystem layout compared
+ # to vanilla instantclient.zip content, it feels easier
+ # to fake the layout found in Oracle eXpress Edition.
+ # Both layouts are known to DBD::Oracle (cpan).
+ insinto "/${oracle_home}"/rdbms/demo
+ newins demo/demo.mk demo_xe.mk
+
+ # Remove ldap.h, #299562
+ rm include/ldap.h || die
+ # DBD::Oracle needs rdbms/public as real directory
+ insinto "/${oracle_home}"/rdbms/public
+ doins include/*.h
+ dosym rdbms/public "/${oracle_home}"/include
+ # ruby-oci8 expects the headers here
+ dosym "/${oracle_home}"/rdbms/public /usr/include/oracle/${MY_PVM}/client
+
+ # ott
+ insinto "/${oracle_home}"/$(get_libdir)
+ dobin ott
+ doins *.zip
+
+ # more files found in the zip
+ insinto "/${oracle_home}"/admin
+ doins admin/oraaccess.xsd
+
+ eend $?
+ fi
+
+ cd "${S}" || die
+ einstalldocs
+
+ # create path for tnsnames.ora
+ insinto /etc/oracle
+ doins "${FILESDIR}"/tnsnames.ora.sample
+
+ # Add OCI libs to library path
+ {
+ echo "# ${EPREFIX}/etc/env.d/50${PN}"
+ echo "# Do not edit this file, but 99${PN} instead"
+ echo
+ echo "ORACLE_HOME=${EPREFIX}/${oracle_home}"
+ echo "LDPATH=${ldpath}"
+ echo "TNS_ADMIN=/etc/oracle/"
+ } > "${T}"/50${PN}
+
+ doenvd "${T}"/50${PN}
+
+ # ensure ORACLE_HOME/lib exists
+ [[ -e ${ED}${oracle_home}/lib/. ]] ||
+ dosym $(get_libdir) "${oracle_home}"/lib
+}
+
+pkg_preinst() {
+ if [[ -r ${EROOT}/etc/env.d/99${PN} ]]; then
+ cp "${EROOT}/etc/env.d/99${PN}" "${ED}/etc/env.d/" || die
+ else
+ {
+ echo "# ${EPREFIX}/etc/env.d/99${PN}"
+ echo "# Configure system-wide defaults for your Oracle Instant Client here"
+ echo
+ echo "#$(grep '^ORACLE_HOME=' "${ED}/etc/env.d/50${PN}")"
+ echo "#$(grep '^TNS_ADMIN=' "${ED}/etc/env.d/50${PN}")"
+ echo "#NLS_LANG="
+ } > "${ED}/etc/env.d/99${PN}"
+ fi
+}
+
+pkg_postinst() {
+ elog "${P} does not provide an sqlnet.ora"
+ elog "configuration file, redirecting oracle diagnostics for database-"
+ elog "and network-issues into ~USER/oradiag_USER/ instead."
+ elog "It should be safe to ignore this message in sqlnet.log there:"
+ elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
+ elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
+ elog "If you want to directly analyse low-level debug info or don't want"
+ elog "to see it at all, so you really need an sqlnet.ora file, please"
+ elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
+ elog ""
+ elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
+ elog "put your tnsnames.ora there or configure TNS_ADMIN"
+ elog "to point to your user specific configuration."
+ ewarn "Please re-source your shell settings for ORACLE_HOME"
+ ewarn " changes, such as: source /etc/profile"
+}
diff --git a/dev-db/percona-server/Manifest b/dev-db/percona-server/Manifest
new file mode 100644
index 000000000000..33d9c4c624d8
--- /dev/null
+++ b/dev-db/percona-server/Manifest
@@ -0,0 +1,8 @@
+AUX my.cnf-5.5 4795 SHA256 fdcc4678723fdac5dba4b5f87299f142ed8f683e800a44d18ae482f09f0cb3cd SHA512 664b81a1621507104fa843fdda01c3bc60e1f39a6c397329ac8a9f00a63d9298b656d374b819b62ba0de5c1a380e9b16b75ebeaaa2d4614274ff2c168cdc5736 WHIRLPOOL 09176ef118e2c0cff8da87b942f871d2da831421fcd35619f7c785e61d773e0209bda856ad69eb91c243c38fdd73ff4cda6fdae17631b992616053d99eb32857
+AUX my.cnf-5.6 4568 SHA256 4c0657abd5ce47eb84332a85be0a8d808bb8902202722c216c08baa26674e798 SHA512 498826f147ad01615358111511c88f671ff823c400782dbad5f359aff99fa88a7be66e3c3b42fd58a5634f17e12f6a18e1896340f1a5a7acecd75320671c3a10 WHIRLPOOL f9fddb93582129cc332e738f4235a0e22a645cd8a2cbf6fea94666f9ec718093be6cfccf8459c85ada5d34e9bc47612e80b7ac0d9af702033ad1219d3e1801a8
+DIST mysql-extras-20170820-2245Z.tar.bz2 312101 SHA256 619afb88752e461434709ed91e91c2104845a9a9ee67ac944212833f4a715ed8 SHA512 34868c8ba3509ed5e3625c973e16f5015390ca9fc656cbcdbe8f5568bc7cab3708bb7c88b1af324ebb66f86433dfee71b90adf6451556fcfc12ad4e7d32256dd WHIRLPOOL f8e08f47bb0789c25dc096c76340b1ca9db8a264d89aca816e3b45e4dd984dc9dea90554c6c114179dc972026c703404aa8521b3c93fb882d7eadd1295635fb9
+DIST percona-server-5.6.37-82.2.tar.gz 56296960 SHA256 3cf04b64c8bf5b9cc1ea1a68c54ba77a4709d9c9051314e70a4cbd4c904da702 SHA512 38905c2429bee6e6ba9c35b232c87c27c414726b349ff5a878cc94bbc4a333bbf76019478f8e82a10274ffeea5ac71c4520ff534cc434c4844b496b48801ea4e WHIRLPOOL 9e3988072d00f60af467a21092cc737529bd9250ce4ebbfa20834455791a3fb093b11da8bb845bd62e3fa33ad37e63bfbda483139700bd4147e1b7be64578659
+EBUILD percona-server-5.6.37.82.2.ebuild 7431 SHA256 8696b8c7d0f3647312c818df7af75de1c23a12b0d06985ac7f6f10f10bb12c26 SHA512 42b943f7cb7594e8dd1bef942a86db77fe23896310da6c00aeb57ed2a253db8041f0aecf0c54ef1489fa939675d4027adac20b0fa0642d4e5834cedee52ab32d WHIRLPOOL b3d3e92473e7816fad6bc7fdc5345145306ec1c6ceb1bef7174ce4e69bbfa0f2ee210dcdd945bf7ab5b7d643a1bc0ad4171fb2e67a75414cbe7150c960a3fb96
+MISC ChangeLog 8899 SHA256 25435f089936ab71880a07e1561d3838f0e0413b4d2cf2cf141858d031901f61 SHA512 7dd26f70ade041ac8da7ea727c934aed7622fb54477cf1a6140109e402f991fd352bd561e0f763682ba61d1d4ddc5c6309ebf3cfb629e7d2067c4abf2c01ab0c WHIRLPOOL c3794ce8daa271144c82b48ff24b491f2f169dfbaef20980db6bdec2df25838b633b8c1e0d4b76ebea633c7c11ef85dcd2e2e4cbfecde9008e3ad7836a76f22a
+MISC ChangeLog-2015 3040 SHA256 66fbbbf27d7181ae09ff7335f029e507e8004ea3aa2ace8c6cd6ad6b6dee4812 SHA512 b1de5efb9da051d6d76b3c65480ecc2266a55baf6071fcf84ca6cda81b6e84075a0bc2654f3a05b787c7827b5420de168e027acf27c460131e67acd9fa71190c WHIRLPOOL 6edd5db667d4d347347d7181670e39ec1ea1d36f39ac7032a5bb9cfafaa544f39b8dc8d429c530f24919d4dd4a347fc167af53cf603c577df90352ec8bfee207
+MISC metadata.xml 1505 SHA256 bb735bd3118fae8803888a0567ea6dd9ff39c65b364015be218f16d3f9a1f314 SHA512 0ccb7a31827fa15606e060522daf9364bc843a64cfca8538292e989546e07784ea7a8af54ea7a1b02675c64515a1f2225b22971cda4110610836770d1ff33dd6 WHIRLPOOL 052bc0f6e078fff0f2d44e0ace7bbd814395230cb713090c170f663c8a692162196811d2cdae79c3ef6adf178daa61c30339b735c07594b29685c1268bc54600
diff --git a/dev-db/percona-server/files/my.cnf-5.5 b/dev-db/percona-server/files/my.cnf-5.5
new file mode 100644
index 000000000000..d48f6c4e6887
--- /dev/null
+++ b/dev-db/percona-server/files/my.cnf-5.5
@@ -0,0 +1,148 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 1M
+table_open_cache = 64
+sort_buffer_size = 512K
+net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
+
diff --git a/dev-db/percona-server/files/my.cnf-5.6 b/dev-db/percona-server/files/my.cnf-5.6
new file mode 100644
index 000000000000..047c8d79be41
--- /dev/null
+++ b/dev-db/percona-server/files/my.cnf-5.6
@@ -0,0 +1,140 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/mysql/my.cnf: The global mysql configuration file.
+
+# The following options will be passed to all MySQL clients
+[client]
+#password = your_password
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=@GENTOO_PORTAGE_EPREFIX@/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server = utf8
+user = mysql
+port = 3306
+socket = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.sock
+pid-file = @GENTOO_PORTAGE_EPREFIX@/var/run/mysqld/mysqld.pid
+log-error = @GENTOO_PORTAGE_EPREFIX@/var/log/mysql/mysqld.err
+basedir = @GENTOO_PORTAGE_EPREFIX@/usr
+datadir = @DATADIR@
+skip-external-locking
+key_buffer_size = 16M
+max_allowed_packet = 4M
+table_open_cache = 400
+sort_buffer_size = 512K
+net_buffer_length = 16K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
+myisam_sort_buffer_size = 8M
+lc_messages_dir = @GENTOO_PORTAGE_EPREFIX@/usr/share/mysql
+#Set this to your desired error message language
+lc_messages = en_US
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address = 127.0.0.1
+
+log-bin
+server-id = 1
+
+# point the following paths to different dedicated disks
+tmpdir = @GENTOO_PORTAGE_EPREFIX@/tmp/
+#log-update = @GENTOO_PORTAGE_EPREFIX@/path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue
+# #tail -f @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log = @GENTOO_PORTAGE_EPREFIX@/tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 128M
+#
+# i'd like to use @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_arch_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+#innodb_log_group_home_dir = @GENTOO_PORTAGE_EPREFIX@/var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 48M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+innodb_file_per_table
+
+# Uncomment this to get FEDERATED engine support
+#plugin-load=federated=ha_federated.so
+loose-federated
+
+[mysqldump]
+quick
+max_allowed_packet = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer = 2M
+write_buffer = 2M
+
+[myisamchk]
+key_buffer_size = 20M
+sort_buffer_size = 20M
+read_buffer_size = 2M
+write_buffer_size = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/percona-server/metadata.xml b/dev-db/percona-server/metadata.xml
new file mode 100644
index 000000000000..0754114167f5
--- /dev/null
+++ b/dev-db/percona-server/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+<use>
+ <flag name="embedded">Build embedded server (libmysqld)</flag>
+ <flag name="extraengine">Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
+ <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
+ <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
+ <flag name="numa">Enable NUMA support using <pkg>sys-process/numactl</pkg> (NUMA kernel support is also required)</flag>
+ <flag name="openssl">Enable SSL connections and crypto functions using <pkg>dev-libs/openssl</pkg></flag>
+ <flag name="profiling">Add support for statement profiling (requires USE=community).</flag>
+ <flag name="server">Build the server program</flag>
+ <flag name="systemtap">Build support for profiling and tracing using <pkg>dev-util/systemtap</pkg></flag>
+ <flag name="test">Install upstream testsuites for end use.</flag>
+ <flag name="tokudb">Add support for TokuDB storage engine</flag>
+ <flag name="tokudb-backup-plugin">Builds the TokuDB backup plugin</flag>
+ <flag name="yassl">Enable SSL connections and crypto functions using the bundled yaSSL</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/percona-server/percona-server-5.6.37.82.2.ebuild b/dev-db/percona-server/percona-server-5.6.37.82.2.ebuild
new file mode 100644
index 000000000000..887e18914445
--- /dev/null
+++ b/dev-db/percona-server/percona-server-5.6.37.82.2.ebuild
@@ -0,0 +1,219 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MY_EXTRAS_VER="20170820-2245Z"
+SUBSLOT="18"
+PYTHON_COMPAT=( python2_7 )
+inherit linux-info python-any-r1 mysql-multilib-r1
+
+IUSE="numa pam tokudb tokudb-backup-plugin"
+
+# REMEMBER: also update eclass/mysql*.eclass before committing!
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-linux"
+HOMEPAGE="http://www.percona.com/software/percona-server"
+DESCRIPTION="An enhanced, drop-in replacement for MySQL from the Percona team"
+
+# When MY_EXTRAS is bumped, the index should be revised to exclude these.
+EPATCH_EXCLUDE=''
+
+COMMON_DEPEND="numa? ( sys-process/numactl:= )
+ server? ( pam? ( virtual/pam:0= ) )
+ tokudb? ( app-arch/snappy )
+ tokudb-backup-plugin? ( dev-util/valgrind )
+ "
+
+DEPEND="${COMMON_DEPEND}
+ || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
+ test? ( $(python_gen_any_dep 'dev-python/mysql-python[${PYTHON_USEDEP}]') )"
+RDEPEND="${COMMON_DEPEND}"
+
+REQUIRED_USE="tokudb-backup-plugin? ( tokudb ) tokudb? ( jemalloc !tcmalloc )"
+
+MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}"
+
+PATCHES=(
+ "${MY_PATCH_DIR}"/01050_all_mysql_config_cleanup-5.6.patch
+ "${MY_PATCH_DIR}"/02040_all_embedded-library-shared-5.5.10.patch
+ "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-5.6.20.patch
+ "${MY_PATCH_DIR}"/20006_all_cmake_elib-percona-5.6.34.patch
+ "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.6.22.patch
+ "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.6.37.patch
+ "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.6.patch
+ "${MY_PATCH_DIR}"/20018_all_percona-server-5.6.25-without-clientlibs-tools.patch
+)
+
+# Please do not add a naive src_unpack to this ebuild
+# If you want to add a single patch, copy the ebuild to an overlay
+# and create your own mysql-extras tarball, looking at 000_index.txt
+
+pkg_pretend() {
+ mysql-multilib-r1_pkg_pretend
+
+ if use numa; then
+ local CONFIG_CHECK="~NUMA"
+
+ local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;"
+ WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support"
+
+ check_extra_config
+ fi
+}
+
+python_check_deps() {
+ has_version "dev-python/mysql-python[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ mysql-multilib-r1_src_prepare
+ if use libressl ; then
+ sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+ "${S}/cmake/ssl.cmake" || die
+ fi
+}
+
+src_configure() {
+ local MYSQL_CMAKE_NATIVE_DEFINES=( -DWITH_NUMA=$(usex numa)
+ -DWITH_PAM=$(usex pam)
+ $(mysql-cmake_use_plugin tokudb TOKUDB)
+ )
+ if use tokudb ; then
+ # TokuDB Backup plugin requires valgrind unconditionally
+ MYSQL_CMAKE_NATIVE_DEFINES+=(
+ $(usex tokudb-backup-plugin '' -DTOKUDB_BACKUP_DISABLED=1)
+ )
+ fi
+ mysql-multilib-r1_src_configure
+}
+
+# Official test instructions:
+# USE='extraengine perl openssl static-libs' \
+# FEATURES='test userpriv -usersandbox' \
+# ebuild percona-server-X.X.XX.ebuild \
+# digest clean package
+multilib_src_test() {
+
+ if ! multilib_is_native_abi ; then
+ einfo "Server tests not available on non-native abi".
+ return 0;
+ fi
+
+ if ! use server ; then
+ einfo "Skipping server tests due to minimal build."
+ return 0
+ fi
+
+ local TESTDIR="${CMAKE_BUILD_DIR}/mysql-test"
+ local retstatus_unit
+ local retstatus_tests
+
+ # Bug #213475 - MySQL _will_ object strenously if your machine is named
+ # localhost. Also causes weird failures.
+ [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
+
+ if [[ $UID -eq 0 ]]; then
+ die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
+ fi
+
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+
+ # Run CTest (test-units)
+ cmake-utils_src_test
+ retstatus_unit=$?
+ [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
+
+ # Ensure that parallel runs don't die
+ export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
+ # Enable parallel testing, auto will try to detect number of cores
+ # You may set this by hand.
+ # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
+ export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
+
+ # create directories because mysqladmin might right out of order
+ mkdir -p "${T}"/var-tests{,/log}
+
+ # These are failing in Percona 5.6 for now and are believed to be
+ # false positives:
+ #
+ # main.information_schema, binlog.binlog_statement_insert_delayed,
+ # main.mysqld--help-notwin, binlog.binlog_mysqlbinlog_filter
+ # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt
+ # funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers
+ # engines/funcs.db_alter_character_set engines/funcs.db_alter_character_set_collate
+ # engines/funcs.db_alter_collate_ascii engines/funcs.db_alter_collate_utf8
+ # engines/funcs.db_create_character_set engines/funcs.db_create_character_set_collate
+ # fails due to USE=-latin1 / utf8 default
+ #
+ # main.mysql_client_test:
+ # segfaults at random under Portage only, suspect resource limits.
+ #
+ # main.percona_bug1289599
+ # Looks to be a syntax error in the test file itself
+ #
+ # main.variables main.myisam main.merge_recover
+ # fails due to ulimit not able to open enough files (needs 5000)
+ #
+ # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
+ # Called with bad parameters should be reported upstream
+ #
+
+ local t
+
+ for t in main.mysql_client_test \
+ binlog.binlog_statement_insert_delayed main.information_schema \
+ main.mysqld--help-notwin binlog.binlog_mysqlbinlog_filter \
+ perfschema.binlog_edge_mix perfschema.binlog_edge_stmt \
+ funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers \
+ main.variables main.myisam main.merge_recover \
+ engines/funcs.db_alter_character_set engines/funcs.db_alter_character_set_collate \
+ engines/funcs.db_alter_collate_ascii engines/funcs.db_alter_collate_utf8 \
+ engines/funcs.db_create_character_set engines/funcs.db_create_character_set_collate \
+ main.percona_bug1289599 main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do
+ mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
+ done
+
+ if use numa && use kernel_linux ; then
+ # bug 584880
+ if ! linux_config_exists || ! linux_chkconfig_present NUMA ; then
+ for t in sys_vars.innodb_buffer_pool_populate_basic ; do
+ mysql-multilib-r1_disable_test "$t" "Test $t requires system with NUMA support"
+ done
+ fi
+ fi
+
+ if ! use extraengine ; then
+ # bug 401673, 530766
+ for t in federated.federated_plugin ; do
+ mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
+ done
+ fi
+
+ # Run mysql tests
+ pushd "${TESTDIR}" || die
+
+ # Set file limits higher so tests run
+ ulimit -n 3000
+ python_setup
+ # run mysql-test tests
+ perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
+ --testcase-timeout=30 --reorder
+ retstatus_tests=$?
+ [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
+
+ popd || die
+
+ # Cleanup is important for these testcases.
+ pkill -9 -f "${S}/ndb" 2>/dev/null
+ pkill -9 -f "${S}/sql" 2>/dev/null
+
+ failures=""
+ [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
+ [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
+
+ if [[ -n "$failures" ]]; then
+ has usersandbox $FEATURES && eerror "Some tests may have failed due to FEATURES=usersandbox"
+ die "Test failures: $failures"
+ fi
+
+ einfo "Tests successfully completed"
+}
diff --git a/dev-db/percona-toolkit/Manifest b/dev-db/percona-toolkit/Manifest
new file mode 100644
index 000000000000..59a44ee3eefc
--- /dev/null
+++ b/dev-db/percona-toolkit/Manifest
@@ -0,0 +1,15 @@
+AUX percona-toolkit-2.2.17-fix-package-name.patch 872 SHA256 3f532830a03d4305b37afee8a879849088e02de4465fec93b735a487a54fd173 SHA512 74cdd3d460811d6d7b03ca2c1c671cfe13e09de5789456f54a133803a1fd68f1506904a27d1bd41fd6423a52a96b9d8df485a750d8ac32773a04fd486173349d WHIRLPOOL 0eb188e249648e5cffb48a2c2e5ee36cc70db5fd61c411c7a03f1925b7cf57e7741a0690b429fb60dd9d5ca29ff3475b789a3b5a6cd65d3a4a836b43e5944b98
+AUX percona-toolkit-2.2.19-fix-package-name.patch 334 SHA256 bc306319e8faf4dea2a80461af8a20639599a41d12d164a8e9431b958cd394e9 SHA512 6a9ffdcc98e65dfe3eb013170efb4c35ca53375aff4d816118908cb2de1e946591501a22a7ad2a64a19cdf0f68d17a4d2910d6a6fb814e8cb012d20e8d302164 WHIRLPOOL 24dd02e25701ccae23b92b6d68f742d13c44c15b701875c732f3de68e70f28f94d25eee10c599231a3a893201dd81c3d8f6b5268dd1a096129ddce43e67155cf
+AUX percona-toolkit-2.2.20-fix-package-name.patch 334 SHA256 a5560dd4fe06d2aa6d1b19948b7e9bcbe55b5855b51e24a7b3f54246519a1c76 SHA512 eb87fa7d333160d0620ff56fb7e413024f573d05583b68a06aa0156f9a0332ce104ea38e9394d7a842bb5ab05349d77ec4ca3a5fdf28abd582241604f2337e09 WHIRLPOOL f684434fd09d8b609eb219faf74d94d201165f0b8299a4319e1c913c06c607420d6096b19b3990d5f8121ba0ef6b57ccc1c1eed8f3590aeaddf33bc540a0ebc3
+AUX percona-toolkit-2.2.7-no-versioncheck.patch 9310 SHA256 4345de18dcea0243fa9928cdc03cc36d8cccd7cf8636845ab9ce1a539e44faa3 SHA512 6d571c017254e8ea37d128f1623cc4e813ebbfc611cbb84403540c786abc62ee9ba625ec914b101953e5d1d09431f9caa91e270684e00ec6e002b2777b105df9 WHIRLPOOL 8bc7f2a5520bcdff0d0eb2c1cb6d4dd94f8053278199ae4df5ce8924319272f72b3df520feb034bd950e3534f860af364d98ab7a07687a5e34757bccc928c267
+DIST percona-toolkit-2.2.11.tar.gz 1389718 SHA256 848a8a57bf04dc1b2cc2ab555dd594a2c708b76656042ff38b1a91b8ccb1df4b SHA512 d5e34fce1b6b69dfc1a8ecd7bcbe84e586e950976553f4fd30afb887a850770c08990216e41fc194bdd0a5642034905ee2d69c2f8b3781503c9b4aab47017cdb WHIRLPOOL 79e02087c97b86e6e282215cf73c89d7d6842978a1d40d3b9e2a484437e6939a9957c7028feb8690ffc8b915c26627c943204f230f4cb09749bb3e22ec4189ff
+DIST percona-toolkit-2.2.17.tar.gz 1420968 SHA256 5a49c84bd8cf9dceca943f1e2879d0a67b58b73325dc7db725aec81a6a125262 SHA512 a6ac84db9fc77b57fffd4f18b1e6c147fa39821a8b8db128af15bac6884a2937f973aa59adb05b738c3a15d9006c71db49276207c5b321acbefd8bd3a6130b76 WHIRLPOOL f2041c61f0e58c68cad1cb1ddca09aca7f9c0b9bb2ffc81303e80e483211b5fcf59f176d32d9bc324cf1bce6404fe15ad730fda40ad5c9b96c4bc81fc5b9e437
+DIST percona-toolkit-2.2.19.tar.gz 1425623 SHA256 e9f4d4730265813fa7a39ed8799d12ca5775c8e5d6fa27ff48bae11db0f7e671 SHA512 8da35e2ee4d81465131623e5b423c2c49c0bf0faf01862952dd5ca72c2ffea64fabcaf88dda883e633e23de8ae4a6c75a095a751708bac6a8136fc8daaae2383 WHIRLPOOL 7539e661230c321b3ba74b625a67d1e19d3c21676e2e5bbc66d843c1f896df6fc679e406d2703c42b990e7446f490f2fb2cd39298059eb382fbc8af39a46bc31
+DIST percona-toolkit-2.2.20.tar.gz 1431840 SHA256 8439be616ee43b22ba7526135719ef6f40af6621327acc30b84be5f18cd426b1 SHA512 f7a5f47e9ca05c43dcb80866a1eacd13066e1f036f4f58d51145fc6354ddc86dd6515a9aa33c8f736029800bf4c80f7ba5fcb9f1e6ac41653b3351597885f679 WHIRLPOOL 0b8ec9657798b23d809da51ca12befd578f8e26ea96e9b1b723f505df0f9a4ff3345ea9f8d357bd93b316f7338d613b1c417449c61eca974d59419cafb98bdb5
+EBUILD percona-toolkit-2.2.11.ebuild 1262 SHA256 57a14617e667ce35bf7caab40bb02e725063b15f98755c6aee10a32b59351685 SHA512 fb9ab1638b6aff2e43b55a2fb1872f07d36f3f41a7c7c02038681cbaf163e85291b0c79e422e4395b521a0bcb9bc9d0d9d4ae4aaa2654bcafcd39c6e85dca922 WHIRLPOOL f8e54acc8dcd80aba7d8b27b43be99f71efd650d3ca90329a5aafa20e59b1a23f15c15d8e5353ba15b0f6d8482bc1cdb5a27068bdc735fd58c8c1ee6cfd466ef
+EBUILD percona-toolkit-2.2.17.ebuild 1213 SHA256 a7ca6e217438de1769ba5c40ea5ee0648055210e8615e189d4c213c27775089c SHA512 78b956efbe27586145cee31f784cb143cec4c40ef9f06efb315367178db085f2767f8b29180be0549ab407ad77ddc20527588102354eee23d3a328fc46f8a892 WHIRLPOOL 8b4e7aa9957d6156be51eccfea6fc098b6066c3765530ed7ca9a5a880edb4533acb460de89f9fbf234e7c7661331b7f1bd573ed25a282bab9dbfdb8e234ff529
+EBUILD percona-toolkit-2.2.19.ebuild 1213 SHA256 3dbdbf42d196c79bc096fd1701e540373b58ca8f8779a74bf98fefee1da0dd9e SHA512 21caa33395129da3a11c2bd3bac9eff2a722bfc473d4e1065c9baa123542239531755b4b16965c5c470e7851027ce81b9a17b35bf6ba16cd922ca34a600f8fa2 WHIRLPOOL 6365f6ed9475be41dbf6404edbc320516f911e45c4df6232578544a14baa2a04fbecc1de893b337ebe761887fd292d268f2f87b744515179c9256103ecac4864
+EBUILD percona-toolkit-2.2.20.ebuild 1215 SHA256 88cc0fa5eaf65de4c2f9aa4edb727164f877deaa695d5a87927a873a54630ec6 SHA512 d4a46bf28dcf7e71158d797cd699371fd9f6adc45ddc7766c98301308704b9f13bcc1d57439b63fdeceba8d47a4ed07059bf2301c486f500b2a659baae724a56 WHIRLPOOL d76a7d51fdeab6ea19e7e05b4b071edb780338cd49cc788fb70c1809743e97c6fb0169bf762e5c0dfdcada4c7ba81283b47666ae5e333de2da7795a2a9cc9483
+MISC ChangeLog 4228 SHA256 742ea80ad14f46c9ae0bc04fe49e2de15a0e2aa088ad83bd0e862b04584ff8bb SHA512 7137e776f89d97668a1df3769c85fe00848a76218633c66633977298641181b93839348a5565c973ff60b560400ccf03276fe61fbcbbc7876d7f50a222e4258b WHIRLPOOL 88b7f9f5e7b9a642b669bbf5a6358516259ab1d70a812aa6bc83b4f5316d3c953b38678d7693837be1a30e12e716c079f4233010b86313410aa228d227a590ef
+MISC ChangeLog-2015 2400 SHA256 51b0155c3bfc573a6d71ec920ab34bc2ff47435a04578a387bdb0546b11a141e SHA512 20d89950b2bcc9dcadefdae797fa75cade211082a48c74c0dd3c1a4e9cf405c59f78ed7b5cae84f5a4e9b35b3c709c91d4a37d648564a57101e468f69099b743 WHIRLPOOL efb33bce25c9a0913d122d610db1e2262f169a57c34254d7a23c09527819befe3e4758ab8b161ba2538da8cc4420f8aa9f4609d12c26da2183d34c7ace3def44
+MISC metadata.xml 833 SHA256 db64d73ea7f2915791035b51281370bda0da4b6c3186723f593a0f3dba66fff4 SHA512 000249923e3303c31bdb6a74806ef08f917c84fdfb93d6e844d3d77ab8f10143ba0a61de4c71dc7b54003c0cb152e9e7b6491245b44a54d80f8e98d7e4d00959 WHIRLPOOL 8072c76d2d9659cd36ad4b337b1377d461c94eec9147a6d733049adca032cb1bc797b4b50edf0bd4fdf8a24a12a865070b4dcd591a6644e9a9da040ee15b5d9f
diff --git a/dev-db/percona-toolkit/files/percona-toolkit-2.2.17-fix-package-name.patch b/dev-db/percona-toolkit/files/percona-toolkit-2.2.17-fix-package-name.patch
new file mode 100644
index 000000000000..2cd7634840e1
--- /dev/null
+++ b/dev-db/percona-toolkit/files/percona-toolkit-2.2.17-fix-package-name.patch
@@ -0,0 +1,35 @@
+From 0e7c176b38c6ee286511e6bb7720390d31fc6233 Mon Sep 17 00:00:00 2001
+From: Thomas D.
+Date: Tue, 15 Mar 2016 22:21:48 +0100
+Subject: [PATCH] Fix package name
+
+The previous package name "percona-toolkit" is not a valid package name for
+ExtUtils::MakeMaker:
+
+ $ perl Makefile.PL
+ Checking if your kit is complete...
+ Looks good
+ Warning: NAME must be a package name
+ [...]
+
+Let us use the same package name (Percona::Toolkit) various scripts in bin/
+are already using.
+---
+ Makefile.PL | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 7f46523..a9723f4 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,7 +1,7 @@
+ use ExtUtils::MakeMaker;
+
+ WriteMakefile(
+- NAME => 'percona-toolkit',
++ NAME => 'Percona::Toolkit',
+ VERSION => '2.2.17',
+ EXE_FILES => [ <bin/*> ],
+ MAN1PODS => {
+--
+2.7.3
diff --git a/dev-db/percona-toolkit/files/percona-toolkit-2.2.19-fix-package-name.patch b/dev-db/percona-toolkit/files/percona-toolkit-2.2.19-fix-package-name.patch
new file mode 100644
index 000000000000..283299b14b42
--- /dev/null
+++ b/dev-db/percona-toolkit/files/percona-toolkit-2.2.19-fix-package-name.patch
@@ -0,0 +1,13 @@
+Source https://github.com/percona/percona-toolkit/pull/84
+Adapted to current version
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,7 +1,7 @@
+ use ExtUtils::MakeMaker;
+
+ WriteMakefile(
+- NAME => 'percona-toolkit',
++ NAME => 'Percona::Toolkit',
+ VERSION => '2.2.19',
+ EXE_FILES => [ <bin/*> ],
+ MAN1PODS => {
diff --git a/dev-db/percona-toolkit/files/percona-toolkit-2.2.20-fix-package-name.patch b/dev-db/percona-toolkit/files/percona-toolkit-2.2.20-fix-package-name.patch
new file mode 100644
index 000000000000..9865e1ba1a7a
--- /dev/null
+++ b/dev-db/percona-toolkit/files/percona-toolkit-2.2.20-fix-package-name.patch
@@ -0,0 +1,13 @@
+Source https://github.com/percona/percona-toolkit/pull/84
+Adapted to current version
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,7 +1,7 @@
+ use ExtUtils::MakeMaker;
+
+ WriteMakefile(
+- NAME => 'percona-toolkit',
++ NAME => 'Percona::Toolkit',
+ VERSION => '2.2.20',
+ EXE_FILES => [ <bin/*> ],
+ MAN1PODS => {
diff --git a/dev-db/percona-toolkit/files/percona-toolkit-2.2.7-no-versioncheck.patch b/dev-db/percona-toolkit/files/percona-toolkit-2.2.7-no-versioncheck.patch
new file mode 100644
index 000000000000..d6d38177b18f
--- /dev/null
+++ b/dev-db/percona-toolkit/files/percona-toolkit-2.2.7-no-versioncheck.patch
@@ -0,0 +1,216 @@
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-archiver new/percona-toolkit-2.2.7/bin/pt-archiver
+--- old/percona-toolkit-2.2.7/bin/pt-archiver 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-archiver 2014-05-21 18:13:49.148631547 +0200
+@@ -7465,8 +7465,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-config-diff new/percona-toolkit-2.2.7/bin/pt-config-diff
+--- old/percona-toolkit-2.2.7/bin/pt-config-diff 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-config-diff 2014-05-21 18:13:38.012402960 +0200
+@@ -5563,8 +5563,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-deadlock-logger new/percona-toolkit-2.2.7/bin/pt-deadlock-logger
+--- old/percona-toolkit-2.2.7/bin/pt-deadlock-logger 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-deadlock-logger 2014-05-21 18:11:18.923569703 +0200
+@@ -5332,8 +5332,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-diskstats new/percona-toolkit-2.2.7/bin/pt-diskstats
+--- old/percona-toolkit-2.2.7/bin/pt-diskstats 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-diskstats 2014-05-21 18:11:04.041268359 +0200
+@@ -5468,8 +5468,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-duplicate-key-checker new/percona-toolkit-2.2.7/bin/pt-duplicate-key-checker
+--- old/percona-toolkit-2.2.7/bin/pt-duplicate-key-checker 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-duplicate-key-checker 2014-05-21 18:12:51.993462828 +0200
+@@ -5430,8 +5430,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-find new/percona-toolkit-2.2.7/bin/pt-find
+--- old/percona-toolkit-2.2.7/bin/pt-find 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-find 2014-05-21 18:09:46.496705351 +0200
+@@ -4440,8 +4440,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-fk-error-logger new/percona-toolkit-2.2.7/bin/pt-fk-error-logger
+--- old/percona-toolkit-2.2.7/bin/pt-fk-error-logger 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-fk-error-logger 2014-05-21 18:12:39.277202489 +0200
+@@ -4335,8 +4335,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-heartbeat new/percona-toolkit-2.2.7/bin/pt-heartbeat
+--- old/percona-toolkit-2.2.7/bin/pt-heartbeat 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-heartbeat 2014-05-21 18:09:29.885373476 +0200
+@@ -6019,8 +6019,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-index-usage new/percona-toolkit-2.2.7/bin/pt-index-usage
+--- old/percona-toolkit-2.2.7/bin/pt-index-usage 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-index-usage 2014-05-21 18:08:58.139739567 +0200
+@@ -7348,8 +7348,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-kill new/percona-toolkit-2.2.7/bin/pt-kill
+--- old/percona-toolkit-2.2.7/bin/pt-kill 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-kill 2014-05-21 18:11:45.264103271 +0200
+@@ -7626,8 +7626,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-online-schema-change new/percona-toolkit-2.2.7/bin/pt-online-schema-change
+--- old/percona-toolkit-2.2.7/bin/pt-online-schema-change 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-online-schema-change 2014-05-21 18:13:04.843724091 +0200
+@@ -11298,8 +11298,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-query-digest new/percona-toolkit-2.2.7/bin/pt-query-digest
+--- old/percona-toolkit-2.2.7/bin/pt-query-digest 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-query-digest 2014-05-21 18:12:23.127872894 +0200
+@@ -16265,8 +16265,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-slave-delay new/percona-toolkit-2.2.7/bin/pt-slave-delay
+--- old/percona-toolkit-2.2.7/bin/pt-slave-delay 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-slave-delay 2014-05-21 18:08:11.586811388 +0200
+@@ -4698,8 +4698,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-slave-restart new/percona-toolkit-2.2.7/bin/pt-slave-restart
+--- old/percona-toolkit-2.2.7/bin/pt-slave-restart 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-slave-restart 2014-05-21 18:11:32.423843497 +0200
+@@ -5638,8 +5638,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-table-checksum new/percona-toolkit-2.2.7/bin/pt-table-checksum
+--- old/percona-toolkit-2.2.7/bin/pt-table-checksum 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-table-checksum 2014-05-21 18:14:03.377924135 +0200
+@@ -12314,8 +12314,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-table-sync new/percona-toolkit-2.2.7/bin/pt-table-sync
+--- old/percona-toolkit-2.2.7/bin/pt-table-sync 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-table-sync 2014-05-21 18:10:18.476350097 +0200
+@@ -12501,8 +12501,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-upgrade new/percona-toolkit-2.2.7/bin/pt-upgrade
+--- old/percona-toolkit-2.2.7/bin/pt-upgrade 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-upgrade 2014-05-21 18:08:38.344342935 +0200
+@@ -11003,8 +11003,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
+diff -rupN old/percona-toolkit-2.2.7/bin/pt-variable-advisor new/percona-toolkit-2.2.7/bin/pt-variable-advisor
+--- old/percona-toolkit-2.2.7/bin/pt-variable-advisor 2014-02-20 08:20:28.000000000 +0100
++++ new/percona-toolkit-2.2.7/bin/pt-variable-advisor 2014-05-21 18:10:01.967017827 +0200
+@@ -5968,8 +5968,6 @@ Show version and exit.
+
+ =item --[no]version-check
+
+-default: yes
+-
+ Check for the latest version of Percona Toolkit, MySQL, and other programs.
+
+ This is a standard "check for updates automatically" feature, with two
diff --git a/dev-db/percona-toolkit/metadata.xml b/dev-db/percona-toolkit/metadata.xml
new file mode 100644
index 000000000000..5579d6b912c3
--- /dev/null
+++ b/dev-db/percona-toolkit/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+ </maintainer>
+ <longdescription>Percona Toolkit, formerly Maatkit and Aspersa, formerly MySQL Toolkit,
+ is a collection of command-line utilities that provide missing
+ functionality for MySQL. Some of the tools implement lacking server
+ functionality, such as online consistency checks for master/slave
+ replication; others are client-side utilities such as a query
+ profiler.</longdescription>
+ <!--
+ <upstream>
+ <remote-id type="launchpad">percona-toolkit</remote-id>
+ </upstream>
+ -->
+</pkgmetadata>
diff --git a/dev-db/percona-toolkit/percona-toolkit-2.2.11.ebuild b/dev-db/percona-toolkit/percona-toolkit-2.2.11.ebuild
new file mode 100644
index 000000000000..402e3ff753d1
--- /dev/null
+++ b/dev-db/percona-toolkit/percona-toolkit-2.2.11.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils perl-app perl-module toolchain-funcs
+
+DESCRIPTION="essential command-line utilities for MySQL"
+HOMEPAGE="http://www.percona.com/software/percona-toolkit/"
+SRC_URI="http://www.percona.com/downloads/${PN}/${PV}/${P}.tar.gz"
+
+LICENSE="|| ( GPL-2 Artistic )"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+# Package warrants IUSE doc
+IUSE=""
+
+COMMON_DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ virtual/perl-Time-HiRes"
+RDEPEND="${COMMON_DEPEND}
+ dev-perl/JSON
+ dev-perl/libwww-perl
+ dev-perl/Role-Tiny
+ virtual/perl-File-Path
+ virtual/perl-Getopt-Long
+ virtual/perl-Time-Local
+ virtual/perl-Digest-MD5
+ virtual/perl-IO-Compress
+ virtual/perl-File-Temp
+ virtual/perl-File-Spec
+ virtual/perl-Scalar-List-Utils
+ dev-perl/TermReadKey"
+DEPEND="${COMMON_DEPEND}
+ virtual/perl-ExtUtils-MakeMaker"
+
+src_prepare() {
+ # bug 501904 - CVE-2014-2029
+ # sed -i -e '/^=item --\[no\]version-check/,/^default: yes/{/^default: yes/d}' bin/*
+ epatch "${FILESDIR}/${PN}-2.2.7-no-versioncheck.patch"
+}
+
+# Percona Toolkit does NOT contain the UDF code for Murmur/FNV any more.
+src_install() {
+ perl-module_src_install
+ dodoc docs/percona-toolkit.pod
+}
diff --git a/dev-db/percona-toolkit/percona-toolkit-2.2.17.ebuild b/dev-db/percona-toolkit/percona-toolkit-2.2.17.ebuild
new file mode 100644
index 000000000000..1673b79d5a9d
--- /dev/null
+++ b/dev-db/percona-toolkit/percona-toolkit-2.2.17.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit perl-module
+
+DESCRIPTION="Advanced command-line tools to perform a variety of MySQL and system tasks"
+HOMEPAGE="https://www.percona.com/software/mysql-tools/percona-toolkit"
+SRC_URI="https://www.percona.com/downloads/${PN}/${PV}/tarball/${P}.tar.gz"
+
+LICENSE="|| ( GPL-2 Artistic )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+# Package warrants IUSE doc
+IUSE=""
+
+COMMON_DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ virtual/perl-Time-HiRes"
+RDEPEND="${COMMON_DEPEND}
+ dev-perl/JSON
+ dev-perl/libwww-perl
+ dev-perl/Role-Tiny
+ virtual/perl-File-Path
+ virtual/perl-Getopt-Long
+ virtual/perl-Time-Local
+ virtual/perl-Digest-MD5
+ virtual/perl-IO-Compress
+ virtual/perl-File-Temp
+ virtual/perl-File-Spec
+ virtual/perl-Scalar-List-Utils
+ dev-perl/TermReadKey"
+DEPEND="${COMMON_DEPEND}
+ virtual/perl-ExtUtils-MakeMaker"
+
+src_prepare() {
+ # Bug #501904 - CVE-2014-2029
+ # sed -i -e '/^=item --\[no\]version-check/,/^default: yes/{/^default: yes/d}' bin/*
+ eapply -p2 "${FILESDIR}"/${PN}-2.2.7-no-versioncheck.patch
+ eapply -p1 "${FILESDIR}"/${PN}-2.2.17-fix-package-name.patch
+
+ default
+}
diff --git a/dev-db/percona-toolkit/percona-toolkit-2.2.19.ebuild b/dev-db/percona-toolkit/percona-toolkit-2.2.19.ebuild
new file mode 100644
index 000000000000..7ffe6c3da3be
--- /dev/null
+++ b/dev-db/percona-toolkit/percona-toolkit-2.2.19.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit perl-module
+
+DESCRIPTION="Advanced command-line tools to perform a variety of MySQL and system tasks"
+HOMEPAGE="https://www.percona.com/software/mysql-tools/percona-toolkit"
+SRC_URI="https://www.percona.com/downloads/${PN}/${PV}/tarball/${P}.tar.gz"
+
+LICENSE="|| ( GPL-2 Artistic )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+# Package warrants IUSE doc
+IUSE=""
+
+COMMON_DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ virtual/perl-Time-HiRes"
+RDEPEND="${COMMON_DEPEND}
+ dev-perl/JSON
+ dev-perl/libwww-perl
+ dev-perl/Role-Tiny
+ virtual/perl-File-Path
+ virtual/perl-Getopt-Long
+ virtual/perl-Time-Local
+ virtual/perl-Digest-MD5
+ virtual/perl-IO-Compress
+ virtual/perl-File-Temp
+ virtual/perl-File-Spec
+ virtual/perl-Scalar-List-Utils
+ dev-perl/TermReadKey"
+DEPEND="${COMMON_DEPEND}
+ virtual/perl-ExtUtils-MakeMaker"
+
+src_prepare() {
+ # Bug #501904 - CVE-2014-2029
+ # sed -i -e '/^=item --\[no\]version-check/,/^default: yes/{/^default: yes/d}' bin/*
+ eapply -p2 "${FILESDIR}"/${PN}-2.2.7-no-versioncheck.patch
+ eapply -p1 "${FILESDIR}"/${PN}-2.2.19-fix-package-name.patch
+
+ default
+}
diff --git a/dev-db/percona-toolkit/percona-toolkit-2.2.20.ebuild b/dev-db/percona-toolkit/percona-toolkit-2.2.20.ebuild
new file mode 100644
index 000000000000..9dc68077033e
--- /dev/null
+++ b/dev-db/percona-toolkit/percona-toolkit-2.2.20.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit perl-module
+
+DESCRIPTION="Advanced command-line tools to perform a variety of MySQL and system tasks"
+HOMEPAGE="https://www.percona.com/software/mysql-tools/percona-toolkit"
+SRC_URI="https://www.percona.com/downloads/${PN}/${PV}/tarball/${P}.tar.gz"
+
+LICENSE="|| ( GPL-2 Artistic )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+# Package warrants IUSE doc
+IUSE=""
+
+COMMON_DEPEND="dev-perl/DBI
+ dev-perl/DBD-mysql
+ virtual/perl-Time-HiRes"
+RDEPEND="${COMMON_DEPEND}
+ dev-perl/JSON
+ dev-perl/libwww-perl
+ dev-perl/Role-Tiny
+ virtual/perl-File-Path
+ virtual/perl-Getopt-Long
+ virtual/perl-Time-Local
+ virtual/perl-Digest-MD5
+ virtual/perl-IO-Compress
+ virtual/perl-File-Temp
+ virtual/perl-File-Spec
+ virtual/perl-Scalar-List-Utils
+ dev-perl/TermReadKey"
+DEPEND="${COMMON_DEPEND}
+ virtual/perl-ExtUtils-MakeMaker"
+
+src_prepare() {
+ # Bug #501904 - CVE-2014-2029
+ # sed -i -e '/^=item --\[no\]version-check/,/^default: yes/{/^default: yes/d}' bin/*
+ eapply -p2 "${FILESDIR}"/${PN}-2.2.7-no-versioncheck.patch
+ eapply -p1 "${FILESDIR}"/${PN}-2.2.20-fix-package-name.patch
+
+ default
+}
diff --git a/dev-db/percona-xtrabackup/Manifest b/dev-db/percona-xtrabackup/Manifest
new file mode 100644
index 000000000000..b8a1341bf6aa
--- /dev/null
+++ b/dev-db/percona-xtrabackup/Manifest
@@ -0,0 +1,8 @@
+AUX percona-xtrabackup-2.4.6-fix-gcc6-isystem.patch 3801 SHA256 15bbcf88ff8945295805f2f1b641f020001f3cae5e9d3143ab39202b4197ed43 SHA512 8ab3cb41092f3ce324213917842d0cf72d2b501c60238007b57702458c572ea0d7faa159dec10367bfef97584b0b2dfc0a153bba5f13ac9efebeae2f1e2c7a39 WHIRLPOOL 8b48af01fe42c9c9115958a6d92b8004994d7e800709c72ab3c37baa57eb955d938d62a4516b59b7769e03f3f2b22c5149adc7f00d37e02d351cc91b990551b9
+AUX percona-xtrabackup-2.4.6-remove-boost-version-check.patch 485 SHA256 b2480ebdbfbc8f5ba678932ebb9e67f2892f06a50302d17aee0ffd133713cd71 SHA512 31277d6bef14a6b642ce425ce9f2c92fe49f905c42c720a583cb45406c1ee18ccbf2bef224b9b89bb02de18aecc1ec48576f5ca0c9bfef0cc683d78218506906 WHIRLPOOL 3c61ff5ce7e7b33ef37ab2f5c0424d5d7ef32bf6d11e2be837c1bdfd352ed1dc1d88edd2ec2c7127bd87a439a023ae0227cca4ee22048151e480591166fe0338
+DIST percona-xtrabackup-2.4.7.tar.gz 54119422 SHA256 261567a4f0bdde0df7eefeb4f651ad39b4752984bbaabd68245e0e5ee368871a SHA512 7aaf82975cd4c0b7af119902eddf96b8ce75c0fbcbd6835991e33f1f89347361fbe3c9040762c9989df5d53199b628aa6b2b45004ef440bb46e2415fbab13009 WHIRLPOOL 768749471ac987a24f86d07b330988cb679042be5a8affd264f1195eeeacaa8e403370d558316708a056acb4b0ad78083e195f31a4f2a58bc497bf301be2ddb1
+DIST percona-xtrabackup-2.4.8.tar.gz 57965576 SHA256 66a9cb73ce03c8a0b125998d464190288cb400cc6c22a766798ed4b24cceab91 SHA512 a613c41169c6ebdba27c6cb8111d388ff656d4daf0e69b52e401b293a6ac6499d81d0f028afd805fa60018ad5f2007e70db7a9ba931d6829272f0ce273ba9739 WHIRLPOOL c6b8d93abade6f8a4586c6d01db6e569eafad9cc21827af6d36b91e58fcb0352e0cba0221031b4c582b372744360a97b296b868006e9d9b6f591cfa07cf22918
+EBUILD percona-xtrabackup-2.4.7.ebuild 1757 SHA256 4330e29a3d14ba3fc7cf705ba97369bbadde51fe206b8bf63bdf7ee92e643c05 SHA512 12837447a0a2f63db110d93b7f736658e6c34aaf478bf1d94589ef48d881fea24085b55c1a71aeea85a315ac3843309292ef35a95d566b19dbf2971f62d8bf48 WHIRLPOOL f07e0366d7e48ab8887911593cc932bfba56394452df28044fedb1ba13c7eb7c23dc55ac2629e7faf3cef4ec012c4bae9eef62baf14d737a7594efe2091ed5d6
+EBUILD percona-xtrabackup-2.4.8.ebuild 1806 SHA256 4b9d5cffdbe5d5ffdf5f686eeea48345e101243984ff78b5bedf1fbdd2cd122f SHA512 7c735c4e95b154b58b796a02ac7ea25586d480874b5268d39f72f2592d2e9bf7b84ef92696e0df311d54dd5afbd952def07b21783a50755fc35daaaf0477e2e6 WHIRLPOOL cef83ff051c413272a64d04a0760b3b3e6f5fb2b2ca5bca3fd54a21f8b6752bce1660de37bafcb40f469e7ef19aaa3c448d3f464405e9156d5e44b13d6d87a7d
+MISC ChangeLog 1334 SHA256 51107538cea464b0750237424322e3c54ec738f25bdc0a6677bf63a8ba0942fa SHA512 6e3e203a7855df7db424cb790da735b3ab5a7a83eda65b1027d23bcf731e5ada2c7a683a4ebed0f5191b521a7f7e49a253f3d2d231598a39c7b09a2efb8297fc WHIRLPOOL 656748a7337f8dfc5f0c67258b75736a729111920b0c3b903a519d95c1dfaf646afb1a07ad49bc2aae2178f3abcd8de652fcc3b5794dcff2ed405c2f03c2b294
+MISC metadata.xml 563 SHA256 486a4fbe1025f330bf051dfec480bd58780e2dcc1f26bac7bd390512225af405 SHA512 050e1a78c8c7f4b024b207754005dcec28188697b3be2d93c30f800f8a91da1a3376b4501a4a6e061dcd096a958a9a4cba62251f5003b2056dfadee5bfda6716 WHIRLPOOL 3aa3246de6ff6ed3f036b3a86d3665100c54933bd599a8a735af5277902857f5ca1df4429236f62c6820e41094503253e362849286af9084355c67fd575827f0
diff --git a/dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-fix-gcc6-isystem.patch b/dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-fix-gcc6-isystem.patch
new file mode 100644
index 000000000000..6418e34a8d6b
--- /dev/null
+++ b/dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-fix-gcc6-isystem.patch
@@ -0,0 +1,112 @@
+Do not use -isystem to add headers, as they break GCC 6's header wrapping.
+See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
+
+--- a/client/base/CMakeLists.txt
++++ b/client/base/CMakeLists.txt
+@@ -49,7 +49,7 @@
+ mutex.cc
+ mysql_query_runner.cc
+ show_variable_query_extractor.cc
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ TARGET_LINK_LIBRARIES(client_base mysqlclient)
+--- a/client/CMakeLists.txt
++++ b/client/CMakeLists.txt
+@@ -52,7 +52,7 @@
+ upgrade/program.cc
+ )
+ ADD_COMPILE_FLAGS(
+- upgrade/program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ upgrade/program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+ TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient client_base mysqlcheck_core)
+ ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs GenSysSchema)
+--- a/client/dump/CMakeLists.txt
++++ b/client/dump/CMakeLists.txt
+@@ -68,7 +68,7 @@
+ ADD_COMPILE_FLAGS(
+ ${BOOST_LIB_SOURCES}
+ ${BOOST_THREAD_SOURCES}
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ IF(HAVE_clock_gettime_IN_rt)
+@@ -163,7 +163,7 @@
+
+ ADD_COMPILE_FLAGS(
+ ${MYSQLPUMP_LIB_SOURCES}
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ # Files that use Boost sources that trigger compilation warnings
+@@ -199,7 +199,7 @@
+ )
+ MYSQL_ADD_EXECUTABLE(mysqlpump program.cc)
+ ADD_COMPILE_FLAGS(
+- program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ TARGET_LINK_LIBRARIES(mysqlpump mysqlpump_lib ${LOCAL_BOOST_LIB})
+--- a/libmysqld/CMakeLists.txt
++++ b/libmysqld/CMakeLists.txt
+@@ -115,7 +115,7 @@
+ ../sql/item_geofunc_setops.cc
+ ../sql/item_json_func.cc
+ ../sql/spatial.cc
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ # Fixes "C1128: number of sections exceeded object file format limit" in MSVC /MD
+--- a/sql/CMakeLists.txt
++++ b/sql/CMakeLists.txt
+@@ -309,7 +309,7 @@
+ item_geofunc_setops.cc
+ item_json_func.cc
+ spatial.cc
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ # Fixes "C1128: number of sections exceeded object file format limit" in MSVC /MD
+--- a/storage/innobase/xtrabackup/src/CMakeLists.txt
++++ b/storage/innobase/xtrabackup/src/CMakeLists.txt
+@@ -68,7 +68,7 @@
+ ../../../../plugin/keyring/keyring_key.cc
+ ../../../../plugin/keyring/buffered_file_io.cc
+ ../../../../plugin/keyring/keys_container.cc
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ ADD_COMPILE_FLAGS(
+--- a/unittest/gunit/CMakeLists.txt
++++ b/unittest/gunit/CMakeLists.txt
+@@ -378,7 +378,7 @@
+ ENDIF()
+ ADD_COMPILE_FLAGS(
+ ${MERGE_SMALL_TESTS}
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+
+@@ -453,11 +453,11 @@
+ ENDIF()
+ ADD_COMPILE_FLAGS(
+ bounded_queue-t.cc
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+ ADD_COMPILE_FLAGS(
+ pump_object_filter-t.cc
+- COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR}
++ COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR}
+ )
+
+ FOREACH(test ${SERVER_TESTS})
diff --git a/dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-remove-boost-version-check.patch b/dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-remove-boost-version-check.patch
new file mode 100644
index 000000000000..48a7fcc783f0
--- /dev/null
+++ b/dev-db/percona-xtrabackup/files/percona-xtrabackup-2.4.6-remove-boost-version-check.patch
@@ -0,0 +1,19 @@
+Remove Boost version check which makes using the
+system boost libraries close to impossible.
+
+--- a/cmake/boost.cmake
++++ b/cmake/boost.cmake
+@@ -262,13 +262,6 @@
+ COULD_NOT_FIND_BOOST()
+ ENDIF()
+
+-IF(NOT BOOST_MINOR_VERSION EQUAL 59)
+- MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} "
+- "we need 59"
+- )
+- COULD_NOT_FIND_BOOST()
+-ENDIF()
+-
+ MESSAGE(STATUS "BOOST_INCLUDE_DIR ${BOOST_INCLUDE_DIR}")
+
+ # We have a limited set of patches/bugfixes here:
diff --git a/dev-db/percona-xtrabackup/metadata.xml b/dev-db/percona-xtrabackup/metadata.xml
new file mode 100644
index 000000000000..927d7f85fdf7
--- /dev/null
+++ b/dev-db/percona-xtrabackup/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hydrapolic@gmail.com</email>
+ <name>Tomáš Mózes</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>manwe@manwe.pl</email>
+ <name>Michał Zając</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">percona/percona-xtrabackup</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/percona-xtrabackup/percona-xtrabackup-2.4.7.ebuild b/dev-db/percona-xtrabackup/percona-xtrabackup-2.4.7.ebuild
new file mode 100644
index 000000000000..7a3720c1107d
--- /dev/null
+++ b/dev-db/percona-xtrabackup/percona-xtrabackup-2.4.7.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils flag-o-matic
+
+DESCRIPTION="Hot backup utility for MySQL based servers"
+HOMEPAGE="https://www.percona.com/software/mysql-database/percona-xtrabackup"
+SRC_URI="https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/source/tarball/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="
+ app-arch/lz4:0=
+ app-editors/vim-core
+ <dev-libs/boost-1.65.0:=
+ dev-libs/libaio
+ <dev-libs/libedit-20170329.3.1
+ dev-libs/libev
+ dev-libs/libevent:0=
+ dev-libs/libgcrypt:0=
+ dev-libs/libgpg-error
+ dev-python/sphinx
+ net-misc/curl
+ sys-libs/zlib"
+RDEPEND="${DEPEND}
+ !dev-db/xtrabackup-bin
+ dev-perl/DBD-mysql"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.4.6-remove-boost-version-check.patch
+ "${FILESDIR}"/${PN}-2.4.6-fix-gcc6-isystem.patch
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # remove bundled lz4, boost, libedit, libevent, zlib
+ # just to be safe...
+ rm -r extra/lz4 include/boost_1_59_0 \
+ cmd-line-utils/libedit libevent zlib || die
+}
+
+src_configure() {
+ # Needed, due to broken handling of CMAKE_BUILD_TYPE leading to
+ #
+ # error: 'fts_ast_node_type_get' was not declared in this scope
+ #
+ append-cppflags -DDBUG_OFF
+
+ local mycmakeargs=(
+ -DBUILD_CONFIG=xtrabackup_release
+ -DWITH_EDITLINE=system
+ -DWITH_LIBEVENT=system
+ -DWITH_LZ4=system
+ -DWITH_SSL=bundled # uses yassl, which isn't packaged
+ -DWITH_ZLIB=system
+ -DWITH_PIC=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ local p="${BUILD_DIR}/storage/innobase/xtrabackup"
+
+ dobin "${p}"/src/{xbcloud,xbcrypt,xbstream,xtrabackup}
+ dosym xtrabackup /usr/bin/innobackupex
+
+ einstalldocs
+ doman "${p}"/doc/source/build/man/*
+}
diff --git a/dev-db/percona-xtrabackup/percona-xtrabackup-2.4.8.ebuild b/dev-db/percona-xtrabackup/percona-xtrabackup-2.4.8.ebuild
new file mode 100644
index 000000000000..9230fcab15d9
--- /dev/null
+++ b/dev-db/percona-xtrabackup/percona-xtrabackup-2.4.8.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils flag-o-matic
+
+DESCRIPTION="Hot backup utility for MySQL based servers"
+HOMEPAGE="https://www.percona.com/software/mysql-database/percona-xtrabackup"
+SRC_URI="https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/source/tarball/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+ app-arch/lz4:0=
+ app-editors/vim-core
+ <dev-libs/boost-1.65.0:=
+ dev-libs/libaio
+ <dev-libs/libedit-20170329.3.1
+ dev-libs/libev
+ dev-libs/libevent:0=
+ dev-libs/libgcrypt:0=
+ dev-libs/libgpg-error
+ dev-python/sphinx
+ net-misc/curl
+ sys-libs/zlib"
+
+RDEPEND="
+ ${DEPEND}
+ !dev-db/xtrabackup-bin
+ dev-perl/DBD-mysql"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.4.6-remove-boost-version-check.patch
+ "${FILESDIR}"/${PN}-2.4.6-fix-gcc6-isystem.patch
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # remove bundled lz4, boost, libedit, libevent, zlib
+ # just to be safe...
+ rm -rv \
+ extra/lz4 \
+ include/boost_1_59_0 \
+ cmd-line-utils/libedit \
+ libevent \
+ zlib || die
+}
+
+src_configure() {
+ # Needed, due to broken handling of CMAKE_BUILD_TYPE leading to
+ #
+ # error: 'fts_ast_node_type_get' was not declared in this scope
+ #
+ append-cppflags -DDBUG_OFF
+
+ local mycmakeargs=(
+ -DBUILD_CONFIG=xtrabackup_release
+ -DWITH_EDITLINE=system
+ -DWITH_LIBEVENT=system
+ -DWITH_LZ4=system
+ -DWITH_SSL=bundled # uses yassl, which isn't packaged
+ -DWITH_ZLIB=system
+ -DWITH_PIC=ON
+ )
+
+ local CMAKE_BUILD_TYPE="Release"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ local p="${BUILD_DIR}/storage/innobase/xtrabackup"
+
+ dobin "${p}"/src/{xbcloud,xbcrypt,xbstream,xtrabackup}
+ dosym xtrabackup /usr/bin/innobackupex
+
+ einstalldocs
+ doman "${p}"/doc/source/build/man/*
+}
diff --git a/dev-db/pg_activity/Manifest b/dev-db/pg_activity/Manifest
new file mode 100644
index 000000000000..be625c7ea4c0
--- /dev/null
+++ b/dev-db/pg_activity/Manifest
@@ -0,0 +1,5 @@
+DIST pg_activity-1.2.0.tar.gz 88863 SHA256 e93f09263f9111963818dafe6a8f166ed9c1b272e56e046925d7524ebf779d92 SHA512 0bf2f3f746755cb3bc6cbff6a9377d172b15a82c836a19cd52ef8073c39cbb8ffaf2f9583fca437cabc7251bab55a874e1ee8e0559778881d42bcc030bf5d0c4 WHIRLPOOL ec8f5d414290bdbb59821ca37cd1a0d098db3771e7d51f0f4f5125c999889a69bf0a71e94288ee7d0e90821b78f5eef3d907f5eac46a5e8e6a5bcf68a241163b
+EBUILD pg_activity-1.2.0.ebuild 623 SHA256 fdeb46771b261581c1e28bbd21158a945b150d6e869adfe999fb707ce7ef8648 SHA512 1f7debcfb9165f69f7e52b8f40470e3449a4aa4fb8773f2a1ed5baea0c158d74f9758d430a1f513fde5ebc6dfba45f27823bff8fb49966acac27c8ba4e197d32 WHIRLPOOL 079280ab8c4d3cce329a158a27b57a60a79606fb9b04e492cbafc9e30ea4aae7e829826e60684d091806d73c7d58dedefecd90abf7ba0608f3de21a8595b9940
+MISC ChangeLog 2186 SHA256 b1d2f7ce4d138af38c4ed22737fc21c5b0571c658fa8639b54750da6ff1e4567 SHA512 53f34349fd60942ff31ecb7763ea5ca55e08e1b5bdb64aebf1f239c5ef40f799e72205206f3817d0db44df7a22f12ae87caf25a343908f5fe2619fb71b965634 WHIRLPOOL bfc2545dc047dcb58e44ea48af4d4e506ae788c422c44d4e5d4cf23a128691540a735ff56d8c07d21779ad74fd8cc199102ed2bf31dece50c65b30f72fd7e683
+MISC ChangeLog-2015 493 SHA256 0aee9b28c168bf353062b9278e7fb61e9b541756d5d4dae44a7b8fde88c35522 SHA512 c0abc8872e125f6f97546d626ec5af9e0884f6c99b85c2a7ce5bb1caae29db90c919b903751eeda6b4a9a2b9d7930b8572eb09701b8b1e214bbf4fce995bb74c WHIRLPOOL b8743814b531dd6f1cb0aea744e243e9d94fe41799e8d59fbba08c706c852b40ffff31745f21484cef894214e1b7895b77dfe4dfdd24317570d5f4f15a8ddd72
+MISC metadata.xml 339 SHA256 d53e2679617e3bac1fb939753c264e1fcbdd44e059f0f96de2d3ec93388f8df4 SHA512 db6f9da66f99eb53ef5c118ebb7e6d2ecde79c118a0a7b3094375405cf02700bb2f423b830d23ad4819819557bf35a1073a67bafe0de01654f9651e956840355 WHIRLPOOL e7fe658280fba1333606cdb142195b11258a94f48fa3e32e3e63159a9830b5de36a7ecd3f34407fe21d3224ecce90073088f3e318ca569ebb858275ae8ce64af
diff --git a/dev-db/pg_activity/metadata.xml b/dev-db/pg_activity/metadata.xml
new file mode 100644
index 000000000000..77dc3c3999e2
--- /dev/null
+++ b/dev-db/pg_activity/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ago@gentoo.org</email>
+ <name>Agostino Sarubbo</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">julmon/pg_activity</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/pg_activity/pg_activity-1.2.0.ebuild b/dev-db/pg_activity/pg_activity-1.2.0.ebuild
new file mode 100644
index 000000000000..ab84a426b26f
--- /dev/null
+++ b/dev-db/pg_activity/pg_activity-1.2.0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Realtime PostgreSQL database server monitoring tool"
+HOMEPAGE="https://github.com/julmon/pg_activity/"
+SRC_URI="https://github.com/julmon/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+LICENSE="POSTGRESQL"
+
+DEPEND=""
+RDEPEND="dev-python/psutil[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-python/psycopg:2[${PYTHON_USEDEP}]"
+
+src_install() {
+ distutils-r1_src_install
+ doman docs/man/${PN}.1
+}
diff --git a/dev-db/pg_top/Manifest b/dev-db/pg_top/Manifest
new file mode 100644
index 000000000000..1fe14883eb06
--- /dev/null
+++ b/dev-db/pg_top/Manifest
@@ -0,0 +1,9 @@
+AUX pg_top-3.6.2.patch 724 SHA256 f9f8b25ed8fe8471cf71af79acd8751b61731a8e7009da2f8f379d0374c2554b SHA512 d5384e611b71d919d9d02dcb759fa47fb66030430aba8b200c436ddde464ceae629440a82046af4ef29abf9428555f9df0f1f6d452dd698248512af052fff04f WHIRLPOOL 442d746f7ca07c6737f9080989be63b0c14711bdd4ab1b0d1bf124cace68e9c2785330c102237ead4bf9c5d36330603fc294e76675451f8a5f1aa3bf99a32506
+AUX pg_top-3.7.0.patch 749 SHA256 abeea9acc7eaa494c0ec6165643f171911b893579161d6fac66f6d0860fba596 SHA512 e94b14318f22f35fb28de3e0d53e6ff785a36e1eed37fe0f8066a0e0e4adb5c2c280de5c577ba7969715bee594ed2686b41fde0ce2930990064ab80132c760e4 WHIRLPOOL d53340c825055355583a58ba4140531f859929afd8148875f1764cb9f441dc04c15d870909c3ef8029591ef9169b89ad0dfd977121b581baa965df15eca45888
+DIST pg_top-3.6.2.tar.bz2 220985 SHA256 8a749f6aec44625d834e477982c67ba0a76262a6a8c87b20e20df9ea07ce714d SHA512 0e7f33cccd7a1debce4965a11ff3d5d6868aace53651ca1c486f061728034f0ab3901ddfbded022c9297d3393eaea32585ca779334954c87fd0c13c8fa523074 WHIRLPOOL c92e62a1765a734da290b2df78fc6770819f8a566baf8c69929bbace89aa46b0cf4399e25e594947e57cf74f46a22a35a25d5db0d407fd28738343eab0f74558
+DIST pg_top-3.7.0.tar.bz2 236076 SHA256 c48d726e8cd778712e712373a428086d95e2b29932e545ff2a948d043de5a6a2 SHA512 509cd3ce65a9b549097eaab5ae27106fa469cdeb4f37950564654f3df01390e1a771c8fa4f5858c3e4c1e76470b6c0fd9b07e8268564f59285e30bf824d7c4ec WHIRLPOOL 29c8f326f08e31a13b7f903d025b4608107524de5b65c8567788e6855df6b01a2991b95312e8b3da88a3df0d946834929cab681599340a647e93d8401114ed83
+EBUILD pg_top-3.6.2-r1.ebuild 623 SHA256 58ea6c4e50c39138414007e4e1804d536fd1f751b7ae97559f4a6c15fda010ea SHA512 3c6d2bdfc87807147247418b9a8b1178a5df5159cb4d8b0e0c12ba8ea7f8c14f491ebb207614eba4f6e9a8857dd5be509aa138a166dd44a1cf2fa9acb69ccd57 WHIRLPOOL 0d8ce8494b3693b6c3bb270b98245bba4168b98babe6256bd6951eed7991f1d8248042160cf73035eef926dc46e652ff60c5ad2abebc6fd170ba7a9dd7a86894
+EBUILD pg_top-3.7.0.ebuild 623 SHA256 4a1c1459039ecc42c791630f5a02c264338c34b08a6ab652b3257b373c63f460 SHA512 9518ba816b4856cbdaa744faaa49a2bf785bfadc479a4b1a9d91d8b804ae9605fe5c33768bbe4241b55e0cf61d85c831d10a5ea38b41a3a34495fc69c9676b50 WHIRLPOOL 3a1359f76cf489ad85db7a60a1076b219b5c321172ec545630b93d20a388a1a6ed38d73fa78b4c660e96dfa506725cce7f5ae55c4eac0037b2ff3aedbbafde97
+MISC ChangeLog 2927 SHA256 eb8fdc721c5e2c317492ee378ae82b96c3f57377c0f5e9a525b995c9d7696a95 SHA512 7efd8b00424fa16f2d83c5c27e3f21ea5c7b0e16d2bd40f48abbfeceff1017d01f565f7e6201188d921146623402725821ac0241378a857f9c603f2257ff0f7c WHIRLPOOL 30552e7ccc2ba99e20923bb1901f91eb804d6a9146f751fdc4c0cdf28374bc2685f1b2eca540ed0e9bd11644f9cb5620dcc9be35e115e1d1f6eab3a176b64fae
+MISC ChangeLog-2015 2064 SHA256 eff2ee9d9f0e7309fa214f48b4a234eaa5c18a2fd2bc1875f706e933a28bd1a4 SHA512 da90c013e5b6c51f5daa64ed4c7a09ac4be3aa9bd5094805a914287819a7964bde34fe35b31e26de889ddb1cfc697a03fffe81b600137a5d0cf65af79d71f20e WHIRLPOOL 45fd903abbe1bbb1cbcdd5129a137f9c391f710becc1fc5d4bc9d9691679aa976570f19c7c738d72dfde33bb9a31ed6981e3327c4b16a8c9b30d9d817794ee02
+MISC metadata.xml 461 SHA256 da2519e7d0bef419ea4007b07196a50582e5eb82bb04b547e8f536851f0eb4e8 SHA512 ef6740e37b9d51eb8d303e393d826c91519e8fbd2fe66930486bfbf16bf3bfe09f1a90040a044428841ed61dd6885eefefa2fc9bc43a08e6d4e2dec4a67ba9fc WHIRLPOOL 5b48379002ee7a2b0c02de5231f04f098acb472735d38eff0241625dd2d759f29e62a31c3335498d30c7b57e3170c0f598155029f757fece71fd7de30dc0feb0
diff --git a/dev-db/pg_top/files/pg_top-3.6.2.patch b/dev-db/pg_top/files/pg_top-3.6.2.patch
new file mode 100644
index 000000000000..03ef912ed2b8
--- /dev/null
+++ b/dev-db/pg_top/files/pg_top-3.6.2.patch
@@ -0,0 +1,29 @@
+--- configure.ac.orig 2013-09-20 10:11:20.256444684 +0400
++++ configure.ac 2013-09-20 10:16:30.262459612 +0400
+@@ -90,7 +90,7 @@
+
+ DBCFLAGS="-I$INCLUDEDIR"
+ LIBDIR=`$PG_CONFIG --libdir`
+-DBLDFLAGS="-L$LIBDIR -lpq"
++DBLDFLAGS="-L$LIBDIR"
+
+ AC_SUBST(DBCFLAGS)
+ AC_SUBST(DBLDFLAGS)
+@@ -109,6 +109,8 @@
+ AC_SEARCH_LIBS(inet_aton, resolv, AC_DEFINE(HAVE_INET_ATON, 1,
+ [inet_aton is already defined]))
+
++AC_SEARCH_LIBS(PQexec, pq)
++
+ # check for libraries required by extension
+ extlibs=""
+ if test -n "$with_ext" -a -f "${srcdir}/ext/$with_ext.libs"; then
+@@ -216,8 +218,6 @@
+ AC_SUBST(SRC)
+ AC_SUBST(OBJ)
+
+-CFLAGS="-Wall -g"
+-
+ AC_MSG_CHECKING(for installation settings)
+ # calculate appropriate settings
+ OWNER=""
diff --git a/dev-db/pg_top/files/pg_top-3.7.0.patch b/dev-db/pg_top/files/pg_top-3.7.0.patch
new file mode 100644
index 000000000000..6367a1dc03dc
--- /dev/null
+++ b/dev-db/pg_top/files/pg_top-3.7.0.patch
@@ -0,0 +1,29 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -103,7 +103,7 @@
+ AC_SEARCH_LIBS(elf32_getphdr, elf)
+ # -lmld -lmach
+ AC_SEARCH_LIBS(vm_statistics, mach)
+-AC_SEARCH_LIBS(tgetent, termcap curses ncurses)
++AC_SEARCH_LIBS(tgetent, termcap tinfo curses ncurses)
+ AC_SEARCH_LIBS(exp, m)
+
+ AC_SEARCH_LIBS(dlerror, dl)
+@@ -111,6 +111,8 @@
+ AC_SEARCH_LIBS(inet_aton, resolv, AC_DEFINE(HAVE_INET_ATON, 1,
+ [inet_aton is already defined]))
+
++AC_SEARCH_LIBS(PQexec, pq)
++
+ # check for libraries required by extension
+ extlibs=""
+ if test -n "$with_ext" -a -f "${srcdir}/ext/$with_ext.libs"; then
+@@ -217,8 +219,6 @@
+ AC_SUBST(SRC)
+ AC_SUBST(OBJ)
+
+-CFLAGS="-Wall -g"
+-
+ AC_MSG_CHECKING(for installation settings)
+ # calculate appropriate settings
+ OWNER=""
diff --git a/dev-db/pg_top/metadata.xml b/dev-db/pg_top/metadata.xml
new file mode 100644
index 000000000000..7bf9e26e0d40
--- /dev/null
+++ b/dev-db/pg_top/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <longdescription lang="en">
+ pg_top is 'top' for PostgreSQL. It is derived from Unix Top. Similar to
+ top, pg_top allows you to monitor PostgreSQL processes.
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-db/pg_top/pg_top-3.6.2-r1.ebuild b/dev-db/pg_top/pg_top-3.6.2-r1.ebuild
new file mode 100644
index 000000000000..ed4375a4571f
--- /dev/null
+++ b/dev-db/pg_top/pg_top-3.6.2-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+inherit autotools-utils eutils
+
+DESCRIPTION="'top' for PostgreSQL"
+HOMEPAGE="http://ptop.projects.postgresql.org/"
+SRC_URI="http://pgfoundry.org/frs/download.php/1780/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="dev-db/postgresql"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( FAQ HISTORY README TODO Y2K )
+PATCHES=( "${FILESDIR}/${P}.patch" )
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
diff --git a/dev-db/pg_top/pg_top-3.7.0.ebuild b/dev-db/pg_top/pg_top-3.7.0.ebuild
new file mode 100644
index 000000000000..7531d3439336
--- /dev/null
+++ b/dev-db/pg_top/pg_top-3.7.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+inherit autotools-utils eutils
+
+DESCRIPTION="'top' for PostgreSQL"
+HOMEPAGE="http://ptop.projects.postgresql.org/"
+SRC_URI="http://pgfoundry.org/frs/download.php/3504/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="dev-db/postgresql"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( FAQ HISTORY README TODO Y2K )
+PATCHES=( "${FILESDIR}/${P}.patch" )
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
diff --git a/dev-db/pgadmin3/Manifest b/dev-db/pgadmin3/Manifest
new file mode 100644
index 000000000000..b592090758e0
--- /dev/null
+++ b/dev-db/pgadmin3/Manifest
@@ -0,0 +1,11 @@
+AUX pgadmin3-desktop-r1.patch 512 SHA256 46d9881b4e45ab935acfbf8c1cce52bb611e3f7f6f4018d4ef5ff0dad2dd7cb4 SHA512 8a3253318ad6b98136b8fd4539dffc030d9625a256d7f802a399e972b9a5cf3440a3c602bde8ee21091eed4aae8c736643b9a15246dfd3bae56c8dbd80847ae6 WHIRLPOOL b09ce60ea51e67380bbbdc8efc0ce040923dce5a2475ab41f18a30986a79070534af3f2c7db4a6ae051e82c467a6ab062b303a39a8e504f3d5433c82ac9d8ca0
+AUX pgadmin3-desktop.patch 533 SHA256 c0da2c8e45b5407f8c7421e92edf2f6d2902d69bc76aa1cce9e872d9a58f0819 SHA512 f36c3b3ce8dd384b32bf096de4ea95b3a7d63f82514512615f8e7cc3a0ac3f892390114ba65b66ebb69db1cce5415afd517941622cf2a6939a58d7792b362557 WHIRLPOOL b44a66c67f4037ae8aef7f47ec62ce40a30f2386fcc6dab8ef0eeef17b2b26e97e0988677b9b6c56cdec820112fb440413adfcfcf3ff0c092da1e84920dfd88a
+AUX pgadmin3-gcc6-null-pointer.patch 421 SHA256 b175869b77bcbfa43f1bc256277966882789883792c4f9dd26038ec248def6a2 SHA512 c0fe3d3cc5c1c29f69f3b81b0c78fbe2cf6e484e3ace9e35a3352d93246fc8227047c7c59a168bedfdc7b4f67d3db800c8b1d7cd962d7952436e080a2ea1e083 WHIRLPOOL 4e10d294227a8ec04fe40e5d7e9c4766a3b7df7bebd3ee7070c6edce362205ec2c7b4ace483ee33d122abe11445644aed53edc7d158586af3fe6a8e6320406a3
+DIST pgadmin3-1.22.1.tar.gz 14667770 SHA256 719ea7c0e65d99e8f365bf2d395d7a199804170b3266ada1374d9ac790bc783e SHA512 f190e82317e10b75cb0ebd7cc0c878c4be9c392e33aba44a1356446e4cac92735834a32b1d65999ffc3e36ed130d4cfcc1c25ad5faa3c745e884fccd797331e0 WHIRLPOOL ce7291cd0257914d6c5c11b71f0de630d9b72ac1ec9ee890a4b1feffed540c751c16e4164544223bb7db0eca02d1798d83f188362db4b750c504fd44aad081b7
+DIST pgadmin3-1.22.2.tar.gz 14788481 SHA256 9b68b0e3d3f0a261344fb8196825967d1e7acaca1d8cc82c42e12368ca5844ac SHA512 dcfc72cc2e33dbf1c9d1ce287f9d1d46eb047c99a165372cb74ef1716098f90f2ce2a8d0cd21b511a1ac8c0569dc7b3c0593208a74641f5a8f29dc9c04e40bbd WHIRLPOOL 22db2eb23520d80a3a2d2187954885ed46dac5a8db3fc26eec81faec20987fcc9a2529e0f5d91a6560374c9518209f361530911fbc60488109ec22819e0c048d
+EBUILD pgadmin3-1.22.1-r1.ebuild 1232 SHA256 dd33f90439c3b7b09584f58f644778d738d98a923f99b95e184e3501a15f9fb5 SHA512 b062550f8bc6856906984eef98cdf57ec191c7008a0b70f12f10a89811b98125d3a690cb48bf419990b4f6bcc9346517e518bb8975cb10c18a9f151d890028eb WHIRLPOOL c585c918c2d081684bfaa3a0b6340a8b5c7fafb25c02320e87f645d2042d25e8250d6a93e8c74b90b1afbb9b04d9020f82a6194cd3b0e968122dddd0e3eb137e
+EBUILD pgadmin3-1.22.1-r2.ebuild 918 SHA256 0d49872e9f7561b7f6c4acfdb3ca3a6ab80657bd90f7c2229bf2a26a7deab60b SHA512 029c492b94913695c6d1ee1ce5508e284ebe112ecb960a5dcae7eeb8a8b7e48b6ba8af8ecf00fbd80ff2a9bed8867faa04b26b05d9ee3c4b828b378edaa55739 WHIRLPOOL 25f6546551f02a741d77909f485d340aae65f82eea793a0ebf00aa7d771eba490607e6cc1ebe1252e07095b8a9e0eceb84619f4a50f9dfd982602d753f30a34a
+EBUILD pgadmin3-1.22.2.ebuild 982 SHA256 382e042cf62e12a8601ddd015d5976f3bedd7cbc125b97c9ddce406c6274ee5a SHA512 ad39f85a87a0f90ce8d2646de9bfb1eb311d4b79d90b7f33abe3ceb551fe9b50753b124b48c6d965eab4134f5c57da4e157f5493165a1d50431b5fc23f52d6f9 WHIRLPOOL 458ae2936c9887cea340a8438174cab64f262b24df5b08a233cbc440e492cc36bfe1e9576fdcca354742877ba03812c4786c1e2e39853a90468a2b10cee193b1
+MISC ChangeLog 4756 SHA256 aec332ea3ad6d7d771a71cde558067bda4136e9eb20ede5c66fbf64554a1caa1 SHA512 b2afaeb1447cb4db6e7c9aa6134ca8bf80ea1ee25f4d3d0eee051e6c37e93f389418dadf2a46f787cd0569a86337fbf8fd031f914c506b29bf309851966268c3 WHIRLPOOL 975d8d6b0f9cf75dd40841d5f2a3574f9caf6d184c36614b6230eb043a92e9fd07d26318f8ba929065b70d93ed232a66188422e95f4f375be999ca6ac9f8d321
+MISC ChangeLog-2015 15376 SHA256 67c6bcb093d15422761eaa141ab143836419e5ac9f1af7177887fbdee6d7a8fa SHA512 14379a90e6ff07bd8367ee7b656dcf6cff8dd3a04f920a52fd1233c9d1f5a730a24c0e96727230f92d3bb7896c0d3ad6a096ddf39bb74ca8235f4f739c374659 WHIRLPOOL 576172b1eccd3397bb7a25c29084ea369ba197e7ee9b3f28861eda9d516351d57026ce250bfecb67828dbefee59eed2fb909b47e9e7755575f207850e9b603fe
+MISC metadata.xml 368 SHA256 7d625ab5d00b750ed72a3cc7438ce2deb60b2d991e20dcedc3054ce07d330638 SHA512 435f2da400e35d133390ec90860cfe1dd135281156ae1ed6c28e32b4e9f67d93cdb5e7e9ffa183244984e689a131838e6301a50d5366216bccc2df5cd97b54ea WHIRLPOOL f1282ccb0f3ad2f0d4dc39e657544fa35e83e686c5d1f325cc61e1405d3ca4c78507ab4354c2e52183506e3b62b0186153cc7961d73d4df0c15604c19bde665f
diff --git a/dev-db/pgadmin3/files/pgadmin3-desktop-r1.patch b/dev-db/pgadmin3/files/pgadmin3-desktop-r1.patch
new file mode 100644
index 000000000000..64a599e00cdb
--- /dev/null
+++ b/dev-db/pgadmin3/files/pgadmin3-desktop-r1.patch
@@ -0,0 +1,15 @@
+diff -Naruw a/pkg/pgadmin3.desktop b/pkg/pgadmin3.desktop
+--- a/pkg/pgadmin3.desktop 2013-02-22 12:21:19.000000000 -0500
++++ b/pkg/pgadmin3.desktop 2015-02-04 15:36:34.845312953 -0500
+@@ -2,9 +2,8 @@
+ Encoding=UTF-8
+ Name=pgAdmin III
+ Exec=/usr/bin/pgadmin3
+-Icon=/usr/share/pgadmin3/pgAdmin3.png
++Icon=/usr/share/pixmaps/pgadmin3.png
+ Type=Application
+-Categories=Application;Development;
+-MimeType=text/html
++Categories=Development;
+ DocPath=/usr/share/pgadmin3/docs/en_US/index.html
+ Comment=PostgreSQL Tools
diff --git a/dev-db/pgadmin3/files/pgadmin3-desktop.patch b/dev-db/pgadmin3/files/pgadmin3-desktop.patch
new file mode 100644
index 000000000000..0453d8d7e4b3
--- /dev/null
+++ b/dev-db/pgadmin3/files/pgadmin3-desktop.patch
@@ -0,0 +1,16 @@
+diff -Naruw a/pkg/pgadmin3.desktop b/pkg/pgadmin3.desktop
+--- a/pkg/pgadmin3.desktop 2013-02-22 12:21:19.000000000 -0500
++++ b/pkg/pgadmin3.desktop 2015-02-04 15:36:34.845312953 -0500
+@@ -2,9 +2,9 @@
+ Encoding=UTF-8
+ Name=pgAdmin III
+ Exec=/usr/bin/pgadmin3
+-Icon=/usr/share/pgadmin3/pgAdmin3.png
++Icon=/usr/share/pixmaps/pgadmin3.png
+ Type=Application
+-Categories=Application;Development;
+-MimeType=text/html
++Categories=Development;
++MimeType=text/html;
+ DocPath=/usr/share/pgadmin3/docs/en_US/index.html
+ Comment=PostgreSQL Tools
diff --git a/dev-db/pgadmin3/files/pgadmin3-gcc6-null-pointer.patch b/dev-db/pgadmin3/files/pgadmin3-gcc6-null-pointer.patch
new file mode 100644
index 000000000000..1396f8de8aab
--- /dev/null
+++ b/dev-db/pgadmin3/files/pgadmin3-gcc6-null-pointer.patch
@@ -0,0 +1,11 @@
+--- a/pgadmin/frm/plugins.cpp
++++ b/pgadmin/frm/plugins.cpp
+@@ -380,7 +380,7 @@ bool pluginUtilityFactory::CheckEnable(p
+ {
+ // If we need a specific server type, we can't enable unless
+ // we have a connection.
+- if (!obj || !(obj->GetConnection()->GetStatus() == PGCONN_OK))
++ if (!obj || !obj->GetConnection() || !(obj->GetConnection()->GetStatus() == PGCONN_OK))
+ return false;
+
+ // Get the server type.
diff --git a/dev-db/pgadmin3/metadata.xml b/dev-db/pgadmin3/metadata.xml
new file mode 100644
index 000000000000..7d8a73bc92c1
--- /dev/null
+++ b/dev-db/pgadmin3/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+<use>
+ <flag name="databasedesigner">Enable the Database Designer component</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/pgadmin3/pgadmin3-1.22.1-r1.ebuild b/dev-db/pgadmin3/pgadmin3-1.22.1-r1.ebuild
new file mode 100644
index 000000000000..f2ebdc7e46e5
--- /dev/null
+++ b/dev-db/pgadmin3/pgadmin3-1.22.1-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils multilib versionator wxwidgets
+
+DESCRIPTION="wxWidgets GUI for PostgreSQL"
+HOMEPAGE="http://www.pgadmin.org/"
+SRC_URI="mirror://postgresql/${PN}/release/v${PV}/src/${P}.tar.gz"
+
+LICENSE="POSTGRESQL"
+KEYWORDS="amd64 ppc x86 ~x86-fbsd"
+SLOT="0"
+IUSE="debug +databasedesigner"
+
+DEPEND="
+ x11-libs/wxGTK:3.0=[X]
+ >=dev-db/postgresql-8.4.0:=
+ >=dev-libs/libxml2-2.6.18
+ >=dev-libs/libxslt-1.1"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ local pgslot=$(postgresql-config show)
+
+ if [[ ${pgslot//.} < 84 ]] ; then
+ eerror "PostgreSQL slot must be set to 8.4 or higher."
+ eerror " postgresql-config set 8.4"
+ die "PostgreSQL slot is not set to 8.4 or higher."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/pgadmin3-desktop.patch"
+
+ epatch_user
+}
+
+src_configure() {
+ WX_GTK_VER="3.0"
+
+ setup-wxwidgets
+
+ econf --with-wx-version=${WX_GTK_VER} \
+ $(use_enable debug) \
+ $(use_enable databasedesigner)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ newicon "${S}/pgadmin/include/images/pgAdmin3.png" ${PN}.png
+
+ domenu "${S}/pkg/pgadmin3.desktop"
+
+ # Fixing world-writable files
+ fperms -R go-w /usr/share
+}
diff --git a/dev-db/pgadmin3/pgadmin3-1.22.1-r2.ebuild b/dev-db/pgadmin3/pgadmin3-1.22.1-r2.ebuild
new file mode 100644
index 000000000000..27d932986e32
--- /dev/null
+++ b/dev-db/pgadmin3/pgadmin3-1.22.1-r2.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils wxwidgets
+
+DESCRIPTION="wxWidgets GUI for PostgreSQL"
+HOMEPAGE="https://www.pgadmin.org/"
+SRC_URI="mirror://postgresql/${PN}/release/v${PV}/src/${P}.tar.gz"
+
+LICENSE="POSTGRESQL"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+SLOT="0"
+IUSE="debug +databasedesigner"
+
+DEPEND="
+ >=dev-db/postgresql-8.4.0:=
+ >=dev-libs/libxml2-2.6.18
+ >=dev-libs/libxslt-1.1
+ x11-libs/wxGTK:3.0=[X]"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${PN}-desktop-r1.patch" )
+
+src_configure() {
+ WX_GTK_VER="3.0"
+
+ setup-wxwidgets
+
+ econf --with-wx-version=${WX_GTK_VER} \
+ $(use_enable debug) \
+ $(use_enable databasedesigner)
+}
+
+src_install() {
+ default
+
+ newicon "${S}/pgadmin/include/images/pgAdmin3.png" ${PN}.png
+
+ domenu "${S}/pkg/pgadmin3.desktop"
+
+ # Fixing world-writable files
+ fperms -R go-w /usr/share
+}
diff --git a/dev-db/pgadmin3/pgadmin3-1.22.2.ebuild b/dev-db/pgadmin3/pgadmin3-1.22.2.ebuild
new file mode 100644
index 000000000000..efce58f103c6
--- /dev/null
+++ b/dev-db/pgadmin3/pgadmin3-1.22.2.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils multilib versionator wxwidgets
+
+DESCRIPTION="wxWidgets GUI for PostgreSQL"
+HOMEPAGE="http://www.pgadmin.org/"
+SRC_URI="mirror://postgresql/pgadmin/pgadmin3/v${PV}/src/${P}.tar.gz"
+
+LICENSE="POSTGRESQL"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+SLOT="0"
+IUSE="debug +databasedesigner"
+
+DEPEND="
+ x11-libs/wxGTK:3.0=[X]
+ >=dev-db/postgresql-8.4.0:=
+ >=dev-libs/libxml2-2.6.18
+ >=dev-libs/libxslt-1.1"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}"/pgadmin3-{desktop,gcc6-null-pointer}.patch )
+
+src_configure() {
+ WX_GTK_VER="3.0"
+
+ setup-wxwidgets
+
+ econf --with-wx-version=${WX_GTK_VER} \
+ $(use_enable debug) \
+ $(use_enable databasedesigner)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ newicon "${S}/pgadmin/include/images/pgAdmin3.png" ${PN}.png
+
+ domenu "${S}/pkg/pgadmin3.desktop"
+
+ # Fixing world-writable files
+ fperms -R go-w /usr/share
+}
diff --git a/dev-db/pgadmin4/Manifest b/dev-db/pgadmin4/Manifest
new file mode 100644
index 000000000000..7c7c5335e42d
--- /dev/null
+++ b/dev-db/pgadmin4/Manifest
@@ -0,0 +1,5 @@
+DIST pgadmin4-1.6.tar.gz 24595129 SHA256 514c021994c91eb9adb4a42edcec12974b473175289d48a5824b8c0f4e15e0c8 SHA512 115c2b0f1fd205912ba5fa51426de8c75ce979a075a16434ced3421186794fef756faae58f81c9585359cbe31b7bde24b773cfc886a64d349e656334349f6387 WHIRLPOOL 2697d253cf4a05a57fd06576636ab689c883daea46eae190f57ccb0a88a77e0df5e57bea554aca844beaab4cc9e10ecdf0607a0aee24468ed0602c78073f98c4
+DIST pgadmin4-2.0.tar.gz 24988176 SHA256 a8c8052d9e61f3ae357810bcabc8ffc8b02a0c39730e1f14d9a920ae7cae6ccb SHA512 463e95a341dec74ac0a08a647af1cbe83b514b0595b8469ab9c7b5335e24604e082b906d530aa735fef7b08c58d8a8a6df3edf5dc65402f6521165f1cbb72f67 WHIRLPOOL 5685a6d7c4fbeb1c4629ab30908e75792ede775afe59895462fe1760b45e33a7b67e5942eabb63400eab9c757aeb1f872d0146161839f304cb2d2b8f133a1ff5
+EBUILD pgadmin4-1.6.ebuild 3378 SHA256 bde889c71affa93d6041019cb42590c243a5d612d4ba36679155a9ea8a70b9cb SHA512 4f36248b9538041a6b837986fc53e56c916ad3247aa674130dafc598bdac6286121cc289ac9eb184e9d557f579da38b3412ce2bb80ceb07d92262bd37adbd433 WHIRLPOOL fac15cd3858d12a522fd304896afac277ba231d04295cdcbe205b847c4abe2d400eb701007c458de655b7085de33d54b450792000aab2a6f0f8bf94868ae76af
+EBUILD pgadmin4-2.0.ebuild 3378 SHA256 bde889c71affa93d6041019cb42590c243a5d612d4ba36679155a9ea8a70b9cb SHA512 4f36248b9538041a6b837986fc53e56c916ad3247aa674130dafc598bdac6286121cc289ac9eb184e9d557f579da38b3412ce2bb80ceb07d92262bd37adbd433 WHIRLPOOL fac15cd3858d12a522fd304896afac277ba231d04295cdcbe205b847c4abe2d400eb701007c458de655b7085de33d54b450792000aab2a6f0f8bf94868ae76af
+MISC metadata.xml 266 SHA256 eef85725585b45398124c5be76b10938c155120d7fb2af2d50082030a59b2d71 SHA512 9f85990c7ce6a1de5c1067e4781af18bede2d3bd02963a7b2927766b70dbe98d3fb63bb01e19b1cf6e2b77038d9788bf38155b3cc33f9e5ff8430b10a4006325 WHIRLPOOL 9f0cee39655a0947e3f8df38dfd33db69caaaae947e85205ea842236c257f70e6f2e5a196d5bd080a8f670efbbc57eb487bb89ef31a36aa28deaab3e7e36ce8d
diff --git a/dev-db/pgadmin4/metadata.xml b/dev-db/pgadmin4/metadata.xml
new file mode 100644
index 000000000000..f1828406d76b
--- /dev/null
+++ b/dev-db/pgadmin4/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/pgadmin4/pgadmin4-1.6.ebuild b/dev-db/pgadmin4/pgadmin4-1.6.ebuild
new file mode 100644
index 000000000000..9357a0e8f27c
--- /dev/null
+++ b/dev-db/pgadmin4/pgadmin4-1.6.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5} )
+PYTHON_REQ_USE="sqlite"
+
+inherit python-single-r1 qmake-utils
+
+DESCRIPTION="GUI administration and development platform for PostgreSQL"
+HOMEPAGE="http://www.pgadmin.org/"
+SRC_URI="mirror://postgresql/pgadmin/${PN}/v${PV}/source/${P}.tar.gz"
+
+LICENSE="POSTGRESQL"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE="doc"
+
+RESTRICT="test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="${PYTHON_DEPS}
+ dev-qt/qtwidgets:5
+ dev-qt/qtwebkit:5
+ dev-qt/qtwebengine:5[widgets]
+"
+
+DEPEND="${COMMON_DEPEND}
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+"
+
+RDEPEND="${COMMON_DEPEND}
+ >=app-text/htmlmin-0.1.10[${PYTHON_USEDEP}]
+ >=dev-python/Babel-2.3.4[${PYTHON_USEDEP}]
+ >=dev-python/beautifulsoup-4.4.1[${PYTHON_USEDEP}]
+ >=dev-python/blinker-1.3[${PYTHON_USEDEP}]
+ >=dev-python/click-6.6[${PYTHON_USEDEP}]
+ >=dev-python/extras-0.0.3[${PYTHON_USEDEP}]
+ >=dev-python/fixtures-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/flask-0.11.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-babel-0.11.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-gravatar-0.4.2[${PYTHON_USEDEP}]
+ >=dev-python/flask-htmlmin-1.2[${PYTHON_USEDEP}]
+ >=dev-python/flask-login-0.3.2[${PYTHON_USEDEP}]
+ >=dev-python/flask-mail-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-migrate-2.0.3[${PYTHON_USEDEP}]
+ >=dev-python/flask-principal-0.4.0[${PYTHON_USEDEP}]
+ >=dev-python/flask-security-1.7.5[${PYTHON_USEDEP}]
+ >=dev-python/flask-sqlalchemy-2.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-wtf-0.12[${PYTHON_USEDEP}]
+ >=dev-python/html5lib-0.9999999[${PYTHON_USEDEP}]
+ >=dev-python/itsdangerous-0.24[${PYTHON_USEDEP}]
+ >=dev-python/jinja-2.7.3[${PYTHON_USEDEP}]
+ >=dev-python/linecache2-1.0.0[${PYTHON_USEDEP}]
+ >=dev-python/markupsafe-0.23[${PYTHON_USEDEP}]
+ >=dev-python/mimeparse-1.5.1[${PYTHON_USEDEP}]
+ >=dev-python/passlib-1.6.2[${PYTHON_USEDEP}]
+ >=dev-python/pbr-1.9.1[${PYTHON_USEDEP}]
+ >=dev-python/psycopg-2.7.1[${PYTHON_USEDEP}]
+ >=dev-python/pycrypto-2.6.1[${PYTHON_USEDEP}]
+ >=dev-python/pyrsistent-0.11.13[${PYTHON_USEDEP}]
+ >=dev-python/python-dateutil-2.5.0[${PYTHON_USEDEP}]
+ >=dev-python/python-sqlparse-0.1.19[${PYTHON_USEDEP}]
+ >=dev-python/pytz-2014.10[${PYTHON_USEDEP}]
+ >=dev-python/simplejson-3.6.5[${PYTHON_USEDEP}]
+ >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
+ >=dev-python/speaklater-1.3[${PYTHON_USEDEP}]
+ >=dev-python/sqlalchemy-1.0.14[${PYTHON_USEDEP}]
+ >=dev-python/werkzeug-0.9.6[${PYTHON_USEDEP}]
+ >=dev-python/wtforms-2.0.2[${PYTHON_USEDEP}]
+"
+
+S="${WORKDIR}"/${P}/runtime
+
+src_prepare() {
+ cd "${WORKDIR}"/${P} || die
+ default
+}
+
+src_configure() {
+ eqmake5
+}
+
+src_compile() {
+ default
+ if use doc; then
+ cd "${WORKDIR}"/${P} || die
+ emake docs
+ fi
+}
+
+src_install() {
+ dobin pgAdmin4
+
+ cd "${WORKDIR}"/${P} || die
+
+ local APP_DIR=/usr/share/${PN}/web
+ insinto "${APP_DIR}"
+ doins -r web/*
+ cat > "${D}${APP_DIR}"/config_local.py <<-EOF
+ SERVER_MODE = False
+ UPGRADE_CHECK_ENABLED = False
+ EOF
+ python_optimize "${D}${APP_DIR}"
+
+ local CONFIG_DIR="/etc/xdg/pgadmin"
+ dodir "${CONFIG_DIR}"
+ cat > "${D}${CONFIG_DIR}"/pgadmin4.conf <<-EOF
+ [General]
+ ApplicationPath=${APP_DIR}
+ PythonPath=$(python_get_sitedir)
+ EOF
+
+ if use doc; then
+ rm -r docs/en_US/_build/html/_sources || die
+ insinto /usr/share/${PN}/docs/en_US/_build
+ doins -r docs/en_US/_build/html
+ fi
+}
diff --git a/dev-db/pgadmin4/pgadmin4-2.0.ebuild b/dev-db/pgadmin4/pgadmin4-2.0.ebuild
new file mode 100644
index 000000000000..9357a0e8f27c
--- /dev/null
+++ b/dev-db/pgadmin4/pgadmin4-2.0.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5} )
+PYTHON_REQ_USE="sqlite"
+
+inherit python-single-r1 qmake-utils
+
+DESCRIPTION="GUI administration and development platform for PostgreSQL"
+HOMEPAGE="http://www.pgadmin.org/"
+SRC_URI="mirror://postgresql/pgadmin/${PN}/v${PV}/source/${P}.tar.gz"
+
+LICENSE="POSTGRESQL"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE="doc"
+
+RESTRICT="test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="${PYTHON_DEPS}
+ dev-qt/qtwidgets:5
+ dev-qt/qtwebkit:5
+ dev-qt/qtwebengine:5[widgets]
+"
+
+DEPEND="${COMMON_DEPEND}
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+"
+
+RDEPEND="${COMMON_DEPEND}
+ >=app-text/htmlmin-0.1.10[${PYTHON_USEDEP}]
+ >=dev-python/Babel-2.3.4[${PYTHON_USEDEP}]
+ >=dev-python/beautifulsoup-4.4.1[${PYTHON_USEDEP}]
+ >=dev-python/blinker-1.3[${PYTHON_USEDEP}]
+ >=dev-python/click-6.6[${PYTHON_USEDEP}]
+ >=dev-python/extras-0.0.3[${PYTHON_USEDEP}]
+ >=dev-python/fixtures-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/flask-0.11.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-babel-0.11.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-gravatar-0.4.2[${PYTHON_USEDEP}]
+ >=dev-python/flask-htmlmin-1.2[${PYTHON_USEDEP}]
+ >=dev-python/flask-login-0.3.2[${PYTHON_USEDEP}]
+ >=dev-python/flask-mail-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-migrate-2.0.3[${PYTHON_USEDEP}]
+ >=dev-python/flask-principal-0.4.0[${PYTHON_USEDEP}]
+ >=dev-python/flask-security-1.7.5[${PYTHON_USEDEP}]
+ >=dev-python/flask-sqlalchemy-2.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-wtf-0.12[${PYTHON_USEDEP}]
+ >=dev-python/html5lib-0.9999999[${PYTHON_USEDEP}]
+ >=dev-python/itsdangerous-0.24[${PYTHON_USEDEP}]
+ >=dev-python/jinja-2.7.3[${PYTHON_USEDEP}]
+ >=dev-python/linecache2-1.0.0[${PYTHON_USEDEP}]
+ >=dev-python/markupsafe-0.23[${PYTHON_USEDEP}]
+ >=dev-python/mimeparse-1.5.1[${PYTHON_USEDEP}]
+ >=dev-python/passlib-1.6.2[${PYTHON_USEDEP}]
+ >=dev-python/pbr-1.9.1[${PYTHON_USEDEP}]
+ >=dev-python/psycopg-2.7.1[${PYTHON_USEDEP}]
+ >=dev-python/pycrypto-2.6.1[${PYTHON_USEDEP}]
+ >=dev-python/pyrsistent-0.11.13[${PYTHON_USEDEP}]
+ >=dev-python/python-dateutil-2.5.0[${PYTHON_USEDEP}]
+ >=dev-python/python-sqlparse-0.1.19[${PYTHON_USEDEP}]
+ >=dev-python/pytz-2014.10[${PYTHON_USEDEP}]
+ >=dev-python/simplejson-3.6.5[${PYTHON_USEDEP}]
+ >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
+ >=dev-python/speaklater-1.3[${PYTHON_USEDEP}]
+ >=dev-python/sqlalchemy-1.0.14[${PYTHON_USEDEP}]
+ >=dev-python/werkzeug-0.9.6[${PYTHON_USEDEP}]
+ >=dev-python/wtforms-2.0.2[${PYTHON_USEDEP}]
+"
+
+S="${WORKDIR}"/${P}/runtime
+
+src_prepare() {
+ cd "${WORKDIR}"/${P} || die
+ default
+}
+
+src_configure() {
+ eqmake5
+}
+
+src_compile() {
+ default
+ if use doc; then
+ cd "${WORKDIR}"/${P} || die
+ emake docs
+ fi
+}
+
+src_install() {
+ dobin pgAdmin4
+
+ cd "${WORKDIR}"/${P} || die
+
+ local APP_DIR=/usr/share/${PN}/web
+ insinto "${APP_DIR}"
+ doins -r web/*
+ cat > "${D}${APP_DIR}"/config_local.py <<-EOF
+ SERVER_MODE = False
+ UPGRADE_CHECK_ENABLED = False
+ EOF
+ python_optimize "${D}${APP_DIR}"
+
+ local CONFIG_DIR="/etc/xdg/pgadmin"
+ dodir "${CONFIG_DIR}"
+ cat > "${D}${CONFIG_DIR}"/pgadmin4.conf <<-EOF
+ [General]
+ ApplicationPath=${APP_DIR}
+ PythonPath=$(python_get_sitedir)
+ EOF
+
+ if use doc; then
+ rm -r docs/en_US/_build/html/_sources || die
+ insinto /usr/share/${PN}/docs/en_US/_build
+ doins -r docs/en_US/_build/html
+ fi
+}
diff --git a/dev-db/pgagent/Manifest b/dev-db/pgagent/Manifest
new file mode 100644
index 000000000000..d19ae028cfd9
--- /dev/null
+++ b/dev-db/pgagent/Manifest
@@ -0,0 +1,14 @@
+AUX add-log-timestamps.patch 18087 SHA256 a08a31e823f19d61f9fb81727f2efc36f4e1e583e661b7803b88887eb4dbb9b7 SHA512 ce5d00aeda35bc4282ca65e8112be35e6f28cb70ff64316e47ab2247574ba71edbc99a1b4567df6a5a40bda1c8dbb5a1d65faa45054a7c63444c8591c9c059c5 WHIRLPOOL f9638ab74506b9dc60512d1666d1a5ca3546b8081ebd22e44b12ba01d6b94916f3a7b596f18d1e9cddea945b5cf4f8505f90527524fe1f9b7415f0902a97ae45
+AUX fix-dbconn-getlasterror-crash.patch 1242 SHA256 e370b94e8d63dfbae2374be54d3f4b520994b7028bb28135c63dc7b8edc7bccf SHA512 fa5553592878a6778d56306b515804ff60510c2327ea13d2f11f6b1259c13dc908237065bcc3e79a975128fa5e48e68135f1357e9c5053fb667e52c8d1a14dc0 WHIRLPOOL 9b0631c655c6c79b37f85045d514503fa778996dd158e6d7c53d972d9856d7f16ed003555ca8d08332bffbf51fc32d9a8dab3c0621c9d1ee8a8923ad99430078
+AUX fix-job-success-test.patch 1119 SHA256 f3173622cb74288c0ce9fe96fdde1ab4a1f0862ddd3ab136a1837df4190dd87d SHA512 67f8c882b548057095b6914e6462b4e87be02fedc9c281d4aa4a4f1b936d257b9b0c9e01cd06e5a5e065e5ee128dc0da9416a436e78ab956b7d68f117e0bd102 WHIRLPOOL 3af70469b28e72372e0976e2a14be148527b84dc325df15c3071c2de1bd879a5ec47fd5defcbd1b7789e5214e4c7f3f50502859e7626c93781f75fe8179f8d72
+AUX pgagent.confd 292 SHA256 3a916c0b7066a62c0ab47ec520015645c789c9097247f4877060c473aca2a4a5 SHA512 a7346ae4dc7231efb8c29d3b7a1d7d377a2b1dabe01b0be9b090e070bec927b29d8e8c20ce30d437cab2ab5c119af89dfcdc6f75fecaca7366b2c10c5e48ed11 WHIRLPOOL 4d4c6035754ab751bddc1ec50b0b563f9201f2e789025c2b469aacf0461c46e839a1aa6f7b51c8b0a86a8346ae854c96736601eb5aa540773dfb8ab9f1cacfd3
+AUX pgagent.initd 545 SHA256 bd5d3000f0fd6d99bb0fad150d32f1e2b5d732be0fdbb78c5ee7a086068170e4 SHA512 a35531dd4ed7d07215920f60b0c3f7651816f436353f3566682c1d2e85c595dffb61c1319b3f6367d29b69b961abd327f0c895b5398dece3c512a16acbe5c26a WHIRLPOOL 5355d48c684932b61552ac4b1d15384010119180efc3faf93e6c2257c25880afa727b272eb586dd6b4d812ee1203821b8dd878375568757c0c3414369cd60eae
+AUX pgagent.initd-r1 837 SHA256 0de733c1c041971f455d740c71962284cfece3545d4448ca405b4c89af5d7118 SHA512 ec6843ad55a7b2800c146ce7ee0551c5ede319d1fca1cfd700acd2245c6fcbaa36a87ad6cda04f33e124b479e6ca6b040cb57d0f78e40d335276e29c800f6627 WHIRLPOOL 0b3289560d52570fdeedcb69be4b2dfd91167f8602e29a85d283e20a8030f3eb74317b255a8396dbba13beaee29560045658089ffa1d63a2db9eebfaedd83f28
+AUX postgres-10-build-fix.patch 2421 SHA256 7887e667386276b798e3d95251d206b28b68889408bdddc605f1c98052b48e4c SHA512 52aaf0582d8132904d7b95fc523d597749f045f9d465401ed851ebfeeb0824d2c8668ba0525db5e15a3966b388215e885aaea5626e3102a765fb7f2a2ba0b349 WHIRLPOOL c0de7d3d1be898a05bea60fa75850500bb6ca05f5733967a0e4869b2d2c5219efe5d6cef523239c7f5d738771412afe19ea45f5e83d98172a80ef299d92555b3
+AUX save-stderr-jobstep-output.patch 2626 SHA256 7a87fd19924ba56bdc09bca1b04da193be5e44ffc4e7355867c78e7bbce7d4bd SHA512 b84b52e5a96d98067eab5e4877c54e02e3c912215067f4e1a1c9d3983a29acfd3e63fe666c6e62cf46391fb72cb02b4197d23e305cadf88da096f80d8e0c8167 WHIRLPOOL 483fbb046fff7e9fe6c981a6a8b376a30e6fadd9d7fbbdb9af26b430c71522bc425db63aa39e4406b162580c7243a3fe38497367f211e2b7e2fcb2f5cc7a94dc
+DIST pgAgent-3.4.0-Source.tar.gz 45081 SHA256 0da0ac8f453cf34ab6f708eee036bed0fd0e5fa311de283b92d2ff06600bbb3d SHA512 3b068fc6f5e51ff20604f8cec3e067d04b5b1537229da15ee442000f5fe834697a4eae86be0e9a58b8ee5da24cc985c8c9804d71cb2a50e93ec4cf9a424a4ff0 WHIRLPOOL df619ddbfd5c01cf9e17b22becf74742ea7caa783504fd5942d63992bc80913b36f1c85d7ce2d3dd31634b524617a943ed07a3eba675caddc7cd7f3fc79d8c1c
+EBUILD pgagent-3.4.0-r1.ebuild 1230 SHA256 933a43edb813649e5749d020bb009d97edbeccacf72854f783e35fceebbb1a91 SHA512 ebcf393c254a0110b85071a0ff09445b1638b94def4c6e5fcbe93719df82958537e6ebfc9dea46be1e4a3c0811853e1614d2980cb995bd8a37886ca4568e1f85 WHIRLPOOL b205d9442e8005948645187947247558e79b40756c3e57b8ef2f8bebe855aa12ade5e93838a3f5e7e772a5078af4b5ed714ae1cf05d985bbee72e3819fc2fb53
+EBUILD pgagent-3.4.0-r3.ebuild 2033 SHA256 1d0de10cbd4023b8137502e28df0328afa4047a26ce95575128d783469386164 SHA512 4e3968ce6f545a85085b8ffd326d4c87955e280ba5185eddbf87b42705c19427b4ab8ed8e1d4416e27dd0a60f00174cb301b25e3c8367eb02445a4c21ef73518 WHIRLPOOL 5a568d4a5e16b1589e9190289856b6c129d8cbb09b8a146a65322526a9c8a7197aed859e212073407bc8078f583f7777cbfbdc4a02de2b086b5408f90ad51fd3
+MISC ChangeLog 3643 SHA256 67629c68ea7e97fd5ab628c9c5e2618c703274f3cc5dece12a335df10a6abf51 SHA512 8015fd3d80f62510180ee23ae4154c4ebd3188564a4ea8924bad8411233e5a6033dfe0c93e9cc89e15f0fafd99849dde4875cf1ff1682f0246b36eb14b816be6 WHIRLPOOL 576f430c79d74b831bad9b9d56e2c6fe4ae85162900c5c0e4dd6af258ecce4c8d916d78c0284dda1da73f41939cff282ff95823b13945fc9527a5459efca6e6b
+MISC ChangeLog-2015 1605 SHA256 c57b5601767ff35dc540e148bc4a5bb33b4237fd80c5ca22886da4b683120e55 SHA512 25c8294d435bb3f517a6403ce8a2fd0bb0f67f9aec0eeb3948d506e92e6fecd0e1a2d37c2a8716d7e6445206febd0416f19121bf61371bbb25c34a7ba6a7486b WHIRLPOOL f40f3e94882123f713676c5e4ff56be6235542b717ac93fa01e459b4032082004b3e73783e8fef2e5a3f52014b099f53cc449725d308e697bbe49acacd158fe1
+MISC metadata.xml 298 SHA256 9f51466b5b46a12996e91f294520ed3dd90eeef32edb1989121d553a4ac3d1dc SHA512 167896d1d92ccb4b171cce16d63405369a9e28b0d01c12b2ed94fcec1f982892e179c007287fc3386e1c00393d6570a2ae9e8efe9420e53a82308426075d5c89 WHIRLPOOL 870c5ed93a2a9aacc7763ce60e5d4eb9da14369c8f01818edd9a0166767909de7ec942349a1ebdb3e0c124cb3982dff300c18a5d730f09045b10b3fea0940cd9
diff --git a/dev-db/pgagent/files/add-log-timestamps.patch b/dev-db/pgagent/files/add-log-timestamps.patch
new file mode 100644
index 000000000000..8d9eb4a3e8e2
--- /dev/null
+++ b/dev-db/pgagent/files/add-log-timestamps.patch
@@ -0,0 +1,535 @@
+From 2eef6cc4928c611cecdca3c1daecb60568deca4e Mon Sep 17 00:00:00 2001
+From: Sanket Mehta <sanket.mehta@enterprisedb.com>
+Date: Fri, 17 Jul 2015 09:07:09 +0100
+Subject: [PATCH] Add log timestamps and a --version option per Josh Berkus.
+ Update copyright notices while passing.
+
+---
+ CMakeLists.txt | 8 ++++----
+ LICENSE | 2 +-
+ cmake/MakeExt.cmake | 2 +-
+ connection.cpp | 2 +-
+ include/connection.h | 2 +-
+ include/job.h | 2 +-
+ include/misc.h | 3 ++-
+ include/pgAgent.h | 2 +-
+ job.cpp | 2 +-
+ misc.cpp | 14 +++++++++++++-
+ pgAgent.cpp | 2 +-
+ pgAgent.rc | 14 +++++++-------
+ pgaevent/CMakeLists.txt | 2 +-
+ pgaevent/pgaevent.c | 2 +-
+ pgaevent/pgaevent.def | 2 +-
+ pgaevent/pgamsgevent.h | 2 +-
+ pgaevent/pgamsgevent.rc | 14 +++++++-------
+ precomp.cpp | 2 +-
+ sql/pgagent--unpackaged--3.4.sql | 2 +-
+ sql/pgagent.sql | 2 +-
+ sql/pgagent_upgrade.sql | 2 +-
+ unix.cpp | 16 +++++++++++-----
+ win32.cpp | 5 ++++-
+ 23 files changed, 64 insertions(+), 42 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ab02fea..c8bfa4a 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ #######################################################################
+ #
+ # pgAgent - PostgreSQL tools
+-# Copyright (C) 2002 - 2014, The pgAdmin Development Team
++# Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ # This software is released under the PostgreSQL Licence
+ #
+ # CMakeLists.txt - CMake build configuration
+@@ -27,7 +27,6 @@ SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+
+ SET(STATIC_BUILD YES CACHE BOOL "Statically link the executable?")
+-
+ ################################################################################
+ # Apple stuff
+ ################################################################################
+@@ -61,12 +60,12 @@ PROJECT(pgagent)
+ # in pgagent.sql and upgrade_pgagent.sql if the major version number is
+ # changed. The full version number also needs to be included in pgAgent.rc and
+ # pgaevent/pgamsgevent.rc at present.
+-SET(VERSION 3.4.0)
++SET(VERSION "3.4.1")
+
+ # CPack stuff
+ SET(CPACK_PACKAGE_VERSION_MAJOR 3)
+ SET(CPACK_PACKAGE_VERSION_MINOR 4)
+-SET(CPACK_PACKAGE_VERSION_PATCH 0)
++SET(CPACK_PACKAGE_VERSION_PATCH 1)
+ SET(CPACK_PACKAGE_NAME "pgAgent")
+ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "pgAgent is a job scheduling engine for PostgreSQL")
+ SET(CPACK_PACKAGE_VENDOR "the pgAdmin Development Team")
+@@ -79,6 +78,7 @@ SET(CPACK_SOURCE_GENERATOR TGZ)
+ SET(CPACK_SOURCE_IGNORE_FILES "\\\\.DS_Store;/CVS/;/\\\\.svn/;\\\\.swp$;\\\\.#;/#;.*~;cscope.*")
+
+ ADD_DEFINITIONS(-DPGAGENT_VERSION_MAJOR=${CPACK_PACKAGE_VERSION_MAJOR})
++ADD_DEFINITIONS(-DPGAGENT_VERSION="${VERSION}")
+
+ # This must come after we set the CPACK variables!!
+ INCLUDE(CPack)
+diff --git a/LICENSE b/LICENSE
+index 3b2638a..c460d6f 100644
+--- a/LICENSE
++++ b/LICENSE
+@@ -1,6 +1,6 @@
+ pgAgent
+
+-Copyright (c) 2002 - 2014, The pgAdmin Development Team
++Copyright (c) 2002 - 2015, The pgAdmin Development Team
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose, without fee, and without a written agreement is
+diff --git a/cmake/MakeExt.cmake b/cmake/MakeExt.cmake
+index 5777c97..ae30e30 100644
+--- a/cmake/MakeExt.cmake
++++ b/cmake/MakeExt.cmake
+@@ -1,7 +1,7 @@
+ #######################################################################
+ #
+ # pgAgent - PostgreSQL tools
+-# Copyright (C) 2002 - 2014, The pgAdmin Development Team
++# Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ # This software is released under the PostgreSQL Licence
+ #
+ # MakeExt,cmake - Create the PG Extension
+diff --git a/connection.cpp b/connection.cpp
+index f2213bd..25432bb 100644
+--- a/connection.cpp
++++ b/connection.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // connection.cpp - database connection
+diff --git a/include/connection.h b/include/connection.h
+index a201450..064067c 100644
+--- a/include/connection.h
++++ b/include/connection.h
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // connection.h - database connection
+diff --git a/include/job.h b/include/job.h
+index e511852..abc33d4 100644
+--- a/include/job.h
++++ b/include/job.h
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // job.h - agent job
+diff --git a/include/misc.h b/include/misc.h
+index 14b4edc..59847d1 100644
+--- a/include/misc.h
++++ b/include/misc.h
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // misc.h - misc functions
+@@ -18,6 +18,7 @@ void WaitAWhile(const bool waitLong = false);
+ void setOptions(int argc, char **argv, const wxString &executable);
+ wxString getArg(int &argc, char **&argv);
+ wxString NumToStr(const long l);
++void printVersion();
+
+ #endif // MISC_H
+
+diff --git a/include/pgAgent.h b/include/pgAgent.h
+index 6ef4944..059e0ca 100644
+--- a/include/pgAgent.h
++++ b/include/pgAgent.h
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgAgent.h - main include
+diff --git a/job.cpp b/job.cpp
+index c4b39ce..f3eaa03 100644
+--- a/job.cpp
++++ b/job.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014 The pgAdmin Development Team
++// Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // job.cpp - pgAgent job
+diff --git a/misc.cpp b/misc.cpp
+index dfd56a0..2252d83 100644
+--- a/misc.cpp
++++ b/misc.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014 The pgAdmin Development Team
++// Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // misc.cpp - misc functions
+@@ -16,6 +16,8 @@
+ #include <unistd.h>
+ #endif
+
++#define APPVERSION_STR wxT(PGAGENT_VERSION)
++
+ // In unix.c or win32.c
+ void usage(const wxString &executable);
+
+@@ -42,6 +44,11 @@ wxString getArg(int &argc, char **&argv)
+ return s;
+ }
+
++void printVersion()
++{
++ wxPrintf(_("PostgreSQL Scheduling Agent\n"));
++ wxPrintf(_("Version: %s\n"), APPVERSION_STR);
++}
+
+ void setOptions(int argc, char **argv, const wxString &executable)
+ {
+@@ -72,6 +79,11 @@ void setOptions(int argc, char **argv, const wxString &executable)
+ minLogLevel = val;
+ break;
+ }
++ case 'v':
++ {
++ printVersion();
++ exit (0);
++ }
+ #ifndef __WXMSW__
+ case 'f':
+ {
+diff --git a/pgAgent.cpp b/pgAgent.cpp
+index 5ed43fb..9238fa1 100644
+--- a/pgAgent.cpp
++++ b/pgAgent.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgAgent.cpp - pgAgent main entry
+diff --git a/pgAgent.rc b/pgAgent.rc
+index 3c51bfa..c4169e1 100644
+--- a/pgAgent.rc
++++ b/pgAgent.rc
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgAgent.rc - win32 Resources
+@@ -16,8 +16,8 @@ aaaPGAGENT ICON DISCARDABLE "include/pgAgent.ico"
+
+
+ VS_VERSION_INFO VERSIONINFO
+-FILEVERSION 3,4,0,0
+-PRODUCTVERSION 3,4,0,0
++FILEVERSION 3,4,1,0
++PRODUCTVERSION 3,4,1,0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ BEGIN
+@@ -25,15 +25,15 @@ BEGIN
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+- VALUE "FileVersion", "3.4.0", "\0"
+- VALUE "File Version", "3.4.0", "\0"
++ VALUE "FileVersion", "3.4.1", "\0"
++ VALUE "File Version", "3.4.1", "\0"
+ VALUE "FileDescription", "pgAgent - PostgreSQL Scheduling Agent", "\0"
+- VALUE "LegalCopyright", "\251 2002 - 2012, The pgAdmin Development Team", "\0"
++ VALUE "LegalCopyright", "\251 2002 - 2015, The pgAdmin Development Team", "\0"
+ VALUE "LegalTrademarks", "This software is released under the PostgreSQL Licence.", "\0"
+ VALUE "InternalName", "pgAgent", "\0"
+ VALUE "OriginalFilename","pgagent.exe", "\0"
+ VALUE "ProductName", "pgAgent", "\0"
+- VALUE "ProductVersion", "3.4.0", "\0"
++ VALUE "ProductVersion", "3.4.1", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+diff --git a/pgaevent/CMakeLists.txt b/pgaevent/CMakeLists.txt
+index 10478c3..2fd6192 100644
+--- a/pgaevent/CMakeLists.txt
++++ b/pgaevent/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ #######################################################################
+ #
+ # pgAgent - PostgreSQL tools
+-# Copyright (C) 2002 - 2014, The pgAdmin Development Team
++# Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ # This software is released under the PostgreSQL Licence
+ #
+ # pgaevent/CMakeLists.txt - CMake build configuration
+diff --git a/pgaevent/pgaevent.c b/pgaevent/pgaevent.c
+index a66ed42..c9fac75 100644
+--- a/pgaevent/pgaevent.c
++++ b/pgaevent/pgaevent.c
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgaevent.c - win32 message format dll
+diff --git a/pgaevent/pgaevent.def b/pgaevent/pgaevent.def
+index c9e222d..34e03c1 100644
+--- a/pgaevent/pgaevent.def
++++ b/pgaevent/pgaevent.def
+@@ -2,7 +2,7 @@
+ ; //
+ ; // pgAgent - PostgreSQL Tools
+ ; //
+-; // Copyright (C) 2002 - 2014 The pgAdmin Development Team
++; // Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ ; // This software is released under the PostgreSQL Licence
+ ; //
+ ; // pgaeventdef - pgaevent.dll exports
+diff --git a/pgaevent/pgamsgevent.h b/pgaevent/pgamsgevent.h
+index b8e11a5..f589d60 100644
+--- a/pgaevent/pgamsgevent.h
++++ b/pgaevent/pgamsgevent.h
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgamsgevent.h - Message id declarations
+diff --git a/pgaevent/pgamsgevent.rc b/pgaevent/pgamsgevent.rc
+index 79e77aa..510ab65 100644
+--- a/pgaevent/pgamsgevent.rc
++++ b/pgaevent/pgamsgevent.rc
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgaevent.rc - win32 Resources
+@@ -19,8 +19,8 @@ aaaPGAEVENT ICON DISCARDABLE "../include/pgagent.ico"
+
+
+ VS_VERSION_INFO VERSIONINFO
+-FILEVERSION 3,4,0,0
+-PRODUCTVERSION 3,4,0,0
++FILEVERSION 3,4,1,0
++PRODUCTVERSION 3,4,1,0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ BEGIN
+@@ -28,15 +28,15 @@ BEGIN
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+- VALUE "FileVersion", "3.4.0", "\0"
+- VALUE "File Version", "3.4.0", "\0"
++ VALUE "FileVersion", "3.4.1", "\0"
++ VALUE "File Version", "3.4.1", "\0"
+ VALUE "FileDescription", "pgaevent - pgAgent Event Log Message DLL", "\0"
+- VALUE "LegalCopyright", "\251 2002 - 2014, The pgAdmin Development Team", "\0"
++ VALUE "LegalCopyright", "\251 2002 - 2015, The pgAdmin Development Team", "\0"
+ VALUE "LegalTrademarks", "This software is released under the PostgreSQL Licence.", "\0"
+ VALUE "InternalName", "pgaevent", "\0"
+ VALUE "OriginalFilename","pgaevent.dll", "\0"
+ VALUE "ProductName", "pgAgent", "\0"
+- VALUE "ProductVersion", "3.4.0", "\0"
++ VALUE "ProductVersion", "3.4.1", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+diff --git a/precomp.cpp b/precomp.cpp
+index 02c969f..56766bb 100644
+--- a/precomp.cpp
++++ b/precomp.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // precomp.cpp - pgAgent precompiled headers
+diff --git a/sql/pgagent--unpackaged--3.4.sql b/sql/pgagent--unpackaged--3.4.sql
+index 536640e..f5ffc63 100644
+--- a/sql/pgagent--unpackaged--3.4.sql
++++ b/sql/pgagent--unpackaged--3.4.sql
+@@ -1,7 +1,7 @@
+ /*
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014 The pgAdmin Development Team
++// Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgagent--unpackaged--3.4.sql - Convert pgAgent existing tables and functions to an extension
+diff --git a/sql/pgagent.sql b/sql/pgagent.sql
+index 3708adf..1118833 100644
+--- a/sql/pgagent.sql
++++ b/sql/pgagent.sql
+@@ -1,7 +1,7 @@
+ /*
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014 The pgAdmin Development Team
++// Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgagent.sql - pgAgent tables and functions
+diff --git a/sql/pgagent_upgrade.sql b/sql/pgagent_upgrade.sql
+index ae0d995..c256c93 100644
+--- a/sql/pgagent_upgrade.sql
++++ b/sql/pgagent_upgrade.sql
+@@ -1,7 +1,7 @@
+ /*
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014 The pgAdmin Development Team
++// Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // pgagent_upgrade.sql - Upgrade pgAgent tables and functions
+diff --git a/unix.cpp b/unix.cpp
+index 34ad0f6..e206408 100644
+--- a/unix.cpp
++++ b/unix.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014, The pgAdmin Development Team
++// Copyright (C) 2002 - 2015, The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // unix.cpp - pgAgent unix specific functions
+@@ -17,14 +17,17 @@
+ #include <wx/filename.h>
+ #include <wx/ffile.h>
+ #include <fcntl.h>
++void printVersion();
+
+ void usage(const wxString &executable)
+ {
+ wxFileName *fn = new wxFileName(executable);
++ printVersion();
+
+ wxPrintf(_("Usage:\n"));
+ wxPrintf(fn->GetName() + _(" [options] <connect-string>\n"));
+ wxPrintf(_("options:\n"));
++ wxPrintf(_("-v (display version info and then exit)\n"));
+ wxPrintf(_("-f run in the foreground (do not detach from the terminal)\n"));
+ wxPrintf(_("-t <poll time interval in seconds (default 10)>\n"));
+ wxPrintf(_("-r <retry period after connection abort in seconds (>=10, default 30)>\n"));
+@@ -50,22 +53,25 @@ void LogMessage(wxString msg, int level)
+ return;
+ }
+
++ wxDateTime logTime = wxDateTime::Now();
++ wxString logTimeString = logTime.Format() + wxT(" : ");
++
+ switch (level)
+ {
+ case LOG_DEBUG:
+ if (minLogLevel >= LOG_DEBUG)
+- file.Write(_("DEBUG: ") + msg + wxT("\n"));
++ file.Write(logTimeString + _("DEBUG: ") + msg + wxT("\n"));
+ break;
+ case LOG_WARNING:
+ if (minLogLevel >= LOG_WARNING)
+- file.Write(_("WARNING: ") + msg + wxT("\n"));
++ file.Write(logTimeString + _("WARNING: ") + msg + wxT("\n"));
+ break;
+ case LOG_ERROR:
+- file.Write(_("ERROR: ") + msg + wxT("\n"));
++ file.Write(logTimeString + _("ERROR: ") + msg + wxT("\n"));
+ exit(1);
+ break;
+ case LOG_STARTUP:
+- file.Write(_("WARNING: ") + msg + wxT("\n"));
++ file.Write(logTimeString + _("WARNING: ") + msg + wxT("\n"));
+ break;
+ }
+
+diff --git a/win32.cpp b/win32.cpp
+index aa5d5d7..624ae77 100644
+--- a/win32.cpp
++++ b/win32.cpp
+@@ -2,7 +2,7 @@
+ //
+ // pgAgent - PostgreSQL Tools
+ //
+-// Copyright (C) 2002 - 2014 The pgAdmin Development Team
++// Copyright (C) 2002 - 2015 The pgAdmin Development Team
+ // This software is released under the PostgreSQL Licence
+ //
+ // win32.cpp - pgAgent win32 specific functions
+@@ -36,6 +36,7 @@ static HANDLE serviceSync;
+ static HANDLE eventHandle;
+
+ bool stopService();
++void printVersion();
+
+ // This will be called from MainLoop, if pgagent is initialized properly
+ void Initialized()
+@@ -435,12 +436,14 @@ bool removeService(const wxString &serviceName)
+ void usage(const wxString &executable)
+ {
+ wxFileName *fn = new wxFileName(executable);
++ printVersion();
+
+ wxPrintf(_("Usage:\n"));
+ wxPrintf(fn->GetName() + _(" REMOVE <serviceName>\n"));
+ wxPrintf(fn->GetName() + _(" INSTALL <serviceName> [options] <connect-string>\n"));
+ wxPrintf(fn->GetName() + _(" DEBUG [options] <connect-string>\n"));
+ wxPrintf(_("options:\n"));
++ wxPrintf(_("-v (display version info and then exit)\n"));
+ wxPrintf(_("-u <user or DOMAIN\\user>\n"));
+ wxPrintf(_("-p <password>\n"));
+ wxPrintf(_("-d <displayname>\n"));
diff --git a/dev-db/pgagent/files/fix-dbconn-getlasterror-crash.patch b/dev-db/pgagent/files/fix-dbconn-getlasterror-crash.patch
new file mode 100644
index 000000000000..633a359b6765
--- /dev/null
+++ b/dev-db/pgagent/files/fix-dbconn-getlasterror-crash.patch
@@ -0,0 +1,32 @@
+From f9bf1ccb27ebcfce00e7a6d467bc0e1b5ee9555e Mon Sep 17 00:00:00 2001
+From: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
+Date: Wed, 1 Apr 2015 15:24:11 +0530
+Subject: [PATCH] Fixed a bug in DBconn::GetLastError() function.
+
+pgAgent was crashing, while removing the trailing new-lines from the
+empty error message string (Reported by: Thomas Krennwallner)
+---
+ connection.cpp | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/connection.cpp b/connection.cpp
+index b7623e6..f2213bd 100644
+--- a/connection.cpp
++++ b/connection.cpp
+@@ -313,15 +313,7 @@ int DBconn::ExecuteVoid(const wxString &query)
+
+ wxString DBconn::GetLastError()
+ {
+- // Return the last error message, minus any trailing line ends
+- if (lastError.substr(lastError.length() - 2, 2) == wxT("\r\n")) // DOS
+- return lastError.substr(0, lastError.length() - 2);
+- else if (lastError.substr(lastError.length() - 1, 1) == wxT("\n")) // Unix
+- return lastError.substr(0, lastError.length() - 1);
+- else if (lastError.substr(lastError.length() - 1, 1) == wxT("\r")) // Mac
+- return lastError.substr(0, lastError.length() - 1);
+- else
+- return lastError;
++ return lastError.Trim(true);
+ }
+
+ ///////////////////////////////////////////////////////7
diff --git a/dev-db/pgagent/files/fix-job-success-test.patch b/dev-db/pgagent/files/fix-job-success-test.patch
new file mode 100644
index 000000000000..cd5495a52aa9
--- /dev/null
+++ b/dev-db/pgagent/files/fix-job-success-test.patch
@@ -0,0 +1,30 @@
+From 01b72d867cc2bdbaff1765499a6395f7bc94e2be Mon Sep 17 00:00:00 2001
+From: Sanket Mehta <sanket.mehta@enterprisedb.com>
+Date: Tue, 1 Dec 2015 11:34:32 +0530
+Subject: [PATCH] Set 'succeeded' flag to true/false by checking for the step
+ failure everytime (it gets executed).
+
+These was an issue with the current implementation.
+
+Once the 'succeeded' flag is set to true, the following batch step
+execution does not stop executiong of following steps on failure, even
+we have set 'onerror' to 'f' for that step.
+---
+ job.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/job.cpp b/job.cpp
+index f3eaa03..9864f57 100644
+--- a/job.cpp
++++ b/job.cpp
+@@ -307,9 +307,7 @@ int Job::Execute()
+
+ // set success status for batch runs, be pessimistic by default
+ LogMessage(wxString::Format(_("Script return code: %d"), rc), LOG_DEBUG);
+- if (rc == 0)
+- succeeded = true;
+-
++ succeeded = ((rc == 0) ? true : false);
+ // If output is empty then either script did not return any output
+ // or script threw some error into stderr.
+ // Check script threw some error into stderr
diff --git a/dev-db/pgagent/files/pgagent.confd b/dev-db/pgagent/files/pgagent.confd
new file mode 100644
index 000000000000..0b2c7d788dd2
--- /dev/null
+++ b/dev-db/pgagent/files/pgagent.confd
@@ -0,0 +1,22 @@
+# Pool time interval
+PGA_POLL="10"
+
+# Retry period
+PGA_RETRY="30"
+
+# Log file
+PGA_LOG="/var/log/pgagent.log"
+
+# Logging verbosity
+# ERROR=0, WARNING=1, DEBUG=2
+PGA_LEVEL="1"
+
+# Server parameters
+# Host address
+PG_HOST="localhost"
+
+# DB name
+PG_DBNAME="postgres"
+
+# Username
+PG_USER="postgres" \ No newline at end of file
diff --git a/dev-db/pgagent/files/pgagent.initd b/dev-db/pgagent/files/pgagent.initd
new file mode 100644
index 000000000000..a43916888bbb
--- /dev/null
+++ b/dev-db/pgagent/files/pgagent.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PGAGENTOPT="-t ${PGA_POLL} -r ${PGA_RETRY} -s ${PGA_LOG} -l ${PGA_LEVEL}"
+
+PGOPT="hostaddr=${PG_HOST} dbname=${PG_DBNAME} user=${PG_USER}"
+
+depend() {
+ use net
+ need postgresql
+}
+
+start() {
+ ebegin "Starting pgagent"
+ start-stop-daemon --start --exec /usr/bin/pgagent -- ${PGAGENTOPT} ${PGOPT}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping pgagent"
+ start-stop-daemon --stop --name pgagent
+ eend $?
+}
diff --git a/dev-db/pgagent/files/pgagent.initd-r1 b/dev-db/pgagent/files/pgagent.initd-r1
new file mode 100644
index 000000000000..a555006d3bd2
--- /dev/null
+++ b/dev-db/pgagent/files/pgagent.initd-r1
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/pgagent"
+command_user="pgagent"
+
+# If pgagent daemonizes itself, it won't write a PID file and
+# we have to work a little harder to stop() it. So let it run
+# in the foreground, and have OpenRC manage its PID file.
+command_args="-f
+ -t ${PGA_POLL}
+ -r ${PGA_RETRY}
+ -s ${PGA_LOG}
+ -l ${PGA_LEVEL}
+ hostaddr=${PG_HOST}
+ dbname=${PG_DBNAME}
+ user=${PG_USER}"
+
+command_background="true"
+pidfile="/run/pgagent.pid"
+
+depend() {
+ use net
+ need postgresql
+}
+
+start_pre() {
+ # The log file needs to be writable by the daemon user.
+ checkpath --file --owner root:pgagent --mode 0660 "${PGA_LOG}"
+}
diff --git a/dev-db/pgagent/files/postgres-10-build-fix.patch b/dev-db/pgagent/files/postgres-10-build-fix.patch
new file mode 100644
index 000000000000..e2ecb0aa60b7
--- /dev/null
+++ b/dev-db/pgagent/files/postgres-10-build-fix.patch
@@ -0,0 +1,52 @@
+From a7b82fb3d3bd3de3ce624d9e4b0da53cb9835c2d Mon Sep 17 00:00:00 2001
+From: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
+Date: Mon, 31 Jul 2017 14:57:55 +0530
+Subject: [PATCH] Added support two digits version for PostgreSQL/EDB Postgres
+ Advanced Server >= 10
+
+---
+ CMakeLists.txt | 6 +++++-
+ cmake/FindPG.cmake | 6 +++---
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8214650..29755b4 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -176,7 +176,11 @@ MESSAGE(STATUS " Description : ${CPACK_PACKAGE_DESCRIPTION_SUMM
+ MESSAGE(STATUS " Version : ${VERSION}")
+ MESSAGE(STATUS " ")
+ MESSAGE(STATUS " PostgreSQL version string : ${PG_VERSION_STRING}")
+-MESSAGE(STATUS " PostgreSQL version parts : ${PG_MAJOR_VERSION}.${PG_MINOR_VERSION}.${PG_PATCH_VERSION}")
++IF(${PG_MAJOR_VERSION} GREATER 9)
++ MESSAGE(STATUS " PostgreSQL version parts : ${PG_MAJOR_VERSION}")
++ELSE()
++ MESSAGE(STATUS " PostgreSQL version parts : ${PG_MAJOR_VERSION}.${PG_MINOR_VERSION}")
++ENDIF(${PG_MAJOR_VERSION} GREATER 10)
+ MESSAGE(STATUS " PostgreSQL path : ${PG_ROOT_DIR}")
+ MESSAGE(STATUS " PostgreSQL config binary : ${PG_CONFIG_PATH}")
+ MESSAGE(STATUS " PostgreSQL include path : ${PG_INCLUDE_DIRS}")
+diff --git a/cmake/FindPG.cmake b/cmake/FindPG.cmake
+index 349086c..9768771 100644
+--- a/cmake/FindPG.cmake
++++ b/cmake/FindPG.cmake
+@@ -28,7 +28,6 @@
+ # PG_VERSION_STRING - The PostgreSQL version number.
+ # PG_MAJOR_VERSION - The PostgreSQL major version (x in x.y.z).
+ # PG_MINOR_VERSION - The PostgreSQL minor version (y in x.y.z).
+-# PG_PATCH_VERSION - The PostgreSQL patch version (z in x.y.z).
+ # PG_EXTENSION - Set to TRUE if PostgreSQL supports extensions.
+
+ IF(NOT PG_STATIC OR PG_STATIC STREQUAL "")
+@@ -70,8 +69,9 @@ IF(NOT _retval)
+ # Split the version into its component parts.
+ STRING(REGEX MATCHALL "[0-9]+" PG_VERSION_PARTS "${PG_VERSION_STRING}")
+ LIST(GET PG_VERSION_PARTS 0 PG_MAJOR_VERSION)
+- LIST(GET PG_VERSION_PARTS 1 PG_MINOR_VERSION)
+- LIST(GET PG_VERSION_PARTS 2 PG_PATCH_VERSION)
++ IF((PG_MAJOR_VERSION LESS 10))
++ LIST(GET PG_VERSION_PARTS 1 PG_MINOR_VERSION)
++ ENDIF((PG_MAJOR_VERSION LESS 10))
+
+ # Are extensions supported?
+ IF((PG_MAJOR_VERSION GREATER 9) OR ((PG_MAJOR_VERSION EQUAL 9) AND (PG_MINOR_VERSION GREATER 0)))
diff --git a/dev-db/pgagent/files/save-stderr-jobstep-output.patch b/dev-db/pgagent/files/save-stderr-jobstep-output.patch
new file mode 100644
index 000000000000..245dbe2764ea
--- /dev/null
+++ b/dev-db/pgagent/files/save-stderr-jobstep-output.patch
@@ -0,0 +1,79 @@
+From 5d2e0d3500a8e144215cdfe10b52cf7415b58046 Mon Sep 17 00:00:00 2001
+From: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
+Date: Mon, 25 May 2015 12:37:42 +0530
+Subject: [PATCH] Save the standarad error too along with the standard output
+ in the jobstep output for the batch jobs.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[Worked on by: Mehmet Emin KARAKAŞ, Akshay Joshi]
+[Reviewed and improvised by: Sanket Joshi, Ashesh Vashi]
+---
+ job.cpp | 37 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/job.cpp b/job.cpp
+index 00334ab..c4b39ce 100644
+--- a/job.cpp
++++ b/job.cpp
+@@ -186,8 +186,10 @@ int Job::Execute()
+
+ #ifdef __WIN32__
+ wxString filename = dirname + wxT("\\") + jobid + wxT("_") + stepid + wxT(".bat");
++ wxString errorFile = dirname + wxT("\\") + jobid + wxT("_") + stepid + wxT("_error.txt");
+ #else
+ wxString filename = dirname + wxT("/") + jobid + wxT("_") + stepid + wxT(".scr");
++ wxString errorFile = dirname + wxT("/") + jobid + wxT("_") + stepid + wxT("_error.txt");
+ #endif
+
+ // Write the script
+@@ -233,6 +235,10 @@ int Job::Execute()
+ file->Close();
+ LogMessage(wxString::Format(_("Executing script file: %s"), filename.c_str()), LOG_DEBUG);
+
++ // freopen function is used to redirect output of stream (stderr in our case)
++ // into the specified file.
++ FILE *fpError = freopen(errorFile.mb_str(), "w", stderr);
++
+ // Execute the file and capture the output
+ #ifdef __WIN32__
+ // The Windows way
+@@ -304,6 +310,37 @@ int Job::Execute()
+ if (rc == 0)
+ succeeded = true;
+
++ // If output is empty then either script did not return any output
++ // or script threw some error into stderr.
++ // Check script threw some error into stderr
++ if (fpError)
++ {
++ //fclose(fpError);
++ FILE* fpErr = fopen(errorFile.mb_str(), "r");
++ if (fpErr)
++ {
++ char buffer[4098];
++ wxString errorMsg = wxEmptyString;
++ while (!feof(fpErr))
++ {
++ if (fgets(buffer, 4096, fpErr) != NULL)
++ errorMsg += wxString(buffer, wxConvLibc);
++ }
++
++ if (errorMsg != wxEmptyString) {
++ wxString errmsg =
++ wxString::Format(
++ _("Script Error: \n%s\n"),
++ errorMsg.c_str());
++ LogMessage(errmsg, LOG_WARNING);
++ output += wxT("\n") + errmsg;
++ }
++
++ fclose(fpErr);
++ }
++ wxRemoveFile(errorFile);
++ }
++
+ // Delete the file/directory. If we fail, don't overwrite the script output in the log, just throw warnings.
+ if (!wxRemoveFile(filename))
+ {
diff --git a/dev-db/pgagent/metadata.xml b/dev-db/pgagent/metadata.xml
new file mode 100644
index 000000000000..eb41154c968f
--- /dev/null
+++ b/dev-db/pgagent/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/pgagent/pgagent-3.4.0-r1.ebuild b/dev-db/pgagent/pgagent-3.4.0-r1.ebuild
new file mode 100644
index 000000000000..318a56619a09
--- /dev/null
+++ b/dev-db/pgagent/pgagent-3.4.0-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+CMAKE_IN_SOURCE_BUILD=1
+WX_GTK_VER="3.0"
+
+inherit cmake-utils eutils wxwidgets
+
+MY_PN=${PN/a/A}
+
+KEYWORDS="amd64 x86"
+
+DESCRIPTION="${MY_PN} is a job scheduler for PostgreSQL"
+HOMEPAGE="http://www.pgadmin.org/download/pgagent.php"
+SRC_URI="mirror://postgresql/pgadmin3/release/${PN}/${MY_PN}-${PV}-Source.tar.gz"
+LICENSE="POSTGRESQL GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-db/postgresql-9.0.0:*
+ x11-libs/wxGTK:${WX_GTK_VER}
+"
+DEPEND="${RDEPEND}
+ >=dev-util/cmake-2.6
+"
+
+S="${WORKDIR}/${MY_PN}-${PV}-Source"
+
+src_prepare() {
+ sed -e "s:share):share/${P}):" \
+ -i CMakeLists.txt || die "Couldn't patch CMakeLists.txt"
+ sed -i -e '/SET(WX_VERSION "2.8")/d' CMakeLists.txt || die
+}
+
+src_configure() {
+ if has_version "x11-libs/wxGTK[X]"; then
+ need-wxwidgets unicode
+ else
+ need-wxwidgets base-unicode
+ fi
+ mycmakeargs="-DSTATIC_BUILD:BOOLEAN=FALSE -DWX_VERSION=${WX_GTK_VER}"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newinitd "${FILESDIR}/pgagent.initd" ${PN}
+ newconfd "${FILESDIR}/pgagent.confd" ${PN}
+
+ rm "${ED}"/usr/{LICENSE,README} || die "Failed to remove useless docs"
+}
diff --git a/dev-db/pgagent/pgagent-3.4.0-r3.ebuild b/dev-db/pgagent/pgagent-3.4.0-r3.ebuild
new file mode 100644
index 000000000000..3426a5d6bec8
--- /dev/null
+++ b/dev-db/pgagent/pgagent-3.4.0-r3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+CMAKE_IN_SOURCE_BUILD=1
+WX_GTK_VER="3.0"
+
+inherit cmake-utils user wxwidgets
+
+MY_PN=${PN/a/A}
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="${MY_PN} is a job scheduler for PostgreSQL"
+HOMEPAGE="http://www.pgadmin.org/download/pgagent.php"
+SRC_URI="mirror://postgresql/pgadmin3/release/${PN}/${MY_PN}-${PV}-Source.tar.gz"
+LICENSE="POSTGRESQL GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-db/postgresql:*
+ x11-libs/wxGTK:${WX_GTK_VER}"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_PN}-${PV}-Source"
+
+PATCHES=(
+ "${FILESDIR}/fix-dbconn-getlasterror-crash.patch"
+ "${FILESDIR}/save-stderr-jobstep-output.patch"
+ "${FILESDIR}/add-log-timestamps.patch"
+ "${FILESDIR}/fix-job-success-test.patch"
+ "${FILESDIR}/postgres-10-build-fix.patch"
+)
+
+src_prepare() {
+ default
+ sed -e "s:share):share/${P}):" \
+ -i CMakeLists.txt || die "failed to patch CMakeLists.txt"
+ sed -i -e '/SET(WX_VERSION "2.8")/d' CMakeLists.txt || die
+}
+
+src_configure() {
+ if has_version "x11-libs/wxGTK[X]"; then
+ need-wxwidgets unicode
+ else
+ need-wxwidgets base-unicode
+ fi
+ mycmakeargs=( "-DSTATIC_BUILD:BOOLEAN=FALSE"
+ "-DWX_VERSION=${WX_GTK_VER}" )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newinitd "${FILESDIR}/pgagent.initd-r1" "${PN}"
+ newconfd "${FILESDIR}/pgagent.confd" "${PN}"
+
+ rm "${ED}"/usr/{LICENSE,README} || die "failed to remove useless docs"
+}
+
+pkg_preinst() {
+ # This user needs a real shell, and the daemon will use the
+ # ~/.pgpass file from its home directory.
+ enewuser pgagent -1 /bin/bash /home/pgagent
+}
+
+pkg_postinst() {
+ if [[ -n "${REPLACING_VERSIONS}" ]]; then
+ # This warning can be removed around a year after this version
+ # goes stable.
+ ewarn 'pgAgent now runs as a dedicated "pgagent" user (as'
+ ewarn 'opposed to root). You may need to move your /root/.pgpass'
+ ewarn 'file to /home/pgagent/.pgpass, and the new user will'
+ ewarn 'need permissions on any paths that it will access.'
+ fi
+}
diff --git a/dev-db/pgbadger/Manifest b/dev-db/pgbadger/Manifest
new file mode 100644
index 000000000000..bee18e9be0c7
--- /dev/null
+++ b/dev-db/pgbadger/Manifest
@@ -0,0 +1,5 @@
+DIST pgbadger-9.1.tar.gz 742409 SHA256 2fd7166d74692cc7d87f00b37cc5c7c1c6eddf156372376d382a40f67d694011 SHA512 e3841516dd56ea0aeae397c8264302881df3b07a86063f7813f593ba817a4f3417559b88e2b9e23fec811d3dfd716589f56092be106960e88d1800a94d3d83c3 WHIRLPOOL 0a29eabf49c9d7f6ea9e5b7d2fd8b2a53dc63dbcfe582d123a528481836f802f6985f48013b5396d9785d06c5ad67c7bd5d4000663f45d3bf5515451b07e1b4c
+EBUILD pgbadger-9.1-r1.ebuild 438 SHA256 118ba82c778f4ca9ab17f66be90975ed0431782fbc1a7b1ced9a93a8845890e5 SHA512 5d918d0ccfa4d49096693d3dc62caf95bb9a38015afde5565aa43fb23b1961030feb4ec942a1ba957d75f42e63b2a3079aa6cbdf399eeb88393f3ae183ba729b WHIRLPOOL 479643ef75c24ba5326143b9ea5a663cc3686ad680ff0965869d709c4010638545f945e2ea65f4dd2b10ae55dc9d4ae4576cdb05f55027e21bfa1311edfbd775
+MISC ChangeLog 2524 SHA256 45d77a1979874e89834128c612039f6259d7acb7d9774f0795fc23a5048c5203 SHA512 8f4ac6db506c8a9fd19a8571ce038bd53da7ebe06a0260be4e858b389c9247e8282ac6bd58af17b326e2f39d99a194874b53875e7b2c43fdcc02cec4de518ee4 WHIRLPOOL 8167611e851241c3bb891df092c32cf70bfc810875cc22599ec01eeb1507e5f9d9f1312612b1542187641f4ae845a4946bbef1e3cf5d351569007ee77e719029
+MISC ChangeLog-2015 1163 SHA256 2b5ace4a697325f83cc7943d61827d11143bcdf93b9a40cde730846878c8d0af SHA512 6287bd20ddc45de50205e7a643aa1946849dd4613e1129ab5b79d0132fcf4c02baf9604bbfc193baaeb4bad2880b79c5eb98dda4b95f7c62791703ae39793908 WHIRLPOOL 8a58bdf1c866dd0b8c1d0a8cf92135bf50d3e33b70e0e6e0bb58c08558f4e56608d57894e55dde7a4843882d0442297a40d18f91b0f8598fd2cf5a8ad03563d9
+MISC metadata.xml 413 SHA256 b5665875fb7598dfde8c03d8076bed94cf3543111643873704631228f681ecaa SHA512 6bf32dc50ecd2d51d450413500b00773177109ab3ad26d74b458ec902973fa38542dbc65e65fbbe103b4be63589f61c2b9a6ab6ea5492b1954142afc5c2f8f93 WHIRLPOOL d349e8b4edd5066d4f6e5e14c093682ccefd187df53d311284955a595a12e9ea8d52ed233310ba5bde2cb348dad3df008bcbbeb41f8ed8a8aa6399437510e6e2
diff --git a/dev-db/pgbadger/metadata.xml b/dev-db/pgbadger/metadata.xml
new file mode 100644
index 000000000000..5010c08906f3
--- /dev/null
+++ b/dev-db/pgbadger/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">pgbadger</remote-id>
+ <remote-id type="github">dalibo/pgbadger</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/pgbadger/pgbadger-9.1-r1.ebuild b/dev-db/pgbadger/pgbadger-9.1-r1.ebuild
new file mode 100644
index 000000000000..9e674e7b549b
--- /dev/null
+++ b/dev-db/pgbadger/pgbadger-9.1-r1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit perl-module
+
+DESCRIPTION="pgBadger is a PostgreSQL log analyzer."
+HOMEPAGE="http://dalibo.github.io/pgbadger/"
+SRC_URI="https://github.com/dalibo/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="
+ dev-perl/JSON-XS
+ dev-perl/Text-CSV_XS
+"
+RDEPEND="${DEPEND}"
diff --git a/dev-db/pgbouncer/Manifest b/dev-db/pgbouncer/Manifest
new file mode 100644
index 000000000000..0c9ac49e7469
--- /dev/null
+++ b/dev-db/pgbouncer/Manifest
@@ -0,0 +1,9 @@
+AUX logrotate 119 SHA256 09e12d5f8f026251a0a8532dfc181199085e4cc23a3f4cbb4dd15a4bea5af6ad SHA512 5aa4226ab2d168a88a3b64deb114d3901431d2afb2571cf8ae411c989549bc465ee05104a6863cc8fce6d769d809b4ab536973280f50cb4415c6698c34e1a5b8 WHIRLPOOL 982d153670d43bf5b195988887474cd8b4dc268dc663ce88d430f86d83f6cf5cd3bc0455495eb8d225fe4d6179b5bf6e3136d3d960cb9b1d1dabeb0b2f4288a3
+AUX pgbouncer-dirs.patch 685 SHA256 d5b0875000c89e945b0eb3f3007d68b211d675a4e18872ef7166c76dbd3eb695 SHA512 6a475bf5cff10b464177af619051529ad78e802c56655500ad23130c5989721f41592387f9bf6719810eae2d876a8dd36219b87ae1fdb29304b2adc98c49ae4c WHIRLPOOL ac8df7239880f21479bec1153a4b9a6ab4da937bccec38205785ccc4f951b4d8a227e94c12f564b2694803a2a43c5390c4700944c9ed60f55fdbeeec370439c7
+AUX pgbouncer.confd 425 SHA256 e681f992f6051bc1bb2887f712530c38be1c0a2ffb8ee254d0438b8679f55b9c SHA512 9f997cbfb18f5bb1623aea2a9af706359a973fd2167be91ee6ffb37a22a6dc453280c66b6d2c11ab0174dbf159a195f0a1612be198466633d728a5317a878035 WHIRLPOOL bbad3f2609c638e859e44555e25bef1249a7cbb024a7f6e07f4cee57bfc1571d8100a43715360d2d03a9bf62b0ed65878339cc5f641ac0f3736296a93c597b6f
+AUX pgbouncer.initd 2183 SHA256 2eb70ea8913b52560628a266a0b8bcae59b5e00fddb4cb43f6fe6f2956b5be90 SHA512 ecd34f017316b2c0aad172e5bf5393137da5ab841f4d6de93eb82a07abe9f234a2426ca7dada2dc047c33ea4c7dc0af3040b249ec1f9d7e0c1782fb0463a7293 WHIRLPOOL c7dcec6b8c884ae9b52e988f1d4f38c5b1c65b19f353f2ac0224da5e6fa2dcad5182473c1d4b01bd52c6d684a500dff636e0f580dc01c0095a925abcc1806b32
+DIST pgbouncer-1.7.2.tar.gz 462374 SHA256 de36b318fe4a2f20a5f60d1c5ea62c1ca331f6813d2c484866ecb59265a160ba SHA512 11c89606599f424b34f39a4b072ec6293fea0b14ee52ae4fbc44775e6d83771a22d194f4e8eabe410e0d6a70657508cf1a3b1012543d91873c36f644afb5675d WHIRLPOOL 3b007d6ea8f9c5e7e8ee3e2908839e24c120fa458f127192f40f8f7d37e5e56bcce3501f76b623670a210c96af66a861adf183e62c152e92e030b2cef60f3d03
+EBUILD pgbouncer-1.7.2.ebuild 1786 SHA256 d68c07bbe7308231d3123e59fc2bc04a4c2a969b93faaaa33696808d41631044 SHA512 dabfa3936e5292c14d6aaf44489c4d8b530725328776ac207b90b2b0dbecf6a3767b858848eb3d94be8766cdc496584c5062dda25f2b291e2aec68c05cd29e98 WHIRLPOOL c51faadd3f3b9c29f2b471b74087260b0f0a60cb164ae2ce50a333974ecd9af01d1ee64d25de8f2e17c4bcf7e00bfa48bc6b9ba07ef1d5ca0c1a1882f3e0c1a7
+MISC ChangeLog 3394 SHA256 f8f33fecd5d29016fa9192ef7c69ad036330eb94ead2a7140911ddc1ba72c7b1 SHA512 6bca8609c6a57769b42443709b6948ff9c8171d6e3a1b016af1853983e0f03efd1dbc09d6506c2f9fd3af88124b32d6896000540a6a5184bb0b3b650fb336c97 WHIRLPOOL e1f112fb1cb1f1376c46fd949b699d95c00a96d311f78a6d31fb038c2194410fbe2fd035cadbecb7f97d67efd945b1cf6c19323732288a99626084a6ac87f6a6
+MISC ChangeLog-2015 2800 SHA256 5d899d2830d6ffe1ef3a58aa1161fcada9b09e2ba3bf2d45c5afe1fcfc9e5010 SHA512 4332c8917229ff25709efdd12a97f71596e7b8eab5ff9bc62d2fa5a0b119de9301a5508e2935646bc48d9b31ffe789ed83162e324164e9a39eb68182526507f2 WHIRLPOOL a10f35230f908d9544e1ecfb6df07afda7da448e593d8eafef24e535c3ad92b77d83caa22e48a4f6b1371808f2496800e2ba46bdcab826d0adcec83bf0cbd02d
+MISC metadata.xml 946 SHA256 5f69388f01dbe23c221467fd1aa454b0f833a2ebe4d86bb3ad1beeb6a3cf0517 SHA512 9f147d93f85cd9350ea5e7e8061228e6269baf4766de6ccc2495c071f508a774b6c27e1bf626f192a823a7d28b7cf76f9c20a49a91d3d5618e5d0aebfba5e630 WHIRLPOOL cc47b597b128596e8242fce4e465e678a48e3faeaea4d81c10ed7ded34ffa453d37c5b5af6d03cf1cb94a9fc9c52505391f2d57a047acbf3dc0b52097ce8a900
diff --git a/dev-db/pgbouncer/files/logrotate b/dev-db/pgbouncer/files/logrotate
new file mode 100644
index 000000000000..9617eafa66b0
--- /dev/null
+++ b/dev-db/pgbouncer/files/logrotate
@@ -0,0 +1,7 @@
+/var/log/pgbouncer/pgbouncer.log {
+ missingok
+ sharedscripts
+ postrotate
+ /etc/init.d/pgbouncer -q reload
+ endscript
+} \ No newline at end of file
diff --git a/dev-db/pgbouncer/files/pgbouncer-dirs.patch b/dev-db/pgbouncer/files/pgbouncer-dirs.patch
new file mode 100644
index 000000000000..62bcd0b84409
--- /dev/null
+++ b/dev-db/pgbouncer/files/pgbouncer-dirs.patch
@@ -0,0 +1,26 @@
+diff -Naruw a/etc/pgbouncer.ini b/etc/pgbouncer.ini
+--- a/etc/pgbouncer.ini 2012-06-10 19:57:01.000000000 +0000
++++ b/etc/pgbouncer.ini 2013-07-17 02:25:59.598888628 +0000
+@@ -29,7 +29,7 @@
+ ;;;
+
+ logfile = /var/log/pgbouncer/pgbouncer.log
+-pidfile = /var/run/pgbouncer/pgbouncer.pid
++pidfile = /run/pgbouncer/pgbouncer.pid
+
+ ;;;
+ ;;; Where to wait for clients
+@@ -40,10 +40,9 @@
+ listen_port = 6432
+
+ ; unix socket is also used for -R.
+-; On debian it should be /var/run/postgresql
+-;unix_socket_dir = /tmp
+-;unix_socket_mode = 0777
+-;unix_socket_group =
++unix_socket_dir = /run/postgresql
++unix_socket_mode = 0777
++unix_socket_group = postgres
+
+ ;;;
+ ;;; Authentication settings
diff --git a/dev-db/pgbouncer/files/pgbouncer.confd b/dev-db/pgbouncer/files/pgbouncer.confd
new file mode 100644
index 000000000000..e2c584011884
--- /dev/null
+++ b/dev-db/pgbouncer/files/pgbouncer.confd
@@ -0,0 +1,12 @@
+# Location of configuration file for PgBouncer.
+INIFILE="/etc/pgbouncer.ini"
+
+# How long to wait in seconds for a safe shutdown. Equivalent to
+# issuing 'PAUSE;' and 'SHUTDOWN;' on psql console. (See 'man 1 pgbouncer'.)
+NICE_TIMEOUT=60
+
+# Set to 'YES' to perform an immediate shutdown if the nice shutdown
+# doesn't work. Same as issuing 'SHUTDOWN;' on console. (See 'man 1
+# pgbouncer'.)
+FORCE_QUIT="no"
+FORCE_QUIT_TIMEOUT=2 \ No newline at end of file
diff --git a/dev-db/pgbouncer/files/pgbouncer.initd b/dev-db/pgbouncer/files/pgbouncer.initd
new file mode 100644
index 000000000000..20479dc22dab
--- /dev/null
+++ b/dev-db/pgbouncer/files/pgbouncer.initd
@@ -0,0 +1,88 @@
+#!/sbin/openrc-run
+
+extra_started_commands="reload"
+
+depend() {
+ use net
+ after postgresql
+}
+
+get_config() {
+ [ -f "${INIFILE}" ] || eend 1 "'${INIFILE}' not found"
+
+ eval echo $(sed -e 's:;.*::' "${INIFILE}" | \
+ awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }')
+}
+
+PIDFILE="$(get_config pidfile)"
+UNIX_SOCKET_DIR="$(get_config unix_socket_dir)"
+
+prep() {
+ if [ -n "${UNIX_SOCKET_DIR}" ] ; then
+ checkpath -o postgres:postgres -m 0775 -d "${UNIX_SOCKET_DIR}" \
+ || return 1
+ fi
+ checkpath -o pgbouncer:postgres -m 0755 -d "$(dirname ${PIDFILE})" \
+ || return 1
+ checkpath -o pgbouncer:postgres -m 0644 -f "${PIDFILE}" \
+ || return 1
+ checkpath -o pgbouncer:postgres -m 0755 -d "$(dirname $(get_config logfile))" \
+ || return 1
+ checkpath -o pgbouncer:postgres -m 0640 -f "$(get_config logfile)" \
+ || return 1
+
+ return 0
+}
+
+start() {
+ ebegin "Starting PgBouncer"
+ prep
+ local ret=$?
+ if [ $ret -ne 0 ] ; then
+ eend $ret
+ exit $ret
+ fi
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --user pgbouncer \
+ --exec /usr/bin/pgbouncer -- -q -d "${INIFILE}"
+ eend $?
+}
+
+stop() {
+ local seconds=$(( ${NICE_TIMEOUT} + ${FORCE_QUIT_TIMEOUT} ))
+ ebegin "Stopping PgBouncer (this can take up to ${seconds} seconds)"
+
+ local retries=SIGINT/${NICE_TIMEOUT}
+
+ if [ "${FORCE_QUIT}" = "YES" ] ; then
+ einfo "FORCE_QUIT enabled."
+ retries="${retries}/SIGTERM/${FORCE_QUIT_TIMEOUT}"
+ fi
+
+ # Loops through nice and force quit in one go.
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE} \
+ --retry ${retries}
+
+ eend $?
+}
+
+restart() {
+ if [ -n "${UNIX_SOCKET_DIR}" ] ; then
+ ebegin "Performing online restart of PgBouncer"
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --user pgbouncer \
+ --exec /usr/bin/pgbouncer -- -q -d -R "${INIFILE}"
+ eend $?
+ else
+ stop && start
+ fi
+}
+
+reload() {
+ ebegin "Reloading PgBouncer configuration from '${INIFILE}'"
+ start-stop-daemon --signal HUP --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/dev-db/pgbouncer/metadata.xml b/dev-db/pgbouncer/metadata.xml
new file mode 100644
index 000000000000..eccd61517f95
--- /dev/null
+++ b/dev-db/pgbouncer/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bugs@bergstroem.nu</email>
+ <name>Johan Bergström</name>
+ <description>Proxy-Maintainer, assign bugs</description>
+ </maintainer>
+ <maintainer type="person">
+ <email>titanofold@gentoo.org</email>
+ <name>Aaron W. Swenson</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="libevent">Use libevent 2.0+ and evdns as the DNS backend</flag>
+ <flag name="udns">Use udns as the DNS backend. Supports IPv4 only.</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/pgbouncer/pgbouncer-1.7.2.ebuild b/dev-db/pgbouncer/pgbouncer-1.7.2.ebuild
new file mode 100644
index 000000000000..39eec25d1f5d
--- /dev/null
+++ b/dev-db/pgbouncer/pgbouncer-1.7.2.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+# Upstream has *way* broken tests.
+RESTRICT="test"
+
+inherit eutils user
+
+DESCRIPTION="Lightweight connection pooler for PostgreSQL"
+HOMEPAGE="https://pgbouncer.github.io"
+SRC_URI="https://pgbouncer.github.io/downloads/files/${PV}/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug doc libevent udns"
+REQUIRED_USE="
+ libevent? ( !udns )
+ udns? ( !libevent )
+"
+RDEPEND="
+ >=sys-libs/glibc-2.10
+ libevent? ( >=dev-libs/libevent-2.0 )
+ udns? ( >=net-libs/udns-0.1 )
+"
+
+DEPEND="
+ ${RDEPEND}
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+ >=app-text/asciidoc-8.4
+"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
+
+ enewuser pgbouncer -1 -1 -1 postgres
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/pgbouncer-dirs.patch"
+}
+
+src_configure() {
+ # --enable-debug is only used to disable stripping
+ econf \
+ --docdir=/usr/share/doc/${PF} \
+ --enable-debug \
+ $(use_enable debug cassert) \
+ $(use_with libevent) \
+ $(use_with udns)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS
+
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+
+ insinto /etc
+ doins etc/pgbouncer.ini
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate" pgbouncer
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ einfo "Please read the config.txt for Configuration Directives"
+ einfo
+ einfo "For Administration Commands, see:"
+ einfo " man pgbouncer"
+ einfo
+ einfo "By default, PgBouncer does not have access to any database."
+ einfo "GRANT the permissions needed for your application and make sure that it"
+ einfo "exists in PgBouncer's auth_file."
+ fi
+}
diff --git a/dev-db/pgmemcache/Manifest b/dev-db/pgmemcache/Manifest
new file mode 100644
index 000000000000..2f0e3d667459
--- /dev/null
+++ b/dev-db/pgmemcache/Manifest
@@ -0,0 +1,9 @@
+DIST pgmemcache-2.1.2.tar.gz 16685 SHA256 015bf72efd6e7bc392814e9ae49bc9c486e699e9dc80f0c437b42408b7155d67 SHA512 2be9aeef214f569473efcb849611e10c4fdb179e5cb8b1105f63fe0ab7bd829648a7891fd4e21109afc1b6375aeae0c2449a977a67631ee4d505e3faf83bc3f3 WHIRLPOOL 7f7c62400316da6c8ed2da0e1909ab8034e8f845d4b3d439fbdf54b310d8fe1100e7c487a3d7485a3e86358fe493bf1bb5107b4d0f4ab1091bf6467a04fe6eac
+DIST pgmemcache-2.2.0.tar.gz 17742 SHA256 c16e062f6ae4ad9345b26ae0caf70e7169eb2a4fa316197b578a76095df5c5a2 SHA512 8d63aa25fec9c5f1895cf5107bbb261be2b35d5e05ac03e8fa59597ed18cf123c45aa0690eafeca4a26bdfabf61088bd1e2518c3fa13b683333b1ca0b5d8446f WHIRLPOOL a8a01bb98cb56ee3d0d19b2d7aeeeee38953c3310bafc2cd6737eb3114ceb78cd11d28626abb14114d92429cf1812a377b65470696fd4141a25253b0b9a92e0a
+DIST pgmemcache-2.3.0.tar.gz 21135 SHA256 7f9f545c02e13c842b20a1cb387e209ec0fb654ebb083828bcf08023ed6657e2 SHA512 75ae3b7c9087078b2276ebadf66f9d419323927f6b8c8f61f8681fe939d086dbfe6aa935f20afa3acc11171e00329e5758a8a6a952cfbcf3aef45c8cc3f50a3b WHIRLPOOL 2aad23d17a357ddf1ff00ef0b99501d25ffb420e7250e338924281a94f686a360daad167d7d136934083b390fb191da016c17db448fcbbb1e37ba41e1c8addd1
+EBUILD pgmemcache-2.1.2.ebuild 548 SHA256 7349e11d20fdff5972a822649d39e830eda1472dadb05e927e745a4648415ac6 SHA512 64e9c790166d299a83b345bf85cc16dda6d79eab33d1aac70864f64248a18d6b6b4eee23ec2ce845bc6dc1f7688d5687b0e08381d5a9d3cfc0a11bb230cd7021 WHIRLPOOL f264c5d3449d7737d7e718b65bc4a18a94573266eecad34427e2797f999394f78c7a0c5b15457ce4fd152b1fe22913274ad8c4e5b5189f6247e73fd5bb925913
+EBUILD pgmemcache-2.2.0.ebuild 601 SHA256 41192cc56ad071ff2e16564542cc24c8ac644a8181b82ac8015974384e9a0de4 SHA512 c980e61b09d6b66acce579e13cdd09a3ff560378c3e8248a995d62dc2a74f47e52c3514561ef8e4c37b49b557d82896d7037a4d3cf9257b5cc0307648ad63177 WHIRLPOOL 9cf67fd853eb0b2d340b5b18942cb12c860a285d686d8dcf3014dda1747fcb9e80d5eb67d40a6300543bf46a2028a38bbdf2150e2641a9f089f8c1da8f01e596
+EBUILD pgmemcache-2.3.0.ebuild 601 SHA256 6c47720b7c1bc1e40b105bd73d39c6487dc6b4e24c6f4e855e1b49edb1a26875 SHA512 e9a9a4be1416c3026a6240642b132c51a2416f80d14939fac93aff167bf92531114feba50c0530fecbec3da257a63a8cf799373e57ec969cb84853e8260529a4 WHIRLPOOL fcf9b5e786b155c773ded3090eac8426cb8dfa47771ea8f2b8f1cde8f122b64df7ae24af113a7ec02e667808ab2959997c3898870941cd65f14ffa803b4f5212
+MISC ChangeLog 2552 SHA256 970882c0eeadbd91f06f8c15f01dcb14f4f6731121e1366555de8d014172ff81 SHA512 fa5bd8a815b9b296e8d773523363ccc521a23d54b7f163e1605ff3070a1299f8bce76ef1558e0a4f9dfa72f6da59b83e385188a206a9b2f4b7703c6d1238592a WHIRLPOOL 50dbcb74de41c7a3c4f9bc4cd4e39f9abfb7b2ccc52b254968df388fc43d5f84ea298b9e4f72c2cecc4400c6d362738e2edb7885c44751fc309e52cb8f618669
+MISC ChangeLog-2015 1982 SHA256 0369e4b3d033b76c12c751ad166af006e114ca7cad8c14833f9fade4e8d73e00 SHA512 0aa1d156a41fd46b9ecc0347ea555c6beb0e66b41f1bc5c97830c981f85ace1593675211417f522ff605338665f61db602b40ab23d2fa83cb2d8f8dbbff40310 WHIRLPOOL ff13d554baddac45d72302b296ad824a5d54fa5200b2748a92fe3ad5afa560f572d44d0a25816c5728d446d975536d4fc8c073789874c7417b6698fc6f384523
+MISC metadata.xml 577 SHA256 f27289ee51b2e4ccc38e3649b53cdbcfa7f9cd2778032f55202398e7b5c3f50f SHA512 81c43b42be24f1369c34d35656880d91ee10e59965aa1e0900576b9e45e0c320a43266bc3c4b61f0140dec4e80730d82cbaf2d629f7b75e15225b3b6d64a2edf WHIRLPOOL c5a42703052031743ee2ba794e158d719910706de5608719a42832fad3f7d9f69bddea8b69ed3c4a01d9990d1fb8242a52f2af38b305968a645725e54cc9384b
diff --git a/dev-db/pgmemcache/metadata.xml b/dev-db/pgmemcache/metadata.xml
new file mode 100644
index 000000000000..2028473d78d8
--- /dev/null
+++ b/dev-db/pgmemcache/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>bugs@bergstroem.nu</email>
+ <name>Johan Bergström</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">ohmu/pgmemcache</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/pgmemcache/pgmemcache-2.1.2.ebuild b/dev-db/pgmemcache/pgmemcache-2.1.2.ebuild
new file mode 100644
index 000000000000..d3137046d2b0
--- /dev/null
+++ b/dev-db/pgmemcache/pgmemcache-2.1.2.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="A PostgreSQL API based on libmemcached to interface with memcached"
+HOMEPAGE="http://pgfoundry.org/projects/pgmemcache https://github.com/ohmu/pgmemcache"
+SRC_URI="https://github.com/ohmu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-db/postgresql
+ dev-libs/cyrus-sasl
+ >=dev-libs/libmemcached-1.0.18[sasl]"
+RDEPEND="${DEPEND}"
+
+DOCS=( NEWS README TODO )
diff --git a/dev-db/pgmemcache/pgmemcache-2.2.0.ebuild b/dev-db/pgmemcache/pgmemcache-2.2.0.ebuild
new file mode 100644
index 000000000000..7d0ec99a8032
--- /dev/null
+++ b/dev-db/pgmemcache/pgmemcache-2.2.0.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="A PostgreSQL API based on libmemcached to interface with memcached"
+HOMEPAGE="http://pgfoundry.org/projects/pgmemcache https://github.com/ohmu/pgmemcache"
+SRC_URI="https://github.com/ohmu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-db/postgresql
+ dev-libs/cyrus-sasl
+ >=dev-libs/libmemcached-1.0.18[sasl]"
+RDEPEND="${DEPEND}"
+
+DOCS=( NEWS README TODO )
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install
+}
diff --git a/dev-db/pgmemcache/pgmemcache-2.3.0.ebuild b/dev-db/pgmemcache/pgmemcache-2.3.0.ebuild
new file mode 100644
index 000000000000..1e794204e9ae
--- /dev/null
+++ b/dev-db/pgmemcache/pgmemcache-2.3.0.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="A PostgreSQL API based on libmemcached to interface with memcached"
+HOMEPAGE="http://pgfoundry.org/projects/pgmemcache https://github.com/ohmu/pgmemcache"
+SRC_URI="https://github.com/ohmu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-db/postgresql
+ dev-libs/cyrus-sasl
+ >=dev-libs/libmemcached-1.0.18[sasl]"
+RDEPEND="${DEPEND}"
+
+DOCS=( NEWS README TODO )
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install
+}
diff --git a/dev-db/pgpool2/Manifest b/dev-db/pgpool2/Manifest
new file mode 100644
index 000000000000..6a99b5f6f595
--- /dev/null
+++ b/dev-db/pgpool2/Manifest
@@ -0,0 +1,23 @@
+AUX pgpool2-3.5.0-path-fix.patch 8540 SHA256 605994192d43c631f46edbd7e93e581996d4223d2f9602541c71e0a7d33dfea4 SHA512 b9e5b2c3532fd9a72f19915913b0a9d721a0e714de0215ae3f5f0d978b4effa9662b1eb3cb013fdb4f18160cc7c4ed5733f3085c98770aa6407a2af384065609 WHIRLPOOL 6b8b916c64af10ca65c30f73991648ab8758576716cb4afb8969d41a261aaabb799524f424cf83c0f5b463d4b0ee7ba144baae9053775875d52d4613248f56e3
+AUX pgpool2.confd 649 SHA256 542007a1f5fc377ce921316913526fe08a5b6913d533359a3ec3317b0075b60d SHA512 5f9a4fa1e68161049ad767d64c764fbf70e84a4239e58119455a45a7e45d86ea2d19b617147cf891053e0dad4420c84704d67015334c7d41bad05b260d70e910 WHIRLPOOL 0b28a1731bed4a316f33c2c0f8d95567093b6685e43912a2de05802248d3f6a7044bf391efa1f01a320e978f45764b4c7569f0e5aa73be8291abad264d43964c
+AUX pgpool2.initd 2174 SHA256 dce3cd0d474719c5cf42be8adf63e9e0856c5de8d08f5741bb0d3155ca803810 SHA512 3123d2c5e7178fc4b970592fe6908df2860ca3cd5ec54d4609c28145ffc934edf6ddb11f9d2208d89d43bc4252e326b3bc0eed36a28fd2fadbaeb2d635935e40 WHIRLPOOL c6795799b370b21f56e472d1ec1d8f5c194dbec881d5a2f3360c1e87dd1ec63b24fca527029f505856006069b82702d1e3beac3f2987a6721b561abbc186622f
+AUX pgpool_run_paths-3.6.4.patch 10760 SHA256 9f3213e093b36ba61ee818a7d411ad7d98fc9225a7297d00664066c0a8acbce9 SHA512 ba3bdd19e6ea9178da3eb178f72981b337c9746ddf9f27d6de51d0d3c41d3a4b6f52ed88bbbbbcc6004693ee630172649ab316d69658b25521f438c44f72b3c5 WHIRLPOOL 57c344f7f96d88cb687116dc01163e099f36f92d75779158cd7771f9227a8f2ce5243aa5033aee7e3794d54f64caa176c0e32ba9a04c16c12963d23f1c6d3722
+AUX pgpool_run_paths-3.6.5.patch 11626 SHA256 4f0a05764970fa7f5652bec12f7d548ae0544466b16f4a3079c1d9e848bc8c17 SHA512 ea718378d0ea14fa48975a899df26bc8aafa1e61b0d3f264ead81031a21d68284f4af5ce065c5534d113faf36724c880ce280665e148ec623e9fea9c8f91c77c WHIRLPOOL 2c96e6e1c43f86ab20804d9a0f8022f9a78f337b87abff826757c7b00ec4b6cce0df13eaf150dd131af78d68951a4dea6bc6c04d948812587fb9ea640d08061d
+AUX pgpool_run_paths-9999.patch 11759 SHA256 bb595873c5a7e3dc4e94fd19cf059b6a398ca35a71277cf48dc2896b40e5f259 SHA512 109be0f3bcda49db14ebb86d6e9347aa0a47d582ac1a1438b07719f9fa503045cc5b65a27964c3c0b1690ef489f752a497e3b050b816569d0ce01193dc007259 WHIRLPOOL b0ff1ce229c4a3d4d38f0014bb62ab3135d658eb2399f8cfc6ddf97e8a1d9bd5a089670c180d389ba3756bebb5df4ee55ef7af98bdccd0925c239d21daeaef3b
+AUX pgpool_run_paths.patch 7443 SHA256 c75abd28e48c8895e7c00eab800b8497f8b64d55c7f192c2343aab1eb3fee31c SHA512 227716daf9d93d1ca0c749faedca3d1c9e35b64eebe4c61db2e37f94ed2dcc2e97e34118d853b3dbc848e395329c05c026f819a9e5350b4f0e32b269932d68b1 WHIRLPOOL 822b11df3b7940f8557d51f93967e892b7d66ee9cec2c52a62a0ba2848148a52edfab13e0f2d29e24e76328a69be0b11156d64503c22e576dc4fa033cc700e76
+DIST pgpool-II-3.5.2.tar.gz 2227075 SHA256 5d29fd9c30141bfdaf15b51c7878766178e5df42fa5e160d0f7df2824d26104f SHA512 dd7268bce0019de30dfad01a8600af798127a4c2cc818e6f85ba30289e97c253d6faa392734d85ccbc97be3f04458c12af1bba541e5b8f3d2ee8268432e01d1a WHIRLPOOL 22939c855919b8399c1129ff4622eae159141e9bf05cc36aca456bfd582c7ab0dc7ec87df5ea96d7101f438e89bf4e06f46a5f63cfde22e505d0a3965c0496fc
+DIST pgpool-II-3.5.5.tar.gz 2243184 SHA256 8fa1ccf13ff4f7c1ab0f6d523090444f65d78923de11061b5027eb5d58318491 SHA512 f77888cbc5e2c15ae1035ee3a1965d4fd3d02cdfd5810c6c656456eaa0d73dae7471906bdf0848607723633da5b8d02145559b767735bcc9b7e4023b1d59efed WHIRLPOOL 5f4d4d9c3f6478b9b3ecda311c571e1f54805a07aa505acd32fbfb8fb2790183b732d6f86843a2b6614c74565efad7f9b3d962281cd2b1d23b54515448a1c84a
+DIST pgpool-II-3.6.1.tar.gz 2539510 SHA256 244f99a70198b5861a63b2fe3e44ac39d2819f6aa6497f62958c6afa2750d94c SHA512 9d4f0ecec3cf7478c7c4cd5cb1aa75614edca204d11b145f145d752c24bed7f7f4ea2880f6a3f9833aee0b5f428e8cf36e2f91bdef2f6065fb98019df546469a WHIRLPOOL 9a307a63e9179ecfc7a52d1f056d47f09543bf4e378fa0090cdaf90d141c70e89323b4cfcbc9bbd9fa2422ff76bea592f189bea78915445fb1779ce9089ef6e1
+DIST pgpool-II-3.6.4.tar.gz 2623625 SHA256 6ad78b9878d126e8da1e03e8edf3c8d56bb0754fe6432f633e81f6faaf8e6dbf SHA512 a44724b77faca12bc2b46a88e307c10f8099574b5a27720c98f2939fbfa61f41b4c3dc03565412972c351c10d57da4324a483c310b52f624f5ba87c2bd4d006f WHIRLPOOL 410136d359baa369f3d19136da54ba202c8b250bf364fc2f9b91a66190266ae523647cc89313211b63effbedd97168d026a2574be059dd0da7c8768b2d9714e7
+DIST pgpool-II-3.6.5.tar.gz 2651330 SHA256 f7eb62bd977a24d9187dc6aca6dd73b3b9e322cb3680ab5f5191a7e802a3cc9f SHA512 12247730f202859c76b0a11ccc485de786e53df7b8e08ffd76d7653c25633d79387f027e7c9d804bf19cd89b9db047b7ca0cf1cf5e914ee74c6efc0b6660eb1d WHIRLPOOL 22a153afc9f4a37ff52165ac6e79464ccff42600dddf085908da5cd6a62d7a5d5690dfe029adaf197f7f8b9d4f033326b5d2f61648133db3881129e8c1c55499
+DIST pgpool-II-3.6.6.tar.gz 3171264 SHA256 5fbdac14a07b4f4cabef8bd224be1fbb0770d9aa4731d8fa7905878dc4c22fbc SHA512 02cfceed761cf6338ce0a33e9afe05194acdf4d5577cf0d920176cb3bacffce6e9c2c1e8a8b89c5b062bc53d54cd012a4ad9582b42df7bc36ee666dcd0ee3e10 WHIRLPOOL 504c49cccfb3be78144defc5eccce46e1994f0049a9b5835130ffc7b5339f05ef5a562236053c4b10a711053384baccbdc96eb60ee21ea24354627f594bbb8f1
+EBUILD pgpool2-3.5.2.ebuild 2465 SHA256 009b6abc74f1c3a31d579cb1855713682d06706b08cb14e22bf062dae6f9b3bc SHA512 5f1d18669f16acdccda9eedb0a24d61705f9b9ea23130c95428ba1143ca337815e724047b9b41ee48ae7ae0599e329edd4a45ecc3ac428b95868d9990b4542bb WHIRLPOOL c5ccd1bd550e758512a765a78fd1a623840b1884c604666588b29a7c51a0afefb586dd0d597c181fe2c3832bdbc67a905d37ae1669675b924b22f6e206fcbb81
+EBUILD pgpool2-3.5.5.ebuild 2465 SHA256 d13d9a638056e34e34685a8837b465c568f31e0a33d768c3ca1e6da99afffdd0 SHA512 8cbe17265f1b698eca9386d1268dd3e07cc305efb0b4bd8cecd995656827bcb1db573094514d7f1e0b51a9a80effb70bffdc7c3c62f14fe974c468e2e3090926 WHIRLPOOL 1d7765e62fc20b9f8455a2225c43c0ce085563628eb3fa127235e2a8fe103accdea6bea045cbee7741d3d8bf9aedf846487927e7f0ec339752589e6bdcb9e2fd
+EBUILD pgpool2-3.6.1.ebuild 2396 SHA256 5413cc6e97d9d03f6a8d9306925e550dfae066b84e8b350fc37cb20bdde048bd SHA512 27b23a48947221074fee372c3c1708492796f1d0671d0f98272aa279c8021e491be182b7cf5f74e7ab7fa8a683a76539e60ad28ea89a79ed06984bc2e3920386 WHIRLPOOL b4fc29df28364b3ccf26612f3eff4808ed0473caec41d121a2d9b3d4d7fad3f080f24ad9badf97d363d27ad40ac09376874f8df8b80b06ec72460ddc706531d8
+EBUILD pgpool2-3.6.4.ebuild 2482 SHA256 0bc4c186c05d05d79cbd4381f6cb2d8f45d85d3fb6d07c46c237062d12e7bd68 SHA512 5d6fe03bd4d38ab5b73531635c81ec7aadfc3387646cb1c4833e20b19f0863b1c9b5d8d85426a2176986adab30359b7ab984dac0002ceb0f42e0cba1886edfe9 WHIRLPOOL d57efc4b218af5870a249265a73c4dd1eca8b4ea2368c26f9d42a4574a7f1ec3a225029761635aac1bdbb0f5a4458ad62b8badbcf267820271f2098d21de4c95
+EBUILD pgpool2-3.6.5.ebuild 2468 SHA256 ab395a3727d617226980e606bc9d7d36be1bacddaba0fdd23303433ba6a1bee0 SHA512 265a1b0be61105fe691ef883491733c8acd5cdbcfd98e9010c0d901b6891a4373afabb95f4697f000612a14700f3fc1afde27fd9a55f97879d67d3f7d6ecafcf WHIRLPOOL a3edcc30ed0c8c66878cbf7a665ce066a3f636b1eb6911eaba862f5b55fcd35a89b00a7fa17f482a6b2c876a7e140841215450602474a48750a933b54eb43152
+EBUILD pgpool2-3.6.6.ebuild 2468 SHA256 ab395a3727d617226980e606bc9d7d36be1bacddaba0fdd23303433ba6a1bee0 SHA512 265a1b0be61105fe691ef883491733c8acd5cdbcfd98e9010c0d901b6891a4373afabb95f4697f000612a14700f3fc1afde27fd9a55f97879d67d3f7d6ecafcf WHIRLPOOL a3edcc30ed0c8c66878cbf7a665ce066a3f636b1eb6911eaba862f5b55fcd35a89b00a7fa17f482a6b2c876a7e140841215450602474a48750a933b54eb43152
+EBUILD pgpool2-9999.ebuild 2420 SHA256 f5f6ff4fe45e0b7f20206defa6b03fe946e0cba3fa2708361a7cc37c999ca6e3 SHA512 de8cbbc56013fefaba4d7a93e7f6c218e40e8233b44694efc99bfca94bb1b1cefa9438fcb6c0947ffe71abd09c4a4011ffecb8089bd32f7075304b578ef132d5 WHIRLPOOL c748c80ef34f2c9392b75edb49d0089a3dbf50ca4a516b2a21fe4203b329ed18f76ec2e724f1d9b4201e3bdd568852bcc8633d7298dd1de8e7f756d960a5e4bb
+MISC ChangeLog 3763 SHA256 dc204ef977231a6acb1c9782acef4b57568d2b00fea4f6608b8e5aba1bbff885 SHA512 3b69836d0a396c3f27c9a201b14c1deec7c502e59aa89f0ae836d5f4a4f245a8e6af9eb841cbd9cd423607a398f1b053ab79906b069535a5a335f33d25bd5904 WHIRLPOOL ed590470288ceaac302a7949d790affe4eb8bbf873007111e4c4fe05d29f61bceff5b5b0f51e1e2f310761f4054e38586c83f8aa365305582cfc72ab470f2e54
+MISC ChangeLog-2015 5253 SHA256 fa072640b1475ffb2c7cb9407832d0cd2e1ae47d71be3f8ec6e60c7887c5a7d3 SHA512 a4e8b1bc2e41e6280fb37fc9edfec9cfacea8d611aaf2c344ed177cfccb7e9bd72e95c2fd1b8ee462c4c632dc09e365c3fc1aa4bb46aace1afbd0d0f288e5620 WHIRLPOOL 4e41bffad28612c3c2580561006f6f8e73a82506b52f704311d3d70cce7314166741f6701655e981d97d05b2668dcac50c3d5addee63fef1985034433e1916d9
+MISC metadata.xml 390 SHA256 5f53324eed631180f21fa0a389a924158b09d877441362d09bda1d50f313019e SHA512 ce26ee116c3c7ff77a771294ed07f38d8f940dc380915c339eb4c543d86fa5bde025ba83e70af2b7bf4a1bef1e51957f151131836855e0dae2e1daed73ffae8d WHIRLPOOL 6b73e921bcf284cbfd72c420e13b7b40260fe1f66ffdf905b88000e4f3f9676fca36d58b09c0f7e51e51d1459f2b9f944023f5e9991899e53fbf2dde52128405
diff --git a/dev-db/pgpool2/files/pgpool2-3.5.0-path-fix.patch b/dev-db/pgpool2/files/pgpool2-3.5.0-path-fix.patch
new file mode 100644
index 000000000000..b2c5d554e561
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool2-3.5.0-path-fix.patch
@@ -0,0 +1,184 @@
+diff -aruw pgpool-II-3.5.0.orig/src/include/pool.h pgpool-II-3.5.0/src/include/pool.h
+--- pgpool-II-3.5.0.orig/src/include/pool.h 2016-02-10 03:53:31.000000000 -0500
++++ pgpool-II-3.5.0/src/include/pool.h 2016-03-12 06:47:15.297966248 -0500
+@@ -72,16 +72,16 @@
+ #define HBA_CONF_FILE_NAME "pool_hba.conf"
+
+ /* pid file directory */
+-#define DEFAULT_LOGDIR "/tmp"
++#define DEFAULT_LOGDIR "@PGPOOL_SOCKETDIR@"
+
+ /* Unix domain socket directory */
+-#define DEFAULT_SOCKET_DIR "/tmp"
++#define DEFAULT_SOCKET_DIR "@PGPOOL_SOCKETDIR@"
+
+ /* Unix domain socket directory for watchdog IPC */
+-#define DEFAULT_WD_IPC_SOCKET_DIR "/tmp"
++#define DEFAULT_WD_IPC_SOCKET_DIR "@PGPOOL_SOCKETDIR@"
+
+ /* pid file name */
+-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid"
++#define DEFAULT_PID_FILE_NAME "@PGPOOL_SOCKETDIR@/pgpool.pid"
+
+ /* status file name */
+ #define STATUS_FILE_NAME "pgpool_status"
+diff -aruw pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample pgpool-II-3.5.0/src/sample/pgpool.conf.sample
+--- pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample 2016-02-10 03:53:31.000000000 -0500
++++ pgpool-II-3.5.0/src/sample/pgpool.conf.sample 2016-03-12 08:55:22.318087007 -0500
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -214,10 +210,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/var/log/pgpool'
++logdir = '/var/lib/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -aruw pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample-master-slave pgpool-II-3.5.0/src/sample/pgpool.conf.sample-master-slave
+--- pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample-master-slave 2016-02-10 03:53:31.000000000 -0500
++++ pgpool-II-3.5.0/src/sample/pgpool.conf.sample-master-slave 2016-03-12 08:55:45.284665542 -0500
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -214,10 +210,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/var/lib/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -aruw pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample-replication pgpool-II-3.5.0/src/sample/pgpool.conf.sample-replication
+--- pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample-replication 2016-02-10 03:53:31.000000000 -0500
++++ pgpool-II-3.5.0/src/sample/pgpool.conf.sample-replication 2016-03-12 08:56:55.004397999 -0500
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -214,10 +210,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/var/lib/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -aruw pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample-stream pgpool-II-3.5.0/src/sample/pgpool.conf.sample-stream
+--- pgpool-II-3.5.0.orig/src/sample/pgpool.conf.sample-stream 2016-02-10 03:53:31.000000000 -0500
++++ pgpool-II-3.5.0/src/sample/pgpool.conf.sample-stream 2016-03-12 08:58:23.820723842 -0500
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -47,10 +45,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -215,10 +211,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/var/lib/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
diff --git a/dev-db/pgpool2/files/pgpool2.confd b/dev-db/pgpool2/files/pgpool2.confd
new file mode 100644
index 000000000000..b2dd2a69e02e
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool2.confd
@@ -0,0 +1,17 @@
+# NICE_QUIT ignores new connections and wait for clients to disconnect from
+# server before shutting down. NICE_TIMEOUT in seconds determines how long to
+# wait for this to succeed.
+NICE_TIMEOUT=60
+
+# Forecfully disconnect clients from server and shut down. This is performed
+# after NICE_QUIT. Terminated client connections have their open transactions
+# rolled back.
+# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds.
+RUDE_QUIT="YES"
+RUDE_TIMEOUT=30
+
+# If the server still fails to shutdown, you can force it to quit by setting
+# this to YES.
+# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds.
+FORCE_QUIT="NO"
+FORCE_TIMEOUT=2 \ No newline at end of file
diff --git a/dev-db/pgpool2/files/pgpool2.initd b/dev-db/pgpool2/files/pgpool2.initd
new file mode 100644
index 000000000000..c9ffb0cf1611
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool2.initd
@@ -0,0 +1,82 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+CONFIGFILE="/etc/pgpool2/pgpool.conf"
+LOGFILE="/var/log/pgpool2.log"
+
+depend() {
+ use net
+ use postgresql
+ after logger
+}
+
+get_config() {
+ [ -f ${CONFIGFILE} ] || return 1
+
+ eval echo $(sed -e 's:#.*::' ${CONFIGFILE} | \
+ awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }')
+}
+
+PIDFILE="$(get_config pid_file_name)"
+: ${PIDFILE:='/run/pgpool/pgpool.pid'}
+
+prep() {
+ # $logdir contains status file(s), not log files.
+ local logdir=$(get_config logdir)
+ local socket_dir=$(get_config socket_dir)
+ local pcp_socket_dir=$(get_config pcp_socket_dir)
+
+ checkpath -o pgpool:postgres -m 0770 -d $(dirname ${PIDFILE}) || return 1
+ checkpath -o pgpool:postgres -m 0770 -d ${logdir:-'/run/pgpool'} || return 1
+ checkpath -o pgpool:postgres -m 0660 -f ${LOGFILE} || return 1
+ checkpath -o postgres:postgres -m 0770 \
+ -d ${socket_dir:-'/run/postgresql'} || return 1
+ checkpath -o postgres:postgres -m 0770 \
+ -d ${pcp_socket_dir:-'/run/postgresql'} || return 1
+}
+
+start() {
+ prep || return 1
+
+ ebegin "Starting pgpool2"
+
+ start-stop-daemon --start \
+ --user pgpool:postgres \
+ --pidfile ${PIDFILE} \
+ --exec /usr/bin/pgpool
+
+ eend
+}
+
+stop() {
+ local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} ))
+ ebegin "Stopping pgpool (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 \
+ --pidfile ${PIDFILE} \
+ --retry ${retries}
+
+ eend
+}
+
+reload() {
+ start-stop-daemon --signal HUP \
+ --pidfile ${PIDFILE}
+}
diff --git a/dev-db/pgpool2/files/pgpool_run_paths-3.6.4.patch b/dev-db/pgpool2/files/pgpool_run_paths-3.6.4.patch
new file mode 100644
index 000000000000..d6943d7502e2
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool_run_paths-3.6.4.patch
@@ -0,0 +1,255 @@
+diff -ru a/src/include/parser/pg_config_manual.h b/src/include/parser/pg_config_manual.h
+--- a/src/include/parser/pg_config_manual.h 2017-05-11 05:53:04.000000000 -0400
++++ b/src/include/parser/pg_config_manual.h 2017-07-08 20:28:47.733745889 -0400
+@@ -184,7 +184,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
+
+ /*
+ * This is the default event source for Windows event log.
+diff -ru a/src/include/pcp/pcp_stream.h b/src/include/pcp/pcp_stream.h
+--- a/src/include/pcp/pcp_stream.h 2017-05-11 05:36:01.000000000 -0400
++++ b/src/include/pcp/pcp_stream.h 2017-07-08 20:29:28.613506800 -0400
+@@ -48,6 +48,6 @@
+ extern int pcp_write(PCP_CONNECTION *pc, void *buf, int len);
+ extern int pcp_flush(PCP_CONNECTION *pc);
+
+-#define UNIX_DOMAIN_PATH "/tmp"
++#define UNIX_DOMAIN_PATH "/run/pgpool"
+
+ #endif /* PCP_STREAM_H */
+diff -ru a/src/include/pool.h b/src/include/pool.h
+--- a/src/include/pool.h 2017-05-11 05:53:04.000000000 -0400
++++ b/src/include/pool.h 2017-07-08 20:27:09.330984074 -0400
+@@ -73,16 +73,16 @@
+ #define HBA_CONF_FILE_NAME "pool_hba.conf"
+
+ /* pid file directory */
+-#define DEFAULT_LOGDIR "/tmp"
++#define DEFAULT_LOGDIR "/run/pgpool"
+
+ /* Unix domain socket directory */
+-#define DEFAULT_SOCKET_DIR "/tmp"
++#define DEFAULT_SOCKET_DIR "/run/postgresql"
+
+ /* Unix domain socket directory for watchdog IPC */
+-#define DEFAULT_WD_IPC_SOCKET_DIR "/tmp"
++#define DEFAULT_WD_IPC_SOCKET_DIR "/run/pgpool"
+
+ /* pid file name */
+-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid"
++#define DEFAULT_PID_FILE_NAME "/run/pgpool/pgpool.pid"
+
+ /* status file name */
+ #define STATUS_FILE_NAME "pgpool_status"
+diff -ru a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample
+--- a/src/sample/pgpool.conf.sample 2017-05-11 05:53:04.000000000 -0400
++++ b/src/sample/pgpool.conf.sample 2017-07-08 20:36:28.477717849 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,10 +206,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/var/log/pgpool'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -490,10 +486,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+diff -ru a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave
+--- a/src/sample/pgpool.conf.sample-master-slave 2017-05-11 05:53:04.000000000 -0400
++++ b/src/sample/pgpool.conf.sample-master-slave 2017-07-08 20:37:17.914095382 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,10 +206,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -489,10 +485,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Virtual IP control Setting -
+diff -ru a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication
+--- a/src/sample/pgpool.conf.sample-replication 2017-05-11 05:53:04.000000000 -0400
++++ b/src/sample/pgpool.conf.sample-replication 2017-07-08 20:37:30.384022450 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,10 +206,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -489,10 +485,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+diff -ru a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream
+--- a/src/sample/pgpool.conf.sample-stream 2017-05-11 05:53:04.000000000 -0400
++++ b/src/sample/pgpool.conf.sample-stream 2017-07-08 20:37:44.060609128 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -47,10 +45,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -211,10 +207,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -489,10 +485,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
diff --git a/dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch b/dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch
new file mode 100644
index 000000000000..06c1b3711bd4
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool_run_paths-3.6.5.patch
@@ -0,0 +1,268 @@
+diff -ur a/src/include/parser/pg_config_manual.h b/src/include/parser/pg_config_manual.h
+--- a/src/include/parser/pg_config_manual.h 2017-07-10 04:56:18.000000000 -0400
++++ b/src/include/parser/pg_config_manual.h 2017-07-11 09:38:46.612907898 -0400
+@@ -193,7 +193,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
+
+ /*
+ * This is the default event source for Windows event log.
+Only in b/src/include/parser: pg_config_manual.h.orig
+diff -ur a/src/include/pcp/pcp_stream.h b/src/include/pcp/pcp_stream.h
+--- a/src/include/pcp/pcp_stream.h 2017-07-10 04:39:14.000000000 -0400
++++ b/src/include/pcp/pcp_stream.h 2017-07-11 09:38:46.612907898 -0400
+@@ -48,6 +48,6 @@
+ extern int pcp_write(PCP_CONNECTION *pc, void *buf, int len);
+ extern int pcp_flush(PCP_CONNECTION *pc);
+
+-#define UNIX_DOMAIN_PATH "/tmp"
++#define UNIX_DOMAIN_PATH "/run/pgpool"
+
+ #endif /* PCP_STREAM_H */
+diff -ur a/src/include/pool.h b/src/include/pool.h
+--- a/src/include/pool.h 2017-07-10 04:56:18.000000000 -0400
++++ b/src/include/pool.h 2017-07-11 09:38:46.612907898 -0400
+@@ -73,16 +73,16 @@
+ #define HBA_CONF_FILE_NAME "pool_hba.conf"
+
+ /* pid file directory */
+-#define DEFAULT_LOGDIR "/tmp"
++#define DEFAULT_LOGDIR "/run/pgpool"
+
+ /* Unix domain socket directory */
+-#define DEFAULT_SOCKET_DIR "/tmp"
++#define DEFAULT_SOCKET_DIR "/run/postgresql"
+
+ /* Unix domain socket directory for watchdog IPC */
+-#define DEFAULT_WD_IPC_SOCKET_DIR "/tmp"
++#define DEFAULT_WD_IPC_SOCKET_DIR "/run/pgpool"
+
+ /* pid file name */
+-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid"
++#define DEFAULT_PID_FILE_NAME "/run/pgpool/pgpool.pid"
+
+ /* status file name */
+ #define STATUS_FILE_NAME "pgpool_status"
+diff -ur a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample
+--- a/src/sample/pgpool.conf.sample 2017-07-10 04:56:18.000000000 -0400
++++ b/src/sample/pgpool.conf.sample 2017-07-11 11:05:00.174030914 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,13 +206,13 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/var/log/pgpool'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -493,10 +489,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+diff -ur a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave
+--- a/src/sample/pgpool.conf.sample-master-slave 2017-07-10 04:56:18.000000000 -0400
++++ b/src/sample/pgpool.conf.sample-master-slave 2017-07-11 11:13:57.700698647 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,13 +206,13 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -492,10 +488,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Virtual IP control Setting -
+diff -ur a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication
+--- a/src/sample/pgpool.conf.sample-replication 2017-07-10 04:56:18.000000000 -0400
++++ b/src/sample/pgpool.conf.sample-replication 2017-07-11 11:15:10.613588243 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,13 +206,13 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -492,10 +488,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+diff -ur a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream
+--- a/src/sample/pgpool.conf.sample-stream 2017-07-10 04:56:18.000000000 -0400
++++ b/src/sample/pgpool.conf.sample-stream 2017-07-11 11:15:50.996675811 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -47,10 +45,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -211,13 +207,13 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -492,10 +488,8 @@
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
diff --git a/dev-db/pgpool2/files/pgpool_run_paths-9999.patch b/dev-db/pgpool2/files/pgpool_run_paths-9999.patch
new file mode 100644
index 000000000000..691d6e867ef5
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool_run_paths-9999.patch
@@ -0,0 +1,274 @@
+diff --git a/src/include/parser/pg_config_manual.h b/src/include/parser/pg_config_manual.h
+index d7e153b2..a4c9e87a 100644
+--- a/src/include/parser/pg_config_manual.h
++++ b/src/include/parser/pg_config_manual.h
+@@ -193,7 +193,7 @@
+ * here's where to twiddle it. You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
+
+ /*
+ * This is the default event source for Windows event log.
+diff --git a/src/include/pcp/pcp_stream.h b/src/include/pcp/pcp_stream.h
+index 254b98cb..5883ad31 100644
+--- a/src/include/pcp/pcp_stream.h
++++ b/src/include/pcp/pcp_stream.h
+@@ -48,6 +48,6 @@ extern int pcp_read(PCP_CONNECTION *pc, void *buf, int len);
+ extern int pcp_write(PCP_CONNECTION *pc, void *buf, int len);
+ extern int pcp_flush(PCP_CONNECTION *pc);
+
+-#define UNIX_DOMAIN_PATH "/tmp"
++#define UNIX_DOMAIN_PATH "/run/pgpool"
+
+ #endif /* PCP_STREAM_H */
+diff --git a/src/include/pool.h b/src/include/pool.h
+index d5dd63aa..a3ae197f 100644
+--- a/src/include/pool.h
++++ b/src/include/pool.h
+@@ -73,16 +73,16 @@
+ #define HBA_CONF_FILE_NAME "pool_hba.conf"
+
+ /* pid file directory */
+-#define DEFAULT_LOGDIR "/tmp"
++#define DEFAULT_LOGDIR "/run/pgpool"
+
+ /* Unix domain socket directory */
+-#define DEFAULT_SOCKET_DIR "/tmp"
++#define DEFAULT_SOCKET_DIR "/run/postgresql"
+
+ /* Unix domain socket directory for watchdog IPC */
+-#define DEFAULT_WD_IPC_SOCKET_DIR "/tmp"
++#define DEFAULT_WD_IPC_SOCKET_DIR "/run/pgpool"
+
+ /* pid file name */
+-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid"
++#define DEFAULT_PID_FILE_NAME "/run/pgpool/pgpool.pid"
+
+ /* status file name */
+ #define STATUS_FILE_NAME "pgpool_status"
+diff --git a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample
+index d73c9bca..e95815ba 100644
+--- a/src/sample/pgpool.conf.sample
++++ b/src/sample/pgpool.conf.sample
+@@ -31,10 +31,8 @@ listen_addresses = 'localhost'
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@ pcp_listen_addresses = '*'
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,13 +206,13 @@ syslog_ident = 'pgpool'
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/var/log/pgpool'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -505,10 +501,8 @@ wd_authkey = ''
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+diff --git a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave
+index 612c10a7..ad385ba6 100644
+--- a/src/sample/pgpool.conf.sample-master-slave
++++ b/src/sample/pgpool.conf.sample-master-slave
+@@ -31,10 +31,8 @@ listen_addresses = 'localhost'
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@ pcp_listen_addresses = '*'
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,13 +206,13 @@ syslog_ident = 'pgpool'
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -504,10 +500,8 @@ wd_authkey = ''
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Virtual IP control Setting -
+diff --git a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication
+index f47a7957..bd7ce73e 100644
+--- a/src/sample/pgpool.conf.sample-replication
++++ b/src/sample/pgpool.conf.sample-replication
+@@ -31,10 +31,8 @@ listen_addresses = 'localhost'
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -53,10 +51,8 @@ pcp_listen_addresses = '*'
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -210,13 +206,13 @@ syslog_ident = 'pgpool'
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -504,10 +500,8 @@ wd_authkey = ''
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+diff --git a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream
+index d57226b0..669a31d4 100644
+--- a/src/sample/pgpool.conf.sample-stream
++++ b/src/sample/pgpool.conf.sample-stream
+@@ -31,10 +31,8 @@ listen_addresses = 'localhost'
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '/run/postgresql'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -47,10 +45,8 @@ pcp_listen_addresses = '*'
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '/run/pgpool'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+ listen_backlog_multiplier = 2
+ # Set the backlog parameter of listen(2) to
+@@ -211,13 +207,13 @@ syslog_ident = 'pgpool'
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '/run/pgpool/pgpool.pid'
+ # PID file name
+ # Can be specified as relative to the"
+ # location of pgpool.conf file or
+ # as an absolute path
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/run/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -504,10 +500,8 @@ wd_authkey = ''
+ # Authentication key for watchdog communication
+ # (change requires restart)
+
+-wd_ipc_socket_dir = '/tmp'
++wd_ipc_socket_dir = '/run/pgpool'
+ # Unix domain socket path for watchdog IPC socket
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
diff --git a/dev-db/pgpool2/files/pgpool_run_paths.patch b/dev-db/pgpool2/files/pgpool_run_paths.patch
new file mode 100644
index 000000000000..a1912af15e4c
--- /dev/null
+++ b/dev-db/pgpool2/files/pgpool_run_paths.patch
@@ -0,0 +1,180 @@
+diff -Naurw a/pgpool.conf.sample b/pgpool.conf.sample
+--- a/pgpool.conf.sample 2012-07-19 03:06:21.000000000 -0400
++++ b/pgpool.conf.sample 2012-08-14 07:33:39.200695855 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -43,10 +41,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -176,10 +172,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '@PGPOOL_SOCKETDIR@'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -Naurw a/pgpool.conf.sample-master-slave b/pgpool.conf.sample-master-slave
+--- a/pgpool.conf.sample-master-slave 2012-07-16 22:56:37.000000000 -0400
++++ b/pgpool.conf.sample-master-slave 2012-08-14 07:33:39.201695842 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -43,10 +41,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -176,10 +172,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '@PGPOOL_SOCKETDIR@'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -Naurw a/pgpool.conf.sample-replication b/pgpool.conf.sample-replication
+--- a/pgpool.conf.sample-replication 2012-07-16 22:56:37.000000000 -0400
++++ b/pgpool.conf.sample-replication 2012-08-14 07:33:39.202695830 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -43,10 +41,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -176,10 +172,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '@PGPOOL_SOCKETDIR@'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -Naurw a/pgpool.conf.sample-stream b/pgpool.conf.sample-stream
+--- a/pgpool.conf.sample-stream 2012-07-16 22:56:37.000000000 -0400
++++ b/pgpool.conf.sample-stream 2012-08-14 07:33:39.203695818 -0400
+@@ -31,10 +31,8 @@
+ port = 9999
+ # Port number
+ # (change requires restart)
+-socket_dir = '/tmp'
++socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -43,10 +41,8 @@
+ pcp_port = 9898
+ # Port number for pcp
+ # (change requires restart)
+-pcp_socket_dir = '/tmp'
++pcp_socket_dir = '@PGSQL_SOCKETDIR@'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+@@ -176,10 +172,10 @@
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '@PGPOOL_SOCKETDIR@'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+diff -Naurw a/pool.h b/pool.h
+--- a/pool.h 2012-07-02 00:09:18.000000000 -0400
++++ b/pool.h 2012-08-14 07:26:56.005764702 -0400
+@@ -61,13 +61,13 @@
+ #define HBA_CONF_FILE_NAME "pool_hba.conf"
+
+ /* pid file directory */
+-#define DEFAULT_LOGDIR "/tmp"
++#define DEFAULT_LOGDIR "@PGPOOL_SOCKETDIR@"
+
+ /* Unix domain socket directory */
+-#define DEFAULT_SOCKET_DIR "/tmp"
++#define DEFAULT_SOCKET_DIR "@PGSQL_SOCKETDIR@"
+
+ /* pid file name */
+-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid"
++#define DEFAULT_PID_FILE_NAME "@PGPOOL_SOCKETDIR@/pgpool.pid"
+
+ /* status file name */
+ #define STATUS_FILE_NAME "pgpool_status"
diff --git a/dev-db/pgpool2/metadata.xml b/dev-db/pgpool2/metadata.xml
new file mode 100644
index 000000000000..7414c47471c7
--- /dev/null
+++ b/dev-db/pgpool2/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <use>
+ <flag name="memcached">Use memcached for query caching.</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/pgpool2/pgpool2-3.5.2.ebuild b/dev-db/pgpool2/pgpool2-3.5.2.ebuild
new file mode 100644
index 000000000000..f5c656a3a1aa
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-3.5.2.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${PN/2/-II}-${PV}"
+
+inherit eutils user
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ dev-db/postgresql:=
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:= )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser pgpool -1 -1 -1 postgres
+
+ # We need the postgres user as well so we can set the proper
+ # permissions on the sockets without getting into fights with
+ # PostgreSQL's initialization scripts.
+ enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/pgpool2-3.5.0-path-fix.patch"
+
+ local pg_config_manual="$(pg_config --includedir)/pg_config_manual.h"
+ local pgsql_socket_dir=$(grep DEFAULT_PGSOCKET_DIR "${pg_config_manual}" | \
+ sed 's|.*\"\(.*\)\"|\1|g')
+ local pgpool_socket_dir="$(dirname $pgsql_socket_dir)/pgpool"
+
+ sed "s|@PGSQL_SOCKETDIR@|${pgsql_socket_dir}|g" \
+ -i src/sample/pgpool.conf.sample* src/include/pool.h || die
+
+ sed "s|@PGPOOL_SOCKETDIR@|${pgpool_socket_dir}|g" \
+ -i src/sample/pgpool.conf.sample* src/include/pool.h || die
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ emake
+
+ emake -C src/sql
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation
+ dodoc NEWS TODO
+ use doc && dohtml -r doc/*
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin doc/{pgpool_remote_start,basebackup.sh}
+ insinto "/usr/share/${PN}"
+ doins doc/recovery.conf.sample
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgpool2/pgpool2-3.5.5.ebuild b/dev-db/pgpool2/pgpool2-3.5.5.ebuild
new file mode 100644
index 000000000000..206325ee553c
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-3.5.5.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${PN/2/-II}-${PV}"
+
+inherit eutils user
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ dev-db/postgresql:=
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:= )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser pgpool -1 -1 -1 postgres
+
+ # We need the postgres user as well so we can set the proper
+ # permissions on the sockets without getting into fights with
+ # PostgreSQL's initialization scripts.
+ enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/pgpool2-3.5.0-path-fix.patch"
+
+ local pg_config_manual="$(pg_config --includedir)/pg_config_manual.h"
+ local pgsql_socket_dir=$(grep DEFAULT_PGSOCKET_DIR "${pg_config_manual}" | \
+ sed 's|.*\"\(.*\)\"|\1|g')
+ local pgpool_socket_dir="$(dirname $pgsql_socket_dir)/pgpool"
+
+ sed "s|@PGSQL_SOCKETDIR@|${pgsql_socket_dir}|g" \
+ -i src/sample/pgpool.conf.sample* src/include/pool.h || die
+
+ sed "s|@PGPOOL_SOCKETDIR@|${pgpool_socket_dir}|g" \
+ -i src/sample/pgpool.conf.sample* src/include/pool.h || die
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ emake
+
+ emake -C src/sql
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation
+ dodoc NEWS TODO
+ use doc && dohtml -r doc/*
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin doc/{pgpool_remote_start,basebackup.sh}
+ insinto "/usr/share/${PN}"
+ doins doc/recovery.conf.sample
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgpool2/pgpool2-3.6.1.ebuild b/dev-db/pgpool2/pgpool2-3.6.1.ebuild
new file mode 100644
index 000000000000..644dc65245e6
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-3.6.1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${PN/2/-II}-${PV}"
+
+inherit eutils user
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ dev-db/postgresql:=
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:= )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser pgpool -1 -1 -1 postgres
+
+ # We need the postgres user as well so we can set the proper
+ # permissions on the sockets without getting into fights with
+ # PostgreSQL's initialization scripts.
+ enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/pgpool2-3.5.0-path-fix.patch"
+
+ local pg_config_manual="$(pg_config --includedir)/pg_config_manual.h"
+ local pgsql_socket_dir=$(grep DEFAULT_PGSOCKET_DIR "${pg_config_manual}" | \
+ sed 's|.*\"\(.*\)\"|\1|g')
+ local pgpool_socket_dir="$(dirname $pgsql_socket_dir)/pgpool"
+
+ sed "s|@PGSQL_SOCKETDIR@|${pgsql_socket_dir}|g" \
+ -i src/sample/pgpool.conf.sample* src/include/pool.h || die
+
+ sed "s|@PGPOOL_SOCKETDIR@|${pgpool_socket_dir}|g" \
+ -i src/sample/pgpool.conf.sample* src/include/pool.h || die
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ emake
+
+ emake -C src/sql
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation
+ dodoc NEWS TODO
+ use doc && dohtml -r doc/*
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin src/sample/pgpool_remote_start
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgpool2/pgpool2-3.6.4.ebuild b/dev-db/pgpool2/pgpool2-3.6.4.ebuild
new file mode 100644
index 000000000000..cf9cd0abf25d
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-3.6.4.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+POSTGRES_COMPAT=( 9.{2..6} )
+
+inherit postgres-multi
+
+MY_P="${PN/2/-II}-${PV}"
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:* )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ postgres_new_user pgpool
+
+ postgres-multi_pkg_setup
+}
+
+src_prepare() {
+ eapply "${FILESDIR}/pgpool_run_paths-3.6.4.patch"
+
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ postgres-multi_foreach econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
+ --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ # Even though we're only going to do an install for the best slot
+ # available, the extension bits in src/sql need some things outside
+ # of that directory built, too.
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C src/sql
+}
+
+src_install() {
+ # We only need the best stuff installed
+ postgres-multi_forbest emake DESTDIR="${D}" install
+
+ # Except for the extension and .so files that each PostgreSQL slot needs
+ postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation!
+ dodoc NEWS TODO
+ if use doc ; then
+ postgres-multi_forbest emake DESTDIR="${D}" -C doc install
+ fi
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
+ insinto "/usr/share/${PN}"
+ doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgpool2/pgpool2-3.6.5.ebuild b/dev-db/pgpool2/pgpool2-3.6.5.ebuild
new file mode 100644
index 000000000000..6029e61e8832
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-3.6.5.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+POSTGRES_COMPAT=( 9.{2..6} )
+
+inherit postgres-multi
+
+MY_P="${PN/2/-II}-${PV}"
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:* )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ postgres_new_user pgpool
+
+ postgres-multi_pkg_setup
+}
+
+src_prepare() {
+ eapply "${FILESDIR}/pgpool_run_paths-3.6.5.patch"
+
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ postgres-multi_foreach econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
+ --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ # Even though we're only going to do an install for the best slot
+ # available, the extension bits in src/sql need some things outside
+ # of that directory built, too.
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C src/sql
+}
+
+src_install() {
+ # We only need the best stuff installed
+ postgres-multi_forbest emake DESTDIR="${D}" install
+
+ # Except for the extension and .so files that each PostgreSQL slot needs
+ postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation!
+ dodoc NEWS TODO
+ doman doc/src/sgml/man{1,8}/*
+ use doc && dodoc -r doc/src/sgml/html
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
+ insinto "/usr/share/${PN}"
+ doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgpool2/pgpool2-3.6.6.ebuild b/dev-db/pgpool2/pgpool2-3.6.6.ebuild
new file mode 100644
index 000000000000..6029e61e8832
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-3.6.6.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+POSTGRES_COMPAT=( 9.{2..6} )
+
+inherit postgres-multi
+
+MY_P="${PN/2/-II}-${PV}"
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:* )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ postgres_new_user pgpool
+
+ postgres-multi_pkg_setup
+}
+
+src_prepare() {
+ eapply "${FILESDIR}/pgpool_run_paths-3.6.5.patch"
+
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ postgres-multi_foreach econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
+ --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ # Even though we're only going to do an install for the best slot
+ # available, the extension bits in src/sql need some things outside
+ # of that directory built, too.
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C src/sql
+}
+
+src_install() {
+ # We only need the best stuff installed
+ postgres-multi_forbest emake DESTDIR="${D}" install
+
+ # Except for the extension and .so files that each PostgreSQL slot needs
+ postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation!
+ dodoc NEWS TODO
+ doman doc/src/sgml/man{1,8}/*
+ use doc && dodoc -r doc/src/sgml/html
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
+ insinto "/usr/share/${PN}"
+ doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgpool2/pgpool2-9999.ebuild b/dev-db/pgpool2/pgpool2-9999.ebuild
new file mode 100644
index 000000000000..031166c54b9d
--- /dev/null
+++ b/dev-db/pgpool2/pgpool2-9999.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+EGIT_REPO_URI="https://git.postgresql.org/git/pgpool2.git"
+
+POSTGRES_COMPAT=( 9.{2..6} )
+
+inherit git-r3 postgres-multi
+
+DESCRIPTION="Connection pool server for PostgreSQL"
+HOMEPAGE="http://www.pgpool.net/"
+SRC_URI=""
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS=""
+
+IUSE="doc memcached pam ssl static-libs"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ memcached? ( dev-libs/libmemcached )
+ pam? ( sys-auth/pambase )
+ ssl? ( dev-libs/openssl:* )
+"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ !!dev-db/pgpool
+"
+
+pkg_setup() {
+ postgres_new_user pgpool
+
+ postgres-multi_pkg_setup
+}
+
+src_prepare() {
+ eapply "${FILESDIR}/pgpool_run_paths-9999.patch"
+
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myconf
+ use memcached && \
+ myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
+ use pam && myconf+=' --with-pam'
+
+ postgres-multi_foreach econf \
+ --disable-rpath \
+ --sysconfdir="${EROOT%/}/etc/${PN}" \
+ --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
+ --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
+ $(use_with ssl openssl) \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
+
+src_compile() {
+ # Even though we're only going to do an install for the best slot
+ # available, the extension bits in src/sql need some things outside
+ # of that directory built, too.
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C src/sql
+}
+
+src_install() {
+ # We only need the best stuff installed
+ postgres-multi_forbest emake DESTDIR="${D}" install
+
+ # Except for the extension and .so files that each PostgreSQL slot needs
+ postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ # Documentation!
+ dodoc NEWS TODO
+ if use doc ; then
+ postgres-multi_forbest emake DESTDIR="${D}" -C doc install
+ fi
+
+ # Examples and extras
+ # mv some files that get installed to /usr/share/pgpool-II so that
+ # they all wind up in the same place
+ mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
+ into "/usr/share/${PN}"
+ dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
+ insinto "/usr/share/${PN}"
+ doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
+
+ # One more thing: Evil la files!
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-db/pgrouting/Manifest b/dev-db/pgrouting/Manifest
new file mode 100644
index 000000000000..8a8528766ec8
--- /dev/null
+++ b/dev-db/pgrouting/Manifest
@@ -0,0 +1,8 @@
+AUX no-contrib-when-use-extension.patch 3077 SHA256 7d467aeb6f7701c4aff0e2034d28d7314152f7c654da547593260542533b7867 SHA512 be0e5ad3fe44c8138e44ee61744fb57e9d759cc066619bc0e2d1758d26ef075b88cb52ccea6b6f2e2b5af7e0d5db982a0da0762c54dabccf9f71116ffbad87f4 WHIRLPOOL 5693233ba778f4ed0284649b749ed422fc9832b047f31aa644b7f9d24218e59e513474897a5c4745e6b9f96b118ffea5402bf305377d60f3c68b1e1fa053a196
+DIST pgrouting-2.0.0.tar.gz 3765933 SHA256 606309e8ece04abec062522374b48179c16bddb30dd4c5080b89a4298e8d163b SHA512 4a74cc1ce1bbbb8d95ae2aabc712e30c97e0418b1e4f28a255ecd9e57577bd7081a52e6e64a63cb06c9ca659271273b37bdbefb94d49e69b9c2ce45e96911884 WHIRLPOOL ce7492fe1512f7829bd887a7acaadc6c276719fc7e00ceb68a702a2476a9464c83bf929ef78381c8d36a6575dee21587c204f798511e1430731064c2c48a0815
+DIST pgrouting-2.5.0.tar.gz 7157856 SHA256 2c97df865484bf4e4e6f059b535b63bbe64534076b9d0c4bdd494f916fa24e9d SHA512 663dd5f5133d0bf1bbf7c35480c644ba848e65259023a0ef7f31b813b8ed99a4e2cfb813d870de7550e98ca1f8b0255aa28b2c948d13e8975af9f0d19f820784 WHIRLPOOL 0b9236414efd3b07e12dce1d4239151593212c2baae398b2b75e31e2ad09aa1f1fdb0d59471da716ae13ceef7b65fb9594b3090ecff0c1d2cab0a4c73177aae4
+EBUILD pgrouting-2.0.0.ebuild 2283 SHA256 44bfe89cfcb6da5b760b130154825e7e176b8dcb2245a88c9e7a1089ba6d9e80 SHA512 51ee8a469d30b32df77026e51fa4db70d9c4ad4334c54ed7447c52deba008524b45a56a594825071cc64a0bfb39a919c991ffe3569eca3bb4a79c4e5ff1501e9 WHIRLPOOL 878143c567f379ad56022dc5323da7bc44a3dff2c6d2343dc97842f3eb2cdd89166226b845b32c2f6c2a577a9470b03ca7a88648a427c57d974bb2a34423b33e
+EBUILD pgrouting-2.5.0.ebuild 2172 SHA256 b5bc421fe7db178554de14b6606d82e4b07c79f2b68d86f961f2beaee547dadb SHA512 23c8b4a82c36958f63bf1cdcfb1e6983efe87db16f0a8e3f4154bb3a4ad2fc0ac2fddffefb3082680b6f9ab76fdf096d5988d00ac49b292f6fee1ec4a2c8cac5 WHIRLPOOL 5026be5df7f1fb8d474565683e6271f3dd03af09f7e12fe30804430fca4530e8eeda99304c3376ffb77683edf139b4dda4e4fc40a34d50d0acc13ec343b2c9a5
+MISC ChangeLog 2477 SHA256 0147b33c423abd244af322201c85d6bb993c4de924f3c63e66d650b961064e67 SHA512 de630f7523ef252a11f6bd06bd90057c5c441e114644dc8e7b4d4dcfff2e16974684893c0717e4f6a0c76d18f31211a833af5a0b40398946e8e65975d0ec6877 WHIRLPOOL 5be574aae7180e69e3a9ff5719e4207adebdb64479707557c79ad562754f6d1aac52d40930b0621addc92491bc389f3e5b1fb44fb85454f91e5ac5238e3f3020
+MISC ChangeLog-2015 707 SHA256 071c13c8fd86042e118fb522616dff76c131faf151be23ece751cd68890ff818 SHA512 c6b3ed75302fd084dae64d2dacbf988b9586c1fcd4b1538ff24d53254f136441b587627cfeeb8d016a13a6581c5f3fdf59638568653f4b6bcef4d2bc6d36b6c0 WHIRLPOOL 34cf3ac99f2e6ca3d4aa7c4a8e89b0722289347ac57bf583851c967faf661c14df7665659591cc913e204a47a7ef43d31a8189ac4c9127c806df48e903cc43ec
+MISC metadata.xml 534 SHA256 e61242cce9017f54718a022dcb241589cf7d54563138a56e38f0b34a92bf3d86 SHA512 2892a64cf6e8e34e1ede87ddbcbaabd7e66bc5a45c5a8e21b33103af83e1a6a92c665fbfc02af6ae8fa6aec9df6ba340a40d3332d2da557789c95a312439a55f WHIRLPOOL c7bb30f6a809465c571919398eee69d98da6be7fb9d3f648fe59e1da27ee297be6b7599203752073c591e9bae5a621cb4b08f3928903249e29f9b9875279bac7
diff --git a/dev-db/pgrouting/files/no-contrib-when-use-extension.patch b/dev-db/pgrouting/files/no-contrib-when-use-extension.patch
new file mode 100644
index 000000000000..e26af3ef0da3
--- /dev/null
+++ b/dev-db/pgrouting/files/no-contrib-when-use-extension.patch
@@ -0,0 +1,76 @@
+diff -Naur pgrouting-2.0.0.orig/CMakeLists.txt pgrouting-2.0.0/CMakeLists.txt
+--- pgrouting-2.0.0.orig/CMakeLists.txt 2013-09-24 16:38:31.000000000 -0400
++++ pgrouting-2.0.0/CMakeLists.txt 2014-11-07 06:48:11.555026180 -0500
+@@ -170,16 +170,13 @@
+ OUTPUT_VARIABLE SHARE_DIR)
+
+ if(SHARE_DIR)
+- # Always install in "contrib" directory of PostgreSQL
+- set(CONTRIB_DIR "${SHARE_DIR}/contrib/pgrouting-${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}")
+- message(STATUS "Contrib directory for SQL files is set to ${CONTRIB_DIR}")
+-
+ # Install as extension if supported by the version of PostgreSQL
+ if(USE_PG_EXTENSION)
+ set(SHARE_DIR "${SHARE_DIR}/extension")
+ message(STATUS "Extension directory for SQL files is set to ${SHARE_DIR}")
+- #else(USE_PG_EXTENSION)
+- # set(SHARE_DIR "/usr/share/pgrouting")
++ else(USE_PG_EXTENSION)
++ set(CONTRIB_DIR "${SHARE_DIR}/contrib/pgrouting-${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}")
++ message(STATUS "Contrib directory for SQL files is set to ${CONTRIB_DIR}")
+ endif(USE_PG_EXTENSION)
+ else(SHARE_DIR)
+ message(FATAL_ERROR "pg_config --sharedir failed to return a value. Please check your PostgreSQL installation!")
+@@ -347,22 +344,24 @@
+
+ install(FILES ${LIBS_TO_INSTALL} DESTINATION ${LIB_DIR})
+
+-install(FILES
++if(USE_PG_EXTENSION)
++ install(FILES
+ "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql"
+ "${CMAKE_BINARY_DIR}/lib/pgrouting.control"
+ "${CMAKE_BINARY_DIR}/lib/pgrouting_legacy.sql"
+ DESTINATION "${SHARE_DIR}")
+-
+-# The following probably could be done better
+-# The idea is to also have a "pgrouting-x.x" directory in PostgreSQL contrib
+-configure_file("${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql"
++else(USE_PG_EXTENSION)
++ # The following probably could be done better
++ # The idea is to also have a "pgrouting-x.x" directory in PostgreSQL contrib
++ configure_file("${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql"
+ "${CMAKE_BINARY_DIR}/lib/pgrouting.sql" COPYONLY)
+
+-install(FILES
++ install(FILES
+ "${CMAKE_BINARY_DIR}/lib/pgrouting.sql"
+ "${CMAKE_BINARY_DIR}/lib/pgrouting.control"
+ "${CMAKE_BINARY_DIR}/lib/pgrouting_legacy.sql"
+ DESTINATION "${CONTRIB_DIR}")
++endif(USE_PG_EXTENSION)
+
+ # TODO: The following probably should be done better
+ if(WITH_DD)
+@@ -372,12 +371,14 @@
+ configure_file("${PGROUTING_SOURCE_DIR}/src/driving_distance/sql/routing_dd_legacy.sql"
+ "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql" COPYONLY)
+
+- install(FILES
+- "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql"
+- DESTINATION "${SHARE_DIR}")
+-
+- install(FILES
+- "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql"
+- DESTINATION "${CONTRIB_DIR}")
++ if(USE_PG_EXTENSION)
++ install(FILES
++ "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql"
++ DESTINATION "${SHARE_DIR}")
++ else(USE_PG_EXTENSION)
++ install(FILES
++ "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql"
++ DESTINATION "${CONTRIB_DIR}")
++ endif(USE_PG_EXTENSION)
+ endif(WITH_DD)
+
diff --git a/dev-db/pgrouting/metadata.xml b/dev-db/pgrouting/metadata.xml
new file mode 100644
index 000000000000..01cf346d26bd
--- /dev/null
+++ b/dev-db/pgrouting/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <use>
+ <flag name="html">Install HTML formatted documentation</flag>
+ <flag name="drivingdistance">Enable to calculate driving distance</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">pgRouting/pgrouting</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/pgrouting/pgrouting-2.0.0.ebuild b/dev-db/pgrouting/pgrouting-2.0.0.ebuild
new file mode 100644
index 000000000000..7a36fce1799c
--- /dev/null
+++ b/dev-db/pgrouting/pgrouting-2.0.0.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+POSTGRES_COMPAT=( 9.{0,1,2,3,4} )
+
+inherit eutils cmake-utils
+
+DESCRIPTION="pgRouting extends PostGIS and PostgreSQL with geospatial routing functionality."
+HOMEPAGE="http://pgrouting.org/index.html"
+LICENSE="GPL-2 MIT Boost-1.0"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+SRC_URI="https://github.com/pgRouting/pgrouting/archive/v${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
+IUSE="+drivingdistance doc pdf html"
+
+REQUIRED_USE="html? ( doc ) pdf? ( doc )"
+
+RDEPEND="
+ || (
+ dev-db/postgresql:9.4[server]
+ dev-db/postgresql:9.3[server]
+ dev-db/postgresql:9.2[server]
+ dev-db/postgresql:9.1[server]
+ dev-db/postgresql:9.0[server]
+ )
+ >=dev-db/postgis-2.0
+ dev-libs/boost
+ drivingdistance? ( sci-mathematics/cgal )
+"
+
+DEPEND="
+ doc? ( >=dev-python/sphinx-1.1 )
+ pdf? ( >=dev-python/sphinx-1.1[latex] )
+"
+
+# Needs a running psql instance, doesn't work out of the box
+RESTRICT="test"
+
+postgres_check_slot() {
+ if ! declare -p POSTGRES_COMPAT &>/dev/null; then
+ die 'POSTGRES_COMPAT not declared.'
+ fi
+
+# Don't die because we can't run postgresql-config during pretend.
+[[ "$EBUILD_PHASE" = "pretend" \
+ && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0
+
+ local res=$(echo ${POSTGRES_COMPAT[@]} \
+ | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null)
+
+ if [[ "$res" -eq "0" ]] ; then
+ eerror "PostgreSQL slot must be set to one of: "
+ eerror " ${POSTGRES_COMPAT[@]}"
+ return 1
+ fi
+
+ return 0
+}
+
+pkg_pretend() {
+ postgres_check_slot || die
+}
+
+pkg_setup() {
+ postgres_check_slot || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/no-contrib-when-use-extension.patch"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_with drivingdistance DD)
+ $(cmake-utils_use_with doc DOC)
+ $(cmake-utils_use_build doc MAN)
+ $(cmake-utils_use_build html HTML)
+ $(cmake-utils_use_build pdf LATEX)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ local make_opts
+ use doc && make_opts="all doc"
+ cmake-utils_src_make ${make_opts}
+}
+
+src_install() {
+ use doc && doman "${BUILD_DIR}"/doc/man/en/pgrouting.7
+ use html && dohtml -r "${BUILD_DIR}"/doc/html/*
+ use pdf && dodoc "${BUILD_DIR}"/doc/latex/en/*.pdf
+
+ dodoc README* VERSION
+
+ cmake-utils_src_install
+}
diff --git a/dev-db/pgrouting/pgrouting-2.5.0.ebuild b/dev-db/pgrouting/pgrouting-2.5.0.ebuild
new file mode 100644
index 000000000000..79e1b0aa8f7f
--- /dev/null
+++ b/dev-db/pgrouting/pgrouting-2.5.0.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+POSTGRES_COMPAT=( 9.{4,5,6} 10 )
+
+inherit eutils cmake-utils
+
+DESCRIPTION="pgRouting extends PostGIS and PostgreSQL with geospatial routing functionality."
+HOMEPAGE="http://pgrouting.org/index.html"
+LICENSE="GPL-2 MIT Boost-1.0"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+SRC_URI="https://github.com/pgRouting/pgrouting/archive/v${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
+IUSE="+drivingdistance doc pdf html"
+
+REQUIRED_USE="html? ( doc ) pdf? ( doc )"
+
+RDEPEND="
+ || (
+ dev-db/postgresql:10[server]
+ dev-db/postgresql:9.6[server]
+ dev-db/postgresql:9.5[server]
+ dev-db/postgresql:9.4[server]
+ )
+ >=dev-db/postgis-2.0
+ dev-libs/boost
+ drivingdistance? ( sci-mathematics/cgal )
+"
+
+DEPEND="
+ doc? ( >=dev-python/sphinx-1.1 )
+ pdf? ( >=dev-python/sphinx-1.1[latex] )
+"
+
+# Needs a running psql instance, doesn't work out of the box
+RESTRICT="test"
+
+postgres_check_slot() {
+ if ! declare -p POSTGRES_COMPAT &>/dev/null; then
+ die 'POSTGRES_COMPAT not declared.'
+ fi
+
+# Don't die because we can't run postgresql-config during pretend.
+[[ "$EBUILD_PHASE" = "pretend" \
+ && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0
+
+ local res=$(echo ${POSTGRES_COMPAT[@]} \
+ | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null)
+
+ if [[ "$res" -eq "0" ]] ; then
+ eerror "PostgreSQL slot must be set to one of: "
+ eerror " ${POSTGRES_COMPAT[@]}"
+ return 1
+ fi
+
+ return 0
+}
+
+pkg_pretend() {
+ postgres_check_slot || die
+}
+
+pkg_setup() {
+ postgres_check_slot || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_with drivingdistance DD)
+ $(cmake-utils_use_with doc DOC)
+ $(cmake-utils_use_build doc MAN)
+ $(cmake-utils_use_build html HTML)
+ $(cmake-utils_use_build pdf LATEX)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ local make_opts
+ use doc && make_opts="all doc"
+ cmake-utils_src_make ${make_opts}
+}
+
+src_install() {
+ use doc && doman "${BUILD_DIR}"/doc/man/en/pgrouting.7
+ use html && dohtml -r "${BUILD_DIR}"/doc/html/*
+ use pdf && dodoc "${BUILD_DIR}"/doc/latex/en/*.pdf
+
+ dodoc README* VERSION
+
+ cmake-utils_src_install
+}
diff --git a/dev-db/pgtap/Manifest b/dev-db/pgtap/Manifest
new file mode 100644
index 000000000000..82f257b3e642
--- /dev/null
+++ b/dev-db/pgtap/Manifest
@@ -0,0 +1,8 @@
+AUX pgtap-pg_config_override.patch 1045 SHA256 653c016a7baba2539e81eeb38eb40eab8f986e920171c4b5df07b5b766103ef9 SHA512 ac84f139d910a9f6394d9ceb8430b8f7c5768f9792ffad1b9b265ef4de45fc9d08b0961d04026a9a44c0c161f14e77acca52807191b3e07821a970a511a935fc WHIRLPOOL c432ed431868bc2b46b52c711eaf0da4a5f4b90607693a8c59bcf02f50c01dc9d98db092bd380deeeff3ad1c1f43647239eb75b1a5d21b285b0f3f4b66243b07
+DIST pgtap-0.93.0.zip 219355 SHA256 d1fa168b5d089d031552103c985d1f4b681659ece2f976d27c070ad26f6c1d4c SHA512 6165f8bd107168a3955c3ec4c63277ce9fce31d7c375fdfe13cb31b7df71cb9aae4b20a1c2d961fba97e3ae207b45b8daf9174f0701a220e52f4ffb53dddea94 WHIRLPOOL 2352e71e004ad9486d6a5ed3b6c5967613caa06ea657af7394ea37249f16f266e611b64d3d2106bc737bf10e9810613b67f9eb79faadc578ca3ff16cd132a263
+DIST pgtap-0.97.0.zip 260089 SHA256 a29f739e5973b19d83e0448f62e5529d11e8c71546d57e80791b172140c9a76a SHA512 8d1a87b6060e28150c580383b0151553dc9c588145a3888d1b2313770283c327bb50820eee3db8cfa5d21e4664272c1538cd3784908fd042c7e788b4558a0df5 WHIRLPOOL 8f3c6114b3dac8c349e72a1608607518a44fa8f6a3ae67fca7213d4d96a63e8c44f6fd4d10ec768376af8f654641094c1e4cc7077fdb159292ac8f7cced1535d
+EBUILD pgtap-0.93.0.ebuild 1094 SHA256 63165ec9507cfcb8092e8e8360a038885363e3e5559aec8c6038b75115118880 SHA512 3669d55eb1bd4a9fa30e38b2699f77ebe0c4bdd77daec4af8906188031bab8b07274dccb6a0d90ce627ab23d648bfc80a5806391c2366cfae20e2eb3facdeeb7 WHIRLPOOL 34b521c74dbb51bc540c0050cf795d28104589d85c69732c4d38f3b2968919b841cad4fe131da7e928a182568e712dc642f875f95a5eb88a610cd33d3541190c
+EBUILD pgtap-0.97.0.ebuild 467 SHA256 eb25d080267db6274d6a475c9f968068b860d60141938f59edfd9f84d3f5297e SHA512 803a340ea66b873dd932151def432ea435b28774dff15b9470165035f72def9d78a233caefd5b6f672ea5e953e11289368c5f33473bced4e1fd1d2b8540d2299 WHIRLPOOL 91fba7266e0e4fed56fe250ab339dae4938df21bc1e77616cd5acaf4f462d3983f5f5b455db3589c2aa1033ab26cd968fbbfd3f4bc98bf5e415b53b39d5787de
+MISC ChangeLog 2460 SHA256 9619dff0a575392a4d0c59d9dc8892c524dc1e81505989b55373bc1e84dfe1ac SHA512 bcef5d3236f054a888015d58e114f995845f0fbc40ecbd76e50449a7c9c8b1681d7853f386c41c336b7ed38b608d049bb5749f883546fdeac8d869d516e88133 WHIRLPOOL 18e083d80ed799455f129c99bfba670b1d185d171f71681018baa75685727244548c5a184d78d8ebf38dc2423b33dc830b63154c45404177692759569464e54c
+MISC ChangeLog-2015 805 SHA256 6e6844879b5781445c29c14f44ab7582ebc28ed3d67d9860fec13d82c27ce481 SHA512 0a49d597fa66169622d985250921b4e71e9d5250223195694f8265a10d89f169ffb851bdf681ba9f7e8b7e0a124cce6f5e359328ba0229686d2eeb955155dcaf WHIRLPOOL 84d2efc0dd92352fd856919abfdd6834ac347f6ad0252a8c3ca7c6c7d7093fbb39b9e70481cb2f5f22742810196ca8e573e3c0fae596d1a67a11e0eaf8ce64e3
+MISC metadata.xml 628 SHA256 10fdb51b6e53e5de5648719f8c9412e63fc4b2226f923fb18d943c8945540f0e SHA512 1c06c14ea5af9248950e6c10ab877b0725c4885082211db94b8a195fdf0dd115dc584a325655b7155895ec4382008e03511aa238d43179310fbe3dc835f5270a WHIRLPOOL eee3aed923a5ae9fe51fdfdd064adf4d701ae3e014f132772d528d89aea3a0654683946d408f9881ffa71f8996d44c0f825373373e6959ba5130514082a90f0f
diff --git a/dev-db/pgtap/files/pgtap-pg_config_override.patch b/dev-db/pgtap/files/pgtap-pg_config_override.patch
new file mode 100644
index 000000000000..2034b233f00c
--- /dev/null
+++ b/dev-db/pgtap/files/pgtap-pg_config_override.patch
@@ -0,0 +1,25 @@
+diff -Naurw pgtap-0.93.0.orig/Makefile pgtap-0.93.0/Makefile
+--- pgtap-0.93.0.orig/Makefile 2013-01-28 20:14:20.000000000 +0000
++++ pgtap-0.93.0/Makefile 2013-03-30 16:02:45.077880109 +0000
+@@ -9,14 +9,15 @@
+ DOCS = doc/pgtap.mmd
+ REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
+ REGRESS_OPTS = --inputdir=test --load-language=plpgsql
++ifndef PG_CONFIG
+ PG_CONFIG = pg_config
++endif
+
+ ifdef NO_PGXS
+ top_builddir = ../..
+ PG_CONFIG := $(top_builddir)/src/bin/pg_config/pg_config
+ else
+ # Run pg_config to get the PGXS Makefiles
+-PG_CONFIG = pg_config
+ PGXS := $(shell $(PG_CONFIG) --pgxs)
+ endif
+
+@@ -145,4 +146,3 @@
+ MultiMarkdown.pl doc/pgtap.mmd > doc/pgtap.html
+ ./tocgen doc/pgtap.html 2> doc/toc.html
+ perl -MPod::Simple::XHTML -E "my \$$p = Pod::Simple::XHTML->new; \$$p->html_header_tags('<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">'); \$$p->strip_verbatim_indent(sub { (my \$$i = \$$_[0]->[0]) =~ s/\\S.*//; \$$i }); \$$p->parse_from_file('`perldoc -l pg_prove`')" > doc/pg_prove.html
+-
diff --git a/dev-db/pgtap/metadata.xml b/dev-db/pgtap/metadata.xml
new file mode 100644
index 000000000000..06a2adf57216
--- /dev/null
+++ b/dev-db/pgtap/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>titanofold@gentoo.org</email>
+ <name>Aaron W. Swenson</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <longdescription>
+ pgTAP is a suite of database functions that make it easy to write
+ TAP-emitting unit tests in psql scripts or xUnit-style test functions.
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-db/pgtap/pgtap-0.93.0.ebuild b/dev-db/pgtap/pgtap-0.93.0.ebuild
new file mode 100644
index 000000000000..1e2fc503e373
--- /dev/null
+++ b/dev-db/pgtap/pgtap-0.93.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Unit testing for PostgreSQL"
+HOMEPAGE="http://pgtap.org/"
+SRC_URI="http://api.pgxn.org/dist/${PN}/${PV}/${P}.zip"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="amd64"
+IUSE=""
+
+DEPEND=">=dev-db/postgresql-8.4
+ dev-perl/TAP-Parser-SourceHandler-pgTAP
+"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/pgtap-pg_config_override.patch"
+
+ local pgslots=$(eselect --brief postgresql list)
+ local pgslot
+ for pgslot in ${pgslots} ; do
+ mkdir -p "${WORKDIR}/${pgslot}"
+ cp -R "${S}" "${WORKDIR}/${pgslot}"
+ done
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ local pgslots=$(eselect --brief postgresql list)
+ local pgslot
+ for pgslot in ${pgslots} ; do
+ cd "${WORKDIR}/${pgslot}/${P}"
+ PG_CONFIG="pg_config${pgslot//.}" emake
+ done
+}
+
+src_install() {
+ local pgslots=$(eselect --brief postgresql list)
+ local pgslot
+ for pgslot in ${pgslots} ; do
+ cd "${WORKDIR}/${pgslot}/${P}"
+ PG_CONFIG="pg_config${pgslot//.}" emake DESTDIR="${D}" install
+ done
+}
diff --git a/dev-db/pgtap/pgtap-0.97.0.ebuild b/dev-db/pgtap/pgtap-0.97.0.ebuild
new file mode 100644
index 000000000000..ac184400535a
--- /dev/null
+++ b/dev-db/pgtap/pgtap-0.97.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+POSTGRES_COMPAT=( 9.{2..6} )
+
+inherit postgres-multi
+
+DESCRIPTION="Unit testing for PostgreSQL"
+HOMEPAGE="http://pgtap.org/"
+SRC_URI="http://api.pgxn.org/dist/${PN}/${PV}/${P}.zip"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="${POSTGRES_DEP}
+ dev-perl/TAP-Parser-SourceHandler-pgTAP
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ :
+}
diff --git a/dev-db/pgxnclient/Manifest b/dev-db/pgxnclient/Manifest
new file mode 100644
index 000000000000..734b7d5c0b94
--- /dev/null
+++ b/dev-db/pgxnclient/Manifest
@@ -0,0 +1,7 @@
+DIST pgxnclient-1.2.1.tar.gz 87275 SHA256 8e3022bc960aa5d5fc7d4c564786087693a1a99f15e025ad920fc0aa378e1d67 SHA512 3fa864b1ebb5dedaf75515b5efe4c453f02acff558f7b82d2648da62e58c93e050049a7688171a69593784d9963bb62f4ad3674d526284554dbeb4f4a4ea1dbf WHIRLPOOL f0e5df1e841a8da59a0fed16643e30120c188813c69307e2db6055c25d4298368a56c89f08dd54edbb6c6dbc1a8676a462fc9fe1b7982c8334d2c6af040d0d99
+DIST pgxnclient-1.2.tar.gz 86436 SHA256 ad3768d1ed83ea3af8a3ad9abf11fd164dbdeb355371819bce072dc581f43c42 SHA512 d677f8d5346caf4de5d7e0d4e4031b8bdd932e343af7fc33e8895ebe51b1e9e6a11d7300d9e98ddc10242854f7d39c0a4196f41938e42f0b0e5158454e386deb WHIRLPOOL fcb76ce45b4898a56f2ee99317874b1cbecafc67d37d1edabc55c9f6bea644d757ac1ab396fc5f3d0a8d98040e2f70211d3a712a8219c1ba2da23c4fa22b41fa
+EBUILD pgxnclient-1.2-r1.ebuild 773 SHA256 f3dbbddd6a383cb8ccb98dd5ff28cc8b416f03068b8cf28139be8d823cc5c2c2 SHA512 c060a5502382177919a0cdc5e085d2903afd3c9f431e5010540d959ced11ec73c39683871fc66c01918c4284932dfaa663bfc4031c4820ed3cd9ddd6118ebe8f WHIRLPOOL 33b1d7495a732e254a6610b41d5a23ab866c7c64448b822383d0ca86130687d2fcca9e262e373d7f0629e27447d4d011fd9f1b7d7df3427511451d81e8d2318c
+EBUILD pgxnclient-1.2.1.ebuild 781 SHA256 49e920e4018d61e5954af369058f21b3036069f4eb08beb58665ae05697723a7 SHA512 a7f8aa7feaf4b252603451a25bf62d11fe7306ee07e56b7896b1ad3f838adb9fe15adf1ec18504c5324dfc5cc5ac66b2db4ea0bb89948b3a9d734d5cfe2a6e25 WHIRLPOOL f853a0879fd57758a6915005c7130aa502122a444b19f10604256ff18a96f3e5d349490fbd8ffebe3ac68219cbea97ff07a72e597d18cfeba96be0980b4b2376
+MISC ChangeLog 2827 SHA256 101baddc70a92f4bdf8fef017fbb5f9054ca129eb2e394ccf236de0aca422890 SHA512 976b71073d5d62bae219984835ac8a39b9d573ab6540313100168be84ae66aaec28eaf964505372c5ceffb2083b8d8c9ee686ef500f3d6c2029661f8ac7d7334 WHIRLPOOL ea46b446f6718d8ac2b9d01af5edbb56cebaa25af7f17eb57152ef2c2223daa58098705e7ef3775389d30612c0709eaf96bd782855c6c2eba9114ecc2da9ea03
+MISC ChangeLog-2015 1119 SHA256 96a0e631e525e58ccb6b09235a27c701aa66ebb03f666f0b326c8d8d36d0eda4 SHA512 e2578125cca5669fb684ed074f71ec8eac12087d3c70831bdb37e86a9d3460907a670ec90ca89722f6e57080f76c158b2790763950e6b83c5016e34fc63f6403 WHIRLPOOL ff965d34a47ad15e69b4754fc1d35b33289d7c0dcde5f28f8d290529ade5b34ea80944b6d4aec06bcff920262cdc6bb761e8837e507c357b8c6918f70ac3153b
+MISC metadata.xml 477 SHA256 fb62015a473a1d86a96dbf11418e5448bfc1c47a0a0d0ce143eefb5a6e395170 SHA512 63a1019650d2bfec1f0dab904cabd0de847f5d7cb5ad62dd04ca93a6cf7c25ef2a727a8dc0700a00958b841f7ffaa2c99f608b4cb1872a31a1dc920d0834d22d WHIRLPOOL 61b0e21ae38c227d2c4eecd298ea6bbb49c15a272117424238ca0af4db8c421fb2fafc45b49e557e8367abce020c8b1379da42ab0961662b44687f5c0a81b2ec
diff --git a/dev-db/pgxnclient/metadata.xml b/dev-db/pgxnclient/metadata.xml
new file mode 100644
index 000000000000..dc934da28afe
--- /dev/null
+++ b/dev-db/pgxnclient/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">pgxnclient</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/pgxnclient/pgxnclient-1.2-r1.ebuild b/dev-db/pgxnclient/pgxnclient-1.2-r1.ebuild
new file mode 100644
index 000000000000..184b5fd16ecb
--- /dev/null
+++ b/dev-db/pgxnclient/pgxnclient-1.2-r1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4} )
+
+inherit distutils-r1
+
+DESCRIPTION="PostgreSQL Extension Network Client"
+HOMEPAGE="http://pgxnclient.projects.postgresql.org/ https://pypi.python.org/pypi/${PN}"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="test"
+
+RDEPEND=">=dev-db/postgresql-9.1[server]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+python_test() {
+ # suite written onlt for py2
+ pushd ${PN} > /dev/null
+ if ! python_is_python3; then
+ PYTHONPATH=../ "${PYTHON}" -m unittest discover || die "tests failed"
+ fi
+ popd > dev/null
+}
diff --git a/dev-db/pgxnclient/pgxnclient-1.2.1.ebuild b/dev-db/pgxnclient/pgxnclient-1.2.1.ebuild
new file mode 100644
index 000000000000..1abdafe1a352
--- /dev/null
+++ b/dev-db/pgxnclient/pgxnclient-1.2.1.ebuild
@@ -0,0 +1,29 @@
+# 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,3_5,3_6} )
+
+inherit distutils-r1
+
+DESCRIPTION="PostgreSQL Extension Network Client"
+HOMEPAGE="http://pgxnclient.projects.postgresql.org/ https://pypi.python.org/pypi/${PN}"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="test"
+
+RDEPEND=">=dev-db/postgresql-9.1[server]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+python_test() {
+ # suite written onlt for py2
+ pushd ${PN} > /dev/null
+ if ! python_is_python3; then
+ PYTHONPATH=../ "${PYTHON}" -m unittest discover || die "tests failed"
+ fi
+ popd > dev/null
+}
diff --git a/dev-db/phpmyadmin/Manifest b/dev-db/phpmyadmin/Manifest
new file mode 100644
index 000000000000..aaa94cc8583f
--- /dev/null
+++ b/dev-db/phpmyadmin/Manifest
@@ -0,0 +1,12 @@
+AUX postinstall-en-3.1.txt 1160 SHA256 0fa47a49b9c5604339335d36ce9d1506a1cd07644d219fb7f35e2e4432fa8dbf SHA512 7b50ab9f9e3a828bd9bff600550ea97712c28804467ab5900a52710d4adb0581fe33155a965dd3956fcd36cc153b1a18a1f001d88ac52d70c8288faf695f01ec WHIRLPOOL 5b548fd9d41ca794f74936ce8ceda15c2c410cbc8d383c3376009a8936e47bc4d350c520ece1ff1eb20b0ac899f84fa513a185db5c255db362b7f3ee0b8f69ef
+DIST phpMyAdmin-4.0.10.20-all-languages.tar.xz 4323896 SHA256 16595dd62c8256caa999beb722d793674da86054e117b9968f82352d84233b24 SHA512 e1d8b8a503eaa19a090d24d5ad011241aab06c2767138424d875edd82a868b4ebcdf5bba154b7eefef23b41d1949dcd021defe17e9047d0bf5fcfd0d6a5f4d27 WHIRLPOOL 80983dbeeca9cf1a279c35c652f4c5c0f239ba2aa9456a0707a1686b1f0322a949cd42fa8d949efce1d9e849ee3030c8487faccc79c1f65458ac73b205f119a6
+DIST phpMyAdmin-4.7.0-all-languages.tar.xz 7600296 SHA256 6378d1f45f5356fda2d18a923c56a495e03bc1e7694e7b7c004dd688d2178f90 SHA512 03f3b56d3fed846e8e27e38a1bf32175b267a3cc2784ee499b64a48b6a37f0352302a9c150e1db1c99f633aabd8a373a834ad7ab2b694146b0ac13dd05bd27e3 WHIRLPOOL b7c65a1e47ef0358057052ca9d5b0a4a40f17157ba8b711b6c54b3e3a244da50b23840f67def30c13fabd0b4be7b03785dbbd69a31fa27cece19f256acbf4af2
+DIST phpMyAdmin-4.7.1-all-languages.tar.xz 5665344 SHA256 f94ed0fc5df38e049746e40852135bf55b9af0fd9fcee07f175919c463ad58a5 SHA512 583ad8c8ee871fedd4df79e49845554f2f6182a343439fff8f91f61428964a85f3305590792096ede95a2ea675f065a4a4cdee31d365c03d2cc3aa721b0aeb6e WHIRLPOOL 9fbb781dac0087eb2100e213f2e4c2048a0358f0272fa4f05105ac7fa50333e617376f9580adcc11e8c8d269b6b8cc7dbb4d7c6c0050f9224fa4892261315c49
+DIST phpMyAdmin-4.7.2-all-languages.tar.xz 6270116 SHA256 4f5e474d826ae2fcb704aaade9422592595a2b41046b13e625aa3d00d4d00eee SHA512 ed0b26fd53d1a7d77dcaac98c8570282855b967aee23814fb61737484ea899ede7d900fd0baa27c20fa8ae9a55009db6037b1be42bd6a24d471d672f138d1761 WHIRLPOOL ab3eb4f8b970b53decf63bb6abeab25fbe76103361d04918346f81aabfac236fede780cd94348cd4552952b20db1ea67e8e6eee8e06cc7a6fb091f6ad73df246
+EBUILD phpmyadmin-4.0.10.20.ebuild 1562 SHA256 80ebe9eef53a85de9f0893e86c863f5bdfc6d6472944a403b9e253b0a37c0197 SHA512 e15e47f37a54090574b4c4554ff295fb9ad73543aebed5718e28575c238b3e59c393b091eb34ddccc04be8297b08deb442d27e12c595f846d8810aa50561af64 WHIRLPOOL f1a7ce64d675158d0cac194e72739997b34c1a20a9406ab1861260b508a79cf989592389c596bb9a62f7ddfd8cf496a08fec2820e1aca8b0966b5fee94b4cde2
+EBUILD phpmyadmin-4.7.0.ebuild 1568 SHA256 4ff27f93c08896592b5bd4d5d5d5ca7e872427a8b4daa644e9e0ae226c381529 SHA512 5dfac57cc1535df8edb5cb2ff9b37ef0336ca199d306e0adc9522b80172f19decba837f9314b8aa8dc5981eb4bb6a13e235022a7cb788e65ba4c136b13bcbb0f WHIRLPOOL 091d6c85718a4e68abd0179dbc334ecd8ed5b5af7118cc573eefcdad288779a8f60e6c6455f12ee2c965254608864475d781b986ade6d5e753b64bb44905bcd5
+EBUILD phpmyadmin-4.7.1.ebuild 1575 SHA256 66b32471246093710838ea502c6204226ce5160bf1bad0bfb618d093f0811f17 SHA512 9144b7827cc47c7d0b016759b02dceda26f29d5e4b595ea4df30f0fedb85b0a431e80f252450aaa85eb3de2cdaaff49cde3b0a18c2147f8de0ea85f6576db800 WHIRLPOOL 024c7309fcbc1a5bef08808a5c6a1f3cf239f7230e3cae21ec6085873f7466535cc1e4158d424561ac487cd696d3d2c6ccc8e970152c05fd735390c38776fe1f
+EBUILD phpmyadmin-4.7.2.ebuild 1575 SHA256 66b32471246093710838ea502c6204226ce5160bf1bad0bfb618d093f0811f17 SHA512 9144b7827cc47c7d0b016759b02dceda26f29d5e4b595ea4df30f0fedb85b0a431e80f252450aaa85eb3de2cdaaff49cde3b0a18c2147f8de0ea85f6576db800 WHIRLPOOL 024c7309fcbc1a5bef08808a5c6a1f3cf239f7230e3cae21ec6085873f7466535cc1e4158d424561ac487cd696d3d2c6ccc8e970152c05fd735390c38776fe1f
+MISC ChangeLog 20746 SHA256 14f3ab395cad53b14b52b6744032d114082a72184ceef4cc39403f37a9fd864a SHA512 f8a8c46e218ef51c88a15f20441b372d58c58a240b6523d06460ee9609737455e10ba7000af403b1dafa172792dbaddb7b8f5d5f6e4101aa0964c6fb98f3baab WHIRLPOOL 6f41f0031f121f460fdc1938ca77176b901eddf79fe9d2c06c1a0d50554a4f28a8fa830006b56e8d98f4f0fb9af84047fa641bf8afb434c5dbf9ae92cb53f915
+MISC ChangeLog-2015 80911 SHA256 8c20627f5c843b8aa8999b982f5618a109becf30bc848bcb7ea1392847f7b72a SHA512 75a3ae700448f65c6da1b2e85f20d7e961f4b15a7c06809a312563536a7e0288aad25b05c88879240cab27e3584cd9fde12b29adc883e9ccc359dbbc5480c08a WHIRLPOOL 2173a3da61d49ce67021c840a6e65582abc5902a3d5c10486bbc74a1f45fe17f9b0fe57f752de9596a25a198c793c807295e2546e98cbde2be297fac45b0272b
+MISC metadata.xml 701 SHA256 47c56f4cc1682d217f2d69bbec1a98ad736a24ac224bcb1b789ec477ca754f75 SHA512 6dcb099779cd0db4928ee812c81fee762612846044e6ee3df3b661a2dce6aed01420d0bc1301c8ff9d763fb8aeaeef3290a7889b32705fc48e8c392aa8b8ca82 WHIRLPOOL 7381974d488b5ee5ce23888fe2eeff5fd7136be63579b0e01206a2fef6c1f82d6127ee0db88018bbbcdc0263a4c5ec78db6135b8975a51a33135eb05fc6dd9f6
diff --git a/dev-db/phpmyadmin/files/postinstall-en-3.1.txt b/dev-db/phpmyadmin/files/postinstall-en-3.1.txt
new file mode 100644
index 000000000000..4e72581eb82d
--- /dev/null
+++ b/dev-db/phpmyadmin/files/postinstall-en-3.1.txt
@@ -0,0 +1,36 @@
+If this is a new installation:
+
+1. Configure ${PN}:
+
+a) Create config.inc.php. You can use the web-based installer
+ (this requires the 'setup' USE flag to be enabled):
+
+ mkdir ${MY_INSTALLDIR}/config
+ chown ${VHOST_SERVER_UID}:${VHOST_SERVER_UID} ${MY_INSTALLDIR}/config
+
+ then go to http://${VHOST_HOSTNAME}/${VHOST_APPDIR}/setup/
+
+ once you've saved the configuration:
+
+ cp ${MY_INSTALLDIR}/config/config.inc.php ${MY_INSTALLDIR}/config.inc.php
+ rm -rf ${MY_INSTALLDIR}/config
+
+b) Alternatively, use an existing configuration:
+
+ cp <path to existing config.inc.php file> ${MY_INSTALLDIR}/
+
+c) Alternatively, use the sample config file:
+
+ cp ${MY_INSTALLDIR}/config.sample.inc.php ${MY_INSTALLDIR}/config.inc.php
+
+2. Be sure that the libraries/ directory is not visible. You can use the
+ provided .htaccess file.
+
+=================================================================
+
+If you are upgrading from an earlier version:
+
+1. If you are using ${PN}'s features for master/foreign tables, be sure to read
+ http://${VHOST_HOSTNAME}/${VHOST_APPDIR}/Documentation.html#col_com
+
+ You will need to perform the ALTER TABLE step yourself.
diff --git a/dev-db/phpmyadmin/metadata.xml b/dev-db/phpmyadmin/metadata.xml
new file mode 100644
index 000000000000..b75a0f9193e7
--- /dev/null
+++ b/dev-db/phpmyadmin/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>jmbsvicetto@gentoo.org</email>
+ <name>Jorge Manuel B. S. Vicetto</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>web-apps@gentoo.org</email>
+ <name>Gentoo Webapps</name>
+ </maintainer>
+ <use>
+ <flag name="setup">
+ Installs the phpMyAdmin setup utility.
+ Users who don't use the utility should disable this USE flag
+ for security reasons as the setup tool was the target of various
+ exploits in the past.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">phpmyadmin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/phpmyadmin/phpmyadmin-4.0.10.20.ebuild b/dev-db/phpmyadmin/phpmyadmin-4.0.10.20.ebuild
new file mode 100644
index 000000000000..a9120f420d5b
--- /dev/null
+++ b/dev-db/phpmyadmin/phpmyadmin-4.0.10.20.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils webapp
+
+MY_PV=${PV/_/-}
+MY_PN="phpMyAdmin"
+MY_P="${MY_PN}-${MY_PV}-all-languages"
+
+DESCRIPTION="Web-based administration for MySQL database in PHP"
+HOMEPAGE="http://www.phpmyadmin.net/"
+SRC_URI="https://files.phpmyadmin.net/${MY_PN}/${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 hppa ~ia64 ppc ppc64 sparc x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="setup"
+
+RDEPEND="
+ dev-lang/php[crypt,ctype,filter,json,session,unicode]
+ || (
+ dev-lang/php[mysqli]
+ dev-lang/php[mysql]
+ )
+ virtual/httpd-php:*
+"
+
+need_httpd_cgi
+
+S="${WORKDIR}"/${MY_P}
+
+pkg_setup() {
+ webapp_pkg_setup
+}
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc README RELEASE-DATE-${MY_PV} ChangeLog || die
+ rm -f LICENSE README* RELEASE-DATE-${MY_PV}
+
+ if ! use setup; then
+ rm -rf setup || die "Cannot remove setup utility"
+ elog "The phpMyAdmin setup utility has been removed."
+ elog "It is a regular target of various exploits. If you need it, set USE=setup."
+ else
+ elog "You should consider disabling the setup USE flag"
+ elog "to exclude the setup utility if you don't use it."
+ elog "It regularly is the target of various exploits."
+ fi
+
+ insinto "${MY_HTDOCSDIR#${EPREFIX}}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+ webapp_serverowned "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en-3.1.txt
+ webapp_src_install
+}
diff --git a/dev-db/phpmyadmin/phpmyadmin-4.7.0.ebuild b/dev-db/phpmyadmin/phpmyadmin-4.7.0.ebuild
new file mode 100644
index 000000000000..3422d6c70f46
--- /dev/null
+++ b/dev-db/phpmyadmin/phpmyadmin-4.7.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils webapp
+
+MY_PV=${PV/_/-}
+MY_PN="phpMyAdmin"
+MY_P="${MY_PN}-${MY_PV}-all-languages"
+
+DESCRIPTION="Web-based administration for MySQL database in PHP"
+HOMEPAGE="https://www.phpmyadmin.net/"
+SRC_URI="https://files.phpmyadmin.net/${MY_PN}/${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ~arm hppa ~ia64 ppc ppc64 sparc x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="setup"
+
+RDEPEND="
+ dev-lang/php[crypt,ctype,filter,json,session,unicode]
+ || (
+ dev-lang/php[mysqli]
+ dev-lang/php[mysql]
+ )
+ virtual/httpd-php:*
+"
+
+need_httpd_cgi
+
+S="${WORKDIR}"/${MY_P}
+
+pkg_setup() {
+ webapp_pkg_setup
+}
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc README RELEASE-DATE-${MY_PV} ChangeLog || die
+ rm -f LICENSE README* RELEASE-DATE-${MY_PV}
+
+ if ! use setup; then
+ rm -rf setup || die "Cannot remove setup utility"
+ elog "The phpMyAdmin setup utility has been removed."
+ elog "It is a regular target of various exploits. If you need it, set USE=setup."
+ else
+ elog "You should consider disabling the setup USE flag"
+ elog "to exclude the setup utility if you don't use it."
+ elog "It regularly is the target of various exploits."
+ fi
+
+ insinto "${MY_HTDOCSDIR#${EPREFIX}}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+ webapp_serverowned "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en-3.1.txt
+ webapp_src_install
+}
diff --git a/dev-db/phpmyadmin/phpmyadmin-4.7.1.ebuild b/dev-db/phpmyadmin/phpmyadmin-4.7.1.ebuild
new file mode 100644
index 000000000000..80ad74d42a80
--- /dev/null
+++ b/dev-db/phpmyadmin/phpmyadmin-4.7.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils webapp
+
+MY_PV=${PV/_/-}
+MY_PN="phpMyAdmin"
+MY_P="${MY_PN}-${MY_PV}-all-languages"
+
+DESCRIPTION="Web-based administration for MySQL database in PHP"
+HOMEPAGE="https://www.phpmyadmin.net/"
+SRC_URI="https://files.phpmyadmin.net/${MY_PN}/${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="setup"
+
+RDEPEND="
+ dev-lang/php[crypt,ctype,filter,json,session,unicode]
+ || (
+ dev-lang/php[mysqli]
+ dev-lang/php[mysql]
+ )
+ virtual/httpd-php:*
+"
+
+need_httpd_cgi
+
+S="${WORKDIR}"/${MY_P}
+
+pkg_setup() {
+ webapp_pkg_setup
+}
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc README RELEASE-DATE-${MY_PV} ChangeLog || die
+ rm -f LICENSE README* RELEASE-DATE-${MY_PV}
+
+ if ! use setup; then
+ rm -rf setup || die "Cannot remove setup utility"
+ elog "The phpMyAdmin setup utility has been removed."
+ elog "It is a regular target of various exploits. If you need it, set USE=setup."
+ else
+ elog "You should consider disabling the setup USE flag"
+ elog "to exclude the setup utility if you don't use it."
+ elog "It regularly is the target of various exploits."
+ fi
+
+ insinto "${MY_HTDOCSDIR#${EPREFIX}}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+ webapp_serverowned "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en-3.1.txt
+ webapp_src_install
+}
diff --git a/dev-db/phpmyadmin/phpmyadmin-4.7.2.ebuild b/dev-db/phpmyadmin/phpmyadmin-4.7.2.ebuild
new file mode 100644
index 000000000000..80ad74d42a80
--- /dev/null
+++ b/dev-db/phpmyadmin/phpmyadmin-4.7.2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils webapp
+
+MY_PV=${PV/_/-}
+MY_PN="phpMyAdmin"
+MY_P="${MY_PN}-${MY_PV}-all-languages"
+
+DESCRIPTION="Web-based administration for MySQL database in PHP"
+HOMEPAGE="https://www.phpmyadmin.net/"
+SRC_URI="https://files.phpmyadmin.net/${MY_PN}/${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="setup"
+
+RDEPEND="
+ dev-lang/php[crypt,ctype,filter,json,session,unicode]
+ || (
+ dev-lang/php[mysqli]
+ dev-lang/php[mysql]
+ )
+ virtual/httpd-php:*
+"
+
+need_httpd_cgi
+
+S="${WORKDIR}"/${MY_P}
+
+pkg_setup() {
+ webapp_pkg_setup
+}
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc README RELEASE-DATE-${MY_PV} ChangeLog || die
+ rm -f LICENSE README* RELEASE-DATE-${MY_PV}
+
+ if ! use setup; then
+ rm -rf setup || die "Cannot remove setup utility"
+ elog "The phpMyAdmin setup utility has been removed."
+ elog "It is a regular target of various exploits. If you need it, set USE=setup."
+ else
+ elog "You should consider disabling the setup USE flag"
+ elog "to exclude the setup utility if you don't use it."
+ elog "It regularly is the target of various exploits."
+ fi
+
+ insinto "${MY_HTDOCSDIR#${EPREFIX}}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+ webapp_serverowned "${MY_HTDOCSDIR#${EPREFIX}}"/libraries/config.default.php
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en-3.1.txt
+ webapp_src_install
+}
diff --git a/dev-db/phppgadmin/Manifest b/dev-db/phppgadmin/Manifest
new file mode 100644
index 000000000000..69bcc6c9b0f5
--- /dev/null
+++ b/dev-db/phppgadmin/Manifest
@@ -0,0 +1,7 @@
+AUX postinstall-en.txt 162 SHA256 4a9660e63271a754cc5ad9976c0021b57ef1e02cb3e919e54b7b6e87293e6573 SHA512 3aa9e4b58ffd97cc9bc990e0ca8444e8be012fb56859b28705e7ed3d5ffae74bcfab19c55e415785c9f09fabcc20ea5a493ee2f03fb380a351c02fe958231bd8 WHIRLPOOL d287cced1e68151cd00e1050601629ea70b6deb268d06f86f3348e9fe0a5f63a724a5a2518d924866a75e31459e4b254d7bfe03c0ee4663412fa63cf69a81cb6
+DIST phpPgAdmin-5.1.tar.bz2 583620 SHA256 8a450ec4b8c85e8da7ab43b928265bc2ad0280fdea4144b55b40da4ceefd6ec6 SHA512 3a1eebfc4e07a620ea3ec5d65e1fd1f07cb19f12db470f163430ded20542107c828cebbd5d5ae23c470fbe5aa0e2358b8c4d3ba66834009a39ac74440cc751c0 WHIRLPOOL bb6b148efb87efc3120dc2b4e4b4ea031f1b06a89fc316d0dbe6360646c0bff496b42eb6063896baf96ce551706acfc1ffa15956827aa6895534060a63f32fa7
+EBUILD phppgadmin-5.1.ebuild 943 SHA256 4ededa53a83e869b8230ddb67032dd6500b3ed0f8b51fe78db2c2687c395e6f7 SHA512 9dc11c40cdbdc05779d9a7cbd16350925c574f5b191106854ac81636ddc4549be7a9a682a9054b7a7aced600a79fb7d4bedeeaaafa59aa325bc6fc07745acaef WHIRLPOOL 4c4d8ffcc54b7e8fecec96421f82d3cdd1366606be99b94114eb568f3ae96387be54381d0462a81284c396496492908b03a04732d56ac01edbe9462416cc5b9f
+EBUILD phppgadmin-9999.ebuild 912 SHA256 b3a1d31b6c3b76e005b1537d9169a965dc76afa19e5d9dc91582ecef1309721f SHA512 2fbbb0e09b4f17cdfa270e995208969f5de67395da4ad5adf4354b30f0849e292e0866b28fae22d443a89c6759e4b317713421359a8c71940c7a68aad9da957f WHIRLPOOL a17a33bcf1379aa00a73f67fd69b6e72d1f35b16f2b3c00cb18d36716a49c5471d40dc0bf4df19aa089c2353b3d5c1cacb823a61c75d497c36933b4903341f37
+MISC ChangeLog 3061 SHA256 c9a7f702957bb13d7450e937f3305dce14bed567e9bd45264066ba4ef295231d SHA512 609e492be273761eb1df6c7af4e083b377e411760727db00316b9d5fda66e0d215f232ae91c2b05a10120dccc307114868064b10072477ef81a96cfc35856ecb WHIRLPOOL 8264bfcb7cc42bd10a55e43ff6f826bbeb2ce748d21a5b2045da7fa1928f25e5a524dfe34cd0dbd67dbc53665f787f5ce0442574e9fb931271d334d314700f36
+MISC ChangeLog-2015 14025 SHA256 23e15529f908e42392ebb52bd9844bc1df466ba544f4786a5833235abba72083 SHA512 a93ac608d0d724f3d8f109da2c0f4678d4c8779f3711fb1e3dbcfb6ac58b3ba67649e16dd5b4446bab256ce7db902805297ace9663ee0ed4982c7636cdb1a442 WHIRLPOOL 0e20b7e2207802be363abd1706fc5ea0de0b56e55b7b8eab1b9a8d1b4a30fcbb26af56fc30eb6fce7e760ee45c9be707db351c0f7a72db0af15be8631a516044
+MISC metadata.xml 471 SHA256 228ab137639c1b4381705a51c7158c32396379fe4b1750da3195950cc721ce3b SHA512 c77ad7f8013618aa1775c023bb166792ddf7824b53315d4b9c36b140ea4b1985c1530dc50e38c14948ea5aee124d0823ce782d59b12da320757db249dddb535c WHIRLPOOL 59162c8dc91b5b072bc4299773bace2516b6096b088e0c9b85529525f49960982b501e040772e7f19f6a8b0cda56bf54f0cff0e18e69567a2ccc643b6f4aad38
diff --git a/dev-db/phppgadmin/files/postinstall-en.txt b/dev-db/phppgadmin/files/postinstall-en.txt
new file mode 100644
index 000000000000..003fe5003bbd
--- /dev/null
+++ b/dev-db/phppgadmin/files/postinstall-en.txt
@@ -0,0 +1,4 @@
+Make sure you edit ${MY_INSTALLDIR}/conf/config.inc.php
+
+To use the reports database, you have to manually execute
+psql -f ${MY_INSTALLDIR}/sql/reports-pgsql.sql
diff --git a/dev-db/phppgadmin/metadata.xml b/dev-db/phppgadmin/metadata.xml
new file mode 100644
index 000000000000..fc6f76702327
--- /dev/null
+++ b/dev-db/phppgadmin/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>web-apps@gentoo.org</email>
+ <name>Gentoo Webapps</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">phppgadmin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/phppgadmin/phppgadmin-5.1.ebuild b/dev-db/phppgadmin/phppgadmin-5.1.ebuild
new file mode 100644
index 000000000000..7434f1c78238
--- /dev/null
+++ b/dev-db/phppgadmin/phppgadmin-5.1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit webapp
+
+MY_P="phpPgAdmin-${PV}"
+
+DESCRIPTION="Web-based administration for Postgres database in php"
+HOMEPAGE="http://phppgadmin.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 hppa ppc x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/php[postgres,session]
+ || ( <dev-lang/php-5.3[pcre] >=dev-lang/php-5.3 )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_install() {
+ webapp_src_preinst
+
+ local doc
+ local docs="CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS"
+ dodoc ${docs}
+ mv conf/config.inc.php-dist conf/config.inc.php
+
+ cp -r * "${D}"${MY_HTDOCSDIR}
+ for doc in ${docs} INSTALL LICENSE; do
+ rm -f "${D}"${MY_HTDOCSDIR}/${doc}
+ done
+
+ webapp_configfile ${MY_HTDOCSDIR}/conf/config.inc.php
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+ webapp_src_install
+}
diff --git a/dev-db/phppgadmin/phppgadmin-9999.ebuild b/dev-db/phppgadmin/phppgadmin-9999.ebuild
new file mode 100644
index 000000000000..61ae2918cea2
--- /dev/null
+++ b/dev-db/phppgadmin/phppgadmin-9999.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit webapp git-2
+
+DESCRIPTION="Web-based administration for Postgres database in php"
+HOMEPAGE="http://phppgadmin.sourceforge.net/"
+EGIT_REPO_URI="https://github.com/xzilla/${PN}.git"
+
+LICENSE="GPL-2"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="
+ || (
+ <dev-lang/php-5.3[pcre]
+ >=dev-lang/php-5.3
+ )
+ dev-lang/php[postgres,session]
+"
+
+pkg_setup() {
+ webapp_pkg_setup
+}
+
+src_install() {
+ webapp_src_preinst
+
+ local doc
+ local docs="CREDITS DEVELOPERS FAQ HISTORY INSTALL TODO TRANSLATORS"
+ dodoc ${docs}
+ mv conf/config.inc.php-dist conf/config.inc.php
+
+ cp -r * "${D}"${MY_HTDOCSDIR}
+ for doc in ${docs} INSTALL LICENSE; do
+ rm -f "${D}"${MY_HTDOCSDIR}/${doc}
+ done
+
+ webapp_configfile ${MY_HTDOCSDIR}/conf/config.inc.php
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+ webapp_src_install
+}
diff --git a/dev-db/postgis/Manifest b/dev-db/postgis/Manifest
new file mode 100644
index 000000000000..f3fa1ec6f35c
--- /dev/null
+++ b/dev-db/postgis/Manifest
@@ -0,0 +1,15 @@
+AUX postgis-2.0-arflags.patch 539 SHA256 02429ac34d53c0beaae9d323b65cc85702e46fbf7f83cfd0d0ba7c0f74ba3afa SHA512 e600cf3548fa7c13f7cddec24a0f9078646155b48fb42cd1d41bff311976718ba93bcf7d8361d0494df5e3c6bdff74af5b8b4821026a49618ad3d835383f2785 WHIRLPOOL 506aa9782eac840a9ee21ad2b139035431e2fee2e96b4a8f0900d71bb9aaf693a3f1fae864ad1a19133b4cba362153afda9ef1222cc3bab5e5aaa309772a16e4
+AUX postgis-2.1-ldflags.patch 1367 SHA256 30b56a31599a276f9d82658e12744f7aff59eafc1401a6b6ecfe5edca948be56 SHA512 7bfce943698b8ba41fea5606c1a3dc43b2cc11daeb8e81e432701c2cebf300984ff54e8c8817e245ec4195a85b8d28bcfc6b30d111bd6c05341c93e7c769ab35 WHIRLPOOL 9743cdc192ab12ea0a6efc90e4915e6798dee49117d47246aa0405abb1698aba7e276198d1147b8b535abc9b8e4e59ba5f1f8b062062e4d23b91d610358cb9b2
+AUX postgis-2.1.4-pkgconfig-json.patch 4276 SHA256 0a8347d9427e10c9a0d2554f862ecbbacd1bbe1c6f9373ae4c9721ffe8475b00 SHA512 7439b2221bee6e3940485b1964edda10d320493b3dc8b86e1579824a9f0c6b5ff21a3d444077fa331096a9e0e4442df2c792d8a51c79dcf6c680404cbebf9275 WHIRLPOOL 3e4d05566fd38dd7e6c25f39299abf7add7247f558fd0243a0559b664c9fb0a946d45f5e9daf19f43c68fbfe85dfb128bef9e2299d20121058b4b3b5ee3eee03
+AUX postgis-2.2.0-arflags.patch 535 SHA256 7253a58b96f73a685143c0c957c41c9b8008f10752a36b45365e6c9abbc55259 SHA512 7f8b92a582dd11b3040832278b75e65036315ca0e438cb9b19cc5b63a7b5c5bcae8ec274a487a29abadfbbc31cdfacf6c668e46f249d4bf88c09607501cacf66 WHIRLPOOL e08f5e2397dde8012e60bedfbda7c3fa5a88a4409a65929eaa184cdbd1e8aeb4854808c48a3c2fd41d4d0355616d16f70a34f9e534bb3787377e8dbeea6e52d5
+AUX postgis_dbs 2096 SHA256 dafde4a1d1d95e18facb3287baddab3c1c116933498c310438c91dbd736833ec SHA512 5a11a3ce0153461f363d1b9a393dd10392e123c7b18b20610a5e26f2c7c6ed258a1517082a244c6ab5de40d439bc8a370848a0177c3c2ffcffc67a24fca8e66a WHIRLPOOL 8e4c34ac428c5ac887b414334fe80424b09845585596be1affaf69a9205af7dd183198eed44fa0406074ad1bcc133db8a9a13acd4a0882945b32ec8e0a480b61
+DIST postgis-2.1.8.tar.gz 6811272 SHA256 7c2380b895fe7bda34c2e70deab3fcf4c12b13ab40d7501cdaa6fa36f1a6c662 SHA512 e8aeb739a1ecf95b224a3908d2af3aa38933b56c63713af30d14243653745436165b418a3368601a699b744f6fe61ce645c980319eb159395d68166a3815c5f4 WHIRLPOOL b6675fecbb922379bd50c351abe1553fdbda53543fce56451c688e25a3fa2e9d0813d8f3a349b623b85fcb4016fc4710f6746a224ba7673ec0d2106c7635d3d1
+DIST postgis-2.3.3.tar.gz 11342032 SHA256 723d43a1c8ca4cf06359ec0b7fd5521b355db4e37128a26fb8c661b1fe2fc930 SHA512 c0ec4b4b5c470e5f88d1bb72c528269a0cf954981385580db3333502c2da74e431b5a86e3d6427c839c3d4440122be18a69261c8205aa71c8aa4b790550c5e9c WHIRLPOOL 427d4637e0073ad549cd2e74d117b2dc2b0b0e5fff98f9a0bbee3514c00b3688dd56acd7bb3f1742eda61238cf8c5ab81cea6ead7ea5880261b753a86e0f847e
+DIST postgis-2.4.0.tar.gz 12576979 SHA256 02baa90f04da41e04b6c18eedfda53110c45ae943d4e65050f6d202f7de07d29 SHA512 813e8e9feb75b58673afaec2dda3b5d8fc586a0f483c553795c8ae2b917bb67a9741e8c901787a0b914c327848323239346f1d816aa60b47d5a7065596de0067 WHIRLPOOL 75403b5d1babdc1d714d29a6c1f86dfcd1503997536d6a35333b6e19c72de44aa131cba3c6a9a4f2ced59a280eb0eaee41696fa8440c2028f8555d6a2c4dcd3b
+EBUILD postgis-2.1.8-r1.ebuild 7353 SHA256 e99d42f70adee30cea1d6ef8c2f87185cd07ac314ec407cc053dbbb82f52c480 SHA512 f7341c7ec07f6fefa9b904aa915bef8ac309cd17595f246e26efdc0d932476bee7cc6264c8bdd98b02b0637c2cd24ce31a2aa7799ccf8f4f9d19b6192584a856 WHIRLPOOL 0904d54d41c094dd0cf3de73230bc33d0ff12562ac074dc7c362cb8dc1d57baa309ba30c74571fed4556e633b6bcbec21c196c7fa364e2f3610e651f98a3278a
+EBUILD postgis-2.3.3.ebuild 2734 SHA256 0ede97176d14f51bfce0a63646327d759e7214cc50116ed469d0fa58fbc84330 SHA512 04b648cf53497cfb0f5fcdd7a3c033a01f62180f60d82d427d9a163a09484be8c09a63e188237abab37e5028fa36ac2075094d19e96211d50238bb8b95e1234f WHIRLPOOL 634cdce7b397b582194f4b8e050fa2b3e0dad71b855b4b167fa2e8d2811f8b08a8031738718f1785d7ac26c64ec2a84ffe5ec8e90a0f49cc19de06e99a0973a6
+EBUILD postgis-2.4.0.ebuild 2737 SHA256 fb130b6a3f58c723dd74f6fdcc7a554573d763c05dbfb3e8da9fde5310d3b925 SHA512 2bd729a3fb41cac6e283f045741de3fdfb5789849b025cdb76ff9ace385309a2838c6e001a110e853d0f98992d411265634af0526c7f7891ffe4a7269fb35cf6 WHIRLPOOL f00170fcfc1dc542dd852646a8fa1d066e8207238c34ae76c922dbf8b0887ef9905659c6948b1b8f9bf2e1ca86560e45282501b266266ef55463232a3703cd40
+EBUILD postgis-9999.ebuild 2645 SHA256 5086db52abc3f8a51401593892239a77b00dc0ae835c424250ed5632c2ae31a7 SHA512 fc23662b423b3a07d6bd79c36d83677f3bc09975b93259a20b8d46d19eb95542456df9785e21c40d44c6c833cddc08cb34c1b9c214323d2b1661b33262c49e10 WHIRLPOOL ea7254ee0405d04b15169371d371f91b065210b1e2de1283598be5115cb4d06253632783e3ea7118ac95d31ec2cbb7292466feb7bf9cc21d7616ea7ac24313ba
+MISC ChangeLog 6529 SHA256 27002d9667de8a361e347cc66c2fc804054e53b1834548a3229526d472d5c36c SHA512 e5011139d4d58675b1513bb128e07c589bfa65a8d6ac9e2d43366f50d8a8cd38f6b08d39b1b6adeff3af0579c22403a5b1643f4f290be3c8a8a08fbf33c00570 WHIRLPOOL 93ed801a763374b3a6afe680e8711fedd7a9e0a149ffb7dc8352664b1f1cc7284886415f879aa1ac2f5b12aec3591e032e1814559c0414fb5f13654c96cddbd6
+MISC ChangeLog-2015 15421 SHA256 0f3e682af97970b63f483d38082d202cad0ce391e805f545590a37fc9fc2c3b3 SHA512 71d3a8f9f00ecdb484fead44508a1f15674b546d60533addf7f91c94d028800b098f52b1172ec028b6c85470154a4b364f10c9e1c8e0e6d0d8139d1aac8b9c6a WHIRLPOOL 651c4e132f36162267fe3473136aecfb8f6266a22d2715989697ff8319c933b058fb3a9fdbcefc6abc9451e5b3da72d94c05c51e31dc90bf6a09dd9e166330d6
+MISC metadata.xml 506 SHA256 ef5bf9003c7834db20fcd1278ec11d36d5e7230c09f25cac7ae4e9b59f70ae74 SHA512 5cbe7ca8eb33c99d029f9491189b1cbe76506b7ff375eba688e9975edc89c2f0518eb65e703c4fcc48600949718b932408fb87217cc3eda2074d9da1577c2803 WHIRLPOOL 255644f4eb56f3964a15388fcdef709483a1e44d1332b9980f58b8cfe9d973a5782363da188fae64811fa0efbb2294d2b232b16c394b304ed1cb66ed3086188c
diff --git a/dev-db/postgis/files/postgis-2.0-arflags.patch b/dev-db/postgis/files/postgis-2.0-arflags.patch
new file mode 100644
index 000000000000..fa2e9a8da607
--- /dev/null
+++ b/dev-db/postgis/files/postgis-2.0-arflags.patch
@@ -0,0 +1,18 @@
+diff -Naruw a/raster/rt_core/Makefile.in b/raster/rt_core/Makefile.in
+--- a/raster/rt_core/Makefile.in 2012-03-21 21:36:59.000000000 +0000
++++ b/raster/rt_core/Makefile.in 2013-04-28 13:23:21.055728249 +0000
+@@ -8,7 +8,7 @@
+ #
+ #############################################################################
+
+-AR=ar rs
++ARFLAGS=rs
+
+ CC=@CC@
+ LIBLWGEOM_LDFLAGS=../../liblwgeom/.libs/liblwgeom.a
+@@ -35,4 +35,4 @@
+ rm -f Makefile
+
+ librtcore.a: $(RT_OBJS) $(RT_HEADERS)
+- $(AR) $(RT_LIB) $(RT_OBJS)
++ $(AR) $(ARFLAGS) $(RT_LIB) $(RT_OBJS)
diff --git a/dev-db/postgis/files/postgis-2.1-ldflags.patch b/dev-db/postgis/files/postgis-2.1-ldflags.patch
new file mode 100644
index 000000000000..de11510ea37b
--- /dev/null
+++ b/dev-db/postgis/files/postgis-2.1-ldflags.patch
@@ -0,0 +1,26 @@
+diff -Naruw postgis-2.1.0rc1.orig/loader/Makefile.in postgis-2.1.0rc1/loader/Makefile.in
+--- postgis-2.1.0rc1.orig/loader/Makefile.in 2013-05-06 08:30:51.000000000 +0000
++++ postgis-2.1.0rc1/loader/Makefile.in 2013-07-14 17:19:19.313306844 +0000
+@@ -97,11 +97,11 @@
+
+ $(PGSQL2SHP-CLI): $(SHPLIB_OBJS) pgsql2shp-core.o pgsql2shp-cli.o $(LIBLWGEOM)
+ $(LIBTOOL) --mode=link \
+- $(CC) $(CFLAGS) $^ $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) $(GETTEXT_LDFLAGS) -o $@
++ $(CC) $(CFLAGS) $^ $(LDFLAGS) $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) $(GETTEXT_LDFLAGS) -o $@
+
+ $(SHP2PGSQL-CLI): $(SHPLIB_OBJS) shp2pgsql-core.o shp2pgsql-cli.o $(LIBLWGEOM)
+ $(LIBTOOL) --mode=link \
+- $(CC) $(CFLAGS) $^ -o $@ $(GETTEXT_LDFLAGS) $(ICONV_LDFLAGS)
++ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(GETTEXT_LDFLAGS) $(ICONV_LDFLAGS)
+
+ shp2pgsql-gui.o: shp2pgsql-gui.c shp2pgsql-core.h shpcommon.h
+ $(CC) $(CFLAGS) $(GTK_CFLAGS) $(PGSQL_FE_CPPFLAGS) -o $@ -c shp2pgsql-gui.c
+@@ -109,7 +109,7 @@
+ $(SHP2PGSQL-GUI): $(SHPLIB_OBJS) shp2pgsql-core.o shp2pgsql-gui.o pgsql2shp-core.o $(LIBLWGEOM) $(GTK_WIN32_RES)
+ $(LIBTOOL) --mode=link \
+ $(CC) $(CFLAGS) $(GTK_WIN32_FLAGS) $^ -o $@ \
+- $(GTK_LIBS) $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) $(GETTEXT_LDFLAGS)
++ $(LDFLAGS) $(GTK_LIBS) $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) $(GETTEXT_LDFLAGS)
+
+ installdir:
+ @mkdir -p $(DESTDIR)$(bindir)
diff --git a/dev-db/postgis/files/postgis-2.1.4-pkgconfig-json.patch b/dev-db/postgis/files/postgis-2.1.4-pkgconfig-json.patch
new file mode 100644
index 000000000000..13634abb6de2
--- /dev/null
+++ b/dev-db/postgis/files/postgis-2.1.4-pkgconfig-json.patch
@@ -0,0 +1,122 @@
+diff --git a/configure.ac b/configure.ac
+index a13cf13..c0a7842 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -780,61 +780,19 @@ dnl ===========================================================================
+ dnl Detect if json-c installed
+ dnl ===========================================================================
+
+-CHECK_JSON=yes
+-HAVE_JSON=no
+-HAVE_JSON_C=no
+-
+-AC_ARG_WITH([json],
+- [AS_HELP_STRING([--without-json], [build without json-c support])],
+- [CHECK_JSON="$withval"], [])
+-
+-if test "$CHECK_JSON" != "no"; then dnl {
+-
+-AC_ARG_WITH([jsondir],
+- [AS_HELP_STRING([--with-jsondir=PATH], [specify the json-c installation directory])],
+- [JSONDIR="$withval"], [JSONDIR=])
+-
+-if test ! "x$JSONDIR" = "x"; then
+- dnl Make sure that the directory exists
+- if test "x$JSONDIR" = "xyes"; then
+- AC_MSG_ERROR([you must specify a parameter to --with-jsondir, e.g. --with-jsondir=/path/to])
+- else
+- AC_MSG_RESULT([Using user-specified json-c directory: $JSONDIR])
+-
+- dnl Add the include directory to JSON_CPPFLAGS
+- JSON_CPPFLAGS="-I$JSONDIR/include"
+- JSON_LDFLAGS="-L$JSONDIR/lib"
+- fi
+-fi
+-
+-dnl Check that we can find the json/json.h header file
+-CPPFLAGS_SAVE="$CPPFLAGS"
+-CPPFLAGS="$JSON_CPPFLAGS"
+-AC_CHECK_HEADER([json/json.h], [HAVE_JSON=yes], [
+- AC_CHECK_HEADER([json-c/json.h], [HAVE_JSON=yes; HAVE_JSON_C=yes], [])
+-])
+-CPPFLAGS="$CPPFLAGS_SAVE"
+-
+-dnl Ensure we can link against libjson
+-LIBS_SAVE="$LIBS"
+-LIBS="$JSON_LDFLAGS"
+-AC_CHECK_LIB([json-c], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson-c"], [
+- AC_CHECK_LIB([json], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson"], [], [])
+-], [])
+-LIBS="$LIBS_SAVE"
+-
+-if test "$HAVE_JSON" = "yes"; then
++PKG_CHECK_MODULES([JSON], [json],
++ [
++ HAVE_JSON=yes
+ AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present])
+-fi
+-if test "$HAVE_JSON_C" = "yes"; then
+- AC_DEFINE([HAVE_LIBJSON_C], 1, [Define to 1 if libjson resides in a json-c subdir])
+-fi
+-
+-AC_SUBST([JSON_CPPFLAGS])
+-AC_SUBST([JSON_LDFLAGS])
+-AC_SUBST([HAVE_JSON])
+-
+-fi dnl }
++ ],
++ [
++ PKG_CHECK_MODULES([JSON], [json-c],
++ [
++ HAVE_JSON=yes
++ AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present])
++ ],
++ [HAVE_JSON=no])
++ ])
+
+ dnl ===========================================================================
+ dnl Detect GTK+2.0 for GUI
+@@ -927,7 +885,7 @@ AC_DEFINE_UNQUOTED([POSTGIS_USE_STATS], [1], [Enable use of ANALYZE statistics])
+ CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $CPPFLAGS"
+ AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
+
+-SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS"
++SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LIBS $XML2_LDFLAGS $SFCGAL_LDFLAGS"
+ AC_SUBST([SHLIB_LINK])
+ dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
+
+diff --git a/liblwgeom/Makefile.in b/liblwgeom/Makefile.in
+index 3cc6256..5ccbb3b 100644
+--- a/liblwgeom/Makefile.in
++++ b/liblwgeom/Makefile.in
+@@ -11,8 +11,8 @@
+ # **********************************************************************
+
+ CC = @CC@
+-CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ @JSON_CPPFLAGS@
+-LDFLAGS = @LDFLAGS@ @GEOS_LDFLAGS@ -lgeos_c @PROJ_LDFLAGS@ -lproj @JSON_LDFLAGS@
++CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ @JSON_CFLAGS@
++LDFLAGS = @LDFLAGS@ @GEOS_LDFLAGS@ -lgeos_c @PROJ_LDFLAGS@ -lproj @JSON_LIBS@
+ NUMERICFLAGS = @NUMERICFLAGS@
+ top_builddir = @top_builddir@
+ prefix = @prefix@
+diff --git a/liblwgeom/lwin_geojson.c b/liblwgeom/lwin_geojson.c
+index 7019626..ec1d594 100644
+--- a/liblwgeom/lwin_geojson.c
++++ b/liblwgeom/lwin_geojson.c
+@@ -19,13 +19,8 @@
+
+ #include <string.h>
+
+-#ifdef HAVE_LIBJSON_C
+-#include <json-c/json.h>
+-#include <json-c/json_object_private.h>
+-#else
+-#include <json/json.h>
+-#include <json/json_object_private.h>
+-#endif
++#include <json.h>
++#include <json_object_private.h>
+
+ #ifndef JSON_C_VERSION
+ // Adds support for libjson < 0.10
diff --git a/dev-db/postgis/files/postgis-2.2.0-arflags.patch b/dev-db/postgis/files/postgis-2.2.0-arflags.patch
new file mode 100644
index 000000000000..97770042d8f6
--- /dev/null
+++ b/dev-db/postgis/files/postgis-2.2.0-arflags.patch
@@ -0,0 +1,18 @@
+diff -Naruw a/raster/rt_core/Makefile.in b/raster/rt_core/Makefile.in
+--- a/raster/rt_core/Makefile.in 2015-05-13 14:13:18.000000000 -0400
++++ b/raster/rt_core/Makefile.in 2015-12-14 16:49:49.166156232 -0500
+@@ -18,7 +18,7 @@
+ #
+ #############################################################################
+
+-AR = ar rs
++ARFLAGS = rs
+
+ CC = @CC@
+ LIBLWGEOM_LDFLAGS = ../../liblwgeom/.libs/liblwgeom.a
+@@ -64,4 +64,4 @@
+ rm -f Makefile
+
+ librtcore.a: $(RT_OBJS)
+- $(AR) $(RT_LIB) $(RT_OBJS)
++ $(AR) $(ARFLAGS) $(RT_LIB) $(RT_OBJS)
diff --git a/dev-db/postgis/files/postgis_dbs b/dev-db/postgis/files/postgis_dbs
new file mode 100644
index 000000000000..8a414157f6c6
--- /dev/null
+++ b/dev-db/postgis/files/postgis_dbs
@@ -0,0 +1,49 @@
+# This file is used by 'emerge --config dev-db/postgis' to determine which
+# databases it should install to, upgrade or create as a template.
+
+# Unlike the previous versions of the PostGIS ebuilds, it no longer creates any
+# databases except for templates. All databases you list must already exist in
+# the cluster.
+
+# The user to perform the updates as. This user must have the privileges to
+# modify all of the databases you list here.
+pguser="postgres"
+
+# By default, no databases will have PostGIS enabled. The databases listed here
+# must already exist. The databases you list here must not already be PostGIS
+# enabled. Instead, use the upgrade lists further down.
+#databases=( "your" "databases" )
+
+# Anything you place in this list will create a database and make it a template.
+# It will be PostGIS-enabled. To add additional features, add the template names
+# to the following lists.
+#templates=( "template_postgis" )
+
+# The PostGIS enabled templates will be created using this template.
+from_template="template1"
+
+# For a complete set of EPSG coordinate system definition identifiers, you can
+# also load the spatial_ref_sys.sql definitions file and populate the
+# spatial_ref_sys table. This will permit you to perform ST_Transform()
+# operations on geometries.
+#epsg_databases=( "enable" "epsg" "on" "these" "databases" )
+
+# Add comments to PostGIS functions to the databases in this list.
+#comment_databases=( "comments" "on" "these" "databases" )
+
+# Any databases you have that are already PostGIS enabled can be listed among
+# the following list to perform a soft upgrade. If the soft upgrade fails,
+# you'll need to do a hard upgrade.
+# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#hard_upgrade
+
+# Upgrade from PostGIS 1.3 to 1.5
+#upgrade_from_1_3=( "upgrade" "these" "databases" )
+
+# Upgrade from PostGIS 1.4 to 1.5
+#upgrade_from_1_4=( "upgrade" "these" "databases" )
+
+# Perform a minor upgrade for PostGIS 1.5
+#upgrade_from_1_5=( "upgrade" "these" "databases" )
+
+# Uncomment this once you're satisfied with the settings in this file.
+#configured="true"
diff --git a/dev-db/postgis/metadata.xml b/dev-db/postgis/metadata.xml
new file mode 100644
index 000000000000..41af88acdf31
--- /dev/null
+++ b/dev-db/postgis/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>sci-geosciences@gentoo.org</email>
+ <name>Gentoo Geosciences Project</name>
+ </maintainer>
+ <use>
+ <flag name="gtk">Build shp2pgsql-gui a graphical interface to shp2pgsql</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/postgis/postgis-2.1.8-r1.ebuild b/dev-db/postgis/postgis-2.1.8-r1.ebuild
new file mode 100644
index 000000000000..7b1340edd962
--- /dev/null
+++ b/dev-db/postgis/postgis-2.1.8-r1.ebuild
@@ -0,0 +1,281 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+POSTGRES_COMPAT=( 9.{2,3,4} )
+
+inherit autotools eutils versionator
+
+MY_PV=$(replace_version_separator 3 '')
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Geographic Objects for PostgreSQL"
+HOMEPAGE="http://postgis.net"
+SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc gtk static-libs test"
+
+RDEPEND="
+ || (
+ dev-db/postgresql:9.4[server]
+ dev-db/postgresql:9.3[server]
+ dev-db/postgresql:9.2[server]
+ )
+ dev-libs/json-c
+ dev-libs/libxml2:2
+ >=sci-libs/geos-3.4.2
+ >=sci-libs/proj-4.6.0
+ >=sci-libs/gdal-1.10.0:=
+ gtk? ( x11-libs/gtk+:2 )
+"
+
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/libxslt
+ virtual/imagemagick-tools[png]
+ )
+ virtual/pkgconfig
+ test? ( dev-util/cunit )
+"
+
+PGIS="$(get_version_component_range 1-2)"
+
+REQUIRED_USE="test? ( doc )"
+
+# Needs a running psql instance, doesn't work out of the box
+RESTRICT="test"
+
+MAKEOPTS+=' -j1'
+
+# These modules are built using the same *FLAGS that were used to build
+# dev-db/postgresql. The right thing to do is to ignore the current
+# *FLAGS settings.
+QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so"
+
+postgres_check_slot() {
+ if ! declare -p POSTGRES_COMPAT &>/dev/null; then
+ die 'POSTGRES_COMPAT not declared.'
+ fi
+
+# Don't die because we can't run postgresql-config during pretend.
+[[ "$EBUILD_PHASE" = "pretend" \
+ && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0
+
+ local res=$(echo ${POSTGRES_COMPAT[@]} \
+ | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null)
+
+ if [[ "$res" -eq "0" ]] ; then
+ eerror "PostgreSQL slot must be set to one of: "
+ eerror " ${POSTGRES_COMPAT[@]}"
+ return 1
+ fi
+
+ return 0
+}
+
+pkg_setup() {
+ postgres_check_slot || die
+ export PGSLOT="$(postgresql-config show)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.1-ldflags.patch" \
+ "${FILESDIR}/${PN}-2.0-arflags.patch" \
+ "${FILESDIR}/${PN}-2.1.4-pkgconfig-json.patch"
+
+ local AT_M4DIR="macros"
+ eautoreconf
+}
+
+src_configure() {
+ local myargs=""
+ use gtk && myargs+=" --with-gui"
+ econf \
+ --with-pgconfig="/usr/lib/postgresql-${PGSLOT}/bin/pg_config" \
+ ${myargs}
+}
+
+src_compile() {
+ emake
+ emake -C topology
+
+ if use doc ; then
+ emake comments
+ emake cheatsheets
+ emake -C doc html
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use doc && emake DESTDIR="${D}" comments-install
+ emake -C topology DESTDIR="${D}" install
+ dobin ./utils/postgis_restore.pl
+
+ dodoc CREDITS TODO loader/README.* doc/*txt
+
+ use doc && dohtml -r doc/html/*
+
+ docinto topology
+ dodoc topology/{TODO,README}
+
+ insinto /etc
+ doins "${FILESDIR}/postgis_dbs"
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
+
+pkg_postinst() {
+ postgresql-config update
+
+ elog "To finish installing or updating PostGIS edit:"
+ elog " ${EROOT%/}/etc/postgis_dbs"
+ elog
+ elog "Then, run:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+}
+
+pkg_config(){
+ source "${EROOT%/}/etc/conf.d/postgresql-${PGSLOT}"
+ source "${EROOT%/}/etc/postgis_dbs"
+ local postgis_path="${EROOT%/}/usr/share/postgresql-${PGSLOT}/contrib/postgis-${PGIS}"
+
+ if [[ -n ${configured} ]] ; then
+ einfon "Password for PostgreSQL user '${pguser}': "
+ read -s PGPASSWORD
+ export PGPASSWORD
+ echo
+ else
+ eerror "You must edit:"
+ eerror " ${EROOT%/}/etc/postgis_dbs"
+ eerror "Before running 'emerge --config =${CATEGORY}/${PF}'"
+ eerror
+ die "Edit postgis_dbs"
+ fi
+
+ # The server we work with must be the same slot we built against.
+ local server_match
+ server_match=$(psql -U ${pguser} -d postgres -p ${PGPORT} \
+ -Aqwtc 'SELECT version()' 2> /dev/null | grep -c "PostgreSQL ${PGSLOT}")
+ if [[ $? = 0 ]] ; then
+ if [[ $server_match -ne 1 ]] ; then
+ unset PGPASSWORD
+ eerror "Server version must be ${PGSLOT}.x"
+ die "Server version isn't ${PGSLOT}.x"
+ fi
+ else
+ unset PGPASSWORD
+ eerror "Is the server running?"
+ die "Couldn't connect to server."
+ fi
+
+ local retval
+ safe_exit() {
+ unset PGPASSWORD
+ sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs"
+ eend $retval
+ eerror "All actions could not be performed."
+ eerror "Read above to see what failed."
+ eerror "Once you fix the issue, you'll need to edit:"
+ eerror " ${EROOT%/}/etc/postgis_dbs"
+ eerror "As some things may have succeeded."
+ eerror
+ die "All actions could not be performed"
+ }
+
+ local db
+ for db in ${databases[@]} ; do
+ ebegin "Performing CREATE LANGUAGE on ${db}"
+ createlang -U ${pguser} -p ${PGPORT} plpgsql ${db}
+ retval=$?
+ # In this case, only error code 1 is fatal
+ [[ $retval == 1 ]] && safe_exit || eend 0
+
+ ebegin "Enabling PostGIS on ${db}"
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} \
+ -f "${postgis_path}/postgis.sql"
+ retval=$?
+ [[ $retval == 0 ]] && eend 0 || safe_exit
+ done
+
+ for db in ${templates[@]} ; do
+ ebegin "Creating template database '${db}'"
+ createdb -p ${PGPORT} -U ${pguser} -O ${pguser} -T ${from_template} \
+ ${db} "PostGIS Template"
+ retval=$?
+ [[ $retval != 0 ]] && safe_exit
+
+ psql -q -U ${pguser} -p ${PGPORT} -c \
+ "UPDATE pg_database \
+ SET datistemplate = TRUE, datallowconn = TRUE \
+ WHERE datname = '${db}'"
+ retval=$?
+ [[ $retval != 0 ]] && safe_exit
+
+ createlang -U ${pguser} -p ${PGPORT} plpgsql ${db}
+ retval=$?
+ # In this case, only error code 1 is fatal
+ [[ $retval == 1 ]] && safe_exit
+
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} \
+ -f "${postgis_path}/postgis.sql"
+ retval=$?
+ [[ $retval == 0 ]] && eend 0 || safe_exit
+ done
+
+ for db in ${epsg_databases[@]} ; do
+ ebegin "Adding EPSG to ${db}"
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} \
+ -f "${postgis_path}/spatial_ref_sys.sql"
+ retval=$?
+ [[ $retval == 0 ]] && eend 0 || safe_exit
+ done
+
+ for db in ${comment_databases[@]} ; do
+ ebegin "Adding comments on ${db}"
+ local comment_file
+ for comment_file in "${postgis_path}"/*_comments.sql ; do
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} -f "${comment_file}"
+ retval=$?
+ [[ $retval == 0 ]] && continue || safe_exit
+ done
+ eend 0
+ done
+
+ for db in ${upgrade_from_1_3[@]} ; do
+ ebegin "Upgrading from PostGIS 1.3 to ${PGIS} on ${db}"
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} \
+ -f "${postgis_path}/postgis_upgrade_13_to_${PGIS//.}.sql"
+ retval=$?
+ [[ $retval == 0 ]] && eend 0 || safe_exit
+ done
+
+ for db in ${upgrade_from_1_4[@]} ; do
+ ebegin "Upgrading from PostGIS 1.4 to ${PGIS} on ${db}"
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} \
+ -f "${postgis_path}/postgis_upgrade_14_to_${PGIS//.}.sql"
+ retval=$?
+ [[ $retval == 0 ]] && eend 0 || safe_exit
+ done
+
+ for db in ${upgrade_from_1_5[@]} ; do
+ ebegin "Minor upgrade for PostGIS ${PGIS} on ${db}"
+ psql -q -U ${pguser} -p ${PGPORT} -d ${db} \
+ -f "${postgis_path}/postgis_upgrade_${PGIS//.}_minor.sql"
+ retval=$?
+ [[ $retval == 0 ]] && eend 0 || safe_exit
+ done
+
+ # Clean up and make it so the user has to edit postgis_dbs again that
+ # way this script won't step on any toes due to user error.
+ unset PGPASSWORD
+ sed -e 's/\(configured\)/#\1/' -i "${EROOT%/}/etc/postgis_dbs"
+ einfo "PostgreSQL ${PGSLOT} is now PostGIS enabled."
+ einfo
+ einfo "Currently, only one PostgreSQL slot at a time can be PostGIS enabled."
+}
diff --git a/dev-db/postgis/postgis-2.3.3.ebuild b/dev-db/postgis/postgis-2.3.3.ebuild
new file mode 100644
index 000000000000..87001946ec62
--- /dev/null
+++ b/dev-db/postgis/postgis-2.3.3.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+POSTGRES_COMPAT=( 9.{2..6} )
+POSTGRES_USEDEP="server"
+
+inherit autotools eutils postgres-multi versionator
+
+MY_PV=$(replace_version_separator 3 '')
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Geographic Objects for PostgreSQL"
+HOMEPAGE="http://postgis.net"
+SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc gtk static-libs test"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ dev-libs/json-c
+ dev-libs/libxml2:2
+ >=sci-libs/geos-3.5.0
+ >=sci-libs/proj-4.6.0
+ >=sci-libs/gdal-1.10.0
+ gtk? ( x11-libs/gtk+:2 )
+"
+
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/libxslt
+ || (
+ media-gfx/imagemagick[png]
+ media-gfx/graphicsmagick[imagemagick,png]
+ )
+ )
+ virtual/pkgconfig
+ test? ( dev-util/cunit )
+"
+
+PGIS="$(get_version_component_range 1-2)"
+
+REQUIRED_USE="test? ( doc ) ${POSTGRES_REQ_USE}"
+
+# Needs a running psql instance, doesn't work out of the box
+RESTRICT="test"
+
+MAKEOPTS+=' -j1'
+
+# These modules are built using the same *FLAGS that were used to build
+# dev-db/postgresql. The right thing to do is to ignore the current
+# *FLAGS settings.
+QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so"
+
+src_prepare() {
+ eapply "${FILESDIR}/${PN}-2.2.0-arflags.patch"
+
+ local AT_M4DIR="macros"
+ eautoreconf
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myargs=""
+ use gtk && myargs+=" --with-gui"
+ postgres-multi_foreach econf ${myargs}
+}
+
+src_compile() {
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C topology
+
+ if use doc ; then
+ postgres-multi_foreach emake comments
+ postgres-multi_foreach emake cheatsheets
+ postgres-multi_forbest emake -C doc html
+ fi
+}
+
+src_install() {
+ postgres-multi_foreach emake DESTDIR="${D}" install
+ postgres-multi_foreach emake -C topology DESTDIR="${D}" install
+ postgres-multi_forbest dobin ./utils/postgis_restore.pl
+
+ dodoc CREDITS TODO loader/README.* doc/*txt
+
+ docinto topology
+ dodoc topology/{TODO,README}
+
+ if use doc ; then
+ postgres-multi_foreach emake DESTDIR="${D}" comments-install
+
+ docinto html
+ postgres-multi_forbest dodoc doc/html/{postgis.html,style.css}
+
+ docinto html/images
+ postgres-multi_forbest dodoc doc/html/images/*
+ fi
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
+
+pkg_postinst() {
+ ebegin "Refreshing PostgreSQL symlinks"
+ postgresql-config update
+ eend $?
+
+ elog "To finish installing PostGIS, follow the directions detailed at:"
+ elog "http://postgis.net/docs/manual-${PGIS}/postgis_installation.html#create_new_db_extensions"
+}
diff --git a/dev-db/postgis/postgis-2.4.0.ebuild b/dev-db/postgis/postgis-2.4.0.ebuild
new file mode 100644
index 000000000000..18cd48cf4505
--- /dev/null
+++ b/dev-db/postgis/postgis-2.4.0.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+POSTGRES_COMPAT=( 9.{2..6} 10 )
+POSTGRES_USEDEP="server"
+
+inherit autotools eutils postgres-multi versionator
+
+MY_PV=$(replace_version_separator 3 '')
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Geographic Objects for PostgreSQL"
+HOMEPAGE="http://postgis.net"
+SRC_URI="http://download.osgeo.org/postgis/source/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc gtk static-libs test"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ dev-libs/json-c
+ dev-libs/libxml2:2
+ >=sci-libs/geos-3.5.0
+ >=sci-libs/proj-4.6.0
+ >=sci-libs/gdal-1.10.0
+ gtk? ( x11-libs/gtk+:2 )
+"
+
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/libxslt
+ || (
+ media-gfx/imagemagick[png]
+ media-gfx/graphicsmagick[imagemagick,png]
+ )
+ )
+ virtual/pkgconfig
+ test? ( dev-util/cunit )
+"
+
+PGIS="$(get_version_component_range 1-2)"
+
+REQUIRED_USE="test? ( doc ) ${POSTGRES_REQ_USE}"
+
+# Needs a running psql instance, doesn't work out of the box
+RESTRICT="test"
+
+MAKEOPTS+=' -j1'
+
+# These modules are built using the same *FLAGS that were used to build
+# dev-db/postgresql. The right thing to do is to ignore the current
+# *FLAGS settings.
+QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so"
+
+src_prepare() {
+ eapply "${FILESDIR}/${PN}-2.2.0-arflags.patch"
+
+ local AT_M4DIR="macros"
+ eautoreconf
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myargs=""
+ use gtk && myargs+=" --with-gui"
+ postgres-multi_foreach econf ${myargs}
+}
+
+src_compile() {
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C topology
+
+ if use doc ; then
+ postgres-multi_foreach emake comments
+ postgres-multi_foreach emake cheatsheets
+ postgres-multi_forbest emake -C doc html
+ fi
+}
+
+src_install() {
+ postgres-multi_foreach emake DESTDIR="${D}" install
+ postgres-multi_foreach emake -C topology DESTDIR="${D}" install
+ postgres-multi_forbest dobin ./utils/postgis_restore.pl
+
+ dodoc CREDITS TODO loader/README.* doc/*txt
+
+ docinto topology
+ dodoc topology/{TODO,README}
+
+ if use doc ; then
+ postgres-multi_foreach emake DESTDIR="${D}" comments-install
+
+ docinto html
+ postgres-multi_forbest dodoc doc/html/{postgis.html,style.css}
+
+ docinto html/images
+ postgres-multi_forbest dodoc doc/html/images/*
+ fi
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
+
+pkg_postinst() {
+ ebegin "Refreshing PostgreSQL symlinks"
+ postgresql-config update
+ eend $?
+
+ elog "To finish installing PostGIS, follow the directions detailed at:"
+ elog "http://postgis.net/docs/manual-${PGIS}/postgis_installation.html#create_new_db_extensions"
+}
diff --git a/dev-db/postgis/postgis-9999.ebuild b/dev-db/postgis/postgis-9999.ebuild
new file mode 100644
index 000000000000..c112970c7060
--- /dev/null
+++ b/dev-db/postgis/postgis-9999.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+POSTGRES_COMPAT=( 9.{3..6} 10 )
+POSTGRES_USEDEP="server"
+
+inherit autotools eutils postgres-multi subversion versionator
+
+MY_PV=$(replace_version_separator 3 '')
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+ESVN_REPO_URI="http://svn.osgeo.org/postgis/trunk/"
+
+DESCRIPTION="Geographic Objects for PostgreSQL"
+HOMEPAGE="http://postgis.net"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="doc gtk static-libs test"
+
+RDEPEND="
+ ${POSTGRES_DEP}
+ dev-libs/json-c
+ dev-libs/libxml2:2
+ >=sci-libs/geos-3.4.2
+ >=sci-libs/proj-4.6.0
+ >=sci-libs/gdal-1.10.0:=
+ gtk? ( x11-libs/gtk+:2 )
+"
+
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/libxslt
+ virtual/imagemagick-tools[png]
+ )
+ virtual/pkgconfig
+ test? ( dev-util/cunit )
+"
+
+REQUIRED_USE="test? ( doc )"
+
+# Needs a running psql instance, doesn't work out of the box
+RESTRICT="test"
+
+MAKEOPTS+=' -j1'
+
+src_prepare() {
+ source "${S}"/Version.config
+ export PGIS="${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}"
+
+ # These modules are built using the same *FLAGS that were used to build
+ # dev-db/postgresql. The right thing to do is to ignore the current
+ # *FLAGS settings.
+ export QA_FLAGS_IGNORED="usr/lib(64)?/(rt)?postgis-${PGIS}\.so"
+
+ eapply_user
+
+ local AT_M4DIR="macros"
+ eautoreconf
+ postgres-multi_src_prepare
+}
+
+src_configure() {
+ local myargs=""
+ use gtk && myargs+=" --with-gui"
+ postgres-multi_foreach econf ${myargs}
+}
+
+src_compile() {
+ postgres-multi_foreach emake
+ postgres-multi_foreach emake -C topology
+
+ if use doc ; then
+ postgres-multi_foreach emake comments
+ postgres-multi_foreach emake cheatsheets
+ postgres-multi_forbest emake -C doc html
+ fi
+}
+
+src_install() {
+ postgres-multi_foreach emake DESTDIR="${D}" install
+ postgres-multi_foreach emake -C topology DESTDIR="${D}" install
+ postgres-multi_forbest dobin ./utils/postgis_restore.pl
+
+ dodoc CREDITS TODO loader/README.* doc/*txt
+
+ docinto topology
+ dodoc topology/{TODO,README}
+
+ if use doc ; then
+ postgres-multi_foreach emake DESTDIR="${D}" comments-install
+
+ docinto html
+ postgres-multi_forbest dodoc doc/html/{postgis.html,style.css}
+
+ docinto html/images
+ postgres-multi_forbest dodoc doc/html/images/*
+ fi
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
+
+pkg_postinst() {
+ ebegin "Refreshing PostgreSQL symlinks"
+ postgresql-config update
+ eend $?
+
+ elog "To finish installing PostGIS, follow the directions detailed at:"
+ elog "http://postgis.net/docs/manual-dev/postgis_installation.html#create_new_db_extensions"
+}
diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest
new file mode 100644
index 000000000000..e6a81c2b1628
--- /dev/null
+++ b/dev-db/postgresql/Manifest
@@ -0,0 +1,66 @@
+AUX pg_ctl-exit-status.patch 283 SHA256 bfa7d6cd233ebb0a3e0a1c818433fb6c7d03282752c62d88af295d683e447937 SHA512 3f0c9187e315a5dde86b2c99d108f702416a69aceda4b00ed0fa5b6d93b883a1e1a38640cb091282a3a8441b5f7264e28d755667fd3395e6c34ad060b107d813 WHIRLPOOL 95f669116d56c7423385f07302106c950a0b1c5050dc4ab5650066d935be09b954cdc8b8fb7ce97c8f90f89a49063405dca4b79b433c5856a56c7e44362123ad
+AUX postgresql-10beta2-no-server.patch 3586 SHA256 8a032c51c11f15fda37cb669e4e501b59d02ac7ced5c1d79d7e02f0420ee6533 SHA512 d4be4ed02c62586aa8d2c3452eb4b804783e73d8200d484052bf82bf1b15c503a3328b19792a270912ed7ccc5c63c1f055946e32421547c95f47f1264eb085ee WHIRLPOOL b4d5faee78df9c36430d6022c1d1ee5382f1f66e78717c1f17937bfbfc193028de7d6f7cbd1960e16b0f6ce2d776c2748a66b31a44e0ca835308e7d74cd93848
+AUX postgresql-9.1-no-server.patch 4189 SHA256 6016251ce20d5338d612396bb935bb56f7d2fc7d525b4f2ac1f24ee79fdf013c SHA512 580063deb9f2427342018df0bdfd8ad0922ab72ca800f3b1b29d479dfa2736f573daa3434d47c9f15abf295e85ae6cd90401a40b12245e30c36e277f95df83f4 WHIRLPOOL 11ff7ec71b1f919bfbfe1aae4c4ae582ba8f28dc2a187b82317d8c3772217e7e0e0b0b7b32afe1a5c9f0825d28d05a2850b661f084832189ef0a486e16db6d6b
+AUX postgresql-9.1-tz-dir-overflow.patch 1087 SHA256 99132f6655dbb7e088301beb925c47d3c0cd2c9bf315a9db7a46cc8feb15a2f0 SHA512 9f19f345a439c40253f8b3cc110ed1a9ec508c446390cd5e713ae5555d12c6857ea565a1e9236a4c433af8a39c1b136d8e04894b0b1066785d09ceae2d58d3a6 WHIRLPOOL 4c2a5ef47cd6c7bfe1fc578ac9085be7fc300b68ab783aa4d30db6d1cf0c544ce1999511eae674af0cdf62644e7ddb854ef2b9bd72ac718b76ac5b898617a33f
+AUX postgresql-9.2-9.4-tz-dir-overflow.patch 695 SHA256 74d54217b25ef289a8c68537b64722b773a6e5076bdebfc74d49304d19ac1b8c SHA512 079aec61cc88996f9f25e1b6241cdf62587c51b110f989c7ad167eb3770569e857a1704777915c9e1db1cc8259b897a0472de2a43a331b7a6002b2e0bcdcc52e WHIRLPOOL 27bd081978905fc2a1bfac04b5bf64b3597a4440af42da6d1f1d7e8913801e72e7117aca80efafab4611eb6d8e00ddd5afc5937d4b4bb93c14ca64eb74c5353a
+AUX postgresql-9.2-no-server.patch 4219 SHA256 ae358e525dffa957053e0d730a39580b319e568fc3908f1c3a3feb2b1dd2b144 SHA512 e657389bd8d34ce3a5daa7f8432158758ee7a05e5a149e5257c88366dbc1b4f571a312f2934cf29ea8e5069ecf9726c9bf0fa5c908ba3e3e850d906d66d5b4a9 WHIRLPOOL 5821d8b24fcd4001c6169faf438898b5839d43293fa78a476720254e2d0bcfc05c0fe205e44a5b50e4692c5da8db8f30be7fecbbb94d152c5e361239e677e3e1
+AUX postgresql-9.3-no-server.patch 4293 SHA256 c745cab6abac271bf3dbcf76343b2fb17afe8be09c67f8694d9f9a4b4a4e87a8 SHA512 20117afa5a6999c6ae7f2b9adbdcfd2394a56c61d9c5d8c7ab2554a8de869d3aeaa4230a7dc4322fe585591277eb6ae47a594a7e605b811ed2c089d91cad6d4c WHIRLPOOL 95948a7be0427675e663bd476f25c9865e0532a4e5e71e02f4f2c2b0f4579cd77fa8a66b687b3565b8931d489ee6dad1e6c442a1d66e9d54f6aa3ffa693d9258
+AUX postgresql-9.4.10-no-server.patch 4356 SHA256 c163e530aec0bce6966c9310084caba06c27aa3db3187fd1ae74de68f67cc37c SHA512 1abfb624b01b925a834c1c4f292246fd676cb7f2241a4e26bf52ce9b8c4dc2e4beeb4eea326c44f758d45034d5f18370280a8b18114bffaba1841e9ddac45174 WHIRLPOOL 384a411d715f806a6eb0c8b8ddc2f4a3420f3886267d1e35297505215d80dbb2d01725c9ee2924f56f793339173d43a8d42b84a7bfc33ecf1c5ca61cbc4b07b9
+AUX postgresql-9.5-no-server.patch 4200 SHA256 fa7fce4673cefd973046bbe7ba7030a55098434f9792866603603cb7a465aa78 SHA512 8e81dc9db4928b7c1a9c93ecf1defb18baf0372ea9ab4dc3f0cf11b19ddea4a722dff43238f7c2cb32b230af7b9208dbbe341d2551685a50d575dfaf9c040fdb WHIRLPOOL 2e9f09b79360843f767e760fb23ecd70b4db3fb261cfb52c058d3dcc64c9b0495c6ffc1076e8894054bfaa24ca8ed1ff985f1e75a2c25e3befff461d1e7591c2
+AUX postgresql-9.5.5-no-server.patch 4498 SHA256 9ecf3ae2b845949579bb59608b9e697a66f11868b48f0d8cfe64bdb26fde06e5 SHA512 c961c7f1935b064e402e6c73dc6b087cdbea23d8038ef5e5aa5e625f7f1e87bb8d5986b95bbf9ed7c1abc40eeb89cda3b7aa4571d4a75ad6dd6c6d847de77c7d WHIRLPOOL 4f13cf9d2ff228ae80be77d4f789e7852078e2b54d4e25abdc288e42c59c62374f2951cdcfe9a62f88b7be2f2d17b04e435bb1516b01d1faa14672da2aaab55f
+AUX postgresql-9.6-no-server.patch 2104 SHA256 8827022d5db77e770cc020c6b401bc729e18f06f80063910e637c80845cdcead SHA512 18e48ce275854159bd99cd5eaf8ef38cc3cd94d5365976d917f9f6088b3d62ed29f7e16710fa9cf4b08dd1706e539289c3ba33c345ffa47ed22e5f3d17e8fd2f WHIRLPOOL b6bc42d830bcc6106cfbbd8600621b56084aafc3be06d440a3f123f128eaa65897c99312d0372128ebb22158ad1f75b9a6262c3bc17c16562f19e751d469c567
+AUX postgresql-9.6.1-no-server.patch 2886 SHA256 6eb915f92ad437a8ca76b5c333b98ccc2b352d31f2cc8c631e6b149bf1ca49b3 SHA512 41e884b8b1bf64df47e735e62fac2275a100c6ceea95861da61c5f6cadb32214d43dff8e6fe5940a7bd069b49c437e3162604e69d041b6b8495231ad6e7730fc WHIRLPOOL cbaf6b9e12ba7d52a953a44d3ece5afe1308ec8f0d5ff1543248a1a38ed94b82cf986b6b8685fe2254aa8f985310660ba1337bb2bc6f2bf50a006c975a989c91
+AUX postgresql-9.6.3-no-server.patch 3555 SHA256 647ca780766dd15fab8a09e5e8cef2060edf096a93570003ab5383b3586c5fdc SHA512 c70a4df16d865ceff7474f1a1ccc72d4e82e73a09792edc787a7907aa419985495871d07830390982bc82c82723fe668fb42b0dd239973804532499f39696dfe WHIRLPOOL 8a99670976b76c6c220b5ac40afb8bcc5f5dd94b6dec2c9901c4acddde6c88d7a0a06d328d0228ac6763be4cb93142b2618efaf8dd77940219d3397965db5712
+AUX postgresql-check-db-dir 1013 SHA256 bd39dc7d112c42330afb94abff0739afe5b02268fff7c89f60306f6e7c22956f SHA512 2f34ee0cb6a889500ccfca7621ada6ee1bb06dc146f3c556938152dd3d7c0312266bb4db5f4099838d93ade26e2b8866dfddb3576cb5a737431ea2befd0cec6f WHIRLPOOL 7e7cbcd2caa2ebc97e96fa50a340b44b8abf3d1cfefeaa5676ac78860735719f27a98b1ded02108d349e75db4b533bc4fb31402cff7e3cbe1e2651a1c43781a3
+AUX postgresql.confd 2202 SHA256 57c1ad0b14e8458024c713dd8cc2390023b95c27ba4cbd637333b1020f11f398 SHA512 ad4e66196f70d543d396ae72db6b0beb2cf8861f612dceaa1a1333b139475262e84bcf40774155254ed1cda7ada830d76f60b27982d0cb840360cc13fbbcecbc WHIRLPOOL aa012a5f302dccb362e54b6fea1ae6193330cc41c632b132c890f8a578f6f97a7ee9773057ea607b4f4914c97cd845dd4778c1bc29ea62b5ee1ff0e5c56f2211
+AUX postgresql.confd-9.2 2450 SHA256 550c3d081021aceeba197d3ee4ef597e4be168e6dfa7fd3809d84ba5537d56cd SHA512 a4aae13cc0312707d77d3164da6f573c78360cf039bd81e8e0dccd19cedf701a227315aded0a412531217398426e357bffffcf9d374614bcb5bfa398c946bf0b WHIRLPOOL ccb2878553e6c01a27466bdbf02fe0a1f901d4cba853d8b9dbf144fa7acb61ab8e9b878f6eac36d01f8de4f434bfaee2768c058ca8dc82b887704fdd98166235
+AUX postgresql.confd-9.3 2477 SHA256 1d144dc8c5eb2a9a345823b6b4631f633c2d83e49c5c18ddda1fdc9fd4ace925 SHA512 c928364b2b8a555443db8c1ac2a7336cd5e32ac860f3238a0a791cfcdfdce941837d72dfa44f3f08704d528590f9f3bb479e25b7db9f32cdde76f216819baa9d WHIRLPOOL da42d85f32098b82469d053370bdba68197cdd10eb87ea5adba3c08e1847fd883bfda2cf486a0791d8d751066d45b46ee8d26e178516605f1efa95f9db7ce32d
+AUX postgresql.init 4162 SHA256 031f010ca5f70ce7b763c7d1f1adf13fce1c09dcd0afcefa057dd1b3bff45063 SHA512 e0052fda5d71b9ba06ad7a4517c7bb2d6bb186acf3686095d7217b63e4f5b45f21e3f90c1ac9b0238143d458081eedc36167af6abefe95e197c31f9e429d87a8 WHIRLPOOL 43db9eeef47aa3457e4c455e550e779537531b30714cadd584df3ad137ac6dea4d25344bb811a2f46a5836636b012628110062d600b5b74ea091a07b780900d9
+AUX postgresql.init-9.2 4911 SHA256 a6f36a0524d1a77279e3b4f5e3d2a950a7ee595f39c1ba12f752c2bfc5fa3faf SHA512 bf51e7fbe02344f74a76c250c9804206ec7d3b988f99ad3476d00422ef2eea9c6ead7133a5adb9fb23aa7c0820f450ecab48f0c1a1a12a4e5ef5fe2bef48a0c0 WHIRLPOOL 075294db5d4507ff1c7380a1bf6659cc1bdd94747663c0fe3333285241fc51af4e9b1f06771e6a418f149af6ba76be7ff3f6918913684f3a5f68002d0b4de1fc
+AUX postgresql.init-9.3 4187 SHA256 120e872848eb13c949179b22f00a31bd043823ac75c547374225c6c3620a827d SHA512 dde933a673b86f5ff9355acff036c07ce9c4b572b127e909044e0c0502477d9d7e8ea5655cf9a53c198c15787d83ade231c6f33e3ecdec45f330f4a6da24da30 WHIRLPOOL 664925ca5c2c202e905a262afeb20365933fd28cae2f22f80335442b266fbb64e5149c80a350480b9153737646a43e0b2dbbbfebf5273c5a640ab6ba81886094
+AUX postgresql.init-9.3-r1 4999 SHA256 17c4639ddab32215cf4ad472394cc854b8521b28f736fb48670c83a2835989ab SHA512 cd181bb6d3ed72f786cd21a5c0c012bac3847adcf9da2e0b78eb212c9515953b2f1a2006faf475bfaa9a8c91371bda34f558f83ae010daa7cd670923526e39a0 WHIRLPOOL 14adb59dd079b9db8594cd3e6c54143ccc2b9fdbdbc3cbf4891f60ed2117ebb07cf9c9a8d60c912f023ec0c860bc7692318081ab368a265ceac1dfce43e3a6f0
+AUX postgresql.service 1768 SHA256 a5882f4f4b8d391a1226c5dc514df83342107c94880e32eaf174d152f280de88 SHA512 92c60a21ac87a298742d0aa0f4180218cebfa5644762c32a27b1314d92a581eb4f6cbcf41b20f29509c6eec9f6f236a57d2c944aa1eca35d7f8d29e2865b47d7 WHIRLPOOL 5f58b28a903311b4b59452d44c1cec3dab792bbb59b73eb5ae3926f64f45a5926bbdc7a17f460ea66256c940aefa560c89ffa49999fedfff69f223a63bf33a03
+AUX postgresql.service-9.2 1666 SHA256 2b1b4a98ce32ae229774c6f303b54ff7a86aa649e2a20563749f84b3334ed1a6 SHA512 8c64b59f1e80096382a7166e1e8f183a5b9cf14c75138c15a39de74b983bfbed2f41cf9b33b2c72c3b9c79130c10104836a3505c96cb18ac1be1297c0fce1af0 WHIRLPOOL c4feda1d51204b87a53fc747f983047955be71ffd3edcd96004edff9ec708466d3c38f84c3898a3b54a828487e84d188897be99b64e73a5b6dae18a53cfe7110
+AUX postgresql.service-9.6 1579 SHA256 42c0a9284f3c7afd4148b8c80c8ab9f7a84ece2b20c604d2596fea4143478dab SHA512 e56abca735c4ac21ddf39b15ed16b2ccd1d0a2eec9be05ac1d12ef9a4972309206b0e551dc04bd9238e6c1c4e2b7601c8caef796cc9bdaff28357b928bbf0d85 WHIRLPOOL 2122cc8ab5060e7669fdf4ce7fdadee33b3179a5484a46085c1a1a404de3a332b2484c5b1bd2f5472856c9107a0f284123e0fe09f130384a87f8d463ac736825
+AUX postgresql.service-9.6-r1 1477 SHA256 42c8458a3e58e38c738d003eaec80d788ea2f5ed8f23d0d06d61297d0c0a804f SHA512 9e2b04923f6ebec1424c0f276c58a6a0c4933f2de5e2a9776169227729afd06ce5284461be8b6ed70e5aaff2a68b9f96c6893d867d35761c9977f9847ccfe93d WHIRLPOOL c8068b9ac951b79c6c69eabdc51360eebd32964d8851335c8828a53482ab889d210c8bf00b36550172afa9d171886d90e574a5ffa37ef095b5a9f62d37492051
+AUX postgresql.tmpfiles 39 SHA256 648794e824e2fe61cbd591c8d533e15391e47382a68f56038b075acce5d3f112 SHA512 498060f2a597cf374f4fb31deaa2d6c5b00edef68efc0e71b82bfc20b717ae12518ba18fcb455a0c518ebba1a0868f38321470616151d02fa79b889a66dcb9f8 WHIRLPOOL 6288c1c2b899d3b2c75fcde1d4cabc9d2421aecd4ede13a8355f36a96986cddc237a03698dc27ebd9ddf87b682fb60f0cdf816829a685fa574ca7b05746ae493
+DIST postgresql-10.0.tar.bz2 19639147 SHA256 712f5592e27b81c5b454df96b258c14d94b6b03836831e015c65d6deeae57fd1 SHA512 88295af13db77a85a604c925aa627d383fdac62c1185119bba87753ce4167a13aed0f055a7a1329b3051f8757c6ba7529baed00a564ef0cfbee685720f282678 WHIRLPOOL 134ed8b17770e53f0a898c0b459a6abaaedfffe71e4eaefab6f9cac44b7a1e4d30da83949f65fe4567751bf58d6be4dbbc973f243af6130ca13c6919e4231470
+DIST postgresql-9.2.19.tar.bz2 16466698 SHA256 1d29d73a4f590fcc348280f13ac2ff6a0f72c94908c54e3c20b7ab1560e8dbad SHA512 d3b4c5578bf6d6580028e775bff81a921258cb53b6b06567d96a352d14f3b63063adb480b2f5e2029baf8a034e14b5cd75eebc04f1ed7b16c849e1a5ec1f4867 WHIRLPOOL c13b45fd7aee08ea472557c9f40d79c45abd572fefcc215002b562b8046b1937bf522f6f7f6e280ff1e434c9698734cda9f1c3dacd3c8fee5f33dad0da21f75f
+DIST postgresql-9.2.22.tar.bz2 16531224 SHA256 a70e94fa58776b559a8f7b5301371ac4922c9e3ed313ccbef20862514de7c192 SHA512 3e5ab04c2be2719579b2ebbf64b220522acfd9ea74029dd2ed699f60230da224bdc99de4ee5529b513e5586de0377764c4e54deb3dd93d5c53c4d666dce2b6b7 WHIRLPOOL ff1817463b488f4793cd0851df846b961d5510b7c1cf4a560717755ca47c363eb782bc1f2cd7a5d8cbc49727dea64394c6b30038105fc584749157157948964d
+DIST postgresql-9.2.23.tar.bz2 16531436 SHA256 0e6ecdfeed69030dac8d219ecd4c350ce45e9f2caa9d73e166e407e87afec450 SHA512 9715cb9aa34921f7d246837c6c516d588f88fda543ad635520e9575a5ea448ad39062f2c89c086c7f129cc5f61f4dca33e4f5fd94e1df39da428507c56a81ba3 WHIRLPOOL adb7b0b54661e5208967d6158591b918e776a998d34973c907afac83fb50870f2357446ff40bc7a0fbc71723c12c299b0a29ab3b8a71c1ab5b302281d3a0cd50
+DIST postgresql-9.3.15.tar.bz2 17059932 SHA256 a9fcba1446a93aa95e3e1b6535756f0472d10b0f267a0845f8b2b29f89de5c4f SHA512 35c30cdb5599f99c94ab921f9f5e7671a8c0b7bca8fe3b616630ae13d6eda8d329e77e7e802da6a83cb09c3c9ca10fa8ce0de8a184e6fff471130e1cd68ce762 WHIRLPOOL 7a627b2da1dc3671df7edfe58420f81ce24202c1251225054674d79e431bc36e1a70c84aaacb76c59e9eefb26429cbbb9ea80c45a989e3564b69e334d3dd4d84
+DIST postgresql-9.3.18.tar.bz2 17194269 SHA256 ad60d12a5a3dd0f6f5904c41b87e43eff49d3f74e45129fe52c5744366ff2fe0 SHA512 df3f2e0bb396cac74021fcc1a989d04515c12e73846b7392ae859c32668d73ae0027607426072672b6228d7533cc512f72b5729bf5c8f7b0e8d0270727784455 WHIRLPOOL c5b3db88e01c507556b354acb1ecf2bbf43246d023c5d9e1d8479ce4aa9944beca518abbd3e810830af1d75356272b4df3eb58358edfdd265cdc395f62ac8c33
+DIST postgresql-9.3.19.tar.bz2 17190203 SHA256 fb9e872cd9e927ba331690d86bc63dcb5a596acb7a536fa0518a3c7d43ac2fb5 SHA512 7293d75b97255720c30d342e1de6032e14e9112e283d2668e80320f76906038d7419ffa7a12eba1fcf9f9274595db10e372db4999b0845cb55998d47f683ebb1 WHIRLPOOL 11ca6ea696de3c25bdaf6073ca4163dbc2f7699772b38ea2c3aababd5b3fb0b0f05e55fb3c255556e35ea3f2feab7129ed5c0ec3944d2f430d0681c33fe4d398
+DIST postgresql-9.4.10.tar.bz2 17802812 SHA256 7061678bed1981c681ce54c76b98b6ec17743f090a9775104a45e7e1a8826ecf SHA512 2fcf47769b22c69bc82c9d6edc317e18dfcb4a96534e012bae4355e5088afa83da98b21e08a07766794f0a166888acbd16705a806464ea11711ed97c3b4012fb WHIRLPOOL e6ed3c209043cbbacb0698e1be367f20028d649d4cff62b5d6edd162c6ad629a3ec5f55854bd12334a3d3165462fecb34188bd62cd398cfc242a3579810b5b85
+DIST postgresql-9.4.13.tar.bz2 17867502 SHA256 0080f55d65194de8b96a2dab153443f8248ff2b2b10e6ab4cda2dcadcac7f2ab SHA512 98e5721ab1ebc88070a5c2c9ef10e4fc21825de495db71f011577aa15fdd31c2dc0429d48e1624f7161c9d31dd75de4d8cf4ed2e34006ed6d1852f04a948e932 WHIRLPOOL 4f963b81dca21a2f3f5e047b5cfd1796d103c0648c4af0250ffe2274ed71011634dfc1e8387fe6dfa6589585a8fcb5accc9878c461978b9abd483b85f6ea3e68
+DIST postgresql-9.4.14.tar.bz2 17873740 SHA256 8e7df23a104b057b360d03180ebcb67f645e198a4a0bee94bf56b2bc9505ec6b SHA512 5952479b7c911cc381744e72d44c7c2269f98f4dda677e8c20a8ac7f4281e143017d287634b707ed96859e5438e82e96668bc4c68bb0c2ce9f3853c5a38fd0b2 WHIRLPOOL de4deeef5fca6375265665cc847b693a39bf09e13d8dcc717090b808b82a6fb5cab5e0da0bd7f9bcf299de979d21bbbb6845a0419e6967519711c6bb7ff559c1
+DIST postgresql-9.5.5.tar.bz2 18525082 SHA256 02c65290be74de6604c3fed87c9fd3e6b32e949f0ab8105a75bd7ed5aa71f394 SHA512 727ab57796cd393ec3755e9aabf515ebbdc3152b4062c20e64511e866a7e7038ba5c5e2843f13f3a79e2263296451f0e93108346b6f638611fba2449394e338e WHIRLPOOL ec5262fd8cecea20fd12bcec8e6e015817ae8181d9e9ff6d8aca6ed43cadedac1bd5006c3d04262b99b9a79aa02c409920ab3392136f3ff3dc480fe1155cade8
+DIST postgresql-9.5.8.tar.bz2 18670910 SHA256 ade57068f134f36710fa953e1ef79185abd96572f8098741413132f79ed37202 SHA512 4a11f0a16df460391c8250122ca8bf1ab76e49672a8c003ed09718bb4ce2aa57757e7aaec6e41b53d0d1ada293172b974761606647fcc8b4fce8807490b6ef10 WHIRLPOOL 7688ddeea69449d2e2a518017d306f6c17a08becb258297cbf4bde9f3734c5ba2129a9660b448df458963a7cdc796bbb72f2798c20abd3d50d1be8d4f3f94ec1
+DIST postgresql-9.5.9.tar.bz2 18677113 SHA256 e98cd5c664ab5a05cb83618ba8078647815cb71f7a60437f0322c7518727cdd4 SHA512 2c6a887b80a4b1d1da18282f443419db2279d8fe61821aa6ed1e9af6d28dda41959981ccede2456bd8835dccd16a80fd485ebc0a1bdc9459996a5d27d7781c55 WHIRLPOOL 522c7927c102b9a3bf14d79d00cd9d598f02dcba97f5f6268f4d1fc0ac20773bfcc96bea945ca958b3ed499af3d1555d8b731a1ef0915d919923d54915090147
+DIST postgresql-9.6.4.tar.bz2 19566875 SHA256 2b3ab16d82e21cead54c08b95ce3ac480696944a68603b6c11b3205b7376ce13 SHA512 b0527efacce6efc09340b68c8c56483cd884676e01cb6bfb4f9ce63226a394bdb0bcf3d832f84e4dff5ceecf09ef4cf93e9fbd0ac453ec85efb11ac50a7dff39 WHIRLPOOL 6296114c2a6f690428754278d11fb93f2142c28bc36e0a17b4b075b60ee90bf708d73d68ff6e8118253ef22e54cd5e325094e3675eccb7f060e32af2572a65b0
+DIST postgresql-9.6.5.tar.bz2 19576132 SHA256 06da12a7e3dddeb803962af8309fa06da9d6989f49e22865335f0a14bad0744c SHA512 ad35c27ea55b18005ea61b49d6994718df86519b3f99addd0ecb17ece1f1c34764eb5194f8961c45cfa75703d810baf54433f8538cfd43a70bd908e1e5878df9 WHIRLPOOL 19e235cc5583b23fc00c3cf47a77972471f39753dc16305e880b22e32395194bd002dd86da1b59be795a9df7786b02764af513aae992a0bea00cd6fcbf349c41
+EBUILD postgresql-10.0-r1.ebuild 13755 SHA256 90d199e06c0992613b35a51d06f0d786a155361fdebefe78672fd092e6fb5bb8 SHA512 60c6f0d5ecef9db6d0095b1a3010dd8e4a3af1a94e69bea90336ae9ff0dd2bc48607016f93e8e56cc3b755d6f20841cffe70415bf9bdbc84c73a4a55e6990a0c WHIRLPOOL e51bc1c90d09f06304b68c2cddcb0e66aa01553fc7a8a093e3e25775c7b634913334e372ef4ac8163b6dda36d13aec13d15fe16b7dfc20e9e42e1ef4a02cfec4
+EBUILD postgresql-10.0.ebuild 13607 SHA256 348ceaee92275ae06c259bf7c568f9a771f8a269bd10ba550db8c75fe22ebea8 SHA512 fe84e6f2e87505cfe5edb0d571f54465cd2e7d05ea9a62a1e6b9f2e96acf36dcfa6adc7995e80eb4b2d27c42c0c4a69e476f4d86068124755f2a6cfbcd623cb8 WHIRLPOOL 338e2685a058e9a256a01dacb1d9346d858ca66d8fe5f991a1281c8e9e23a7e5af1e33390176aa749202ad6d196d1b1e08337e8c026a27d09511d8afdec1403d
+EBUILD postgresql-9.2.19.ebuild 11735 SHA256 138e40dd809a0af6cd2a227e5b5fbbeaccdc429942a9a72f9627f47fa42b0fae SHA512 a8adf4f3cfd3ccdb22f0f1fd8c2ca2498e6a06643b62bbd6349ec1728ef9af4832ec27904c18fc8d8d43b5f1444c020c5214f4373a556d9d94adf4b0b16a72ee WHIRLPOOL 66b702a7a9c099a0489e1d364d0d31546f4106843a10a872fb911bb055e37d668bd819d104000b42801311b4dbf2b5ed6159e5b412af91d7c5419e05b228109e
+EBUILD postgresql-9.2.22.ebuild 13345 SHA256 dff3fded6bcced845bd0fcf77b7fe126324ce0a31922144da50e1e9ad5f35f56 SHA512 c0286afe4a066ddbd32b2cc3d09e5f86250b7656f2148dbd2128ec3b650260a0af9f67cbee02fa3f3bbab880824b2a692c93add8cc705d22c1a6664ec7dd3b8f WHIRLPOOL ef4d7d6158ec832f13b0873023e543e44c2ad1457baa31cbfcf74647fb15cf7bb1a4f0c928336a16aeb99bb32fc44f8fb4bff81075f573101d6619b079b43ed1
+EBUILD postgresql-9.2.23-r1.ebuild 13541 SHA256 d93f312199b82b0541928b4b2a2906212a2eef6dab348c0b85198e44a296b65e SHA512 380dfda81ac3e5c6bed023c899f102eb97c7ba9b43fca1bbee101b599a69c1cb51594dc5d5171202a415774c719b94f4fb6573575f166893d0c0ec71d9534dd9 WHIRLPOOL aa2e2b9c3316dabf2837006c843f58ac4dc6571ff076be584699d534f4c16421bf8dae778425c68d122c5a031083887eae28bf112c0e9cd51484fab087332930
+EBUILD postgresql-9.2.23.ebuild 13353 SHA256 cc028ba5d35c865b4971f0d5103f5ad17a899d043e96c2a594815e5513c1f95b SHA512 99cb6a49c13473d45f5c399458df5b1773fc23f61070ca9147cb8e25587fa8ea8e18cb38e608aac3eabaad0f0317b14ef7057f9456b196468f25c57d5003bce6 WHIRLPOOL e80339f1016007d470375ca36b781f423ec53500994388a6bed7e0c548186e117dc86514a2e95648a0a23ec74f4e28d2adda33b6f4cb3d385e43c486a2dca0e5
+EBUILD postgresql-9.3.15.ebuild 11990 SHA256 9e98677996c9a2aa865318a437b5f19a45dfc989709701b074d4d62b2ae333f2 SHA512 b6a66d1a6726d0c6ec545930c6cb7d0379f7373e75ab26ed2510a15e071a1223bfbdecd66583be5272b40599cd41a750d172e86406d24533d293d2474ae215a7 WHIRLPOOL 9fb156077e4c2fab054dba97b5d73fb33aa46eb8b928c85c64af0aa03a1a0797d0b2a3106671f49490a020fea62174dd9a670899c63a3ef41ca0376f08638581
+EBUILD postgresql-9.3.18.ebuild 13604 SHA256 c3fbd47ca159d367eeb583dd86208715e4bae9480f9e380b3a4b199d3121eccc SHA512 ff6c8e72feb7e742104865cbf9310b21969be5995a3c723cda19288238b30559c97796c3f25d6a0da91adc366e6b8d242240f62b08b8e20b18080cbf6be875ce WHIRLPOOL 57a37c19602846b56279208207d9a6661c65f31b6355fe42fc396da6459eabe212b86b4244fd3186195d6be7de6591a8a0990a0fd91ef0e5945030b013cc0e55
+EBUILD postgresql-9.3.19-r1.ebuild 13800 SHA256 438d34bef1412db604d8ed263cfb7c6de1a56a09181f1161c6f32b6f20f0be42 SHA512 a494d82d83de9404e02d400152bdcdf4bfd86c568df5a607d64b547d0c47c9acc752338fc555eaacdc72d6c01a041bd25da90e17f77d0ef7c270046f597787e9 WHIRLPOOL 6e3896bd1536fae1066bc0a4d1080ea171b372ab6a710a1a087f5a3c687a6869c72e34fba4c8fb12a6f2e82d45e0c20b5fc75d1ef05429654aebe170447e5275
+EBUILD postgresql-9.3.19.ebuild 13612 SHA256 e67affb945cb1f0e8a1ffc1d2f3462b7769fe7e08739bfb929b32849ab91b59b SHA512 7edb5e2a49852cb9e293e116de5f3495250aed637a9ca62d7effd76232499a1c9e56e4ef683c9b65252a41b0323b78fd8ddab0ca664033be1ce199dc2178b167 WHIRLPOOL 87255163b5e4d791f4aa645ab4f061c2935794782eea8998857663398db1978c125fbd9bc99360b8af31628a3134b2b9ae0f93d0ad6c2f32453d05154f7f3e7f
+EBUILD postgresql-9.4.10.ebuild 12800 SHA256 56748a56a6eb3e4cd8d75c4157ca9f1db4ce094e4526e7617fd7a8abd2a945e5 SHA512 e871945bf9027fe9288ca22d44f89c4dd51184be830f06ed4debfc4b2848dcc914c6ac559bc16853fb27331305ac15d8b6cd1247f10b433029f30a16b98de78d WHIRLPOOL 3a86bc549b1ab99ad7bbacae40110b9c5ee3b4ca2fb84e40a3fec2646497b8039ef3edb61b07fe551c77c2f697dafddd6111967854521c284bbcabab763f69da
+EBUILD postgresql-9.4.13.ebuild 14414 SHA256 b1191ed2503818964af23ce6476fc0ee39a81af45088ed21e1a9bbabb7e30111 SHA512 ea30a21f8a5604abe407231306ba7b944c1e84b8ee1b8eb29dcf08b920bb11d46ce93cec82c5e6147608ac8a318daa2255377dbcf403415fa1a68cfe84de82c9 WHIRLPOOL d63ab0c21f3eb0c3a12fabede3d66b8854350bca51ea451ae0a2773ee242363fa285bde5c13b9c45f8c8b996d8cd5035862c28e5d3ae9d3b192a2acbaf2f2ddb
+EBUILD postgresql-9.4.14-r1.ebuild 14610 SHA256 c06f2770f6ff15a5dbd2e04de6c59ec2679ee2ce5f03eb5840fb4920169bd204 SHA512 1eb925c156cb593e55ff349784a77cbd87a0fa18ce2c589bd63767f5f5ce1e1c5f81a5329ecb1b1ebc6ad55f0e56a8760bb55765f4682687c98b4b570277ba39 WHIRLPOOL 5284e65496462b3190c5f2286a275764132402bd17c0837b52d01bb7458d711c6c9b37af84744542a523e42302548e1bc3b97c25d3353b5967d413ee912f7985
+EBUILD postgresql-9.4.14.ebuild 14422 SHA256 ab3788ea2074c5f745e2cf16f20edcd21ab3d200d4e771cb1724c83431d4b6ae SHA512 fa0c366667b1e0600bf3e86091adaaf7d313a144d1d77bab5235d4feec6f7c9b46eab26616c4f8a9490c1d9b139f26ddbbca89cc237453c09289eb75624e831d WHIRLPOOL 9ba46dd9d3daf8412a3644ca73caeb8ddde945818dcff798ca6df0efbf3a6770de1373c1fdf4cf4b65951977a9f0b91f228aa29fcfd07cec57af132298a361e9
+EBUILD postgresql-9.5.5.ebuild 13139 SHA256 6c892bbc3d171aca36611ee56bc95d041b149d6ba8b9162d024a30cb5902ff63 SHA512 1de5c0764000d9f1ceba56931d8b0517d3acb55905c0a199d029a7959e2bf7bd0449d7cf335c9de97f5ba028f87c1b5d135d35813407b3726848570229bbd936 WHIRLPOOL f839a4a5543d3a0aae87039fdc0d8486c71e7ce02d907d95aa71ea42fc376bc9289a56c50c3148212f4a413eb4a2090cdd6762ca3723a9cb2d7fcaeb7379a64a
+EBUILD postgresql-9.5.8.ebuild 14642 SHA256 0902de32099cab163eca68a01c85173e21c82ab2f509f9a9520e9ea58b8b558e SHA512 901fdc87137be8b4a1bae48efc9cf355bb1ae79c326e929c36e18ea35f767f8e6fb82abf63570ccdcec0dacc4f4d6daa92ac9a1e60da07cc7e46b67552949bf4 WHIRLPOOL 6d95ce1a79081afbac26485e3ddc7caff166bfcfa38f6c8b3c202e23c74e56d6041c16d5873e5f20fd78d7c54c4c2eefc4d2f6578fb8afaf761b07abea45cdfc
+EBUILD postgresql-9.5.9-r1.ebuild 14838 SHA256 b78e896f248434b46b81e6d6a4c943ec84b8eed8cf8f8fc448f9b4ff47e9bbd1 SHA512 33332df4890fdaea9e426ea3b9a2060bf5e15f882ff1850af75445c20ae90a2f7a8b4920644b640f8f2b54db9db6b08fdaa412299f482d0c4c9b918e2bf1a5dd WHIRLPOOL 91e3969ee3ff9751543f6cd216d31217274a5c8acaae579cfaba73b063afdfae7c2936379919d4543f17af08afd905623910e1eb2e55c710bd0d3885ce67f7f6
+EBUILD postgresql-9.5.9.ebuild 14650 SHA256 66f174eb010fd59e2e0e0d656ccd7fec3740118e05270457b560e0219dc577b4 SHA512 1f81e0d8c2b5e3cc629ee3b7900dad6c3edd5cfb1830d05a1b9fc5d9dccc1177cd699f7c4de8d2fe8d00f5fef36ef17232ecac8dedf33492d698cb5bc23fc961 WHIRLPOOL d4098383fce3fef4cccc08735f4e0df754a6a859296e16767714e80be3c77afd1169d1adf19cc21412dc51b5f821f9b8d899caae5b80813a36895596f5b7cfe0
+EBUILD postgresql-9.6.4.ebuild 14824 SHA256 e97ebf6b5b838853f25c51961cf392bf8fc52150eb0cdef51f6874f4e05c379c SHA512 10d8beb1db4ce1220f64877dcc732ab22a883e260c4eef0801123adf0994a3a2539455bc9fc61fd40388be2160c3da506764373458fd1b209b340a11d018a051 WHIRLPOOL 51e9d56b16656187a3ed3f444e4310b94804fcd13c4def7913479386c49957603a6fc9a02c1bc68986bc5ddc303bbf71f1d55a2f33aabeec117e1da03d4d07da
+EBUILD postgresql-9.6.5-r1.ebuild 14980 SHA256 82d17f4d81573d41cd9f50b88c2678769dbf4270056749ff9fa0ebae9987d6f5 SHA512 31a1194cd7dbd23ddd5c1ada080d64504da399d418b0ddcb71a7ce7cd0600fc7373ccdd85723e8970308cf587aacee6ff8744c73e2801b9bced3d108b09b4145 WHIRLPOOL 2b9058a1effa914f3d507fe779650452d8efc4e9c5044e0eac4af5627f1d04bb8f5e57b6d74d6a6a78a034d963aa829288893af9004d8a263b5a98dc93d9efcb
+EBUILD postgresql-9.6.5.ebuild 14832 SHA256 aa10bb6693070992994620f9507d3960063dbb2f7ddd4e0c6ab61e6c204a6403 SHA512 e063329853426a7052722191ed12a98beed3170f77da7eb395def5bfdae8cc335686a6866fa24bd01a6daa664845887dac4117cef95e1f4ad0faac7b35290604 WHIRLPOOL 4589b1f57db1f0ff512826ce91f7c33a17f7d18081ca7b2ef6136c0f741597a78d5417dd63dfc7ab2f98da46e55c92b62c542920211666da9dbbc92aefd74fba
+EBUILD postgresql-9999.ebuild 13581 SHA256 b2d47e07868d66352c879f9d911ed713de9881d05c6806d2d40b3515268cdbce SHA512 619ba19094569be077c69dca78674736bbde7cdd84e8cc4bfb8543ed69f8f793691e5e75fcbb15c4f1195fc353cde8fb1586de403874102537d546218d1194f1 WHIRLPOOL 5ba4d032b598591440c50fcee150b5340337e7e374c8eac8d99925544ccd87af414bf8dae358390bf1d323619dae45026732e4e19634948be560749d9f88b2fc
+MISC ChangeLog 34734 SHA256 39191b7df137cd50c7d8b834b673d517709d6ea867a09ce8eeb2fd42cd0d6b49 SHA512 b405d44ca7ede523760599ac3ceac384a9abd4a73a2fe47544e90c6259e6fe5766edc147064fba7fe9f2926c4cd298805521e2aa5da63286d5d8ba1bff7dd27d WHIRLPOOL 8bf92c120033a40cb4b5001c9b9e5d4eae858754e8e7552f0864a7c12020fff770bb755008928af0685035a5e01fad2f12591ef365397edbd877db314f99c7e7
+MISC ChangeLog-2015 18629 SHA256 4f6c87a86705d9d4597dcbd319d207c8b45f4dba38455f1466bdcdaffb65ba1d SHA512 2604c3af8d03fff5f293c30b5c6bbfc801c0b99fa5d20021b365795e2af50cc65c73972fb643e594720e28ccf5e873503550eeedef262375da63b29442e80c96 WHIRLPOOL 760146d15f3f656816be71d4d4b27823975ecc37c13f03766c38a0b8a3c2cabf15bec3da2c01d843859e277937815e85532a17327650dc221c4d22d01fece293
+MISC metadata.xml 751 SHA256 97274deca46bb3ef708b8fe348946d9119220d8ba34bf90c0044675a00eeb5f2 SHA512 726f30ec991194427b2dbcdf650778dbe0f169cb305d569918404d403deef397aef7ec3f1a5269c15f7ec7fc5506dc534203323379f1d0acc475eeb8d75d0cf1 WHIRLPOOL 8372aaaaa2044be729eaa5d2e620dff368f16bacd450a48b048338a51f1500fc85fe5865d68f3e06b783732e823566b6dc7b7bc4f6149893cda8e452daefc331
diff --git a/dev-db/postgresql/files/pg_ctl-exit-status.patch b/dev-db/postgresql/files/pg_ctl-exit-status.patch
new file mode 100644
index 000000000000..bbbd4498555d
--- /dev/null
+++ b/dev-db/postgresql/files/pg_ctl-exit-status.patch
@@ -0,0 +1,12 @@
+diff -Naur a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
+--- a/src/bin/pg_ctl/pg_ctl.c 2011-04-14 23:18:15 -0400
++++ b/src/bin/pg_ctl/pg_ctl.c 2011-08-01 19:44:54 -0400
+@@ -975,7 +975,7 @@
+ }
+ }
+ printf(_("%s: no server running\n"), progname);
+- exit(1);
++ exit(3);
+ }
+
+
diff --git a/dev-db/postgresql/files/postgresql-10beta2-no-server.patch b/dev-db/postgresql/files/postgresql-10beta2-no-server.patch
new file mode 100644
index 000000000000..8c88465e7bd8
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-10beta2-no-server.patch
@@ -0,0 +1,146 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2017-07-10 16:26:20.000000000 -0400
++++ b/contrib/Makefile 2017-07-12 09:35:05.025053646 -0400
+@@ -5,57 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- adminpack \
+- amcheck \
+- auth_delay \
+- auto_explain \
+- bloom \
+- btree_gin \
+- btree_gist \
+- chkpass \
+- citext \
+- cube \
+- dblink \
+- dict_int \
+- dict_xsyn \
+- earthdistance \
+- file_fdw \
+- fuzzystrmatch \
+- hstore \
+- intagg \
+- intarray \
+- isn \
+- lo \
+- ltree \
+ oid2name \
+- pageinspect \
+- passwordcheck \
+- pg_buffercache \
+- pg_freespacemap \
+- pg_prewarm \
+- pg_standby \
+- pg_stat_statements \
+- pg_trgm \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- pg_visibility \
+- postgres_fdw \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_decoding \
+- tsm_system_rows \
+- tsm_system_time \
+- unaccent \
+ vacuumlo
+
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile 2017-07-10 16:26:20.000000000 -0400
++++ b/src/backend/Makefile 2017-07-12 10:02:15.890642203 -0400
+@@ -51,7 +51,7 @@
+
+ ##########################################################################
+
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: generated-headers
+
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -226,23 +226,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 -Naruw a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2017-07-10 16:26:20.000000000 -0400
++++ b/src/bin/Makefile 2017-07-12 10:06:45.609174107 -0400
+@@ -14,19 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- initdb \
+- pg_archivecleanup \
+- pg_basebackup \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetwal \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+- pg_waldump \
+ pgbench \
+ psql \
+ scripts
+diff -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2017-07-10 16:26:20.000000000 -0400
++++ b/src/Makefile 2017-07-12 10:10:04.128087426 -0400
+@@ -15,20 +15,12 @@
+ SUBDIRS = \
+ common \
+ port \
+- timezone \
+ backend \
+- backend/utils/mb/conversion_procs \
+- backend/snowball \
+ include \
+ interfaces \
+- backend/replication/libpqwalreceiver \
+- backend/replication/pgoutput \
+ fe_utils \
+ bin \
+- pl \
+- makefiles \
+- test/regress \
+- test/perl
++ makefiles
+
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql-9.1-no-server.patch b/dev-db/postgresql/files/postgresql-9.1-no-server.patch
new file mode 100644
index 000000000000..64363a0f4112
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.1-no-server.patch
@@ -0,0 +1,141 @@
+diff -Naur a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2011-09-08 17:13:27.000000000 -0400
++++ b/contrib/Makefile 2011-09-16 21:58:34.080579316 -0400
+@@ -5,56 +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_standby \
+- pg_stat_statements \
+- pg_test_fsync \
+- 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
+-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 2011-09-08 17:13:27.000000000 -0400
++++ b/src/backend/Makefile 2011-09-16 22:01:48.400579314 -0400
+@@ -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/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:
+@@ -206,23 +206,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-09-08 17:13:27.000000000 -0400
++++ b/src/bin/Makefile 2011-09-16 22:03:48.250579314 -0400
+@@ -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 2011-09-08 17:13:27.000000000 -0400
++++ b/src/Makefile 2011-09-16 22:29:17.650579302 -0400
+@@ -14,17 +14,11 @@
+
+ SUBDIRS = \
+ 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-9.1-tz-dir-overflow.patch b/dev-db/postgresql/files/postgresql-9.1-tz-dir-overflow.patch
new file mode 100644
index 000000000000..9d12c57ecc3a
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.1-tz-dir-overflow.patch
@@ -0,0 +1,29 @@
+--- a/src/timezone/pgtz.c 2015-02-02 15:45:23.000000000 -0500
++++ b/src/timezone/pgtz.c 2015-04-07 14:21:22.341832190 -0400
+@@ -586,6 +586,12 @@
+ if (direntry->d_name[0] == '.')
+ continue;
+
++ /* if current working directory has the same name as current direntry name,
++ * then skip as this is a recursive fs loop
++ */
++ if (strncmp(direntry->d_name,tzdirsub,strlen(direntry->d_name)) == 0)
++ continue;
++
+ snprintf(tzdir + tzdir_orig_len, MAXPGPATH - tzdir_orig_len,
+ "/%s", direntry->d_name);
+
+@@ -1615,6 +1621,13 @@
+ if (direntry->d_name[0] == '.')
+ continue;
+
++ /* copy current working directory so that there is no risk of modification by basename(),
++ * and compare to current direntry name; skip if they are the same as this is a recursive fs loop
++ */
++ snprintf(fullname, MAXPGPATH, "%s", dir->dirname[dir->depth]);
++ if (strncmp(direntry->d_name,basename(fullname),strlen(direntry->d_name)) == 0)
++ continue;
++
+ snprintf(fullname, MAXPGPATH, "%s/%s",
+ dir->dirname[dir->depth], direntry->d_name);
+ if (stat(fullname, &statbuf) != 0)
diff --git a/dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch b/dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch
new file mode 100644
index 000000000000..59e43c5384e7
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.2-9.4-tz-dir-overflow.patch
@@ -0,0 +1,16 @@
+--- a/src/timezone/pgtz.c 2015-02-02 15:45:23.000000000 -0500
++++ b/src/timezone/pgtz.c 2015-04-07 14:21:22.341832190 -0400
+@@ -1615,6 +1615,13 @@
+ if (direntry->d_name[0] == '.')
+ continue;
+
++ /* copy current working directory so that there is no risk of modification by basename(),
++ * and compare to current direntry name; skip if they are the same as this is a recursive fs loop
++ */
++ snprintf(fullname, MAXPGPATH, "%s", dir->dirname[dir->depth]);
++ if (strncmp(direntry->d_name,basename(fullname),strlen(direntry->d_name)) == 0)
++ continue;
++
+ snprintf(fullname, MAXPGPATH, "%s/%s",
+ dir->dirname[dir->depth], direntry->d_name);
+ if (stat(fullname, &statbuf) != 0)
diff --git a/dev-db/postgresql/files/postgresql-9.2-no-server.patch b/dev-db/postgresql/files/postgresql-9.2-no-server.patch
new file mode 100644
index 000000000000..a0c33efc63ae
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.2-no-server.patch
@@ -0,0 +1,143 @@
+diff -Naur a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2012-05-10 18:35:09.000000000 -0400
++++ b/contrib/Makefile 2012-05-20 09:33:47.892622992 -0400
+@@ -5,58 +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_standby \
+- pg_stat_statements \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_trgm \
+- pg_upgrade \
+- pg_upgrade_support \
+ pgbench \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_parser \
+- tsearch2 \
+- unaccent \
+ 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 2012-05-10 18:35:09.000000000 -0400
++++ b/src/backend/Makefile 2012-05-20 09:36:24.446654842 -0400
+@@ -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/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:
+@@ -207,23 +207,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 2012-05-10 18:35:09.000000000 -0400
++++ b/src/bin/Makefile 2012-05-20 09:41:18.489958216 -0400
+@@ -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 2012-05-10 18:35:09.000000000 -0400
++++ b/src/Makefile 2012-05-20 09:40:13.532774840 -0400
+@@ -14,17 +14,11 @@
+
+ SUBDIRS = \
+ 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-9.3-no-server.patch b/dev-db/postgresql/files/postgresql-9.3-no-server.patch
new file mode 100644
index 000000000000..3ce90d60ae70
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.3-no-server.patch
@@ -0,0 +1,148 @@
+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,61 +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_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_parser \
+- 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-9.4.10-no-server.patch b/dev-db/postgresql/files/postgresql-9.4.10-no-server.patch
new file mode 100644
index 000000000000..81fc3837bede
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.4.10-no-server.patch
@@ -0,0 +1,151 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2016-10-24 16:12:53.000000000 -0400
++++ b/contrib/Makefile 2016-10-27 13:38:23.361545396 -0400
+@@ -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
+
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile 2016-10-24 16:12:53.000000000 -0400
++++ b/src/backend/Makefile 2016-10-27 14:04:47.617000374 -0400
+@@ -47,7 +47,7 @@
+
+ ##########################################################################
+
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -106,7 +106,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:
+@@ -199,23 +199,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 -Naruw a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2016-10-24 16:12:53.000000000 -0400
++++ b/src/bin/Makefile 2016-10-27 13:41:34.443930143 -0400
+@@ -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 -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2016-10-24 16:12:53.000000000 -0400
++++ b/src/Makefile 2016-10-27 13:43:09.296792018 -0400
+@@ -15,18 +15,11 @@
+ SUBDIRS = \
+ common \
+ port \
+- timezone \
+ backend \
+- backend/utils/mb/conversion_procs \
+- backend/snowball \
+ include \
+ interfaces \
+- backend/replication/libpqwalreceiver \
+ bin \
+- pl \
+- makefiles \
+- test/regress \
+- test/perl
++ makefiles
+
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql-9.5-no-server.patch b/dev-db/postgresql/files/postgresql-9.5-no-server.patch
new file mode 100644
index 000000000000..c5e2c7ddd3b8
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.5-no-server.patch
@@ -0,0 +1,152 @@
+diff -ru a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/contrib/Makefile 2015-09-06 07:50:51.258463861 -0400
+@@ -5,56 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- adminpack \
+- auth_delay \
+- auto_explain \
+- btree_gin \
+- btree_gist \
+- chkpass \
+- citext \
+- cube \
+- dblink \
+- dict_int \
+- dict_xsyn \
+- earthdistance \
+- file_fdw \
+- fuzzystrmatch \
+- hstore \
+- intagg \
+- intarray \
+- isn \
+- lo \
+- ltree \
+ oid2name \
+- pageinspect \
+- passwordcheck \
+- pg_buffercache \
+- pg_freespacemap \
+- pg_prewarm \
+- pg_standby \
+- pg_stat_statements \
+- pg_trgm \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- postgres_fdw \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_decoding \
+- tsm_system_rows \
+- tsm_system_time \
+- tsearch2 \
+- unaccent \
+ vacuumlo
+
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+-
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+ else
+diff -ru a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/src/backend/Makefile 2015-09-06 08:01:36.775374842 -0400
+@@ -47,7 +47,7 @@
+
+ ##########################################################################
+
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -106,7 +106,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:
+@@ -199,23 +199,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 -ru a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/src/bin/Makefile 2015-09-06 08:03:27.014847309 -0400
+@@ -14,20 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- initdb \
+- pg_archivecleanup \
+- pg_basebackup \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetxlog \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+- pg_xlogdump \
+- pgbench \
+ psql \
+ scripts
+
+diff -ru a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/src/Makefile 2015-09-06 08:04:25.274568519 -0400
+@@ -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-9.5.5-no-server.patch b/dev-db/postgresql/files/postgresql-9.5.5-no-server.patch
new file mode 100644
index 000000000000..285667801a63
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.5.5-no-server.patch
@@ -0,0 +1,151 @@
+diff -Naruw postgresql-9.5.5.orig/contrib/Makefile postgresql-9.5.5/contrib/Makefile
+--- postgresql-9.5.5.orig/contrib/Makefile 2016-10-24 16:10:50.000000000 -0400
++++ postgresql-9.5.5/contrib/Makefile 2016-10-27 13:49:19.418285694 -0400
+@@ -5,55 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- adminpack \
+- auth_delay \
+- auto_explain \
+- btree_gin \
+- btree_gist \
+- chkpass \
+- citext \
+- cube \
+- dblink \
+- dict_int \
+- dict_xsyn \
+- earthdistance \
+- file_fdw \
+- fuzzystrmatch \
+- hstore \
+- intagg \
+- intarray \
+- isn \
+- lo \
+- ltree \
+ oid2name \
+- pageinspect \
+- passwordcheck \
+- pg_buffercache \
+- pg_freespacemap \
+- pg_prewarm \
+- pg_standby \
+- pg_stat_statements \
+- pg_trgm \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- postgres_fdw \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_decoding \
+- tsm_system_rows \
+- tsm_system_time \
+- tsearch2 \
+- unaccent \
+ vacuumlo
+
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+diff -Naruw postgresql-9.5.5.orig/src/backend/Makefile postgresql-9.5.5/src/backend/Makefile
+--- postgresql-9.5.5.orig/src/backend/Makefile 2016-10-24 16:10:50.000000000 -0400
++++ postgresql-9.5.5/src/backend/Makefile 2016-10-27 13:51:16.027706097 -0400
+@@ -47,7 +47,7 @@
+
+ ##########################################################################
+
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -106,7 +106,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:
+@@ -199,23 +199,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 -Naruw postgresql-9.5.5.orig/src/bin/Makefile postgresql-9.5.5/src/bin/Makefile
+--- postgresql-9.5.5.orig/src/bin/Makefile 2016-10-24 16:10:50.000000000 -0400
++++ postgresql-9.5.5/src/bin/Makefile 2016-10-27 14:26:26.397161219 -0400
+@@ -14,19 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- initdb \
+- pg_archivecleanup \
+- pg_basebackup \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetxlog \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+- pg_xlogdump \
+ pgbench \
+ psql \
+ scripts
+diff -Naruw postgresql-9.5.5.orig/src/Makefile postgresql-9.5.5/src/Makefile
+--- postgresql-9.5.5.orig/src/Makefile 2016-10-24 16:10:50.000000000 -0400
++++ postgresql-9.5.5/src/Makefile 2016-10-27 14:03:49.513956432 -0400
+@@ -15,18 +15,11 @@
+ SUBDIRS = \
+ common \
+ port \
+- timezone \
+ backend \
+- backend/utils/mb/conversion_procs \
+- backend/snowball \
+ include \
+ interfaces \
+- backend/replication/libpqwalreceiver \
+ bin \
+- pl \
+- makefiles \
+- test/regress \
+- test/perl
++ makefiles
+
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql-9.6-no-server.patch b/dev-db/postgresql/files/postgresql-9.6-no-server.patch
new file mode 100644
index 000000000000..637e65ecc472
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.6-no-server.patch
@@ -0,0 +1,110 @@
+vdiff -ru a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/contrib/Makefile 2015-09-06 07:50:51.258463861 -0400
+@@ -5,58 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- adminpack \
+- auth_delay \
+- auto_explain \
+- bloom \
+- btree_gin \
+- btree_gist \
+- chkpass \
+- citext \
+- cube \
+- dblink \
+- dict_int \
+- dict_xsyn \
+- earthdistance \
+- file_fdw \
+- fuzzystrmatch \
+- hstore \
+- intagg \
+- intarray \
+- isn \
+- lo \
+- ltree \
+ oid2name \
+- pageinspect \
+- passwordcheck \
+- pg_buffercache \
+- pg_freespacemap \
+- pg_prewarm \
+- pg_standby \
+- pg_stat_statements \
+- pg_trgm \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- pg_visibility \
+- postgres_fdw \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_decoding \
+- tsm_system_rows \
+- tsm_system_time \
+- tsearch2 \
+- unaccent \
+ vacuumlo
+
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+-
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+ else
+diff -ru a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/src/bin/Makefile 2015-09-06 08:03:27.014847309 -0400
+@@ -14,20 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- initdb \
+- pg_archivecleanup \
+- pg_basebackup \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetxlog \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+- pg_xlogdump \
+- pgbench \
+ psql \
+ scripts
+
+diff -ru a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2015-06-29 15:42:18.000000000 -0400
++++ b/src/Makefile 2015-09-06 08:04:25.274568519 -0400
+@@ -15,19 +15,11 @@
+ SUBDIRS = \
+ common \
+ port \
+- timezone \
+ backend \
+- backend/utils/mb/conversion_procs \
+- backend/snowball \
+ include \
+ interfaces \
+- backend/replication/libpqwalreceiver \
+- fe_utils \
+ bin \
+- pl \
+- makefiles \
+- test/regress \
+- test/perl
++ makefiles
+
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql-9.6.1-no-server.patch b/dev-db/postgresql/files/postgresql-9.6.1-no-server.patch
new file mode 100644
index 000000000000..868567cadb2c
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.6.1-no-server.patch
@@ -0,0 +1,130 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2016-10-24 16:08:51.000000000 -0400
++++ b/contrib/Makefile 2016-10-28 11:41:00.450589656 -0400
+@@ -5,58 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- adminpack \
+- auth_delay \
+- auto_explain \
+- bloom \
+- btree_gin \
+- btree_gist \
+- chkpass \
+- citext \
+- cube \
+- dblink \
+- dict_int \
+- dict_xsyn \
+- earthdistance \
+- file_fdw \
+- fuzzystrmatch \
+- hstore \
+- intagg \
+- intarray \
+- isn \
+- lo \
+- ltree \
+ oid2name \
+- pageinspect \
+- passwordcheck \
+- pg_buffercache \
+- pg_freespacemap \
+- pg_prewarm \
+- pg_standby \
+- pg_stat_statements \
+- pg_trgm \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- pg_visibility \
+- postgres_fdw \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_decoding \
+- tsm_system_rows \
+- tsm_system_time \
+- tsearch2 \
+- unaccent \
+ vacuumlo
+
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+-
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+ else
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile 2016-10-24 16:08:51.000000000 -0400
++++ b/src/backend/Makefile 2016-10-28 11:48:58.571353118 -0400
+@@ -51,7 +51,7 @@
+
+ ##########################################################################
+
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: someheaders
+
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -110,7 +110,7 @@
+ endif # aix
+
+ # Update the commonly used headers before building the subdirectories
+-$(SUBDIRS:%=%-recursive): | generated-headers
++someheaders $(SUBDIRS:%=%-recursive): | generated-headers
+
+ # src/port needs a convenient way to force just errcodes.h to get built
+ submake-errcodes: $(top_builddir)/src/include/utils/errcodes.h
+diff -Naruw a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2016-10-24 16:08:51.000000000 -0400
++++ b/src/bin/Makefile 2016-10-28 11:42:26.000129832 -0400
+@@ -14,19 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- initdb \
+- pg_archivecleanup \
+- pg_basebackup \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetxlog \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+- pg_xlogdump \
+ pgbench \
+ psql \
+ scripts
+diff -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2016-10-24 16:08:51.000000000 -0400
++++ b/src/Makefile 2016-10-28 11:41:00.453922971 -0400
+@@ -15,19 +15,11 @@
+ SUBDIRS = \
+ common \
+ port \
+- timezone \
+ backend \
+- backend/utils/mb/conversion_procs \
+- backend/snowball \
+ include \
+ interfaces \
+- backend/replication/libpqwalreceiver \
+- fe_utils \
+ bin \
+- pl \
+- makefiles \
+- test/regress \
+- test/perl
++ makefiles
+
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql-9.6.3-no-server.patch b/dev-db/postgresql/files/postgresql-9.6.3-no-server.patch
new file mode 100644
index 000000000000..db662d4630e3
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-9.6.3-no-server.patch
@@ -0,0 +1,145 @@
+diff -Naruw a/contrib/Makefile b/contrib/Makefile
+--- a/contrib/Makefile 2017-05-08 17:15:12.000000000 -0400
++++ b/contrib/Makefile 2017-07-13 20:20:26.926646151 -0400
+@@ -5,57 +5,9 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- adminpack \
+- auth_delay \
+- auto_explain \
+- bloom \
+- btree_gin \
+- btree_gist \
+- chkpass \
+- citext \
+- cube \
+- dblink \
+- dict_int \
+- dict_xsyn \
+- earthdistance \
+- file_fdw \
+- fuzzystrmatch \
+- hstore \
+- intagg \
+- intarray \
+- isn \
+- lo \
+- ltree \
+ oid2name \
+- pageinspect \
+- passwordcheck \
+- pg_buffercache \
+- pg_freespacemap \
+- pg_prewarm \
+- pg_standby \
+- pg_stat_statements \
+- pg_trgm \
+- pgcrypto \
+- pgrowlocks \
+- pgstattuple \
+- pg_visibility \
+- postgres_fdw \
+- seg \
+- spi \
+- tablefunc \
+- tcn \
+- test_decoding \
+- tsm_system_rows \
+- tsm_system_time \
+- tsearch2 \
+- unaccent \
+ vacuumlo
+
+-ifeq ($(with_openssl),yes)
+-SUBDIRS += sslinfo
+-else
+-ALWAYS_SUBDIRS += sslinfo
+-endif
+
+ ifneq ($(with_uuid),no)
+ SUBDIRS += uuid-ossp
+diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
+--- a/src/backend/Makefile 2017-05-08 17:15:12.000000000 -0400
++++ b/src/backend/Makefile 2017-07-13 20:18:08.590323095 -0400
+@@ -51,7 +51,7 @@
+
+ ##########################################################################
+
+-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
++all: generated-headers
+
+ ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+@@ -218,23 +218,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 -Naruw a/src/bin/Makefile b/src/bin/Makefile
+--- a/src/bin/Makefile 2017-05-08 17:15:12.000000000 -0400
++++ b/src/bin/Makefile 2017-07-13 20:23:51.419471550 -0400
+@@ -14,19 +14,8 @@
+ include $(top_builddir)/src/Makefile.global
+
+ SUBDIRS = \
+- initdb \
+- pg_archivecleanup \
+- pg_basebackup \
+ pg_config \
+- pg_controldata \
+- pg_ctl \
+ pg_dump \
+- pg_resetxlog \
+- pg_rewind \
+- pg_test_fsync \
+- pg_test_timing \
+- pg_upgrade \
+- pg_xlogdump \
+ pgbench \
+ psql \
+ scripts
+diff -Naruw a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2017-05-08 17:15:12.000000000 -0400
++++ b/src/Makefile 2017-07-13 20:25:57.539158282 -0400
+@@ -15,19 +15,12 @@
+ SUBDIRS = \
+ common \
+ port \
+- timezone \
+ backend \
+- backend/utils/mb/conversion_procs \
+- backend/snowball \
+ include \
+ interfaces \
+- backend/replication/libpqwalreceiver \
+ fe_utils \
+ bin \
+- pl \
+- makefiles \
+- test/regress \
+- test/perl
++ makefiles
+
+ # There are too many interdependencies between the subdirectories, so
+ # don't attempt parallel make here.
diff --git a/dev-db/postgresql/files/postgresql-check-db-dir b/dev-db/postgresql/files/postgresql-check-db-dir
new file mode 100644
index 000000000000..7f89919a1f68
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-check-db-dir
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+eerror() {
+ echo "$@" >&2
+}
+
+# Check that DATA_DIR has been set
+if [ -z ${DATA_DIR} ] ; then
+ eerror "DATA_DIR not set"
+ exit 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@"
+ exit 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.
+for file in postgresql pg_hba pg_ident ; do
+ file="${PGDATA%/}/${file}.conf"
+ if [ ! -f ${file} ] ; then
+ eerror "${file} not found"
+ eerror "HINT: mv ${DATA_DIR%/}/*.conf ${PGDATA}"
+ exit 1
+ fi
+done
diff --git a/dev-db/postgresql/files/postgresql.confd b/dev-db/postgresql/files/postgresql.confd
new file mode 100644
index 000000000000..07b465d9b61a
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.confd
@@ -0,0 +1,58 @@
+# Which port and socket to bind PostgreSQL
+PGPORT="5432"
+
+# How long to wait for server to start in seconds
+START_TIMEOUT=10
+
+# NICE_QUIT ignores new connections and wait for clients to disconnect from
+# server before shutting down. NICE_TIMEOUT in seconds determines how long to
+# wait for this to succeed.
+NICE_TIMEOUT=60
+
+# Forecfully disconnect clients from server and shut down. This is performed
+# after NICE_QUIT. Terminated client connections have their open transactions
+# rolled back.
+# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds.
+RUDE_QUIT="YES"
+RUDE_TIMEOUT=30
+
+# If the server still fails to shutdown, you can force it to quit by setting
+# this to YES and a recover-run will execute on the next startup.
+# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds.
+FORCE_QUIT="NO"
+FORCE_TIMEOUT=2
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these
+# options can be set directly in the configuration file.
+#PGOPTS="-N 512 -B 1024"
+
+# Pass extra environment variables. If you have to export environment variables
+# for the database process, this can be done here.
+# Don't forget to escape quotes.
+#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\""
+
+##############################################################################
+#
+# The following values should not be arbitrarily changed.
+#
+# `emerge --config dev-db/postgresql:@SLOT@' uses these values to
+# determine where to create the data directory, where to place the
+# configuration files, and any additional options to pass to initdb.
+#
+# The initscript also uses these variables to inform PostgreSQL where to find
+# its data directory and configuration files.
+#
+##############################################################################
+
+# Location of configuration files
+PGDATA="/etc/postgresql-@SLOT@/"
+
+# Where the data directory is located/to be created
+DATA_DIR="/var/lib/postgresql/@SLOT@/data"
+
+# Additional options to pass to initdb.
+# See `man initdb' for available options.
+PG_INITDB_OPTS="--encoding=UTF8"
diff --git a/dev-db/postgresql/files/postgresql.confd-9.2 b/dev-db/postgresql/files/postgresql.confd-9.2
new file mode 100644
index 000000000000..7753eeae3a89
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.confd-9.2
@@ -0,0 +1,65 @@
+# Directory that contains the unix socket. Created and controlled by
+# the related initscript. The directory created will be owned
+# root:postgres with mode 1775.
+#
+# /run/postgresql is the default directory.
+PG_SOCKET_DIRECTORY="/run/postgresql"
+
+# Which port and socket to bind PostgreSQL
+PGPORT="5432"
+
+# How long to wait for server to start in seconds
+START_TIMEOUT=10
+
+# NICE_QUIT ignores new connections and wait for clients to disconnect from
+# server before shutting down. NICE_TIMEOUT in seconds determines how long to
+# wait for this to succeed.
+NICE_TIMEOUT=60
+
+# Forecfully disconnect clients from server and shut down. This is performed
+# after NICE_QUIT. Terminated client connections have their open transactions
+# rolled back.
+# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds.
+RUDE_QUIT="YES"
+RUDE_TIMEOUT=30
+
+# If the server still fails to shutdown, you can force it to quit by setting
+# this to YES and a recover-run will execute on the next startup.
+# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds.
+FORCE_QUIT="NO"
+FORCE_TIMEOUT=2
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these
+# options can be set directly in the configuration file.
+#PGOPTS="-N 512 -B 1024"
+
+# Pass extra environment variables. If you have to export environment variables
+# for the database process, this can be done here.
+# Don't forget to escape quotes.
+#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\""
+
+##############################################################################
+#
+# The following values should not be arbitrarily changed.
+#
+# `emerge --config dev-db/postgresql:@SLOT@' uses these values to
+# determine where to create the data directory, where to place the
+# configuration files, and any additional options to pass to initdb.
+#
+# The initscript also uses these variables to inform PostgreSQL where to find
+# its data directory and configuration files.
+#
+##############################################################################
+
+# Location of configuration files
+PGDATA="/etc/postgresql-@SLOT@/"
+
+# Where the data directory is located/to be created
+DATA_DIR="/var/lib/postgresql/@SLOT@/data"
+
+# Additional options to pass to initdb.
+# See `man initdb' for available options.
+PG_INITDB_OPTS="--encoding=UTF8"
diff --git a/dev-db/postgresql/files/postgresql.confd-9.3 b/dev-db/postgresql/files/postgresql.confd-9.3
new file mode 100644
index 000000000000..8b6d2a097285
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.confd-9.3
@@ -0,0 +1,65 @@
+# Comma-separated list of directories that contain a unix
+# socket. Created and controlled by the related initscript. The
+# directories created will be owned root:postgres with mode 1775.
+#
+# /run/postgresql is the default directory.
+PG_SOCKET_DIRECTORIES="/run/postgresql"
+
+# Which port and socket to bind PostgreSQL
+PGPORT="5432"
+
+# How long to wait for server to start in seconds
+START_TIMEOUT=10
+
+# NICE_QUIT ignores new connections and wait for clients to disconnect from
+# server before shutting down. NICE_TIMEOUT in seconds determines how long to
+# wait for this to succeed.
+NICE_TIMEOUT=60
+
+# Forecfully disconnect clients from server and shut down. This is performed
+# after NICE_QUIT. Terminated client connections have their open transactions
+# rolled back.
+# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds.
+RUDE_QUIT="YES"
+RUDE_TIMEOUT=30
+
+# If the server still fails to shutdown, you can force it to quit by setting
+# this to YES and a recover-run will execute on the next startup.
+# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds.
+FORCE_QUIT="NO"
+FORCE_TIMEOUT=2
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these
+# options can be set directly in the configuration file.
+#PGOPTS="-N 512 -B 1024"
+
+# Pass extra environment variables. If you have to export environment variables
+# for the database process, this can be done here.
+# Don't forget to escape quotes.
+#PG_EXTRA_ENV="PGPASSFILE=\"/path/to/.pgpass\""
+
+##############################################################################
+#
+# The following values should not be arbitrarily changed.
+#
+# `emerge --config dev-db/postgresql:@SLOT@' uses these values to
+# determine where to create the data directory, where to place the
+# configuration files, and any additional options to pass to initdb.
+#
+# The initscript also uses these variables to inform PostgreSQL where to find
+# its data directory and configuration files.
+#
+##############################################################################
+
+# Location of configuration files
+PGDATA="/etc/postgresql-@SLOT@/"
+
+# Where the data directory is located/to be created
+DATA_DIR="/var/lib/postgresql/@SLOT@/data"
+
+# Additional options to pass to initdb.
+# See `man initdb' for available options.
+PG_INITDB_OPTS="--encoding=UTF8"
diff --git a/dev-db/postgresql/files/postgresql.init b/dev-db/postgresql/files/postgresql.init
new file mode 100644
index 000000000000..35dd316e9604
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init
@@ -0,0 +1,137 @@
+#!/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 \
+ --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl \
+ -- start -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \
+ -D ${PGDATA} -o "--data-directory=${DATA_DIR} ${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/files/postgresql.init-9.2 b/dev-db/postgresql/files/postgresql.init-9.2
new file mode 100755
index 000000000000..b191ca29e97c
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-9.2
@@ -0,0 +1,152 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload promote"
+
+PG_CTL="/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl"
+
+description="PostgreSQL @SLOT@ -- the world's most advanced open source database --
+${RC_SERVICE} is a wrapper around pg_ctl with additional administrative checks
+and convenience"
+
+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}}
+
+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 root:postgres "${PG_SOCKET_DIRECTORY}"
+ if [ -e "${PG_SOCKET_DIRECTORY%/}/.s.PGSQL.${configured_port}" ] ; then
+ eerror "Socket conflict."
+ eerror "A server is already listening on:"
+ eerror " ${PG_SOCKET_DIRECTORY%/}/.s.PGSQL.${configured_port}"
+ eerror "HINT: Change PGPORT to listen on a different socket."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL @SLOT@"
+
+ rm -f "${DATA_DIR%/}/postmaster.pid"
+
+ su - postgres -c \
+ "PGPORT=${configured_port} ${PG_EXTRA_ENV} ${PG_CTL} start \
+ -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \
+ -D ${PGDATA} \
+ -o '--data-directory=${DATA_DIR} \
+ --unix-socket-directory=${PG_SOCKET_DIRECTORY} \
+ ${PGOPTS}'"
+
+ local retval=$?
+
+ if [ $retval -ne 0 ] ; then
+ eerror "Check the log for a possible explanation of the above error."
+ eerror "The log may be located at:"
+ eerror " ${DATA_DIR%/}/postmaster.log"
+ eerror "Or wherever you configured PostgreSQL @SLOT@ to log."
+ fi
+
+ eend $retval
+}
+
+stop() {
+ local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} ))
+ ebegin "Stopping PostgreSQL @SLOT@ (this can take up to ${seconds} seconds)"
+
+ su - postgres -c \
+ "${PG_CTL} stop -t ${NICE_TIMEOUT} -s -D ${DATA_DIR} -m smart"
+ local retval=$?
+
+ if [ "${RUDE_QUIT}" != "NO" -a ${retval} -ne 0 ] ; then
+ einfo "Previous attempt failed. Trying RUDE_QUIT."
+ su - postgres -c \
+ "${PG_CTL} stop -t ${RUDE_TIMEOUT} -s -D ${DATA_DIR} -m fast"
+ retval=$?
+ fi
+
+ if [ "${FORCE_QUIT}" = "YES" -a ${retval} -ne 0 ] ; then
+ einfo "Previous step failed. Trying FORCE_QUIT."
+ ewarn "A recover-run might be executed on next startup."
+ su - postgres -c \
+ "${PG_CTL} stop -t ${FORCE_TIMEOUT} -s -D ${DATA_DIR} -m immediate"
+ retval=$?
+ fi
+
+ eend ${retval}
+}
+
+status() {
+ ebegin "Checking PostgreSQL @SLOT@ status"
+ su - postgres -c "${PG_CTL} status -D ${DATA_DIR}"
+ eend $?
+}
+
+description_reload="Simply sends the postgres process a SIGHUP signal, causing
+ it to reread its configuration files (postgresql.conf, pg_hba.conf,
+ etc.). This allows changing of configuration-file options that do not
+ require a complete restart to take effect."
+reload() {
+ ebegin "Reloading PostgreSQL @SLOT@ configuration"
+ su - postgres -c "${PG_CTL} reload -s -D ${DATA_DIR}"
+ eend $?
+}
+
+description_promote="If the server is in standby, it is commanded to exit
+ recovery and begin read-write operations."
+promote() {
+ ebegin "Promoting PostgreSQL @SLOT@"
+ su - postgres -c "${PG_CTL} promote -s -D ${DATA_DIR}"
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql.init-9.3 b/dev-db/postgresql/files/postgresql.init-9.3
new file mode 100644
index 000000000000..ffecea7a757c
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-9.3
@@ -0,0 +1,142 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 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_paths=$(get_config unix_socket_directories)
+: ${socket_paths:=/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 paths and create it if
+ # it doesn't exist.
+ set -f; IFS=','
+ local s
+ for s in ${socket_paths}; do
+ checkpath -d -m 1775 -o postgres:postgres ${s}
+ if [ -e ${s%/}/.s.PGSQL.${configured_port} ] ; then
+ eerror "Socket conflict."
+ eerror "A server is already listening on:"
+ eerror " ${s%/}/.s.PGSQL.${configured_port}"
+ eerror "HINT: Change PGPORT to listen on a different socket."
+ return 1
+ fi
+ done
+ set +f; unset IFS
+}
+
+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 \
+ --exec /usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl \
+ -- start -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \
+ -D ${PGDATA} -o "--data-directory=${DATA_DIR} ${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/files/postgresql.init-9.3-r1 b/dev-db/postgresql/files/postgresql.init-9.3-r1
new file mode 100755
index 000000000000..256ee7e6fd35
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.init-9.3-r1
@@ -0,0 +1,157 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload promote"
+
+PG_CTL="/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl"
+
+description="PostgreSQL @SLOT@ -- the world's most advanced open source database --
+${RC_SERVICE} is a wrapper around pg_ctl with additional administrative checks
+and convenience"
+
+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}}
+
+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 paths and create it if
+ # it doesn't exist.
+ set -f; IFS=','
+ local s
+ for s in ${PG_SOCKET_DIRECTORIES}; do
+ checkpath -d -m 1775 -o root:postgres "${s}"
+ if [ -e "${s%/}/.s.PGSQL.${configured_port}" ] ; then
+ eerror "Socket conflict."
+ eerror "A server is already listening on:"
+ eerror " ${s%/}/.s.PGSQL.${configured_port}"
+ eerror "HINT: Change PGPORT to listen on a different socket."
+ return 1
+ fi
+ done
+ set +f; unset IFS
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PostgreSQL @SLOT@"
+
+ rm -f "${DATA_DIR%/}/postmaster.pid"
+
+ su - postgres -c \
+ "PGPORT=${configured_port} ${PG_EXTRA_ENV} ${PG_CTL} start \
+ -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \
+ -D ${PGDATA} \
+ -o '--data-directory=${DATA_DIR} \
+ --unix-socket-directories=${PG_SOCKET_DIRECTORIES} \
+ ${PGOPTS}'"
+
+ local retval=$?
+
+ if [ $retval -ne 0 ] ; then
+ eerror "Check the log for a possible explanation of the above error."
+ eerror "The log may be located at:"
+ eerror " ${DATA_DIR%/}/postmaster.log"
+ eerror "Or wherever you configured PostgreSQL @SLOT@ to log."
+ fi
+
+ eend $retval
+}
+
+stop() {
+ local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} ))
+ ebegin "Stopping PostgreSQL @SLOT@ (this can take up to ${seconds} seconds)"
+
+ su - postgres -c \
+ "${PG_CTL} stop -t ${NICE_TIMEOUT} -s -D ${DATA_DIR} -m smart"
+ local retval=$?
+
+ if [ "${RUDE_QUIT}" != "NO" -a ${retval} -ne 0 ] ; then
+ einfo "Previous attempt failed. Trying RUDE_QUIT."
+ su - postgres -c \
+ "${PG_CTL} stop -t ${RUDE_TIMEOUT} -s -D ${DATA_DIR} -m fast"
+ retval=$?
+ fi
+
+ if [ "${FORCE_QUIT}" = "YES" -a ${retval} -ne 0 ] ; then
+ einfo "Previous step failed. Trying FORCE_QUIT."
+ ewarn "A recover-run might be executed on next startup."
+ su - postgres -c \
+ "${PG_CTL} stop -t ${FORCE_TIMEOUT} -s -D ${DATA_DIR} -m immediate"
+ retval=$?
+ fi
+
+ eend ${retval}
+}
+
+status() {
+ ebegin "Checking PostgreSQL @SLOT@ status"
+ su - postgres -c "${PG_CTL} status -D ${DATA_DIR}"
+ eend $?
+}
+
+description_reload="Simply sends the postgres process a SIGHUP signal, causing
+ it to reread its configuration files (postgresql.conf, pg_hba.conf,
+ etc.). This allows changing of configuration-file options that do not
+ require a complete restart to take effect."
+reload() {
+ ebegin "Reloading PostgreSQL @SLOT@ configuration"
+ su - postgres -c "${PG_CTL} reload -s -D ${DATA_DIR}"
+ eend $?
+}
+
+description_promote="If the server is in standby, it is commanded to exit
+ recovery and begin read-write operations."
+promote() {
+ ebegin "Promoting PostgreSQL @SLOT@"
+ su - postgres -c "${PG_CTL} promote -s -D ${DATA_DIR}"
+ eend $?
+}
diff --git a/dev-db/postgresql/files/postgresql.service b/dev-db/postgresql/files/postgresql.service
new file mode 100644
index 000000000000..a607169d22f4
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.service
@@ -0,0 +1,55 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change the server's port number to 5433,
+# create a file named
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf"
+# containing:
+# [Service]
+# Environment=PGPORT=5433
+# This will override the setting appearing below.
+
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Service]
+Type=forking
+
+User=postgres
+Group=postgres
+
+# Port number for server to listen on
+Environment=PGPORT=5432
+
+# Location of configuration files
+Environment=PGDATA=/etc/postgresql-@SLOT@
+
+# Where the data directory is located
+Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data
+
+# Where to send early-startup messages from the server (before the logging
+# options of postgresql.conf take effect)
+# This is normally controlled by the global default set by systemd
+# StandardOutput=syslog
+
+ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir
+ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl start -D ${DATA_DIR} -s -l ${DATA_DIR}/postmaster.log -o "-p ${PGPORT} -D ${PGDATA} --data-directory=${DATA_DIR}" -w -t 300
+ExecStop=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl stop -D ${DATA_DIR} -s -m fast
+ExecReload=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl reload -D ${DATA_DIR} -s
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+# Disable OOM kill on the postmaster
+OOMScoreAdjust=-1000
+
+# Make sure the required runtimedir is present
+RuntimeDirectory=postgresql
+RuntimeDirectoryMode=1775
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/postgresql/files/postgresql.service-9.2 b/dev-db/postgresql/files/postgresql.service-9.2
new file mode 100644
index 000000000000..20ed27a10f29
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.service-9.2
@@ -0,0 +1,51 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change the server's port number to 5433,
+# create a file named
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf"
+# containing:
+# [Service]
+# Environment=PGPORT=5433
+# This will override the setting appearing below.
+
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Service]
+Type=forking
+
+User=postgres
+Group=postgres
+
+# Port number for server to listen on
+Environment=PGPORT=5432
+
+# Location of configuration files
+Environment=PGDATA=/etc/postgresql-@SLOT@
+
+# Where the data directory is located
+Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data
+
+# Where to send early-startup messages from the server (before the logging
+# options of postgresql.conf take effect)
+# This is normally controlled by the global default set by systemd
+# StandardOutput=syslog
+
+ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir
+ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl start -D ${DATA_DIR} -s -l ${DATA_DIR}/postmaster.log -o "-p ${PGPORT} -D ${PGDATA} --data-directory=${DATA_DIR}" -w -t 300
+ExecStop=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl stop -D ${DATA_DIR} -s -m fast
+ExecReload=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl reload -D ${DATA_DIR} -s
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+# Disable OOM kill on the postmaster
+OOMScoreAdjust=-1000
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/postgresql/files/postgresql.service-9.6 b/dev-db/postgresql/files/postgresql.service-9.6
new file mode 100644
index 000000000000..89ec2d5cf7c0
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.service-9.6
@@ -0,0 +1,56 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change the server's port number to 5433,
+# create a file named
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf"
+# containing:
+# [Service]
+# Environment=PGPORT=5433
+# This will override the setting appearing below.
+
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Service]
+Type=notify
+
+User=postgres
+Group=postgres
+
+# Port number for server to listen on
+Environment=PGPORT=5432
+
+# Location of configuration files
+Environment=PGDATA=/etc/postgresql-@SLOT@
+
+# Where the data directory is located
+Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data
+
+# Where to send early-startup messages from the server (before the logging
+# options of postgresql.conf take effect)
+# This is normally controlled by the global default set by systemd
+# StandardOutput=syslog
+
+ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir
+ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres -p ${PGPORT} -D ${DATA_DIR}
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=mixed
+KillSignal=SIGINT
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+# Disable OOM kill on the postmaster
+OOMScoreAdjust=-1000
+
+# Make sure the required runtimedir is present
+RuntimeDirectory=postgresql
+RuntimeDirectoryMode=1775
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/postgresql/files/postgresql.service-9.6-r1 b/dev-db/postgresql/files/postgresql.service-9.6-r1
new file mode 100644
index 000000000000..3b92e851f299
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.service-9.6-r1
@@ -0,0 +1,52 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change the server's port number to 5433,
+# create a file named
+# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf"
+# containing:
+# [Service]
+# Environment=PGPORT=5433
+# This will override the setting appearing below.
+
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Service]
+Type=notify
+
+User=postgres
+Group=postgres
+
+# Port number for server to listen on
+Environment=PGPORT=5432
+
+# Location of configuration files
+Environment=PGDATA=/etc/postgresql-@SLOT@
+
+# Where the data directory is located
+Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data
+
+# Where to send early-startup messages from the server (before the logging
+# options of postgresql.conf take effect)
+# This is normally controlled by the global default set by systemd
+# StandardOutput=syslog
+
+ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir
+ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/postgres -p ${PGPORT} -D ${DATA_DIR}
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=mixed
+KillSignal=SIGINT
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+# Disable OOM kill on the postmaster
+OOMScoreAdjust=-1000
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/postgresql/files/postgresql.tmpfiles b/dev-db/postgresql/files/postgresql.tmpfiles
new file mode 100644
index 000000000000..650ae22b7c1b
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql.tmpfiles
@@ -0,0 +1 @@
+d /run/postgresql 1775 root postgres -
diff --git a/dev-db/postgresql/metadata.xml b/dev-db/postgresql/metadata.xml
new file mode 100644
index 000000000000..c02f7774e30a
--- /dev/null
+++ b/dev-db/postgresql/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+ <use>
+ <flag name="pg_legacytimestamp">
+ Use double precision floating-point numbers instead of 64-bit
+ integers for timestamp storage.
+ </flag>
+ <flag name="server">
+ Disable to build and install the clients and libraries only.
+ </flag>
+ <flag name="uuid">
+ Enable server side UUID generation (via
+ <pkg>dev-libs/ossp-uuid</pkg>).
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/postgresql/postgresql-10.0-r1.ebuild b/dev-db/postgresql/postgresql-10.0-r1.ebuild
new file mode 100644
index 000000000000..18fea4c814b0
--- /dev/null
+++ b/dev-db/postgresql/postgresql-10.0-r1.ebuild
@@ -0,0 +1,464 @@
+# 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 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"
+
+ 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 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-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+ fi
+}
+
+pkg_postinst() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ 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-10.0.ebuild b/dev-db/postgresql/postgresql-10.0.ebuild
new file mode 100644
index 000000000000..f8c09bb804cc
--- /dev/null
+++ b/dev-db/postgresql/postgresql-10.0.ebuild
@@ -0,0 +1,462 @@
+# 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 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"
+
+ 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 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
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+ fi
+
+ 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.2.19.ebuild b/dev-db/postgresql/postgresql-9.2.19.ebuild
new file mode 100644
index 000000000000..008123508d64
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.2.19.ebuild
@@ -0,0 +1,394 @@
+# 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.22.ebuild b/dev-db/postgresql/postgresql-9.2.22.ebuild
new file mode 100644
index 000000000000..6da7c31e6c4e
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.2.22.ebuild
@@ -0,0 +1,445 @@
+# 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 ~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 || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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%/}"
+
+ 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}
+
+ # 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/.}tmp"
+ 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.23-r1.ebuild b/dev-db/postgresql/postgresql-9.2.23-r1.ebuild
new file mode 100644
index 000000000000..e51086d898b3
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.2.23-r1.ebuild
@@ -0,0 +1,449 @@
+# 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 ~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 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= )
+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 || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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%/}"
+
+ 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}
+
+ # 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/.}tmp"
+ 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}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ 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 1775 /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() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ 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.23.ebuild b/dev-db/postgresql/postgresql-9.2.23.ebuild
new file mode 100644
index 000000000000..b32870c3a84a
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.2.23.ebuild
@@ -0,0 +1,445 @@
+# 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 ~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 || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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%/}"
+
+ 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}
+
+ # 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/.}tmp"
+ 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.15.ebuild b/dev-db/postgresql/postgresql-9.3.15.ebuild
new file mode 100644
index 000000000000..8a187562c900
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.3.15.ebuild
@@ -0,0 +1,399 @@
+# 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.18.ebuild b/dev-db/postgresql/postgresql-9.3.18.ebuild
new file mode 100644
index 000000000000..37b53c36ff12
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.3.18.ebuild
@@ -0,0 +1,450 @@
+# 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 ~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 || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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%/}"
+
+ 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}
+
+ # 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/.}tmp"
+ 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.19-r1.ebuild b/dev-db/postgresql/postgresql-9.3.19-r1.ebuild
new file mode 100644
index 000000000000..ff42ac626f75
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.3.19-r1.ebuild
@@ -0,0 +1,454 @@
+# 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 ~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 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= )
+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 || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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%/}"
+
+ 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}
+
+ # 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/.}tmp"
+ 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}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ 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 1775 /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() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ 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.19.ebuild b/dev-db/postgresql/postgresql-9.3.19.ebuild
new file mode 100644
index 000000000000..41dc55cea872
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.3.19.ebuild
@@ -0,0 +1,450 @@
+# 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 ~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 || eapply "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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%/}"
+
+ 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}
+
+ # 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/.}tmp"
+ 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.10.ebuild b/dev-db/postgresql/postgresql-9.4.10.ebuild
new file mode 100644
index 000000000000..61f957f53221
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4.10.ebuild
@@ -0,0 +1,431 @@
+# 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.13.ebuild b/dev-db/postgresql/postgresql-9.4.13.ebuild
new file mode 100644
index 000000000000..f17788a2300c
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4.13.ebuild
@@ -0,0 +1,482 @@
+# 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 ~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 || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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 !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}
+
+ # 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/.}tmp"
+ 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.14-r1.ebuild b/dev-db/postgresql/postgresql-9.4.14-r1.ebuild
new file mode 100644
index 000000000000..d77190ea0a50
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4.14-r1.ebuild
@@ -0,0 +1,486 @@
+# 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 ~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 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= )
+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}-9.4.10-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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 !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}
+
+ # 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/.}tmp"
+ 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}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ 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 1775 /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() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ 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.14.ebuild b/dev-db/postgresql/postgresql-9.4.14.ebuild
new file mode 100644
index 000000000000..a5ce342394d8
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.4.14.ebuild
@@ -0,0 +1,482 @@
+# 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 ~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 || eapply "${FILESDIR}/${PN}-9.4.10-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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 !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}
+
+ # 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/.}tmp"
+ 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.5.ebuild b/dev-db/postgresql/postgresql-9.5.5.ebuild
new file mode 100644
index 000000000000..1393518bebd8
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.5.5.ebuild
@@ -0,0 +1,442 @@
+# 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.5.8.ebuild b/dev-db/postgresql/postgresql-9.5.8.ebuild
new file mode 100644
index 000000000000..0e5a7b5009f5
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.5.8.ebuild
@@ -0,0 +1,488 @@
+# 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_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 || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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) \
+ $(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}
+
+ # 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/.}tmp"
+ 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.9-r1.ebuild b/dev-db/postgresql/postgresql-9.5.9-r1.ebuild
new file mode 100644
index 000000000000..721f27ae0f95
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.5.9-r1.ebuild
@@ -0,0 +1,492 @@
+# 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_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 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= )
+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}-9.5.5-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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) \
+ $(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}
+
+ # 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/.}tmp"
+ 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}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.2" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ 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 1775 /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() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ 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.9.ebuild b/dev-db/postgresql/postgresql-9.5.9.ebuild
new file mode 100644
index 000000000000..5db745095a88
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.5.9.ebuild
@@ -0,0 +1,488 @@
+# 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_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 || eapply "${FILESDIR}/${PN}-9.5.5-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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) \
+ $(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}
+
+ # 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/.}tmp"
+ 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.6.4.ebuild b/dev-db/postgresql/postgresql-9.6.4.ebuild
new file mode 100644
index 000000000000..98b451d44981
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.6.4.ebuild
@@ -0,0 +1,495 @@
+# 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_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 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= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+server? ( systemd? ( sys-apps/systemd ) )
+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}.3-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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
+ 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}
+
+ # 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/.}tmp"
+ 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}
+
+ 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_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
+ 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.6.5-r1.ebuild b/dev-db/postgresql/postgresql-9.6.5-r1.ebuild
new file mode 100644
index 000000000000..df077d0dfb87
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.6.5-r1.ebuild
@@ -0,0 +1,497 @@
+# 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_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 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= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+server? ( systemd? ( sys-apps/systemd ) )
+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}.3-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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
+ 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}
+
+ # 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/.}tmp"
+ 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}
+
+ if use systemd; then
+ sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
+ "${FILESDIR}/${PN}.service-9.6-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ 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 1775 /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() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ 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.6.5.ebuild b/dev-db/postgresql/postgresql-9.6.5.ebuild
new file mode 100644
index 000000000000..66369e14a212
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9.6.5.ebuild
@@ -0,0 +1,495 @@
+# 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_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 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= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+server? ( systemd? ( sys-apps/systemd ) )
+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}.3-no-server.patch"
+
+ if use pam ; then
+ sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
+ -i src/backend/libpq/auth.c || \
+ die 'PGSQL_PAM_SERVICE rename failed.'
+ fi
+
+ 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
+ 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}
+
+ # 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/.}tmp"
+ 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}
+
+ 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_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
+ 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-9999.ebuild b/dev-db/postgresql/postgresql-9999.ebuild
new file mode 100644
index 000000000000..af236abbcc11
--- /dev/null
+++ b/dev-db/postgresql/postgresql-9999.ebuild
@@ -0,0 +1,446 @@
+# 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 git-r3 linux-info multilib pam prefix \
+ python-single-r1 systemd user versionator
+
+KEYWORDS=""
+
+# Bump when rc released.
+SLOT="11"
+
+EGIT_REPO_URI="https://git.postgresql.org/git/postgresql.git"
+
+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="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= )
+ssl? (
+ !libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
+ libressl? ( dev-libs/libressl:= )
+)
+server? ( systemd? ( sys-apps/systemd ) )
+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
+>=dev-lang/perl-5.8
+app-text/docbook-dsssl-stylesheets
+app-text/docbook-sgml-dtd:4.2
+app-text/docbook-xml-dtd:4.2
+app-text/docbook-xsl-stylesheets
+app-text/openjade
+dev-libs/libxml2
+dev-libs/libxslt
+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_pretend() {
+ ewarn "You are using a live ebuild that uses the current source code as it is"
+ ewarn "available from PostgreSQL's Git repository at emerge time. Given such,"
+ ewarn "the GNU Makefiles may be altered by upstream without notice and the"
+ ewarn "documentation for this live version is not readily available"
+ ewarn "online. Ergo, the ebuild maintainers will not support building a"
+ ewarn "client-only and/or document-free version."
+}
+
+pkg_setup() {
+ 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
+
+ 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%/}"
+
+ 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) \
+ $(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 world
+}
+
+src_install() {
+ emake DESTDIR="${D}" install-world
+
+ dodoc README HISTORY doc/{TODO,bug.template}
+
+ insinto /etc/postgresql-${SLOT}
+ newins src/bin/psql/psqlrc.sample psqlrc
+
+ use static-libs || find "${ED}" -name '*.a' -delete
+
+ 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-r1" | \
+ systemd_newunit - ${PN}-${SLOT}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
+ fi
+
+ newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
+
+ use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
+
+ 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
+
+ # 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
+
+ if use prefix ; then
+ keepdir /run/postgresql
+ fperms 1775 /run/postgresql
+ fi
+}
+
+pkg_preinst() {
+ # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
+ # /usr/bin/psql97). 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(). We
+ # only worry about the 9.7 slot as that's the last slot that had its
+ # slot-specific links generated by eselect.
+ #
+ # This can be removed when 10 is the lowest slot in the tree.
+ 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
+ [[ $(${canonicalise} "${l}") == *postgresql-9.7* ]] && rm "${l}"
+ 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() {
+ use server && use systemd && systemd_tmpfiles_create ${PN}-${SLOT}.conf
+ postgresql-config update
+
+ elog "If you need a global psqlrc-file, you can place it in:"
+ elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
+
+ elog
+ elog "Gentoo specific documentation:"
+ elog "https://wiki.gentoo.org/wiki/PostgreSQL"
+ elog
+ elog "Official documentation:"
+ elog "${EROOT%/}/usr/share/doc/${PF}/html"
+ elog
+ elog "The default location of the Unix-domain socket is:"
+ elog " ${EROOT%/}/run/postgresql/"
+ elog
+ elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
+ elog "so that it contains your preferred locale, and other options, in:"
+ elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
+ elog
+ elog "Then, execute the following command to setup the initial database"
+ elog "environment:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+}
+
+pkg_prerm() {
+ if [[ -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() {
+ [[ -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() {
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+
+ if [[ ${UID} -ne 0 ]] ; then
+ emake check
+
+ einfo "If you think other tests besides the regression tests are necessary, please"
+ einfo "submit a bug including a patch for this ebuild to enable them."
+ else
+ [[ ${UID} -eq 0 ]] || \
+ ewarn "Tests cannot be run as root. Enable 'userpriv' in FEATURES."
+
+ ewarn "Skipping."
+ fi
+}
diff --git a/dev-db/psqlodbc/Manifest b/dev-db/psqlodbc/Manifest
new file mode 100644
index 000000000000..8aeac50f3067
--- /dev/null
+++ b/dev-db/psqlodbc/Manifest
@@ -0,0 +1,9 @@
+DIST psqlodbc-09.06.0200.tar.gz 887807 SHA256 aaa44027f98478635b4ab512a4f90c1aaf56a710276a482b3b0ef6740e20e415 SHA512 d8e3b6c13e657b4a3435ace94e6e1265a5a1a7bcd3a1f81348ca4edcb532b66036e3595ecd7224d3104f6a3f2e02704f73c1b62d94e9879528933edef7764552 WHIRLPOOL 398386f79928e65d29a493fa7d293e9adf2e6352c95c21d9e474675f0a5562128f7f514c834f444659222ebabc84402e5b9abc7a4832728468eb6e4b79c0e609
+DIST psqlodbc-09.06.0300.tar.gz 898065 SHA256 8033061fdbd27a2a2f7b97fd29d3618ac0dcb68f99dca4bad9bc56d2fc1d0c02 SHA512 c7e31138888307bd25ff80c0796deb653a1e8f57af85ff91f9f307c2b3b683d9d8bc4b18a837dc604a9f896f85ee489a6678a2a69782258b17bdb9d2911e968c WHIRLPOOL ceb5b0d315054de3ba90b6523a68913e91963f0aa9175697e02731ab5811214bbc77dacb139a9b57cc8828ec17a8aed2238203872fc3c82af4f0050aafceea32
+DIST psqlodbc-09.06.0310.tar.gz 898154 SHA256 6c42078af094d61baca2c8bd1dc4d137a77377198ef94e4eda5989bdce3474c3 SHA512 ccd6536a4065428d906be74c4381471c01b386668be3746daabaa9a9b8ef6fb09c42e400fe1207b6e3336b8625716b6bd9a61e9b88080f4f7cd233e96cb55f8a WHIRLPOOL 7f63af6f72fb1ae77781c20fe4e83077c6372350d19883fa6c6e720683e293b33a2b695d525f4fa788fe59046c4be751a5c79bbd4f8396120c803c11b0f93fb7
+EBUILD psqlodbc-09.06.0200.ebuild 718 SHA256 ec5758b55a3c3b8346e5a849594fe65fdd5512e77e7648edbfe3d2b73fa34fd2 SHA512 523f1939b1136ae7baa1b23ad99d5643b19edc7ad8815681e7cb1ad19e7499a2cdc33c7c8f3255531a7d1115db909196b1d85261b419d2e0a3d623fb56179c83 WHIRLPOOL d4684a1251955505dd8af790026ec94d2252a2c83a63653ae5dd7f488dd51c45ac8d5f7f533e82e099c141fbe500d9b40f5666b54a68f25da3323ca43ecc25fb
+EBUILD psqlodbc-09.06.0300.ebuild 684 SHA256 446faa6acb1f608ecd50219c70242523410459ef64795bf37997260740d14029 SHA512 62e2bde253fe3718b48a8e62eabc7d634568c2047e750f98addfd6c297cde3395a460d69b97e64551aa89e8c0008bb39b10bec8f224ec38e587bb1aea4c743b8 WHIRLPOOL a49b7f2552f6e16c67e3d3bb75225cbcde2b76034ba57a1862a36c0dccb7f8d77e813de2b572427718b1402e356300ad4c37ee69524b9c482c4ff81a5bb6cef9
+EBUILD psqlodbc-09.06.0310.ebuild 684 SHA256 446faa6acb1f608ecd50219c70242523410459ef64795bf37997260740d14029 SHA512 62e2bde253fe3718b48a8e62eabc7d634568c2047e750f98addfd6c297cde3395a460d69b97e64551aa89e8c0008bb39b10bec8f224ec38e587bb1aea4c743b8 WHIRLPOOL a49b7f2552f6e16c67e3d3bb75225cbcde2b76034ba57a1862a36c0dccb7f8d77e813de2b572427718b1402e356300ad4c37ee69524b9c482c4ff81a5bb6cef9
+MISC ChangeLog 2961 SHA256 74f8a84c1269786d10c3c63de880c8685fd17083957a08ddecc92e7b536663ce SHA512 98c1c92302a54f26f25534b44b0f9e6d093f41b3e2e7c6fefd632fb2ee6150b7d4528cf67228260b23dc8f469c9fdf981c39db813b764e74be0e754d9fddb204 WHIRLPOOL 966d452a974e262e2424910d6cd3a99a04a2340d9145428d29d74569400225f58450ea0433490607d1e711c80e60c59460e33154835b58ceb990405e0179e829
+MISC ChangeLog-2015 1118 SHA256 4248db8cc84f97a9441faab3b4d8bec88dc4e6d6ebc4ff52467a4dce689dcc53 SHA512 f5936d3780f7de9d714dcb346ea4654eca389e731f68d3d0d587c62f0f47685c8588d21519c18f60ad591675a2997dead1ecdb96b1f75c49f17803a55ba5404e WHIRLPOOL afaa673c5923d677ff7588172c3ebef435f1d7de20da689f0ad4a40ca6c63a17707ac6a4f99d002661221d61089f690f9fcc045d9ad81d7a865c43b20165d9d8
+MISC metadata.xml 366 SHA256 a2f5d659b5874904cba3e595f2d16fe9f19ecf4d0e7074c326944eeeef928370 SHA512 a6aa6cbb188fa2ed889ecb69c60b77d33c52ee69a5e9b3c20d8faf9bd9616d33f592c85bded3351fb099b6424e2f7728ee11fb1114121604ceacd9e7e0a13f7b WHIRLPOOL 42f7cd372d0a6cc87bc558f6065446ac544dffba4f4b349d43560ec22465220fd718a2e0420cf2d41ef3b08df9f9a88f58747362b08ff48356bb18289652184c
diff --git a/dev-db/psqlodbc/metadata.xml b/dev-db/psqlodbc/metadata.xml
new file mode 100644
index 000000000000..30334effd39b
--- /dev/null
+++ b/dev-db/psqlodbc/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+<email>pgsql-bugs@gentoo.org</email>
+<name>PostgreSQL and Related Package Development</name>
+</maintainer>
+<use>
+<flag name="iodbc">Use dev-db/libiodbc. Disable to use dev-db/unixODBC.</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/psqlodbc/psqlodbc-09.06.0200.ebuild b/dev-db/psqlodbc/psqlodbc-09.06.0200.ebuild
new file mode 100644
index 000000000000..1b84488b8768
--- /dev/null
+++ b/dev-db/psqlodbc/psqlodbc-09.06.0200.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Official ODBC driver for PostgreSQL"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/odbc/versions/src/${P}.tar.gz"
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc iodbc ssl threads unicode"
+
+DEPEND="dev-db/postgresql:*[ssl?]
+ !iodbc? ( dev-db/unixODBC )
+ iodbc? ( dev-db/libiodbc )
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ econf \
+ $(use_with iodbc) \
+ $(use_with !iodbc unixodbc) \
+ $(use_enable threads pthreads) \
+ $(use_enable unicode)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc readme.txt
+ use doc && dodoc docs/*{html,jpg,txt}
+}
diff --git a/dev-db/psqlodbc/psqlodbc-09.06.0300.ebuild b/dev-db/psqlodbc/psqlodbc-09.06.0300.ebuild
new file mode 100644
index 000000000000..0db49481b159
--- /dev/null
+++ b/dev-db/psqlodbc/psqlodbc-09.06.0300.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Official ODBC driver for PostgreSQL"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/odbc/versions/src/${P}.tar.gz"
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc iodbc ssl threads"
+
+DEPEND="dev-db/postgresql:*[ssl?]
+ !iodbc? ( dev-db/unixODBC )
+ iodbc? ( dev-db/libiodbc )
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ econf \
+ $(use_with iodbc) \
+ $(use_with !iodbc unixodbc) \
+ $(use_enable threads pthreads)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc readme.txt
+ use doc && dodoc docs/*{html,jpg,txt}
+}
diff --git a/dev-db/psqlodbc/psqlodbc-09.06.0310.ebuild b/dev-db/psqlodbc/psqlodbc-09.06.0310.ebuild
new file mode 100644
index 000000000000..0db49481b159
--- /dev/null
+++ b/dev-db/psqlodbc/psqlodbc-09.06.0310.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="Official ODBC driver for PostgreSQL"
+HOMEPAGE="http://www.postgresql.org/"
+SRC_URI="mirror://postgresql/odbc/versions/src/${P}.tar.gz"
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc iodbc ssl threads"
+
+DEPEND="dev-db/postgresql:*[ssl?]
+ !iodbc? ( dev-db/unixODBC )
+ iodbc? ( dev-db/libiodbc )
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ econf \
+ $(use_with iodbc) \
+ $(use_with !iodbc unixodbc) \
+ $(use_enable threads pthreads)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc readme.txt
+ use doc && dodoc docs/*{html,jpg,txt}
+}
diff --git a/dev-db/qdbm/Manifest b/dev-db/qdbm/Manifest
new file mode 100644
index 000000000000..8e0d1e51c212
--- /dev/null
+++ b/dev-db/qdbm/Manifest
@@ -0,0 +1,9 @@
+AUX qdbm-configure.patch 3385 SHA256 19b84a96676695cd95afe0a69a93f350c8429455a1f33d906b8cb6bd3211aaac SHA512 a6eeed36b87bdaf9bbddbc7aa641cfca89e72e2e6c2acaec66b0444db9bd39f57afae0c8fb065293875c45dbb14ff6826a4c93061b7457c32b42943e8113d89a WHIRLPOOL 98274d41196862b0da0c60bbaa27202dd8d99f86c164a948840d8cc5a53ae06871a02a56049fcacbc7d522e08b87886e5826d2696894ac99824a17eee4328003
+AUX qdbm-perl.patch 1260 SHA256 9636a32be685a916c9fdfd81d14913971a0dd8242c82eae785e2c23a6368fbf3 SHA512 a7356c2f5a4313e7da2524a6276bca5720459858d8619bfd8e6514cd9c1cd9aa1a2f7f0592e5ad1ee8b05e7e34452761e26be351f8e933e79a75cb4d19c862f3 WHIRLPOOL 4037b5b1088fbcfb91684536aa513e54a474efa019f814c8b0482997b826dbaa4afe67c8dffa3d9b68fd8afd3027748a2988b93bb3b6959d85516634d0f4d7c5
+AUX qdbm-ruby19.patch 10116 SHA256 435007e7696ddb8cae7770c5f89e90b52e2b393ad66cebc47bcaa093ea00de3f SHA512 f3e6c320a600ad3355fc74a333c28fc2dd904a2a52ca91a51f21b3dd14c7527bf312f5040dbc3e4f61d2dbcc0ade185e226333c79f9a04fc05437a156befc0e7 WHIRLPOOL d7df98acc831a278dacd909613513fa7aec3634efc9eeac94e460f71e7a0d7215e20a31edcb6066af98779302acd6375524192fcbf4821aaf52df853c2e425b1
+AUX qdbm-runpath.patch 1133 SHA256 9b1db56970f1048ee48d4ab03a1566a531661a1fe7f025da2ad165c67658895e SHA512 de8bde4a614617d742131e8025fd661019ec81b803817ef32ffca461b2c8b60c20756f6e6f84d6f23124eed3947ab3573b8c4a05b254f8b4d3e53f0cf7bc8452 WHIRLPOOL 5702dda2fb51121da7f0137d564a8566deeac14509bc35a392844336676869450ae5a167f2b8cc5c13a177c5d97879ff6361eec88f01ab4f5fe0c7b390387120
+DIST qdbm-1.8.78.tar.gz 1015429 SHA256 b466fe730d751e4bfc5900d1f37b0fb955f2826ac456e70012785e012cdcb73e SHA512 480549c56071bf82edf714a611aef863599c858ed63702820ae0890fd2c0029d1a231ed94a8090c74420dd648bd3625d270a5c078b113cbb86a12ef509e19037 WHIRLPOOL a42d2c981bf28e5b4619bf166177449abba02ef774a783c33feb7be04ef558cbec4b7e2ea4db85782eb59f57bdebeb0eb8170455e480cc5b578f7a6e0e3a39da
+EBUILD qdbm-1.8.78-r1.ebuild 3247 SHA256 829965f538a1c230d6df92a32f94f67f316e7f4f9246921a60c52e0f39ea9090 SHA512 4e55f633612814e0f91af7ff0434727734b1a187398780d5ab54de4e3b78fdebb13e09ce2f32eb8d60c2a39ab7e6f03458b84125854b9b691c1abc4410ab6942 WHIRLPOOL e666dcea71cc4c9ac8a75fd7f34b719bc126a6973a9de80c6d0e549e1a268c739afa93518a97ac41c1c81fa3ce9c89c62cdd3cdefa6444b147e30d732e125261
+MISC ChangeLog 2264 SHA256 9ac8dd58121d5a9f1ae1c50b72ee7291a2d10fc05e26076da3bb738918bfbb9d SHA512 f556b1c228f3d43c5d759a849dc240d5e3f110ca002040c56370bbf6898dfc665dfe944ebe427fb1709666efe10498021004a8a6155125e707a0466a257bc8bf WHIRLPOOL e6819dc825037b37e74e9c282d21b43fce50d3ec675f3b43f9d70cf5363a05ccd7912694ed09db7c7aa72c65bb6e0afdcdc4bda6d05beb45dedffb906156702d
+MISC ChangeLog-2015 16311 SHA256 7d9c8e4ddadf5931b4fa5041341578bdd8812653bd75701afe3b836519d99e3a SHA512 68589dd037a3495861352f87bbe10930f5ce32f6d4bdbf517e2115571277a8033d99c17821e4d3812fb6bf212d406f05a6eacb332b890db2c8b82029446e1291 WHIRLPOOL 2622c588e4e691bb8ca69b5133dc3460615ebd56e53e4b92594940354d207d3e2a406a9f3cc876ef3be259b589d70106d235deb0252731c92b22a6ac724a71fb
+MISC metadata.xml 221 SHA256 27a3fa259bbce0eb90b1fe397126b9d5ef4e906e824ae72f9ea923fff8da6d02 SHA512 a11e9bbbabc9ac96985c5dc247e601b065fa762f12bce74224896c27aee34eb908187622bfc849c39c6c722a8ef8ee72b248afc84da1b0eb72f1ff5eeb13bbf0 WHIRLPOOL e8ddaad694d5f22a229ccc3dc7597a11dce9ffd502ed3fa64b9cc760d3404c4dac31c9b9948b38b2eee0efc446a8aee52a73f87ec28d229670ba3bfc3cb9a95c
diff --git a/dev-db/qdbm/files/qdbm-configure.patch b/dev-db/qdbm/files/qdbm-configure.patch
new file mode 100644
index 000000000000..364c5c9f653e
--- /dev/null
+++ b/dev-db/qdbm/files/qdbm-configure.patch
@@ -0,0 +1,108 @@
+--- a/cgi/configure.in
++++ b/cgi/configure.in
+@@ -13,15 +13,6 @@
+ # Export variables
+ TARGETS="all"
+
+-# Building paths
+-pathtmp="$PATH"
+-PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+-PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH
+-
+
+
+ #================================================================
+--- a/configure.in
++++ b/configure.in
+@@ -20,15 +20,6 @@
+ LD="ld"
+ AR="ar"
+
+-# Building paths
+-pathtmp="$PATH"
+-PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+-PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH
+-
+
+
+ #================================================================
+--- a/java/configure.in
++++ b/java/configure.in
+@@ -25,15 +25,6 @@
+ MYOPTS=""
+ LD="ld"
+
+-# Building paths
+-pathtmp="$PATH"
+-PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+-PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH
+-
+
+
+ #================================================================
+--- a/perl/configure.in
++++ b/perl/configure.in
+@@ -5,15 +5,6 @@
+ # Targets
+ AC_INIT(qdbm-perl, 1.0.0)
+
+-# Building paths
+-pathtmp="$PATH"
+-PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+-PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH
+-
+ # Setting the default prefix
+ if test "$prefix" = NONE
+ then
+--- a/plus/configure.in
++++ b/plus/configure.in
+@@ -19,15 +19,6 @@
+ LD="ld"
+ AR="ar"
+
+-# Building paths
+-pathtmp="$PATH"
+-PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+-PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH
+-
+
+
+ #================================================================
+--- a/ruby/configure.in
++++ b/ruby/configure.in
+@@ -5,15 +5,6 @@
+ # Targets
+ AC_INIT(qdbm-ruby, 1.0.0)
+
+-# Building paths
+-pathtmp="$PATH"
+-PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+-PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH
+-
+ # Setting the default prefix
+ if test "$prefix" = NONE
+ then
diff --git a/dev-db/qdbm/files/qdbm-perl.patch b/dev-db/qdbm/files/qdbm-perl.patch
new file mode 100644
index 000000000000..1a7ca6a70dcd
--- /dev/null
+++ b/dev-db/qdbm/files/qdbm-perl.patch
@@ -0,0 +1,34 @@
+--- a/perl/Makefile.in
++++ b/perl/Makefile.in
+@@ -25,10 +25,10 @@
+ DESTDIR =
+
+ # Building binaries
+-CC = gcc
++CC = @CC@
+ INC = -I. -I../.. -I$(HOME)/include -I/usr/local/include
+ OPTIMIZE = -O2
+-LD = gcc
++LD = @CC@
+ LIBS = -L../.. -I$(HOME)/lib -L/usr/local/lib -lqdbm @LIBS@
+ RUNENV = LD_LIBRARY_PATH=.:..:../..:/usr/local/lib:$(HOME)/lib
+
+@@ -42,15 +42,15 @@
+ all :
+ cd depot && [ -f Makefile ] || \
+ $(RUNENV) perl Makefile.PL CC="$(CC)" INC="$(INC)" OPTIMIZE="$(OPTIMIZE)" \
+- LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" ; \
++ LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" INSTALLDIRS="vendor" ; \
+ $(RUNENV) make
+ cd curia && [ -f Makefile ] || \
+ $(RUNENV) perl Makefile.PL CC="$(CC)" INC="$(INC)" OPTIMIZE="$(OPTIMIZE)" \
+- LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" ; \
++ LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" INSTALLDIRS="vendor" ; \
+ $(RUNENV) make
+ cd villa && [ -f Makefile ] || \
+ $(RUNENV) perl Makefile.PL CC="$(CC)" INC="$(INC)" OPTIMIZE="$(OPTIMIZE)" \
+- LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" ; \
++ LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" INSTALLDIRS="vendor" ; \
+ $(RUNENV) make
+ @printf '\n'
+ @printf '#================================================================\n'
diff --git a/dev-db/qdbm/files/qdbm-ruby19.patch b/dev-db/qdbm/files/qdbm-ruby19.patch
new file mode 100644
index 000000000000..8724e7cdc4ed
--- /dev/null
+++ b/dev-db/qdbm/files/qdbm-ruby19.patch
@@ -0,0 +1,373 @@
+--- a/ruby/Makefile.in
++++ b/ruby/Makefile.in
+@@ -85,27 +85,27 @@
+ sync ; sync
+ cd depot && rm -rf casket
+ cd depot && \
+- $(RUNENV) ruby -w -Ilib rbdptest write casket 10000 1000
++ $(RUNENV) ruby -w -Ilib -I. rbdptest write casket 10000 1000
+ cd depot && \
+- $(RUNENV) ruby -w -Ilib rbdptest read casket
++ $(RUNENV) ruby -w -Ilib -I. rbdptest read casket
+ cd depot && \
+- $(RUNENV) ruby -w -Ilib rbdptest misc casket
++ $(RUNENV) ruby -w -Ilib -I. rbdptest misc casket
+ cd depot && rm -rf casket
+ cd curia && rm -rf casket
+ cd curia && \
+- $(RUNENV) ruby -w -Ilib rbcrtest write casket 10000 1000 10
++ $(RUNENV) ruby -w -Ilib -I. rbcrtest write casket 10000 1000 10
+ cd curia && \
+- $(RUNENV) ruby -w -Ilib rbcrtest read casket
++ $(RUNENV) ruby -w -Ilib -I. rbcrtest read casket
+ cd curia && \
+- $(RUNENV) ruby -w -Ilib rbcrtest misc casket
++ $(RUNENV) ruby -w -Ilib -I. rbcrtest misc casket
+ cd curia && rm -rf casket
+ cd villa && rm -rf casket
+ cd villa && \
+- $(RUNENV) ruby -w -Ilib rbvltest write casket 10000
++ $(RUNENV) ruby -w -Ilib -I. rbvltest write casket 10000
+ cd villa && \
+- $(RUNENV) ruby -w -Ilib rbvltest read casket
++ $(RUNENV) ruby -w -Ilib -I. rbvltest read casket
+ cd villa && \
+- $(RUNENV) ruby -w -Ilib rbvltest misc casket
++ $(RUNENV) ruby -w -Ilib -I. rbvltest misc casket
+ cd villa && rm -rf casket
+ @printf '\n'
+ @printf '#================================================================\n'
+--- a/ruby/configure.in
++++ b/ruby/configure.in
+@@ -17,7 +17,7 @@
+ # Setting the default prefix
+ if test "$prefix" = NONE
+ then
+- prefix=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("prefix"))'`
++ prefix=`ruby -rrbconfig -e 'puts(RbConfig::CONFIG.fetch("prefix"))'`
+ fi
+
+ # Duplication of QDBM for Ruby
+--- a/ruby/curia/mod_curia.c
++++ b/ruby/curia/mod_curia.c
+@@ -24,6 +24,13 @@
+
+ #define MAXOPEN 1024
+
++#ifndef StringValuePtr
++# define StringValuePtr(v) STR2CSTR(v)
++#endif
++#ifndef RSTRING_LEN
++# define RSTRING_LEN(s) (RSTRING(s)->len)
++#endif
++
+
+ VALUE ccuriaerror;
+ VALUE ccuriaerror_ENOERR;
+@@ -233,7 +240,7 @@
+ const char *name;
+ int index, omode, bnum, dnum;
+ if((index = getnewindex()) == -1) myerror(DP_EMISC);
+- name = STR2CSTR(vname);
++ name = StringValuePtr(vname);
+ FIXNUM_P(vomode);
+ omode = FIX2INT(vomode);
+ FIXNUM_P(vbnum);
+@@ -276,10 +283,10 @@
+ int index, ksiz, vsiz, dmode;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
+- vbuf = STR2CSTR(vval);
+- vsiz = RSTRING(vval)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
++ vbuf = StringValuePtr(vval);
++ vsiz = RSTRING_LEN(vval);
+ FIXNUM_P(vdmode);
+ dmode = FIX2INT(vdmode);
+ curia = crtable[index];
+@@ -297,8 +304,8 @@
+ int index, ksiz;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ curia = crtable[index];
+ if(!crout(curia, kbuf, ksiz)){
+ if(crsltable[index] && dpecode == DP_ENOITEM) return Qfalse;
+@@ -316,8 +323,8 @@
+ VALUE vval;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ FIXNUM_P(vstart);
+ start = FIX2INT(vstart);
+ FIXNUM_P(vmax);
+@@ -339,8 +346,8 @@
+ int index, ksiz, vsiz;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ curia = crtable[index];
+ if((vsiz = crvsiz(curia, kbuf, ksiz)) == -1){
+ if(crsltable[index] && dpecode == DP_ENOITEM) return INT2FIX(-1);
+--- a/ruby/curia/rbcrtest
++++ b/ruby/curia/rbcrtest
+@@ -21,7 +21,7 @@
+
+ # main routine
+ def main()
+- $0.gsub!(/.*\//, "")
++ $0 = $0.gsub(/.*\//, "")
+ (ARGV.length >= 1) || usage()
+ if(ARGV[0] == "write")
+ rv = runwrite()
+@@ -283,7 +283,7 @@
+
+
+ # execute main
+-$0.gsub!(/.*\//, "")
++$0 = $0.gsub(/.*\//, "")
+ exit(main())
+
+
+--- a/ruby/depot/mod_depot.c
++++ b/ruby/depot/mod_depot.c
+@@ -23,6 +23,13 @@
+
+ #define MAXOPEN 1024
+
++#ifndef StringValuePtr
++# define StringValuePtr(v) STR2CSTR(v)
++#endif
++#ifndef RSTRING_LEN
++# define RSTRING_LEN(s) (RSTRING(s)->len)
++#endif
++
+
+ VALUE cdepoterror;
+ VALUE cdepoterror_ENOERR;
+@@ -232,7 +239,7 @@
+ const char *name;
+ int index, omode, bnum;
+ if((index = getnewindex()) == -1) myerror(DP_EMISC);
+- name = STR2CSTR(vname);
++ name = StringValuePtr(vname);
+ FIXNUM_P(vomode);
+ omode = FIX2INT(vomode);
+ FIXNUM_P(vbnum);
+@@ -273,10 +280,10 @@
+ int index, ksiz, vsiz, dmode;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
+- vbuf = STR2CSTR(vval);
+- vsiz = RSTRING(vval)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
++ vbuf = StringValuePtr(vval);
++ vsiz = RSTRING_LEN(vval);
+ FIXNUM_P(vdmode);
+ dmode = FIX2INT(vdmode);
+ depot = dptable[index];
+@@ -294,8 +301,8 @@
+ int index, ksiz;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ depot = dptable[index];
+ if(!dpout(depot, kbuf, ksiz)){
+ if(dpsltable[index] && dpecode == DP_ENOITEM) return Qfalse;
+@@ -313,8 +320,8 @@
+ VALUE vval;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ FIXNUM_P(vstart);
+ start = FIX2INT(vstart);
+ FIXNUM_P(vmax);
+@@ -336,8 +343,8 @@
+ int index, ksiz, vsiz;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ depot = dptable[index];
+ if((vsiz = dpvsiz(depot, kbuf, ksiz)) == -1){
+ if(dpsltable[index] && dpecode == DP_ENOITEM) return INT2FIX(-1);
+--- a/ruby/depot/rbdptest
++++ b/ruby/depot/rbdptest
+@@ -21,7 +21,7 @@
+
+ # main routine
+ def main()
+- $0.gsub!(/.*\//, "")
++ $0 = $0.gsub(/.*\//, "")
+ (ARGV.length >= 1) || usage()
+ if(ARGV[0] == "write")
+ rv = runwrite()
+@@ -278,7 +278,7 @@
+
+
+ # execute main
+-$0.gsub!(/.*\//, "")
++$0 = $0.gsub(/.*\//, "")
+ exit(main())
+
+
+--- a/ruby/myrbdoc
++++ b/ruby/myrbdoc
+@@ -186,7 +186,7 @@
+
+
+ # execute main
+-#$0.gsub!(/.*\//, "")
++#$0 = $0.gsub(/.*\//, "")
+ exit(main())
+
+
+--- a/ruby/villa/mod_villa.c
++++ b/ruby/villa/mod_villa.c
+@@ -25,6 +25,13 @@
+
+ #define MAXOPEN 1024
+
++#ifndef StringValuePtr
++# define StringValuePtr(v) STR2CSTR(v)
++#endif
++#ifndef RSTRING_LEN
++# define RSTRING_LEN(s) (RSTRING(s)->len)
++#endif
++
+
+ VALUE cvillaerror;
+ VALUE cvillaerror_ENOERR;
+@@ -304,7 +311,7 @@
+ int index, omode, cmode;
+ VLCFUNC cmp;
+ if((index = getnewindex()) == -1) myerror(DP_EMISC);
+- name = STR2CSTR(vname);
++ name = StringValuePtr(vname);
+ FIXNUM_P(vomode);
+ omode = FIX2INT(vomode);
+ FIXNUM_P(vcmode);
+@@ -352,10 +359,10 @@
+ int index, ksiz, vsiz, dmode;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
+- vbuf = STR2CSTR(vval);
+- vsiz = RSTRING(vval)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
++ vbuf = StringValuePtr(vval);
++ vsiz = RSTRING_LEN(vval);
+ FIXNUM_P(vdmode);
+ dmode = FIX2INT(vdmode);
+ villa = vltable[index];
+@@ -373,8 +380,8 @@
+ int index, ksiz;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ villa = vltable[index];
+ if(!vlout(villa, kbuf, ksiz)){
+ if(vlsltable[index] && dpecode == DP_ENOITEM) return Qfalse;
+@@ -391,8 +398,8 @@
+ VALUE vval;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ villa = vltable[index];
+ if(!(vbuf = vlget(villa, kbuf, ksiz, &vsiz))){
+ if(vlsltable[index] && dpecode == DP_ENOITEM) return Qnil;
+@@ -409,8 +416,8 @@
+ int index, ksiz, vsiz;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ villa = vltable[index];
+ if((vsiz = vlvsiz(villa, kbuf, ksiz)) == -1){
+ if(vlsltable[index] && dpecode == DP_ENOITEM) return INT2FIX(-1);
+@@ -426,8 +433,8 @@
+ int index, ksiz, vnum;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ villa = vltable[index];
+ vnum = vlvnum(villa, kbuf, ksiz);
+ return INT2FIX(vnum);
+@@ -497,8 +504,8 @@
+ VALUE vval;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- kbuf = STR2CSTR(vkey);
+- ksiz = RSTRING(vkey)->len;
++ kbuf = StringValuePtr(vkey);
++ ksiz = RSTRING_LEN(vkey);
+ FIXNUM_P(vjmode);
+ jmode = FIX2INT(vjmode);
+ villa = vltable[index];
+@@ -551,8 +558,8 @@
+ int index, vsiz, cpmode;
+ FIXNUM_P(vindex);
+ if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
+- vbuf = STR2CSTR(vval);
+- vsiz = RSTRING(vval)->len;
++ vbuf = StringValuePtr(vval);
++ vsiz = RSTRING_LEN(vval);
+ FIXNUM_P(vcpmode);
+ cpmode = FIX2INT(vcpmode);
+ villa = vltable[index];
+--- a/ruby/villa/rbvltest
++++ b/ruby/villa/rbvltest
+@@ -21,7 +21,7 @@
+
+ # main routine
+ def main()
+- $0.gsub!(/.*\//, "")
++ $0 = $0.gsub(/.*\//, "")
+ (ARGV.length >= 1) || usage()
+ if(ARGV[0] == "write")
+ rv = runwrite()
+@@ -280,7 +280,7 @@
+
+
+ # execute main
+-$0.gsub!(/.*\//, "")
++$0 = $0.gsub(/.*\//, "")
+ exit(main())
+
+
diff --git a/dev-db/qdbm/files/qdbm-runpath.patch b/dev-db/qdbm/files/qdbm-runpath.patch
new file mode 100644
index 000000000000..56d85a5b14a5
--- /dev/null
+++ b/dev-db/qdbm/files/qdbm-runpath.patch
@@ -0,0 +1,30 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -61,7 +61,6 @@
+ LIBS = -lqdbm @LIBS@
+ LIBLDFLAGS = @LDFLAGS@ -L. -L$(MYLIBDIR) -L$(HOME)/lib -L/usr/local/lib @LIBS@
+ LDFLAGS = @LDFLAGS@ -L. -L$(MYLIBDIR) -L$(HOME)/lib -L/usr/local/lib $(LIBS)
+-LDENV = LD_RUN_PATH=/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib
+ AR = @AR@
+ ARFLAGS = rcsv
+ RUNENV = LD_LIBRARY_PATH=.:/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib
+--- a/cgi/Makefile.in
++++ b/cgi/Makefile.in
+@@ -28,7 +28,6 @@
+ CFLAGS = -Wall -ansi -pedantic -fsigned-char -O2
+ LIBS = -lqdbm @LIBS@
+ LDFLAGS = -L$(srcdir)/.. -L$(HOME)/lib -L/usr/local/lib $(LIBS)
+-LDENV = LD_RUN_PATH=/lib:/usr/lib:$(HOME)/lib:/usr/local/lib:$(prefix)/lib
+
+ # Install destinations
+ prefix = @prefix@
+--- a/plus/Makefile.in
++++ b/plus/Makefile.in
+@@ -51,7 +51,6 @@
+ -L$(HOME)/lib -L/usr/local/lib $(LIBS)
+ LDFLAGS = @LDFLAGS@ -L. -L$(srcdir)/.. -L$(MYLIBDIR) \
+ -L$(HOME)/lib -L/usr/local/lib -lxqdbm $(LIBS)
+-LDENV = LD_RUN_PATH=/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib
+ AR = @AR@
+ ARFLAGS = rcsv
+ RUNENV = LD_LIBRARY_PATH=.:..:/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib
diff --git a/dev-db/qdbm/metadata.xml b/dev-db/qdbm/metadata.xml
new file mode 100644
index 000000000000..21dc8fdf43ff
--- /dev/null
+++ b/dev-db/qdbm/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hattya@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/qdbm/qdbm-1.8.78-r1.ebuild b/dev-db/qdbm/qdbm-1.8.78-r1.ebuild
new file mode 100644
index 000000000000..fcb210018c4c
--- /dev/null
+++ b/dev-db/qdbm/qdbm-1.8.78-r1.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+USE_RUBY="ruby21 ruby22 ruby23 ruby24"
+RUBY_OPTIONAL="yes"
+
+inherit autotools java-pkg-opt-2 perl-functions ruby-ng
+
+DESCRIPTION="Quick Database Manager"
+HOMEPAGE="http://fallabs.com/qdbm/"
+SRC_URI="http://fallabs.com/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="bzip2 cxx debug java lzo perl ruby zlib"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ java? ( >=virtual/jre-1.4:* )
+ lzo? ( dev-libs/lzo )
+ perl? ( dev-lang/perl )
+ ruby? ( $(ruby_implementations_depend) )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ java? ( >=virtual/jdk-1.4:* )"
+S="${WORKDIR}/all/${P}"
+RUBY_S="${P}/ruby"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-configure.patch
+ "${FILESDIR}"/${PN}-perl.patch
+ "${FILESDIR}"/${PN}-ruby19.patch
+ "${FILESDIR}"/${PN}-runpath.patch
+)
+HTML_DOCS=( doc/. )
+
+AT_NOELIBTOOLIZE="yes"
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ use ruby && ruby-ng_pkg_setup
+}
+
+qdbm_foreach_api() {
+ local u
+ for u in cxx java perl ruby; do
+ if ! use "${u}"; then
+ continue
+ fi
+ einfo "${EBUILD_PHASE} ${u}"
+ if [[ "${u}" == "cxx" ]]; then
+ u="plus"
+ fi
+ if [[ "${u}" != "ruby" ]]; then
+ cd "${u}"
+ case "${EBUILD_PHASE}" in
+ prepare)
+ mv configure.{in,ac}
+ eautoreconf
+ ;;
+ configure)
+ case "${u}" in
+ cgi|java|plus)
+ econf $(use_enable debug)
+ ;;
+ *)
+ econf
+ ;;
+ esac
+ ;;
+ compile)
+ emake
+ ;;
+ test)
+ emake check
+ ;;
+ install)
+ emake DESTDIR="${D}" MYDATADIR=/usr/share/doc/${P}/html install
+ esac
+ cd - >/dev/null
+ else
+ PATCHES= ruby-ng_src_${EBUILD_PHASE}
+ fi
+ done
+}
+
+src_prepare() {
+ default
+ java-pkg-opt-2_src_prepare
+
+ sed -i \
+ -e "/^CFLAGS/s|$| ${CFLAGS}|" \
+ -e "/^OPTIMIZE/s|$| ${CFLAGS}|" \
+ -e "/^CXXFLAGS/s|$| ${CXXFLAGS}|" \
+ -e "/^JAVACFLAGS/s|$| ${JAVACFLAGS}|" \
+ -e 's/make\( \|$\)/$(MAKE)\1/g' \
+ -e '/^debug/,/^$/s/LDFLAGS="[^"]*" //' \
+ Makefile.in {cgi,java,perl,plus,ruby}/Makefile.in
+ find -name "*~" -delete
+
+ mv configure.{in,ac}
+ eautoreconf
+ qdbm_foreach_api
+}
+
+each_ruby_prepare() {
+ sed -i \
+ -e "s|ruby |${RUBY} |" \
+ -e "s|\.\./\.\.|${WORKDIR}/all/${P}|" \
+ {Makefile,configure}.in {curia,depot,villa}/extconf.rb
+
+ mv configure.{in,ac}
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable bzip2 bzip) \
+ $(use_enable debug) \
+ $(use_enable lzo) \
+ $(use_enable zlib) \
+ --enable-iconv \
+ --enable-pthread
+ qdbm_foreach_api
+}
+
+each_ruby_configure() {
+ econf
+}
+
+src_compile() {
+ default
+ qdbm_foreach_api
+}
+
+each_ruby_compile() {
+ emake
+}
+
+src_test() {
+ default
+ qdbm_foreach_api
+}
+
+each_ruby_test() {
+ emake check
+}
+
+src_install() {
+ default
+ qdbm_foreach_api
+
+ rm -rf "${ED}"/usr/share/${PN}
+
+ if use java; then
+ java-pkg_dojar "${ED}"/usr/$(get_libdir)/*.jar
+ rm -f "${ED}"/usr/$(get_libdir)/*.jar
+ fi
+ if use perl; then
+ perl_delete_module_manpages
+ perl_fix_packlist
+ fi
+
+ rm -f "${ED}"/usr/bin/*test
+ rm -f "${ED}"/usr/share/man/man1/*test.1*
+}
+
+each_ruby_install() {
+ local m
+ for m in curia depot villa; do
+ emake -C "${m}" DESTDIR="${D}" install
+ done
+}
+
+all_ruby_install() {
+ dodoc -r rb*.html rbapidoc
+}
diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
new file mode 100644
index 000000000000..020cb70b610b
--- /dev/null
+++ b/dev-db/redis/Manifest
@@ -0,0 +1,34 @@
+AUX configure.ac-2.2 1522 SHA256 349b9f826578a886930bf395b59e6bdf1802c453ffd4cadbfcc3cca49c07313f SHA512 7a67bbd2f5fcfd7e1bfe18b739438342d40484c3f178ef5e2ddb617480715626e7f5a47d58660761489867ae460a58457a85a14bb2af90fe2e2ab3b8bd940b34 WHIRLPOOL a78a56a8e5963fee703b90d4eba112591693ded8ff8b780b049864be4fe712815ef0743d32b120edadca4e5909982d841cfa4ed1483b9eb91bc030ecdf3d7c70
+AUX configure.ac-3.2 1882 SHA256 abc988876ec5e00afec596ff27430403a248805fe5872db4566d2d523b9446b6 SHA512 13d9f16cde8a95c96bcd726056d670d390dea6e2752ac607bc68eefb6214f0ab18b0e27d3283f2b219febd2da82e6489bd434215c9380c3c85c711aa00cb2be5 WHIRLPOOL 8fcdc27c607cc9dc1e5b7277ec8438bd72a5f5f862ef79eb2b30218d2eb1c62e3764a62b286bf180b0ada2414d47db597f589f18005b638e7f61d196bfb12919
+AUX redis-2.8.17-config.patch 1660 SHA256 2fe9ddae4bd1198850eabd1c2c34258cf0e089aa79575124a72e2333b634392a SHA512 4b7f88361ca33fb676d47e6e5e364cd33731031cf83d0cec34d6542e6e832a6b7187b847fde7c65b8c838b309feec7033e0d44f5a5690d6ed0e6694773d4195e WHIRLPOOL 9dde5a6b75a3d91d5ff785c4d4fa96ee0ccbc6c4d853e41073d957b11176265f1ded151f3a62a23228e28f1da604c9c64a5b0ae6b718b2f8d0e84221b048be74
+AUX redis-2.8.3-shared.patch 909 SHA256 fe95148b87d4fe70b655638a3355865fdb5f52d344d07dfd60ae2350d04b7862 SHA512 1070d9d22654a0ee00ecb2536dd2644cc59917650aa56af10689302c3ac962c172bc24a0c493c17f78aa2632bfd3d924ceef221340622d46fd6bf7346e69f49d WHIRLPOOL eeedadd088bf9a2449406d62bfd386b2c8bf484d6b835948d879d6441e35ee20e80c489fc8d81b4c9cb23dd4ebfe1dc07217fed058bd4e5be44f9c6f17a9ac81
+AUX redis-3.0.0-sharedlua.patch 1900 SHA256 6d3e84831d98fe0251a3f4dbcfa941df7eb40eaba6137a18296a4609d9eec471 SHA512 817719139b500073ab038286e2457f5ce5978a88ceb910cccf51015d607b4d9b640d1d5ffeeb55f06781cd04a1f7d604bf1cceddd3cab480753c8c119ecda49d WHIRLPOOL 7265392ff47e29e00fae5161d3492b726b0a930cd340e96b564c6c36389bac27bedac7b867f4887512d9b2a9f5d2ff4a71d595437fd1f2c5ad96c90459b64fc2
+AUX redis-3.2.0-config.patch 1352 SHA256 5a0210b3fa593530eecbbc7503cd61fd946d97bc525eb362848456825dc23862 SHA512 b72b6a6b44e534616183aed23fed0300d02337f10dccad2bd94c803788fcbeaa9a6f3252b5232a149a0a6928c4fda200e84e6d6846f0c0556aad273d9445fccb WHIRLPOOL 91c048aafb79f3856e1ed107518fc22159c9627930a68b3ea2a3ec223e9ae03fa7c51c2b878b993ccf4660e9ab829a61ff10a66bf9647aa7907d506c60081e32
+AUX redis-3.2.0-sharedlua.patch 1923 SHA256 3ede6adb41bfc72241eb928c52643148ecb4f1af13efb0c2658e8eeb9125cc51 SHA512 c0c34644531a206880184102beafd881866209c76672e5d2bbc560e0edb9e469c3c2035ee437326980d97d0220b87f1df6d0a4d5c3e47804bacabdd93c74536e WHIRLPOOL f66482f9ee9da81ab053199559a6682ae729c251052fc5bd6af60cf1c8fb21d207a46c482e51c62d2e25e7cd1eee997752b0274c6394db342a5cbdca8acb71a6
+AUX redis-3.2.3-config.patch 1495 SHA256 48988330395b43a7551e7a285f597a4052b50e17616d5ea7763daa561d184149 SHA512 d71c918ea4952ecb55cc4c87649745ee468587c289d60bd1bee87a2948a6e882d42afe36bb113392b5aaab17d315732cabfc472804204d3a043305a5488a4124 WHIRLPOOL 1360d39ba816e9cc6adefff587f7773743250a518bf3351c0afa6e94aaa394710ef3de0a6deea3fe15d54ae506d5abdb02795d9bcb19b445408ffef3e67951e1
+AUX redis-3.2.3-sharedlua.patch 2535 SHA256 0056ddcb8552da5ce424d0f016fabafbff552734e632377403521f611f667bcf SHA512 4b60271a24a27f69292450575f9316dd009e154980db2b70d7035794bc1f332fe54957558037c75de625d1eaf98cc0f1ec02fcd0ef510c86a3c605c474c1117e WHIRLPOOL 672185942783ccd8d5c635a8d8d2aec839ff68770b42d7acd8cd059aa046b2b5550164564a6b63696cfb4e4bcb31fc04de2b427ca7dcd85f3dfe2806207a457d
+AUX redis-3.2.5-shared.patch 754 SHA256 008cd244b40d6a3bef804a6aa30c4592a7ad8480ea1358112071f079ed284d47 SHA512 dcb0755a0cc24b4dc21c7a20891df5fa0c643beb8f411779548893ac9681c41510ecba79b0ba031d7eeeccbf5b15ae32be04241b197524de4f8f9aafa02ccaab WHIRLPOOL be653deb553aa59102ea6af2c7870b90f0b9d2f989aee677bb6e9e81b89ce818e49484fba83d813cf0902c714da42ec6dd86a8daa20c32e50bdb65c8b8b8eaec
+AUX redis-4.0.1-shared.patch 866 SHA256 d0b6186ddbe0f7912405e06c01987d5fbbcb4ea2759b93cbf4ea44ab6df6ad72 SHA512 f58ae83d3370949187325b1f1f75feb7d85d3112ae65e7cd330d193490c42aa6288f05cd4d2309dbde5d32015a067ec831255a3dab937cd0889970c8eecfb3f1 WHIRLPOOL 3601bf1a7e743819e8191a19639d62dec8e929c15b2010d82b2b109605eb7997f36d9c15ba8e3778640dbced8e23637c0c03ae6385308e4c02c6eac64a4ac556
+AUX redis-4.0.1-sharedlua.patch 2568 SHA256 76a14354c456cdcb50507392d34a6b126706fd9780e38ded66eecd420dfdf8a3 SHA512 c7c08b67c09425876da513bbeb52667fe5917b56a43749a914dac356fa37c091b696765eabca100f2506cf461107abdbf22bce075879a8aa82a0e8d54f696fee WHIRLPOOL b15f8c5c57a6da05577894a7bd8eb7bcca420184d0c80435fbaa884d23f125de6d9b6bcb93ec4c6ab7409d2fc878906dcbc988551105d8958d3aa6aef350a475
+AUX redis.confd 450 SHA256 8c68e29dc88c8ad99b9212a448d313d1406ef02c7638398b2e48ea1ca8aa937b SHA512 c6347cc6e17e9ce93fd081608b19c4977c3e1ffd58d2a417804ca3e647967800ac11859bd05d5437c36310dcd7552c11f35965e4521c5266c3414387d4796a6b WHIRLPOOL 72fb07431293f0e382af98c5a0b7eeca146cab84153befdd808328aa27404cd74d55d524b5442ad10de5989917351299bc7610e0be75d11d2e31fb5353beb45a
+AUX redis.confd-r1 511 SHA256 d995e4b96a4e11e8012edd470288f9b48b87b5a144a357bbaedd411c9bb1329d SHA512 f041e6b1da2c579a7dcf40e411ff47bc4675e5931e04f4353888ed5864b7e0c94d53fc98faee982c65a69d0154ee1f624fbadbbcc3a324aec583eefee6fb7133 WHIRLPOOL e819dddfbfe2730a30e1d85b85a68908abe573788b2ef13fb73d2e0e561c22845e2e564643ee93a76df2f22508280de753fc8f4708b23436d3599dd70d478635
+AUX redis.initd-4 780 SHA256 94257e625ee8c0212dd8afdaa9871796f9944a3ee68641cbde902a1a8a9c6fa9 SHA512 779a35db0f603956c9ab7827f1d0a0b20d5dcab041aafca2055dfd413056de5e572c9996929ef9bf3c54b5f56e4a3a20f2eaaec306b5790252b46ebae30e74b6 WHIRLPOOL 22af0f74c4b1c1120288264d3c1261e38d51b30b0e01e0fd1693e2f4568e1252662ec31e26591142c9e32ffdaa0d0ab89b66bcdf2fbb2f67932735b1a5dc87e5
+AUX redis.initd-5 590 SHA256 b7d0b0fe1467507ba15be1aa009a355279bd8318880d37289f6534bd753bcf30 SHA512 1f9b065c7facece193556d923016a977da811deb1bb19d1607a3f6ac257b78de5d91b829a66d799e54c40e93d00bf3eb43a97476c79b6b46c38c3fd25dd7a702 WHIRLPOOL cc010188604f33fa7994738fe881d0cfed46fabd4afb849c983dcaa93362588c73c6704fba2afec5964abf4e60edeb33b22261186bb7cfeb517b2181adf83709
+AUX redis.service-2 253 SHA256 e65ec7fdac98f30fb72ab73656e4467e74c8900d2664cba64d9baf9e16eaee1b SHA512 b42b73bb54ccc0d16adafb91aabe010092f548ec7979d8a0ed1c4563d9fca378eeb74c0c556f7565a32199ed30ca8a13d6b610d9cda39fd23da1428a410f62cc WHIRLPOOL e2b041b37bf95cbe4ed6684238034497c971352db602a86adbb5ef0626967b4ab20dd9ae412c0cae009a8470e502426b0135e4c676858c11d6e10c97a677baee
+AUX redis.tmpfiles 61 SHA256 68e4c7e3159068400cbc7d07e84b5618f9d829dc7a4f18253783c6256a53031a SHA512 741ff5a4df5b04e7af4e81357812bf5b6cf992bc18b6052074aef134401d0a92703a2e41f52966012c05ea80fac5636435c8d3e6ed55e62a5711526ba67ee738 WHIRLPOOL 2c6f4d9e5382c43e935db16bf120b24cd8de517bc067dcab91b3230a8ddced7ecc5ed37626464d3f1a7880d2d41efdf3cecfd1029a38aaa2edf3d20de74489b4
+DIST redis-3.0.7.tar.gz 1375200 SHA256 b2a791c4ea3bb7268795c45c6321ea5abcc24457178373e6a6e3be6372737f23 SHA512 6c8f4c88d911e1433fd28efff2f6d62763e08be89814ebf4aa4e68e2c8bd605eba24ca3410548b2f480ae094437ce96c0bafa7a5762b3b405d5d850886297ba3 WHIRLPOOL 53c2c967b999bbcb5b45117bbad74b46457158ad94e8c43566311dd3d58c63c2d0cc2dac5dc9e8806821c2532ee4beded17e039da4ddeae958e5a0092429ee3a
+DIST redis-3.2.5.tar.gz 1544040 SHA256 8509ceb1efd849d6b2346a72a8e926b5a4f6ed3cc7c3cd8d9f36b2e9ba085315 SHA512 4ecf6277c8fdf4411223b9f5a5c8308829da9bd756b45de5217d469e9def8faad8c05b6348c06aef99eca9245d45abfd52df056c3c819723da66a2ca20c381dd WHIRLPOOL db1eecac5e407734002d39cc16f708fcb1f506829df4dabda53bffc7012746a23ea2342cded4d90f39db72ba61eda349b80b4a3e4f1eba06dbaa6cad8c50264e
+DIST redis-3.2.8.tar.gz 1547237 SHA256 61b373c23d18e6cc752a69d5ab7f676c6216dc2853e46750a8c4ed791d68482c SHA512 7334faf73af3644f7f9dcaddd322955d5df1e88a1640b509ae623f322615a20f6dc143eb57dd89ff3a278557df309ac4215c3fb458235682ce28e16c817068ba WHIRLPOOL 50ffecd1891051a3e28028065bfaf090b2eec42a757cdf61c6d22b051c8ba4fc78809b3198182d2333bedb4715d9a8d70bf04f605030abe6e33cc6b9b7161cf7
+DIST redis-4.0.1.tar.gz 1711660 SHA256 2049cd6ae9167f258705081a6ef23bb80b7eff9ff3d0d7481e89510f27457591 SHA512 62dec537aebd12340b9642f5f8b07fd98757c9e648dcd539a0411f207db3495923c5a6a9941036c56b2d574ee38b46d08558668111e322345ef549f93fada26f WHIRLPOOL 90b6a7a81e6d5302a28c49a8a1ea479f80f7924eb2f69d0b17d48cf15c9ba769a8ef425ae9bec44d3cbd81816b43fe7997adeb73caa6d2b64f7657e60cb2fb82
+DIST redis-4.0.2.tar.gz 1713990 SHA256 b1a0915dbc91b979d06df1977fe594c3fa9b189f1f3d38743a2948c9f7634813 SHA512 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4 WHIRLPOOL 24834b1fbedaea75f245c9f3f7dc29444b34bccdac08b060dee5ff78b23ee60cb029d8a255f69df7a7a3a54c7440bb37390361a2d995eb0bc7534273570adfc3
+EBUILD redis-3.0.7-r1.ebuild 3312 SHA256 178857c68ff546fe0e5a5bd968afc0979e17e60ab41ed3539655d836c1f036d6 SHA512 de42869cd28e6b9f7ce63ef0baaa64acc0b5465d2bb2a0c23013a42c0a00059a18620ab428eae88b33f4d6a3b37b2e6cc0dc71135af807dbd9d524908d1d80fb WHIRLPOOL 26d3325a56be5d02fa6571d3bfca3a399c765f7ba2e7d6577b13f0117ea5d4b97c7449d1dd2c3eb942f8711bf5c22ec38dd2db42af455b3e2c1d93be40b54e37
+EBUILD redis-3.0.7.ebuild 3312 SHA256 178857c68ff546fe0e5a5bd968afc0979e17e60ab41ed3539655d836c1f036d6 SHA512 de42869cd28e6b9f7ce63ef0baaa64acc0b5465d2bb2a0c23013a42c0a00059a18620ab428eae88b33f4d6a3b37b2e6cc0dc71135af807dbd9d524908d1d80fb WHIRLPOOL 26d3325a56be5d02fa6571d3bfca3a399c765f7ba2e7d6577b13f0117ea5d4b97c7449d1dd2c3eb942f8711bf5c22ec38dd2db42af455b3e2c1d93be40b54e37
+EBUILD redis-3.2.5.ebuild 3578 SHA256 1c935a9f011cf9ceba6a75fb2b0d204817b4aa70cb7bd7e003aa94f98473e627 SHA512 72d8563a1eee0e62d34a3c04583c210a95c0fdd306512f63714324ac6e1302f5a06debb56bae083f9102eef9cade1674f6d5dd746ca7ab796e70592aef659021 WHIRLPOOL ef8f61ee53edbd01e55119105a961bddd4188b92dc55ae54a1ff9a4fe02f0b9139c06abf54864180529a569442785e84592f952e8df0d694f28606835f6d9e07
+EBUILD redis-3.2.8-r2.ebuild 3579 SHA256 7e4ea5f0a2396bd4c0a5e0da06c42422ff58b3fc8d165f00f52012f38749045d SHA512 3acf577e2509cf29ae5274117ec5c512fe390167d88c38b6fd375a5d145e4b94704990b23e3a18d6e8ab6c91e5d5bebb5d6c9330a9975b7ef9aa2d14c0914282 WHIRLPOOL 227ca8851ce549c4947c9a258071b44a1f4c5c3a779946a1d998fbe468741e9be73a275ce01337ab9a02840e5f7452268abd92d396fe3179746a8f767fda7382
+EBUILD redis-3.2.8-r4.ebuild 3891 SHA256 3a9ceddc4b209bf1952223300badbf5ab81d72533485d4248422594d828f5d05 SHA512 00d62cc9e030912c942030466b397accc11100e64175df3031b9e9e67c11d4ac62b0fea66fea903264c3e0eedd883c4c188d563e24a74e9ec1af3cc54ade0bda WHIRLPOOL 8a887d676f07f8116f00c05ef220e22be0b81a17abce12e0e89f3cf112e226cb083c347ee41a5d4b6a8b3eec48b6f5b743d1eba375cfa091157eac876592a915
+EBUILD redis-4.0.1-r1.ebuild 3722 SHA256 4305a38f60f529600e36ced799a5c780c32a152e5d4e2efcdbf200bb92b8ab0a SHA512 d928b9714a9c028fbe14286c975a5ba385384c4ff32311e060252ccf9802e2f58d945d261a9fd5cd512d7142cb82fdb41a44955c046c253ee399e09578b42a0d WHIRLPOOL cf4a5bd6128143c87808282e24a439d527c6f3efde4308231d8fafd393a41b3869fdebf61c0791ad350ff2665651b4816e46377f8e62820da819d51647cba068
+EBUILD redis-4.0.1.ebuild 3507 SHA256 8e8281d3c068e21e6e925ff905603dc645262577eaa898a4c7032ab479ad7dfb SHA512 e0a258e5e2333d9c88d5ebba37f52cb772bb17d77b719edc0ce443a3a2ac09cd064766fcf7541503fe656ca2f77d890ae911f518b2552e2673f650cc8bd4d13d WHIRLPOOL 62f2267dceddce78da7b81aa49d40087afb39981743ec02a3337c11202e880fbc9126b49a88dc38cfec8d6bc4391565b1573fcbcab420019cb674271e8b40e4b
+EBUILD redis-4.0.2.ebuild 3814 SHA256 949258b27da78e4663f65e1eea15882543cb8978c0dd90e83334026c17cc461e SHA512 3e053a76b16dd7a73cadd890bd5d3afc9a4652f4b5503d0a0c9f135e0c4711e085533cdf3422cdca571ea49ee7769b62145421423a0d619e3941620ab173bd52 WHIRLPOOL 916a0944ff241821cebf34b748c6ef30d80a6cd90fab53e0ba0eb2a15ada43a1a00035b145cab77bbb88727ba674f7edd40c8b4d2d0bc723ddfc4bf58d98caba
+MISC ChangeLog 9085 SHA256 ed9cb241c3bfe71d3211e01c2a198c4d8e42fbfd42633487141ec65e7c3bd7e4 SHA512 ebcb05824a18732c1daf72785a6ef59305378ea215f3910487fec354771f7a9137d27f0c4bf50a935829f2bd3bce5dbe2bb1a7faf478fc1c8dc01398e435f8b2 WHIRLPOOL e9bce2718149978854fc4adbc99db7daadd1687bf67e68b075ccea02659c71dad7c620a39740d1ac70e0f6a855cc5638b4a3237b85b4719a0ea8100d7524d959
+MISC ChangeLog-2015 14790 SHA256 2b26170b052d7ee86954593cf4c8ac44c071e702b546cfb10b5821371efa5bea SHA512 80ece5f6c84ad894aad3290665c6d2099f7c57eee8682fe85d2ab59969099d5f7e229a81968c02f63601b7e40123073394ffeccb58edfa8c374b6148213956f5 WHIRLPOOL c8828bedd95dc6814790355ad42ed2d378831f821c5185a1db2a45c89ebb770a5fbc3453b4893e7d9831ac98a5384fcaecc920cbda97ba5d7c4a98a4121f33b3
+MISC metadata.xml 632 SHA256 623fd6b8e252684955a557e3bd26a6fa237dce08702e8373a9eb65207a609a14 SHA512 a032eb7204137f8c5e7b75f8b214b0b6fd7f2a119b261a3da2e0cf8979fda5a5f25643870515a8e8d821ff63df3d17808a6e3189cc16a0f87c88f479571e8ef5 WHIRLPOOL 652c5fcb32bf4a79400534743cb5b4803d813daf9ec363ca38c5c1c2c7f3292b16a50e99845274486fbe5c8dda2abe1ce98da28350f18c06a5d508146a7bd172
diff --git a/dev-db/redis/files/configure.ac-2.2 b/dev-db/redis/files/configure.ac-2.2
new file mode 100644
index 000000000000..3ff6650407ca
--- /dev/null
+++ b/dev-db/redis/files/configure.ac-2.2
@@ -0,0 +1,58 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.63)
+AC_INIT(redis, 2.0.0, antirez@gmail.com)
+AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
+if test x"$CFLAGS" = x""; then
+ AM_CFLAGS="$AM_CFLAGS -O2"
+else
+ AM_CFLAGS="$AM_CFLAGS $CFLAGS"
+fi
+
+# options
+AC_MSG_CHECKING([whether to build with debug information])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [enable debug data generation (def=no)])],
+ [debugit="$enableval"],
+ [debugit=no])
+AC_MSG_RESULT([$debugit])
+
+if test x"$debugit" = x"yes"; then
+ AC_DEFINE([DEBUG],[],[Debug Mode])
+ AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
+else
+ AC_DEFINE([NDEBUG],[],[No-debug Mode])
+fi
+AC_SUBST([AM_CFLAGS])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_STRCOLL
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/dev-db/redis/files/configure.ac-3.2 b/dev-db/redis/files/configure.ac-3.2
new file mode 100644
index 000000000000..3e2cf9267266
--- /dev/null
+++ b/dev-db/redis/files/configure.ac-3.2
@@ -0,0 +1,66 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.63)
+AC_INIT(redis, 3.2.3, antirez@gmail.com)
+AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
+if test x"$CFLAGS" = x""; then
+ AM_CFLAGS="$AM_CFLAGS -O2"
+else
+ AM_CFLAGS="$AM_CFLAGS $CFLAGS"
+fi
+
+# options
+AC_MSG_CHECKING([whether to build with debug information])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [enable debug data generation (def=no)])],
+ [debugit="$enableval"],
+ [debugit=no])
+AC_MSG_RESULT([$debugit])
+
+if test x"$debugit" = x"yes"; then
+ AC_DEFINE([DEBUG],[],[Debug Mode])
+ AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
+else
+ AC_DEFINE([NDEBUG],[],[No-debug Mode])
+fi
+AC_SUBST([AM_CFLAGS])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_STRCOLL
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])
+
+# Check for lua-5.1 or luajit
+AC_ARG_WITH([luajit],
+ AS_HELP_STRING([--with-luajit], [Use luajit instead of lua]))
+
+AS_IF([test "x$with_luajit" = "xyes"],
+ [PKG_CHECK_MODULES([LUA], [luajit >= 2], [], [AC_MSG_ERROR([luajit requested but not found])])],
+ [PKG_CHECK_MODULES([LUA], [lua5.1], [], [AC_MSG_ERROR([lua-5.1 required but not found])])])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/dev-db/redis/files/redis-2.8.17-config.patch b/dev-db/redis/files/redis-2.8.17-config.patch
new file mode 100644
index 000000000000..c9f6b2af172b
--- /dev/null
+++ b/dev-db/redis/files/redis-2.8.17-config.patch
@@ -0,0 +1,46 @@
+--- a/redis.conf 2014-12-02 16:22:38.722433643 +0100
++++ b/redis.conf 2014-12-02 16:22:16.252249350 +0100
+@@ -38,7 +38,7 @@
+
+ # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
+ # default. You can specify a custom pid file location here.
+-pidfile /var/run/redis.pid
++pidfile /run/redis/redis.pid
+
+ # Accept connections on the specified port, default is 6379.
+ # If port 0 is specified Redis will not listen on a TCP socket.
+@@ -61,7 +61,7 @@
+ # Examples:
+ #
+ # bind 192.168.1.100 10.0.0.1
+-# bind 127.0.0.1
++bind 127.0.0.1
+
+ # Specify the path for the Unix socket that will be used to listen for
+ # incoming connections. There is no default, so Redis will not listen
+@@ -100,7 +100,7 @@
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -184,7 +184,7 @@
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -403,6 +403,7 @@
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+ # maxmemory <bytes>
++maxmemory 67108864
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-2.8.3-shared.patch b/dev-db/redis/files/redis-2.8.3-shared.patch
new file mode 100644
index 000000000000..d32484f0cd18
--- /dev/null
+++ b/dev-db/redis/files/redis-2.8.3-shared.patch
@@ -0,0 +1,36 @@
+commit 388a76f24c96767c831ee7682234fd9f2bc5b9ac
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Mon Nov 25 09:17:14 2013 +1100
+
+ Use shared jemalloc
+
+diff --git src/Makefile src/Makefile
+index c37549d..77e6255 100644
+--- src/Makefile
++++ src/Makefile
+@@ -26,12 +26,7 @@ PREFIX?=/usr/local
+ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+-# Default allocator
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-else
+- MALLOC=libc
+-endif
++MALLOC?=jemalloc
+
+ # Backwards compatibility for selecting an allocator
+ ifeq ($(USE_TCMALLOC),yes)
+@@ -79,9 +74,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis-3.0.0-sharedlua.patch b/dev-db/redis/files/redis-3.0.0-sharedlua.patch
new file mode 100644
index 000000000000..ba983efafc7c
--- /dev/null
+++ b/dev-db/redis/files/redis-3.0.0-sharedlua.patch
@@ -0,0 +1,44 @@
+commit fd0fc43f6e0ea45bce0e1a68c1f736e481fc4429
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Thu Apr 2 14:33:51 2015 +1100
+
+ Use shared LUA
+
+diff --git src/Makefile src/Makefile
+index a88f1d2..f71e7b5 100644
+--- src/Makefile
++++ src/Makefile
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua
++DEPENDENCY_TARGETS=hiredis linenoise
+
+ # Default settings
+ STD=-std=c99 -pedantic
+@@ -47,6 +47,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=$(shell pkg-config --libs lua)
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -108,6 +109,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o sds.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+ REDIS_BENCHMARK_NAME=redis-benchmark
+@@ -162,7 +164,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.0-config.patch b/dev-db/redis/files/redis-3.2.0-config.patch
new file mode 100644
index 000000000000..8d93a0e7b62a
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.0-config.patch
@@ -0,0 +1,37 @@
+--- a/redis.conf 2016-05-06 09:11:36.000000000 +0200
++++ b/redis.conf 2016-06-14 09:20:05.980855432 +0200
+@@ -146,7 +146,7 @@
+ #
+ # Creating a pid file is best effort: if Redis is not able to create it
+ # nothing bad happens, the server will start and run normally.
+-pidfile /var/run/redis.pid
++pidfile /run/redis/redis.pid
+
+ # Specify the server verbosity level.
+ # This can be one of:
+@@ -159,7 +159,7 @@
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -243,7 +243,7 @@
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -505,6 +505,7 @@
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+ # maxmemory <bytes>
++maxmemory 67108864
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-3.2.0-sharedlua.patch b/dev-db/redis/files/redis-3.2.0-sharedlua.patch
new file mode 100644
index 000000000000..248e990cf59c
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.0-sharedlua.patch
@@ -0,0 +1,36 @@
+--- a/src/Makefile 2016-06-14 09:21:51.613721601 +0200
++++ b/src/Makefile 2016-06-14 09:25:21.262442026 +0200
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua geohash-int
++DEPENDENCY_TARGETS=hiredis linenoise geohash-int
+
+ # Default settings
+ STD=-std=c99 -pedantic -DREDIS_STATIC=''
+@@ -51,6 +51,7 @@
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=$(shell pkg-config --libs lua)
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -112,6 +113,7 @@
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_GEOHASH_OBJ=../deps/geohash-int/geohash.o ../deps/geohash-int/geohash_helper.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+@@ -166,7 +168,7 @@
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.3-config.patch b/dev-db/redis/files/redis-3.2.3-config.patch
new file mode 100644
index 000000000000..bde0ef7cbaf1
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.3-config.patch
@@ -0,0 +1,40 @@
+diff --git a/redis.conf b/redis.conf
+index 22e00bc..b09de57 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -147,7 +147,7 @@ supervised no
+ #
+ # Creating a pid file is best effort: if Redis is not able to create it
+ # nothing bad happens, the server will start and run normally.
+-pidfile /var/run/redis_6379.pid
++pidfile /run/redis/redis.pid
+
+ # Specify the server verbosity level.
+ # This can be one of:
+@@ -160,7 +160,7 @@ loglevel notice
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -244,7 +244,7 @@ dbfilename dump.rdb
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -534,7 +534,7 @@ slave-priority 100
+ # limit for maxmemory so that there is some free RAM on the system for slave
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+-# maxmemory <bytes>
++maxmemory 64MB
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-3.2.3-sharedlua.patch b/dev-db/redis/files/redis-3.2.3-sharedlua.patch
new file mode 100644
index 000000000000..52de9048463f
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.3-sharedlua.patch
@@ -0,0 +1,60 @@
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7..fa50c41 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -46,7 +46,7 @@
+ #include "strbuf.h"
+ #include "fpconv.h"
+
+-#include "../../../src/solarisfixes.h"
++#include "solarisfixes.h"
+
+ #ifndef CJSON_MODNAME
+ #define CJSON_MODNAME "cjson"
+diff --git a/src/Makefile b/src/Makefile
+index 648127a..1f96d98 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua geohash-int
++DEPENDENCY_TARGETS=hiredis linenoise geohash-int
+
+ # Default settings
+ STD=-std=c99 -pedantic -DREDIS_STATIC=''
+@@ -56,6 +56,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=@LUA_LIBS@
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -80,7 +81,7 @@ endif
+ endif
+ endif
+ # Include paths to dependencies
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@
+
+ ifeq ($(MALLOC),tcmalloc)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+@@ -118,6 +119,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_GEOHASH_OBJ=../deps/geohash-int/geohash.o ../deps/geohash-int/geohash_helper.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+@@ -172,7 +174,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.5-shared.patch b/dev-db/redis/files/redis-3.2.5-shared.patch
new file mode 100644
index 000000000000..7ebff12b5196
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.5-shared.patch
@@ -0,0 +1,30 @@
+diff --git a/src/Makefile b/src/Makefile
+index fdbe36a..df224ae 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -26,12 +26,7 @@ PREFIX?=/usr/local
+ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+-# Default allocator
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-else
+- MALLOC=libc
+-endif
++MALLOC?=jemalloc
+
+ # Backwards compatibility for selecting an allocator
+ ifeq ($(USE_TCMALLOC),yes)
+@@ -103,9 +98,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis-4.0.1-shared.patch b/dev-db/redis/files/redis-4.0.1-shared.patch
new file mode 100644
index 000000000000..945d114ae2fb
--- /dev/null
+++ b/dev-db/redis/files/redis-4.0.1-shared.patch
@@ -0,0 +1,32 @@
+diff --git a/src/Makefile b/src/Makefile
+index 86e0b3fe..c7db0ee9 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -29,14 +29,7 @@ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+ # Default allocator defaults to Jemalloc if it's not an ARM
+-MALLOC=libc
+-ifneq ($(uname_M),armv6l)
+-ifneq ($(uname_M),armv7l)
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-endif
+-endif
+-endif
++MALLOC?=jemalloc
+
+ # To get ARM stack traces if Redis crashes we need a special C flag.
+ ifneq (,$(findstring armv,$(uname_M)))
+@@ -120,9 +113,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis-4.0.1-sharedlua.patch b/dev-db/redis/files/redis-4.0.1-sharedlua.patch
new file mode 100644
index 000000000000..d2b572250e86
--- /dev/null
+++ b/dev-db/redis/files/redis-4.0.1-sharedlua.patch
@@ -0,0 +1,60 @@
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7b..fa50c410 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -46,7 +46,7 @@
+ #include "strbuf.h"
+ #include "fpconv.h"
+
+-#include "../../../src/solarisfixes.h"
++#include "solarisfixes.h"
+
+ #ifndef CJSON_MODNAME
+ #define CJSON_MODNAME "cjson"
+diff --git a/src/Makefile b/src/Makefile
+index 86e0b3fe..09630321 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua
++DEPENDENCY_TARGETS=hiredis linenoise
+ NODEPS:=clean distclean
+
+ # Default settings
+@@ -66,6 +66,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=@LUA_LIBS@
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -107,7 +108,7 @@ endif
+ endif
+ endif
+ # Include paths to dependencies
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@
+
+ ifeq ($(MALLOC),tcmalloc)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+@@ -145,6 +146,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+ REDIS_BENCHMARK_NAME=redis-benchmark
+@@ -196,7 +198,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis.confd b/dev-db/redis/files/redis.confd
new file mode 100644
index 000000000000..07585fa7a116
--- /dev/null
+++ b/dev-db/redis/files/redis.confd
@@ -0,0 +1,20 @@
+# Redis user.
+REDIS_USER="redis"
+
+# Redis group.
+REDIS_GROUP="redis"
+
+# Redis configuration file.
+REDIS_CONF="/etc/redis.conf"
+
+# Redis dump directory.
+REDIS_DIR="/var/lib/redis"
+
+# Redis pid file.
+# (Be sure to change the main redis configuration file as well if you change
+# this from the default.)
+REDIS_PID="/var/run/redis/redis.pid"
+
+# Redis options.
+# (Redis expects the first argument to be the configuration file.)
+REDIS_OPTS="${REDIS_CONF}"
diff --git a/dev-db/redis/files/redis.confd-r1 b/dev-db/redis/files/redis.confd-r1
new file mode 100644
index 000000000000..1f4ff23f211b
--- /dev/null
+++ b/dev-db/redis/files/redis.confd-r1
@@ -0,0 +1,20 @@
+# Redis user.
+REDIS_USER="redis"
+
+# Redis group.
+REDIS_GROUP="redis"
+
+# Redis configuration file.
+REDIS_CONF="/etc/redis.conf"
+
+# Redis dump directory.
+REDIS_DIR="/var/lib/redis"
+
+# Redis options.
+# (Redis expects the first argument to be the configuration file.)
+REDIS_OPTS="${REDIS_CONF}"
+
+# Specify the network service that corresponds to the "bind" setting
+# in your redis.conf. For example, if you bind to 127.0.0.1, this should
+# be set to "net.lo" which provides the loopback interface.
+rc_need="net.lo"
diff --git a/dev-db/redis/files/redis.initd-4 b/dev-db/redis/files/redis.initd-4
new file mode 100644
index 000000000000..5c12fdc7c79d
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-4
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+
+REDIS_DIR=${REDIS_DIR:-/var/lib/redis}
+REDIS_CONF=${REDIS_CONF:-/etc/redis.conf}
+REDIS_OPTS=${REDIS_OPTS:-"${REDIS_CONF}"}
+REDIS_USER=${REDIS_USER:-redis}
+REDIS_GROUP=${REDIS_GROUP:-redis}
+REDIS_TIMEOUT=${REDIS_TIMEOUT:-30}
+
+command=/usr/sbin/redis-server
+pidfile=${REDIS_PID:-/run/redis/redis.pid}
+start_stop_daemon_args="--background --pidfile ${pidfile} --chdir \"${REDIS_DIR}\" --user ${REDIS_USER} --group ${REDIS_GROUP}"
+command_args="${REDIS_OPTS}"
+
+depend() {
+ use net localmount logger
+ after keepalived
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o ${REDIS_USER}:${REDIS_GROUP} $(dirname ${REDIS_PID})
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --exec ${command} \
+ --retry ${REDIS_TIMEOUT} \
+ --pidfile ${pidfile}
+ eend
+}
diff --git a/dev-db/redis/files/redis.initd-5 b/dev-db/redis/files/redis.initd-5
new file mode 100644
index 000000000000..a567b1e210d8
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-5
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${REDIS_DIR:=/var/lib/redis}
+: ${REDIS_CONF:=/etc/redis.conf}
+: ${REDIS_OPTS:="${REDIS_CONF}"}
+: ${REDIS_USER:=redis}
+: ${REDIS_GROUP:=redis}
+: ${REDIS_TIMEOUT:=30}
+
+command="/usr/sbin/redis-server"
+command_args="${REDIS_OPTS}"
+command_background="true"
+command_user="${REDIS_USER}:${REDIS_GROUP}"
+pidfile="/run/${RC_SVCNAME}.pid"
+retry="${REDIS_TIMEOUT}"
+start_stop_daemon_args="--chdir \"${REDIS_DIR}\""
+
+depend() {
+ use localmount logger
+ after keepalived
+}
diff --git a/dev-db/redis/files/redis.service-2 b/dev-db/redis/files/redis.service-2
new file mode 100644
index 000000000000..c36d7960ef71
--- /dev/null
+++ b/dev-db/redis/files/redis.service-2
@@ -0,0 +1,14 @@
+[Unit]
+Description=A persistent key-value database
+After=syslog.target network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/redis/redis.pid
+ExecStart=/usr/sbin/redis-server /etc/redis.conf
+User=redis
+Group=redis
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-db/redis/files/redis.tmpfiles b/dev-db/redis/files/redis.tmpfiles
new file mode 100644
index 000000000000..657d8a551d4b
--- /dev/null
+++ b/dev-db/redis/files/redis.tmpfiles
@@ -0,0 +1,2 @@
+# redis runtime directory
+d /var/run/redis 0755 redis root -
diff --git a/dev-db/redis/metadata.xml b/dev-db/redis/metadata.xml
new file mode 100644
index 000000000000..872bd8ba741e
--- /dev/null
+++ b/dev-db/redis/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ultrabug@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="jemalloc">
+ Use <pkg>dev-libs/jemalloc</pkg> for allocations.
+ </flag>
+ <flag name="tcmalloc">
+ Use tcmalloc from <pkg>dev-util/google-perftools</pkg> for allocations.
+ </flag>
+ <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of <pkg>dev-lang/lua</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/redis/redis-3.0.7-r1.ebuild b/dev-db/redis/redis-3.0.7-r1.ebuild
new file mode 100644
index 000000000000..e46c5c221e5a
--- /dev/null
+++ b/dev-db/redis/redis-3.0.7-r1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc test"
+SLOT="0"
+
+RDEPEND=">=dev-lang/lua-5.1:*
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.3-shared.patch
+ epatch "${FILESDIR}"/${PN}-2.8.17-config.patch
+ epatch "${FILESDIR}"/${PN}-3.0.0-sharedlua.patch
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-2.2 configure.ac
+ sed -i -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoconf
+}
+
+src_configure() {
+ econf
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-dump
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.0.7.ebuild b/dev-db/redis/redis-3.0.7.ebuild
new file mode 100644
index 000000000000..e46c5c221e5a
--- /dev/null
+++ b/dev-db/redis/redis-3.0.7.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc test"
+SLOT="0"
+
+RDEPEND=">=dev-lang/lua-5.1:*
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.3-shared.patch
+ epatch "${FILESDIR}"/${PN}-2.8.17-config.patch
+ epatch "${FILESDIR}"/${PN}-3.0.0-sharedlua.patch
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-2.2 configure.ac
+ sed -i -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoconf
+}
+
+src_configure() {
+ econf
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-dump
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.2.5.ebuild b/dev-db/redis/redis-3.2.5.ebuild
new file mode 100644
index 000000000000..125fe7e3d229
--- /dev/null
+++ b/dev-db/redis/redis-3.2.5.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 ~arm arm64 hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.2.8-r2.ebuild b/dev-db/redis/redis-3.2.8-r2.ebuild
new file mode 100644
index 000000000000..9ad05c87cf7c
--- /dev/null
+++ b/dev-db/redis/redis-3.2.8-r2.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm ~arm64 ~hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.2.8-r4.ebuild b/dev-db/redis/redis-3.2.8-r4.ebuild
new file mode 100644
index 000000000000..cb1541102b7c
--- /dev/null
+++ b/dev-db/redis/redis-3.2.8-r4.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+# Redis does NOT build with Lua 5.2 or newer at this time.
+# This should link correctly with both unslotted & slotted Lua, without
+# changes.
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+ # Use the correct pkgconfig name for Lua
+ has_version 'dev-lang/lua:5.1' \
+ && LUAPKGCONFIG=lua5.1 \
+ || LUAPKGCONFIG=lua
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd-r1" redis
+ newinitd "${FILESDIR}/redis.initd-5" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-4.0.1-r1.ebuild b/dev-db/redis/redis-4.0.1-r1.ebuild
new file mode 100644
index 000000000000..c93a6b4061fc
--- /dev/null
+++ b/dev-db/redis/redis-4.0.1-r1.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+# Does NOT build with Lua 5.2 or newer at this time.
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-4.0.1-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+ # Use the correct pkgconfig name for Lua
+ has_version 'dev-lang/lua:5.1' \
+ && LUAPKGCONFIG=lua5.1 \
+ || LUAPKGCONFIG=lua
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-4.0.1.ebuild b/dev-db/redis/redis-4.0.1.ebuild
new file mode 100644
index 000000000000..aece2a0822b3
--- /dev/null
+++ b/dev-db/redis/redis-4.0.1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-4.0.1-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-4.0.2.ebuild b/dev-db/redis/redis-4.0.2.ebuild
new file mode 100644
index 000000000000..1449a3567826
--- /dev/null
+++ b/dev-db/redis/redis-4.0.2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+# Redis does NOT build with Lua 5.2 or newer at this time.
+# This should link correctly with both unslotted & slotted Lua, without
+# changes.
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-4.0.1-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+ # Use the correct pkgconfig name for Lua
+ has_version 'dev-lang/lua:5.1' \
+ && LUAPKGCONFIG=lua5.1 \
+ || LUAPKGCONFIG=lua
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd-r1" redis
+ newinitd "${FILESDIR}/redis.initd-5" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/repmgr/Manifest b/dev-db/repmgr/Manifest
new file mode 100644
index 000000000000..5365bfe400fd
--- /dev/null
+++ b/dev-db/repmgr/Manifest
@@ -0,0 +1,7 @@
+DIST repmgr-3.0.1.tar.gz 91724 SHA256 27656442aacc1c97a006039a50cf6da84b4d38fc11542a555df24d93ae6b02bc SHA512 5655745df18132ee53ff36f80b3a2bb8caa6cedd8091350464cf343386baa31c47d46b25c171dda0fd1f4c3402babea9864f4557a10659111449a2eb2e1fa2b9 WHIRLPOOL 48383f717c1ab4f6b07d724af3b52bf7d257855300b289a887d1cb88c66ef7ae434a609e233168ad4cd7310cdb7a47e2101baf5d0ea52436d2576f02eec55a83
+DIST repmgr-3.3.2.tar.gz 162107 SHA256 3ca93e58aee941967c4088cd8f4535a0096949234cbdc8629e2447e7dbe2e610 SHA512 98fba8fc0d9074e496c66762dbec45734fe279f39c9c51adb3e66dca929ac37f66a609789c8c658545856fd81f5afc5b35f6b5e389e52bce8c04ce8c52acd8dd WHIRLPOOL f82b65f74a2e4ce2e767b71984553ee4727e7bc0608ef2840ee488cc649292f7bd26dd59f43ba4c3ca50a902e0f85c431ab4d75b2b1315d79d266f4c6ebfab8c
+EBUILD repmgr-3.0.1.ebuild 1093 SHA256 2de6df19869f44cb7158db6a8dde8fc4cd4490d9057ba654d19d0e5c479d5fd8 SHA512 20196fa1f8819d40fb9eb2d72b76e4fe152ed1ac4ee4c35fd6b052af19ad8f3704888ffcae008869635661880a9e81076b012a2ecbd271e4553f74db1904930f WHIRLPOOL 25ada57023dcddaba5cb505531ab85faf977b9b8e6e3ffca50e2060b214438eca416683de37eff5492e0fea432198dbdeb0c0857d6064b67ce7b797ef372321e
+EBUILD repmgr-3.3.2.ebuild 1093 SHA256 cdc491a3576b370945cc24bcaabab36927ff2e4b2c761c1d3dbb433a5450ffe4 SHA512 6412c5cc1a9bde4fc6cac191146c0a529a67016690353b733547270198515b13ac56f9ecc081fb58eebe93b4afd03095001a9b4986e5f2ce55e3175c6893955b WHIRLPOOL 0a6cdcea55f39faa4988d919a63bc3ea0fdb4313ff64be6dd38b8682b4ef6f4009140a014878138422b5aecfe76362ca295bede14fcae663afc7f91ae9b023f1
+MISC ChangeLog 2278 SHA256 20b75b84f79f25faa31403a34094ee4cfc1dd5ce92e1efb6924ec60fed448679 SHA512 0cdff6c6cb07bb1d60d44a41ee3d06edb26ffcdb5a61419380ce7b61ffc527c7eb5d485d3c40e24587f3d217ff7cb45eb25518975d278934cd4cd0326a4339dd WHIRLPOOL 7b6c48aaaaaaab1a22416772d0b14ce7440a328f7fc2b94f1c808b27f2841470319e132ce917ed3875e3b4395a3e6227f5bcd9651c5249672592c03f63d8acfe
+MISC ChangeLog-2015 844 SHA256 32b7bff092f6fee6ff70b256ecabe820db56f5990776e86ba38d970c9974d305 SHA512 811e92e877fbe3ed486577475b0e2d68254a951770a4faabf2e0d41cfa92c9f541366447d8a07eb266a73181e9cab8f7bc9872595c266943c3c1f8d29a86c8cf WHIRLPOOL 448c97e108f53d89c5efe8c2194960e0c0fd31fcde00da75204147e095b9813aea0c47892e1823f702772bd256c8365655e11dc01b72cbbd9da6b3b097080287
+MISC metadata.xml 308 SHA256 475c243a282c51fca857fef7c5dd3fa0c36e18bed4399c1f7d30efdaa9f49316 SHA512 ac1061c181c1cd49f0c7e4e3769d46969132c10ff6d44c35bdb8d504b6e25acc80c5f19d43fdb3cd6226baad6703412e6b42604645e8b286270a8aac623eec5a WHIRLPOOL 069193c583cdb91ddf30ddf9670bd3519866c4829755e3e57948914db4049acaedb925749118ec2efc0dc15b8e2960251e85c7692c5ac813d18740aa872a51f6
diff --git a/dev-db/repmgr/metadata.xml b/dev-db/repmgr/metadata.xml
new file mode 100644
index 000000000000..06d2f4bd93e4
--- /dev/null
+++ b/dev-db/repmgr/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>betelgeuse@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/repmgr/repmgr-3.0.1.ebuild b/dev-db/repmgr/repmgr-3.0.1.ebuild
new file mode 100644
index 000000000000..7a82e8739f28
--- /dev/null
+++ b/dev-db/repmgr/repmgr-3.0.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib
+DESCRIPTION="PostgreSQL Replication Manager"
+HOMEPAGE="http://www.repmgr.org/"
+SRC_URI="http://www.repmgr.org/download/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+
+DEPEND=">=dev-db/postgresql-9.3[server,static-libs]"
+RDEPEND="${DEPEND}
+ net-misc/rsync"
+
+src_compile() {
+ emake USE_PGXS=1
+}
+
+src_install() {
+ emake DESTDIR="${D}" USE_PGXS=1 install
+ export PGSLOT="$(postgresql-config show)"
+ einfo "PGSLOT: ${PGSLOT}"
+ PGBASEDIR=/usr/$(get_libdir)/postgresql-${PGSLOT}
+ PGBINDIR=${PGBASEDIR}/bin/
+ PGCONTRIB=/usr/share/postgresql-${PGSLOT}/contrib/
+ dodir $PGCONTRIB $PGBINDIR
+ insinto $PGCONTRIB
+ doins sql/repmgr2_repmgr3.sql
+ dosym $PGBINDIR/repmgr /usr/bin/repmgr${PGSLOT//.}
+ dosym $PGBINDIR/repmgrd /usr/bin/repmgrd${PGSLOT//.}
+ dodoc CREDITS HISTORY COPYRIGHT TODO *.md *.rst
+ insinto /etc
+ newins repmgr.conf.sample repmgr.conf
+ fowners postgres:postgres /etc/repmgr.conf
+ ewarn "Remember to modify /etc/repmgr.conf"
+}
diff --git a/dev-db/repmgr/repmgr-3.3.2.ebuild b/dev-db/repmgr/repmgr-3.3.2.ebuild
new file mode 100644
index 000000000000..8aa275358e43
--- /dev/null
+++ b/dev-db/repmgr/repmgr-3.3.2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib
+DESCRIPTION="PostgreSQL Replication Manager"
+HOMEPAGE="http://www.repmgr.org/"
+SRC_URI="http://www.repmgr.org/download/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+
+DEPEND=">=dev-db/postgresql-9.3[server,static-libs]"
+RDEPEND="${DEPEND}
+ net-misc/rsync"
+
+src_compile() {
+ emake USE_PGXS=1
+}
+
+src_install() {
+ emake DESTDIR="${D}" USE_PGXS=1 install
+ export PGSLOT="$(postgresql-config show)"
+ einfo "PGSLOT: ${PGSLOT}"
+ PGBASEDIR=/usr/$(get_libdir)/postgresql-${PGSLOT}
+ PGBINDIR=${PGBASEDIR}/bin/
+ PGCONTRIB=/usr/share/postgresql-${PGSLOT}/contrib/
+ dodir $PGCONTRIB $PGBINDIR
+ insinto $PGCONTRIB
+ doins sql/repmgr2_repmgr3.sql
+ dosym $PGBINDIR/repmgr /usr/bin/repmgr${PGSLOT//.}
+ dosym $PGBINDIR/repmgrd /usr/bin/repmgrd${PGSLOT//.}
+ dodoc CREDITS HISTORY COPYRIGHT TODO *.md *.rst
+ insinto /etc
+ newins repmgr.conf.sample repmgr.conf
+ fowners postgres:postgres /etc/repmgr.conf
+ ewarn "Remember to modify /etc/repmgr.conf"
+}
diff --git a/dev-db/rethinkdb/Manifest b/dev-db/rethinkdb/Manifest
new file mode 100644
index 000000000000..af1c839b4e5f
--- /dev/null
+++ b/dev-db/rethinkdb/Manifest
@@ -0,0 +1,8 @@
+AUX rethinkdb.confd 606 SHA256 5d659a409a7b1a502a6362b818b01c1eb5f12e1bed273e9e876cc43758464659 SHA512 3a07f9c78ef96b2ca37fca508ee14a644d3c08612f662ba5260182fbfcceba064d20253f1261f56dc0a2c28d1a4d5e2320872c3c4e7595cb7ab4e202eb28ad42 WHIRLPOOL 2598d32113314f60b9e64048ba148c6fb3653ab92f833da13cc58b080996b988a20a61b8821634889c735628421609cee36c88dede66d89d5de071011a7afc57
+AUX rethinkdb.initd 1645 SHA256 fea58f7423e160abd7470abcea821b5d502dff0314e94e81c5cbd0acbbbfc3d3 SHA512 4449b8a4d25232a1d8f375f161d3801d67d93756bd9b3e2f33b58a87e8a257e2e94e47f8aa4a74b69df3da528ffc349f15198a939552c3b5b9ffaacc18a096a9 WHIRLPOOL 6d1c2744ea27f9351e0165f711148581dadf472a7f88e65f08b23040f0e82c1c920e46506981550f3de0370017f96ae32dbac2ebbe12cc0f67ad3654586b564b
+AUX rethinkdb.service 261 SHA256 c831f179b0973ea5abb205a5aae3f4597d09bc7575f3a75fa6db5c32fce5f5ee SHA512 70389797ae79481b7d47b45f1676bd0531bc830a2f2daf7baec87533a7a6a0e67177572bab7d42324fe719f8a056899babc5ab2358a679c6a59899ed1272374b WHIRLPOOL 7e0259a1678a216a44ee1b64df65ad8c3d653887a392ed371b027f17fa91cc9cb1f315fdce4071e8c1403e9af7891d772089f85fb9291981fdbca08ed3e46b6a
+AUX rethinkdb.tmpfilesd 43 SHA256 656d3a42e75d087e723f71aa320fdd91cbbb82071ef72eb11fd3e4a619b429a4 SHA512 5996f72b8e08aac80285373e8e1b5a664177e9d0e8d13e5638c6b821fe5b7a0368001fbfa9ef3f6709dabf0616abcabea40adc4808d176572f8f99b7a3255bae WHIRLPOOL 84ff192ff84922155cfacb26e8f9255d506c0733472d5b674ea61e1c2f805a0293da0f69622d52bd21b2822dcaaf3a641c2ec39321283af0b3f00b0fb37ba2c9
+DIST rethinkdb-2.3.5.tgz 76829628 SHA256 dd8aeee169b177179bfe080725f0560443e0f26dae875b32ae25d90cf2f8ee10 SHA512 ac71656fd2451fd36432fa0f7d2c16c2be53888f748d88f0bfc2fb9ad7cd3c704b56551bc35eda72eb08fffdd799727a3cbe83830337cf71e17c159588d33c94 WHIRLPOOL 533a0a4db02672c4310ebd99a18517ff8a6e571e1c9a1c6b8f8ddc40e8b76c0506a56986857469a15ff74b6f80d2e5c830c0d606f67e4bf70eac4d59c7356652
+EBUILD rethinkdb-2.3.5.ebuild 3796 SHA256 2a2e3cd89d5323bd8f52fd899b82bf8e0328263b6806c4281102b0524ef97745 SHA512 95a8f533a12a939e03d5bab2076574bdd0c1c5f5cf1c5e45722c1bfd580f79a36c56fb903f063a057b0d3381317ff12577d4b1c5ae75fc4969d0d4d714513897 WHIRLPOOL bc29c69d86071912e33fa4ac6ebed4d5918bc345fdcb66d045be2d02e3b43934a628f0629c2a7cbb8d2f517d0c196b6205cdbb5678b94f05fda1e1c2c04a858f
+MISC ChangeLog 811 SHA256 e88527a22732eb4670de3a12c546448deb0e77e1af8f70faa797b66cf850e09e SHA512 620ee0dbb9ecfc0c9244ab9caadd4f03948dfe9edb08596289ec5ac5166f8ceca1410752d272cb45398654b6299a8c78032bb91ac0ef7a8f1cf469a398942ccb WHIRLPOOL c811b8598672e07f87103fdce8883a9a5872d50bd59b78bfb0e961aa598c6567e46eb74f2149d26760340d620c958d19f93dc62ede049edada26fb86b39ce999
+MISC metadata.xml 584 SHA256 78e93ccdd027b576957d5e3cd8fcc3ca75150d2591d70a4fd60f35c8c170293f SHA512 50641820a4f298ad66ceedafcb388b8f99d2732e0e7de9c0aa412d75482488a9d382845802ea55a451c39890ff5167715f47e3346aad29992fd3bc069d097dae WHIRLPOOL faf720da7b8edb0781aa3985e448c049fe8027bfec7771a2f6319b3a60f4aaf94b0218230760ec0c4000a9eab6557fc2ae1dcaefb4ccc3b80b3657366912fabc
diff --git a/dev-db/rethinkdb/files/rethinkdb.confd b/dev-db/rethinkdb/files/rethinkdb.confd
new file mode 100644
index 000000000000..af65794a44bd
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.confd
@@ -0,0 +1,12 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your rethinkdb instance,
+# see the /etc/rethinkdb/default.conf.sample file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/rethinkdb/instance.d/<instance-name>.conf)
+# - user : the user used to run your rethinkdb instance (default : rethinkdb)
+# - group : the group used to run your rethinkdb instance (default : rethinkdb)
+# - run_dir : the run directory for your PID files (default : /run/rethinkdb) \ No newline at end of file
diff --git a/dev-db/rethinkdb/files/rethinkdb.initd b/dev-db/rethinkdb/files/rethinkdb.initd
new file mode 100644
index 000000000000..9f55aa49c8e6
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.initd
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+instance_name=${SVCNAME/*.}
+config_file=${config_file:-/etc/rethinkdb/instances.d/${instance_name}.conf}
+run_dir=${run_dir:-/run/rethinkdb}
+
+command="/usr/bin/rethinkdb"
+command_args="--config-file ${config_file}"
+command_background="true"
+pidfile=${run_dir}/${instance_name}.pid
+user=${user:-rethinkdb}
+group=${group:-rethinkdb}
+start_stop_daemon_args="--user ${user} --group ${group} --wait 2000"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ if [ "${instance_name}" == "rethinkdb" ]; then
+ eerror "You should not run this default init script directly"
+ eerror "Create a symlink to an instance name"
+ eerror "and create a configuration file in /etc/rethinkdb/instances.d/"
+ eerror "then run this instance init script instead."
+ return 1
+ fi
+ if [ ! -f ${config_file} ]; then
+ eerror "Missing configuration file ${config_file}"
+ return 1
+ else
+ # respect configured directory or set a default
+ directory=$(egrep -e '^directory=' "${config_file}" | cut -d'=' -f2)
+ if [ -z "${directory}" ]; then
+ directory=/var/lib/rethinkdb/instances.d/"${instance_name}"
+ fi
+ checkpath -d -m 0750 -o "${user}":"${group}" "${directory}"
+ command_args="${command_args} --directory ${directory}"
+
+ # respect configured log-file or set a default
+ log_file=$(egrep -e '^log_file=' "${config_file}" | cut -d'=' -f2)
+ if [ -z "${log_file}" ]; then
+ log_file=/var/log/rethinkdb/"${instance_name}".log
+ fi
+ command_args="${command_args} --log-file ${log_file}"
+ fi
+}
diff --git a/dev-db/rethinkdb/files/rethinkdb.service b/dev-db/rethinkdb/files/rethinkdb.service
new file mode 100644
index 000000000000..09645c2ae6ab
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=RethinkDB database server for instance '%i'
+
+[Service]
+User=rethinkdb
+Group=rethinkdb
+ExecStart=/usr/bin/rethinkdb serve --config-file /etc/rethinkdb/instances.d/%i.conf
+KillMode=process
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-db/rethinkdb/files/rethinkdb.tmpfilesd b/dev-db/rethinkdb/files/rethinkdb.tmpfilesd
new file mode 100644
index 000000000000..694501e8ab55
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.tmpfilesd
@@ -0,0 +1 @@
+d /run/rethinkdb 0755 rethinkdb rethinkdb - \ No newline at end of file
diff --git a/dev-db/rethinkdb/metadata.xml b/dev-db/rethinkdb/metadata.xml
new file mode 100644
index 000000000000..91224a49a819
--- /dev/null
+++ b/dev-db/rethinkdb/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ultrabug@gentoo.org</email>
+ <name>Ultrabug</name>
+ </maintainer>
+ <use>
+ <flag name="jemalloc">
+ Use <pkg>dev-libs/jemalloc</pkg> for allocations (default).
+ </flag>
+ <flag name="tcmalloc">
+ Use tcmalloc from <pkg>dev-util/google-perftools</pkg> for allocations.
+ </flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/rethinkdb/rethinkdb/issues</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild b/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild
new file mode 100644
index 000000000000..7dafd2bc1039
--- /dev/null
+++ b/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit python-utils-r1 systemd user
+
+DESCRIPTION="The open-source database for the realtime web."
+HOMEPAGE="http://www.rethinkdb.com"
+LICENSE="AGPL-3"
+SLOT="0"
+SRC_URI="http://download.rethinkdb.com/dist/${P}.tgz"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="doc +jemalloc tcmalloc"
+
+# TODO: rly need some webui libs ?
+DEPEND=">=dev-libs/re2-0.2016.05.01
+ dev-cpp/gtest
+ dev-libs/boost
+ dev-libs/protobuf-c
+ net-misc/curl
+ sys-libs/libunwind
+ sys-libs/ncurses:=
+ jemalloc? ( >=dev-libs/jemalloc-4.0 )
+ tcmalloc? ( dev-util/google-perftools )"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+pkg_setup() {
+ enewgroup rethinkdb
+ enewuser rethinkdb -1 -1 /var/lib/${PN} rethinkdb
+}
+
+src_prepare() {
+ eapply_user
+
+ # don't use predefined configuration
+ rm configure.default
+
+ # fix doc and init script auto installation
+ sed -e 's/ install-docs / /g' -e 's/ install-init / /g' -i mk/install.mk || die
+
+ # default config for Gentoo
+ # fix default pid-file path
+ # fix default directory path
+ # fix default log-file path
+ sed -e 's@/var/run/@/run/@g' \
+ -e 's@/var/lib/rethinkdb/@/var/lib/rethinkdb/instances.d/@g' \
+ -e 's@/var/log/rethinkdb@/var/log/rethinkdb/default.log@g' \
+ -i packaging/assets/config/default.conf.sample || die
+
+ # proper CXX declaration
+ sed -e "s/CXX=\$(.*/CXX=$(tc-getCXX)/g" -i configure || die
+
+ # respect user CXXFLAGS optimizations
+ sed -e 's/-O3//g' -i src/build.mk || die
+}
+
+src_configure() {
+ local conf_opts=(
+ --prefix="/usr"
+ --sysconfdir="/etc"
+ --localstatedir="/var"
+ --static=none
+ --dynamic=gtest
+ --dynamic=re2
+ )
+ if use jemalloc; then
+ conf_opts+=(--with-jemalloc)
+ elif use tcmalloc; then
+ conf_opts+=(--with-tcmalloc)
+ else
+ conf_opts+=(--with-system-malloc)
+ fi
+ ./configure "${conf_opts[@]}"
+}
+
+src_compile() {
+ python_export python2.7 EPYTHON
+ emake VERBOSE=1
+}
+
+src_install() {
+ emake DESTDIR="${D}" VERBOSE=1 install
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners rethinkdb:rethinkdb "${x}"
+ done
+
+ newconfd "${FILESDIR}/rethinkdb.confd" rethinkdb
+ newinitd "${FILESDIR}/rethinkdb.initd" rethinkdb
+
+ systemd_newunit "${FILESDIR}/"${PN}.service "rethinkdb@.service"
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd "rethinkdb.conf"
+
+ use doc && dodoc COPYRIGHT NOTES.md README.md
+}
+
+pkg_config() {
+ einfo "This will prepare a new RethinkDB instance. Press Control-C to abort."
+
+ einfo "Enter the name for the new instance: "
+ read instance_name
+ [[ -z "${instance_name}" ]] && die "Invalid instance name"
+
+ local instance_data="/var/lib/rethinkdb/instances.d/${instance_name}"
+ local instance_config="/etc/rethinkdb/instances.d/${instance_name}.conf"
+ if [[ -e "${instance_data}" || -e "${instance_config}" ]]; then
+ eerror "An instance with the same name already exists:"
+ eerror "Check ${instance_data} or ${instance_config}."
+ die "Instance already exists"
+ fi
+
+ /usr/bin/rethinkdb create -d "${instance_data}" &>/dev/null \
+ || die "Creating instance failed"
+ chown -R rethinkdb:rethinkdb "${instance_data}" \
+ || die "Correcting permissions for instance failed"
+ cp /etc/rethinkdb/default.conf.sample "${instance_config}" \
+ || die "Creating configuration file failed"
+ sed -e "s:^# \(directory=\).*$:\1${instance_data}:" \
+ -i "${instance_config}" \
+ || die "Modifying configuration file failed"
+ ln -s /etc/init.d/rethinkdb "/etc/init.d/rethinkdb.${instance_name}" \
+ || die "Creating init script symlink failed"
+
+ einfo "Successfully created the instance at ${instance_data}."
+ einfo "To change the default settings edit the configuration file:"
+ einfo "${instance_config}"
+ einfo " "
+ einfo "To start your instance, run:"
+ einfo "/etc/init.d/rethinkdb.${instance_name} start"
+}
diff --git a/dev-db/rqlite/Manifest b/dev-db/rqlite/Manifest
new file mode 100644
index 000000000000..a5070767cd25
--- /dev/null
+++ b/dev-db/rqlite/Manifest
@@ -0,0 +1,30 @@
+DIST github.com-Bowery-prompt-753711fea478fa77bb2c83f6ec244b814d4a8bad.tar.gz 11327 SHA256 67e3487bd79d9da3dfef73ecdf0e26be89555a3a1ba2715f8d6feb32872a4770 SHA512 a365bc6542080e6d6ddf3736923e58552684cd0d204e78fc59993f39eef46a073e4c30d980052c2b6bf5175985b59ac7b4f762f8aa1a15db39481466696b8a28 WHIRLPOOL 9c6b97d83d7e8b1a02e0d6e945d596c2bff31196a86ea08fda63489b08adc6ff2a2b99586d6a12bf372db0192697774c23b87ac9a23c3a7e5cad24b8bc849ec1
+DIST github.com-Bowery-prompt-eb8f7a6a197ce971ed0e9d4a739c628381d5f124.tar.gz 11317 SHA256 3260cedf37b54a5aef1932d4d2f4c6dcfb4419612eb1b7f6d6892b289effeda8 SHA512 593710fe395d5f9b9cb1b794f597a6abd8ba3e1259148a5c7addf423cda330bcf3515ebcda807d859a26a62762a988ee09172723563a9265efa6770c0aa53946 WHIRLPOOL e2dc6bf1d30ede3ce0c2ea1ce5794f1c26ac4c6aec84fdfaa6cd890230ed2bfd71771d21bb83dd29e551a6a7b02b1877e986ebb69f7875c70951730e4a38afcc
+DIST github.com-armon-go-metrics-023a4bbe4bb9bfb23ee7e1afc8d0abad217641f3.tar.gz 21391 SHA256 7d12747199b607361d6f51f076f9582ef53a04619fb7527968297d91011b30c1 SHA512 f5d6ac8eb3710c7dddac79d4d2434c818b6b09f975472979c58ba266e635c0f37d70e6b4d364ea32c82eb0fb953ee8392fb1743328f88ceab414862eceb510db WHIRLPOOL 2554b41b60326466ae8c60177e1cb16bd382ac8e27aab0a6acc660928bac375ac2b0e0bb83d4f0141ae502af41817ee2798b6dac5f5fd24bfff76a5384e49ac5
+DIST github.com-armon-go-metrics-0a12dc6f6b9da6da644031a1b9b5a85478c5ee27.tar.gz 21391 SHA256 117efd09edea7cac0adcaefd5d26d4938b58e03861a5dbc44880f35face4c129 SHA512 d93d2ed9068ba0e65a8477f8edbd02b39be99b015adb881558ff878e04a0c7730c0758ba91e6fe76009bb9e41ece3c8ded2cbdfcf194df8058a6c46489079b2d WHIRLPOOL 555ec726512943e2255bfaa10200a3e2630bdc722445e64bcee64d8c6f62bd7f08b4dc79424dd2ed0b9e5769be34824486fa54eb20c2a3f2e47ab577d736fd2d
+DIST github.com-boltdb-bolt-2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8.tar.gz 83582 SHA256 95dc5842dab55f7519b7002bbec648321277b5d6f0ad59aab509ee59313b6386 SHA512 c555587c880a24718598d72618cd6ff1240e113570783e3be0335d0e37f0673f61740962dd0bac2ea62ab3f81d108b1360d93f828390272d2789f758560c44df WHIRLPOOL 44e728db1c6822b30554807dfd10d3b9fe37b2675369bc3e6d361822bfe406c26701dfaa63e181ed3f83655303095b92bdf9baeda9fa9a61cb523b84912bed89
+DIST github.com-boltdb-bolt-fa5367d20c994db73282594be0146ab221657943.tar.gz 83957 SHA256 530be574604e8ad80d04060c55405a66e941c20a17887380dd1f1a197babf38a SHA512 d877c68da702a5bd0cbec5d7f7c2d2f6d58e1fe1dd0071b095d1ba1d12e5a9844e53dbef7d4855e56852e4669c976dc0705358ad8ee5466e49cc4a2a5ca5202a WHIRLPOOL d819223d103ce584a701c6a4448a9b1f183b509788d7b200dbd91b6378b775353b0328eac293d31f869879f287ccfcc6da893c488bc869a9e68e429bccd692f3
+DIST github.com-golang-net-1c05540f6879653db88113bc4a2b70aec4bd491f.tar.gz 916090 SHA256 37d0bf101e8fc7e1dd8f1aa83ef106befe02fef11dc6a12ea1f7cebdf1a160e1 SHA512 40c070ab27ba31bbf0f0555e2b90b12100246caef36d7bf48d543e432272b0eca6e0deaf49e1e31ff6974b06d6476924818862a9243a8646d0f38b344a09633c WHIRLPOOL d344671f614f0d43a313d1409ba20cad711bf8d3be7b0c52e6d2a7db0a3efbd17369cea70136a095522122a3cbaada7de4d79e2f7ad784b9e7fd8e46d54ec443
+DIST github.com-golang-net-859d1a86bb617c0c20d154590c3c5d3fcb670b07.tar.gz 920336 SHA256 6ca476b72c2b53b181fc32015651b385f565079d8395a28176bf8be168e8a1d2 SHA512 49ccb64c9b675460d12ea6d0456bb1124a92d56e70b04398d14b33dd5879c4e188dcc3e6c79c1aa6f491507f854911a9298fbc61aed60cbdab0205b6995bb4a3 WHIRLPOOL 6995b918f17d4930c246c6796febf09eab7c2777f649565cc4cfc03b770577dbd6a01a8824ba3dde555001cf814e27dd8b886de466e7f5fec1cdbd1791dbc225
+DIST github.com-golang-sys-062cd7e4e68206d8bab9b18396626e855c992658.tar.gz 769037 SHA256 915441e9cf6adfed01c88eda4290999966dcc8c004430aa94379f20881e10200 SHA512 fd7ce44eef01931b5017d9054858d9f3197b03e5e824ec1e4377b2e1cc11beceb5e3fa2fcf5222e7d8624f054608be4e9edfe47261ecdb60ebd3156124ccd6e8 WHIRLPOOL 0fe6af7bb0cf88a1b84da7da7bca4e606c77a17f7537df10bb2779e79fb2fd895bfc63e5a274d49f25d2258478d499453d04d64b501b3905d7490b7d6f078b24
+DIST github.com-golang-sys-b0e0dd72976dc482b6cb37c5640440f876ac1907.tar.gz 749422 SHA256 5eb3cb820259f0d98a883efc82b49d13c83e81d047610a01ee964047b4d72861 SHA512 1269418c156429487388e868041d10b1fec5de1551cc773a0a1b9a032ca50a328c023bf84f1d6959ab8ae3b57765a92f51263d70b729e20d825c31742d4e666a WHIRLPOOL 315b5a38086af0bf2f2971a37b7413fc5a28c808796e80ac241c0bceffaceebb53820ab6b39e0802e45cea6d458e0516535f1892668c4eaa5bbfcf98d8fc3f6a
+DIST github.com-hashicorp-go-immutable-radix-8aac2701530899b64bdea735a1de8da899815220.tar.gz 18806 SHA256 743b0c611b819fb462cf2520e4e309d08d580f40e0835d67f089a51e9a2d4576 SHA512 6b748a06d21972f9011cd85e9128cc27ac67539f8a1be021733b25055d8c6c731a393078ee0418a1929e35cd701bba128a96053cd77fc0a01af51ee58baa5c36 WHIRLPOOL 7d81d7b43d20a574245859951f901bb9fb2384a394e22dd121e581004365898673a628d2ae74dd11286297b1c2987fe566fc82d08496c088bf048af2e481d8c3
+DIST github.com-hashicorp-go-msgpack-fa3f63826f7c23912c15263591e65d54d080b458.tar.gz 49488 SHA256 eeffbd458f4996334275f828cfd3549d32a2ba6eda359e5c9be09f091548781f SHA512 7e60a122cca007bf5455d6e15f77c24eaa5739deedc9e0c158282249e84698f873628bffa9eb7d23c1c59bda7632b1968ca770c8e1796e2d50750ac86e80fcb2 WHIRLPOOL 41745e39256ef510d42c4da413609e3bdd0621cc2acccfddabb4c8774e47b73ad46656639bed3fac2335cf1b6a2a245d3b8b4f3831cfafb2c6e7ecb90293475d
+DIST github.com-hashicorp-golang-lru-0a025b7e63adc15a622f29b0b2c4c3848243bbf6.tar.gz 12306 SHA256 a8cb9b1dbd5c6d7bb9aae4afe50c4c52a4fa7ee0bd139ee3cdd0e9b8bd321055 SHA512 59a53fd3613e16343982ab802a85c9c70feb708c82c687e52712f2c3f3698f1c6799fb7d5c5d95154347301a38223dd19756a580a60b8054783e05e667ce11d7 WHIRLPOOL 4496ce7216a5ec1873b9f2a2f6340e4336040a48e273f3b62ea8877cd6e93379f50e94bd8dcb936d42f5a8e646e553d1b3dc64c08e11efdb5211ecdc3b9924e6
+DIST github.com-hashicorp-raft-3b4d64b29e422f04808b905005eb5a38bf9150e8.tar.gz 68568 SHA256 f4068e028d325c759830ea528d04812adcf54ffdc09b04edcb10ce5c94a163a7 SHA512 aead9470f68c32bc80dba0e4eab922e0ef13e2d12da161b570ba245a9f1e3dd23fd5af25e6352120b2ac152f3d8e6dcec371c651e70b86f8401d6c0dbd641938 WHIRLPOOL aae336162e5cd19587923b674597ae0502b733c9804c218f3538164b23ff0c6688770556067edae293832e477a59493a8c9c3861f47a2f5f543f694891ee9c0a
+DIST github.com-hashicorp-raft-ac704075e75b8626023224c76c56be4d6958a5dc.tar.gz 68504 SHA256 ce90fec880942a0460985db0eb5ce26e37b0de280584d19f2d6d80bda8e1fc40 SHA512 c1963032086944ddee382d70541da596ae3eada05b8c115cf523c988ba775be77934c7704a6c72f5c082766875f10c0d3c67055c0dc4d9cab212b9d1469c90cf WHIRLPOOL 1ed6bfb65d838aea09ced7e6e0f6f180f70b87a7dfbd75d5c730f9ac41f36ffbfa49f7f947186002d8fd8ccce10cf59d69c063f9c21b7fc54a6d22d3b037e329
+DIST github.com-hashicorp-raft-boltdb-df631556b57507bd5d0ed4f87468fd93ab025bef.tar.gz 9828 SHA256 909f4cee5ea9cc1e5a9b716fe8ea722a1172ed2ef83a512a0d175916617fa8a8 SHA512 1b09821dd5eec9781298ca1e40c19598e5c7e6dba7bcf279bb73c79712b39429eace238a669cac6a6db7196ec72c2d4eb682353efc0813541980cb71dddeba5e WHIRLPOOL 21f7165394e914680e3705a1309be4b546b1a06ea85501e289e502eb03d121dac2e327db319bea4bec62fe36c699c6a504ea9ea61b528a2517fd4b5e07d19806
+DIST github.com-labstack-gommon-779b8a8b9850a97acba6a3fe20feb628c39e17c1.tar.gz 10150 SHA256 c0b389fc7d8654b131f385d8680a8543adcd0be46813b0ef822f980e739047c0 SHA512 432ee53a8ec8a1278ef8348151bb80c2323774861eefb85e54bc45b6ed5cf7c3a801187e072a7016929f8682cf653ee1a12ca31e44ab87ba524812eec1bc1e08 WHIRLPOOL 0e03b48ac77e6b9f02d7a84f3221babfd845b44428f0779116f884db5393687ead2924cc07985ebb6b64c171e4e2fced27ce118dfd8ebb9c82c4e31342003ac0
+DIST github.com-mattn-go-colorable-6c0fd4aa6ec5818d5e3ea9e03ae436972a6c5a9a.tar.gz 7782 SHA256 29b89a8a8dd45dd67ecba9997333d375f4e0df2bd7c3e2262d0e2c26dc76a601 SHA512 54a65020809e2d412e6891af0ce6046c2aa8eff71e86d62629a166938b5051f1277d9fd0c96f6eb83988104f9d3c76d1217173d4e6a4f8f501dcf38998d8116c WHIRLPOOL 3b720e47350d8b90eb4ca45ae38878237d5970cdf279f89409fa670372a297abf3f2d06be8b9d5104cccc19c1d78a03f1a2c7da63d17860893f5a8e7ff3c7c9a
+DIST github.com-mattn-go-colorable-ad5389df28cdac544c99bd7b9161a0b5b6ca9d1b.tar.gz 8089 SHA256 ad1e8de71cee50acb8492bcaa9b1a7d0ebe175f76266a8f3dd4d7fb48d8e53be SHA512 0f458e6acfec266b58cd458bd05bc04617df0ef223ffa6a6c374decd29555a78441f3a17df7b5f782d96a25f56bcece061407e9778e25ceafeedafa014a45bb4 WHIRLPOOL e18e5c426b611f5ba102c2bfa935c26bf5be3b42e48c2b337d3827936361daa28ba1185337b1e25d5732063e0cd539661cb740028f811577cd0250ea24b4e0fe
+DIST github.com-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.tar.gz 3262 SHA256 c013b75f090745e80bc5e3060a26d7053ebc63bd3d077177aa7a3e349bf151ca SHA512 8627d22f5ee5a087744bbf4dd391f8f87ebabe8940564206935dec9e406e40a98976479ea973e61afeb1774df211992cd61c67ee198d546e22fbf60826b64ac9 WHIRLPOOL be9969d0cca83428e9f6eadfffd970d95ae8c0562c00005303eb8122b2cd737410372458e2cd8e6328ff65536d5b7d6b60e34f94fac8cb4d582202dae4e0b94a
+DIST github.com-mattn-go-sqlite3-05548ff55570cdb9ac72ff4a25a3b5e77a6fb7e5.tar.gz 2030395 SHA256 6253685c0e7ae8141e4b9f07c6fff664edac80b75b8c09b39965f7603850512b SHA512 0899042c28f4dec19f830155d1da03830ddf6c03c96fc10190184f1ad2ed5eb2d69b5b989c40f489846201ba664ed80554f76a03c9e1e291d7fb9636967aba52 WHIRLPOOL 9c7867e45d0dbbc2b9865f0215b7c2b747cfc2c2e35264ca2bf96adaaa71b59374f301548ccb8cf34ff989fbc688e787dde2ce6de770962ef365b6ff6c5328ef
+DIST github.com-mattn-go-sqlite3-6654e412c3c7eabb310d920cf73a2102dbf8c632.tar.gz 2028435 SHA256 650ece3ec45fe26df3879e3e67fc4e21f65547d441b4085f4910817dae54509e SHA512 743b713ff506517c05ea89fe744eebd5b67751305fc720459840ec6c2d0f2d1fff8437f668a38291b9686ecf940a5177c356c34e022fc020540e0f8c60a21ba8 WHIRLPOOL 840e78119db23b74a231d8f01c6f6a20ce5d5933aafa2dda9c2c1179c5f69f2c7e17fb59a5e5771252cc89b859bcc7ed32f777a5bf139f80e0fb6e026d9e2c6e
+DIST github.com-mkideal-cli-a9c1104566927924fdb041d198f05617492913f9.tar.gz 43950 SHA256 2edcc06d38bd63b3bb4b95f354bf13895202b2a9c7dd433ed6a9acf60c8e760d SHA512 ced5936b659673383295da6a55c21767ed21ba91ca6aed0fd27e8cd317026bf1bcb29da9e7d714f93fe783aa54a9e58d435c56aa84e8ff06c59a333dc9150499 WHIRLPOOL 2e25a5729f4f8355e6bc21815aab8ada7eda13d4619398a341a1c8001deccaed255c39da6c24801b2431db4d8059b2644b21e525cbbf77f004408721fc10e9d1
+DIST github.com-mkideal-pkg-3e188c9e7ecc83d0fe7040a9161ce3c67885470d.tar.gz 69219 SHA256 4856ee957f183854a4253118a811618381ebddf14c668fce143ccba39c7b61ce SHA512 1c6b5cd345da17f8c2691a4f132bcb8ce1e794db54ecdcf2bf20392bb2f3195db6c1579ffd220bb21f121ccbec0c8c9ea4160a4a6c38734c68d1e163622ec1cd WHIRLPOOL bfa02ea6d5f100e01f0821eec97bead1c588143ae6b29c4d1a7b80a88b3bb409b80daeda446cd3dcc11ee826c642f0d0d9de5eed4b6357118b50888dc69d8565
+DIST rqlite-4.0.2.tar.gz 283170 SHA256 061310c60af6e5e12db740e54fa021f55c6b2a067e434af5ed3e859baff25a68 SHA512 27a07e3ac2dba3e018778e2f1876533a9271ec10334008f5e563327258ff9b6a98f943d9090f159a881076f6a6d11d98b067efa6485ada232dd343f46a6ce5aa WHIRLPOOL e6aabd97d8da01eb1341ef7d95f67f11b7d85b22f8e6adbda4cdccea0c3910b810a1ce1c1c3890742c52963757b4251fb7842ae78aa96430858c10744144dbc2
+DIST rqlite-4.1.0.tar.gz 284026 SHA256 00b8ef849fc677e7112d68080c14d34408509b51b7f31e654efbb6d447e8daea SHA512 ea1b5fab399728b970813c913669245320eddcde658d0a57ab7525e5de9cbfd60ee61dd5facd98ff89f8dfcda25948a5b22d4cdd6f34c28a8e8aaf45d8cd0168 WHIRLPOOL 799c3728d01f8a7273106c15a852596be5ec2b302310fd97a088ef906714a4c86f17105212dea72e7fbc6bb120c574eefbe532e41803be33a0becb079fe4bc66
+EBUILD rqlite-4.0.2.ebuild 1888 SHA256 0cf16535aaf1a51a28574f0dbaa9cb23c7fd55e3b06f6648d1627f3eb1152bbd SHA512 3618edcfbeca9c2cc77d99e389077c33df8104e9848325931763299d5c42fcd5272906c0ea583d68c2d40d37cf6178449ab36cbab8942fb037167511dbc05ced WHIRLPOOL 8aec6dd8d63dc5b1ca4035c34dfbae9579e510d764482ebf95eaa71bcad8008e894d65339caf23847b2ce15160f252fe9c7f5778163603a6333aae15ed102799
+EBUILD rqlite-4.1.0.ebuild 1888 SHA256 aa1f87b96527250a73f2ac82f061ef9c4635e70b5c8c891b362567cf7d4cd83c SHA512 2321c5a2e291ce7656a0e757332787a788e9b38e2c7038d80a8bd1d7cb0bdf5c5e124db2fd57eecb5246e8978efafcaf8456f5dbe4f172121c838374e08c7c50 WHIRLPOOL 78632998a4ef99810e5d21c7700a5f0a23cd24e1a91e52b8111f2f1cf820b58c3e7502cebc64b7c3ebe7a4a6a2d1a5a731e657e022a3fdaaff84310d1d6ef941
+MISC ChangeLog 1695 SHA256 8dd98b876fedd98a35a35c705232e40982f18ec16fe6e0a8e78e7e46b418e645 SHA512 071e347e034a6d08010a848e1f7a78418bd0a196a467414be298cf437c6e700f3dea3afcfc5b67d0fdc04f8558e972dc4e8bffd4dbce7e7956f45f805641740a WHIRLPOOL 143da1faf775c8421d536350de2aff6db55b8ec68cece5dd7f7afd70b49548a42f51a3df3e0a1e3b53363ce729eb8bcda0323ced46e9480cb80ddfae6af9b10e
+MISC metadata.xml 304 SHA256 ba1c31f2b49703c11a31144bff8b5ab6cf567c9dedd3ea482f8446b4f8cbe7ca SHA512 3e536da8ed6a50cbffad3574074029e67b25627d80050f388742e7b086ffa73e6fd93fa307cc267bc23b4eca080ddefa7845a3ac90ad3736862362f9c0e29c92 WHIRLPOOL 544b9db20cec303dd54253b32ebce3ee53c7303cc9a80c33a1490f045b7479766a3b44b29d07850cdbc17642e120744abfa28187fbc8990a708da609af747534
diff --git a/dev-db/rqlite/metadata.xml b/dev-db/rqlite/metadata.xml
new file mode 100644
index 000000000000..90df09b8fd4d
--- /dev/null
+++ b/dev-db/rqlite/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">rqlite/rqlite</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/rqlite/rqlite-4.0.2.ebuild b/dev-db/rqlite/rqlite-4.0.2.ebuild
new file mode 100644
index 000000000000..aa19d494946c
--- /dev/null
+++ b/dev-db/rqlite/rqlite-4.0.2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+EGO_PN="github.com/rqlite/rqlite"
+EGO_VENDOR=(
+ "github.com/Bowery/prompt eb8f7a6a197ce971ed0e9d4a739c628381d5f124"
+ "github.com/armon/go-metrics 023a4bbe4bb9bfb23ee7e1afc8d0abad217641f3"
+ "github.com/boltdb/bolt 2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8"
+ "github.com/hashicorp/go-immutable-radix 8aac2701530899b64bdea735a1de8da899815220"
+ "github.com/hashicorp/go-msgpack fa3f63826f7c23912c15263591e65d54d080b458"
+ "github.com/hashicorp/golang-lru 0a025b7e63adc15a622f29b0b2c4c3848243bbf6"
+ "github.com/hashicorp/raft ac704075e75b8626023224c76c56be4d6958a5dc"
+ "github.com/hashicorp/raft-boltdb df631556b57507bd5d0ed4f87468fd93ab025bef"
+ "github.com/labstack/gommon 779b8a8b9850a97acba6a3fe20feb628c39e17c1"
+ "github.com/mattn/go-colorable 6c0fd4aa6ec5818d5e3ea9e03ae436972a6c5a9a"
+ "github.com/mattn/go-isatty fc9e8d8ef48496124e79ae0df75490096eccf6fe"
+ "github.com/mattn/go-sqlite3 6654e412c3c7eabb310d920cf73a2102dbf8c632"
+ "github.com/mkideal/cli a9c1104566927924fdb041d198f05617492913f9"
+ "github.com/mkideal/pkg 3e188c9e7ecc83d0fe7040a9161ce3c67885470d"
+ "golang.org/x/net 1c05540f6879653db88113bc4a2b70aec4bd491f github.com/golang/net"
+ "golang.org/x/sys b0e0dd72976dc482b6cb37c5640440f876ac1907 github.com/golang/sys"
+)
+
+inherit golang-vcs-snapshot
+
+KEYWORDS="~amd64"
+DESCRIPTION="Replicated SQLite using the Raft consensus protocol"
+
+HOMEPAGE="https://${EGO_PN} http://www.philipotoole.com/tag/rqlite/"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+EGIT_REPO_URI="https://${EGO_PN}.git"
+EGIT_COMMIT="v${PV}"
+SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
+ ${EGO_VENDOR_URI}"
+
+src_compile() {
+ GOPATH="${S}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} ${EGO_PN}/cmd/... || die
+}
+
+src_install() {
+ dobin bin/${PN}{,d}
+ dodoc "${S}/src/${EGO_PN}/"*.md
+}
diff --git a/dev-db/rqlite/rqlite-4.1.0.ebuild b/dev-db/rqlite/rqlite-4.1.0.ebuild
new file mode 100644
index 000000000000..1462c4460acc
--- /dev/null
+++ b/dev-db/rqlite/rqlite-4.1.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+EGO_PN="github.com/rqlite/rqlite"
+EGO_VENDOR=(
+ "github.com/Bowery/prompt 753711fea478fa77bb2c83f6ec244b814d4a8bad"
+ "github.com/armon/go-metrics 0a12dc6f6b9da6da644031a1b9b5a85478c5ee27"
+ "github.com/boltdb/bolt fa5367d20c994db73282594be0146ab221657943"
+ "github.com/hashicorp/go-immutable-radix 8aac2701530899b64bdea735a1de8da899815220"
+ "github.com/hashicorp/go-msgpack fa3f63826f7c23912c15263591e65d54d080b458"
+ "github.com/hashicorp/golang-lru 0a025b7e63adc15a622f29b0b2c4c3848243bbf6"
+ "github.com/hashicorp/raft 3b4d64b29e422f04808b905005eb5a38bf9150e8"
+ "github.com/hashicorp/raft-boltdb df631556b57507bd5d0ed4f87468fd93ab025bef"
+ "github.com/labstack/gommon 779b8a8b9850a97acba6a3fe20feb628c39e17c1"
+ "github.com/mattn/go-colorable ad5389df28cdac544c99bd7b9161a0b5b6ca9d1b"
+ "github.com/mattn/go-isatty fc9e8d8ef48496124e79ae0df75490096eccf6fe"
+ "github.com/mattn/go-sqlite3 05548ff55570cdb9ac72ff4a25a3b5e77a6fb7e5"
+ "github.com/mkideal/cli a9c1104566927924fdb041d198f05617492913f9"
+ "github.com/mkideal/pkg 3e188c9e7ecc83d0fe7040a9161ce3c67885470d"
+ "golang.org/x/net 859d1a86bb617c0c20d154590c3c5d3fcb670b07 github.com/golang/net"
+ "golang.org/x/sys 062cd7e4e68206d8bab9b18396626e855c992658 github.com/golang/sys"
+)
+
+inherit golang-vcs-snapshot
+
+KEYWORDS="~amd64"
+DESCRIPTION="Replicated SQLite using the Raft consensus protocol"
+
+HOMEPAGE="https://${EGO_PN} http://www.philipotoole.com/tag/rqlite/"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+EGIT_REPO_URI="https://${EGO_PN}.git"
+EGIT_COMMIT="v${PV}"
+SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
+ ${EGO_VENDOR_URI}"
+
+src_compile() {
+ GOPATH="${S}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} ${EGO_PN}/cmd/... || die
+}
+
+src_install() {
+ dobin bin/${PN}{,d}
+ dodoc "${S}/src/${EGO_PN}/"*.md
+}
diff --git a/dev-db/sadisplay/Manifest b/dev-db/sadisplay/Manifest
new file mode 100644
index 000000000000..12aed1292b6b
--- /dev/null
+++ b/dev-db/sadisplay/Manifest
@@ -0,0 +1,3 @@
+DIST sadisplay-0.4.8.tar.gz 9063 SHA256 30d786c33c62ca91b65d6e70753455d0a57fe67737856fa0f00f7ddb9789c9e5 SHA512 c3707f90a20028fdb164caa3037f4ffff3da3f4bc763c400f8204dae4d7d71862e65902892d8ad0fe3bbe636cf87e4f96a475e01e8ce0ac55bed4e17073e3308 WHIRLPOOL 18c5d8b180c8390eb8d0d320b5889e5c8daa6b1191ccb017d7d1845c2c41d5d939a98c8a7d70d84d2de217f296e20830653c836a022ec668ed0042673d3af263
+EBUILD sadisplay-0.4.8.ebuild 664 SHA256 b17ad6a53e08b4896ee1d65e80ffff40a3e74a6f582a15f8b561725d46d5aec9 SHA512 ce7377769fa177cec3e959845c584b264efe54a4933eac04874dd04c53a6b6edd61bf97fae4e7c66f9ea879f91d55b6ac6f4e480c1c136a1a24fd89399d9248e WHIRLPOOL 8564b661b3f243af8521201c398a4d1963a602e4c0d01af2390571a24f33ef63a1d1bc7c77f884689159da9993714bc85f5a6c74e9fc3c6bac4349ed4b781765
+MISC metadata.xml 731 SHA256 c65cff016de5a8c7feac99affa3071988cc1996b64784532aa7fad3ecf823fa2 SHA512 c05e53460ae66a3c52b3a17ec0547962338bd7beb07b9d8f79d43184ff8fd433eb8eaf4bafbb288555016b33f6b296715fcaf2eb73f571dfffdc593773ffbf74 WHIRLPOOL 995561986ad633be9583d7702ec2331a22009de84bc49da15cab772d8f4bc1d62fd9cee5c57f37b4d0e1c074c18f829d32dc09aee4b13e1278fc1c0182cb983c
diff --git a/dev-db/sadisplay/metadata.xml b/dev-db/sadisplay/metadata.xml
new file mode 100644
index 000000000000..5e098e138e88
--- /dev/null
+++ b/dev-db/sadisplay/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>horea.christ@gmail.com</email>
+ <name>Horea Christian</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ Simple package for describing SQLAlchemy schema and display raw
+ database tables by reflecting feature. Works with mapped classes
+ and raw tables. Relation detecting by ForeignKey columns.
+ Supports mapped class inherit.
+ </longdescription>
+ <upstream>
+ <remote-id type="bitbucket">estin/sadisplay</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/sadisplay/sadisplay-0.4.8.ebuild b/dev-db/sadisplay/sadisplay-0.4.8.ebuild
new file mode 100644
index 000000000000..04ab38a361c6
--- /dev/null
+++ b/dev-db/sadisplay/sadisplay-0.4.8.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1
+
+DESCRIPTION="SqlAlchemy schema display script"
+HOMEPAGE="https://bitbucket.org/estin/sadisplay/wiki/Home"
+COMMIT_ID="d67d12894ebd"
+SRC_URI="https://bitbucket.org/estin/sadisplay/get/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="dev-python/sqlalchemy[${PYTHON_USEDEP}]"
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( ${RDEPEND} )
+ "
+S="${WORKDIR}/estin-${PN}-${COMMIT_ID}"
+
+python_test() {
+ nosetests -v || die
+}
diff --git a/dev-db/slony1/Manifest b/dev-db/slony1/Manifest
new file mode 100644
index 000000000000..88cd803ce61f
--- /dev/null
+++ b/dev-db/slony1/Manifest
@@ -0,0 +1,18 @@
+AUX slony1-2.1.2-ldflags.patch 467 SHA256 92b688972b183656d9b1c2f0a85873727e52c70c1be7d7bf49e3b566f6ffd935 SHA512 202570d6ac0563789a20cdb529d5d1e0f9a8bade99ae30d9aa8f61e76db78d56b2617ce414fcae31b4a2b9518e8f21cf7161accee93a4dd4681397f88117426c WHIRLPOOL 3b598aca98744bc2082948689bfe7eb2063e369a97be1187ffade172e20e8f38547dad9a5cd4c6d6fe4d96d1ddc202ae8dca4324fe48a5e2877a0bcf2bb99baf
+AUX slony1.conf 249 SHA256 06b0b8ca71edc5d4e68b022ba8e56f4f9a8dac46f2b5a6a8350fa21cae3dedcb SHA512 3ef2b9a326cb237aa6ceaf4f161d9ff183c291f423b7ad29cb9102a67de849dbf5a52120ecc756efc5a8d226f0860a2517ced64ab44f135e62cb2e53611775a8 WHIRLPOOL 1c47170fbc72735ad971a8553fbebf2cad551ee2652d3771adf59c60669e82f8443f9f43e3ed7a071181f66742977047593ee212942c52e9e4223b735a2cb53a
+AUX slony1.init 615 SHA256 1ba2574edaba914de9e876deec1bceaf93a48d8475aba07e55c38967c5feed78 SHA512 d450bba5f65372509e542f138d297202371bcaf78332ba13de72ddf937fcffe419083dddc5032c7bafd51993fbc677b37262e1b1e938e9e3c927e130c0a7c693 WHIRLPOOL d2fcd96633f766514600b69ed860b47c13744132935d0ae5648b5217bfa918531670daf899e966af5f7b60d3467fa53391db3ace5485118d8f319affdfcd176a
+DIST slony1-2.1.3-docs.tar.bz2 1314210 SHA256 8588df1b06086809ce0fef7e1348405bf701c959e2b0affda9d6305f201d6fb4 SHA512 a37bc8432d19833c9cbcc7494c783fabce6d2b5feedf4001e031ff5e5039630497e9b7e4ca4d237d53f41109368cd33708400e64f0c2f45cef3a9916ad9cf4e7 WHIRLPOOL 7d7e0db61956919f5d4fdf96a946b81e9b3502f2c8e5f6fc9b525cb89c37d44cadf349f607fd13a89561c87d1ca2bd722e4ca57b250f809b9c25cd1c56bd523b
+DIST slony1-2.1.3.tar.bz2 1512693 SHA256 048b94c990afceb892f8f6631268bb66e93a3c630afc694b3a09f051c338790b SHA512 f02320e3bb85848b93bc43a7d4e0dbb367afcb8af2100cda840888dcd219fead78bd1ac927493bd173cef2bc1195ba4f860679eed0606dd0a2cf9652d671b493 WHIRLPOOL 51641f4dfa78210ab0ecc2827932dc06389867c18df6dfb61d8b43c03ad00d2ac09c529e4171ece07139a803ef45f12c15ac14da39e6bb269bb5a0d7a0270943
+DIST slony1-2.1.4-docs.tar.bz2 1360684 SHA256 e7d8c1939e0e2cf34614940f62c4fc0ce1a52b6b495d8cb2dc2d249756257fc5 SHA512 87d9db938a849171c15d70213ac770f0daf34a930e141411c8a0a9d5f5ca6375c6c0a2ebd88edfbf4144dc81ccaab6494ae8762e3bff863551aa9846d6abc545 WHIRLPOOL 14c455ddcfb64d26d1613d0a6372cd86ad2906d7c1ea438c64075292920cd53b80601a8f5c45d0605b2c878b7dbdc308a385eadd02d557f6d982eedecd0c764a
+DIST slony1-2.1.4.tar.bz2 1515755 SHA256 90dc746bb9f12a051f9f563365e693ffd81f07a2353debfc4b8a4d0884ca72a4 SHA512 b882146a158adee27f360fc34d3c64144efe3c3a7d63574a4450cb1eb3dac7d75df19d17e75ffc72f656d27b5c5b7fc64bc536de9753a36fe96848b562e42883 WHIRLPOOL c0b95f72049b7f90caf1c2259c8f97411f0b1f1d5c9a6cc4fd6b1b2e677dec3fbbea84ffaffb0ba15caa40203923c8272ac6cccae8e08a51f83c62b765ce2580
+DIST slony1-2.2.5-docs.tar.bz2 1449297 SHA256 7afd749215ca63d5f808c2c199096d4d665923b277edaf75b01e4a8bfdf90472 SHA512 cdd08fcea56f29e8e944cd975b613747cfcab75e70d88afdec79b2ede96dc2d1b35b294cd12c522780e513b4cd26c43da401d9570ca67759dbb2271797a380ac WHIRLPOOL 18206b34d03cb685389398f00d681707471b0cbf9cb3dcefb4cc99b24c35f37c10acc32e573a1c255f85881700efde9e1c8c3948596ebc84fbf5254af866b147
+DIST slony1-2.2.5.tar.bz2 1466439 SHA256 6f6dbd9619c615ed68bf6341a8158e42fc0adf6f5b609e6f8e4a0a0e37815241 SHA512 06c5d8c136b1560aa6a3b1b7bfbad09fb6bbff7e3c530ceaf0279d4564dd1518c69647368deac9eb19ea5059a2d78fef26f62bd34315f5f3415ca0f5cb0992aa WHIRLPOOL 3b9b96c41fbe9da03362a866d3bc81da38be82625a9d25378b69cf322ba6aba05fc15f0725ba3f878e4a9d2b5e6609e50ad6d602f480e6e1482d1953135ecb14
+DIST slony1-2.2.6-docs.tar.bz2 1450956 SHA256 418030209a677845127871eb37d324317acd68a5cfda1e0301ec6f0776c39118 SHA512 b5a870d5688ca24c0a9012d7da539917c74ee697f1b1ae663ead3cb1032345c0d8f5fc5bddc2ca2fec5d738fb9ca74822343cce8739b3b4b478928f26d214a0d WHIRLPOOL bae6e88360d3026feed4029ca9b222966631a3b5608876072de4a1955c9607762dae434281fa3762184e133b5aa2f9a3dff264f1e15caaad7c51ea4e73c778fa
+DIST slony1-2.2.6.tar.bz2 1465709 SHA256 79cf246741bc3f95f6890f2dbed5712d6e5a127bf1f442cf8af102d23de0919c SHA512 5aeadb9ed72b83d303596e4f8513409a1f826f25fe283ca6aa969a7563172bbc5f5360f876fa87780f6a6fc70cb55688a2daf678b9cf91972a3c403cb76184b8 WHIRLPOOL 464c52f2063abcd33a0df0f266b538605584accff5461fea2780df96290c4607783b3a49d636f5f8d83622a6f1b5bbbac463be6f829a7c85f06ba6f406859007
+EBUILD slony1-2.1.3.ebuild 1773 SHA256 49979aff78944aee150f823654055720b62d56e26027c36ccfd8e21ffc205345 SHA512 feff51265613b44f13878516bbd8f5f2c1b5d1cb7e858b71163a5bf8c18bf325c99b708fd3aaf45b81a2219941eb4040066593bcec1d65cdd604e91cfea6838a WHIRLPOOL 5c5a630dcca6f7361d26468ddb632e967f624685e5f7d7e19ca2c6b56e5c9a8dde80f459954be0c4d34d39d299b4ecf547e2383a69d91322b92f38a19ecdaaa9
+EBUILD slony1-2.1.4.ebuild 1819 SHA256 226a6845807a4323604a00ce3271f47540ed1b0d88c264d23153d0fdf8713a9b SHA512 3c878c1e8e2f2906d7ae9b96602a3431304aff3f081e372fbecf830dbe7c1d487e0f5ea7176076ef0e096081cf2b06e15eefd34089e3f3fcdf31626f631460ad WHIRLPOOL ca159a6967edd825ff98d72e9f0221e3d5f16ba9990d4df670a4e655a89bfc772e0330b29d1da8b9b3fcf666c73ccb6baf5147b0874ccb353beba6aaa0f07d8d
+EBUILD slony1-2.2.5-r1.ebuild 1629 SHA256 c8a51ac038797be93f77af6fb47de249f8639a80147f6af98cd1133f541cba9c SHA512 3ef05022f6c1af203a1dbedf4df3ac2fd6912eaf80b612331134c4503eaf0b9e49efb02f58576e577aa2a6b52d747910bd5f1bf791b907b57f68bbb3f80156f4 WHIRLPOOL 575fabfc66c984002162d2d2a0ac300412347268db37fd26c562cb7dbe77fafe52246220ba64b1abd2b711748ea44f10427c74844eea92d98d27bb1e52f7cdae
+EBUILD slony1-2.2.6.ebuild 1632 SHA256 960b7414772e5eef2451431fa46d5edae980049fca8c3d115f2fae907bb0e1b0 SHA512 bcc1dec8a81be086505b1196b990e6af7294619ae723ac1381ba1a84d95f589f8985a790c1b536a76d1af44a769f8aba042539b9ee872d715bc1d0c53ea0a006 WHIRLPOOL 5a117f9badb1c1e53ecf8128feb340a12687ec2def278994107a9054360a9d49a8df2916ba80f7ab3880690b391384affe2aea3d4e303fccc36efa1dc3c5b58d
+MISC ChangeLog 3593 SHA256 484ed1254e8e4510f8cdcf6e99fdf3c085a40fcc7ca16125a24933203afd6ec1 SHA512 54d7038ada50956de574226a09469a95e65aeacc29d6541dd7c906eb68a7b8f04d139f00bf6e1cfe28c3b197d4f07811795556766333c8578b09649971759d4f WHIRLPOOL 770e3ffb1a772050c7c84f5463cedb6ca8c6bd751e203a9f628c4044946603b628b8d52b02c47cb07d8e7c3da73da36178f26de2c24bc9675d017c992c51dae8
+MISC ChangeLog-2015 7522 SHA256 1beae2cd26717609d247d0aa333445888d7ebdf324266781ddb6a68b31872bf0 SHA512 aa5a4c45cb810cebb3d8857d67206b49fbb96b85c76eb5896cc49a2b1582db0e1d861c3a44b3494358ad513a078424692a21d12eae38ed57229270641601adb5 WHIRLPOOL 5fbbbeda3b99ed5a66c495630e395daf8eb27ecc4207770fe4bbb359850c08a99996032a83521aa3262df60e06001535eb3816a18589f4838a82993a0f86ba67
+MISC metadata.xml 280 SHA256 5660ba07e5d7576fce822b35f72d04dcf8a747816e9cf5e5d553242f5b7d9a41 SHA512 efb5fb6652ac8cd75fff4eea8b2b044a2c9201cce2faf3bbe13a97565d150e64f9ba0dd8bb691a44a1b6726455306ea8b6c1b121678a721a82e7ea8b6589c94f WHIRLPOOL eea3f820c4a7f73d6fc893f55c9408f1c27da41bc9e8aa2c07bdd9e884d54945f2eaeb47230411f03160a09ca5f3da762df6f977fed5995a4ffe413b4bce53af
diff --git a/dev-db/slony1/files/slony1-2.1.2-ldflags.patch b/dev-db/slony1/files/slony1-2.1.2-ldflags.patch
new file mode 100644
index 000000000000..038b2ee20fb5
--- /dev/null
+++ b/dev-db/slony1/files/slony1-2.1.2-ldflags.patch
@@ -0,0 +1,17 @@
+diff -Naur a/makefiles/Makefile.linux b/makefiles/Makefile.linux
+--- a/makefiles/Makefile.linux 2012-01-25 14:13:40.000000000 -0500
++++ b/makefiles/Makefile.linux 2012-02-22 06:15:45.652523000 -0500
+@@ -12,9 +12,9 @@
+ endif
+
+ %.so: %.o
+- $(CC) -shared -o $@ $<
++ $(CC) $(LDFLAGS) -shared -o $@ $<
+
+ %.o: %.c
+- $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -o $@ $<
+
+-sqlmansect = 7
+\ No newline at end of file
++sqlmansect = 7
diff --git a/dev-db/slony1/files/slony1.conf b/dev-db/slony1/files/slony1.conf
new file mode 100644
index 000000000000..a660b0b16c40
--- /dev/null
+++ b/dev-db/slony1/files/slony1.conf
@@ -0,0 +1,11 @@
+# /etc/conf.d/slony1:
+
+# Configuration file for /etc/init.d/slony1
+
+USER=postgres
+CLUSTER=your_cluster_name
+DBUSER=postgres
+DBNAME=your_database_name
+DBHOST=localhost
+LOGFILE=/var/lib/postgresql/data/slony1.log
+LOGLEVEL=1 # 1(minimum)..4(maximum)
diff --git a/dev-db/slony1/files/slony1.init b/dev-db/slony1/files/slony1.init
new file mode 100644
index 000000000000..d85c99c733f0
--- /dev/null
+++ b/dev-db/slony1/files/slony1.init
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need postgresql
+}
+
+start() {
+ ebegin "Starting slony1"
+ /usr/bin/slon -p /var/run/slony1.pid -d $LOGLEVEL $CLUSTER "dbname=$DBNAME user=$DBUSER host=$DBHOST" >> $LOGFILE 2>&1 &
+
+ while :
+ do
+ cnt=$(($cnt + 1))
+ if [ -f "/var/run/slony1.pid" ]; then
+ ret=0
+ break
+ fi
+
+ if [ $cnt -eq 30 ]; then
+ eerror "Please see log file: $LOGFILE"
+ ret=1
+ break
+ fi
+ sleep 1
+ done
+ eend $ret
+}
+
+stop() {
+ ebegin "Stopping slony1"
+ kill `cat /var/run/slony1.pid`
+ eend $?
+}
+
diff --git a/dev-db/slony1/metadata.xml b/dev-db/slony1/metadata.xml
new file mode 100644
index 000000000000..711734ad7566
--- /dev/null
+++ b/dev-db/slony1/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pgsql-bugs@gentoo.org</email>
+ <name>PostgreSQL and Related Package Development</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/slony1/slony1-2.1.3.ebuild b/dev-db/slony1/slony1-2.1.3.ebuild
new file mode 100644
index 000000000000..24e4a2e232ba
--- /dev/null
+++ b/dev-db/slony1/slony1-2.1.3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils versionator
+
+IUSE="doc perl"
+
+DESCRIPTION="A replication system for the PostgreSQL Database Management System"
+HOMEPAGE="http://slony.info/"
+
+# ${P}-docs.tar.bz2 contains man pages as well as additional documentation
+MAJ_PV=$(get_version_component_range 1-2)
+SRC_URI="http://main.slony.info/downloads/${MAJ_PV}/source/${P}.tar.bz2
+ http://main.slony.info/downloads/${MAJ_PV}/source/${P}-docs.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+
+DEPEND="|| (
+ dev-db/postgresql:9.2[server]
+ dev-db/postgresql:9.1[server]
+ dev-db/postgresql:9.0[server]
+ )
+ dev-db/postgresql[threads]
+ perl? ( dev-perl/DBD-Pg )
+"
+
+pkg_setup() {
+ local PGSLOT="$(postgresql-config show)"
+ if [[ ${PGSLOT//.} < 83 ]] ; then
+ eerror "You must build ${CATEGORY}/${PN} against PostgreSQL 8.3 or higher."
+ eerror "Set an appropriate slot with postgresql-config."
+ die "postgresql-config not set to 8.3 or higher."
+ fi
+
+# if [[ ${PGSLOT//.} > 90 ]] ; then
+# ewarn "You are building ${CATEGORY}/${PN} against a version of PostgreSQL greater than 9.0."
+# ewarn "This is neither supported here nor upstream."
+# ewarn "Any bugs you encounter should be reported upstream."
+# fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.1.2-ldflags.patch"
+}
+
+src_configure() {
+ local myconf
+ use perl && myconf='--with-perltools'
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc HISTORY-1.1 INSTALL README SAMPLE TODO UPGRADING doc/howto/*.txt
+
+ doman "${S}"/doc/adminguide/man{1,7}/*
+
+ if use doc ; then
+ cd "${S}"/doc
+ dohtml -r *
+ fi
+
+ newinitd "${FILESDIR}"/slony1.init slony1
+ newconfd "${FILESDIR}"/slony1.conf slony1
+}
diff --git a/dev-db/slony1/slony1-2.1.4.ebuild b/dev-db/slony1/slony1-2.1.4.ebuild
new file mode 100644
index 000000000000..8106707b7c93
--- /dev/null
+++ b/dev-db/slony1/slony1-2.1.4.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils versionator
+
+IUSE="doc perl"
+
+DESCRIPTION="A replication system for the PostgreSQL Database Management System"
+HOMEPAGE="http://slony.info/"
+
+# ${P}-docs.tar.bz2 contains man pages as well as additional documentation
+MAJ_PV=$(get_version_component_range 1-2)
+SRC_URI="http://main.slony.info/downloads/${MAJ_PV}/source/${P}.tar.bz2
+ http://main.slony.info/downloads/${MAJ_PV}/source/${P}-docs.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+DEPEND="|| (
+ dev-db/postgresql:9.3[server]
+ dev-db/postgresql:9.2[server]
+ dev-db/postgresql:9.1[server]
+ dev-db/postgresql:9.0[server]
+ )
+ dev-db/postgresql[threads]
+ perl? ( dev-perl/DBD-Pg )
+"
+
+pkg_setup() {
+ local PGSLOT="$(postgresql-config show)"
+ if [[ ${PGSLOT//.} < 83 ]] ; then
+ eerror "You must build ${CATEGORY}/${PN} against PostgreSQL 8.3 or higher."
+ eerror "Set an appropriate slot with postgresql-config."
+ die "postgresql-config not set to 8.3 or higher."
+ fi
+
+# if [[ ${PGSLOT//.} > 90 ]] ; then
+# ewarn "You are building ${CATEGORY}/${PN} against a version of PostgreSQL greater than 9.0."
+# ewarn "This is neither supported here nor upstream."
+# ewarn "Any bugs you encounter should be reported upstream."
+# fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.1.2-ldflags.patch"
+}
+
+src_configure() {
+ local myconf
+ use perl && myconf='--with-perltools'
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc HISTORY-1.1 INSTALL README SAMPLE TODO UPGRADING doc/howto/*.txt
+
+ # gone:
+ #doman "${S}"/doc/adminguide/man{1,7}/*
+
+ if use doc ; then
+ cd "${S}"/doc
+ dohtml -r *
+ fi
+
+ newinitd "${FILESDIR}"/slony1.init slony1
+ newconfd "${FILESDIR}"/slony1.conf slony1
+}
diff --git a/dev-db/slony1/slony1-2.2.5-r1.ebuild b/dev-db/slony1/slony1-2.2.5-r1.ebuild
new file mode 100644
index 000000000000..a312de46f7a1
--- /dev/null
+++ b/dev-db/slony1/slony1-2.2.5-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+POSTGRES_COMPAT=( 9.{2..6} )
+POSTGRES_USEDEP="server,threads"
+
+inherit eutils postgres-multi versionator
+
+IUSE="doc perl"
+
+DESCRIPTION="A replication system for the PostgreSQL Database Management System"
+HOMEPAGE="http://slony.info/"
+
+# ${P}-docs.tar.bz2 contains man pages as well as additional documentation
+MAJ_PV=$(get_version_component_range 1-2)
+SRC_URI="http://main.slony.info/downloads/${MAJ_PV}/source/${P}.tar.bz2
+ http://main.slony.info/downloads/${MAJ_PV}/source/${P}-docs.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+DEPEND="${POSTGRES_DEP}
+ perl? ( dev-perl/DBD-Pg )
+"
+
+RDEPEND=${DEPEND}
+
+REQUIRE_USE="${POSTGRES_REQ_USE}"
+
+src_configure() {
+ local slot_bin_dir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/bin"
+ use perl && myconf=" --with-perltools=\"${slot_bin_dir}\""
+ postgres-multi_foreach econf ${myconf} \
+ --with-pgconfigdir="${slot_bin_dir}" \
+ --with-slonybindir="${slot_bin_dir}"
+}
+
+src_install() {
+ postgres-multi_foreach emake DESTDIR="${D}" install
+
+ dodoc INSTALL README SAMPLE TODO UPGRADING share/slon.conf-sample
+
+ if use doc ; then
+ cd "${S}"/doc
+ dohtml -r *
+ fi
+
+ newinitd "${FILESDIR}"/slony1.init slony1
+ newconfd "${FILESDIR}"/slony1.conf slony1
+}
+
+pkg_postinst() {
+ # Slony-I installs its executables into a directory that is
+ # processed by the PostgreSQL eselect module. Call it here so that
+ # the symlinks will be created.
+ ebegin "Refreshing PostgreSQL $(postgresql-config show) symlinks"
+ postgresql-config update
+ eend $?
+}
diff --git a/dev-db/slony1/slony1-2.2.6.ebuild b/dev-db/slony1/slony1-2.2.6.ebuild
new file mode 100644
index 000000000000..59ee59bcec1c
--- /dev/null
+++ b/dev-db/slony1/slony1-2.2.6.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+POSTGRES_COMPAT=( 9.{2..6} 10 )
+POSTGRES_USEDEP="server,threads"
+
+inherit eutils postgres-multi versionator
+
+IUSE="doc perl"
+
+DESCRIPTION="A replication system for the PostgreSQL Database Management System"
+HOMEPAGE="http://slony.info/"
+
+# ${P}-docs.tar.bz2 contains man pages as well as additional documentation
+MAJ_PV=$(get_version_component_range 1-2)
+SRC_URI="http://main.slony.info/downloads/${MAJ_PV}/source/${P}.tar.bz2
+ http://main.slony.info/downloads/${MAJ_PV}/source/${P}-docs.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+DEPEND="${POSTGRES_DEP}
+ perl? ( dev-perl/DBD-Pg )
+"
+
+RDEPEND=${DEPEND}
+
+REQUIRE_USE="${POSTGRES_REQ_USE}"
+
+src_configure() {
+ local slot_bin_dir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/bin"
+ use perl && myconf=" --with-perltools=\"${slot_bin_dir}\""
+ postgres-multi_foreach econf ${myconf} \
+ --with-pgconfigdir="${slot_bin_dir}" \
+ --with-slonybindir="${slot_bin_dir}"
+}
+
+src_install() {
+ postgres-multi_foreach emake DESTDIR="${D}" install
+
+ dodoc INSTALL README SAMPLE TODO UPGRADING share/slon.conf-sample
+
+ if use doc ; then
+ cd "${S}"/doc
+ dohtml -r *
+ fi
+
+ newinitd "${FILESDIR}"/slony1.init slony1
+ newconfd "${FILESDIR}"/slony1.conf slony1
+}
+
+pkg_postinst() {
+ # Slony-I installs its executables into a directory that is
+ # processed by the PostgreSQL eselect module. Call it here so that
+ # the symlinks will be created.
+ ebegin "Refreshing PostgreSQL $(postgresql-config show) symlinks"
+ postgresql-config update
+ eend $?
+}
diff --git a/dev-db/soci/Manifest b/dev-db/soci/Manifest
new file mode 100644
index 000000000000..6a63236a9219
--- /dev/null
+++ b/dev-db/soci/Manifest
@@ -0,0 +1,7 @@
+DIST soci-3.2.2.zip 518502 SHA256 e3ad3ea0ef37eab0ae9e6459d2cdd099b1fa1165b663c349e1200356cf4e9c91 SHA512 36fa977e8827ec546ec85be45d78bb21b2700ee7838d144e6f6ac91cc70242cbe8ce968092146e2b29d52fe1022b9287cff7465c156a49c0ffb1dde6d89964ab WHIRLPOOL e25bc0ec7ca1137db5b703635ea0066b8e93307e721c2e4efc45f0d008abff8c9b944b483dfd9c45a6361e7bd049f70570342ae4ea0e0594f9d0914268d00873
+DIST soci-3.2.3.zip 508929 SHA256 ab0f82873b0c5620e0e8eb2ff89abad6517571fd63bae4bdcac64dd767ac9a05 SHA512 dd9b7eaf535502e3230eada4d4d019963d2c9cf59b69fff5d466b4fc00976fa08f7b0199a0e4564a0395d0d30095b97aa1d613dfbaa329feb077ece3b0efacdf WHIRLPOOL ce4316de7228ba44a7440fe2e90c6252f5d5780b6826bd1b41cce7fe471551bb454d4658c3b07813050d36ec17886c6f583e1d531ee63c671d648bccfc63b1b1
+EBUILD soci-3.2.2.ebuild 1234 SHA256 88a8779ec13757ba24c1644a51f800fbb66973370f8a272acfbf378dc7a90085 SHA512 0e7eee3a2fd94d6d9a0042ee734d9c57586bde432b65ae75a2d986cdd42e7d589524b4d0a99d250a055eb02f50af1028e199dd8286ad119f58c714a2f8bfb3b6 WHIRLPOOL 00f42ea30920be35ea43670f31bb4e962d3207d8385cbff6c569127c1fef3ec5e84bb4a5a1d05b4f914767523e9c5312e71ce7552fcfefbca491640f2a62660e
+EBUILD soci-3.2.3.ebuild 1234 SHA256 88a8779ec13757ba24c1644a51f800fbb66973370f8a272acfbf378dc7a90085 SHA512 0e7eee3a2fd94d6d9a0042ee734d9c57586bde432b65ae75a2d986cdd42e7d589524b4d0a99d250a055eb02f50af1028e199dd8286ad119f58c714a2f8bfb3b6 WHIRLPOOL 00f42ea30920be35ea43670f31bb4e962d3207d8385cbff6c569127c1fef3ec5e84bb4a5a1d05b4f914767523e9c5312e71ce7552fcfefbca491640f2a62660e
+MISC ChangeLog 2332 SHA256 9432949c5cd2f1e585959a27fdd606caeac47127f80d6f7740a5f7ad3b34a32a SHA512 7dc51470f0b81bc837266cace107ca4e86a89acfafece4b597ea2d9235bf3877dad2f8181cf9e70fb9bdd0bcbc590dbf207fe98b733f6d3ebf437e97fe0aafe8 WHIRLPOOL 0cf6ed150b5f59a944602a72feca3c82bd346b93cf032116e99290996db314354493fdd45d51d18e4222eb5104274a8bea7c04eedd6cfa97db8ecd6e8874d63e
+MISC ChangeLog-2015 843 SHA256 15fdd5dd62ff471bb043dd335d7a796d6f4a4c1e07ef35fb67e0c7441a52d908 SHA512 3ec885ab044b079bb17448b48b50a4f7bb4d04b89e1d41475823ee8ba30ef8a46ecc749743710f97351204227e4ff576780e4ecc697399dfcd949f2303975678 WHIRLPOOL 6f75c9df347fbad02490fd13be2d57e52413c9d446144972bf104c497dbbf9193286c91dded3a6fbf3c84c975204148d58440d51867e1b9cc8e0d33f89d75fc1
+MISC metadata.xml 343 SHA256 e028778dce2d25da1ef0696024408125730aff49e073492d8fd140eb480b2f45 SHA512 a3441b5c5f7127af874a08bc9e05dd95f1594167906383c44fcfb9620e52fdabdd90b23c2cbc6f082699150b1593b4600f7a9eae54c799f501b95ca9022d83c7 WHIRLPOOL 55a5af1906c47bb26215b4fb5156c6073937e7ff09db04629eb8cee9bac94a2ff70281e4b62af4209b8c03640f5d1e76faf44d2e9c964571ebd3e009beb7af1f
diff --git a/dev-db/soci/metadata.xml b/dev-db/soci/metadata.xml
new file mode 100644
index 000000000000..3f843d86929c
--- /dev/null
+++ b/dev-db/soci/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="boost">Enable boost support</flag>
+ <flag name="empty">Build the sample backend called Empty</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">soci</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/soci/soci-3.2.2.ebuild b/dev-db/soci/soci-3.2.2.ebuild
new file mode 100644
index 000000000000..390012ef0f71
--- /dev/null
+++ b/dev-db/soci/soci-3.2.2.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="Makes the illusion of embedding SQL queries in the regular C++ code"
+HOMEPAGE="http://soci.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.zip"
+LICENSE="Boost-1.0"
+SLOT="0"
+IUSE="boost doc +empty firebird mysql odbc oracle postgres sqlite"
+
+DEPEND="boost? ( dev-libs/boost )
+ firebird? ( dev-db/firebird )
+ mysql? ( virtual/mysql )
+ odbc? ( dev-db/unixODBC )
+ oracle? ( dev-db/oracle-instantclient-basic )
+ postgres? ( dev-db/postgresql:= )
+ sqlite? ( dev-db/sqlite:3 )
+"
+RDEPEND=${DEPEND}
+
+src_configure() {
+ local mycmakeargs="$(cmake-utils_use_with boost )
+ $(cmake-utils_use empty SOCI_EMPTY)
+ $(cmake-utils_use_with firebird FIREBIRD)
+ $(cmake-utils_use_with mysql MYSQL)
+ $(cmake-utils_use_with odbc ODBC)
+ $(cmake-utils_use_with oracle ORACLE)
+ $(cmake-utils_use_with postgres POSTGRESQL)
+ $(cmake-utils_use_with sqlite SQLITE3)
+ -DWITH_DB2=OFF" #use MYCMAKEARGS if you want enable IBM DB2 support
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc AUTHORS CHANGES
+ if use doc; then
+ dohtml -r doc/*
+ fi
+}
diff --git a/dev-db/soci/soci-3.2.3.ebuild b/dev-db/soci/soci-3.2.3.ebuild
new file mode 100644
index 000000000000..390012ef0f71
--- /dev/null
+++ b/dev-db/soci/soci-3.2.3.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils
+
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="Makes the illusion of embedding SQL queries in the regular C++ code"
+HOMEPAGE="http://soci.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.zip"
+LICENSE="Boost-1.0"
+SLOT="0"
+IUSE="boost doc +empty firebird mysql odbc oracle postgres sqlite"
+
+DEPEND="boost? ( dev-libs/boost )
+ firebird? ( dev-db/firebird )
+ mysql? ( virtual/mysql )
+ odbc? ( dev-db/unixODBC )
+ oracle? ( dev-db/oracle-instantclient-basic )
+ postgres? ( dev-db/postgresql:= )
+ sqlite? ( dev-db/sqlite:3 )
+"
+RDEPEND=${DEPEND}
+
+src_configure() {
+ local mycmakeargs="$(cmake-utils_use_with boost )
+ $(cmake-utils_use empty SOCI_EMPTY)
+ $(cmake-utils_use_with firebird FIREBIRD)
+ $(cmake-utils_use_with mysql MYSQL)
+ $(cmake-utils_use_with odbc ODBC)
+ $(cmake-utils_use_with oracle ORACLE)
+ $(cmake-utils_use_with postgres POSTGRESQL)
+ $(cmake-utils_use_with sqlite SQLITE3)
+ -DWITH_DB2=OFF" #use MYCMAKEARGS if you want enable IBM DB2 support
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc AUTHORS CHANGES
+ if use doc; then
+ dohtml -r doc/*
+ fi
+}
diff --git a/dev-db/spatialite-tools/Manifest b/dev-db/spatialite-tools/Manifest
new file mode 100644
index 000000000000..f86e62297bed
--- /dev/null
+++ b/dev-db/spatialite-tools/Manifest
@@ -0,0 +1,5 @@
+DIST spatialite-tools-4.3.0.tar.gz 540811 SHA256 f739859bc04f38735591be2f75009b98a2359033675ae310dffc3114a17ccf89 SHA512 e1de27c1c65ff2ff0b08583113517bea74edf33fff59ad6e9c77492ea3ae87d9c0f17d7670ee6602b32eea73ad3678bb5410ef2c6fac6e213bf2e341a907db88 WHIRLPOOL 24414efc61454bdde4fde4120503b9568821af20ced44cfae88696e099a7778f4311d556da7c48d6c13785eca9caa436dcd2d0666e371b12470b74b7fe77dbcc
+EBUILD spatialite-tools-4.3.0-r1.ebuild 666 SHA256 140108c37b7a82270c2713a625c15952db6d09fbab733304274ee0e54847d9fe SHA512 20ceb663ce052d6955229d7667e23d0674f5edffa62b73bdba8b24b051f97f0e989826d9d0c9320f7f7edd564b5c6c416e5cb5beb3cdbc58ca71561ba90c131c WHIRLPOOL ff844839239d102791a2f027cf40e417975c961509ab2c73e5e73e0cac1cb9e22d45d2f2a55ff1ddd53bd20ed4e24bb4eced5550a7bef30ec02ea440c7d0ec65
+MISC ChangeLog 2620 SHA256 3e0a35896929a9b05c872341e7f8eeccc68381e48c70b766a7a1687a10a8f580 SHA512 acbca674e7b3d8f8e6f649eebd489e7eeb1a4b5844b024d772aa92d66fd1660c2c7fa3a6401d27fea81c6735896b97a020fde5959512f4c14e431a0567078b45 WHIRLPOOL 733182606898fbcfb0ffca2750aef787802a3076300a578ee9a758704247c31d3399bfb780e978172d90e44c91c4167b00058d8568b6c71073ef1c0bb69c0f14
+MISC ChangeLog-2015 437 SHA256 05302fbf0e67f0af43edb3f722e1a6e3ffd2974542439003a63b726c9cc6d280 SHA512 d359375c5290ff14cee50ed920853a1acfa45be1fbeab6d86c4bb713572f71070b9bd8592edf630adaa8d9b2b227ac05b802f1498088924aeca45e0961492f50 WHIRLPOOL 2559ab206653c71812dafba614b5c6f382825af5b88a720aaf839703c5b2416fdac802df87cefb11f0dc636f327bab989165b8dd1bdefaf8d6bd4d48fb8cd025
+MISC metadata.xml 269 SHA256 40cab114263d43c3b93b822066d1871574ffb54eb88971fe3ba2f978de6683df SHA512 9877d09d42c801d752617b41c7fb790db8e10c033c02ee9fe9a04fa1c6a8ea06d3baeb4f81d041b57e883d5d9dadb429289faae90d0293c62334ba35549e0276 WHIRLPOOL 4ab6badc6e62443d13b8f13341e48263abd3f6907a32dfa263470528c1eb445fb4ec79ad7f9979177846c0a3a39dcafa27dff466fd283946da5c8bc1872b9218
diff --git a/dev-db/spatialite-tools/metadata.xml b/dev-db/spatialite-tools/metadata.xml
new file mode 100644
index 000000000000..2761b1b9e5c0
--- /dev/null
+++ b/dev-db/spatialite-tools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-geosciences@gentoo.org</email>
+ <name>Gentoo Geosciences Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/spatialite-tools/spatialite-tools-4.3.0-r1.ebuild b/dev-db/spatialite-tools/spatialite-tools-4.3.0-r1.ebuild
new file mode 100644
index 000000000000..a4a242e63a90
--- /dev/null
+++ b/dev-db/spatialite-tools/spatialite-tools-4.3.0-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="A collection of CLI tools supporting SpatiaLite"
+HOMEPAGE="https://www.gaia-gis.it/spatialite"
+SRC_URI="https://www.gaia-gis.it/gaia-sins/${PN}-sources/${P}.tar.gz"
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="readline"
+
+RDEPEND="
+ dev-db/sqlite:3[extensions(+)]
+ >=dev-db/spatialite-3.0.1[geos,xls]
+ dev-libs/expat
+ dev-libs/libxml2
+ sci-geosciences/readosm
+ sci-libs/geos
+ sci-libs/proj
+ readline? (
+ sys-libs/ncurses:=
+ sys-libs/readline:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf \
+ $(use_enable readline)
+}
diff --git a/dev-db/spatialite/Manifest b/dev-db/spatialite/Manifest
new file mode 100644
index 000000000000..48470ea61340
--- /dev/null
+++ b/dev-db/spatialite/Manifest
@@ -0,0 +1,7 @@
+DIST libspatialite-4.3.0.tar.gz 4439538 SHA256 4acf2d2b891989e61351584fe28514a6561f8f6a1901b988990513be5fe1bdfe SHA512 b686766ed90711a41efbf219a8942ead8aefda8784a9cabc59233f107e0e10eda949d022152af1064a169975aa6a47515f6064589166418b853427dde5779ecc WHIRLPOOL ecb98596eae3468423de9921cc304c7299806d911be2bc10efdd38bb1d557cc6a5e70ad96e2268887b443879ca49fabd1b3ed747e440b464ac7f798f0ab2ae7c
+DIST libspatialite-4.3.0a.tar.gz 4440660 SHA256 88900030a4762904a7880273f292e5e8ca6b15b7c6c3fb88ffa9e67ee8a5a499 SHA512 adfd63e8dde0f370b07e4e7bb557647d2bfb5549205b60bdcaaca69ff81298a3d885e7c1ca515ef56dd0aca152ae940df8b5dbcb65bb61ae0a9337499895c3c0 WHIRLPOOL 4d591b604d7f31a1cd52dbb8f375da0487404ec8f5bc4a38de8436134a126fae1028a0aef872cfd4ba6ce8a69aa1d4924768b2ceeed75a67999df4b3ddd4bda3
+EBUILD spatialite-4.3.0-r1.ebuild 1057 SHA256 002eccae955c2b48e5fad2a05a921877ad4205ed6a4ef279d5a20c5089820b94 SHA512 6507bf86455097d9eef6a3b4e67066c02a6037ec37b7536b7c712c29e5d48e28e6fbb55600843bae38c5ab079d015784d20ad5a402e9f621a16f57a8d28da30f WHIRLPOOL 8ff90384968cbc0fee5d5b14d5e5ade19e24fbad3eca30c62919f1d4740995396984464c534c06a1427eb404976c69a5e385157a96c2fbb273a49a34d3e5c343
+EBUILD spatialite-4.3.0a.ebuild 1072 SHA256 cb60df707512aa7c9001486503c756cb289f20f9bd15a08a01cac7311aad5326 SHA512 1c63596e1101681677dfb36866f1e6135520cc6687243383d3c5b859d85bb899ea6ee0729a98448c7a8d8e882a79739c4b5cf235edead99ddc75d2336d47c90e WHIRLPOOL b0358dbb7211fed85f0655c99e71e357087e4ebb0528461fd402bf88b27df30307c8cc71ad4354c2f220910e3a4ac959c46d1655885d6c7ccac2eddd8a6592c7
+MISC ChangeLog 3692 SHA256 d2c35a4db8ed81945e2374644799725214751d9a79196023d23a53fe57ca1db1 SHA512 ed23254d71972debd35fed3083be9b3832703aac3969ea8fb79cfc41a0b5e723b68c15bb86be1cae362448edf163178bcc270247d06db02796996bccace23fa1 WHIRLPOOL d8bb021a2f23749829ce37b49010a2bbbabbbb9537ea5277fd4d20e3167a6ae20bed3b260529b481174cbe55e436e707ccb5d2a82d0b4df217e35c0fdf0f364e
+MISC ChangeLog-2015 1316 SHA256 ba552e5d81ad497f037c9f5c494eae8de77fb0fc4193d4c4176ac6c17c6bcff2 SHA512 75168f26d03b5c782df0fe177629817f99961d2c1a30851f26d56654bd807e239baf44100d6ad3004ebc9aa8fb358756718d11aa0dac9c4b588aef91938da39c WHIRLPOOL 12b42a17ec5a70b4ae5dedfcb7c3e018c2a1e26dbaae9dc56d235be439133078d96123299c316698687c1222600cd8491466b9270752fc8d4c71ddde62a974d1
+MISC metadata.xml 559 SHA256 aef066dc7ac68a2b383623a68d8c6d8fa107bb41a26e8a74a6dcd85c6b98c2d5 SHA512 a21438d83d828b52e4fc16f91edd29e6ace87ada9b697cf233b847a6d3a9f5196135769993873f23409f98548bf852a4e89645c2b0eaf57bd8427ff6dcc36111 WHIRLPOOL 2d4f9fabd1e11427bf98de97d361c4b9e6deff9c5442277b7b6bb1b6086c1fe286bafc8603109427aef7ed93bc23101deede5f57f9affd00f2c6bd3fea07661e
diff --git a/dev-db/spatialite/metadata.xml b/dev-db/spatialite/metadata.xml
new file mode 100644
index 000000000000..f3d7fe3cbb04
--- /dev/null
+++ b/dev-db/spatialite/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-geosciences@gentoo.org</email>
+ <name>Gentoo Geosciences Project</name>
+ </maintainer>
+<use>
+ <flag name="geos">Add the <pkg>sci-libs/geos</pkg> library for exact topological tests</flag>
+ <flag name="proj">Add the <pkg>sci-libs/proj</pkg> library for reprojection features</flag>
+ <flag name="xls">Add the <pkg>dev-libs/freexl</pkg> library for xls import support</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-db/spatialite/spatialite-4.3.0-r1.ebuild b/dev-db/spatialite/spatialite-4.3.0-r1.ebuild
new file mode 100644
index 000000000000..9adfb477cd11
--- /dev/null
+++ b/dev-db/spatialite/spatialite-4.3.0-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN="lib${PN}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A complete Spatial DBMS in a nutshell built upon sqlite"
+HOMEPAGE="https://www.gaia-gis.it/gaia-sins/"
+SRC_URI="https://www.gaia-gis.it/gaia-sins/${MY_PN}-sources/${MY_P}.tar.gz"
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86"
+IUSE="+geos iconv +proj test +xls +xml"
+
+RDEPEND="
+ >=dev-db/sqlite-3.7.5:3[extensions(+)]
+ sys-libs/zlib
+ geos? ( >=sci-libs/geos-3.4 )
+ proj? ( sci-libs/proj )
+ xls? ( dev-libs/freexl )
+ xml? ( dev-libs/libxml2 )
+"
+DEPEND="${RDEPEND}"
+
+REQUIRED_USE="test? ( iconv )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_configure() {
+ econf \
+ --disable-examples \
+ --disable-static \
+ --enable-epsg \
+ --enable-geocallbacks \
+ $(use_enable geos) \
+ $(use_enable geos geosadvanced) \
+ $(use_enable iconv) \
+ $(use_enable proj) \
+ $(use_enable xls freexl) \
+ $(use_enable xml libxml2)
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/dev-db/spatialite/spatialite-4.3.0a.ebuild b/dev-db/spatialite/spatialite-4.3.0a.ebuild
new file mode 100644
index 000000000000..d822e5ce055d
--- /dev/null
+++ b/dev-db/spatialite/spatialite-4.3.0a.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN="lib${PN}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A complete Spatial DBMS in a nutshell built upon sqlite"
+HOMEPAGE="https://www.gaia-gis.it/gaia-sins/"
+SRC_URI="https://www.gaia-gis.it/gaia-sins/${MY_PN}-sources/${MY_P}.tar.gz"
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
+IUSE="+geos iconv +proj test +xls +xml"
+
+RDEPEND="
+ >=dev-db/sqlite-3.7.5:3[extensions(+)]
+ sys-libs/zlib
+ geos? ( >=sci-libs/geos-3.4 )
+ proj? ( sci-libs/proj )
+ xls? ( dev-libs/freexl )
+ xml? ( dev-libs/libxml2 )
+"
+DEPEND="${RDEPEND}"
+
+REQUIRED_USE="test? ( iconv )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_configure() {
+ econf \
+ --disable-examples \
+ --disable-static \
+ --enable-epsg \
+ --enable-geocallbacks \
+ $(use_enable geos) \
+ $(use_enable geos geosadvanced) \
+ $(use_enable iconv) \
+ $(use_enable proj) \
+ $(use_enable xls freexl) \
+ $(use_enable xml libxml2)
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/dev-db/sqlcipher/Manifest b/dev-db/sqlcipher/Manifest
new file mode 100644
index 000000000000..4031db927713
--- /dev/null
+++ b/dev-db/sqlcipher/Manifest
@@ -0,0 +1,6 @@
+AUX sqlcipher-3.4.1-libressl.patch 450 SHA256 73f8b18af14335dfd57ba99ea2a23df5f7ace6c02e5933676f10b76da5e3c099 SHA512 ceb74cfb4b2dd3dae16bcb0ac53ed2746f59d88811a81b5099c6fbac71ccc83ccde08642d25eed5ae8229a672f74baa5a28221ae071a32836bb3e2f2fedfbad4 WHIRLPOOL 6889beb83c7ea686338c6185f649874ee269e8bb89a0155558a48aa1e7e15cda526537ad5c0b5c1a8e8bee7798a25179df9f141d08799fdfad70d95ac18a055f
+DIST sqlcipher-3.4.1.tar.gz 13873645 SHA256 4172cc6e5a79d36e178d36bd5cc467a938e08368952659bcd95eccbaf0fa4ad4 SHA512 1c08ccdf438c0de23b1293192c687cb869db1ea904c47da5643c69f3a21f3f6a801fe8e87eb2e660acf0fe977b1f05bf8801b79162c609ffa3711706392c642b WHIRLPOOL 4098712a08ff852521f649e9d3abbb1f5d7a4b4f58fe9cef5495ac75bf993a64ddd04ede6f46c2fbdd823b71315e165bf20d70018993192d2844dcc5ed76f037
+EBUILD sqlcipher-3.4.1.ebuild 1292 SHA256 247d9b0403cb792c1c562eda6658153e9afe60114571ab3a7fbde85d2c46cdf8 SHA512 9e3b046b8d46e6bce55403b5166de1f86131b8bc2c713581c78c4c5602af8f9a9a89df9d8b48b58698176481ab93ce062f54a5b73e914027648f411633f97ca6 WHIRLPOOL 2dff46277d61cdf08adef34e44bf043ac93298b601066b0c9d149e33bf3484005472f48381c09a4f3622f8f2df0d2936053bb1e3f15c07f0f7435a1ddb656b25
+MISC ChangeLog 3303 SHA256 ca1fed110d6d3533c9ba4cabfb944f61bd77376678acdd498ec992a2995c00ff SHA512 ad824a603e391dd222f90c4bd914831168e1ce04a04b2bcf392bc9f0e5fff8c8af39b5c1ff1e061dafbdf61d0e99961cdc166b97d823af9814806ec841dfff47 WHIRLPOOL 3edc31b08cff0ccbdd3c3186f5e3a41886cd7e44761c4c7d3533f59cabc21da695500dba65e9282c9826c9df2a5c8ff262a24d16eed19a1580e402c157569477
+MISC ChangeLog-2015 461 SHA256 578d8843f8f55f30aff6f251842f7bed4ffb9d18a0cb29c2f9760853554e2048 SHA512 b78d5725ffa1650432449c589e8f83069f083820c12302b24b2e8b887ae520ebadeddf201f96a690b04fac03b562d234ebcdcbf76d94e1f703cd61bd06796544 WHIRLPOOL c7901507ed4911e05d75233781eb2f42176dc3e03081a7057136d67bf24e7e25ec7692c8eb63be2def907a4980742dceb70771a8505fbe1f63390756f837c03a
+MISC metadata.xml 341 SHA256 d3d590bffb97239d4199ef2c39400da6d4bfafcda0b86d69cd850ddcbb727a40 SHA512 b387658993279fb3c74c7647b36035f5c0e0e3e81a3cf4eab28f3dac19319f0b6958cfa16fab30295e5508c0810d601b0e2899710f57e992886f35c781e37dfa WHIRLPOOL 92b45938556062eca687b1ca6fb2d1379dcaa40bd58fa5cecb88a8043d58e82b3751b39c7c08ae851347f898c48c437d3b5845d9969912163ca56d3bdf731b3d
diff --git a/dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch b/dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch
new file mode 100644
index 000000000000..f12f1284514d
--- /dev/null
+++ b/dev-db/sqlcipher/files/sqlcipher-3.4.1-libressl.patch
@@ -0,0 +1,11 @@
+--- a/src/crypto_openssl.c 2017-07-06 08:11:21.560000000 +0300
++++ b/src/crypto_openssl.c 2017-07-06 08:11:32.180000000 +0300
+@@ -46,7 +46,7 @@
+ static unsigned int openssl_init_count = 0;
+ static sqlite3_mutex* openssl_rand_mutex = NULL;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ static HMAC_CTX *HMAC_CTX_new(void)
+ {
+ HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
diff --git a/dev-db/sqlcipher/metadata.xml b/dev-db/sqlcipher/metadata.xml
new file mode 100644
index 000000000000..97d08dafb28d
--- /dev/null
+++ b/dev-db/sqlcipher/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">sqlcipher/sqlcipher</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/sqlcipher/sqlcipher-3.4.1.ebuild b/dev-db/sqlcipher/sqlcipher-3.4.1.ebuild
new file mode 100644
index 000000000000..d75de25de377
--- /dev/null
+++ b/dev-db/sqlcipher/sqlcipher-3.4.1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic multilib-minimal
+
+DESCRIPTION="Full Database Encryption for SQLite"
+HOMEPAGE="https://www.zetetic.net/sqlcipher/"
+SRC_URI="https://github.com/sqlcipher/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+IUSE="readline libressl static-libs tcl test"
+
+# Tcl is always needed by buildsystem
+RDEPEND="
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+ dev-lang/tcl:*"
+
+# Testsuite requires compilation with TCL, bug #582584
+REQUIRED_USE="test? ( tcl )"
+
+DOCS=( README.md )
+
+src_prepare() {
+ append-cflags -DSQLITE_HAS_CODEC
+
+ # bug #622114
+ epatch "${FILESDIR}/${P}-libressl.patch"
+
+ eapply_user
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fts3 \
+ --enable-fts4 \
+ --enable-fts5 \
+ --enable-json1 \
+ --enable-tempstore \
+ $(use_enable readline) \
+ $(use_enable static-libs static) \
+ $(use_enable tcl)
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+ einstalldocs
+}
diff --git a/dev-db/sqlcl-bin/Manifest b/dev-db/sqlcl-bin/Manifest
new file mode 100644
index 000000000000..54b6c68eb5cd
--- /dev/null
+++ b/dev-db/sqlcl-bin/Manifest
@@ -0,0 +1,3 @@
+DIST sqlcl-17.2.0.184.1230-no-jre.zip 19805375 SHA256 62ec4348dc44cda1b4622617159a4f9fd7a29fe79864af26fc97555d6093fc23 SHA512 b57fdf46859a92cbecc53c9306d45a30c0fa8dfaaf3d9ecea7611a5344d6a6679b4dbf77c2171fe420c9473f2c55a2a659a0fbbfc07649b7a973d45212914134 WHIRLPOOL 8bde627c6e3474e7a8bd6bd22cc1081866caccdd6ffe3726aeaa5d33735334c04975f632738da1b4c195c9cbbb9eb9909e98f4927bc9aa6fbc3348637a3075db
+EBUILD sqlcl-bin-17.2.0.184.1230.ebuild 1107 SHA256 e0b859beb49ae2c4f438361ade3c4c3be7bde5e4c879e41bb236df55b23866aa SHA512 adf1788e0125a26caddacd7903d583272d1c6b6746a588bc8bcc76aeb7328c30985c309c339279bfe79cd2073e635ec3afb0d55d42fe69d3158af53140def9cf WHIRLPOOL 19cfab2d6a708b36e15f77af80613deb3c50df9ff9249cc6db356b0cd55f3d4537dd4ebf096e3bcbe8e1f6418a736432570aac1b11067e224e50e81ed1da3e7b
+MISC metadata.xml 483 SHA256 3189925dafcaf3b34f724d664336faf0aa62d7631130d1a567e06d853e21b80e SHA512 e88ad9fd8c20d5be5569c64544c3f4dd72eb3243d46333c30aaa1b939eb6ce35855aa3e771008b2fff990de5b2e5bf79ca378714e3cf7dc375144b7cd8f5649c WHIRLPOOL cf4cb60c0bef411a744dc35f3405ecf169c30b44320dd87828ea20e832a647e6ae4758ab6780fa20f3704b805e2dac41adc3a83aae524a7d728e853b624bc0af
diff --git a/dev-db/sqlcl-bin/metadata.xml b/dev-db/sqlcl-bin/metadata.xml
new file mode 100644
index 000000000000..0a47874eaf48
--- /dev/null
+++ b/dev-db/sqlcl-bin/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>fedeliallalinea@gmail.com</email>
+ <name>Marco Genasci</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>mudler@gentoo.org</email>
+ <name>Ettore Di Giacinto</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/sqlcl-bin/sqlcl-bin-17.2.0.184.1230.ebuild b/dev-db/sqlcl-bin/sqlcl-bin-17.2.0.184.1230.ebuild
new file mode 100644
index 000000000000..2da7c12ea1eb
--- /dev/null
+++ b/dev-db/sqlcl-bin/sqlcl-bin-17.2.0.184.1230.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN="${PN/-bin}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Oracle SQLcl is the new SQL*Plus"
+HOMEPAGE="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html"
+SRC_URI="${MY_P}-no-jre.zip"
+RESTRICT="bindist fetch mirror"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=""
+RDEPEND="virtual/jre:1.8
+ dev-java/java-config:2
+ dev-db/oracle-instantclient"
+
+S="${WORKDIR}"
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE}"
+ eerror "and download"
+ eerror " Command Line - SQLcl"
+ eerror " ${SRC_URI}"
+ eerror "and move it to DISTDIR directory."
+}
+
+src_prepare() {
+ default
+ find ./ \( -iname "*.bat" -or -iname "*.exe" \) -exec rm {} + || die "remove files failed"
+ mv sqlcl/bin/sql sqlcl/bin/"${MY_PN}" || die "rename executable failed"
+}
+
+src_install() {
+ exeinto "/opt/${MY_PN}/bin/"
+ doexe "${S}/${MY_PN}/bin/${MY_PN}"
+
+ insinto "/opt/${MY_PN}/lib/"
+ doins -r "${S}/${MY_PN}/lib/"*
+
+ dosym "${ED%/}/opt/${MY_PN}/bin/${MY_PN}" "/opt/bin/${MY_PN}"
+}
diff --git a/dev-db/sqldeveloper/Manifest b/dev-db/sqldeveloper/Manifest
new file mode 100644
index 000000000000..7fd5932992ac
--- /dev/null
+++ b/dev-db/sqldeveloper/Manifest
@@ -0,0 +1,13 @@
+AUX sqldeveloper 325 SHA256 1faae16f299116961c0d43290a8a421e7350df9ba18ce4accf051444e8916802 SHA512 ab1d70c5b693efe5e6270d7fcd0ba7ef30852ed98fe88a1853c5b415178c51bbb754a4da6964b5e57e87c38015cc90ac2fc04b7aa121b660300434523457bad2 WHIRLPOOL 2e28dd068077a82516cc17a8ef66d9e862f54ea31b0bd057147d37c04149555698a6ae61f0b7230c662cd5ba4f7d6fbf949250cc7bfe67477f054f77482dab85
+AUX sqldeveloper-r1 407 SHA256 65b1498f771bf5c684dd11be096b57b91189f6dd46fe8cdd25866ad55394347f SHA512 cf089f58c9de3677dbaa7b0c4bdd81e234bffac4c25f5a433c7854068ca33b5a4165d8a5d24188890d5d8c60c209adee5267a255505b978a5a7f73646fd1dfbe WHIRLPOOL f1efc909451c27e08bfa96dd6ce869bbe9f8de40dea4ce4e8e0dd6e9f06398322fcc84f827f75fc32256dc6aa6bce668d006db3274560166ed2ac213b8a6a112
+DIST sqldeveloper-4.0.2.15.21-no-jre.zip 235443867 SHA256 b23aca1d256002cdc19a0b3136ae13ebf9064feacc45a131be229a88fe9faed7 SHA512 e67b0f3d127adbc6cb77b3eb822834a6c41be7039c54eceb85e8c882704684a02dd036f078408192ad2cbcb963dfb0ba583e99a9f7b7db36b1e9a1f96e555880 WHIRLPOOL 31b32713f116193036dc5dd9b63c9b6c321763e2273227c51d70bd3db93575e4f12150a045f8615fb6086ee1d464af4d112be5824f9bf22b4f5917ae5a15b724
+DIST sqldeveloper-4.1.3.20.78-no-jre.zip 331401110 SHA256 10caec7183f4075033598faf272d2be82207261442abf3bc3bd899246968b8de SHA512 828a751bc9df7bdc59f9b89b317189826e328671d081df24d39a102aeefaf5a0a56e01e066802da1ee92617bf1fdb77ad598b448043dd7f4239f2103efb4427b WHIRLPOOL 8eee4fbc34617f721893ab880be9c7c27ac8d5378491ba97bcd0084660ad500e2c0e4812ea5b25f8cd907e2c689168af08bbccfdc0b51f04cc0d74bf0760e009
+DIST sqldeveloper-4.1.5.21.78-no-jre.zip 349775471 SHA256 1b6a5ea4f12306eaa41e4ad961d2cae4e4ccbdcb4b89d85f3d8f88a883f06967 SHA512 06535a2d60ce140fa08cf937e9bb38d0a8ecefcb1b68675b547d4682c2e514ba62121e4363cf655c10de149e39a5e7d1d4a61c8cf79d7388b2998bf9b0098601 WHIRLPOOL ceb60934100a9184c734d2d07bdde752a384f807934186f54618479de6af19a114a879edee52214bce71509e4b2a22dca8fa988f4f91202d29bceaaf8cbe67e9
+DIST sqldeveloper-4.2.0.17.089.1709-no-jre.zip 348604841 SHA256 866042c85f66ef022c256d726b4e2e0e8014be7b41346cfd84a56fe677d78b6a SHA512 4d1e270376ae125a60146228e35fcb2cb615d593c0e9f2ca98e4deef4d8fd1ddff59cf15064d63e33e77125f49e8da9fe317ed1fd96a9b00a699bf6c5e739874 WHIRLPOOL 695130acfed58678d92521cc86a6b6aaa51d400c6bec61b6e95eecb156cc4925483a2f687b2b942fb88dfbc7440a02d0444a9a4d242258ebad605a5fa589afbf
+EBUILD sqldeveloper-4.0.2.15.21.ebuild 2996 SHA256 58a8599590441980039fe0d079aa10e2551a80bd1c37aa5e95ce2e09ca92b70b SHA512 3bc5b623272f8da7b2d3af934bd3a767aab54145a76693b1f3cf57d30da80e0ce986ce4068a7bbae57c01c59ec0e992e35dc14303d5b07dc8101c078afbb859f WHIRLPOOL 63026e1a18d1ade76a65049bb4f40c78f3b52235343c322e8e23d71c4af72a863b3fe1697337be692a7a0e2e287aef92aee64b388664b45c1ee5392288c59e84
+EBUILD sqldeveloper-4.1.3.20.78-r1.ebuild 3192 SHA256 8113af77ebc5585b0b8b52a1841273a8fe396973abd2d169f534e3c8eb84bafc SHA512 6eb54e872d31ede49c537c625590d4be515a2d33b63027b71756709731eb2d9ceff6665dc5b31bf51f62a72bb13e174a3ef0306981790f69438cb1c8fec075e0 WHIRLPOOL 63786b1a850485ebd392220e2dac889d4c7571a811a4576dba3be480f06a25dc6d025014d7bab20a2fa93f35927d20c54ce0cb2e13c3e7ed0b3293a14e560cbd
+EBUILD sqldeveloper-4.1.5.21.78.ebuild 3192 SHA256 8113af77ebc5585b0b8b52a1841273a8fe396973abd2d169f534e3c8eb84bafc SHA512 6eb54e872d31ede49c537c625590d4be515a2d33b63027b71756709731eb2d9ceff6665dc5b31bf51f62a72bb13e174a3ef0306981790f69438cb1c8fec075e0 WHIRLPOOL 63786b1a850485ebd392220e2dac889d4c7571a811a4576dba3be480f06a25dc6d025014d7bab20a2fa93f35927d20c54ce0cb2e13c3e7ed0b3293a14e560cbd
+EBUILD sqldeveloper-4.2.0.17.089.1709.ebuild 3192 SHA256 6b5051c6b0420c8d6c227909269f570e472eb6cc80a51f6775087298ec5a4866 SHA512 f02536d56f568087603004f6b84d936834fb0257f9d523c4901c82b95bd0a120722f3eac6fc86547d66615b99537d55f3c262b8fb3d62735d14af39ca3528b5e WHIRLPOOL b7ef45a7aae495cf4059f434814209f12e8c91235925435bdab254f0b8a1f210c0b0b23e5b6cc388478a544af420524686a7f7b07e69974927516af17c4c5f55
+MISC ChangeLog 4534 SHA256 0af812348097d1f9d22f135899c1652050f5906b890a7e1cf19cbf1629f900ec SHA512 2fa1a4434d516c0452ae56ec5918f80c17f1cbf7f48f0d7750f6a6b9e54dda4dd6f363f907fa5ee1065e2aa6a31851d2f583fea6c4bedd471394caf249e36478 WHIRLPOOL 93a38a6cccbde04ab3e0d43fa6f721980de8b4f1c87c72b08e1f18f2751f7d973d4a5635babd59677078dea56165fd90795327f7eb1054adbc73c721d033280a
+MISC ChangeLog-2015 3979 SHA256 babdbc8e323a8fbd7e166fad4c690eaeca030abb01ecc5e7a9d5b1391c227cc9 SHA512 423839b6bf4e049325aa4501bfe1bace7bb53734eb4c876ec0f3bfec4d5bac404709d37291222c35614295600deb76e2a01a33b60ab11e8eac40f70f5f53bcdc WHIRLPOOL 67578f4ffee61f06996744e04caf72f6911bf3157ca6e5062f7148e7c72c4ac7d1e207dbcc1c98abed9fa51e8cebde85b97265321c9418104763fd9ec58cb2d1
+MISC metadata.xml 285 SHA256 502e8aa7a56636b1b50665927305856511de54be9d9d44d5c78408a308628c5c SHA512 ba5e57afca4a2ba90676c7b773775f6e64be1143d79f7fc14b7e15cdb51d2bdaaa52c84ef133f6cea770d9074bd46ee47a58e8fbd4d26d69bf721c7bbe16cee4 WHIRLPOOL 82640a2ed819b44602861603a39d141b73b2e22f3f08e54add398d54cdcfe4e77771e8c95fb37255ca1a13c44e6973424d99f366ef1950b568e3d11f79f85eed
diff --git a/dev-db/sqldeveloper/files/sqldeveloper b/dev-db/sqldeveloper/files/sqldeveloper
new file mode 100644
index 000000000000..eba773e10267
--- /dev/null
+++ b/dev-db/sqldeveloper/files/sqldeveloper
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# skip their stupid [ -f `which java` ] test, which will always fail on Gentoo
+export APP_SKIP_J2SE_TEST=1
+export JAVA_HOME=$(java-config -o)
+
+cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $@
diff --git a/dev-db/sqldeveloper/files/sqldeveloper-r1 b/dev-db/sqldeveloper/files/sqldeveloper-r1
new file mode 100644
index 000000000000..7173cbbb75d2
--- /dev/null
+++ b/dev-db/sqldeveloper/files/sqldeveloper-r1
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# skip their stupid [ -f `which java` ] test, which will always fail on Gentoo
+export APP_SKIP_J2SE_TEST=1
+export GENTOO_VM=$( eval $(gjl --get-vm -p sqldeveloper) && echo ${gjl_vm} )
+export JAVA_HOME=$(java-config -o)
+
+cd /opt/sqldeveloper/sqldeveloper/bin && exec bash sqldeveloper $@
diff --git a/dev-db/sqldeveloper/metadata.xml b/dev-db/sqldeveloper/metadata.xml
new file mode 100644
index 000000000000..c5bb708993e9
--- /dev/null
+++ b/dev-db/sqldeveloper/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>wschlich@gentoo.org</email>
+ <name>Wolfram Schlich</name>
+ <description>Maintainer</description>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/sqldeveloper/sqldeveloper-4.0.2.15.21.ebuild b/dev-db/sqldeveloper/sqldeveloper-4.0.2.15.21.ebuild
new file mode 100644
index 000000000000..57a691f893ac
--- /dev/null
+++ b/dev-db/sqldeveloper/sqldeveloper-4.0.2.15.21.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils java-pkg-2
+
+DESCRIPTION="Oracle SQL Developer is a graphical tool for database development"
+HOMEPAGE="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html"
+SRC_URI="${P}-no-jre.zip"
+RESTRICT="fetch"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="mssql mysql sybase"
+
+DEPEND="mssql? ( dev-java/jtds:1.2 )
+ mysql? ( dev-java/jdbc-mysql:0 )
+ sybase? ( dev-java/jtds:1.2 )"
+RDEPEND=">=virtual/jdk-1.7.0
+ dev-java/java-config:2
+ ${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE}"
+ eerror "and download"
+ eerror " Oracle SQL Developer for other platforms"
+ eerror " ${SRC_URI}"
+ eerror "and move it to ${DISTDIR}"
+}
+
+src_prepare() {
+ # we don't need these, do we?
+ find ./ \( -iname "*.exe" -or -iname "*.dll" -or -iname "*.bat" \) -exec rm {} +
+
+ # they both use jtds, enabling one of them also enables the other one
+ if use mssql && ! use sybase; then
+ einfo "You requested MSSQL support, this also enables Sybase support."
+ fi
+ if use sybase && ! use mssql; then
+ einfo "You requested Sybase support, this also enables MSSQL support."
+ fi
+
+ if use mssql || use sybase; then
+ echo "AddJavaLibFile $(java-pkg_getjars jtds-1.2)" >> sqldeveloper/bin/sqldeveloper.conf
+ fi
+
+ if use mysql; then
+ echo "AddJavaLibFile $(java-pkg_getjars jdbc-mysql)" >> sqldeveloper/bin/sqldeveloper.conf
+ fi
+}
+
+src_install() {
+ dodir /opt/${PN}
+ # NOTE For future version to get that line (what to copy) go to the unpacked sources dir
+ # using `bash` and press Meta+_ (i.e. Meta+Shift+-) -- that is a builtin bash feature ;-)
+ cp -r {configuration,d{ataminer,ropins,vt},e{quinox,xternal},ide,j{avavm,d{bc,ev},lib,views},modules,netbeans,r{dbms,eadme.html},s{leepycat,ql{cli,developer,j},vnkit}} \
+ "${D}"/opt/${PN}/ || die "Install failed"
+
+ dobin "${FILESDIR}"/${PN} || die "Install failed"
+
+ mv icon.png ${PN}-32x32.png || die
+ doicon ${PN}-32x32.png || die
+ make_desktop_entry ${PN} "Oracle SQL Developer" ${PN}-32x32 || die
+}
+
+pkg_postinst() {
+ # this temporary fixes FileNotFoundException with datamodeler
+ # this is more like a workaround than permanent fix
+ test -d /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log \
+ || mkdir /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log
+ touch /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log
+ chmod -R 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log
+
+ # this fixes another datamodeler FileNotFoundException
+ # also more like a workaround than permanent fix
+ chmod 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/types/dr_custom_scripts.xml
+
+ echo
+ einfo "If you want to use the TNS connection type you need to set up the"
+ einfo "TNS_ADMIN environment variable to point to the directory your"
+ einfo "tnsnames.ora resides in."
+ echo
+}
diff --git a/dev-db/sqldeveloper/sqldeveloper-4.1.3.20.78-r1.ebuild b/dev-db/sqldeveloper/sqldeveloper-4.1.3.20.78-r1.ebuild
new file mode 100644
index 000000000000..311c3ef938da
--- /dev/null
+++ b/dev-db/sqldeveloper/sqldeveloper-4.1.3.20.78-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils java-pkg-2
+
+DESCRIPTION="Oracle SQL Developer is a graphical tool for database development"
+HOMEPAGE="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html"
+SRC_URI="${P}-no-jre.zip"
+
+RESTRICT="fetch"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="mssql mysql sybase"
+
+DEPEND="mssql? ( dev-java/jtds:1.3 )
+ mysql? ( dev-java/jdbc-mysql:0 )
+ sybase? ( dev-java/jtds:1.3 )"
+RDEPEND=">=virtual/jdk-1.8
+ ${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+QA_PREBUILT="
+opt/${PN}/netbeans/platform/modules/lib/amd64/linux/*.so
+opt/${PN}/netbeans/platform/modules/lib/i386/linux/*.so
+"
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE}"
+ eerror "and download"
+ eerror " Oracle SQL Developer for other platforms"
+ eerror " ${SRC_URI}"
+ eerror "and move it to ${DISTDIR}"
+}
+
+src_prepare() {
+ # we don't need these, do we?
+ find ./ \( -iname "*.exe" -or -iname "*.dll" -or -iname "*.bat" \) -exec rm {} +
+
+ # they both use jtds, enabling one of them also enables the other one
+ if use mssql && ! use sybase; then
+ einfo "You requested MSSQL support, this also enables Sybase support."
+ fi
+ if use sybase && ! use mssql; then
+ einfo "You requested Sybase support, this also enables MSSQL support."
+ fi
+
+ if use mssql || use sybase; then
+ echo "AddJavaLibFile $(java-pkg_getjars jtds-1.3)" >> sqldeveloper/bin/sqldeveloper.conf || die
+ fi
+
+ if use mysql; then
+ echo "AddJavaLibFile $(java-pkg_getjars jdbc-mysql)" >> sqldeveloper/bin/sqldeveloper.conf || die
+ fi
+}
+
+src_install() {
+ dodir /opt/${PN}
+ # NOTE For future version to get that line (what to copy) go to the unpacked sources dir
+ # using `bash` and press Meta+_ (i.e. Meta+Shift+-) -- that is a builtin bash feature ;-)
+ cp -r {configuration,d{ataminer,ropins,vt},e{quinox,xternal},ide,j{avavm,d{bc,ev},lib,views},modules,netbeans,ords,rdbms,s{leepycat,ql{developer,j},vnkit}} \
+ "${D}"/opt/${PN}/ || die "Install failed"
+
+ newbin "${FILESDIR}"/${PN}-r1 ${PN}
+
+ newicon icon.png ${PN}-32x32.png
+ make_desktop_entry ${PN} "Oracle SQL Developer" ${PN}-32x32
+
+ # This is normally called automatically by java-pkg_dojar, which
+ # hasn't been used above. We need to create package.env to help the
+ # launcher select the correct VM.
+ java-pkg_do_write_
+}
+
+pkg_postinst() {
+ # this temporary fixes FileNotFoundException with datamodeler
+ # this is more like a workaround than permanent fix
+ mkdir -p /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log || die
+ touch /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
+ chmod -R 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
+
+ # this fixes another datamodeler FileNotFoundException
+ # also more like a workaround than permanent fix
+ chmod 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/types/dr_custom_scripts.xml || die
+
+ echo
+ einfo "If you want to use the TNS connection type you need to set up the"
+ einfo "TNS_ADMIN environment variable to point to the directory your"
+ einfo "tnsnames.ora resides in."
+ echo
+}
diff --git a/dev-db/sqldeveloper/sqldeveloper-4.1.5.21.78.ebuild b/dev-db/sqldeveloper/sqldeveloper-4.1.5.21.78.ebuild
new file mode 100644
index 000000000000..311c3ef938da
--- /dev/null
+++ b/dev-db/sqldeveloper/sqldeveloper-4.1.5.21.78.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils java-pkg-2
+
+DESCRIPTION="Oracle SQL Developer is a graphical tool for database development"
+HOMEPAGE="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html"
+SRC_URI="${P}-no-jre.zip"
+
+RESTRICT="fetch"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="mssql mysql sybase"
+
+DEPEND="mssql? ( dev-java/jtds:1.3 )
+ mysql? ( dev-java/jdbc-mysql:0 )
+ sybase? ( dev-java/jtds:1.3 )"
+RDEPEND=">=virtual/jdk-1.8
+ ${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+QA_PREBUILT="
+opt/${PN}/netbeans/platform/modules/lib/amd64/linux/*.so
+opt/${PN}/netbeans/platform/modules/lib/i386/linux/*.so
+"
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE}"
+ eerror "and download"
+ eerror " Oracle SQL Developer for other platforms"
+ eerror " ${SRC_URI}"
+ eerror "and move it to ${DISTDIR}"
+}
+
+src_prepare() {
+ # we don't need these, do we?
+ find ./ \( -iname "*.exe" -or -iname "*.dll" -or -iname "*.bat" \) -exec rm {} +
+
+ # they both use jtds, enabling one of them also enables the other one
+ if use mssql && ! use sybase; then
+ einfo "You requested MSSQL support, this also enables Sybase support."
+ fi
+ if use sybase && ! use mssql; then
+ einfo "You requested Sybase support, this also enables MSSQL support."
+ fi
+
+ if use mssql || use sybase; then
+ echo "AddJavaLibFile $(java-pkg_getjars jtds-1.3)" >> sqldeveloper/bin/sqldeveloper.conf || die
+ fi
+
+ if use mysql; then
+ echo "AddJavaLibFile $(java-pkg_getjars jdbc-mysql)" >> sqldeveloper/bin/sqldeveloper.conf || die
+ fi
+}
+
+src_install() {
+ dodir /opt/${PN}
+ # NOTE For future version to get that line (what to copy) go to the unpacked sources dir
+ # using `bash` and press Meta+_ (i.e. Meta+Shift+-) -- that is a builtin bash feature ;-)
+ cp -r {configuration,d{ataminer,ropins,vt},e{quinox,xternal},ide,j{avavm,d{bc,ev},lib,views},modules,netbeans,ords,rdbms,s{leepycat,ql{developer,j},vnkit}} \
+ "${D}"/opt/${PN}/ || die "Install failed"
+
+ newbin "${FILESDIR}"/${PN}-r1 ${PN}
+
+ newicon icon.png ${PN}-32x32.png
+ make_desktop_entry ${PN} "Oracle SQL Developer" ${PN}-32x32
+
+ # This is normally called automatically by java-pkg_dojar, which
+ # hasn't been used above. We need to create package.env to help the
+ # launcher select the correct VM.
+ java-pkg_do_write_
+}
+
+pkg_postinst() {
+ # this temporary fixes FileNotFoundException with datamodeler
+ # this is more like a workaround than permanent fix
+ mkdir -p /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log || die
+ touch /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
+ chmod -R 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
+
+ # this fixes another datamodeler FileNotFoundException
+ # also more like a workaround than permanent fix
+ chmod 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/types/dr_custom_scripts.xml || die
+
+ echo
+ einfo "If you want to use the TNS connection type you need to set up the"
+ einfo "TNS_ADMIN environment variable to point to the directory your"
+ einfo "tnsnames.ora resides in."
+ echo
+}
diff --git a/dev-db/sqldeveloper/sqldeveloper-4.2.0.17.089.1709.ebuild b/dev-db/sqldeveloper/sqldeveloper-4.2.0.17.089.1709.ebuild
new file mode 100644
index 000000000000..ae93183a1921
--- /dev/null
+++ b/dev-db/sqldeveloper/sqldeveloper-4.2.0.17.089.1709.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils java-pkg-2
+
+DESCRIPTION="Oracle SQL Developer is a graphical tool for database development"
+HOMEPAGE="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html"
+SRC_URI="${P}-no-jre.zip"
+
+RESTRICT="fetch"
+
+LICENSE="OTN"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="mssql mysql sybase"
+
+DEPEND="mssql? ( dev-java/jtds:1.3 )
+ mysql? ( dev-java/jdbc-mysql:0 )
+ sybase? ( dev-java/jtds:1.3 )"
+RDEPEND=">=virtual/jdk-1.8
+ ${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+QA_PREBUILT="
+opt/${PN}/netbeans/platform/modules/lib/amd64/linux/*.so
+opt/${PN}/netbeans/platform/modules/lib/i386/linux/*.so
+"
+
+pkg_nofetch() {
+ eerror "Please go to"
+ eerror " ${HOMEPAGE}"
+ eerror "and download"
+ eerror " Oracle SQL Developer for other platforms"
+ eerror " ${SRC_URI}"
+ eerror "and move it to ${DISTDIR}"
+}
+
+src_prepare() {
+ # we don't need these, do we?
+ find ./ \( -iname "*.exe" -or -iname "*.dll" -or -iname "*.bat" \) -exec rm {} +
+
+ # they both use jtds, enabling one of them also enables the other one
+ if use mssql && ! use sybase; then
+ einfo "You requested MSSQL support, this also enables Sybase support."
+ fi
+ if use sybase && ! use mssql; then
+ einfo "You requested Sybase support, this also enables MSSQL support."
+ fi
+
+ if use mssql || use sybase; then
+ echo "AddJavaLibFile $(java-pkg_getjars jtds-1.3)" >> sqldeveloper/bin/sqldeveloper.conf || die
+ fi
+
+ if use mysql; then
+ echo "AddJavaLibFile $(java-pkg_getjars jdbc-mysql)" >> sqldeveloper/bin/sqldeveloper.conf || die
+ fi
+}
+
+src_install() {
+ dodir /opt/${PN}
+ # NOTE For future version to get that line (what to copy) go to the unpacked sources dir
+ # using `bash` and press Meta+_ (i.e. Meta+Shift+-) -- that is a builtin bash feature ;-)
+ cp -r {configuration,d{ataminer,ropins,vt},e{quinox,xternal},ide,j{avavm,d{bc,ev},lib,views},modules,netbeans,ords,rdbms,s{leepycat,ql{developer,j},vnkit}} \
+ "${D}"/opt/${PN}/ || die "Install failed"
+
+ newbin "${FILESDIR}"/${PN}-r1 ${PN}
+
+ newicon icon.png ${PN}-32x32.png
+ make_desktop_entry ${PN} "Oracle SQL Developer" ${PN}-32x32
+
+ # This is normally called automatically by java-pkg_dojar, which
+ # hasn't been used above. We need to create package.env to help the
+ # launcher select the correct VM.
+ java-pkg_do_write_
+}
+
+pkg_postinst() {
+ # this temporary fixes FileNotFoundException with datamodeler
+ # this is more like a workaround than permanent fix
+ mkdir -p /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log || die
+ touch /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
+ chmod -R 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
+
+ # this fixes another datamodeler FileNotFoundException
+ # also more like a workaround than permanent fix
+ chmod 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/types/dr_custom_scripts.xml || die
+
+ echo
+ einfo "If you want to use the TNS connection type you need to set up the"
+ einfo "TNS_ADMIN environment variable to point to the directory your"
+ einfo "tnsnames.ora resides in."
+ echo
+}
diff --git a/dev-db/sqlite/Manifest b/dev-db/sqlite/Manifest
new file mode 100644
index 000000000000..5baa299e7a55
--- /dev/null
+++ b/dev-db/sqlite/Manifest
@@ -0,0 +1,37 @@
+AUX sqlite-3.16.0-full_tarball-build.patch 5574 SHA256 603761b58e8eddb52c389b60d9ce57866516c7a0643645756873f116bb40ff94 SHA512 b17dc5b1f6ddfa859e26c3baf237ba9999bdeb35033efea7235914daa5325cca07f2e3185d0b156d014f23527aeeb0d4b3009967411034a19d9bde1988176afa WHIRLPOOL 40b89a893ca6e116ce8e5c1bd7068b9b1618cd28ad42f60092ed310630693bd24ae0c1d7af6444fb45bbdb47f9021a151cf16985241838a728efcf2ff9b38e73
+AUX sqlite-3.16.0-nonfull_tarball-build.patch 405 SHA256 4960dfd86f2d11152b8b1c0ffb70c962b9c24c3898244537f8e3a16e21c55657 SHA512 f7c4ad34b853b0584b63d6f93b8c2f32ff2380b078f1be13e745680d5f3a00b07fe5b0f36c0c27159bdb5b062c28cffc148e3e58dd2cb8a14dd822a11555fe27 WHIRLPOOL 16fc6f1a92c2989f1376d7f941a1f12501459c37c60aa0572dd811e43c14d2977727f33d5c58d542ba5c5cfa96905f7f885a09a7299fb64d93327fbd90d5e33c
+AUX sqlite-3.18.0-full_tarball-build.patch 6082 SHA256 625aab9dc1215993a01052479361f3ef8e41b3880836a74d5f84dd818fdfbeff SHA512 3e9429bd629775b4e036d21c1367d7505c09d41ec0fa6fcbd411cbe4199a68451ffd9a10bc183405c5ed7620f505d0a4a4e4fad84cdab91a339febed8d525b00 WHIRLPOOL 0e7566b060b0146668d3bcb326c0fef2c4380b0c8e43c34a7b90a4f2b056d357198d1dfee13ea79b81056abd1cebc33cd55bbf7a32d3b5b8d8194e8a140da494
+AUX sqlite-3.20.0-full_tarball-build.patch 6080 SHA256 9e4c1d9888284a0322107bbb3dc8e62f4b980eafff894e03553b62f69ea5da3d SHA512 eebc07a6bf3413942c2cb11975b1c2040e91e42af076c5998cb058bfce253a15ada1abe093e4fefba53ff867eff6a450d4c3b611abb3a35ad11e61f61ce3cf02 WHIRLPOOL ef62f7f6632a5df6a21950058d22c57f46fae77898aa7e69aa5f6b6e243aff3ae6e483583d5fe49348300b373cf138e281908e6cf6b72d084298734d1dbfad75
+AUX sqlite-3.20.1-full_tarball-csv-unsigned_char.patch 1087 SHA256 010f5943d574695836cda1dfdfee5a7783ff278b8e114122586235df9b43eb65 SHA512 d03bb42685423facbcf292f06b34ca416468b4482af12f1180b8804dca9070fba38907749588ee810eacc25084ad5d6d94d589c47c3ef36b745d0c92fc2ae13f WHIRLPOOL b415457a04a2c1225e553861164143619fce08ff668a8078973fbe25cdf24e90770d294aca50d809530878bf8f9899117bc91cc30da6566f304d615c36250f7a
+AUX sqlite-3.20.1-full_tarball-tests-big-endian.patch 3507 SHA256 6c9eb8591f4cca2b48c1e1774f30f9aa893eb3cd528054869e649694b747dbf3 SHA512 e9e3827f78cc51b401727138ce2bbe5cd157c47c1d2da8994e2f2b44ab66705625edabed3b0246c82ba56d59761f8451917ffcc6ddbba1dc36a519e5b8a5c96a WHIRLPOOL bc9962603eef99dc8866b5cd1388c52ea3d8ea57c58a3c5e72560fd0b289f740e5d92c9208af1d8f1f897475ae1c8cb046a87fd68dcaa951b0234692c3e70a9f
+DIST sqlite-autoconf-3160200.tar.gz 2508179 SHA256 65cc0c3e9366f50c0679c5ccd31432cea894bc4a3e8947dabab88c8693263615 SHA512 83bdd588504f265bbe93fb98a33a292aff5618c14f94d521c8557efbb5f777e82dfbb2d186cbfd4c628ee9522b1fcb73857e24ca2318fa34af3a3f9540e72b9a WHIRLPOOL 850a5051739f65eade0ee5740641a0503870f88d1ebdb40cab36b68d956896270ed59e387d57db74eede5ecd7fc9b3c14bc5841ff02e17eb50abc4701eba18fc
+DIST sqlite-autoconf-3170000.tar.gz 2515143 SHA256 a4e485ad3a16e054765baf6371826b5000beed07e626510896069c0bf013874c SHA512 bebf2693ade1c99b6a178bbe663f64911bf7751932a2524506994cbbb19ab254e7febe3693a76084e55853c1ea85db9e4ece87192422583555fbe569915a2ca8 WHIRLPOOL c3ddeb9691470dfd10950ef36bca8f05f06faa171e3ee87da66d431ba364b7dd903b1350b8ab1aae445a2696ea56dd3f0c50e07d25bc83a09d673a9b92c84e3f
+DIST sqlite-autoconf-3180000.tar.gz 2533004 SHA256 3757612463976e7d08c5e9f0af3021613fc24bbcfe1c51197d6776b9ece9ac5c SHA512 4c2efda1d63d1849f7a351cc57c02cc1820efe3c19f88460a131a1d6ae4f7411e4b7672a5581055e581093df29f65cebd9ff5b24125c18802523b17477dce1ef WHIRLPOOL 5424d028af1649cedeb9192d86939753000bb94676b0578d5bdd33591ddd064f2e9ca60a1abc6e185a8fbbfd13c04361e7bfd82945b3b7c01073b8e79e985031
+DIST sqlite-autoconf-3190200.tar.gz 2542613 SHA256 ca5361fb01cc3ad63d6fd4eb2cb0b6398e629595896d3558f7e121d37dac2ffc SHA512 fc9fbb76a741a22d620902868d5db6c8954db8a2692c8e91080ab96f41b4e18a4d27aa8f549c8fac62aaf5ad20c908abd01ecc0fdf7204310bf0cb6d1a2e5e14 WHIRLPOOL 003b4600a4689d94b690f9122e749401371deb39e0a04ffcdf161fc72b8d89349a7e9cf9883d54064c23ea08a72cac190d1d14fb586349c528a033d72b139a84
+DIST sqlite-autoconf-3190300.tar.gz 2542682 SHA256 06129c03dced9f87733a8cba408871bd60673b8f93b920ba8d815efab0a06301 SHA512 7896c99726da75818f1027d5675b24724bc89c738874c868868e60c09d4509ad5a6da93f54cfcecb3a1052e4f164f7cb864ede333b9ccfb4f6b811b052ca1d3d WHIRLPOOL 8881e2077a2f443e849e1c1bc4d824e8dfdf3f47f505288f00772e6f7f64b927ae8df0d2d63f240f8b344d729b8258c797073786d3ef75c40e668784c8a8f1c4
+DIST sqlite-autoconf-3200000.tar.gz 2565548 SHA256 3814c6f629ff93968b2b37a70497cfe98b366bf587a2261a56a5f750af6ae6a0 SHA512 f5b0ffcc27adeed5b27b29962d03defa167151868f2281c5642a8ddfa10ac8971aff22081a5b46bd36bcf664bd271975e80249ec403b73656658b33af084ec94 WHIRLPOOL dd63a903ccd05ba111e5b2aa23e55dba0400a979c26e88a238af9986b4c3c4f469f1a474d09c77bacebc3eb0f0aebd95910ce32e612c44bc49d2afbae5504fa0
+DIST sqlite-autoconf-3200100.tar.gz 2565638 SHA256 ec66595b29bc0798b023a5122021ea646ab4fa9e2f735937c5426feeba950742 SHA512 56e3d326ea2225cadc628c3518d46d9f7c4bafa0e3612f2b7ab0dc0d79fcbb7e095f6d84a9a48e1c6d83adcdc8706ad5ac4404f0f622c7fe38cfde3a7e7e69f0 WHIRLPOOL 9b1f5ae9861ca526a0f01c5981b0dca7a1e633f25d8713a3263e496690f3c7098eff7babae23ba65ace3ef18f56b1c1d0e64311063f22f788c8a489ca2673e26
+DIST sqlite-doc-3160200.zip 5521023 SHA256 c13ffbb6019f3849b251c22358f31ccb862a842c0a2379f552f2935600157dcb SHA512 b79d21074d1ab154e3b324fb2943f24321ad5cdbc6e2030f1d21940ae46538462af049e0e0cd7c6cf96dec2c59708eaf70aa4cb3c84ba1a0e87238ffcf31fca2 WHIRLPOOL 4d07279b8f186c4a015324021d60f3e76840594a35a2466cc023cd3ef32b5b01572d8a83db5d96f7281c617a8384485bdef60d390e1c12c4ecbc7e0223e1a194
+DIST sqlite-doc-3170000.zip 5533032 SHA256 3102d9eab879074776216357e4c9e272f63d0cda975a0819ec5baba5e0922ff6 SHA512 6a7813be301416dc59401b7732733f44efad60b458ded0f4ed8d845aab0843a1123dd20d1e6f209dd32184a87bcd7e68e213e3676c43d1d05d2df5acc2c64b74 WHIRLPOOL dc1c9b6802985be34ac7819e08883c456a0a76fb1822eff46b26613760063b72888d34323cf15f0f48be69555c0b07b99424a85f29ac580c4ad8fa46b990b723
+DIST sqlite-doc-3180000.zip 5552381 SHA256 6f763eba9f51cb1096d1d40fbdd7ff974203060ddb892fc735adb2d7d42f1dad SHA512 7b65130cb2174d823842cddc912432d206044a8b276fdc2eef437854de7d0b05b8eb5d7aec0ead5c3f88bb7788ae5f1c42ffb1e43ab00774a68f6f7fea72d517 WHIRLPOOL be95f25105aea7f553145b371d64d1192057a2931551758bea418dd41b2ead6e9c07368347320bb041a59051c89ca2c84e3cd4e1f95806cad30dca3adec6042b
+DIST sqlite-doc-3190200.zip 5577171 SHA256 0d136abeea8d045ab7acef64ce84028dacb418584fa5a259e7ab4233ef21ff46 SHA512 f81b8719a54cd5e7f993f3dbd76821fc39651ef20b12cfd19c6d58fcb948e7fa00aa97e2f25cab421ba85d27d10b12822a87d1ae49e33c004c83b8f68cbc781c WHIRLPOOL fd8d25184a1e291ea597d42ce76ce5959db8a974e90934e637851806021d054fdda0a37d33db159478158331d52024b8ad5de11410dad5eb595b590ddda1c657
+DIST sqlite-doc-3190300.zip 5649351 SHA256 62cda70d5285e35144ddfd4629df8fadc2bae8dbcb43d0638aa874c1c03de101 SHA512 4f99b6797f76dab1859eaf4596c42d6b10a80a1ad9dcb33b82fcc4ef80a8e8299ac24c0d2a0f41debf9e82d43c9ecf9675547eb6163756f29afe847613ef75f3 WHIRLPOOL 4c259efcccca513a55150a349410a9c05cd2faa84a41a2f70f9c9311e3cb24d9e028bb2061a03c4dc6dfebfa3ff7738b571c7bd961b0f4aff5b329183b5e9d7b
+DIST sqlite-doc-3200000.zip 5695366 SHA256 5b7a4dc411937f33f17a8b0b7cb490d5e718fe37a751ee772d8989c23745f394 SHA512 0dfa9487c5e4084a9c17e8bf83a92b9a2cd53642efeff0b12051ecdeaf11e3896031f1b4d59021354a293b8acc8c6fcab827961721fda7a5de8415460d3bd280 WHIRLPOOL cd83788e4c054231b3050c54799781b38344d7bec006e640a489276678146f25ab55ee0bc82fc031e5cab39c92c09877d7ce55af90089691e0d09dac37fbbf19
+DIST sqlite-doc-3200100.zip 5759028 SHA256 0caf410e604411fd925c699d5fcb1d846f9297cdf2e18251eceb3e5708301e85 SHA512 518ca59644cecfcd67f511268112e421c5d7bbd77ef1e33304bf306ef110becf1e2a7fe37c506ec6892edb9d5c6ee77657b374c2e061f49890d18af062dea2b3 WHIRLPOOL ba78e9c6cdac90937dd4b39bbf14d78f309b391908ed22f13e9068da66ff6d191d7ade5deaae43d1636342b2ed9f45e34e0c4312c7a15557b4a36b7ed5ba3098
+DIST sqlite-src-3160200.zip 10081950 SHA256 ee77c2cc5cc4a7b0a746a1d4496f7aee0d71c558a3bbfcf8e9e0b35416910337 SHA512 db49551c09830cf4d8997f0a623deeed9f85db5f27e6ca9d8aa5812a23c1466bbcdf8bb56cf009511f72cafec8f09a305127123f54d90437b28770dac34a0897 WHIRLPOOL b8cc52d5111bde34dae02391be8d83f9e703672b2101b36f5409e9acc23743c00561b02bd14b098e29972077fa1866a506d6343b58e4897ca07dac0bb60f4367
+DIST sqlite-src-3170000.zip 10120844 SHA256 86754bee6bcaf1f2a6bf4a02676eb3a43d22d4e5d8339e217424cb2be6b748c3 SHA512 e60381de33fbf566507454e4f1dfb7d3ada554e5c919f05f0dd2f96a6f266adaa62681437f21fdea1c24de57fb6141b798f97854918faa189b507f12f11e0d36 WHIRLPOOL 535c598f7bb9ddbecdd1ca841c0ecf398831c494c99c38542d1cbb756d8333260d6891aa36167aeba75df83fbaf402465dc65c9b3a7fb6685fa54420cb1a1342
+DIST sqlite-src-3180000.zip 10166686 SHA256 eab4d137abd5aa1164244a5d558c9a02122071daf36984b236f8441d749b9ba6 SHA512 b82c5388066f2e905c067d75e890bf2ff03a522733b8c8e0ebdfffe1804d7ecb39b72f6d808fce59133ac8c645f8b6e163e3dff7bbb0d66bbe8748e069ca7a84 WHIRLPOOL b92890b587761dfd550b39fbd64c4fddaf58e495c0f2b7526a624c3415147494648add3fa6968a09411e73c9b0653ec541a49a34daeb7ad2ae4840e829528380
+DIST sqlite-src-3190200.zip 10193843 SHA256 899c370b162a3b1febc644be5363433789a629bd07f5f80231defb5603d1abc1 SHA512 026b97bfc73b6ecf4c48b344a13adfb1c484d76a4fe78fd06bc4d175bb516c324483c6a647eaffc989469b3134c1874a1869b2d6a7d4112e685d75317992deb1 WHIRLPOOL 8af9215bfb2e2c2b418ff19f5e6a31d9ce68c47a3ec5d31fa2747e6de1936a32844fa6d500d876f77038a50dd332d73740594a2a7a9141eff32bc5bf523c5966
+DIST sqlite-src-3190300.zip 10193997 SHA256 5595bbf59e7bb6bb43a6e816b9dd2ee74369c6ae3cd60284e24d5f7957286120 SHA512 514c3de6346bdea359036a79c880133f0eeed4cdfc9e811d662dc343f91ea43edda0f9760405a48e7f61ea1dd3478980cc7d3b5409ef27adcb5311a06e36297e WHIRLPOOL 14491a9f14b7f180781ea78010783709e0539b970d0fadec10a3e0afd9fdda8d417dd14811ad10f98b9b8ec5cb491422bc4e9ebad7720a1733fef11e759908c7
+DIST sqlite-src-3200000.zip 10575632 SHA256 4b358e77a85d128651e504aaf548253ffe10d5d399aaef5a6e34f29262614bee SHA512 40fe7972902d041f012c7739c8712aa40069aebc7be680fde8f43b33fed885bfc42331bfb7200651486484edb71cbdd77ddb9c119d0847bdfb0e92063090f029 WHIRLPOOL e64cefd85a78402a40abe647c001cf280fe8469da99a03b776ba12bbf19fd372506430b4f9d1b507617dff3d3adf74ea177a2238e006d6b85e39e67c60ce6a03
+DIST sqlite-src-3200100.zip 10575637 SHA256 665bcae19f313c974e3fc2e375b93521c3668d79bc7b66250c24a4a4aeaa2c2a SHA512 845a0d64c9356aadf178c04dd716bbd37a7353526b06cfa8e8f65653cf6a1893a5c5e8c78d20b43910c34d9167272cf517749c91ed0ba7686977e3d0327e8939 WHIRLPOOL cfba088bc57f387e665642df2c4050edeaa3802c8c684dcdaa882c608650afb32de3c9877e518d2b1689e26eafb2e693de7d0edc3ce7ce49b0bcf4537954972d
+EBUILD sqlite-3.16.2.ebuild 7562 SHA256 9a43f73fd517cac09cccee3fd4db5b227c9d3416ba557a6ecd3627ec7e886188 SHA512 fff1466d88ea7b14db92e74cc080e2d06706b01e1dd9c388529fcddf02570a03e7b47d3745197ec70517b657218e570dc5deb20697d2a79e608ab856b49d63de WHIRLPOOL 1c9fa1b105dee1685d32fee41c44fd0d51327081f38ae9579afe18b04054b13c449928b964e0a238ec3a19785639e643aea58e0fc2463d6e14cffbeeea1c12c1
+EBUILD sqlite-3.17.0.ebuild 7577 SHA256 8a9fef75009478b47686b47c066572d3bb11eb54c87a153de0c6b795ff2917fc SHA512 74dd5ac09d7f988573e5bcdbd509ea3759369a583db29f1ee679ed5b7a56f8e648a54b827806d6f663ac66d407ca71bebe67c3140a6562f399ff8f7ef70f75d1 WHIRLPOOL 916db3be0235376237c3b9060ba2e2053f64ed1b4d9f665b74a4e3b6b9c2ed62c8743d80076c326273a66e95c40438c96d73110867d49e4ceefc7d286c1ab1e9
+EBUILD sqlite-3.18.0.ebuild 7632 SHA256 a07cf557d2152945d5a14150187882033e4967cbdb9ea1bb42cc36f8408002e2 SHA512 e8650cc6a2abd7a825cf2d336f19758aafbe3a4d9c7be9d08bda885bcc76c7c4182132ca990ea9e9fcdce2d2de65eb4fe3605785f80e28870491862e9e4ad5c1 WHIRLPOOL 8498e5adf11085cd6f67a4d68fd118271388991ac039aee16bd770f4909258c1010f2b5708eb8bf328ff486f27c652bebed0121697c212f867ee475d98112fe9
+EBUILD sqlite-3.19.2.ebuild 7860 SHA256 1d72e9ea14610c26b10e3ca33d8cc46b8317361baa7f757e873285c607ab4d00 SHA512 e90aae9d716ed9d6e5f6ab714917ea3479b8852811be8b59f3955618221b3ed454cb0092002f5a1608a6e62521377d67329e03bd5d5119bdb6228195c9085af9 WHIRLPOOL ac2e32d396ffe7dee96918a547ce4fd8955361baf936adb5e36ae6eb2e6a9b0e28710a2e24afc64ba71795ecb5be63137f164b3cfae6ccb096a005607e241afb
+EBUILD sqlite-3.19.3.ebuild 7627 SHA256 940a4b87c1445c20736d26b44d6e8bea6fca0dcb90815c505974217d8e8c35c1 SHA512 9b689a4fd1897c8ebdb4c726c7377dbc3a53445539d93d443e208ccf007f0085b7179f8821a2eb0b15bb4591b5dd00747dc54fb0a1971bab249b905f49e2b31f WHIRLPOOL 082c44e8a88d94518733bcb2990c863bbebbb1c248f6cb553a60cdef7138c482eb505a345550b94e8285bfd375d0abea9b2059202b66b837fc3840d82cda8a24
+EBUILD sqlite-3.20.0.ebuild 7632 SHA256 9dda38d50abbbc7f1e41729b952745f5bf1a7f2cd9abd0a9ae7fc7140ca90c28 SHA512 0429db119f90a2292eb5ade11f55acee08a68be38bd37e4455e686e5431d1d04475f860fa459d4746e7404123869ebf2ec75fb956d57cad06b49037f25ab8eed WHIRLPOOL 52cb074e3428b4be0777c4cf3e50d6ff7a86ba6e14afd2e2baf31b09e3fd0725dcbfa4adb24fa733706cc647008031a366944cbb3d93e2b700990632e7ec98ea
+EBUILD sqlite-3.20.1-r1.ebuild 8090 SHA256 d953fcafbda3bf5b964b562860a9bbe4d184a2fdbe77f4d21b0f8fa119dc1be1 SHA512 15371d39911f3e4ea0d8c39f354de454564ca23d065a227634f99db18735932cb257c2e7271c2f50d78c5496bff5500b8114b755eab2c861a70afb6f5f9110b2 WHIRLPOOL a94f41a5875535aba2425ec63af32933637838b0aace1428525a531700712a56ad548308aa87065d1c184dabb266ed2a80b7118f90df24b73c3b3f1ff5beb4ac
+MISC ChangeLog 13419 SHA256 729f7a8c3bcf0f8b48bf8abb50a5f7d11c9061a7717ef2d99f5e1c9ea0e0aed0 SHA512 d60a569bf7563f3c8efe9f5c75b0e71b25677125cf82251db4c169f0f67090e87944e51b23c797a22ff3d6e104ff81c3e4af43d88e1a4257ce790644fa30e23e WHIRLPOOL 1c24f28d1358c73eccdf19a03373ffb05505adf77631cec6c6189c4307ab344c9586b1ce245bb4ef40017f767eaa7dd22520a0fc071f44c7711fffd9fdc5ed03
+MISC ChangeLog-2015 77763 SHA256 c33481b0e8ff18658a72ce845ef033f46d7e2e47fd368f276485936b8249e366 SHA512 ae9ede8a42eb81bdbfd39c201aaed8a295c2eb61999d7961aed59f1d439241b57ffff0548b11317abdf2342a2e35daeb8ba98dea3fbd1904653192c3e2b3c86c WHIRLPOOL 892423e0771ee903650e396b9eb63ca76abe782ce5d3f2e1f993d0c65f3ee1b23e38a743557e09f7d11c6466ffe7c8bf7fb4a372ed58e33c1397d9c9b24f1783
+MISC metadata.xml 745 SHA256 0430582d0c0d1d5687f3e488e11f0b0c60f91fa51196df62c5ccd4a57b79912b SHA512 06ed7007e3ded9f29fadc70c583e9795a8ab5c27578159bb060b39c0cf7de6b4bca06ff0ceeab6710c50db96a44c976c52af2352ee7928211a46d5eca071b849 WHIRLPOOL 7c9f0a1ab683d8c10a5eccebdd88f1f470c72ae4b547fc0a465da4cd6c640d0b8658d9767dfd6e16bdfbb54219edc584b0c7e80ed6b4e963032b7aaeeab672d5
diff --git a/dev-db/sqlite/files/sqlite-3.16.0-full_tarball-build.patch b/dev-db/sqlite/files/sqlite-3.16.0-full_tarball-build.patch
new file mode 100644
index 000000000000..60907e795f92
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.16.0-full_tarball-build.patch
@@ -0,0 +1,147 @@
+Link executables against libsqlite3.so.
+Increase timeout for fuzzcheck.
+Fix building with dlopen() not available.
+
+--- Makefile.in
++++ Makefile.in
+@@ -562,6 +562,7 @@
+ #
+ SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
+ # SHELL_OPT += -DSQLITE_ENABLE_FTS5
++SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
+ SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+ SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+ FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
+@@ -586,25 +587,25 @@
+
+ libtclsqlite3.la: tclsqlite.lo libsqlite3.la
+ $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
+- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \
+ -rpath "$(TCLLIBDIR)" \
+ -version-info "8:6:8" \
+ -avoid-version
+
+-sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
+- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
+- $(TOP)/src/shell.c sqlite3.c \
+- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
++sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la
++ $(LTLINK) $(READLINE_FLAGS) -o $@ \
++ $(TOP)/src/shell.c libsqlite3.la \
++ $(LIBREADLINE)
+
+-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
+- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la
+
+-dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
+- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
++dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la
+
+-scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
++scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la
+ $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
+- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
++ $(TOP)/ext/misc/scrub.c libsqlite3.la
+
+ srcck1$(BEXE): $(TOP)/tool/srcck1.c
+ $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
+@@ -679,7 +680,7 @@
+ # Rule to build the amalgamation
+ #
+ sqlite3.lo: sqlite3.c
+- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c
+
+ # Rules to build the LEMON compiler generator
+ #
+@@ -1105,13 +1106,13 @@
+
+ # Fuzz testing
+ fuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
+- ./fuzzcheck$(TEXE) $(FUZZDATA)
++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA)
+
+ fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
+- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
++ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA)
+
+ valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA)
+- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA)
+
+ # The veryquick.test TCL tests.
+ #
+@@ -1141,32 +1142,31 @@
+ smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
+ ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
+
+-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
+ echo "#define TCLSH 2" > $@
+- echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@
+- cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@
++ cat $(TOP)/src/tclsqlite.c >> $@
+ echo "static const char *tclsh_main_loop(void){" >> $@
+ echo "static const char *zMainloop = " >> $@
+ $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@
+ echo "; return zMainloop; }" >> $@
+
+-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
+- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la
++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL)
+
+-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la
+
+-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la
+
+-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
++showjournal$(TEXE): $(TOP)/tool/showjournal.c
++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c
+
+-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
++showwal$(TEXE): $(TOP)/tool/showwal.c
++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c
+
+-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la
+
+ rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
+ $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
+@@ -1180,8 +1180,8 @@
+ speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.lo
+ $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
+
+-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
+- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la
++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la
+
+ loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
+ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
+--- configure.ac
++++ configure.ac
+@@ -584,6 +584,9 @@
+ if test "${use_loadextension}" = "yes" ; then
+ OPT_FEATURE_FLAGS=""
+ AC_SEARCH_LIBS(dlopen, dl)
++ if test "${ac_cv_search_dlopen}" = "no" ; then
++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
++ fi
+ else
+ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
+ fi
diff --git a/dev-db/sqlite/files/sqlite-3.16.0-nonfull_tarball-build.patch b/dev-db/sqlite/files/sqlite-3.16.0-nonfull_tarball-build.patch
new file mode 100644
index 000000000000..81ef29d8a5d5
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.16.0-nonfull_tarball-build.patch
@@ -0,0 +1,14 @@
+Fix building with dlopen() not available.
+
+--- configure.ac
++++ configure.ac
+@@ -102,6 +102,9 @@
+ [], [enable_dynamic_extensions=yes])
+ if test x"$enable_dynamic_extensions" != "xno"; then
+ AC_SEARCH_LIBS(dlopen, dl)
++ if test "${ac_cv_search_dlopen}" = "no" ; then
++ DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
++ fi
+ else
+ DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
+ fi
diff --git a/dev-db/sqlite/files/sqlite-3.18.0-full_tarball-build.patch b/dev-db/sqlite/files/sqlite-3.18.0-full_tarball-build.patch
new file mode 100644
index 000000000000..1278630c0927
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.18.0-full_tarball-build.patch
@@ -0,0 +1,158 @@
+Link executables against libsqlite3.so.
+Increase timeout for fuzzcheck.
+Fix building with dlopen() not available.
+
+--- Makefile.in
++++ Makefile.in
+@@ -562,6 +562,7 @@
+ #
+ SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
+ # SHELL_OPT += -DSQLITE_ENABLE_FTS5
++SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
+ SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+ SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+ FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
+@@ -587,25 +588,25 @@
+
+ libtclsqlite3.la: tclsqlite.lo libsqlite3.la
+ $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
+- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \
+ -rpath "$(TCLLIBDIR)" \
+ -version-info "8:6:8" \
+ -avoid-version
+
+-sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
+- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
+- $(TOP)/src/shell.c sqlite3.c \
+- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
++sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la
++ $(LTLINK) $(READLINE_FLAGS) -o $@ \
++ $(TOP)/src/shell.c libsqlite3.la \
++ $(LIBREADLINE)
+
+-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
+- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la
+
+-dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
+- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
++dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la
+
+-scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
++scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la
+ $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
+- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
++ $(TOP)/ext/misc/scrub.c libsqlite3.la
+
+ srcck1$(BEXE): $(TOP)/tool/srcck1.c
+ $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
+@@ -681,7 +682,7 @@
+ # Rule to build the amalgamation
+ #
+ sqlite3.lo: sqlite3.c
+- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c
+
+ # Rules to build the LEMON compiler generator
+ #
+@@ -1107,13 +1108,13 @@
+
+ # Fuzz testing
+ fuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
+- ./fuzzcheck$(TEXE) $(FUZZDATA)
++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA)
+
+ fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
+- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
++ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA)
+
+ valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA)
+- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA)
+
+ # The veryquick.test TCL tests.
+ #
+@@ -1143,36 +1144,35 @@
+ smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
+ ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
+
+-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
+ echo "#define TCLSH 2" > $@
+- echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@
+- cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@
++ cat $(TOP)/src/tclsqlite.c >> $@
+ echo "static const char *tclsh_main_loop(void){" >> $@
+ echo "static const char *zMainloop = " >> $@
+ $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@
+ echo "; return zMainloop; }" >> $@
+
+-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
+- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la
++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL)
+
+-dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
++dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c libsqlite3.la
+ $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
+- $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
++ $(TOP)/ext/misc/dbdump.c libsqlite3.la
+
+-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la
+
+-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la
+
+-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
++showjournal$(TEXE): $(TOP)/tool/showjournal.c
++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c
+
+-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
++showwal$(TEXE): $(TOP)/tool/showwal.c
++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c
+
+-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la
+
+ rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
+ $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
+@@ -1191,11 +1191,11 @@
+ kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
+ $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
+
+-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
+- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la
++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la
+
+-loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
+- $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
++loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
++ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@
+
+ # This target will fail if the SQLite amalgamation contains any exported
+ # symbols that do not begin with "sqlite3_". It is run as part of the
+--- configure.ac
++++ configure.ac
+@@ -584,6 +584,9 @@
+ if test "${use_loadextension}" = "yes" ; then
+ OPT_FEATURE_FLAGS=""
+ AC_SEARCH_LIBS(dlopen, dl)
++ if test "${ac_cv_search_dlopen}" = "no" ; then
++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
++ fi
+ else
+ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
+ fi
diff --git a/dev-db/sqlite/files/sqlite-3.20.0-full_tarball-build.patch b/dev-db/sqlite/files/sqlite-3.20.0-full_tarball-build.patch
new file mode 100644
index 000000000000..cc95be3ee60e
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.20.0-full_tarball-build.patch
@@ -0,0 +1,158 @@
+Link executables against libsqlite3.so.
+Increase timeout for fuzzcheck.
+Fix building with dlopen() not available.
+
+--- Makefile.in
++++ Makefile.in
+@@ -565,6 +565,7 @@
+ #
+ SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
+ # SHELL_OPT += -DSQLITE_ENABLE_FTS5
++SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
+ SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+ SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+ SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
+@@ -591,25 +592,25 @@
+
+ libtclsqlite3.la: tclsqlite.lo libsqlite3.la
+ $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
+- libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
++ libsqlite3.la @TCL_STUB_LIB_SPEC@ \
+ -rpath "$(TCLLIBDIR)" \
+ -version-info "8:6:8" \
+ -avoid-version
+
+-sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
+- $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
+- $(TOP)/src/shell.c sqlite3.c \
+- $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
++sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la
++ $(LTLINK) $(READLINE_FLAGS) -o $@ \
++ $(TOP)/src/shell.c libsqlite3.la \
++ $(LIBREADLINE)
+
+-sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
+- $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
++sqldiff$(TEXE): $(TOP)/tool/sqldiff.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c libsqlite3.la
+
+-dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
+- $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
++dbhash$(TEXE): $(TOP)/tool/dbhash.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/dbhash.c libsqlite3.la
+
+-scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
++scrub$(TEXE): $(TOP)/ext/misc/scrub.c libsqlite3.la
+ $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
+- $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
++ $(TOP)/ext/misc/scrub.c libsqlite3.la
+
+ srcck1$(BEXE): $(TOP)/tool/srcck1.c
+ $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
+@@ -685,7 +686,7 @@
+ # Rule to build the amalgamation
+ #
+ sqlite3.lo: sqlite3.c
+- $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
++ $(LTCOMPILE) $(SHELL_OPT) $(TEMP_STORE) -c sqlite3.c
+
+ # Rules to build the LEMON compiler generator
+ #
+@@ -1115,13 +1116,13 @@
+
+ # Fuzz testing
+ fuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
+- ./fuzzcheck$(TEXE) $(FUZZDATA)
++ ./fuzzcheck$(TEXE) --timeout 3600 $(FUZZDATA)
+
+ fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
+- ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
++ ./fuzzcheck$(TEXE) --limit-mem 100M --timeout 3600 $(FUZZDATA)
+
+ valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA)
+- valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
++ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 3600 $(FUZZDATA)
+
+ # The veryquick.test TCL tests.
+ #
+@@ -1151,36 +1152,35 @@
+ smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
+ ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
+
+-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
++sqlite3_analyzer.c: $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
+ echo "#define TCLSH 2" > $@
+- echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@
+- cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@
++ cat $(TOP)/src/tclsqlite.c >> $@
+ echo "static const char *tclsh_main_loop(void){" >> $@
+ echo "static const char *zMainloop = " >> $@
+ $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@
+ echo "; return zMainloop; }" >> $@
+
+-sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
+- $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
++sqlite3_analyzer$(TEXE): sqlite3_analyzer.c libsqlite3.la
++ $(LTLINK) sqlite3_analyzer.c -o $@ libsqlite3.la $(LIBTCL)
+
+-dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
++dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c libsqlite3.la
+ $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
+- $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
++ $(TOP)/ext/misc/dbdump.c libsqlite3.la
+
+-showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
++showdb$(TEXE): $(TOP)/tool/showdb.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/showdb.c libsqlite3.la
+
+-showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
++showstat4$(TEXE): $(TOP)/tool/showstat4.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/tool/showstat4.c libsqlite3.la
+
+-showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
++showjournal$(TEXE): $(TOP)/tool/showjournal.c
++ $(LTLINK) -o $@ $(TOP)/tool/showjournal.c
+
+-showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
++showwal$(TEXE): $(TOP)/tool/showwal.c
++ $(LTLINK) -o $@ $(TOP)/tool/showwal.c
+
+-changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
+- $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
++changeset$(TEXE): $(TOP)/ext/session/changeset.c libsqlite3.la
++ $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c libsqlite3.la
+
+ rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
+ $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
+@@ -1199,11 +1199,11 @@
+ kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
+ $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
+
+-rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
+- $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
++rbu$(EXE): $(TOP)/ext/rbu/rbu.c libsqlite3.la
++ $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c libsqlite3.la
+
+-loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
+- $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
++loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
++ $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@
+
+ # This target will fail if the SQLite amalgamation contains any exported
+ # symbols that do not begin with "sqlite3_". It is run as part of the
+--- configure.ac
++++ configure.ac
+@@ -584,6 +584,9 @@
+ if test "${use_loadextension}" = "yes" ; then
+ OPT_FEATURE_FLAGS=""
+ AC_SEARCH_LIBS(dlopen, dl)
++ if test "${ac_cv_search_dlopen}" = "no" ; then
++ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
++ fi
+ else
+ OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
+ fi
diff --git a/dev-db/sqlite/files/sqlite-3.20.1-full_tarball-csv-unsigned_char.patch b/dev-db/sqlite/files/sqlite-3.20.1-full_tarball-csv-unsigned_char.patch
new file mode 100644
index 000000000000..86236c4b4bfe
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.20.1-full_tarball-csv-unsigned_char.patch
@@ -0,0 +1,33 @@
+https://sqlite.org/src/info/42f0777555675875
+
+--- ext/misc/csv.c
++++ ext/misc/csv.c
+@@ -78,7 +78,7 @@
+ int nAlloc; /* Space allocated for z[] */
+ int nLine; /* Current line number */
+ int bNotFirst; /* True if prior text has been seen */
+- char cTerm; /* Character that terminated the most recent field */
++ int cTerm; /* Character that terminated the most recent field */
+ size_t iIn; /* Next unread character in the input buffer */
+ size_t nIn; /* Number of characters in the input buffer */
+ char *zIn; /* The input buffer */
+@@ -166,7 +166,7 @@
+ if( p->in!=0 ) return csv_getc_refill(p);
+ return EOF;
+ }
+- return p->zIn[p->iIn++];
++ return ((unsigned char*)p->zIn)[p->iIn++];
+ }
+
+ /* Increase the size of p->z and append character c to the end.
+--- test/releasetest.tcl
++++ test/releasetest.tcl
+@@ -114,7 +114,7 @@
+ }
+ "Debug-One" {
+ --disable-shared
+- -O2
++ -O2 -funsigned-char
+ -DSQLITE_DEBUG=1
+ -DSQLITE_MEMDEBUG=1
+ -DSQLITE_MUTEX_NOOP=1
diff --git a/dev-db/sqlite/files/sqlite-3.20.1-full_tarball-tests-big-endian.patch b/dev-db/sqlite/files/sqlite-3.20.1-full_tarball-tests-big-endian.patch
new file mode 100644
index 000000000000..427021d2f7b5
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.20.1-full_tarball-tests-big-endian.patch
@@ -0,0 +1,95 @@
+https://www.sqlite.org/src/info/87ccdf9cbb928455
+
+--- test/fts3conf.test
++++ test/fts3conf.test
+@@ -136,47 +136,49 @@
+ do_execsql_test 2.2.3 { SELECT * FROM t1 } {{a b c} {a b c}}
+ fts3_integrity 2.2.4 db t1
+
+-do_execsql_test 3.1 {
+- CREATE VIRTUAL TABLE t3 USING fts4;
+- REPLACE INTO t3(docid, content) VALUES (1, 'one two');
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
+-} {X'0100000002000000'}
+-
+-do_execsql_test 3.2 {
+- REPLACE INTO t3(docid, content) VALUES (2, 'one two three four');
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'four'
+-} {X'0200000003000000'}
+-
+-do_execsql_test 3.3 {
+- REPLACE INTO t3(docid, content) VALUES (1, 'one two three four five six');
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
+-} {X'0200000005000000'}
+-
+-do_execsql_test 3.4 {
+- UPDATE OR REPLACE t3 SET docid = 2 WHERE docid=1;
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
+-} {X'0100000006000000'}
+-
+-do_execsql_test 3.5 {
+- UPDATE OR REPLACE t3 SET docid = 3 WHERE docid=2;
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
+-} {X'0100000006000000'}
+-
+-do_execsql_test 3.6 {
+- REPLACE INTO t3(docid, content) VALUES (3, 'one two');
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
+-} {X'0100000002000000'}
+-
+-do_execsql_test 3.7 {
+- REPLACE INTO t3(docid, content) VALUES (NULL, 'one two three four');
+- REPLACE INTO t3(docid, content) VALUES (NULL, 'one two three four five six');
+- SELECT docid FROM t3;
+-} {3 4 5}
+-
+-do_execsql_test 3.8 {
+- UPDATE OR REPLACE t3 SET docid = 5, content='three four' WHERE docid = 4;
+- SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
+-} {X'0200000002000000'}
++if {$tcl_platform(byteOrder)=="littleEndian"} {
++ do_execsql_test 3.1 {
++ CREATE VIRTUAL TABLE t3 USING fts4;
++ REPLACE INTO t3(docid, content) VALUES (1, 'one two');
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
++ } {X'0100000002000000'}
++
++ do_execsql_test 3.2 {
++ REPLACE INTO t3(docid, content) VALUES (2, 'one two three four');
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'four'
++ } {X'0200000003000000'}
++
++ do_execsql_test 3.3 {
++ REPLACE INTO t3(docid, content) VALUES (1, 'one two three four five six');
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
++ } {X'0200000005000000'}
++
++ do_execsql_test 3.4 {
++ UPDATE OR REPLACE t3 SET docid = 2 WHERE docid=1;
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
++ } {X'0100000006000000'}
++
++ do_execsql_test 3.5 {
++ UPDATE OR REPLACE t3 SET docid = 3 WHERE docid=2;
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
++ } {X'0100000006000000'}
++
++ do_execsql_test 3.6 {
++ REPLACE INTO t3(docid, content) VALUES (3, 'one two');
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
++ } {X'0100000002000000'}
++
++ do_execsql_test 3.7 {
++ REPLACE INTO t3(docid, content) VALUES(NULL,'one two three four');
++ REPLACE INTO t3(docid, content) VALUES(NULL,'one two three four five six');
++ SELECT docid FROM t3;
++ } {3 4 5}
++
++ do_execsql_test 3.8 {
++ UPDATE OR REPLACE t3 SET docid = 5, content='three four' WHERE docid = 4;
++ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
++ } {X'0200000002000000'}
++}
+
+ #-------------------------------------------------------------------------
+ # Test that the xSavepoint is invoked correctly if the first write
diff --git a/dev-db/sqlite/metadata.xml b/dev-db/sqlite/metadata.xml
new file mode 100644
index 000000000000..a3118d84299d
--- /dev/null
+++ b/dev-db/sqlite/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>arfrever.fta@gmail.com</email>
+ <name>Arfrever Frehtes Taifersar Arahesis</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="secure-delete">Enable overwriting of deleted content with zeros by default (http://sqlite.org/pragma.html#pragma_secure_delete), causing some performance penalty</flag>
+ <flag name="tools">Install additional tools</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:sqlite:sqlite</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/sqlite/sqlite-3.16.2.ebuild b/dev-db/sqlite/sqlite-3.16.2.ebuild
new file mode 100644
index 000000000000..85b1897f9dec
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.16.2.ebuild
@@ -0,0 +1,260 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-full_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlite/sqlite-3.17.0.ebuild b/dev-db/sqlite/sqlite-3.17.0.ebuild
new file mode 100644
index 000000000000..ad572bba348c
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.17.0.ebuild
@@ -0,0 +1,260 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-full_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlite/sqlite-3.18.0.ebuild b/dev-db/sqlite/sqlite-3.18.0.ebuild
new file mode 100644
index 000000000000..a607c0afbdc2
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.18.0.ebuild
@@ -0,0 +1,261 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.18.0-full_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbdump dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbdump sqlite3-db-dump
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlite/sqlite-3.19.2.ebuild b/dev-db/sqlite/sqlite-3.19.2.ebuild
new file mode 100644
index 000000000000..cb6dc5fdf17c
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.19.2.ebuild
@@ -0,0 +1,265 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.18.0-full_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+
+ # Fix references to $(OPT_FEATURE_FLAGS).
+ # https://sqlite.org/src/info/43ce3bd3a4b41ea7
+ sed -e "s/OPT_FEATURE_FLAGS=\"\$(OPT_FEATURE_FLAGS)/OPT_FEATURE_FLAGS=\"\${OPT_FEATURE_FLAGS}/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbdump dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbdump sqlite3-db-dump
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlite/sqlite-3.19.3.ebuild b/dev-db/sqlite/sqlite-3.19.3.ebuild
new file mode 100644
index 000000000000..1a76cdffbda5
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.19.3.ebuild
@@ -0,0 +1,261 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.18.0-full_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbdump dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbdump sqlite3-db-dump
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlite/sqlite-3.20.0.ebuild b/dev-db/sqlite/sqlite-3.20.0.ebuild
new file mode 100644
index 000000000000..931807da09cb
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.20.0.ebuild
@@ -0,0 +1,261 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.20.0-full_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbdump dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbdump sqlite3-db-dump
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlite/sqlite-3.20.1-r1.ebuild b/dev-db/sqlite/sqlite-3.20.1-r1.ebuild
new file mode 100644
index 000000000000..9cfbda6afa29
--- /dev/null
+++ b/dev-db/sqlite/sqlite-3.20.1-r1.ebuild
@@ -0,0 +1,275 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
+
+SRC_PV="$(printf "%u%02u%02u%02u" $(get_version_components))"
+DOC_PV="${SRC_PV}"
+# DOC_PV="$(printf "%u%02u%02u00" $(get_version_components $(get_version_component_range 1-3)))"
+
+DESCRIPTION="A SQL Database Engine in a C Library"
+HOMEPAGE="https://sqlite.org/"
+SRC_URI="doc? ( https://sqlite.org/2017/${PN}-doc-${DOC_PV}.zip )
+ tcl? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ test? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ tools? ( https://sqlite.org/2017/${PN}-src-${SRC_PV}.zip )
+ !tcl? ( !test? ( !tools? ( https://sqlite.org/2017/${PN}-autoconf-${SRC_PV}.tar.gz ) ) )"
+
+LICENSE="public-domain"
+SLOT="3"
+KEYWORDS="alpha ~amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
+
+RDEPEND="icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+ tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
+ tools? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( app-arch/unzip )
+ tcl? ( app-arch/unzip )
+ test? (
+ app-arch/unzip
+ dev-lang/tcl:0[${MULTILIB_USEDEP}]
+ )
+ tools? ( app-arch/unzip )"
+
+full_tarball() {
+ use tcl || use test || use tools
+}
+
+pkg_setup() {
+ if full_tarball; then
+ S="${WORKDIR}/${PN}-src-${SRC_PV}"
+ else
+ S="${WORKDIR}/${PN}-autoconf-${SRC_PV}"
+ fi
+}
+
+src_prepare() {
+ if full_tarball; then
+ eapply -p0 "${FILESDIR}/${PN}-3.20.0-full_tarball-build.patch"
+ eapply -p0 "${FILESDIR}/${PN}-3.20.1-full_tarball-csv-unsigned_char.patch"
+ eapply -p0 "${FILESDIR}/${PN}-3.20.1-full_tarball-tests-big-endian.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed -e "s/AC_CHECK_FUNCS(.*)/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" -i configure.ac || die "sed failed"
+ else
+ eapply -p0 "${FILESDIR}/${PN}-3.16.0-nonfull_tarball-build.patch"
+
+ eapply_user
+
+ # Fix AC_CHECK_FUNCS.
+ # https://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-dev/2016-March/002762.html
+ sed \
+ -e "s/AC_CHECK_FUNCS(\[fdatasync.*/AC_CHECK_FUNCS([fdatasync fullfsync gmtime_r isnan localtime_r localtime_s malloc_usable_size posix_fallocate pread pread64 pwrite pwrite64 strchrnul usleep utime])/" \
+ -e "/AC_CHECK_FUNCS(posix_fallocate)/d" \
+ -i configure.ac || die "sed failed"
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+
+ preparation() {
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ if full_tarball && [[ "${ABI}" == "x86" ]]; then
+ # Disable tests broken on x86.
+ sed -e "/^for {set i 0} {\$i<1000} {incr i} {$/,/^}$/d" -i test/date.test || die "sed failed"
+ fi
+
+ popd > /dev/null || die
+ }
+ multilib_foreach_abi preparation
+}
+
+multilib_src_configure() {
+ local CPPFLAGS="${CPPFLAGS}" options=()
+
+ options+=(
+ --enable-$(full_tarball && echo load-extension || echo dynamic-extensions)
+ --enable-threadsafe
+ )
+ if ! full_tarball; then
+ options+=(--disable-static-shell)
+ fi
+
+ # Support detection of misuse of SQLite API.
+ # https://sqlite.org/compile.html#enable_api_armor
+ append-cppflags -DSQLITE_ENABLE_API_ARMOR
+
+ # Support column metadata functions.
+ # https://sqlite.org/c3ref/column_database_name.html
+ append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
+
+ # Support dbstat virtual table.
+ # https://sqlite.org/dbstat.html
+ append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
+
+ # Support comments in output of EXPLAIN.
+ # https://sqlite.org/compile.html#enable_explain_comments
+ append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ # Support Full-Text Search versions 3, 4 and 5.
+ # https://sqlite.org/fts3.html
+ # https://sqlite.org/fts5.html
+ append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
+ options+=(--enable-fts5)
+
+ # Support hidden columns.
+ append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
+
+ # Support JSON1 extension.
+ # https://sqlite.org/json1.html
+ append-cppflags -DSQLITE_ENABLE_JSON1
+
+ # Support memsys5 memory allocator.
+ # https://sqlite.org/malloc.html#memsys5
+ append-cppflags -DSQLITE_ENABLE_MEMSYS5
+
+ # Support Resumable Bulk Update extension.
+ # https://sqlite.org/rbu.html
+ append-cppflags -DSQLITE_ENABLE_RBU
+
+ # Support R*Trees.
+ # https://sqlite.org/rtree.html
+ append-cppflags -DSQLITE_ENABLE_RTREE
+
+ # Support scan status functions.
+ # https://sqlite.org/c3ref/stmt_scanstatus.html
+ # https://sqlite.org/c3ref/stmt_scanstatus_reset.html
+ append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
+
+ # Support Session extension.
+ # https://sqlite.org/sessionintro.html
+ options+=(--enable-session)
+
+ # Support unknown() function.
+ # https://sqlite.org/compile.html#enable_unknown_sql_function
+ append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+
+ # Support unlock notification.
+ # https://sqlite.org/unlock_notify.html
+ append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
+
+ # Support soundex() function.
+ # https://sqlite.org/lang_corefunc.html#soundex
+ append-cppflags -DSQLITE_SOUNDEX
+
+ # debug USE flag.
+ if full_tarball; then
+ options+=($(use_enable debug))
+ else
+ if use debug; then
+ append-cppflags -DSQLITE_DEBUG
+ else
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # icu USE flag.
+ if use icu; then
+ # Support ICU extension.
+ # https://sqlite.org/compile.html#enable_icu
+ append-cppflags -DSQLITE_ENABLE_ICU
+ if full_tarball; then
+ sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ else
+ sed -e "s/^LIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
+ fi
+ fi
+
+ # readline USE flag.
+ options+=(
+ --disable-editline
+ $(use_enable readline)
+ )
+ if full_tarball && use readline; then
+ options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline")
+ fi
+
+ # secure-delete USE flag.
+ if use secure-delete; then
+ # Enable secure_delete pragma by default.
+ # https://sqlite.org/pragma.html#pragma_secure_delete
+ append-cppflags -DSQLITE_SECURE_DELETE
+ fi
+
+ # static-libs USE flag.
+ options+=($(use_enable static-libs static))
+
+ # tcl, test, tools USE flags.
+ if full_tarball; then
+ options+=(--enable-tcl)
+ fi
+
+ if [[ "${CHOST}" == *-mint* ]]; then
+ append-cppflags -DSQLITE_OMIT_WAL
+ fi
+
+ econf "${options[@]}"
+}
+
+multilib_src_compile() {
+ emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
+
+ if use tools && multilib_is_native_abi; then
+ emake changeset dbdump dbhash rbu scrub showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
+ fi
+}
+
+multilib_src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions"
+ return
+ fi
+
+ emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
+
+ if use tools && multilib_is_native_abi; then
+ install_tool() {
+ if [[ -f ".libs/${1}" ]]; then
+ newbin ".libs/${1}" "${2}"
+ else
+ newbin "${1}" "${2}"
+ fi
+ }
+
+ install_tool changeset sqlite3-changeset
+ install_tool dbdump sqlite3-db-dump
+ install_tool dbhash sqlite3-db-hash
+ install_tool rbu sqlite3-rbu
+ install_tool scrub sqlite3-scrub
+ install_tool showdb sqlite3-show-db
+ install_tool showjournal sqlite3-show-journal
+ install_tool showstat4 sqlite3-show-stat4
+ install_tool showwal sqlite3-show-wal
+ install_tool sqldiff sqlite3-diff
+ install_tool sqlite3_analyzer sqlite3-analyzer
+
+ unset -f install_tool
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ doman sqlite3.1
+
+ if use doc; then
+ rm "${WORKDIR}/${PN}-doc-${DOC_PV}/"*.{db,txt}
+ (
+ docinto html
+ dodoc -r "${WORKDIR}/${PN}-doc-${DOC_PV}/"*
+ )
+ fi
+}
diff --git a/dev-db/sqlitebrowser/Manifest b/dev-db/sqlitebrowser/Manifest
new file mode 100644
index 000000000000..9e536ebeea0c
--- /dev/null
+++ b/dev-db/sqlitebrowser/Manifest
@@ -0,0 +1,7 @@
+AUX sqlitebrowser-3.7.0-unbundle.patch 475 SHA256 3e27a396fc8f4afc34df7fe4c43a51b00c8f4fec8135a91cdb7dd24185ab4bd4 SHA512 4f90c4df8ef49943489b239f675a86259536b988585182c8b804f4ed6d38b5aabd83b32b21952329332d8520945304a4f9fea6287631a9a58ce5f311d9242fdb WHIRLPOOL 4990e0f0fa1f314f7502380f0a0b81c75dfa6d4c8044bb9a7b185f82fb51b6a4dcba8566a3664cde3a707a8e68f85fcd0be737c3c5fa6f41bb3d2d235660b274
+AUX sqlitebrowser-3.9.1-cmake.patch 774 SHA256 65911af9f31bc515458150b92f97aa978b9f36b1b578e76b2c31fadd1ae2d3d0 SHA512 f1a64286036d5c05e279fbf430f55400eb8f840564c0d9460424a42f87c4bd8d4f4e2c52c39e07d0bd3a50fa4a1e59bf591c53b1d28d2ef367af2ba25edae299 WHIRLPOOL e21640b4d5d11955cc07bb422b0cc2954dd58b9f979a50f9e052f18a0dc98be1badea9296cab9e8f75ed7c3ad4147bfa543bbc91cd29abf0af119120aba22438
+DIST sqlitebrowser-3.9.1.tar.gz 1704713 SHA256 d0d2e06a69927ba1d0b955f3261ce70c61befc5bd5ddaa06752dae8bb4219ed8 SHA512 c1e88063fac864f60a9802ae378e13d6f3a09e2f4e71e50c6abca4967a941c444a64617bad2dfc743cf9a6be554af9c73e4c61533300ed9a51652234ffdbd225 WHIRLPOOL 50c27ef3405573806e3c8939b69652f25896b9281b59d609cd3210faeb793d707d11ecdea4dada045eb4aa4da375327669566f71ecdbd151f669be1c2419a197
+EBUILD sqlitebrowser-3.9.1-r1.ebuild 1274 SHA256 3dd63d8492a6d54283267188f99ddaa313877316d484095209216017f9b8d4a5 SHA512 3723d51c9a264e269178ca1a5c255e5284f069bd37391458e200a94160703bc2d7b66b43a2d6da2127e5fbd2d511b2c2124d1a035202ccb33a7ec9146c65024d WHIRLPOOL 7e0edf0f0423e0ba7d6b4371d4b447204eead9b579f6330f8ce9662bd073a1be792926fb0406ddaca7d12aba43d5886c0699b31e1a0551b7157a7840a28029df
+MISC ChangeLog 5568 SHA256 eec895f548b4d22d066ab5b7f7d0324ddb69b892cc52ad37fdc0e96f22f5849a SHA512 a1205b1c16e22ea55acc035edd45b524bc7ed77fe8136d290ddc93974cbaa54d53b884c4af8954638e031d37b82585004ed42de90f1495f3ec7c0e0ff0654436 WHIRLPOOL 1f2756c4fbbfe8d407beaaba892f3cb513b2ef0cf4d9c26c05ac95a33e6219a9f1edc9ab5b934124b6d02ff27ae285057f696582cc11c4b3999de82f21ea6880
+MISC ChangeLog-2015 4294 SHA256 f0c59074b445a93909acb0668fe016131bfe0d659ccd37c99eb12be107f066e8 SHA512 8b269f974dec8fa2cdba807a2d5d8383442ec2f6b58245dfdd5a3e2e1274c1dc3a390ce1f35c9745fa17d78585032898f2d24c75fd1bcce107e303480e5bb2ea WHIRLPOOL c1e1c4840f3f53d59b490b121cc3e8558a19ffc22959de40ede33beb3afd045941936e2f1b1707b98f2b41bda088caf000c49e5d20ca428ef0467dcbb91587b8
+MISC metadata.xml 740 SHA256 c205b1f3bb62b5c8049ded74c76395841328c27fce03670b7d9b9561cc00a94d SHA512 697ae7be911f1ce3a8b0c0f9f8509ac5fd338463b7b692ca320ab41ed7676fcc3d7db59e759cfbe82c6d2a1fa9d85a1eeefeda3bca702f56832f336ee7fd0369 WHIRLPOOL bfa9765a16460e67c5e8bb7eb7ee00ca4cc10ce6b42ccceb187a60e7d3c6320bd6864fffcf8997d59148bfb7719c204d54f70a2c3730bd41268ba26245c6e92b
diff --git a/dev-db/sqlitebrowser/files/sqlitebrowser-3.7.0-unbundle.patch b/dev-db/sqlitebrowser/files/sqlitebrowser-3.7.0-unbundle.patch
new file mode 100644
index 000000000000..8dbe870f2e87
--- /dev/null
+++ b/dev-db/sqlitebrowser/files/sqlitebrowser-3.7.0-unbundle.patch
@@ -0,0 +1,18 @@
+--- sqlitebrowser-3.7.0/CMakeLists.txt
++++ sqlitebrowser-3.7.0/CMakeLists.txt
+@@ -29,15 +29,9 @@
+ find_package(Antlr2)
+
+ set(QHEXEDIT_DIR libs/qhexedit)
+-set(QCUSTOMPLOT_DIR libs/qcustomplot-source)
+ set(QSCINTILLA_DIR libs/qscintilla/Qt4Qt5)
+
+-if(NOT ANTLR2_FOUND)
+- set(ANTLR_DIR libs/antlr-2.7.7)
+- add_subdirectory(${ANTLR_DIR})
+-endif()
+ add_subdirectory(${QHEXEDIT_DIR})
+-add_subdirectory(${QCUSTOMPLOT_DIR})
+ add_subdirectory(${QSCINTILLA_DIR})
+
+ if(USE_QT5)
diff --git a/dev-db/sqlitebrowser/files/sqlitebrowser-3.9.1-cmake.patch b/dev-db/sqlitebrowser/files/sqlitebrowser-3.9.1-cmake.patch
new file mode 100644
index 000000000000..cf1cde6c9197
--- /dev/null
+++ b/dev-db/sqlitebrowser/files/sqlitebrowser-3.9.1-cmake.patch
@@ -0,0 +1,24 @@
+From 2563d678681fa6972674b47617015cb2515bd414 Mon Sep 17 00:00:00 2001
+From: Martin Kleusberg <mkleusberg@gmail.com>
+Date: Wed, 12 Oct 2016 23:26:56 +0200
+Subject: [PATCH] Fix cmake file
+
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 998c2f4..4c5debd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.7)
+
+ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
+
+-OPTION(USE_QT5 FALSE "Build with qt5")
+-OPTION(ENABLE_TESTING FALSE "Enable the unit tests")
++OPTION(USE_QT5 "Build with qt5" OFF)
++OPTION(ENABLE_TESTING "Enable the unit tests" OFF)
+
+ if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Release")
diff --git a/dev-db/sqlitebrowser/metadata.xml b/dev-db/sqlitebrowser/metadata.xml
new file mode 100644
index 000000000000..778d9bfc7286
--- /dev/null
+++ b/dev-db/sqlitebrowser/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+ <longdescription lang="en">
+SQLite Database Browser is a freeware, public domain, open source visual tool
+used to create, design and edit database files compatible with SQLite. It is
+meant to be used for users and developers that want to create databases, edit
+and search data using a familiar spreadsheet-like interface, without the need to
+learn complicated SQL commands.
+</longdescription>
+ <upstream>
+ <remote-id type="github">sqlitebrowser/sqlitebrowser</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/sqlitebrowser/sqlitebrowser-3.9.1-r1.ebuild b/dev-db/sqlitebrowser/sqlitebrowser-3.9.1-r1.ebuild
new file mode 100644
index 000000000000..48a7c45c0e0b
--- /dev/null
+++ b/dev-db/sqlitebrowser/sqlitebrowser-3.9.1-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils eutils
+
+DESCRIPTION="SQLite Database Browser"
+HOMEPAGE="http://sqlitebrowser.org"
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3 MPL-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="test"
+
+RDEPEND="
+ dev-cpp/antlr-cpp:2
+ dev-db/sqlite:3
+ dev-libs/qcustomplot[qt5(+)]
+ dev-qt/qtgui:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtwidgets:5
+ >=x11-libs/qscintilla-2.9.3-r2:=[qt5(+)]
+"
+DEPEND="${RDEPEND}
+ dev-qt/linguist-tools:5
+ test? ( dev-qt/qttest:5 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.7.0-unbundle.patch
+ "${FILESDIR}"/${PN}-3.9.1-cmake.patch
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+ # https://github.com/qingfengxia/qhexedit still bundled
+ # x11-libs/qscintilla[qt4?,qt5?] still bundled
+ find libs/{antlr-2.7.7,qcustomplot-source} -delete || die
+
+ sed -e "/^project/ s/\".*\"/sqlitebrowser/" -i CMakeLists.txt || die
+
+ if ! use test; then
+ sed -e "/qt5_use_modules/ s/ Test//" -i CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSE_QT5=ON
+ -DENABLE_TESTING=$(usex test)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ doicon images/sqlitebrowser.svg
+}
diff --git a/dev-db/sqliteman/Manifest b/dev-db/sqliteman/Manifest
new file mode 100644
index 000000000000..b4a754bc6f5d
--- /dev/null
+++ b/dev-db/sqliteman/Manifest
@@ -0,0 +1,8 @@
+AUX sqliteman-1.2.2-lpthread.patch 486 SHA256 af99d278b6d0cda9f84487985afdb427f77edd6eff9a1a62edac906dcfd5487b SHA512 e4598b7f74da7c046571a5b6744d172a9d5d8d35c28ff0bd11b0db68a3fa8ba291ab9634a3622ea5aa383fe6aff75318350665a0a75f68224b6ba97cbc8f3855 WHIRLPOOL 63858a7eb84bdc51ae13d41e1c20c0a29f0b88b853a29560f895b197881acaa9fe3456ef13f585d6746489760c48c5ad05b6f238faf57d1e554f83c0bed762ff
+AUX sqliteman-1.2.2-qscintilla-2.10.patch 587 SHA256 572ba772bfe151f3f5bc85e21bea645da84aeecc2a91272ff9b3c4dcb6a94fed SHA512 91af0f16af6c0d686d3e184518262de123bb998fc4802108645b15b3288c8aa242a869dec99c350cdfa9982420f4989e54d8287e9c387073361e2bdcf1310472 WHIRLPOOL 93bf44bac8433293d9a20b452fa4324a9a4519fba0eb7b9d0120a5d40e96777c55fe026b827c9b80125f988f95cdf391172f73acccdc4b9db7cff0efd8e6e438
+DIST sqliteman-1.2.2.tar.gz 1579855 SHA256 2229e627528ec02a9cf7aba3a65bef8999272fc25eb22112dc3f8ee583eb5dfb SHA512 ada8315247723c6cbb9a4c235ce427aed3fcbe6f4edaa3ee2f9c31c1729d71a4bfc874bb7ca561f2a2c9afad092e2f90c7871646eccecb3e71bcd50d1164faf4 WHIRLPOOL 73f6bee7a98e46ef6e76dca086f6cd9379f3f7c8574df70f92d21ac68def0aef548350877eda319d7bedd6b34f5f128db839ef1b2c583a7ad5565a4a78a42d6c
+EBUILD sqliteman-1.2.2-r2.ebuild 659 SHA256 e5a7d0189a76a303a23cec6b1735d3b02e4c1fc13942f4994734e0ae0788bc36 SHA512 56a3746bef61c5a750c2c7fff27dc02f1a535b9ca2ffadacf864753a49ea52444eaac22c7dc26464e07b034f0056167cdaf56d3a6b70d6d72ecde02137bcecaf WHIRLPOOL 916799ba2a35ec622ceeb02c0eb2c7cb30fbe9b7aa20d6bf0b6615f15e54a1c1bd1acd81ee1ba866d0ec3608f2ffc61a6d65480b25b2b2ffebe61e841da75c0f
+EBUILD sqliteman-1.2.2-r3.ebuild 680 SHA256 6ebd8e39aa81c95bdc65e6f03a6975d71ca82eaca9886bef91a66e8b9a8305f1 SHA512 24abd2d29b5740f05eba51b3663ae77691df586cd07f313273902445a6381d809b26a2694017aa2d6374efe5f186d7b97737c9d012ed4db9a6cb149592a85c91 WHIRLPOOL 0ac27daceb409f7e72d9104850762335903adb98d530e8ac9acf2c9edaca1a3f3622dbd74d9c1e59e80bdb49afa33acaca73d48612ff1aef8eb13ac2c356e4db
+MISC ChangeLog 3476 SHA256 c9ddffe6aefd0b0f18bd6f93b98bd254d7f728ad9a5f768d5d1ac3bc745ee91a SHA512 fa7ccff18dd334d20a636783b8395d95e27b46dbd401f3a5e64d9e9e90c0dcaf12ef2a8fcb858fd07565dcc97566b42e5b908f1c09d433849b048cbab9fb5d1d WHIRLPOOL b91a6800f13796d66b784266b000b990960b2fdb1c00d08fb3b44f13b49092463a504ee742d222aed4bb2957a9a5d32036f55a04f30908753aa9e0b0b4882916
+MISC ChangeLog-2015 1667 SHA256 ba16bedc2ba55ac810300de58f2f3fea81b5eef5e4a8c467323200e3c94c4290 SHA512 1199bc0c7acb74d0000105d69acf448bbac9f4e40999e3adf6a28343f3d17318e606183ac5bb5fee3667237442571aa48499c17f6e63aa1d4f69cf872fcc68d4 WHIRLPOOL 11b650bfaa1dd418ac08fea148b71a7f31db899fb7ecf34b5a9e286bc9c54d0258de98b330c29144b051aa66cb63ad58ad28971fd4d994ce39d99e1f48e005d1
+MISC metadata.xml 326 SHA256 e5809cdedbb1bf2d8c70f0df907f780c75d89412b8bb19cbf464bb7a70c681c6 SHA512 28cfd089b3652e0bc89c32cffa6bc3c6a10dc84ac786db5de65155ef2752982fd167f5a916f1738848e1bce5ed86d335f463187ad532db06e90d5ce6492f4d53 WHIRLPOOL 142f8b039fc64b663505b4f53d50a0109203cae21914c3df67e1dc9260197b43063c9550010aa5421faf35c31902f599df41aa48dbbefe3a4990d5fa9586a306
diff --git a/dev-db/sqliteman/files/sqliteman-1.2.2-lpthread.patch b/dev-db/sqliteman/files/sqliteman-1.2.2-lpthread.patch
new file mode 100644
index 000000000000..a9bf4f4f9528
--- /dev/null
+++ b/dev-db/sqliteman/files/sqliteman-1.2.2-lpthread.patch
@@ -0,0 +1,19 @@
+Resolves underlinking issue causing build failure on uclibc.
+
+Author: René Rhéaume <rene.rheaume@gmail.com>
+Gentoo-bug: 587076
+
+--- a/sqliteman/CMakeLists.txt
++++ b/sqliteman/CMakeLists.txt
+@@ -183,7 +183,10 @@ IF (WIN32)
+ # don't use console subsystem
+ IF (MINGW)
+ TARGET_LINK_LIBRARIES(${EXE_NAME} "-mwindows")
+- ENDIF (MINGW)
++ ENDIF (MINGW)
++ELSE (WIN32)
++ FIND_PACKAGE(Threads)
++ TARGET_LINK_LIBRARIES(${EXE_NAME} ${CMAKE_THREAD_LIBS_INIT})
+ ENDIF (WIN32)
+
+
diff --git a/dev-db/sqliteman/files/sqliteman-1.2.2-qscintilla-2.10.patch b/dev-db/sqliteman/files/sqliteman-1.2.2-qscintilla-2.10.patch
new file mode 100644
index 000000000000..c197ad342111
--- /dev/null
+++ b/dev-db/sqliteman/files/sqliteman-1.2.2-qscintilla-2.10.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/modules/FindQScintilla.cmake b/cmake/modules/FindQScintilla.cmake
+index c4592d0..7700ec4 100644
+--- a/cmake/modules/FindQScintilla.cmake
++++ b/cmake/modules/FindQScintilla.cmake
+@@ -21,7 +21,7 @@ IF(QT4_FOUND)
+ "${QT_INCLUDE_DIR}/Qsci" /usr/include /usr/include/Qsci
+ )
+
+- SET(QSCINTILLA_NAMES ${QSCINTILLA_NAMES} qscintilla2 libqscintilla2)
++ SET(QSCINTILLA_NAMES ${QSCINTILLA_NAMES} qscintilla2 libqscintilla2 qscintilla2_qt4 libqscintilla2_qt4)
+ FIND_LIBRARY(QSCINTILLA_LIBRARY
+ NAMES ${QSCINTILLA_NAMES}
+ PATHS ${QT_LIBRARY_DIR}
diff --git a/dev-db/sqliteman/metadata.xml b/dev-db/sqliteman/metadata.xml
new file mode 100644
index 000000000000..a8ba84e71fd8
--- /dev/null
+++ b/dev-db/sqliteman/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>qt@gentoo.org</email>
+ <name>Gentoo Qt Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">sqliteman</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/sqliteman/sqliteman-1.2.2-r2.ebuild b/dev-db/sqliteman/sqliteman-1.2.2-r2.ebuild
new file mode 100644
index 000000000000..0550f0f6afa4
--- /dev/null
+++ b/dev-db/sqliteman/sqliteman-1.2.2-r2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Powerful GUI manager for the Sqlite3 database"
+HOMEPAGE="https://sourceforge.net/projects/sqliteman/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm x86"
+IUSE=""
+
+RDEPEND="
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ dev-qt/qtsql:4[sqlite]
+ x11-libs/qscintilla:=[qt4(-)]"
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS README )
+PATCHES=( "${FILESDIR}/${P}-lpthread.patch" )
+
+src_prepare() {
+ # remove bundled lib
+ rm -rf "${S}"/${PN}/qscintilla2 || die
+
+ cmake-utils_src_prepare
+}
diff --git a/dev-db/sqliteman/sqliteman-1.2.2-r3.ebuild b/dev-db/sqliteman/sqliteman-1.2.2-r3.ebuild
new file mode 100644
index 000000000000..e591dfbd957f
--- /dev/null
+++ b/dev-db/sqliteman/sqliteman-1.2.2-r3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils
+
+DESCRIPTION="Powerful GUI manager for the Sqlite3 database"
+HOMEPAGE="https://sourceforge.net/projects/sqliteman/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ dev-qt/qtsql:4[sqlite]
+ x11-libs/qscintilla:=[qt4(-)]"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-lpthread.patch"
+ "${FILESDIR}/${P}-qscintilla-2.10.patch"
+)
+
+src_prepare() {
+ # remove bundled lib
+ rm -rf "${S}"/${PN}/qscintilla2 || die
+
+ cmake-utils_src_prepare
+}
diff --git a/dev-db/sqliteodbc/Manifest b/dev-db/sqliteodbc/Manifest
new file mode 100644
index 000000000000..a822a048e70b
--- /dev/null
+++ b/dev-db/sqliteodbc/Manifest
@@ -0,0 +1,8 @@
+AUX sqliteodbc-0.93-respect_LDFLAGS.patch 1180 SHA256 f5864db1996857fb7a062e4d0b85f4d6501175f2b67fb7f5dbd6d4c7301755ab SHA512 083a9640d89976097a402483ebc16c1e5328e705fcea92d78a8f56988cc73b6f75143cf7f2f67b6a783f1bc9cd5ae5671aaf8d794c3548f764d6726cd78f6531 WHIRLPOOL 2c1f6ebfad72f8a9c049a8426db15df9c056470e64bdceefd513c95fa3ee8214ddc0a75a17d0591ff925658cfaa77855bbeccc544150595380b65b561e047703
+DIST sqliteodbc-0.96.tar.gz 670070 SHA256 a5b5a1679e9cbd8cd473079d047c5277b8a57d5875fe35f1e1e576816590bf7f SHA512 447798bbc018890a784abc6b75909fbf9ecd285d6ead3ed437727041ba3ff20ef3ceb1dfe4efb713717b7df2431fd52933e6bcafc2405674cf76518dd5b39435 WHIRLPOOL ded290078b20a32e9d859c0b28297947b9c0df62d66fa64c41d789dea2e2166aed43446a864a3a7ece6cfe7cdc6594dc26558dfda6a45c21bdd869f8fcad81b1
+DIST sqliteodbc-0.99.tar.gz 696992 SHA256 3ae5f5ee80d5e2f051e1436b82fec21ef17ab2ecd5d9f1fa647669f0412573a8 SHA512 adf213acee4ee69c299f39582887fd2adba3856ce6d298d250e3a96744d041c720cefb7fd8acd504c41461751b46b8a729c4fbfa7e56832fb6e4c5a1c537955d WHIRLPOOL 7153a8c2655a7f0f55c604cf86153a286f8c4716c232b77ff5e5f1f601f457a3101d52464e41a61347c1465b2d08297fc29949effd0d0b4fe8212e3b6b73589e
+EBUILD sqliteodbc-0.96.ebuild 800 SHA256 2c3a80c3450ab2088bca7d64d681acb53ed3b64c8c17e6dffd0d9ac19898abf1 SHA512 27a9cef0023a198be47f4b4dfdfff8b9d57043d09e35031049cb3520f631f5feec01940ac7a7325e0e478a914c1a53db2298c035acd916d0f1d1d480158a6105 WHIRLPOOL ef0796beba93bd3b575c02435ed062cb6b6a78d8f88a5d64af74665811f47d98ca800d0beda0e940209394be78dea839d06c132a7e9781a29a5cb84cf917ff14
+EBUILD sqliteodbc-0.99.ebuild 823 SHA256 79c48432eceb195b2a10a4fe449e6d137567aafccb57544c5c66ec375ccfea56 SHA512 3db5f1cee8919f6bb832c7799f7cc6a3d4b41818bd01bf7060b59bf6df62861ab72357090c9c755f6b811db94798eea93a663bcaf5fd714df1f2c582e93dc811 WHIRLPOOL 1e3a4e1dd3c838c15e534223a39d80ef878ef1ac02d39d257b0e05f8bfeb401dd2e629518f2f858674ec4fc6be3bc178c01c6775efa5fe2a2ecc7fde7442ce6d
+MISC ChangeLog 2631 SHA256 a9eedd10c085f3385a441f58ce473effe52f366461d31fc3a1433a34bb254361 SHA512 da2ef9ec459d93d244099150be1702c93eba1696a44ec2036f37c7cee18d9d4032f5f2f950fa15ec1dc6670cb9a1d4ab1978977cc531d822b927e4eafc64ec1a WHIRLPOOL 8f8bfa3c50ff4548ebf905b2366c8884bab2329a5fc430fc969653b495201ff5a13c399904943fb4d25e526eec925bcca6d67e858f1b70789714c604ccbbbb4b
+MISC ChangeLog-2015 5291 SHA256 6260404841a7b79c1c43e83d0adaf8f1a35194b3514ece3d8a279097991ec3cf SHA512 06241eaf794782d610b59994a608a19125e14a4bcd6e237a82988a27d2b683fe0855e54d43e8eab6782370f9477ffa4b6ae938c9a330141f83700eb3c5cbdc5a WHIRLPOOL 56cff35af5a6b489e75d49a44f5a86787ca0399d7e7314598635a1695306a9a5c70ef28b84f978702ab7bcc2945c17346d3b203bfd70de3f409147590e472801
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/sqliteodbc/files/sqliteodbc-0.93-respect_LDFLAGS.patch b/dev-db/sqliteodbc/files/sqliteodbc-0.93-respect_LDFLAGS.patch
new file mode 100644
index 000000000000..129ce3e65ff3
--- /dev/null
+++ b/dev-db/sqliteodbc/files/sqliteodbc-0.93-respect_LDFLAGS.patch
@@ -0,0 +1,30 @@
+--- Makefile.in.old 2012-03-24 12:57:34.533234122 +0100
++++ Makefile.in 2012-03-24 12:58:06.908198492 +0100
+@@ -37,23 +37,23 @@
+ all: @LIB_TARGETS@
+
+ libsqliteodbc.la: sqliteodbc.lo
+- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libsqliteodbc.la \
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libsqliteodbc.la \
+ sqliteodbc.lo -rpath $(drvdir) $(SQLITE_LIB) \
+ $(ODBC_LIB) -release $(VER_INFO)
+
+ libsqlite3odbc.la: sqlite3odbc.lo $(SQLITE3_A10N_O)
+- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libsqlite3odbc.la \
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libsqlite3odbc.la \
+ sqlite3odbc.lo $(SQLITE3_A10N_O) -rpath $(drvdir) \
+ $(SQLITE3_LIB) $(ODBC_LIB) -release $(VER_INFO) \
+ @DL_INITFINI@
+
+ libsqlite3_mod_blobtoxy.la: blobtoxy.lo
+- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) \
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) \
+ -o libsqlite3_mod_blobtoxy.la \
+ blobtoxy.lo -rpath $(drvdir) -release $(VER_INFO)
+
+ libsqlite3_mod_impexp.la: impexp.lo
+- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) \
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) \
+ -o libsqlite3_mod_impexp.la \
+ impexp.lo -rpath $(drvdir) -release $(VER_INFO)
+
diff --git a/dev-db/sqliteodbc/metadata.xml b/dev-db/sqliteodbc/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/sqliteodbc/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/sqliteodbc/sqliteodbc-0.96.ebuild b/dev-db/sqliteodbc/sqliteodbc-0.96.ebuild
new file mode 100644
index 000000000000..79c2e94b6f81
--- /dev/null
+++ b/dev-db/sqliteodbc/sqliteodbc-0.96.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="ODBC driver to access local SQLite database files"
+HOMEPAGE="http://www.ch-werner.de/sqliteodbc/"
+SRC_URI="http://www.ch-werner.de/sqliteodbc/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc x86"
+IUSE=""
+
+DEPEND=">=dev-db/sqlite-3.6
+ || (
+ >=dev-db/unixODBC-2.2
+ >=dev-db/libiodbc-3.5
+ )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ tc-export CC
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-0.93-respect_LDFLAGS.patch"
+}
+
+src_configure() {
+ econf --disable-static
+}
+
+src_install() {
+ dodir "/usr/$(get_libdir)"
+ einstall
+ find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
+ dodoc ChangeLog README
+}
diff --git a/dev-db/sqliteodbc/sqliteodbc-0.99.ebuild b/dev-db/sqliteodbc/sqliteodbc-0.99.ebuild
new file mode 100644
index 000000000000..b82e0f692fec
--- /dev/null
+++ b/dev-db/sqliteodbc/sqliteodbc-0.99.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="ODBC driver to access local SQLite database files"
+HOMEPAGE="http://www.ch-werner.de/sqliteodbc/"
+SRC_URI="http://www.ch-werner.de/sqliteodbc/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~x86"
+IUSE=""
+
+DEPEND=">=dev-db/sqlite-3.6
+ || (
+ >=dev-db/unixODBC-2.2
+ >=dev-db/libiodbc-3.5
+ )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ tc-export CC
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-0.93-respect_LDFLAGS.patch"
+}
+
+src_configure() {
+ econf --disable-static
+}
+
+src_install() {
+ dodir "/usr/$(get_libdir)"
+ emake DESTDIR="${D}" install
+ find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
+ dodoc ChangeLog README
+}
diff --git a/dev-db/sqlitestudio/Manifest b/dev-db/sqlitestudio/Manifest
new file mode 100644
index 000000000000..7d1e865235ea
--- /dev/null
+++ b/dev-db/sqlitestudio/Manifest
@@ -0,0 +1,9 @@
+AUX sqlitestudio-3.0.6-portable.patch 313 SHA256 ab117e222d51f5209b94b327860616655f78766f66ae74b46da86632d6a73b07 SHA512 85a6c67488196b182ea3dc4df065ab175c0da5140d892fd9cfc7c2a120a2dc91b89878f66d92d7e9f085676f0c0dfff6adbfe5742868e62b1b47332232447f07 WHIRLPOOL 32b5d8751dc0025aea633d89720d00d7f7b833191e636e1bca3746d01f280d9c77206efc4ecd9f98a00f9d3e543d3c65cfc77e73d863f02085a7ebed6a3fac28
+AUX sqlitestudio-3.0.6-qt5_5-QDataStream.patch 912 SHA256 a413fbe6048a744e3ca0c5813a5a2a5193286f0aed97fe817fef56380b5dffc8 SHA512 217152e6a8cab0ef52de6f7704c1ed7db6f2b3134bd107d49c1c00405922afd0561046123dac53d91827856b6586c8946231643fe369b3775459cd247c46ceaf WHIRLPOOL 32c43b5eb3cd7770a433c13ac57c0601015eee5efff6540a2dfa186578dd0af73c9dd54a6d9be825e8af8d682f02c67b7a35688272bf676717fd751b0b993f38
+AUX sqlitestudio-3.0.7-paths.patch 735 SHA256 b749a65ba7d0ebe5da2a2908d2cb59e6a7b0524733bf3844a97c493f1528f707 SHA512 cbe5e66483fa8fcfde80e62f2061d59af002aa3f616e5674f49049c21d0683b3b0668c1793186dc2757c870ce71566ca38283e4f1d34bdecb903ab2eaabeebe2 WHIRLPOOL ba44177d02b812a018e7b104f6aec9d3ffaec62e9ef82b0e252c0767bdd9074a45ca92b8521a02556d0fe15cb499f027572c78428e2c607c76a5bbcf1d90f5c0
+DIST sqlitestudio-3.0.7.tar.gz 2551341 SHA256 b5ad7ac22a88eacb9404637ca6257934d0b1b59e16a182099bbdb158a7af55aa SHA512 2171fe26754aed2abe24d73e9ccc2ee1abe5e87228096bc5643c5638ad578dc323b810535f41d0206b3d7a7aa75132bfb578972c7945b962dd593543c7da3270 WHIRLPOOL 6078575b9bf6576d76965b2cf0c7a47a3b56488be8a75dd2df00b58cfab9d29e98ca30d21ac0dd47fe9a6fb0243052107b74686d90b12b9b2fbff05bc205736f
+DIST sqlitestudio-3.1.1.tar.gz 8610037 SHA256 f757a82466e97137addd70dd5323a1a7ba7cad7841dc138812a2da2799f92c6c SHA512 421247730660e8396f692fd8df9366e6ae834633823004ef3cb7c6f3064e66f420f0517df6a8542b800f7f88dacf2fc646b4224b423ab3994c7d8a083e82e143 WHIRLPOOL d3ce08e65ac53367067fd8cd73997cc1313a2cc9de2d15605b91bf57e729a1249c953c4db7b54901e8d41bb2b80d04184fbf19feaee9077e8a07002de2a61a2e
+EBUILD sqlitestudio-3.0.7.ebuild 3332 SHA256 9067d8c07d14d22baca6b89c620d228cbf742270286c787195acf46a837cd734 SHA512 d4560ef7865d0c5356ae23cecec834669e4ad17ab96e020bdd9a5d6dcd493fa038793296376538e5460c22a79df579a6ea90eeb3f1afa1d8cd2550de9d291547 WHIRLPOOL ce43532f7055c1d59b9ee1faae38afee1fa7364d3b78418e35444dbf327b3a2c3ca821aa27c3c07fc6aa2b65809b3ba39f78b9c373017290f5552ad350ffc452
+EBUILD sqlitestudio-3.1.1.ebuild 3499 SHA256 d04e9aeeebce6ac38b723219028fff795bd236d979219311804726f6d3f16e21 SHA512 38ac02906a394f8466064c25069ff979dcc8770cfba780fc083ddd11f0d86982a6f8fa57c439936546ca33ff1653ca48905d4c8ad8d47e2a78aeb84c49454e12 WHIRLPOOL b353d137c20ad03087d87875ee9ee5ddbbde1ef9b533ccf03ef88cfc1d81652ef04dff8e23ab652652c4c7db4e3335b62e2045f54daed03dbe3aa8b96dbd3beb
+MISC ChangeLog 1074 SHA256 18875759831ecc3a41a328073f3d68998950b6f5176eabbfdc97bb75919b04b9 SHA512 7a7d46c49f312106b7455225f652281054419b5a50e0cabfcdd45d160e11782b8b9364e226de10b74f63af5552a3edad8a49b1cd081e3289b6e0454fd648007f WHIRLPOOL f12592f3a8e90f236ab09b9863d308f1fb3b5ee792b2db9618b97f4ed524dade9887242412950ade05551ac78e9dbff14e8dc3429ac73fcc6ae0cb8df6fac27b
+MISC metadata.xml 427 SHA256 e59ddfb4880fee2e7ab90d0c07a4cddcd8a04dc36d522b0b605ca2e0d0eee441 SHA512 a6948ce576abceb4df085f103e097a720ef5f959c6f4bb79cc1f1d858e43cea625d5af3c5edf47f5e61c0a537368e60abd77ed3fcf39a9526543de315ef125b2 WHIRLPOOL 2f504fbf1dd740bcece03919034ba0e5f83c12bf9cefbabadfaab21fb2173a704ec5605f12c4b17630d9ff6f16b30f003ee9f665ff32cf4c1e6379e8ea5fb789
diff --git a/dev-db/sqlitestudio/files/sqlitestudio-3.0.6-portable.patch b/dev-db/sqlitestudio/files/sqlitestudio-3.0.6-portable.patch
new file mode 100644
index 000000000000..558a84231b81
--- /dev/null
+++ b/dev-db/sqlitestudio/files/sqlitestudio-3.0.6-portable.patch
@@ -0,0 +1,11 @@
+--- a/SQLiteStudio3/sqlitestudio/sqlitestudio.pro 2015-11-24 20:09:29.000000000 +0100
++++ b/SQLiteStudio3/sqlitestudio/sqlitestudio.pro 2016-01-20 15:04:46.700926391 +0100
+@@ -25,7 +25,7 @@
+
+ CONFIG += c++11
+ QMAKE_CXXFLAGS += -pedantic
+-linux|portable {
++portable {
+ QMAKE_LFLAGS += -Wl,-rpath,./lib
+ }
+
diff --git a/dev-db/sqlitestudio/files/sqlitestudio-3.0.6-qt5_5-QDataStream.patch b/dev-db/sqlitestudio/files/sqlitestudio-3.0.6-qt5_5-QDataStream.patch
new file mode 100644
index 000000000000..c42160c52f07
--- /dev/null
+++ b/dev-db/sqlitestudio/files/sqlitestudio-3.0.6-qt5_5-QDataStream.patch
@@ -0,0 +1,30 @@
+--- a/SQLiteStudio3/coreSQLiteStudio/db/db.cpp 2015-05-11 23:22:41.000000000 +0200
++++ b/SQLiteStudio3/coreSQLiteStudio/db/db.cpp 2016-01-20 02:21:00.350160645 +0100
+@@ -1,6 +1,7 @@
+ #include "db.h"
+ #include <QMetaEnum>
+ #include <QDebug>
++#include <QDataStream>
+
+ Db::Db()
+ {
+--- a/SQLiteStudio3/coreSQLiteStudio/common/utils.cpp 2015-05-11 23:22:41.000000000 +0200
++++ b/SQLiteStudio3/coreSQLiteStudio/common/utils.cpp 2016-01-20 01:46:22.113263710 +0100
+@@ -11,6 +11,7 @@
+ #include <QDebug>
+ #include <QRegularExpression>
+ #include <QDir>
++#include <QDataStream>
+
+ #ifdef Q_OS_LINUX
+ #include <sys/utsname.h>
+--- a/SQLiteStudio3/sqlitestudiocli/cli_config.h 2015-05-11 23:22:40.000000000 +0200
++++ b/SQLiteStudio3/sqlitestudiocli/cli_config.h 2016-01-20 02:45:11.393819294 +0100
+@@ -2,6 +2,7 @@
+ #define CLI_CONFIG_H
+
+ #include "config_builder.h"
++#include <QDataStream>
+
+ namespace CliResultsDisplay
+ {
diff --git a/dev-db/sqlitestudio/files/sqlitestudio-3.0.7-paths.patch b/dev-db/sqlitestudio/files/sqlitestudio-3.0.7-paths.patch
new file mode 100644
index 000000000000..59d8c0f187aa
--- /dev/null
+++ b/dev-db/sqlitestudio/files/sqlitestudio-3.0.7-paths.patch
@@ -0,0 +1,22 @@
+--- a/Plugins/DbAndroid/DbAndroid.pro 2015-11-24 20:09:41.000000000 +0100
++++ a/Plugins/DbAndroid/DbAndroid.pro 2016-01-20 13:39:02.436869035 +0100
+@@ -6,7 +6,7 @@
+
+ QT += widgets network
+
+-include($$PWD/../../../sqlitestudio/SQLiteStudio3/plugins.pri)
++include($$PWD/../../SQLiteStudio3/plugins.pri)
+
+ TARGET = DbAndroid
+ TEMPLATE = lib
+--- a/Plugins/ScriptingTcl/ScriptingTcl.pro
++++ b/Plugins/ScriptingTcl/ScriptingTcl.pro
+@@ -35,7 +35,7 @@ linux: {
+
+ # Find tclConfig.sh
+ TCL_CONFIG_DIR = $$system(echo "puts [info library]" | tclsh)
+- TCL_CONFIG = $$TCL_CONFIG_DIR/tclConfig.sh
++ TCL_CONFIG = $$TCL_CONFIG_DIR/../tclConfig.sh
+ message("Looking for $$TCL_CONFIG")
+ !exists($$TCL_CONFIG) {
+ # Debian case
diff --git a/dev-db/sqlitestudio/metadata.xml b/dev-db/sqlitestudio/metadata.xml
new file mode 100644
index 000000000000..0e58a49e7265
--- /dev/null
+++ b/dev-db/sqlitestudio/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>reagentoo@gmail.com</email>
+ <name>Dmitry Baranov</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="cli">Build CLI interface</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/sqlitestudio/sqlitestudio-3.0.7.ebuild b/dev-db/sqlitestudio/sqlitestudio-3.0.7.ebuild
new file mode 100644
index 000000000000..21747b2426f6
--- /dev/null
+++ b/dev-db/sqlitestudio/sqlitestudio-3.0.7.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Upstream guide: http://wiki.sqlitestudio.pl/index.php/Compiling_application_from_sources
+
+EAPI=6
+
+inherit qmake-utils fdo-mime kde5-functions
+
+DESCRIPTION="SQLiteStudio3 is a powerful cross-platform SQLite database manager"
+HOMEPAGE="http://sqlitestudio.pl"
+LICENSE="GPL-3"
+SRC_URI="${HOMEPAGE}/files/sqlitestudio3/complete/tar/${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cli cups tcl test"
+
+RDEPEND="
+ dev-db/sqlite:3
+ $(add_qt_dep qtcore)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtnetwork)
+ $(add_qt_dep qtscript)
+ $(add_qt_dep qtsvg)
+ $(add_qt_dep qtwidgets)
+ $(add_qt_dep qtxml)
+ $(add_qt_dep designer)
+ cups? ( $(add_qt_dep qtprintsupport) )
+ cli? ( sys-libs/readline:= )
+ tcl? ( dev-lang/tcl:= )
+"
+DEPEND="${RDEPEND}
+ $(add_qt_dep qtconcurrent)
+ >=sys-devel/gcc-4.8:*
+ test? ( $(add_qt_dep qttest) )
+"
+
+S="${WORKDIR}"
+core_build_dir="${S}/output/build"
+core_src_dir="${S}/SQLiteStudio3"
+plugins_build_dir="${core_build_dir}/Plugins"
+plugins_src_dir="${S}/Plugins"
+
+src_prepare() {
+ PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.6-qt5_5-QDataStream.patch
+ "${FILESDIR}"/${PN}-3.0.6-portable.patch
+ "${FILESDIR}"/${PN}-3.0.7-paths.patch
+ )
+ default
+
+ disable_modules() {
+ [ $# -lt 2 ] && return 0
+ local file="$1"; shift
+
+ edos2unix "${file}"
+
+ local regex=""
+ for m in "$@"; do
+ regex+="\b${m}\b( \\\\|\$)|"
+ done
+ regex="${regex:0:-1}" # last pipe
+
+ elog "Disabling modules: '$*' in '${file#${S}/}'"
+ sed -i -r -e "/${regex}/d" -- "${file}" || return 1
+ }
+
+ ## Core
+ local disabled_modules=(
+ $(usex cli '' 'cli')
+ )
+ disable_modules "${core_src_dir}/SQLiteStudio3.pro" "${disabled_modules[@]}" || die
+
+ ## Plugins
+ local disabled_plugins=(
+ 'DbSqlite2'
+ $(usex tcl '' 'ScriptingTcl')
+ $(usex cups '' 'Printing')
+ )
+ disable_modules "${plugins_src_dir}/Plugins.pro" "${disabled_plugins[@]}" || die
+}
+
+src_configure() {
+ local qmake_args=(
+ "LIBDIR=${EROOT}usr/$(get_libdir)"
+ "BINDIR=${EROOT}usr/bin"
+ "DEFINES+=PLUGINS_DIR=${EROOT}usr/$(get_libdir)/${PN}"
+ "DEFINES+=ICONS_DIR=${EROOT}usr/share/${PN}/icons"
+ "DEFINES+=FORMS_DIR=${EROOT}usr/share/${PN}/forms"
+
+ 'DEFINES+=NO_AUTO_UPDATES' # not strictly needed since 3.0.6, but nevermind
+ $(usex test 'DEFINES+=tests' '')
+ )
+
+ ## Core
+ mkdir -p "${core_build_dir}" && cd "${core_build_dir}" || die
+ eqmake5 "${qmake_args[@]}" "${core_src_dir}"
+
+ ## Plugins
+ mkdir -p "${plugins_build_dir}" && cd "${plugins_build_dir}" || die
+ eqmake5 "${qmake_args[@]}" "${plugins_src_dir}"
+}
+
+src_compile() {
+ cd "${core_build_dir}" || die && emake
+ cd "${plugins_build_dir}" || die && emake
+}
+
+src_install() {
+ cd "${core_build_dir}" || die && emake INSTALL_ROOT="${ED}" install
+ cd "${plugins_build_dir}" || die && emake INSTALL_ROOT="${ED}" install
+
+ dodoc "${core_src_dir}/docs/sqlitestudio3_docs.cfg"
+ doicon -s scalable "${core_src_dir}/guiSQLiteStudio/img/${PN}.svg"
+
+ make_desktop_entry_args=(
+ "${EROOT}usr/bin/${PN} %F" # exec
+ 'SQLiteStudio3' # name
+ "${PN}" # icon
+ 'Development;Utility' # categories
+ )
+ make_desktop_entry_extras=( 'MimeType=application/x-sqlite3;' )
+ make_desktop_entry "${make_desktop_entry_args[@]}" \
+ "$( printf '%s\n' "${make_desktop_entry_extras[@]}" )"
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+}
diff --git a/dev-db/sqlitestudio/sqlitestudio-3.1.1.ebuild b/dev-db/sqlitestudio/sqlitestudio-3.1.1.ebuild
new file mode 100644
index 000000000000..5c183c9c63d5
--- /dev/null
+++ b/dev-db/sqlitestudio/sqlitestudio-3.1.1.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PLOCALES="de es fr it pl pt_BR ru sk zh_CN"
+
+inherit eutils l10n qmake-utils xdg
+
+DESCRIPTION="Powerful cross-platform SQLite database manager"
+HOMEPAGE="https://sqlitestudio.pl"
+SRC_URI="https://sqlitestudio.pl/files/sqlitestudio3/complete/tar/${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="cli cups tcl test"
+
+RDEPEND="
+ dev-db/sqlite:3
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtscript:5
+ dev-qt/qtsvg:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtxml:5
+ cli? ( sys-libs/readline:* )
+ cups? ( dev-qt/qtprintsupport:5 )
+ tcl? ( dev-lang/tcl:* )
+"
+DEPEND="${RDEPEND}
+ dev-qt/designer:5
+ dev-qt/qtconcurrent:5
+ test? ( dev-qt/qttest:5 )
+"
+
+S="${WORKDIR}"
+core_build_dir="${S}/output/build"
+plugins_build_dir="${core_build_dir}/Plugins"
+
+src_prepare() {
+ xdg_src_prepare
+
+ sed -i -e 's/linux|portable/portable/' \
+ SQLiteStudio3/sqlitestudio/sqlitestudio.pro || die
+
+ disable_modules() {
+ [[ $# -lt 2 ]] && die "not enough arguments"
+
+ local pro="$1"; shift
+ local modules="${@}"
+
+ sed -r -i \
+ -e 's/('${modules// /|}')[[:space:]]*(\\?)/\2/' \
+ ${pro} || die
+ }
+
+ use cli || disable_modules SQLiteStudio3/SQLiteStudio3.pro cli
+
+ local mod_lst=( DbSqlite2 )
+ use cups || mod_lst+=( Printing )
+ use tcl || mod_lst+=( ScriptingTcl )
+ disable_modules Plugins/Plugins.pro ${mod_lst[@]}
+
+ local mylrelease="$(qt5_get_bindir)"/lrelease
+ local ts_dir_lst=$(find * -type f -name "*.qm" -printf '%h\n' | sort -u)
+ local ts_pro_lst=$(find * -type f -name "*.pro" -exec grep -l 'TRANSLATIONS' {} \;)
+ local ts_qrc_lst=$(find * -type f -name "*.qrc" -exec grep -l '\.qm' {} \;)
+
+ # delete all "*.qm"
+ for ts_dir in ${ts_dir_lst[@]}; do
+ rm "${ts_dir}"/*.qm || die
+ done
+
+ prepare_locale() {
+ for ts_dir in ${ts_dir_lst[@]}; do
+ local ts=$(find "${ts_dir}" -type f -name "*${1}.ts" || continue)
+ "${mylrelease}" "${ts}" || die "preparing ${1} locale failed"
+ done
+ }
+
+ rm_locale() {
+ for ts_pro in ${ts_pro_lst[@]}; do
+ sed -i -r -e 's/[^[:space:]]*'${1}'\.ts//' \
+ ${ts_pro} || die
+ done
+
+ for ts_qrc in ${ts_qrc_lst[@]}; do
+ sed -i -e '/'${1}'\.qm/d' \
+ ${ts_qrc} || die
+ done
+ }
+
+ local ts_dir_main="SQLiteStudio3/sqlitestudio/translations"
+ l10n_find_plocales_changes ${ts_dir_main} "sqlitestudio_" '.ts'
+ l10n_for_each_locale_do prepare_locale
+ l10n_for_each_disabled_locale_do rm_locale
+}
+
+src_configure() {
+ # NOTE: QMAKE_CFLAGS_ISYSTEM option prevents
+ # build error with tcl use enabled (stdlib.h is missing)
+ local myqmakeargs=(
+ "BINDIR=${EPREFIX}/usr/bin"
+ "LIBDIR=${EPREFIX}/usr/$(get_libdir)"
+ "QMAKE_CFLAGS_ISYSTEM=\"\""
+ $(usex test 'DEFINES+=tests' '')
+ )
+
+ ## Core
+ mkdir -p "${core_build_dir}" && cd "${core_build_dir}" || die
+ eqmake5 "${myqmakeargs[@]}" "${S}/SQLiteStudio3"
+
+ ## Plugins
+ mkdir -p "${plugins_build_dir}" && cd "${plugins_build_dir}" || die
+ eqmake5 "${myqmakeargs[@]}" "${S}/Plugins"
+}
+
+src_compile() {
+ emake -C "${core_build_dir}"
+ emake -C "${plugins_build_dir}"
+}
+
+src_install() {
+ emake -C "${core_build_dir}" INSTALL_ROOT="${D}" install
+ emake -C "${plugins_build_dir}" INSTALL_ROOT="${D}" install
+
+ doicon -s scalable "SQLiteStudio3/guiSQLiteStudio/img/${PN}.svg"
+
+ local make_desktop_entry_args=(
+ "${PN} -- %F"
+ 'SQLiteStudio3'
+ "${PN}"
+ 'Development;Database;Utility'
+ )
+ make_desktop_entry "${make_desktop_entry_args[@]}" \
+ "$( printf '%s\n' "MimeType=application/x-sqlite3;" )"
+}
diff --git a/dev-db/textsearch_ja/Manifest b/dev-db/textsearch_ja/Manifest
new file mode 100644
index 000000000000..c6ab9a8b16b3
--- /dev/null
+++ b/dev-db/textsearch_ja/Manifest
@@ -0,0 +1,5 @@
+DIST textsearch_ja-9.0.0.tar.gz 47126 SHA256 f9cd1c48836bb4707b8ca8e88c835f461d43c4ce48c3cee430f072cf258a7a04 SHA512 1a516431709f2e9ec14a32c7edf7a6cafd2bd231853ead42d7a6381a964a66df37414f9e99959a3cc1f3b6dd50cce1f8142b300f255ae8eb498f6e3544e0dcd4 WHIRLPOOL 5c2c7675d25e23c63de589a4d376d27f621582b0f2e0e5f2f47c3e7854c81ecba6dfcc43bd4296dfcca8420092f0831d4e368b6e44676d8fe6a0531d3e5efc76
+EBUILD textsearch_ja-9.0.0.ebuild 605 SHA256 24ee910734c7e3fc23769ec965bbdb9493473c300b13e760c5a039c608511fb6 SHA512 556262040bcbb55c1f5b902742f19788c23430ecd3d8a55fb8a1b121d1fb7d406f0298d462d7468da85eb5241311b95693d29b86c4cf6e3699a350cba4fd17f6 WHIRLPOOL 48e155dcbe687e5ce94b188b1c23d499bae135e3456a83adad4b14396214961cd43d8a19e5f6dafc97c559356383ac25784d65c8c34a5a440de15ddb2508294f
+MISC ChangeLog 2443 SHA256 64af7278015618fd6f1e20ad9206439bd739ca756a0face98fc11cc27364b9ca SHA512 ab53212f9c1a7bd247b9cccf77b4e0e67f28522ca7da41d5a245149004c117ac8633a5578c137b2390028e19a688bc11d71b63fd45e17f34729cf37f2f789155 WHIRLPOOL be949139fdc829df8004c987a8c7372e1b1ebc83c7f694682c504929298a45b1090fac5c3c31ea709a81094d5a88f8d3184284ebd81d8d0d6fb4ec46fd4ed3f8
+MISC ChangeLog-2015 1060 SHA256 750c3e063a65fb4614bef1771dbb110c03aea7a548d56fe80087d1ee6ed7e870 SHA512 88f67669d688a1c9c8fb0ee6cc74699c80c7075a99567ceb8df3c06e5a271d981dbeadc6cb88841d59729efb646f2f34c3b062966e86b6954611a1d7e2842d70 WHIRLPOOL cc0191d0bc308a9243f0f6383bef224dbcc75dad8043dce3ffe22815888d2ffdfeb7d5176ab38cfdad9d66d74346c9c7904b394ead20efe8cd3111f28def623f
+MISC metadata.xml 230 SHA256 5fc421627b578ee2d1317320525119c0b406026597bb1d054f96254a241bf96a SHA512 74065bee639a38ecdef7c32280ed43a8f1627362cd8e97e714a09bcf116ae8bc4c61b2ab13c31bd02a22ae8a5a201263981ee519a0b6ba9df81a4d5f3cd94eb1 WHIRLPOOL b3c1363540645200abd5bf0b5b7fb3cae0b738bfd359f7b13b56d97650f9381fccede1e3f867dbc736461ee7c7906725a3c53eabd9ac99929d5c7c520a831082
diff --git a/dev-db/textsearch_ja/metadata.xml b/dev-db/textsearch_ja/metadata.xml
new file mode 100644
index 000000000000..c921b96adf6c
--- /dev/null
+++ b/dev-db/textsearch_ja/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/textsearch_ja/textsearch_ja-9.0.0.ebuild b/dev-db/textsearch_ja/textsearch_ja-9.0.0.ebuild
new file mode 100644
index 000000000000..2fa5d4ea83b1
--- /dev/null
+++ b/dev-db/textsearch_ja/textsearch_ja-9.0.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="Integrated Full-Text-Search for Japanese language using morphological analyze"
+HOMEPAGE="http://textsearch-ja.projects.postgresql.org/index.html"
+SRC_URI="http://pgfoundry.org/frs/download.php/2943/textsearch_ja-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="app-text/mecab
+ >=dev-db/postgresql-7.4[server]" # pgmecab requires PGXS
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ emake USE_PGXS=1
+}
+
+src_install() {
+ emake DESTDIR="${D}" USE_PGXS=1 install
+}
diff --git a/dev-db/tinycdb/Manifest b/dev-db/tinycdb/Manifest
new file mode 100644
index 000000000000..e6086b342326
--- /dev/null
+++ b/dev-db/tinycdb/Manifest
@@ -0,0 +1,8 @@
+AUX tinycdb-gentoo.patch 711 SHA256 e075573eec54b8b001a547538ab8947e84c6b6d1bf44ae1a00ee6676c6b009bb SHA512 b188db6904ef63a262a88aa79d1488ede1a9917af8e33b97da5d80c34cb00065bb42e84b00e20548a85f5f0b939679f5a3d85336b938318f98d101d880489415 WHIRLPOOL 070b8c49369f5c07cc6401310f94a6e99b54661aaec9c5682a30b07174472a6cf01bab10d839292440e45045e6c18ce888504d816dd2ef81c004ebd4e8359cd2
+AUX tinycdb-uclibc.patch 328 SHA256 c1e19e80a9ae59860d0f75ffae08ee984b78977f2b07b9689cb7c9685b961975 SHA512 b58656fbcdcd21d46ace85ba50fcbc9a85b3c0d02fe3c7ba048276e6a22e2d8a91dce6fe5f853a3516071e33fc9513216148b0e92ebe13b75b201881e73f127f WHIRLPOOL f1fb181a97f94cc5f7b944271bbb8e8a792155b955b7700df1ffaa44e12a9d0c7db12b128d8f2c50806704cef93c993478cf483b7b752fdf6d5fdfc1c92c49d6
+AUX tinycdb-umask.patch 215 SHA256 76077efd1de189a63681657121eb342c8b0b7ecbe24158af0dfc6c97dec048f2 SHA512 57eae9200d7ea13ae5d761f0c4575b0d438f24f696bd0c2d29c720f27a706bf5dba94f34fb0c93213ee5c6dbd12af449e2fbcc11ec1872e8ecc4a9a66c9d0905 WHIRLPOOL c535fdc0ec64b648d515f47244c72d7af4f4e45eb15c34b2ad5fbfb503ad8c4926d53c2c371a835d62ee42f6d42547375ba060d59ac8c775230be0b0cdf4800d
+DIST tinycdb_0.77.tar.gz 37728 SHA256 82bc3ccf0afed0978472a070ce4506667b8035e65d0dc24388e33858d39b6bc6 SHA512 cfc830578a9be49781a1dbade97b64ec13293853093719aeb9a403c128245f157fd1d2d7e6941966bdea00b472127f10f11672583ba06ccc6e49151b22bf4c9a WHIRLPOOL d9e0b94932a0455660f5fe8bac1fbbe79dc5774c3742a135c2543d5ce698cea077191ea135465930c017ed20601f65d85b86f614b5814cb4d741198ada55660f
+EBUILD tinycdb-0.77-r2.ebuild 1068 SHA256 91626fab3c088b81ff8739dd1d8986c3dd16e49373cd9ddda0694c25033ea228 SHA512 fbdf16205746a7c675a3974e577099c0cd9071ae4cbf84f2c110e097f7bd7fc48baf975274e181d5557006748eeba9c408124c5eeaafd598cf8b9ad047b21bd7 WHIRLPOOL c63a04ac426eaecce99b313dc488a32901eaebc0ccd22201ae4e8f6e3e915dfc2e460f9a7a209735e99dcc2b3259fdd8081193c511e6dd5becc6fa782ba46c15
+MISC ChangeLog 2278 SHA256 dddca81d7c7bcfb84a7198d46a3aded95b4bca395b72bf3fd29d9072375a9768 SHA512 2fed44c5fdb6de47f187b5ff8e64384a3c5f3437292db07fbb9f182ec9e2a328644124485b3757f155202bb5b2f5a79405582f1849e40864daa8bcf7b7fa4696 WHIRLPOOL 1d9b61b333e086828e3ebe058077cfb27cefbcf5bc9184da5b76bbc70c4d927296c4c25a4a0367747fa0d8b38e2417e1fe2c5f16fac6bb1797e7c2f194029f44
+MISC ChangeLog-2015 4850 SHA256 17ce0b0197e4bdd4af8595f5dd4fa58d8599ef4f9d015cf80c59702defe49ff0 SHA512 1f375ebcd66243f0bd5c3eb80799e65abacaef257b9072f3ffa4ce46aec99f707d7338d86b553815759dc046b52e796ff6342cd9ca31b6a78fd63d6fe243b7c5 WHIRLPOOL e42c9753ceec4afc1d7c82d9d763fb819d09fd3ea57285caafd4fbe812f2848db3eb47691c16fc9e34c59bf8d05c4cf0d7c5c0b0ca2097c081bb3533df3108e5
+MISC metadata.xml 221 SHA256 27a3fa259bbce0eb90b1fe397126b9d5ef4e906e824ae72f9ea923fff8da6d02 SHA512 a11e9bbbabc9ac96985c5dc247e601b065fa762f12bce74224896c27aee34eb908187622bfc849c39c6c722a8ef8ee72b248afc84da1b0eb72f1ff5eeb13bbf0 WHIRLPOOL e8ddaad694d5f22a229ccc3dc7597a11dce9ffd502ed3fa64b9cc760d3404c4dac31c9b9948b38b2eee0efc446a8aee52a73f87ec28d229670ba3bfc3cb9a95c
diff --git a/dev-db/tinycdb/files/tinycdb-gentoo.patch b/dev-db/tinycdb/files/tinycdb-gentoo.patch
new file mode 100644
index 000000000000..e8406b647d4b
--- /dev/null
+++ b/dev-db/tinycdb/files/tinycdb-gentoo.patch
@@ -0,0 +1,28 @@
+--- a/Makefile
++++ b/Makefile
+@@ -34,7 +34,7 @@
+ CDB_USELIB = $(LIB)
+ NSS_USELIB = $(PICLIB)
+ LIBMAP = $(LIBBASE).map
+-INSTALLPROG = cdb
++INSTALLPROG = cdb-shared
+
+ # The following assumes GNU CC/LD -
+ # used for building shared libraries only
+@@ -59,7 +59,7 @@
+ ChangeLog NEWS
+ DEBIANFILES = debian/control debian/rules debian/copyright debian/changelog
+
+-all: static
++all: shared
+ static: staticlib cdb
+ staticlib: $(LIB)
+ nss: $(NSS_CDB)
+@@ -128,6 +128,7 @@
+
+ do_install = \
+ while [ "$$1" ] ; do \
++ if [ ! -f $$1 ]; then shift 4; continue; fi; \
+ if [ .$$4 = .- ]; then f=$$1; else f=$$4; fi; \
+ d=$(DESTDIR)$$3 ; echo installing $$1 to $$d/$$f; \
+ [ -d $$d ] || mkdir -p $$d || exit 1 ; \
diff --git a/dev-db/tinycdb/files/tinycdb-uclibc.patch b/dev-db/tinycdb/files/tinycdb-uclibc.patch
new file mode 100644
index 000000000000..14e56bd7b6fc
--- /dev/null
+++ b/dev-db/tinycdb/files/tinycdb-uclibc.patch
@@ -0,0 +1,15 @@
+--- a/cdb.c
++++ b/cdb.c
+@@ -31,6 +31,12 @@
+ # define HAVE_PROGRAM_INVOCATION_SHORT_NAME
+ #endif
+
++#ifdef __UCLIBC__
++# ifndef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
++# undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
++# endif
++#endif
++
+ #ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME
+ # define progname program_invocation_short_name
+ #else
diff --git a/dev-db/tinycdb/files/tinycdb-umask.patch b/dev-db/tinycdb/files/tinycdb-umask.patch
new file mode 100644
index 000000000000..2a53babb2510
--- /dev/null
+++ b/dev-db/tinycdb/files/tinycdb-umask.patch
@@ -0,0 +1,11 @@
+--- a/cdb.c
++++ b/cdb.c
+@@ -21,6 +21,8 @@
+ #include <stdarg.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <sys/types.h> /* umask() */
++#include <sys/stat.h> /* umask() */
+ #include "cdb.h"
+
+ #ifndef EPROTO
diff --git a/dev-db/tinycdb/metadata.xml b/dev-db/tinycdb/metadata.xml
new file mode 100644
index 000000000000..21dc8fdf43ff
--- /dev/null
+++ b/dev-db/tinycdb/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hattya@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/tinycdb/tinycdb-0.77-r2.ebuild b/dev-db/tinycdb/tinycdb-0.77-r2.ebuild
new file mode 100644
index 000000000000..bcdf2cd19b55
--- /dev/null
+++ b/dev-db/tinycdb/tinycdb-0.77-r2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit toolchain-funcs
+
+DESCRIPTION="A very fast and simple package for creating and reading constant data bases"
+HOMEPAGE="http://www.corpit.ru/mjt/tinycdb.html"
+SRC_URI="http://www.corpit.ru/mjt/${PN}/${P/-/_}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 hppa ia64 ppc x86"
+IUSE="static-libs"
+RESTRICT="test"
+
+RDEPEND="!dev-db/cdb"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-gentoo.patch
+ "${FILESDIR}"/${PN}-umask.patch
+ "${FILESDIR}"/${PN}-uclibc.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i "/^libdir/s:/lib:/$(get_libdir):" Makefile
+}
+
+src_compile() {
+ local targets="shared"
+ use static-libs && targets+=" staticlib piclib"
+
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} ${LDFLAGS}" \
+ ${targets}
+}
+
+src_install() {
+ local targets="install install-sharedlib"
+ use static-libs && targets+=" install-piclib"
+
+ emake \
+ prefix="${EPREFIX}"/usr \
+ mandir="${EPREFIX}"/usr/share/man \
+ DESTDIR="${D}" \
+ ${targets}
+ einstalldocs
+}
diff --git a/dev-db/tokumx/Manifest b/dev-db/tokumx/Manifest
new file mode 100644
index 000000000000..999038d0a676
--- /dev/null
+++ b/dev-db/tokumx/Manifest
@@ -0,0 +1,12 @@
+AUX 1.5.0-Werror.diff 2195 SHA256 4c0c9b0b3c08838ee0139f459559889459d340774c9c7a1c0c3ab33e0e841a25 SHA512 ac6c2f40e65bc4476a5a9def8c56865675da0099d910ff99e14c3a53df3d5055433ca5d5d4f92e23a1cd4b468555936412ead1a35ae5fd017f232e0afa6c60e6 WHIRLPOOL 4798ad52f6e920ff3b2c292329d07ec6e0f008042516a5530207a0bdd8b2178892f4a309b72569ea1a90c49f88dcb7fa4583bfb8c75cbbc04489e9bd088377b4
+AUX 1.5.0-boost-57.diff 419 SHA256 4b28b2ad1fc486861ea0a80023907dc340508ee955e8f079ba2122dcceff297b SHA512 2ccdf5514ff53af949f81cbea77c425d00454c6a8b73abcfe8c3260d08e3dfb31d92447a151311137536265bf7baf9cdb3eafb227a034b813e250e4e820b45b0 WHIRLPOOL 8aca6a80c72bcf5c8885b3bbc293bdadeb10e0642949bb809c411ccd626af5f55b524b7b96bc05420ee9b890d832d4cbf99b3c813538eb5c6e775d60880c4a10
+AUX tokumx-2.0.2-boost-57.patch 969 SHA256 0492b0a115cfa8b594e42517a5b057f89705108df77a7626c2edeb002dd6b554 SHA512 366015bc427022cdb76a8bd65227de0a120ebeebde14b5e403476ef0efeb9e8b1fbb84b037bc46a77e91160cb0670c8f05d64f437cc89b50dd9030123df3ef79 WHIRLPOOL d147bb0b43073768f69da39d9730f6293b545c061c3a9d88420322c0a048cfde97ec1e3e51e3bd5362b87d4734506feacb88a82ba7b8b6ca572f205d9a5b36df
+AUX tokumx-2.0.2-no-werror.patch 4372 SHA256 1c498bb50b1136e7e556428cefaaab34e292cc27fb6c77c771e1c8fbf8002b38 SHA512 fdcd3894a9bf8fd3a4301d8f77643f1aaedf1b67da664820114759187555c733eb495a8b28e67a431c4648075af82fe1d2059efa0028f3091b52456b8e185872 WHIRLPOOL 90d790b2825e2e5941652b5c46351c8b77b21cc83bc761d8dea54cddf6180e3479b40703122ebfc24a4efafbaebfb99f29492afb7f8875fdef52aa58913603c2
+AUX tokumx-disable-bundled-libs.patch 477 SHA256 cdcfbe6a6be63dd9e44c8aceed935d65eb1cba7f72d4e177d64492a48b2c7df2 SHA512 acb735167d9753aca5597a81f13696e0c158f837cff8eed703ac777824ef7fef71a339415c0b948f48dc992d0919ef3a0d747f37bb6ff9670e95475f0cf5057f WHIRLPOOL dacb3b8f4ee7d5c9f09ca3d870c61b9d818843c2c841bbb8ab0a12bbfac2aee59b38c720d98575e1817efff954805cc737aad41656aea647c3c51435b8d8578c
+DIST tokumx-enterprise-2.0.2.tar.gz 16756175 SHA256 2ba471715f399a2652e75a978afde89072fce5560c0813a901a1dadb28582e6b SHA512 8d063abcbe16ce50b5b7f99ae6deec348cf60bb8bb57a3b06e478c03af7ded7501ca6ca15ac63ef07bf3fa0da59a30571b9a799fa5c5a9dcbac741c0a674b1f6 WHIRLPOOL 24546adf1466327571406af41378a15d1ceea58ff92aa01b8f758746cc4b54eabac100710c5bfab53f380f073edf081fc47e5c096df598f96c5e971bdee52805
+DIST tokumx-git-tag-1.5.0.tar.bz2 13059584 SHA256 381747c47073c8a6f8717a27756bb793ec6d80f4f7d119385f8d7b805a3d827d SHA512 ba19237db7d3dcbd3ac07b8cc4860549830fa065fa4d26cbae685274524cd5b89f671d5f126ec25bee605c99929ce0436bb2ac32d67efdbb8dd6d7526d3f1c24 WHIRLPOOL e5e33e28ce55b1abcff603a40453ab0a9d68f61cd15c68950dd6f87371565bd05057e8e48475f772524684fdb744093867423b249614d4c02908a467f9380c75
+EBUILD tokumx-1.5.0-r2.ebuild 2011 SHA256 22ed382400ab8dce39e2904a345775398739a466dbe97b63e99ea621e91b7346 SHA512 d21efce4a337030babacf95f856148e479717bcad25d247de4105556aaa53780a08af3f121fc85c9c0ccdaa77d6054294b1e66765e5b8c51e27049236121162a WHIRLPOOL bedcd2c92cdcc6b39372879da37b09b1d99594a6b6502dc24391edb50e1fb21906eabce96a933623a8f7b8d95986b1f7005c5b795e4f9feb91f1414d76145a74
+EBUILD tokumx-2.0.2.ebuild 2044 SHA256 645fa08429d5f73760350ced36721ed23e3995612d255689606bb0cc25a87da3 SHA512 86c94bc545534c0e28456cc28e6ddb64671994879802867d2fe7fdfe9ae79d0e902c928d5273aac2161b99c0c0466cf3c6b44f1033920daa16b0e88cabf01720 WHIRLPOOL 7aecc691c093b8b63a3216af797de1c2e9a4070e68c122409464028434b055e0e4287aed88d62a3e7fd2749e9c3c409077e84aec2d1b6c990bd9d638a5770be1
+MISC ChangeLog 3419 SHA256 f44d229eec1d38b80ac3ec13a51daccb349ad3175fc88b6db6ed02c2337658e6 SHA512 30a2a2e541b05d13afa971d7646b3dbceb267dd524bfb1045dffbaf7f8850e07212dd8e4351893a6ae7832bf82c6398e60315f3fed7b84bd6de9e04144324698 WHIRLPOOL 10f09b7774908f876b856805790cba2721b902ebdd8eaa9fca24d4c9c78528a2b0715d21106df952475baa4e43a68c132c213d9b9abb39e8da3cc9d9aa308a58
+MISC ChangeLog-2015 1019 SHA256 bf5fc22b2a613f10e98f092861e07e0f3896bfcc1f9c980be0e19e96c749d18f SHA512 7534e38c7ed4b6ecaa740a89857317cba1d1658dd7a9f8ee1dc1deb4e7b1389a66a72bb7b83c7db282c469aff0c61aae814059e485b90ccab93fa67e4477a1b8 WHIRLPOOL 197062b95967a2ebac7167990a5e8e81f2a40c028718e1f4defa609a8a4b79e1612d45cce2457861a379eb4d953d1254c29898d1190ef8f3aa2532425fe06290
+MISC metadata.xml 503 SHA256 ab4706b5f9f83c2746648a9b610239759e4f17ed9a0425262b2f24032d736b1b SHA512 4152202513c90e62c95c6aae0ca54f7c3ea2152b553dcc802c391f44778beaab8042f5b3a9c38a89d6f2e80ef32c1aa7ae53e2a4fa55e83620ebe3350c920b54 WHIRLPOOL 704fb4a55f27ec26610bc2a1788a22a2e596f3351d6a9d1c2274d1bbec3a40d3f9291110e60f90424f3f5061591ce680c3255128e1d2422fe48e286c8849e1a5
diff --git a/dev-db/tokumx/files/1.5.0-Werror.diff b/dev-db/tokumx/files/1.5.0-Werror.diff
new file mode 100644
index 000000000000..a865fe074f37
--- /dev/null
+++ b/dev-db/tokumx/files/1.5.0-Werror.diff
@@ -0,0 +1,45 @@
+diff -uNr work.ORIG/mongo/CMakeLists.txt work/mongo/CMakeLists.txt
+--- work.ORIG/mongo/CMakeLists.txt 2014-08-01 11:51:20.832614062 +0100
++++ work/mongo/CMakeLists.txt 2014-08-01 11:51:36.898614862 +0100
+@@ -71,14 +71,13 @@
+ endforeach(flag)
+ endmacro(set_cxxflags_if_supported)
+
+-set(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing -ggdb -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe")
++set(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing -ggdb -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe")
+ set(CMAKE_CXX_FLAGS "-fPIC -fno-strict-aliasing -ggdb")
+ set_cxxflags_if_supported(
+ -Wall
+ -Wsign-compare
+ -Wno-unknown-pragmas
+ -Winvalid-pch
+- -Werror
+ -pipe
+ -Wnon-virtual-dtor
+ -Woverloaded-virtual
+diff -uNr work.ORIG/mongo/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake work/mongo/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake
+--- work.ORIG/mongo/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake 2014-08-01 11:51:20.696614056 +0100
++++ work/mongo/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake 2014-08-01 11:51:36.898614862 +0100
+@@ -174,8 +174,8 @@
+ endif ()
+
+ ## always want these
+-set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
+-set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")
++set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
++set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
+
+ ## need to set -stdlib=libc++ to get real c++11 support on darwin
+ if (APPLE)
+diff -uNr work.ORIG/mongo/src/third_party/ft-index/examples/Makefile work/mongo/src/third_party/ft-index/examples/Makefile
+--- work.ORIG/mongo/src/third_party/ft-index/examples/Makefile 2014-08-01 11:51:20.676614055 +0100
++++ work/mongo/src/third_party/ft-index/examples/Makefile 2014-08-01 11:51:36.898614862 +0100
+@@ -1,7 +1,7 @@
+ SRCS = $(wildcard *.c)
+ TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%-bdb,$(SRCS))
+ CPPFLAGS = -I../include -D_GNU_SOURCE
+-CFLAGS = -g -std=c99 -Wall -Wextra -Werror -Wno-missing-field-initializers
++CFLAGS = -g -std=c99 -Wall -Wextra -Wno-missing-field-initializers
+ ifeq ($(USE_STATIC_LIBS),1)
+ LIBTOKUDB = tokufractaltree_static
+ LIBTOKUPORTABILITY = tokuportability_static
diff --git a/dev-db/tokumx/files/1.5.0-boost-57.diff b/dev-db/tokumx/files/1.5.0-boost-57.diff
new file mode 100644
index 000000000000..e66aec168712
--- /dev/null
+++ b/dev-db/tokumx/files/1.5.0-boost-57.diff
@@ -0,0 +1,11 @@
+diff -uNr work.ORIG/mongo/src/mongo/shell/linenoise_utf8.h work/mongo/src/mongo/shell/linenoise_utf8.h
+--- work.ORIG/mongo/src/mongo/shell/linenoise_utf8.h 2017-03-30 15:20:51.880842717 +0100
++++ work/mongo/src/mongo/shell/linenoise_utf8.h 2017-03-30 15:21:26.002844416 +0100
+@@ -16,6 +16,7 @@
+ */
+
+ #include <boost/smart_ptr/scoped_array.hpp>
++#include <algorithm>
+ #include <string.h>
+
+ namespace linenoise_utf8 {
diff --git a/dev-db/tokumx/files/tokumx-2.0.2-boost-57.patch b/dev-db/tokumx/files/tokumx-2.0.2-boost-57.patch
new file mode 100644
index 000000000000..52b3b9f12064
--- /dev/null
+++ b/dev-db/tokumx/files/tokumx-2.0.2-boost-57.patch
@@ -0,0 +1,22 @@
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/mongo/shell/linenoise.cpp tokumx-enterprise-2.0.2/src/mongo/shell/linenoise.cpp
+--- tokumx-enterprise-2.0.2.ORIG/src/mongo/shell/linenoise.cpp 2016-11-21 11:52:54.883542356 +0000
++++ tokumx-enterprise-2.0.2/src/mongo/shell/linenoise.cpp 2016-11-21 11:53:11.995543208 +0000
+@@ -117,6 +117,7 @@
+ #include "mk_wcwidth.h"
+ #include <string>
+ #include <vector>
++#include <algorithm>
+ #include <boost/smart_ptr/scoped_array.hpp>
+
+ using std::string;
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/mongo/shell/linenoise_utf8.h tokumx-enterprise-2.0.2/src/mongo/shell/linenoise_utf8.h
+--- tokumx-enterprise-2.0.2.ORIG/src/mongo/shell/linenoise_utf8.h 2016-11-21 11:52:54.883542356 +0000
++++ tokumx-enterprise-2.0.2/src/mongo/shell/linenoise_utf8.h 2016-11-21 11:53:31.610544185 +0000
+@@ -15,6 +15,7 @@
+ * limitations under the License.
+ */
+
++#include <algorithm>
+ #include <boost/smart_ptr/scoped_array.hpp>
+ #include <string.h>
+
diff --git a/dev-db/tokumx/files/tokumx-2.0.2-no-werror.patch b/dev-db/tokumx/files/tokumx-2.0.2-no-werror.patch
new file mode 100644
index 000000000000..5a0c160e8866
--- /dev/null
+++ b/dev-db/tokumx/files/tokumx-2.0.2-no-werror.patch
@@ -0,0 +1,88 @@
+diff -uNr tokumx-enterprise-2.0.2.ORIG/CMakeLists.txt tokumx-enterprise-2.0.2/CMakeLists.txt
+--- tokumx-enterprise-2.0.2.ORIG/CMakeLists.txt 2016-11-21 11:15:27.517430430 +0000
++++ tokumx-enterprise-2.0.2/CMakeLists.txt 2016-11-21 11:16:27.874433436 +0000
+@@ -82,14 +82,13 @@
+ endforeach(flag)
+ endmacro(set_cxxflags_if_supported)
+
+-set(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing -ggdb -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe")
++set(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing -ggdb -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe")
+ set(CMAKE_CXX_FLAGS "-fPIC -fno-strict-aliasing -ggdb")
+ set_cxxflags_if_supported(
+ -Wall
+ -Wsign-compare
+ -Wno-unknown-pragmas
+ -Winvalid-pch
+- -Werror
+ -pipe
+ -Wnon-virtual-dtor
+ -Woverloaded-virtual
+diff -uNr tokumx-enterprise-2.0.2.ORIG/SConstruct tokumx-enterprise-2.0.2/SConstruct
+--- tokumx-enterprise-2.0.2.ORIG/SConstruct 2016-11-21 11:15:27.517430430 +0000
++++ tokumx-enterprise-2.0.2/SConstruct 2016-11-21 11:16:27.875433436 +0000
+@@ -710,7 +710,7 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux:
+- env.Append( CCFLAGS=["-Werror", "-pipe"] )
++ env.Append( CCFLAGS=["-pipe"] )
+ if not has_option('clang'):
+ env.Append( CCFLAGS=["-fno-builtin-memcmp"] ) # glibc's memcmp is faster than gcc's
+
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/third_party/backup/CMakeLists.txt tokumx-enterprise-2.0.2/src/third_party/backup/CMakeLists.txt
+--- tokumx-enterprise-2.0.2.ORIG/src/third_party/backup/CMakeLists.txt 2016-11-21 11:15:27.392430424 +0000
++++ tokumx-enterprise-2.0.2/src/third_party/backup/CMakeLists.txt 2016-11-21 11:17:22.576436161 +0000
+@@ -10,7 +10,7 @@
+ _FILE_OFFSET_BITS=64
+ _LARGEFILE64_SOURCE)
+
+-set(CMAKE_CXX_FLAGS "-Werror -W -Wall -Wshadow ${CMAKE_CXX_FLAGS}")
++set(CMAKE_CXX_FLAGS "-W -Wall -Wshadow ${CMAKE_CXX_FLAGS}")
+
+ set(USE_VALGRIND ON CACHE BOOL "whether to use valgrind headers")
+ if (USE_VALGRIND)
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/third_party/backup/remote/Makefile tokumx-enterprise-2.0.2/src/third_party/backup/remote/Makefile
+--- tokumx-enterprise-2.0.2.ORIG/src/third_party/backup/remote/Makefile 2016-11-21 11:15:27.393430424 +0000
++++ tokumx-enterprise-2.0.2/src/third_party/backup/remote/Makefile 2016-11-21 11:17:38.840436971 +0000
+@@ -1,4 +1,4 @@
+ backup.pb.o: backup.pb.h
+-CXXFLAGS = -W -Wall -Werror -O1
++CXXFLAGS = -W -Wall -O1
+ backup.pb.cc backup.bp.h: backup.proto
+ protoc -I=. --cpp_out=. backup.proto
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake tokumx-enterprise-2.0.2/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake
+--- tokumx-enterprise-2.0.2.ORIG/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake 2016-11-21 11:15:27.422430426 +0000
++++ tokumx-enterprise-2.0.2/src/third_party/ft-index/cmake_modules/TokuSetupCompiler.cmake 2016-11-21 11:16:54.312434753 +0000
+@@ -181,8 +181,8 @@
+ endif ()
+
+ ## always want these
+-set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
+-set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")
++set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
++set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
+
+ ## need to set -stdlib=libc++ to get real c++11 support on darwin
+ if (APPLE)
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/third_party/v8/CMakeLists.txt tokumx-enterprise-2.0.2/src/third_party/v8/CMakeLists.txt
+--- tokumx-enterprise-2.0.2.ORIG/src/third_party/v8/CMakeLists.txt 2016-11-21 11:15:27.452430427 +0000
++++ tokumx-enterprise-2.0.2/src/third_party/v8/CMakeLists.txt 2016-11-21 11:16:27.876433437 +0000
+@@ -126,7 +126,6 @@
+
+ set(V8_CXX_FLAGS
+ -Wall
+- -Werror
+ -W
+ -Wno-unused-parameter
+ -Woverloaded-virtual
+diff -uNr tokumx-enterprise-2.0.2.ORIG/src/third_party/v8/SConscript tokumx-enterprise-2.0.2/src/third_party/v8/SConscript
+--- tokumx-enterprise-2.0.2.ORIG/src/third_party/v8/SConscript 2016-11-21 11:15:27.452430427 +0000
++++ tokumx-enterprise-2.0.2/src/third_party/v8/SConscript 2016-11-21 11:16:27.876433437 +0000
+@@ -47,7 +47,6 @@
+ 'gcc': {
+ 'all': {
+ 'CCFLAGS': ['-Wall',
+- '-Werror',
+ '-W',
+ '-Wno-unused-parameter',
+ '-Woverloaded-virtual',
diff --git a/dev-db/tokumx/files/tokumx-disable-bundled-libs.patch b/dev-db/tokumx/files/tokumx-disable-bundled-libs.patch
new file mode 100644
index 000000000000..66d8db3980fa
--- /dev/null
+++ b/dev-db/tokumx/files/tokumx-disable-bundled-libs.patch
@@ -0,0 +1,11 @@
+diff -auwrN a/src/third_party/ft-index/CMakeLists.txt b/src/third_party/ft-index/CMakeLists.txt
+--- a/src/third_party/ft-index/CMakeLists.txt 2014-08-01 04:37:33.000000000 -0400
++++ b/src/third_party/ft-index/CMakeLists.txt 2014-08-01 10:38:28.134869689 -0400
+@@ -35,7 +35,6 @@
+ include(TokuFeatureDetection)
+ include(TokuSetupCompiler)
+ include(TokuSetupCTest)
+-include(TokuThirdParty)
+
+ set(TOKU_CMAKE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ include(TokuMergeLibs)
diff --git a/dev-db/tokumx/metadata.xml b/dev-db/tokumx/metadata.xml
new file mode 100644
index 000000000000..3152dea9ad41
--- /dev/null
+++ b/dev-db/tokumx/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>ultrabug@gentoo.org</email>
+ <name>Alexys Jacob</name>
+ <description>Secondary Maintainer. CC on bugs</description>
+ </maintainer>
+ <use>
+ <flag name="pax_kernel">Apply patch needed for hardened kernels</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/tokumx/tokumx-1.5.0-r2.ebuild b/dev-db/tokumx/tokumx-1.5.0-r2.ebuild
new file mode 100644
index 000000000000..ef1062ab8695
--- /dev/null
+++ b/dev-db/tokumx/tokumx-1.5.0-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+CMAKE_BUILD_TYPE=Release
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1 pax-utils cmake-utils
+
+MY_P=${PN}-git-tag-${PV}
+
+DESCRIPTION="An open source, high-performance distribution of MongoDB"
+HOMEPAGE="http://www.tokutek.com/products/tokumx-for-mongodb/"
+SRC_URI="mirror://gentoo/${MY_P}.tar.bz2"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="pax_kernel"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="!dev-db/mongodb
+ ${PYTHON_DEPS}
+ dev-libs/jemalloc
+ >=dev-libs/boost-1.50[threads(+)]
+ >=dev-libs/libpcre-8.30[cxx]
+ net-libs/libpcap"
+DEPEND="${RDEPEND}
+ sys-libs/ncurses
+ sys-libs/readline
+ pax_kernel? ( sys-apps/paxctl sys-apps/elfix )"
+
+S="${WORKDIR}/mongo"
+BUILD_DIR="${WORKDIR}/mongo/build"
+QA_PRESTRIPPED="/usr/lib64/libHotBackup.so"
+
+src_prepare() {
+ cd "${WORKDIR}"
+ epatch "${FILESDIR}/${PV}-Werror.diff"
+ epatch "${FILESDIR}/${PV}-boost-57.diff"
+ epatch "${FILESDIR}/${PN}-disable-bundled-libs.patch"
+ cd "${S}"
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -D TOKU_DEBUG_PARANOID=OFF
+ -D USE_VALGRIND=OFF
+ -D USE_BDB=OFF
+ -D BUILD_TESTING=OFF
+ -D TOKUMX_DISTNAME=${PV}
+ -D LIBJEMALLOC="jemalloc"
+ -D TOKUMX_STRIP_BINARIES=0
+ -D USE_SYSTEM_PCRE=1
+ -D USE_SYSTEM_BOOST=1
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ pax-mark -m "${D}"/usr/bin/mongo
+
+ # Remove unnecessary files
+ rm -r "${D}usr/buildscripts" "${D}usr/scripts" "${D}usr/src" "${D}usr/include/db.h" || die
+
+ # Correctly install this python script
+ python_foreach_impl python_doscript scripts/tokumxstat.py
+
+ # Clean up documentation installed to /usr
+ pushd "${D}usr/" || die
+ rm GNU-AGPL-3.0 LICENSE.txt NEWS README README.md README-TOKUDB README-TOKUKV SConstruct THIRD-PARTY-NOTICES || die
+ popd || die
+ dodoc README.md distsrc/NEWS distsrc/README distsrc/THIRD-PARTY-NOTICES
+ newdoc src/third_party/ft-index/README-TOKUDB README-TOKUKV
+}
diff --git a/dev-db/tokumx/tokumx-2.0.2.ebuild b/dev-db/tokumx/tokumx-2.0.2.ebuild
new file mode 100644
index 000000000000..987be829e3bc
--- /dev/null
+++ b/dev-db/tokumx/tokumx-2.0.2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+CMAKE_BUILD_TYPE=Release
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1 cmake-utils pax-utils check-reqs
+
+MY_P=${PN}-enterprise-${PV}
+
+DESCRIPTION="An open source, high-performance distribution of MongoDB"
+HOMEPAGE="https://www.percona.com/software/mongo-database/percona-tokumx"
+SRC_URI="https://www.percona.com/downloads/percona-tokumx/${MY_P}/source/tarball/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="pax_kernel"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="!dev-db/mongodb
+ ${PYTHON_DEPS}
+ dev-libs/jemalloc
+ !dev-libs/mongo-cxx-driver
+ >=dev-libs/boost-1.50[threads(+)]
+ >=dev-libs/libpcre-8.30[cxx]
+ net-libs/libpcap"
+DEPEND="${RDEPEND}
+ dev-util/valgrind
+ sys-libs/ncurses
+ sys-libs/readline
+ pax_kernel? ( sys-apps/paxctl sys-apps/elfix )
+"
+
+S="${WORKDIR}/${MY_P}"
+QA_PRESTRIPPED="/usr/lib64/libHotBackup.so"
+CHECKREQS_DISK_BUILD="13G"
+
+src_prepare() {
+ eapply "${FILESDIR}/${P}-no-werror.patch"
+ eapply "${FILESDIR}/${P}-boost-57.patch"
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DTOKU_DEBUG_PARANOID=OFF
+ -DUSE_VALGRIND=OFF
+ -DUSE_BDB=OFF
+ -DBUILD_TESTING=OFF
+ -DTOKUMX_DISTNAME=${PV}
+ -DLIBJEMALLOC="jemalloc"
+ -DTOKUMX_STRIP_BINARIES=0
+ -DUSE_SYSTEM_PCRE=1
+ -DUSE_SYSTEM_BOOST=1
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ pax-mark -m "${D}"/usr/bin/mongo
+
+ # Remove unnecessary files
+ rm -r "${D}usr/buildscripts" "${D}usr/scripts" "${D}usr/src" "${D}usr/include/db.h" || die
+
+ # Correctly install this python script
+ python_foreach_impl python_doscript scripts/tokumxstat.py
+
+ # Clean up documentation installed to /usr
+ pushd "${D}usr/" || die
+ rm GNU-AGPL-3.0 LICENSE.txt NEWS README README.md README-TOKUDB README-TOKUKV SConstruct THIRD-PARTY-NOTICES || die
+ popd || die
+ dodoc README.md distsrc/NEWS distsrc/README distsrc/THIRD-PARTY-NOTICES
+ newdoc src/third_party/ft-index/README-TOKUDB README-TOKUKV
+}
diff --git a/dev-db/tokyocabinet/Manifest b/dev-db/tokyocabinet/Manifest
new file mode 100644
index 000000000000..e060884c3a0b
--- /dev/null
+++ b/dev-db/tokyocabinet/Manifest
@@ -0,0 +1,7 @@
+AUX fix_rpath.patch 2111 SHA256 cba364650da90d9fcae3424a1e6ce400769db193c863e5cdbf29a4ced0292ce6 SHA512 c0ee076d048d8ec4a77b036d0503776c4e3ca7a97c30cd8ba41cb0d99707ad5021613e1d308f6e73cc3432e0f71f7b38429ca0edcbc4edfe0d96955fc56b3504 WHIRLPOOL 9fc3b76b68a58e08cb1674f2a13a2b3de80a3b67874ccdab0bf789e85330dfcb3950ab6f0ebbfc11fa105fe0cfbc169a07c91dcfcfbdaed52354e8e14fc5b2ed
+DIST tokyocabinet-1.4.48.tar.gz 1000485 SHA256 a003f47c39a91e22d76bc4fe68b9b3de0f38851b160bbb1ca07a4f6441de1f90 SHA512 b9995c838e713c13f781ab41062caefeb5c613f696dab08039f992f6860413d60a513114b83468cafdf7fc5b5e51ab880226972465d532f873f2a55f615e1440 WHIRLPOOL 90d47ac8858e5f4c198418c48118c0142e5bd04156088075eb0450cbc1aa7c70dde3206624c52710c46bb1a307675d536ba0d15e5ac8f4680aaf56691dd8a58e
+EBUILD tokyocabinet-1.4.48-r1.ebuild 1574 SHA256 b5a4a575241c60ed2ccdb8f88c7daebe0775c34b823a53630b73af6e54234451 SHA512 f6ccfcd16aceb982936e4bccf85a1aa28d819a6341036d39d5855c3f1c71b6240f076786ed61d3e6a635d7ccb9818a33e94b78efcd23cf40e8b4ce6d920361b3 WHIRLPOOL 3b8ace6e267c7fd4d2065f5ccce1382b835cda5386904084b9cdb7e9bfbf7da37af1c09bd143315328e66a10bb36bc18dedf225455738de40795685f100eeea7
+EBUILD tokyocabinet-1.4.48.ebuild 1434 SHA256 499c55dfdb10778750795030898227207540eedef09d772cbd374e24f4d67d84 SHA512 f4e9e127ce970ab86af1e2a58cb83533250c1c62fd3227ceb93312babc384a980556e05700947f67c6fd121259b9030c78a7230b3ce860bca63b468bcf6f9dad WHIRLPOOL 2e1a0e292f8f301b840c1de6fb5dd3a907927734979bbbe7aac62eaee9ed59f38c017dc8ba5d59c75d47b72b02e9464861958e78f8357b1ce934ab8d24f153f4
+MISC ChangeLog 3550 SHA256 ba07a43c278888be32a8c41c4a38a4bf69a5526514e8176b7b0cddc41e1e785b SHA512 afd17e43410727dbd8f46d19972487fb8258d30a5d92b1c36267b7a6879b81395e25dc111baa7e7d23c765ea3431a0d9b2e33c31c292bfb1d720c44e8b163145 WHIRLPOOL bb6913833e6dbef848efb9207e8845d5f0c24fafbc34c8fde8257cfe123aa72320a0a51624b5c32e381319e91ca29b75f9e5b3179588b0dd9f06a8682e617179
+MISC ChangeLog-2015 7087 SHA256 e9fc61799c2985bb4d76c0dec6a5a21b0edf2127971085387c7e3b5907511842 SHA512 c3a0403af4cdcfc746d04be888fa965c41904b393916055707dc48046edf96e4a75333e6b45b2dbefb008203eba3dac56d9e1f9fa46b5e30dddf1faf2ed84793 WHIRLPOOL d53b775ba78ab3ebb16cb614ae2648a690da6b23d9ac74604aaf66f696aeb4bbad61e97b837396750a4490a2b31b6d1b8237c452390b9398eb4adfe8cdd3c019
+MISC metadata.xml 247 SHA256 0deec0776f26fb762fdf7711f4589b14f52a2456436ef557eec62a2cf2fb2bb7 SHA512 29cf52c16b0cce69899d9c2da8acd9144b7d760442aa323b854dceadb42459e009545193b1df7911ac2241b59f4819b4a6bb1d206d6f57953f770031433bb6b7 WHIRLPOOL a135fa622e99d3dcdb432bc6b3c366076b3d86b4bfd9a76c852d781b8e9152541c7e7a2c7c6d6a3c4d2200dce792847a08166aaf7c17c22b6299dfe868234dec
diff --git a/dev-db/tokyocabinet/files/fix_rpath.patch b/dev-db/tokyocabinet/files/fix_rpath.patch
new file mode 100644
index 000000000000..e1cba0a0370f
--- /dev/null
+++ b/dev-db/tokyocabinet/files/fix_rpath.patch
@@ -0,0 +1,56 @@
+diff -ur Makefile.in Makefile.in
+--- Makefile.in 2009-08-04 09:37:52.000000000 +0200
++++ Makefile.in 2009-09-30 23:45:28.000000000 +0200
+@@ -54,8 +54,8 @@
+ LDFLAGS = @MYLDFLAGS@
+ CMDLDFLAGS = @MYCMDLDFLAGS@
+ LIBS = @LIBS@
+-LDENV = LD_RUN_PATH=/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@:.
+-RUNENV = @MYLDLIBPATHENV@=.:/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@
++LDENV =
++RUNENV = @MYLDLIBPATHENV@=.:$(LIBDIR)
+ POSTCMD = @MYPOSTCMD@
+
+
+diff -ur configure.in configure.in
+--- configure.in 2009-08-31 11:36:58.000000000 +0200
++++ configure.in 2009-09-30 23:45:28.000000000 +0200
+@@ -31,25 +31,15 @@
+ MYPCFILES="tokyocabinet.pc"
+
+ # Building flags
+-MYCFLAGS="-std=c99 -Wall -fPIC -fsigned-char -O2"
++MYCFLAGS="-std=c99 -Wall -fPIC -fsigned-char"
+-MYCPPFLAGS="-I. -I\$(INCLUDEDIR) -I$HOME/include -I/usr/local/include"
++MYCPPFLAGS="-I. -I\$(INCLUDEDIR)"
+ MYCPPFLAGS="$MYCPPFLAGS -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__"
+-MYLDFLAGS="-L. -L\$(LIBDIR) -L$HOME/lib -L/usr/local/lib"
++MYLDFLAGS="-L. -L\$(LIBDIR)"
+ MYCMDLDFLAGS=""
+ MYRUNPATH="\$(LIBDIR)"
+ MYLDLIBPATHENV="LD_LIBRARY_PATH"
+ MYPOSTCMD="true"
+
+-# Building paths
+-PATH="$PATH:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
+-PATH="$PATH:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/xpg4/bin:/usr/xpg6/bin:/usr/ucb"
+-CPATH="$HOME/include:/usr/local/include:$CPATH"
+-LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
+-LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+-PKG_CONFIG_PATH="$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
+-export PATH CPATH LIBRARY_PATH LD_LIBRARY_PATH PKG_CONFIG_PATH
+-
+-
+
+ #================================================================
+ # Options
+diff -ur tokyocabinet.pc.in tokyocabinet.pc.in
+--- tokyocabinet.pc.in 2008-02-18 08:25:18.000000000 +0100
++++ tokyocabinet.pc.in 2009-09-30 23:45:28.000000000 +0200
+@@ -10,5 +10,5 @@
+ Name: Tokyo Cabinet
+ Description: a modern implementation of DBM
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -ltokyocabinet @LIBS@
++Libs: -L${libdir} -ltokyocabinet
+ Cflags: -I${includedir}
diff --git a/dev-db/tokyocabinet/metadata.xml b/dev-db/tokyocabinet/metadata.xml
new file mode 100644
index 000000000000..40aa45df2b01
--- /dev/null
+++ b/dev-db/tokyocabinet/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/tokyocabinet/tokyocabinet-1.4.48-r1.ebuild b/dev-db/tokyocabinet/tokyocabinet-1.4.48-r1.ebuild
new file mode 100644
index 000000000000..5ebdf015b89a
--- /dev/null
+++ b/dev-db/tokyocabinet/tokyocabinet-1.4.48-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils autotools
+
+DESCRIPTION="A library of routines for managing a database"
+HOMEPAGE="http://fallabs.com/tokyocabinet/"
+SRC_URI="${HOMEPAGE}${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
+IUSE="bzip2 debug doc examples threads zlib"
+
+DEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/fix_rpath.patch"
+ sed -i \
+ -e "/ldconfig/d" \
+ -e "/DATADIR/d" Makefile.in || die
+ # cflags fix - remove -O2 at end of line and -fomit-frame-pointer
+ sed -i -e 's/-O3"$/"/' configure.in || die
+ sed -i -e 's/-fomit-frame-pointer//' configure.in || die
+ # flag only works on x86 derivatives, remove everywhere else
+ if ! use x86 && ! use amd64; then sed -i -e 's/ -minline-all-stringops//' configure.in; fi
+ eautoreconf
+}
+
+src_configure() {
+ # we use the "fastest" target without the -O3
+ econf \
+ $(use_enable debug) \
+ $(use_enable bzip2 bzip) \
+ $(use_enable zlib) \
+ $(use_enable threads pthread) \
+ --enable-off64 --enable-fastest
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ if use examples; then
+ insinto /usr/share/${PF}/example
+ doins example/* || die "Install failed"
+ fi
+
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins -r doc/* || die "Install failed"
+ fi
+}
+
+src_test() {
+ emake -j1 check || die "Tests failed"
+}
diff --git a/dev-db/tokyocabinet/tokyocabinet-1.4.48.ebuild b/dev-db/tokyocabinet/tokyocabinet-1.4.48.ebuild
new file mode 100644
index 000000000000..3296d12046cb
--- /dev/null
+++ b/dev-db/tokyocabinet/tokyocabinet-1.4.48.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils autotools
+
+DESCRIPTION="A library of routines for managing a database"
+HOMEPAGE="http://fallabs.com/tokyocabinet/"
+SRC_URI="${HOMEPAGE}${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
+IUSE="debug doc examples"
+
+DEPEND="sys-libs/zlib
+ app-arch/bzip2"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/fix_rpath.patch"
+ sed -i \
+ -e "/ldconfig/d" \
+ -e "/DATADIR/d" Makefile.in || die
+ # cflags fix - remove -O2 at end of line and -fomit-frame-pointer
+ sed -i -e 's/-O3"$/"/' configure.in || die
+ sed -i -e 's/-fomit-frame-pointer//' configure.in || die
+ # flag only works on x86 derivatives, remove everywhere else
+ if ! use x86 && ! use amd64; then sed -i -e 's/ -minline-all-stringops//' configure.in; fi
+ eautoreconf
+}
+
+src_configure() {
+ # we use the "fastest" target without the -O3
+ econf $(use_enable debug) --enable-off64 --enable-fastest
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ if use examples; then
+ insinto /usr/share/${PF}/example
+ doins example/* || die "Install failed"
+ fi
+
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins -r doc/* || die "Install failed"
+ fi
+}
+
+src_test() {
+ emake -j1 check || die "Tests failed"
+}
diff --git a/dev-db/tora/Manifest b/dev-db/tora/Manifest
new file mode 100644
index 000000000000..e127f8d7e38f
--- /dev/null
+++ b/dev-db/tora/Manifest
@@ -0,0 +1,6 @@
+DIST tora-3.0.0_pre20140929.tar.xz 9038680 SHA256 67fb6273c930b4ba4cbc185fd3e2a68b8c7029098b14f729ffbdfa09ed91af2b SHA512 42bc76d8bbed8a5cfee447ea6dec9966a31ef740d3ab58078ecdfc12f725cc94568fbb96d044668ae5fd83def5ab35823df6dee77b630e7903edfd1521b87b73 WHIRLPOOL 7fcf7fbe06d1fa4d31a88674f011c634ec9ef12003a074c8185a981650fff8aef85725007f51a3e463d95f332fde724392fd748d4fdbc464663a2da3b8ec8693
+EBUILD tora-3.0.0_pre20140929-r2.ebuild 1981 SHA256 ca22377dcd0c145e97a0f98dcf168635f1c509bb9b32df07b11611d0d4757b33 SHA512 53c7c86a061c37734c0228d569bcb01a87169d6ba2642f4e2b13c182a7e4f639d4000ac67b1df8e64f36ab294831ed5abf85fde1d08171e2d721fe2d5504cfaf WHIRLPOOL 2876e4cb304254d9a3b70eb93307dd8e19fb2d6124b502bfdbbcce94848478ea18cf1f3a071b6777bc646262d09a1548a0551d7310a6de70e12942287b2cc0aa
+EBUILD tora-9999.ebuild 2286 SHA256 b8716fb120752ecc860cffac50ca2d831ca6b3230e592cd9e1c9a82b6fa866aa SHA512 236f131869f595a3076c32143c238a42f34342be6524c01512d4b6e738b73b05552e54878eda9be621ffbeef79841000bc90c8f52154aca52e20e7855da94deb WHIRLPOOL ed43326f1040a960b1219daf29a1f860449b21d773fd7cc8966b1e16314553e2b281c74e65b9a35677b0548cac373b21570233c9357aa1ed3efdad1cb6c20993
+MISC ChangeLog 2696 SHA256 33251c198bfe3db9693e19e475d1bd8a309aafd73d199177ae4ad91d6be53789 SHA512 80b39829981abb4ef8a6e1a76bee0295c3347d5a0733b8a3e9d30302110a82ca8e72bc41b7776175c8e9b9d0dc950a93995bad8cac3c03141b4f06cf7a446cf9 WHIRLPOOL 96e0dee86dfcee594b7f9307105463a0320da99723b54bb7cd76079551bf999e142a22aff08209dbde4bce8247f991108281850a2bc51f5fcd945652e06d0fb3
+MISC ChangeLog-2015 17172 SHA256 729208383c8defbb239a44e442a3b2abff7926071a5a2d61a909d1a09b128e65 SHA512 461602600b7a2bd75b6c67b42710e72e8fd5a2b460415a68dff93dc59345bbe85738484653f39f3e1135c53bb9e89f8dd793e78f0561fcfa12373040d0551652 WHIRLPOOL 36d9a32b4746dd7410383ac5f88541b3d1971b8d80d86159459abac3d19b08f4033e1ea5e652af5264d22be07221c46711138251ed0179cf122452e18e72aec9
+MISC metadata.xml 843 SHA256 10001de874fa22316ef45dcb0a7111c3c1eda6ea2a45723be338d989d543d7bb SHA512 fb6b7e2966d2cb74576f2558d44e64a5cf8aa79f78c5eeff58fcf433369b4efd32edb103ad4174bdd7d878466e4db720d81e4b1ff637d7c1193d37d944708247 WHIRLPOOL e91a68e1ba8edb12f62df3d566083fabf5ea2f7e7ce80624919dfe106890e641e0a58550498aa84721af5a9007221bebdb5363af47b3ca8cdb922cb43267ce65
diff --git a/dev-db/tora/metadata.xml b/dev-db/tora/metadata.xml
new file mode 100644
index 000000000000..ac37be91b865
--- /dev/null
+++ b/dev-db/tora/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ikonta@yandex.ru</email>
+ <name>Sergey Starikoff</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>haubi@gentoo.org</email>
+ <name>Michael Haubenwallner</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ TOra is a Toolkit for Oracle which aims to help the DBA or developer of
+ database application. Features PL/SQL debugger, SQL worksheet with syntax
+ highlighting, DB browser and a comprehensive set of DBA tools. Also works
+ with mySQL and postgreSQL.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">tora</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/tora/tora-3.0.0_pre20140929-r2.ebuild b/dev-db/tora/tora-3.0.0_pre20140929-r2.ebuild
new file mode 100644
index 000000000000..fdd5149bda7f
--- /dev/null
+++ b/dev-db/tora/tora-3.0.0_pre20140929-r2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils eutils
+
+if [[ ${PV} == 9999 ]]; then
+ ESVN_REPO_URI="https://svn.code.sf.net/p/tora/code/trunk/tora"
+ inherit subversion
+ SRC_URI=""
+else
+ SRC_URI="https://dev.gentoo.org/~pinkbyte/distfiles/snapshots/${P}.tar.xz"
+fi
+
+DESCRIPTION="TOra - Toolkit For Oracle"
+HOMEPAGE="http://torasql.com/"
+IUSE="debug mysql postgres"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-libs/ferrisloki
+ x11-libs/qscintilla:=[qt4(-)]
+ dev-qt/qtgui:4
+ dev-qt/qtsql:4[mysql?,postgres?]
+ dev-qt/qtxmlpatterns:4
+ =dev-db/oracle-instantclient-basic-11*
+ postgres? ( dev-db/postgresql:* )
+"
+DEPEND="
+ virtual/pkgconfig
+ ${RDEPEND}
+"
+
+pkg_setup() {
+ if [ -z "$ORACLE_HOME" ] ; then
+ eerror "ORACLE_HOME variable is not set."
+ eerror
+ eerror "You must install Oracle >= 8i client for Linux in"
+ eerror "order to compile TOra with Oracle support."
+ eerror
+ eerror "You can download the Oracle software from"
+ eerror "http://otn.oracle.com/software/content.html"
+ die
+ fi
+}
+
+src_prepare() {
+ sed -i \
+ -e "/COPYING/ d" \
+ CMakeLists.txt || die "Removal of COPYING file failed"
+ # bug 547520
+ grep -rlZ '$$ORIGIN' . | xargs -0 sed -i 's|:$$ORIGIN[^:"]*||' || \
+ die 'Removal of $$ORIGIN failed'
+}
+
+src_configure() {
+ local mycmakeargs=()
+ mycmakeargs=(-DENABLE_ORACLE=ON)
+ mycmakeargs+=(
+ -DWANT_RPM=OFF
+ -DWANT_BUNDLE=OFF
+ -DWANT_BUNDLE_STANDALONE=OFF
+ -DWANT_INTERNAL_QSCINTILLA=OFF
+ -DWANT_INTERNAL_LOKI=OFF
+ -DLOKI_LIBRARY="$(pkg-config --variable=libdir ferrisloki)/libferrisloki.so"
+ -DLOKI_INCLUDE_DIR="$(pkg-config --variable=includedir ferrisloki)/FerrisLoki"
+ $(cmake-utils_use_enable postgres PGSQL)
+ $(cmake-utils_use_want debug)
+ # path variables
+ -DTORA_DOC_DIR=share/doc/${PF}
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ #
+ doicon src/icons/${PN}.xpm || die
+ domenu src/${PN}.desktop || die
+}
diff --git a/dev-db/tora/tora-9999.ebuild b/dev-db/tora/tora-9999.ebuild
new file mode 100644
index 000000000000..c4a02d4c4a13
--- /dev/null
+++ b/dev-db/tora/tora-9999.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-utils eutils
+
+if [[ ${PV} == 9999 ]]; then
+ ESVN_REPO_URI="https://svn.code.sf.net/p/tora/code/trunk/tora"
+ inherit subversion
+ SRC_URI=""
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+fi
+
+DESCRIPTION="TOra - Toolkit For Oracle"
+HOMEPAGE="http://torasql.com/"
+IUSE="debug mysql oracle oci8-instant-client postgres"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS=""
+
+RDEPEND="
+ dev-libs/ferrisloki
+ x11-libs/qscintilla:=[qt4(-)]
+ dev-qt/qtgui:4
+ dev-qt/qtsql:4[mysql?,postgres?]
+ dev-qt/qtxmlpatterns:4
+ oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+ postgres? ( dev-db/postgresql:* )
+"
+DEPEND="
+ virtual/pkgconfig
+ ${RDEPEND}
+"
+
+pkg_setup() {
+ if ( use oracle || use oci8-instant-client ) && [ -z "$ORACLE_HOME" ] ; then
+ eerror "ORACLE_HOME variable is not set."
+ eerror
+ eerror "You must install Oracle >= 8i client for Linux in"
+ eerror "order to compile TOra with Oracle support."
+ eerror
+ eerror "Otherwise specify -oracle in your USE variable."
+ eerror
+ eerror "You can download the Oracle software from"
+ eerror "http://otn.oracle.com/software/content.html"
+ die
+ fi
+}
+
+src_prepare() {
+ sed -i \
+ -e "/COPYING/ d" \
+ CMakeLists.txt || die "Removal of COPYING file failed"
+ # 'svn info' needs .svn subdirectory
+ [[ ${PV} != 9999 ]] || cp -a "${ESVN_WC_PATH}"/.svn .svn || die
+ # bug 547520
+ grep -rlZ '$$ORIGIN' . | xargs -0 sed -i 's|:$$ORIGIN[^:"]*||' || \
+ die 'Removal of $$ORIGIN failed'
+}
+
+src_configure() {
+ local mycmakeargs=()
+ if use oracle || use oci8-instant-client ; then
+ mycmakeargs=(-DENABLE_ORACLE=ON)
+ else
+ mycmakeargs=(-DENABLE_ORACLE=OFF)
+ fi
+ mycmakeargs+=(
+ -DWANT_RPM=OFF
+ -DWANT_BUNDLE=OFF
+ -DWANT_BUNDLE_STANDALONE=OFF
+ -DWANT_INTERNAL_QSCINTILLA=OFF
+ -DWANT_INTERNAL_LOKI=OFF
+ -DLOKI_LIBRARY="$(pkg-config --variable=libdir ferrisloki)/libferrisloki.so"
+ -DLOKI_INCLUDE_DIR="$(pkg-config --variable=includedir ferrisloki)/FerrisLoki"
+ $(cmake-utils_use_enable postgres PGSQL)
+ $(cmake-utils_use_want debug)
+ # path variables
+ -DTORA_DOC_DIR=share/doc/${PF}
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ doicon src/icons/${PN}.xpm
+ domenu src/${PN}.desktop
+}
diff --git a/dev-db/unixODBC/Manifest b/dev-db/unixODBC/Manifest
new file mode 100644
index 000000000000..6784a8797a78
--- /dev/null
+++ b/dev-db/unixODBC/Manifest
@@ -0,0 +1,8 @@
+DIST unixODBC-2.3.2.tar.gz 1849173 SHA256 9c3459742f25df5aa3c10a61429bde51a6d4f11552c03095f1d33d7eb02b5c9a SHA512 31d705bf3dcaff6707d5680235b34e4d265a084b1de9e1b2ed3bbee1e1dfefdb4437fe3e1736b84e446d1927ec7622296d9e9b129052cb35f4b63b0bd79ccd13 WHIRLPOOL 05b8fe927a148a0b7ec7abecbac6f5370e904c669b5b0cc58840f7c2302e1df62901a1a627221057be6d4b8b90772854fe3db6e5fda2a5df02970073416ef5f0
+DIST unixODBC-2.3.4.tar.gz 1830660 SHA256 2e1509a96bb18d248bf08ead0d74804957304ff7c6f8b2e5965309c632421e39 SHA512 34799777c95539905d4bbe60ad2b83631a31a68483b6be96dba25f80fa2fff4624ba170078097c942f2206873776d179d7d02a340598c4627f8723eb6f083a26 WHIRLPOOL 11fc01160a220d35dbf54ffc88ecb8bb41fc447c2a55e32adc27e5c909251017add3089d1517b0ca3bc1ba0f68055f3eb6a28dfc686706bc58f69258bfdb326a
+EBUILD unixODBC-2.3.2-r1.ebuild 1639 SHA256 b55e8fa484ae1de885cc16cde9f10402c16edada9af389ac629068fb465b06ab SHA512 20437b1f5e7786457fa65c301466cbb8ff0403213e9c72612d1f1f30f7716b2c4215cf88d420f05b3c7f40ccd966a39a7c191402d816a622856c05094565473c WHIRLPOOL b836e038e0431c6d58d89775ff50b4673c3cbfaa9340dd239340e55f434887cfa39bf17c371aa52e48efe0a98cd2cfeb7b19b8f584f06665b16b2141482ee7a2
+EBUILD unixODBC-2.3.4-r1.ebuild 1672 SHA256 5a26d8aee3a8bb597b47de4e6060054ba8da8d741e913aea3c1802aa5f9a4819 SHA512 e8fa096f5934454158168111a3f7fe5bf2723fe0adaea78d88e10beed2933dedf59aec777e7bd2cd4d3d2ca6a361634f5f3cda80a0b17c24102e30cd109dc399 WHIRLPOOL e34ba099339b5d9d9154cb82db56e0e76f80d99a9229d5e395c956ba4058b6b67b121186264c9e1653424cb298a2f2459990f997b1e737321a92498592ffd816
+EBUILD unixODBC-2.3.4.ebuild 1729 SHA256 ca0f40804f9f505c9fc1e59083ceb92c01e8eb401ffc585dd78d624163a05ce3 SHA512 a5b810d7acc4bd3a53d4d9584fc3bbc6de7c59904a5d7e3f21816d7e045ad8910fdbeb8b670bcd3d9e3cb1cc3a49be84f49dbcc389500963df1422f9ae08a071 WHIRLPOOL 12c564c5b21160e0e17564584a04399b29e8bd76ea2bfa5064817eadb1cb6ea1dc4b616c1bc6a2630529e685efa1c1fd7289b7d7b88a6d69bd0421f9f4bfee9e
+MISC ChangeLog 3578 SHA256 500f6ecf3a8fbe068c9c300952a539ec8f18c1785bc709422938034d3a68e513 SHA512 ec824726fa9104d47d0c742ad46f67953140afc166b171dfd194785345e65f468fe9dcb67837984439faeddaaae9f64ef4b3bd46669826861102752ca0a80a45 WHIRLPOOL f98d6873e0aa90db7b7ec8b7de7b883d299853193b7a8affe363bb538eb44fab21ecbc17da215a85648662ef1072bb485ec1e0551b4c460d2d5c8242153e8e53
+MISC ChangeLog-2015 17050 SHA256 503b6acf13f8ffbb82513710f6080742a8ea22c9e6805d26bf087fa288ed4558 SHA512 a8506318d4a05c6b80eb874f132dd07616491de1998a24dadb6c0989fa2a59b9d6f3c99c30a14a87ec059b3686758783e542b0b481c18a7f10da2a5cb19f9b6f WHIRLPOOL 1695e178069b39cdcdd6e5f070d2ade6fe33db9482d19e75e348733c8af99d29d26a58210d24d5313ee4444998d6637f55694ab7e84b1ab9bd64a106fb69f828
+MISC metadata.xml 366 SHA256 9abd74f66df3f812bce2f0916cc7dd5c379d85735988e63f891ed91303ad4208 SHA512 e47157f178b585272b5c11682cef0c7b7dec227ded178d3427e91632f754db869deb72a6c1b258dfc90f6760028d3045d1e703874ae24111f8deb9db629b8c29 WHIRLPOOL bd755097faf2993b4ef48534854eb6d12adc2a69b52572223bb0fa5fe472740faa7dafb07df1b9cae4780ef3a724fd49178acd71ea2047b1596f8905fd0809d9
diff --git a/dev-db/unixODBC/metadata.xml b/dev-db/unixODBC/metadata.xml
new file mode 100644
index 000000000000..4ebc84f52877
--- /dev/null
+++ b/dev-db/unixODBC/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="minimal">Disable bundled drivers and extra libraries (most users don't need these)</flag>
+ <flag name="odbcmanual">Administrator, Internal Structure, Programmer and User documentation</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/unixODBC/unixODBC-2.3.2-r1.ebuild b/dev-db/unixODBC/unixODBC-2.3.2-r1.ebuild
new file mode 100644
index 000000000000..f8709e382f92
--- /dev/null
+++ b/dev-db/unixODBC/unixODBC-2.3.2-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit libtool autotools-multilib eutils
+
+DESCRIPTION="A complete ODBC driver manager"
+HOMEPAGE="http://www.unixodbc.org/"
+SRC_URI="http://ftp.unixodbc.org/pub/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+minimal odbcmanual static-libs unicode"
+
+RDEPEND="|| (
+ dev-libs/libltdl:0[${MULTILIB_USEDEP}]
+ >=sys-devel/libtool-2.4.2-r1[${MULTILIB_USEDEP}]
+ )
+ >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}]
+ >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}]
+ >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+ abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+MULTILIB_WRAPPED_HEADERS=( /usr/include/unixodbc_conf.h )
+
+src_configure() {
+ # --enable-driver-conf is --enable-driverc as per configure.in
+ myeconfargs=(
+ --sysconfdir="${EPREFIX}"/etc/${PN}
+ --enable-iconv
+ $(use_enable static-libs static)
+ $(use_enable !minimal drivers)
+ $(use_enable !minimal driverc)
+ $(use_with unicode iconv-char-enc UTF8)
+ $(use_with unicode iconv-ucode-enc UTF16LE)
+ )
+ autotools-multilib_src_configure
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ use prefix && dodoc README*
+ use odbcmanual && dohtml -a css,gif,html,sql,vsd -r doc/*
+
+ find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +
+}
diff --git a/dev-db/unixODBC/unixODBC-2.3.4-r1.ebuild b/dev-db/unixODBC/unixODBC-2.3.4-r1.ebuild
new file mode 100644
index 000000000000..2f9faf86479a
--- /dev/null
+++ b/dev-db/unixODBC/unixODBC-2.3.4-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit libtool ltprune multilib-minimal
+
+DESCRIPTION="A complete ODBC driver manager"
+HOMEPAGE="http://www.unixodbc.org/"
+SRC_URI="ftp://ftp.unixodbc.org/pub/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+minimal odbcmanual static-libs unicode"
+
+RDEPEND="
+ || (
+ dev-libs/libltdl:0[${MULTILIB_USEDEP}]
+ >=sys-devel/libtool-2.4.2-r1[${MULTILIB_USEDEP}]
+ )
+ >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}]
+ >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}]
+ >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+ abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] )
+"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+"
+
+MULTILIB_CHOST_TOOLS=( /usr/bin/odbc_config )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/unixodbc_conf.h )
+
+multilib_src_configure() {
+ # --enable-driver-conf is --enable-driverc as per configure.in
+ myeconfargs=(
+ --sysconfdir="${EPREFIX}"/etc/${PN}
+ --disable-static
+ --enable-iconv
+ --enable-shared
+ $(use_enable static-libs static)
+ $(use_enable !minimal drivers)
+ $(use_enable !minimal driverc)
+ $(use_with unicode iconv-char-enc UTF8)
+ $(use_with unicode iconv-ucode-enc UTF16LE)
+ )
+ ECONF_SOURCE="${S}" \
+ econf "${myeconfargs[@]}"
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ use prefix && dodoc README*
+ use odbcmanual && dohtml -a css,gif,html,sql,vsd -r doc/*
+
+ prune_libtool_files
+}
diff --git a/dev-db/unixODBC/unixODBC-2.3.4.ebuild b/dev-db/unixODBC/unixODBC-2.3.4.ebuild
new file mode 100644
index 000000000000..50a05677ae7a
--- /dev/null
+++ b/dev-db/unixODBC/unixODBC-2.3.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit libtool multilib-minimal
+
+DESCRIPTION="A complete ODBC driver manager"
+HOMEPAGE="http://www.unixodbc.org/"
+SRC_URI="ftp://ftp.unixodbc.org/pub/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+minimal odbcmanual static-libs unicode"
+
+RDEPEND="|| (
+ dev-libs/libltdl:0[${MULTILIB_USEDEP}]
+ >=sys-devel/libtool-2.4.2-r1[${MULTILIB_USEDEP}]
+ )
+ >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}]
+ >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}]
+ >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+ abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+MULTILIB_CHOST_TOOLS=( /usr/bin/odbc_config )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/unixodbc_conf.h )
+
+multilib_src_configure() {
+ # --enable-driver-conf is --enable-driverc as per configure.in
+ myeconfargs=(
+ --sysconfdir="${EPREFIX}"/etc/${PN}
+ --enable-iconv
+ --enable-shared
+ $(use_enable static-libs static)
+ $(use_enable !minimal drivers)
+ $(use_enable !minimal driverc)
+ $(use_with unicode iconv-char-enc UTF8)
+ $(use_with unicode iconv-ucode-enc UTF16LE)
+ )
+ ECONF_SOURCE="${S}" \
+ econf "${myeconfargs[@]}"
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ use prefix && dodoc README*
+ use odbcmanual && dohtml -a css,gif,html,sql,vsd -r doc/*
+
+ find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +
+}
diff --git a/dev-db/vbisam/Manifest b/dev-db/vbisam/Manifest
new file mode 100644
index 000000000000..7b4ba5546934
--- /dev/null
+++ b/dev-db/vbisam/Manifest
@@ -0,0 +1,5 @@
+DIST vbisam-2.0.tar.bz2 342184 SHA256 391d422cf11b8ff3d27569d2166e4e800febd77d8d3450438fc76a7f0e587308 SHA512 f329b9e35a8d912776342414cd02bb144c359ae316b5851b6fc49e0e13cbf4870ce2a445207fcdd8c1141ea7e0d5dff74f92f19e9b42597c16625a399c75c00c WHIRLPOOL cc8b6f5bc08cba3db663ba7acb1fe96be6d2f32533d4723af47b9e5bda6829acabfeab67f996b692c467bdd8890cbed11c20715c849a74cc0c485109ccbf56db
+EBUILD vbisam-2.0.ebuild 470 SHA256 5ba0fc9324be351f460b01ff706e0e5bdb458196093d02c3dde9a8316292e938 SHA512 7d66e1644c90dabba754a8df36b50ecf99be9b590bdc7b92ab47480b097903dc89c574de8491d6b0f6831593317b7b2f03363a389ccecaa25b816cf57ed96ca9 WHIRLPOOL 5611b8564c78b8de66dd01e09197ed3d088eb882a14a2561aed738366885026b72d7fd38bfa1554f51b362cdbe0b4d3d9272a966b9f45c29b0d8a0321184d3ae
+MISC ChangeLog 2622 SHA256 53e1e8b1a4912d3deecbfa156afa26e79bfdfcd11ff34322ef6a375a1e3023dc SHA512 e4fac3c9a5ed9b9502b380a52363e1ea04a7d58de3556356f9cad5e95c076217c72dcd7d96039da4f7ae8fb2a9696f758ecf62a43e39287bcc3e3d9784aa7d40 WHIRLPOOL 0bd42680bda3c85f245340a683044537c0820a39135de1c379e92271f02376a97b559ce2f15fc7c6b58909ccdcd3859815593b47c2b5ce0a447c07849a30e8bf
+MISC ChangeLog-2015 847 SHA256 e882a81d9d17e15bdce7a00aea9ab173f5f6e1e1fccebc7c3694b045a4033773 SHA512 836031edbad93cedda801bcb91372d94cedde7959d525b69a3f3cb50b6dd17a60060cb1c793666008821456c56a192b819d774f546a02be3e497ec8a8b60c315 WHIRLPOOL b795c6726b1971ca9afa7d760ce5bef2c94b0bb91372b20a6fe4c1b5755e0311a831e97a4eee553b86621baa541818ff8c6d54685992164e06e36ab966830400
+MISC metadata.xml 247 SHA256 c9478d1f509365d15f27e7672569b87f820da23c8034af89c4585d36738dbf80 SHA512 2649cac2764f9196000ccca028398ee0db1f992d8e2b35a3368a84a5e01f9b9fc95d5a2c8f05d57784e873a3b53b457a7520673353e8999d0d8892315c6385c1 WHIRLPOOL b34dba69e111f8b7dad74c8d13020bd0542f2608df2cb36f2b9cdc25d54d11729395cd6e6a2d3e2342a76e4d24b29b8b3032175a45e7a43e2ebbe5a20ffc8f17
diff --git a/dev-db/vbisam/metadata.xml b/dev-db/vbisam/metadata.xml
new file mode 100644
index 000000000000..929c96f25579
--- /dev/null
+++ b/dev-db/vbisam/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="sourceforge">tiny-cobol</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/vbisam/vbisam-2.0.ebuild b/dev-db/vbisam/vbisam-2.0.ebuild
new file mode 100644
index 000000000000..9fcfa08c0155
--- /dev/null
+++ b/dev-db/vbisam/vbisam-2.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+KEYWORDS="ppc x86"
+
+DESCRIPTION="replacement for IBM's C-ISAM"
+HOMEPAGE="https://sourceforge.net/projects/vbisam"
+SRC_URI="mirror://sourceforge/tiny-cobol/isam/${P}.tar.bz2"
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_install()
+{
+ emake install DESTDIR="${D}" || die "emake install failed."
+ dodoc ChangeLog README NEWS AUTHORS
+}
diff --git a/dev-db/vsqlite++/Manifest b/dev-db/vsqlite++/Manifest
new file mode 100644
index 000000000000..dd2d5119d8af
--- /dev/null
+++ b/dev-db/vsqlite++/Manifest
@@ -0,0 +1,5 @@
+DIST vsqlite++-0.3.13.tar.gz 28195 SHA256 73dea3c0b4b7769254da17182efbf9fc16893c50ed0d544abfdde127b69467d5 SHA512 70fcd16348e3b2a0854b1d496c68fda7e354068aefbd6a5ad21d7a42afebd2bd746f604240475acfeebe00898ab156f9dfd687346fdf5c77d775262db3a5666e WHIRLPOOL 02d79a14dabbc7a2191f40370d94071c95c4dcb72f4eb6ba68b38872296a92473ddfd06a702bb6862fa2a5eac9ac921dd93e3312615bc587b319cf7a64ee5427
+EBUILD vsqlite++-0.3.13-r1.ebuild 911 SHA256 cf71ab9f6adab44bcea9a31f13f9134f8bdf337640ce6ff226cfcf7355fc959b SHA512 5b7357ae383da99fb8b09e9f4579cd1a45f4c0504739b75be7c77b49fb77b394fafbace6f683e3c25ff4b58ece8f8ec607876bd487856429bdb1c2c25b9556f5 WHIRLPOOL 95df3fa599a2c1bf664981b12bd006c990809a449df2f46d714325a516a9dd4a25416793422e3243437e9bb39a8a1f5b8231987f3c96fad8e15e383c7a39c547
+MISC ChangeLog 2556 SHA256 00b23d3b68b12f0b9202ff5f8b045023daf27083b4afbe112a9005d9fda7ee98 SHA512 53ed30ed6970a67f8e315d67f683d070f94c6dcec2f249596536bd1ef59e1e13ed9e745488f500593fc1fb16536beb7cac2870901c165d7f11d02613957deac6 WHIRLPOOL 6eef0c337ccba8cd469b068e1e26da4bd043b0fcbf2e1e6ec4a3d8bf442fffbc54ca4e738f9f02b8dc9a9225e459465fc7f903b88420aaad7188a09416af62f3
+MISC ChangeLog-2015 1749 SHA256 6d56b57245f8961012f8da0ebc8795ec8993c38ee8bcae1646430e7401043ce2 SHA512 0a04dc0599e7805b6989510b04d14caccad07cac46790931b13a7717a949305eae1cd10a72b2ee41c5d3ddba0182c0990ca1b6f32fc35aed3afd16f6248ee84c WHIRLPOOL 395c811c805e3d8da7f36e0305c346456452a6342f03de571d3617832cce6ba24c023eb26263bd3ed94c6ec5d9178478f6abc9eddb1f908cfe6efd5c8100c80e
+MISC metadata.xml 307 SHA256 0f83b05076905e010e9e00047af8674d762559278f2151e14c6fe823c8bec7ad SHA512 9c6a1b9a9d1ad7b9c5e8235145bfda70198cab067695215ac9a1844f8e292338c136abf1ba68e28d82de3d2f2884ee47ec4401355cece233534c73a3451476fe WHIRLPOOL 10d7ed130e2e81be87b2821a9f574f6753438b0130f2a583b72b63eefaa260ce208a1cb6f414fda047933375bf27d3c1c8840af920607af73534ebdc89c8835b
diff --git a/dev-db/vsqlite++/metadata.xml b/dev-db/vsqlite++/metadata.xml
new file mode 100644
index 000000000000..56d616cc62a4
--- /dev/null
+++ b/dev-db/vsqlite++/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>graaff@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">vinzenz/vsqlite--</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/vsqlite++/vsqlite++-0.3.13-r1.ebuild b/dev-db/vsqlite++/vsqlite++-0.3.13-r1.ebuild
new file mode 100644
index 000000000000..0024ad1032b1
--- /dev/null
+++ b/dev-db/vsqlite++/vsqlite++-0.3.13-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+AUTOTOOLS_IN_SOURCE_BUILD=1
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-utils
+
+DESCRIPTION="VSQLite++ - A welldesigned and portable SQLite3 Wrapper for C++"
+HOMEPAGE="http://evilissimo.fedorapeople.org/releases/vsqlite--/"
+SRC_URI="https://github.com/vinzenz/vsqlite--/archive/${PV}.tar.gz -> ${P}.tar.gz"
+IUSE="static-libs"
+
+LICENSE="BSD"
+
+SLOT="0"
+
+KEYWORDS="amd64 ppc x86"
+
+DEPEND=">=dev-libs/boost-1.33.1"
+
+RDEPEND="${DEPEND}
+ dev-db/sqlite:3"
+
+DOCS=(AUTHORS COPYING ChangeLog INSTALL NEWS README.md TODO VERSION)
+
+# package name is vsqlite++, but github / homepage name is vsqlite--
+S="${WORKDIR}/vsqlite---${PV}"
+
+src_prepare() {
+ ## remove O3 in AM_CXXFLAGS
+ sed -i -e 's/-O3//' Makefile.am || die
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
diff --git a/dev-db/wxsqlite3/Manifest b/dev-db/wxsqlite3/Manifest
new file mode 100644
index 000000000000..6465ddc42133
--- /dev/null
+++ b/dev-db/wxsqlite3/Manifest
@@ -0,0 +1,6 @@
+AUX wxsqlite3-3.2.1.pc.in 381 SHA256 4bd1d1b406556a5a36d232326250837494f524b933974b4db4d641a2dd7f262b SHA512 4afa87e5eaafc6e21d1f9f6c60716cd783f2286a805a35bdffb391a1c54839baf0651bedbf28ef6e7c9e5d0835beaf0b6d055f919c7169d293bd12a6375bfcfc WHIRLPOOL 4e52385c04d1706718bb15e5e90b5873f99002bc52d6e0b584609b13a47f2064cfbe983c023907c25b03cc5b662426d6acb6c941bebcf5cd1d5ffc6e2107302e
+DIST wxsqlite3-3.2.1.tar.gz 2810940 SHA256 312f2cf63c76a70bae92b78ea6fb7e9485fb23c3ee728daa418babab881939e4 SHA512 c62380815d881e9f08727cf28047d81acabf791429ee1a5df4db4a6e101a5c7c5fe6e314b18e83eda9c330fb62c996db7a560163d25dc8b948a04a970e7be3d6 WHIRLPOOL 2cbf9095f08dddba4671cb5be18b980e8387365e2e7c85fde31a60fd4d6f77ec1fdca07500e29e540bd94dcd439ed55768c47c07c7089cfdaabd37a5601f244b
+EBUILD wxsqlite3-3.2.1-r1.ebuild 1068 SHA256 e24f7ab6d9ededc548f79bd2bee126ec99b12d68b195096b61330e11642321a5 SHA512 9b54fd5b074bea8539f9fc433f1eb3d4a22ad3ce5d9f502be02a8001612b14e50ebfa1095f2c6ae44c0678d05338b5b49cf5c21f376d2f80d962fd58e57bfeac WHIRLPOOL 1e0486777de6ba67a25485f8fbbd90194d88b4104a02e2ca9ac4a43721872fdd0923a124f697c26ed321a9cad3e6093d2b1e381233ed8c15100b829531e83176
+MISC ChangeLog 4404 SHA256 d0b9f484ee97930ffc4f7fc1938d49d493e56d147c3fe7124c9fd205becfa322 SHA512 cb2ef7c59bf57dcba874bc90b79dc361aafd65e3dc0eacba03c9bb01017e78c05418905f060a704af04543191751cf9d2366de339cbd85efeb82a25c71be6444 WHIRLPOOL 8da381ca322ff10e670844cfe820afbd0d337a65b8bed6a55526bdfa66a70c4884b9a4801c8ae38cc0af6d8d55859f7ef56cd7dac8b87e6b3d6ca60427e2e361
+MISC ChangeLog-2015 1006 SHA256 c8e8880d1ee2f52c18f3884e9519391207ff2d0f3d4386c4ec36770069a3efe4 SHA512 4c79659935da51ebc2df40b4248888a64bc7cdbaa80941d496bded84f0cf7d05d707095e07c4083a67687668717aac6d30d12c8536f8ffa9a610d9605c4160eb WHIRLPOOL d48a294bd8dc64cc896990bd7c5458f297d105c6f1dbd7ad164af2e8b01dbc532f8e71b269c828e812399a187ca1e7412921476bee68ac20a8ce7474a252624d
+MISC metadata.xml 337 SHA256 367efb006d009ed2e8c50bf69bc2fdfd316ba1e2685232fb918b70b989cec750 SHA512 94da0a35e480782ff302bee5b75957d202a48835b1b158c9f3c28af08e5c29ddc53129b89c72286776adbc84b37a1fc8516312410c09096d88390d952fa92ff4 WHIRLPOOL c710cf017a812431198e295cbfe2ad06a9ccdb05e09032f1c0535d642a51df9e30a31b2e549628130e807a5d293d09c3e931c8fdb217120563c3e6827fdf6328
diff --git a/dev-db/wxsqlite3/files/wxsqlite3-3.2.1.pc.in b/dev-db/wxsqlite3/files/wxsqlite3-3.2.1.pc.in
new file mode 100644
index 000000000000..112fa14432c3
--- /dev/null
+++ b/dev-db/wxsqlite3/files/wxsqlite3-3.2.1.pc.in
@@ -0,0 +1,14 @@
+# Package Information for pkg-config
+
+prefix=/usr
+wxver=@WXVERSION@
+includedir=${prefix}/include/wx-${wxver}/
+libdir=${prefix}/@LIBDIR@
+
+Name: wxsqlite3-@WXVERSION@
+Description: SQLite3 C++ wrapper for use in programs based on the wxWidgets
+Version: @VERSION@
+#Requires: sqlite3
+Libs: -L${libdir} -lwxcode_gtk2_wxsqlite3-@WXVERSION@
+Libs.private: -lpthread
+Cflags: -I${includedir}
diff --git a/dev-db/wxsqlite3/metadata.xml b/dev-db/wxsqlite3/metadata.xml
new file mode 100644
index 000000000000..9d94ef24a06b
--- /dev/null
+++ b/dev-db/wxsqlite3/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>wxwidgets@gentoo.org</email>
+ <name>Gentoo wxWidgets Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">wxcode</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/wxsqlite3/wxsqlite3-3.2.1-r1.ebuild b/dev-db/wxsqlite3/wxsqlite3-3.2.1-r1.ebuild
new file mode 100644
index 000000000000..5287794cfeba
--- /dev/null
+++ b/dev-db/wxsqlite3/wxsqlite3-3.2.1-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+WX_GTK_VER="3.0"
+
+inherit eutils multilib wxwidgets
+
+DESCRIPTION="C++ wrapper around the public domain SQLite 3.x database"
+HOMEPAGE="http://wxcode.sourceforge.net/components/wxsqlite3/"
+SRC_URI="mirror://sourceforge/wxcode/${P}.tar.gz"
+
+LICENSE="wxWinLL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="
+ x11-libs/wxGTK:3.0[X]
+ dev-db/sqlite:3"
+RDEPEND="${DEPEND}"
+
+#S="${WORKDIR}/${P%.1}"
+
+src_prepare() {
+ rm -rf sqlite3 || die
+ cp configure30 configure || die
+ sed \
+ -e "s:@WXVERSION@:${WX_GTK_VER}:g" \
+ -e "s:@LIBDIR@:$(get_libdir):g" \
+ -e "s:@VERSION@:${PV}:g" \
+ "${FILESDIR}"/${P}.pc.in > ${PN}.pc || die
+}
+
+src_configure() {
+ econf \
+ --enable-shared \
+ --enable-unicode \
+ --with-wx-config="${WX_CONFIG}" \
+ --with-wxshared \
+ --with-sqlite3-prefix="${PREFIX}/usr"
+}
+
+src_install() {
+ default
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ${PN}.pc
+
+ dodoc Readme.txt
+ dohtml -r docs/html/*
+ docinto samples
+ dodoc -r samples/*
+}
diff --git a/dev-db/xbase/Manifest b/dev-db/xbase/Manifest
new file mode 100644
index 000000000000..41d64471010a
--- /dev/null
+++ b/dev-db/xbase/Manifest
@@ -0,0 +1,15 @@
+AUX xbase-2.0.0-ppc.patch 679 SHA256 6cd387bc8b248e4fee1c6155d95ab24663daa2923fc4f6645c271fac6d354029 SHA512 3a91e2ba27cfcb8f31172db7d381a81ebb2a49b984ae7d4f108839ef43c520d5d577b3393a3d520e4d95bf808fc50f738f54abc0172aa25f045267349dd00fe8 WHIRLPOOL 18c31962ab16d8c862fd62ce2567579248c0ca915cd7c1b429791e415687a9ebf16b2cfbf79b7315c90f3ba13babd4b23c04b7984395d78f96360a95547434d3
+AUX xbase-3.1.2-fixconfig.patch 467 SHA256 b4e88b097576d7d68c95296400c125c75863aba6d030b2518d2eb6e81237a0a8 SHA512 15acffe25b7bb0eb495ad480deb9e2c349fee10b938a8cc9fd295ea9c745b7e1c1c94f544513a9839f577ac5a9af892c72c83f42e79601a244ecf84c99eeafb8 WHIRLPOOL e0c1efa7f09e3bf709c6532a3dba99ee46b32023bc84ef16a9165b9de55057c140c6f7e997008d705639153a7a997ab369c4964531e2b03096c07d870e787996
+AUX xbase-3.1.2-gcc-version.patch 441 SHA256 ebe174ede925beabfd9e2f4d0003b6b675cbe791bc33eeb5c4ededa3bea76ae8 SHA512 2104f0c2d186a753bfb8d55d8234e3f2dc53e3b1ee375fbad47654ca5f814d62133606829e8a7884d147d1a213269394a88e9ca356dfb24fd0c8f6f73ec5b878 WHIRLPOOL 0785cbbdae63c668afa5391f04b78d2b026a1a84bdf782bd1df2bd4fcf02ba4c3faabbb6152074ee4b00425f525e364041095354cc3559ea47bc54ca71c922fa
+AUX xbase-3.1.2-gcc44.patch 700 SHA256 5ba9e7b453efad1edb5c05bedfd7e4a2911a4ab1ca380a3a95ef93e35fe918ce SHA512 b38415eced0ead8455bc443424ede47f110fb5d3d2673ccd74fbd438bb08a1fcdabf071bbece3ff3af2fe285b57ea3f2553f8797ccff03a33f7c38dd5c665a4c WHIRLPOOL 6df5ec855622033e3e79c4681a2ba7025acf6e6b5345eb4af2b9c2017559673542316cc3bc92b73b1edc8975fa38dba3cf891f16e1c5a375667e6e700b36de5e
+AUX xbase-3.1.2-gcc47.patch 572 SHA256 d423a868b16f3af3f548698468f7f82c0e72eea61d83e613309437cce6ccecce SHA512 765502e91df57876bc641c0eaae27a0531e9cca10d67f5811b0b93f0c79a8610d684f16a3fc0bfe2f7dc0c1862fa11658a869a2b561762e7697877117f4203fb WHIRLPOOL 50eb4ed59cbdf1af34d0f46743c3e435e3d8004032637a9bbf5293d6b7de3f35a98f388854b1dfccda290fab56254a4a816e6395de65e2f9a6fdc34b0ec4cbaa
+AUX xbase-3.1.2-gcc6.patch 2299 SHA256 a324c754044a66fc777dcdaa5b439f8db66fde0aebb3522b9bd2961b23be24a5 SHA512 e8c3e5a4577a652bbd4582dbca57a1be0c9273ea60b105308258f35431e450fd18031ecac0a61ab934825533d5f07170bdeb88130ece6ca50e3164f82a947eb5 WHIRLPOOL fb2ab4831b6dc351873245a1f58c79caaaad25e67a887c14a2eb166e454e4612df0e76591e0847dd5a956419e07a537d77983d4a07abc7e69502fdfe41ca2e39
+AUX xbase-3.1.2-gcc7.patch 1282 SHA256 38c0cec8081c05e391c28b423f3181802a8698036f66168ceb68b7d5927d048c SHA512 1430ed552aed048c27b37ddc88eab2241b7c1632e884ebf35f333ad1adacbe60eccdcd4b81d869db004e2bec70622f950fecd4beea3f82f8c60a398a4c52b1b7 WHIRLPOOL 9d9e96c1ccd156357984e8f72d257434b96e54d8bbd4a61252af1ab14f40b54d5beb45ec250f92a35e21625ea0ae1c4b7636e4e38732f5760bf177b70c626faf
+AUX xbase-3.1.2-lesserg.patch 9096 SHA256 54b78e10704ae7c1c13f94c7284cdc7f5c1fee93236ff9ba0fb2863737d4f9f6 SHA512 5be7a701922a31e37c570dc054a9fa3f7833ce6733ad776311675dcd615400ec1cb0794c19f4eca110b857d68405391bf5801063224284d7d55fe3fe8dee09ad WHIRLPOOL 81e2987172bd59bd566ea17322534cf7f7938f48fd47489b7bdca2b033cae02cf236bde075fa7dd43448029dc45dacca558779bc2cbf2f1ca611c05b583a11f3
+AUX xbase-3.1.2-outofsource.patch 1290 SHA256 ca7cc25ae2c8acefc41b382e3c01457119f6ffb2dc004cb4dca646844ee86158 SHA512 76164108abd4f50c4fe3d13a4c868936ad6a1d11ae8dd1e82487280bd4bdb70e5f751efda826ba4debc0112c67628b0c78fbdecbf556c18626d5afd378184270 WHIRLPOOL d03c24ad0c2b63afc15c3b469cd3861a40c7293e0447401f4137fb52bb7e930a6e21c94661dddd42972849e5ff58b99d9031c3f78467d3e09642ae5556b396cb
+AUX xbase-3.1.2-xbnode.patch 341 SHA256 b5cb7d2083f3958a551ec1f817bcf05db1f99bd0ebdc51a4d8b41a2201e16617 SHA512 795a6b06990d1399924007a7ad4e674f65131f5ef7ed339ed0f53445f6939c373d375603ae3aa8dee697335327fd1ae0b89fc31d68a253cc5a12380faddba524 WHIRLPOOL 7efe56e8234a72022aac0c6b12e1bc5f6c8868b7b00ef33d2ee61801356a324c7c76dedb44b128cb895059fa4087e5a8c37d57a13839ecbe642f631c24ecbf26
+DIST xbase64-3.1.2.tar.gz 425650 SHA256 5920c453e358ef4af8408c1998805af4537d288436dd7f3c31b5561bfe3c489c SHA512 bd9e27e250ad1035aa7c692cba668b2e9cf678c398f2ee9fdb9a08374a77f3920c059edd8c72fbd172e488d6169b256526acb47b7685e3dbbecd6cbca859ce87 WHIRLPOOL 0fc8b4ff99d1c8bd044f9d62cd662cd6131f3a875ce6f0775c449c4a78fa5ec858a4f24558a1a2409ef159ae357768d67bc1ac165db7e19f0335d5a67777c82d
+EBUILD xbase-3.1.2.ebuild 1430 SHA256 dac1aec4ea991ab716dd7eeda7d10a421cacc5dbfff118394db66727b83359a0 SHA512 a42c6d2b970d63456c91e46b41596b6ccde90c0bd8f448de7af997ed0c07488bb4be87475a90bf4b02052f79eb2876c5f65fe141be35ddb28c45d6fd82cada8d WHIRLPOOL 1bd9e83a1716afcba3454ccee2f2be4ae6a623edb631b532e279d259aea28c7ad31e26dc32795d7fef6b04777c9edfe9acaff6652511287f496ba95fe37a2e4b
+MISC ChangeLog 2795 SHA256 d64daba00d9a6335cec1a41950d4869cb68777de7982274b2dc507ec4beee456 SHA512 eb578ff2a88572e47b7d71261641fb4d661a5fa2900c99ad3bb6d63e2a8045bcc70054bc348096a04a82d16864b90d2aeeca3c27005e73c62988929f83107430 WHIRLPOOL ad03c952de51f13d49a5d80dd9eb36c6fe913bc43edae63bb5758a7db9dbd8cc6d66d8db9dd5597e2f3a6200285bf2ac949e14baecc63790ba739f538c05ff1d
+MISC ChangeLog-2015 4988 SHA256 315238b0f77757dd23ba90257a00e63baeac1f6213e0290b11891a8e3ca5094f SHA512 a778ed4eb2edfb61efe442b287dce8cc07e5e6affe09a8d7b4a62e99a282ab686412f7b3a8d98e93932dbc78635d56d3a3a35349918b9767937730556a678db4 WHIRLPOOL 28e50a6cb2301b70d3571a1177bf08256113ab1f990db417b62590a0a931a9cdce3ab57f6ad95a2a7e7c1b84c65bd8cd15c70dbaa045b67f943ea3975442920d
+MISC metadata.xml 240 SHA256 063f3ecd0c58bb698527d9b31f7633402fa1b67f8cf9158909e1c82b1cb21f32 SHA512 7d73f296795e371ae182b184072c8ed76389fa4eea31e75eb6df2eaa735597465b8f0a913483ec6e12f8ab28133eb93a1292566668c59e9b0e8ebece704ad09e WHIRLPOOL b9a33b352d851492e68cc8a0d7025d43340a67b21f4cf5fad2667a3c14f47444b62fa26fca9d98896129a8405e5c2c80d71ddc795c3880b1675cfb86d0d7be61
diff --git a/dev-db/xbase/files/xbase-2.0.0-ppc.patch b/dev-db/xbase/files/xbase-2.0.0-ppc.patch
new file mode 100644
index 000000000000..3b743a9fd0ae
--- /dev/null
+++ b/dev-db/xbase/files/xbase-2.0.0-ppc.patch
@@ -0,0 +1,20 @@
+--- xbase-2.0.0/ltconfig.foo 2007-05-04 18:14:42.000000000 -0400
++++ xbase-2.0.0/ltconfig 2007-05-04 18:15:39.000000000 -0400
+@@ -1664,16 +1664,7 @@ linux-gnu*)
+ shlibpath_var=LD_LIBRARY_PATH
+ check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object'
+ sys_lib_search_path="/lib /usr/lib /usr/local/lib `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`"
+-
+- if test -f /lib/ld.so.1; then
+- dynamic_linker='GNU ld.so'
+- else
+- # Only the GNU ld.so supports shared libraries on MkLinux.
+- case "$host_cpu" in
+- powerpc*) dynamic_linker=no ;;
+- *) dynamic_linker='Linux ld.so' ;;
+- esac
+- fi
++ dynamic_linker='GNU ld.so'
+ ;;
+
+ netbsd* | openbsd*)
diff --git a/dev-db/xbase/files/xbase-3.1.2-fixconfig.patch b/dev-db/xbase/files/xbase-3.1.2-fixconfig.patch
new file mode 100644
index 000000000000..2bfe92f8239a
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-fixconfig.patch
@@ -0,0 +1,12 @@
+diff -up xbase64-3.1.2/xbase64-config.in.BAD xbase64-3.1.2/xbase64-config.in
+--- xbase64-3.1.2/xbase64-config.in.BAD 2009-08-19 22:58:42.081087534 -0400
++++ xbase64-3.1.2/xbase64-config.in 2009-08-19 22:58:45.604090002 -0400
+@@ -5,7 +5,7 @@ exec_prefix=@exec_prefix@
+ exec_prefix_set=no
+ CC="@CC@"
+ CXX="@CXX@"
+-LD="@SHARED_LD@"
++LD="@LD@"
+
+ usage="\
+ Usage: xbase-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] [--cc] [--cxx] [--ld]"
diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc-version.patch b/dev-db/xbase/files/xbase-3.1.2-gcc-version.patch
new file mode 100644
index 000000000000..3f0d209eec47
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-gcc-version.patch
@@ -0,0 +1,16 @@
+ configure.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 3110c70..5850231 100755
+--- a/configure.in
++++ b/configure.in
+@@ -74,7 +74,7 @@ AC_SUBST(RHREL)
+
+ # get G++ version
+ if test "$GXX" = "yes"; then
+- GXXVER=`${CXX} -v 2>&1 | grep version | cut -d " " -f 3 -`
++ GXXVER=`${CXX} -v 2>&1 | grep " version " | cut -d " " -f 3 -`
+ GXXVER="gcc${GXXVER}"
+ else
+ GXXVER=""
diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc44.patch b/dev-db/xbase/files/xbase-3.1.2-gcc44.patch
new file mode 100644
index 000000000000..d23c9f23d08f
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-gcc44.patch
@@ -0,0 +1,24 @@
+diff -up xbase64-3.1.2/xbase64/xbase64.cpp.gcc44 xbase64-3.1.2/xbase64/xbase64.cpp
+--- xbase64-3.1.2/xbase64/xbase64.cpp.gcc44 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbase64.cpp 2009-08-19 23:08:14.724079392 -0400
+@@ -66,6 +66,8 @@
+ #include <dos.h>
+ #endif
+
++#include <cerrno>
++
+
+ /*! \file xbase64.cpp
+ */
+diff -up xbase64-3.1.2/xbase64/xblock.cpp.gcc44 xbase64-3.1.2/xbase64/xblock.cpp
+--- xbase64-3.1.2/xbase64/xblock.cpp.gcc44 2009-08-19 23:08:59.408186578 -0400
++++ xbase64-3.1.2/xbase64/xblock.cpp 2009-08-19 23:09:11.416184844 -0400
+@@ -65,6 +65,8 @@
+ //#include <stdio.h>
+ //#include <stdlib.h>
+
++#include <cerrno>
++
+ /*! \file xblock.cpp
+ */
+ #ifdef XB_LOCKING_ON
diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc47.patch b/dev-db/xbase/files/xbase-3.1.2-gcc47.patch
new file mode 100644
index 000000000000..7774251ed68d
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-gcc47.patch
@@ -0,0 +1,21 @@
+diff -up xbase64-3.1.2/bin/dumprecs.cpp.gcc47 xbase64-3.1.2/bin/dumprecs.cpp
+--- xbase64-3.1.2/bin/dumprecs.cpp.gcc47 2012-01-05 15:36:00.377536998 -0500
++++ xbase64-3.1.2/bin/dumprecs.cpp 2012-01-05 15:36:15.198399295 -0500
+@@ -70,7 +70,7 @@ int main(int ac,char** av)
+ return 1;
+ }
+
+- for(int i=1; i<ac; ++i){
++ for(int i=1; i<ac; ++i){{
+ char* filename = av[i];
+
+ xbDbf MyFile( &x );
+@@ -91,7 +91,7 @@ int main(int ac,char** av)
+ x.DisplayError( rc );
+ }
+ MyFile.CloseDatabase(); /* close database */
+- }
++ }}
+ return 0;
+ }
+
diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc6.patch b/dev-db/xbase/files/xbase-3.1.2-gcc6.patch
new file mode 100644
index 000000000000..8dd4cdaef971
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-gcc6.patch
@@ -0,0 +1,49 @@
+diff -up xbase64-3.1.2/xbase64/xblock.cpp.gcc6 xbase64-3.1.2/xbase64/xblock.cpp
+--- xbase64-3.1.2/xbase64/xblock.cpp.gcc6 2016-02-16 16:06:40.146864585 -0500
++++ xbase64-3.1.2/xbase64/xblock.cpp 2016-02-16 16:07:51.137342339 -0500
+@@ -84,7 +84,7 @@ xbLock::xbLock(xbDbf * pdbf)
+ TableLockCnt = 0;
+ MemoLockCnt = 0;
+ IndexLockCnt = 0;
+- std::cout << "xbLock constructor" << std::cout;
++ std::cout << "xbLock constructor";
+ }
+ /*************************************************************************/
+ xbLock::~xbLock()
+@@ -169,7 +169,7 @@ else if( LockType == XB_LOCK || LockType
+ /*************************************************************************/
+ xbaseLock::xbaseLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+- std::cout << "xbaseLock constructor" << std::cout;
++ std::cout << "xbaseLock constructor";
+ }
+ /*************************************************************************/
+ xbShort xbaseLock::LockTableHeader( xbShort LockType )
+@@ -336,7 +336,7 @@ xbShort xbaseLock::LockInit()
+ /*************************************************************************/
+ dbaseLock::dbaseLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+- std::cout << "dbaseLock constructor" << std::cout;
++ std::cout << "dbaseLock constructor";
+ }
+ /*************************************************************************/
+ xbShort dbaseLock::LockTableHeader( xbShort LockType )
+@@ -460,7 +460,7 @@ xbShort dbaseLock::UnlockAll()
+ /*************************************************************************/
+ clipperLock::clipperLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+- std::cout << "clipperLock constructor" << std::cout;
++ std::cout << "clipperLock constructor";
+ }
+ /*************************************************************************/
+ xbShort clipperLock::LockTableHeader( xbShort LockType )
+@@ -523,7 +523,7 @@ xbShort clipperLock::UnlockAll()
+ /*************************************************************************/
+ foxproLock::foxproLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+- std::cout << "foxproLock constructor" << std::cout;
++ std::cout << "foxproLock constructor";
+ }
+ /*************************************************************************/
+ xbShort foxproLock::LockTableHeader( xbShort LockType )
+diff -up xbase64-3.1.2/xbase64/xblock.h.gcc6 xbase64-3.1.2/xbase64/xblock.h
diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc7.patch b/dev-db/xbase/files/xbase-3.1.2-gcc7.patch
new file mode 100644
index 000000000000..119fb59e1681
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-gcc7.patch
@@ -0,0 +1,34 @@
+diff -up xbase64-3.1.2/bin/dbfutil1.cpp.gcc7 xbase64-3.1.2/bin/dbfutil1.cpp
+--- xbase64-3.1.2/bin/dbfutil1.cpp.gcc7 2017-02-20 09:59:36.135561103 -0500
++++ xbase64-3.1.2/bin/dbfutil1.cpp 2017-02-20 10:00:32.743218194 -0500
+@@ -157,7 +157,8 @@ void MyClass::SetFilter()
+ memset( Expression, 0x00, 512 );
+ while( !strlen( Expression )){
+ std::cout << "Enter filter expression (like AMOUNT<5)" << std::endl;
+- gets( Expression );
++ fgets( Expression, sizeof(Expression), stdin );
++ strtok( Expression, "\n" );
+ }
+ if( xbf )
+ delete xbf;
+@@ -247,7 +248,8 @@ void MyClass::ProcessExpression()
+ while( !strstr( exprsn, "QUIT" ) && !strstr( exprsn, "quit" )){
+
+ std::cout << ">";
+- gets( exprsn );
++ fgets( exprsn, sizeof(exprsn), stdin );
++ strtok( exprsn, "\n" );
+
+ if( strstr( exprsn, "HELP" ) || strstr( exprsn, "help" )){
+ std::cout << "** Command Help ***" << std::endl << std::endl;
+diff -up xbase64-3.1.2/xbase64/xbase64.h.gcc7 xbase64-3.1.2/xbase64/xbase64.h
+--- xbase64-3.1.2/xbase64/xbase64.h.gcc7 2017-02-20 09:49:07.063609482 -0500
++++ xbase64-3.1.2/xbase64/xbase64.h 2017-02-20 09:57:36.586618723 -0500
+@@ -53,6 +53,7 @@
+ #endif
+
+ #include <string.h>
++#include <cstdio>
+
+ #if defined(__WIN32__)
+ #include "windows.h"
diff --git a/dev-db/xbase/files/xbase-3.1.2-lesserg.patch b/dev-db/xbase/files/xbase-3.1.2-lesserg.patch
new file mode 100644
index 000000000000..b6eb71e0b618
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-lesserg.patch
@@ -0,0 +1,294 @@
+diff -up xbase64-3.1.2/xbase64/xbase64.cpp.lesserg xbase64-3.1.2/xbase64/xbase64.cpp
+--- xbase64-3.1.2/xbase64/xbase64.cpp.lesserg 2012-01-05 15:31:01.695312436 -0500
++++ xbase64-3.1.2/xbase64/xbase64.cpp 2012-01-05 15:31:01.717312232 -0500
+@@ -38,7 +38,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbase64.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbase64.h.lesserg xbase64-3.1.2/xbase64/xbase64.h
+--- xbase64-3.1.2/xbase64/xbase64.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbase64.h 2012-01-05 15:31:01.718312223 -0500
+@@ -42,7 +42,7 @@
+ #ifndef __XB_XBASE_H__
+ #define __XB_XBASE_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+@@ -60,7 +60,7 @@
+ // ripped from wxWindows
+
+ // _declspec works in BC++ 5 and later, as well as VC++
+-#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNU LesserC__)
++#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNU_LesserC__)
+ # ifdef XBMAKINGDLL
+ # define XBDLLEXPORT __declspec( dllexport )
+ # define XBDLLEXPORT_DATA(type) __declspec( dllexport ) type
+diff -up xbase64-3.1.2/xbase64/xbcdx.h.lesserg xbase64-3.1.2/xbase64/xbcdx.h
+--- xbase64-3.1.2/xbase64/xbcdx.h.lesserg 2012-01-05 15:32:17.398608985 -0500
++++ xbase64-3.1.2/xbase64/xbcdx.h 2012-01-05 15:32:43.051370614 -0500
+@@ -50,7 +50,7 @@ struct CdxInnerNode: public CdxNode
+ {
+ char keys[500];
+ }
+-#ifdef __GNU LesserC__
++#ifdef __GNU_LesserC__
+ __attribute__((packed))
+ #endif
+ ;
+@@ -67,7 +67,7 @@ struct CdxLeafNode: public CdxNode
+ char byteCount;
+ char keys[488];
+ }
+-#ifdef __GNU LesserC__
++#ifdef __GNU_LesserC__
+ __attribute__((packed))
+ #endif
+ ;
+diff -up xbase64-3.1.2/xbase64/xbdate.cpp.lesserg xbase64-3.1.2/xbase64/xbdate.cpp
+--- xbase64-3.1.2/xbase64/xbdate.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbdate.cpp 2012-01-05 15:31:01.719312213 -0500
+@@ -40,7 +40,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbdate.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbdate.h.lesserg xbase64-3.1.2/xbase64/xbdate.h
+--- xbase64-3.1.2/xbase64/xbdate.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbdate.h 2012-01-05 15:31:01.721312195 -0500
+@@ -45,7 +45,7 @@
+ #ifndef __XB_XBDATE_H__
+ #define __XB_XBDATE_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbdbf.cpp.lesserg xbase64-3.1.2/xbase64/xbdbf.cpp
+--- xbase64-3.1.2/xbase64/xbdbf.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbdbf.cpp 2012-01-05 15:31:01.722312185 -0500
+@@ -39,7 +39,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbdbf.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbdbf.h.lesserg xbase64-3.1.2/xbase64/xbdbf.h
+--- xbase64-3.1.2/xbase64/xbdbf.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbdbf.h 2012-01-05 15:31:01.723312175 -0500
+@@ -41,7 +41,7 @@
+ #ifndef __XB_DBF_H__
+ #define __XB_DBF_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbexp.cpp.lesserg xbase64-3.1.2/xbase64/xbexp.cpp
+--- xbase64-3.1.2/xbase64/xbexp.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbexp.cpp 2012-01-05 15:31:01.725312157 -0500
+@@ -38,7 +38,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbexp.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbexp.h.lesserg xbase64-3.1.2/xbase64/xbexp.h
+--- xbase64-3.1.2/xbase64/xbexp.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbexp.h 2012-01-05 15:31:01.726312148 -0500
+@@ -42,7 +42,7 @@
+ #ifndef __XB_EXP_H__
+ #define __XB_EXP_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbfile.cpp.lesserg xbase64-3.1.2/xbase64/xbfile.cpp
+--- xbase64-3.1.2/xbase64/xbfile.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbfile.cpp 2012-01-05 15:31:01.727312139 -0500
+@@ -39,7 +39,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbfile.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbfile.h.lesserg xbase64-3.1.2/xbase64/xbfile.h
+--- xbase64-3.1.2/xbase64/xbfile.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbfile.h 2012-01-05 15:31:01.728312130 -0500
+@@ -45,7 +45,7 @@
+ #ifndef __XB_FILE_H__
+ #define __XB_FILE_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbfilter.cpp.lesserg xbase64-3.1.2/xbase64/xbfilter.cpp
+--- xbase64-3.1.2/xbase64/xbfilter.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbfilter.cpp 2012-01-05 15:31:01.729312120 -0500
+@@ -38,7 +38,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbfilter.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbfilter.h.lesserg xbase64-3.1.2/xbase64/xbfilter.h
+--- xbase64-3.1.2/xbase64/xbfilter.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbfilter.h 2012-01-05 15:31:01.731312101 -0500
+@@ -44,7 +44,7 @@
+ #ifndef __XB_FILTER_H__
+ #define __XB_FILTER_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbindex.cpp.lesserg xbase64-3.1.2/xbase64/xbindex.cpp
+--- xbase64-3.1.2/xbase64/xbindex.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbindex.cpp 2012-01-05 15:31:01.732312092 -0500
+@@ -37,7 +37,7 @@
+ USA
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbindex.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbindex.h.lesserg xbase64-3.1.2/xbase64/xbindex.h
+--- xbase64-3.1.2/xbase64/xbindex.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbindex.h 2012-01-05 15:31:01.733312083 -0500
+@@ -43,7 +43,7 @@
+ #ifndef __XB_INDEX_H__
+ #define __XB_INDEX_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xblock.cpp.lesserg xbase64-3.1.2/xbase64/xblock.cpp
+--- xbase64-3.1.2/xbase64/xblock.cpp.lesserg 2012-01-05 15:31:01.696312427 -0500
++++ xbase64-3.1.2/xbase64/xblock.cpp 2012-01-05 15:31:01.734312074 -0500
+@@ -42,7 +42,7 @@
+ USA
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xblock.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xblock.h.lesserg xbase64-3.1.2/xbase64/xblock.h
+--- xbase64-3.1.2/xbase64/xblock.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xblock.h 2012-01-05 15:31:01.735312065 -0500
+@@ -44,7 +44,7 @@
+ #ifndef __XB_XBLOCK_H__
+ #define __XB_XBLOCK_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbndx.cpp.lesserg xbase64-3.1.2/xbase64/xbndx.cpp
+--- xbase64-3.1.2/xbase64/xbndx.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbndx.cpp 2012-01-05 15:31:01.737312045 -0500
+@@ -36,7 +36,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbndx.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbndx.h.lesserg xbase64-3.1.2/xbase64/xbndx.h
+--- xbase64-3.1.2/xbase64/xbndx.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbndx.h 2012-01-05 15:31:01.738312036 -0500
+@@ -41,7 +41,7 @@
+ #ifndef __XB_NDX_H__
+ #define __XB_NDX_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbntx.cpp.lesserg xbase64-3.1.2/xbase64/xbntx.cpp
+--- xbase64-3.1.2/xbase64/xbntx.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbntx.cpp 2012-01-05 15:31:01.740312018 -0500
+@@ -40,7 +40,7 @@
+ USA
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbntx.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbntx.h.lesserg xbase64-3.1.2/xbase64/xbntx.h
+--- xbase64-3.1.2/xbase64/xbntx.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbntx.h 2012-01-05 15:31:01.741312009 -0500
+@@ -42,7 +42,7 @@
+ #ifndef __XB_NTX_H__
+ #define __XB_NTX_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbstring.cpp.lesserg xbase64-3.1.2/xbase64/xbstring.cpp
+--- xbase64-3.1.2/xbase64/xbstring.cpp.lesserg 2006-07-17 12:54:42.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbstring.cpp 2012-01-05 15:31:01.742312000 -0500
+@@ -38,7 +38,7 @@
+
+ */
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma implementation "xbstring.h"
+ #endif
+
+diff -up xbase64-3.1.2/xbase64/xbstring.h.lesserg xbase64-3.1.2/xbase64/xbstring.h
+--- xbase64-3.1.2/xbase64/xbstring.h.lesserg 2006-07-17 12:54:50.000000000 -0400
++++ xbase64-3.1.2/xbase64/xbstring.h 2012-01-05 15:31:01.743311990 -0500
+@@ -41,7 +41,7 @@
+ #ifndef __XBSTRING_H__
+ #define __XBSTRING_H__
+
+-#ifdef __GNU LesserG__
++#ifdef __GNU_LesserG__
+ #pragma interface
+ #endif
+
diff --git a/dev-db/xbase/files/xbase-3.1.2-outofsource.patch b/dev-db/xbase/files/xbase-3.1.2-outofsource.patch
new file mode 100644
index 000000000000..87094a8b429a
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-outofsource.patch
@@ -0,0 +1,52 @@
+ bin/Makefile.am | 2 +-
+ examples/Makefile.am | 2 +-
+ libtest/Makefile.am | 2 +-
+ xbase64/Makefile.am | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/bin/Makefile.am b/bin/Makefile.am
+index 43c8333..ca49ca1 100755
+--- a/bin/Makefile.am
++++ b/bin/Makefile.am
+@@ -1,5 +1,5 @@
+
+-INCLUDES= -I$(topdir)
++INCLUDES= -I$(top_srcdir)
+ LDADD = -L$(topdir)/xbase64 -lxbase64
+
+ INSTALL_PROGRAM = @INSTALL@
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index 248b1ec..85adbf3 100755
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -1,5 +1,5 @@
+
+-INCLUDES= -I$(topdir) $(all_includes)
++INCLUDES= -I$(top_srcdir) $(all_includes)
+ LDADD = -L$(topdir)/xbase64 -lxbase64
+
+ # for shadow passwords override the value
+diff --git a/libtest/Makefile.am b/libtest/Makefile.am
+index 9e84830..1b73af1 100755
+--- a/libtest/Makefile.am
++++ b/libtest/Makefile.am
+@@ -1,5 +1,5 @@
+
+-INCLUDES= -I$(topdir)
++INCLUDES= -I$(top_srcdir)
+ LDADD = -L$(topdir)/xbase64 -lxbase64
+
+ INSTALL_PROGRAM = @INSTALL@
+diff --git a/xbase64/Makefile.am b/xbase64/Makefile.am
+index b0dff24..857aa82 100755
+--- a/xbase64/Makefile.am
++++ b/xbase64/Makefile.am
+@@ -25,7 +25,7 @@
+ #
+ #
+
+-INCLUDES = -I$(topdir)
++INCLUDES = -I$(top_srcdir)
+
+ lib_LTLIBRARIES = libxbase64.la
+
diff --git a/dev-db/xbase/files/xbase-3.1.2-xbnode.patch b/dev-db/xbase/files/xbase-3.1.2-xbnode.patch
new file mode 100644
index 000000000000..98488453cc84
--- /dev/null
+++ b/dev-db/xbase/files/xbase-3.1.2-xbnode.patch
@@ -0,0 +1,9 @@
+diff -up xbase64-3.1.2/xbase64/xbnode.cpp.BAD xbase64-3.1.2/xbase64/xbnode.cpp
+--- xbase64-3.1.2/xbase64/xbnode.cpp.BAD 2009-08-19 23:10:38.444059289 -0400
++++ xbase64-3.1.2/xbase64/xbnode.cpp 2009-08-19 23:10:47.348202984 -0400
+@@ -1,4 +1,4 @@
+-#include "xbNode.h"
++#include "xbnode.h"
+
+ void xbNodeLink::AddNode(xbNodeLink* node)
+ {
diff --git a/dev-db/xbase/metadata.xml b/dev-db/xbase/metadata.xml
new file mode 100644
index 000000000000..40a7cde10e6d
--- /dev/null
+++ b/dev-db/xbase/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="sourceforge">xdb</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/xbase/xbase-3.1.2.ebuild b/dev-db/xbase/xbase-3.1.2.ebuild
new file mode 100644
index 000000000000..c38abe5a5f24
--- /dev/null
+++ b/dev-db/xbase/xbase-3.1.2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="xbase (i.e. dBase, FoxPro, etc.) compatible C++ class library"
+HOMEPAGE="https://sourceforge.net/projects/xdb/ http://linux.techass.com/projects/xdb/"
+SRC_URI="mirror://sourceforge/xdb/${PN}64-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm hppa ppc ppc64 x86 ~x86-fbsd"
+IUSE="doc static-libs"
+
+S="${WORKDIR}"/${PN}64-${PV}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fixconfig.patch
+ "${FILESDIR}"/${P}-gcc44.patch
+ "${FILESDIR}"/${PN}-2.0.0-ppc.patch
+ "${FILESDIR}"/${P}-xbnode.patch
+ "${FILESDIR}"/${P}-lesserg.patch
+ "${FILESDIR}"/${P}-outofsource.patch
+ "${FILESDIR}"/${P}-gcc47.patch
+ "${FILESDIR}"/${P}-gcc-version.patch
+ "${FILESDIR}"/${P}-gcc6.patch
+ "${FILESDIR}"/${P}-gcc7.patch
+)
+
+src_prepare() {
+ default
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ if use doc; then
+ HTML_DOCS+=( html/. )
+ if [[ -e examples/.libs ]] ; then
+ rm -r examples/.libs || die
+ fi
+ dodoc -r examples
+ fi
+
+ default
+ find "${D}" -name '*.la' -delete || die
+
+ if use doc; then
+ rm "${ED%/}"/usr/share/doc/${PF}/html/copying.lib || die
+ rm "${ED%/}"/usr/share/doc/${PF}/html/Makefile{,.in,.am} || die
+ fi
+
+ # media-tv/linuxtv-dvb-apps collision, bug #208596
+ mv "${ED%/}"/usr/bin/{,${PN}-}zap || die
+}
diff --git a/dev-db/xbsql/Manifest b/dev-db/xbsql/Manifest
new file mode 100644
index 000000000000..d5f181bb73cf
--- /dev/null
+++ b/dev-db/xbsql/Manifest
@@ -0,0 +1,9 @@
+AUX xbsql-0.11-autotools.patch 495 SHA256 412a86d55b35be897e64443b2d74edecdc453f6d4ce76c933bafc2eda813e583 SHA512 fd5ecfbf5a63393147e305bfa1704848f807f97f0af4c03bdae7ad6be9085a4bd97724fa59aeec903d3020a01f42cd29440b619705d7678d153e8c4a3e59f450 WHIRLPOOL 577b372d279535f9a1d15046321c6ae806bb342e879dd9dfd10b279ae1bc6ea10ec22700504f8a828559e982cd40718c8bd398200bb7a322cfc152e334ab6abe
+AUX xbsql-0.11-bfr-overflow.patch 3015 SHA256 f71393da3c7d55eeb524ad0fde6828f1de5677981d34ffb6e3b41a1289092558 SHA512 37d4f541fa7e85a9297e19d3793f97d80acef07a9131e35ed7dfa5e277aa646463aafe731c47885251171318edca141bfc2b8304a971db7804f3f0a1eb66d329 WHIRLPOOL fe76bbecdd7b44ef83af98a560a1e71c934db28b3fb7312c964b11b0b950b6b76c8029770971994f4292d76d2331384c3d04bfb88183565b8b2d32ea7e4a08aa
+AUX xbsql-0.11-ncurses64.patch 542 SHA256 405c0b239a8b2c5cea8157b5f1dd050df786d55e14fb7092cda36038efb3aab7 SHA512 64148cab80c3d5bc0209e31c0885ea69d3124dc8ad11c57706b71aafe926451928610aeb5dab6639b5a405bcba07d1a3e4588224293d3e4343f76eb194d3aec8 WHIRLPOOL 0ac35294cae79b3ffc28e2d4d109ee76b84891eafbfb9dfb1a8d55966dfe0d7f0e791b9cb276bdf93304eee7b884902129bf2fdb194b4effdf1e7bc02dc7e9ad
+AUX xbsql-0.11-xbase64.patch 2076 SHA256 4da0e870a1ea1f400e752afe4d97a5cb725058244fc197398b0d48c2e08910d6 SHA512 9b1848156f0629a486510a87077c55548b338206331dbf2b7011487ba04bf7986f73b160505defe319b0144cbf617882da760de8f355b81c757166a603931ef3 WHIRLPOOL 4e84bbd9aeab8a7f996a9bc84af05152da300f3de9c00c686b0380799ada190ff0377e7960d92bf00b4b59b2cd20ecc99942c9bafd808e4baeab869d3f7a59c1
+DIST xbsql-0.11.tgz 307392 SHA256 c91836a4c3f138b6e211d4427dce840cd6b30853f0dffaa3bc36d05f8751606a SHA512 caf8a6d8191f7de860008e5ac2628e388097b05999887ec52b91684f6577dd3152dfa164b71a37d84ef70f43ab868dd02b30bc76c88208d4daa85d8e111ea3a4 WHIRLPOOL 0aecbb9725a2bccac9941eebb160d4dc15f8373e22641ed7a6b75c27955cf61b1ec62f59c3c496a3faa3f1ff7887a2658c08149da6cf1cc59214489ed3510919
+EBUILD xbsql-0.11-r2.ebuild 821 SHA256 def91ec2d759827e73fa574aae353ad7998e8a14de5e5a794f2f50ab6f70a82d SHA512 74b5d612ace30243ab726c2f424d940d4d4e4f00226a0d926aa58e875b2b5fef6bc3a463da6bb3cc2ba61b7398d3507598ad96352e27fb27cb06e70fab92ece1 WHIRLPOOL 8d101018465727d99380b899be6ead811ec8198c34e3ce848dff87eff3e95d74ee326242a367e7490e593d35b8049873161476ad0d65d294af21d39fb146a0eb
+MISC ChangeLog 2663 SHA256 483ace0d0f7515e7332ec35f31de678bb6a080829b3a165cc69531cf511a7bf8 SHA512 d1ac2f33f761cc75513682a245859adcb08efe93ea3e5af84424c8e908a6067588c06ebff64e993320f4638f8e1a0839dc1aa02b98f9276491b04679166a570e WHIRLPOOL f75a20bddb25c07ac20dce187e6a7ac4cde34ca392253dd77412beaa1024aab1bc776d6dc49d648d01bbcab10212d730727c5dc353a76619eb2c9709713c0e6d
+MISC ChangeLog-2015 2000 SHA256 c3b459295a3f4162a9e34ec0ebe12999317dc40e73cbd3211febb3f2b4fcb7e4 SHA512 9c69519928ef103c80abf99431157cba20ccac4f0d1d8e8c00e6e9ea228160e5faee44ff89aa6b6eaecdcce1a5122a2b2760d7ef6134a8fc9f48d10c0e1442d6 WHIRLPOOL 0762e2ee631aa7b43ad9250584d9f63521c27b8f083a0fe7bf1fac4a4dd1c6ee431bdae17f92f26498feaf6623ef812d8bed34d8e54a7070db8c15e0cebd1421
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/dev-db/xbsql/files/xbsql-0.11-autotools.patch b/dev-db/xbsql/files/xbsql-0.11-autotools.patch
new file mode 100644
index 000000000000..b1e72562b397
--- /dev/null
+++ b/dev-db/xbsql/files/xbsql-0.11-autotools.patch
@@ -0,0 +1,18 @@
+ xbsql/Makefile.am | 7 +------
+ 1 files changed, 1 insertions(+), 6 deletions(-)
+
+diff --git a/xbsql/Makefile.am b/xbsql/Makefile.am
+index c281358..5a09198 100644
+--- a/xbsql/Makefile.am
++++ b/xbsql/Makefile.am
+@@ -1,9 +1,4 @@
+-DEBUG = -g
+-CC = g++
+-CFLAGS = -UNO_READLINE -I/usr/local/include $(DEBUG)
+-CXXFLAGS = -UNO_READLINE -I/usr/local/include $(DEBUG)
+-LDFLAGS = $(DEBUG)
+-INCLUDE = -I/usr/local/include
++CC = $(CXX)
+
+ lib_LTLIBRARIES = libxbsql.la
+ bin_PROGRAMS = xql
diff --git a/dev-db/xbsql/files/xbsql-0.11-bfr-overflow.patch b/dev-db/xbsql/files/xbsql-0.11-bfr-overflow.patch
new file mode 100644
index 000000000000..1615fb4d4389
--- /dev/null
+++ b/dev-db/xbsql/files/xbsql-0.11-bfr-overflow.patch
@@ -0,0 +1,79 @@
+ xbsql/xb_fieldset.cpp | 6 +++---
+ xbsql/xbsql.cpp | 20 ++++++++++----------
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/xbsql/xb_fieldset.cpp b/xbsql/xb_fieldset.cpp
+index ea9e726..f922ed3 100644
+--- a/xbsql/xb_fieldset.cpp
++++ b/xbsql/xb_fieldset.cpp
+@@ -58,10 +58,10 @@ XBSQL::Index
+ if ((fldno < 0) || (fldno >= fieldSet.getNumFields()))
+ return XBSQL::IndexNone ;
+
+- char buff[255] ;
+- strncpy (buff, tabname, sizeof(buff)) ;
++ char buff[256] ;
++ strncpy (buff, tabname, sizeof(buff) - 1) ;
+ strncat (buff, "_", sizeof(buff)) ;
+- strncat (buff, getFieldName(fldno), sizeof(buff)) ;
++ strncat (buff, getFieldName(fldno), sizeof(buff) - strlen(tabname) - 1) ;
+
+ const char *path = xbase->getPath (buff, "ndx") ;
+ int fd = open (path, O_RDONLY) ;
+diff --git a/xbsql/xbsql.cpp b/xbsql/xbsql.cpp
+index 9d07f88..96304c4 100644
+--- a/xbsql/xbsql.cpp
++++ b/xbsql/xbsql.cpp
+@@ -376,9 +376,9 @@ bool XBaseSQL::createTable
+ char name [256] ;
+ xbNdx ndxFile (&dbfFile) ;
+
+- strncpy (name, table, sizeof(name)) ;
++ strncpy (name, table, sizeof(name) - 1) ;
+ strncat (name, "_", sizeof(name)) ;
+- strncat (name, schema[idx].FieldName, sizeof(name)) ;
++ strncat (name, schema[idx].FieldName, sizeof(name) - strlen(table) - 1) ;
+
+ path = getPath (name, "ndx") ;
+ idxflag = index[idx] == XBSQL::IndexUnique ?
+@@ -467,9 +467,9 @@ XBSQLTable *XBaseSQL::openTable
+ {
+ char name[256] ;
+
+- strncpy (name, table, sizeof(name)) ;
++ strncpy (name, table, sizeof(name) - 1) ;
+ strncat (name, "_", sizeof(name)) ;
+- strncat (name, fSet.getFieldName (idx), sizeof(name)) ;
++ strncat (name, fSet.getFieldName (idx), sizeof(name) - strlen(table) - 1) ;
+
+ path = getPath (name, "ndx") ;
+ #ifndef _WIN32
+@@ -873,12 +873,12 @@ bool XBaseSQL::renameTable
+ char _newName[256] ;
+ const char *fname = fSet.getFieldName (idx) ;
+
+- strncpy (_oldName, oldName, sizeof(_oldName)) ;
++ strncpy (_oldName, oldName, sizeof(_oldName) - 1) ;
+ strncat (_oldName, "_", sizeof(_oldName)) ;
+- strncat (_oldName, fname, sizeof(_oldName)) ;
+- strncpy (_newName, newName, sizeof(_newName)) ;
++ strncat (_oldName, fname, sizeof(_oldName) - strlen(oldName) - 1) ;
++ strncpy (_newName, newName, sizeof(_newName) - 1) ;
+ strncat (_newName, "_", sizeof(_newName)) ;
+- strncat (_newName, fname, sizeof(_newName)) ;
++ strncat (_newName, fname, sizeof(_newName) - strlen(newName) - 1) ;
+
+ oldAnon = getPath (_oldName, "ndx") ;
+ newAnon = getPath (_newName, "ndx") ;
+@@ -956,9 +956,9 @@ bool XBaseSQL::dropTable
+ char _idxName[256] ;
+ const char *fname = fSet.getFieldName (idx) ;
+
+- strncpy (_idxName, table, sizeof(_idxName)) ;
++ strncpy (_idxName, table, sizeof(_idxName) - 1) ;
+ strncat (_idxName, "_", sizeof(_idxName)) ;
+- strncat (_idxName, fname, sizeof(_idxName)) ;
++ strncat (_idxName, fname, sizeof(_idxName) - strlen(table) - 1) ;
+
+ tabAnon = getPath (_idxName, "ndx") ;
+
diff --git a/dev-db/xbsql/files/xbsql-0.11-ncurses64.patch b/dev-db/xbsql/files/xbsql-0.11-ncurses64.patch
new file mode 100644
index 000000000000..4c04d2736b0b
--- /dev/null
+++ b/dev-db/xbsql/files/xbsql-0.11-ncurses64.patch
@@ -0,0 +1,19 @@
+--- xbsql-0.11/configure.BAD 2005-08-18 10:34:49.000000000 -0500
++++ xbsql-0.11/configure 2005-08-18 10:36:22.000000000 -0500
+@@ -6977,10 +6977,15 @@
+ if test -f /usr/lib/libncurses.so
+ then
+ curses=ncurses
+-
++ elif test -f /usr/lib64/libncurses.so
++ then
++ curses=ncurses
+ elif test -f /usr/lib/libcurses.so
+ then
+ curses=curses
++ elif test -f /usr/lib64/libcurses.so
++ then
++ curses=curses
+ else
+ { { echo "$as_me:6985: error: No (n)curses installation" >&5
+ echo "$as_me: error: No (n)curses installation" >&2;}
diff --git a/dev-db/xbsql/files/xbsql-0.11-xbase64.patch b/dev-db/xbsql/files/xbsql-0.11-xbase64.patch
new file mode 100644
index 000000000000..6d51cbaf06fc
--- /dev/null
+++ b/dev-db/xbsql/files/xbsql-0.11-xbase64.patch
@@ -0,0 +1,66 @@
+diff -up xbsql-0.11/xbsql/Makefile.am.BAD xbsql-0.11/xbsql/Makefile.am
+--- xbsql-0.11/xbsql/Makefile.am.BAD 2009-08-19 23:32:27.481185284 -0400
++++ xbsql-0.11/xbsql/Makefile.am 2009-08-19 23:32:47.157206308 -0400
+@@ -17,10 +17,10 @@ libxbsql_la_SOURCES = xb_value.cpp xb_el
+ xb_assignlist.cpp xb_create.cpp \
+ xbsql.tab.c xb_datetime.cpp
+
+-libxbsql_la_LDFLAGS = -lxbase $(DEBUG)
++libxbsql_la_LIBADD = -lxbase64
+
+ xql_SOURCES = xql.cpp
+-xql_LDADD = -lxbase -lreadline -l$(CURSES) ./libxbsql.la
++xql_LDADD = -lxbase64 -lreadline -l$(CURSES) ./libxbsql.la
+
+ #
+ #
+diff -up xbsql-0.11/xbsql/Makefile.in.BAD xbsql-0.11/xbsql/Makefile.in
+--- xbsql-0.11/xbsql/Makefile.in.BAD 2009-08-19 23:32:54.384058775 -0400
++++ xbsql-0.11/xbsql/Makefile.in 2009-08-19 23:33:03.928059382 -0400
+@@ -108,10 +108,10 @@ libxbsql_la_SOURCES = xb_value.cpp xb_el
+ xbsql.tab.c xb_datetime.cpp
+
+
+-libxbsql_la_LDFLAGS = -lxbase $(DEBUG)
++libxbsql_la_LIBADD = -lxbase64
+
+ xql_SOURCES = xql.cpp
+-xql_LDADD = -lxbase -lreadline -l$(CURSES) ./libxbsql.la
++xql_LDADD = -lxbase64 -lreadline -l$(CURSES) ./libxbsql.la
+
+
+ #install-data-hook:
+diff -up xbsql-0.11/xbsql/xbsql.cpp.BAD xbsql-0.11/xbsql/xbsql.cpp
+--- xbsql-0.11/xbsql/xbsql.cpp.BAD 2009-08-19 23:34:23.880063863 -0400
++++ xbsql-0.11/xbsql/xbsql.cpp 2009-08-19 23:34:47.393184432 -0400
+@@ -207,7 +207,7 @@ void XBaseSQL::setError
+ break ;
+
+ default :
+- e = xbStrError (rc) ;
++ e = GetErrorMessage (rc) ;
+ break ;
+ }
+
+@@ -230,7 +230,7 @@ void XBaseSQL::setError
+ char t[1024] ;
+ va_list aptr ;
+
+- strcpy (t, xbStrError (rc)) ;
++ strcpy (t, GetErrorMessage (rc)) ;
+ strcat (t, ": ") ;
+ int l = strlen(t) ;
+
+diff -up xbsql-0.11/xbsql/xbsql.h.BAD xbsql-0.11/xbsql/xbsql.h
+--- xbsql-0.11/xbsql/xbsql.h.BAD 2009-08-19 23:35:45.087088919 -0400
++++ xbsql-0.11/xbsql/xbsql.h 2009-08-19 23:34:06.949184421 -0400
+@@ -43,8 +43,7 @@ XBSQL_API int strncasecmp (const char *s
+
+ #endif
+
+-#include <xbase/xbase.h>
+-#include <xbase/xbexcept.h>
++#include <xbase64/xbase64.h>
+
+ class XBaseSQL ;
+ class XBSQLTable ;
diff --git a/dev-db/xbsql/metadata.xml b/dev-db/xbsql/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-db/xbsql/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-db/xbsql/xbsql-0.11-r2.ebuild b/dev-db/xbsql/xbsql-0.11-r2.ebuild
new file mode 100644
index 000000000000..53f79773ed13
--- /dev/null
+++ b/dev-db/xbsql/xbsql-0.11-r2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+AUTOTOOLS_AUTORECONF=yes
+
+inherit autotools-utils
+
+DESCRIPTION="An SQL Wrapper for the XBase library"
+HOMEPAGE="http://www.rekallrevealed.org/"
+SRC_URI="http://www.rekallrevealed.org/packages/${P}.tgz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 ppc x86"
+IUSE="doc static-libs"
+
+RDEPEND="
+ >=dev-db/xbase-3.1.2
+ sys-libs/readline"
+DEPEND="${RDEPEND}
+ sys-devel/automake
+ sys-devel/libtool"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-ncurses64.patch
+ "${FILESDIR}"/${P}-xbase64.patch
+ "${FILESDIR}"/${P}-autotools.patch
+ "${FILESDIR}"/${P}-bfr-overflow.patch
+)
+
+DOCS=( AUTHORS Announce ChangeLog INSTALL README TODO )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+src_install() {
+ autotools-utils_src_install
+ use doc && dohtml doc/*
+}
diff --git a/dev-db/xtrabackup-bin/Manifest b/dev-db/xtrabackup-bin/Manifest
new file mode 100644
index 000000000000..645ccaf80598
--- /dev/null
+++ b/dev-db/xtrabackup-bin/Manifest
@@ -0,0 +1,9 @@
+DIST percona-xtrabackup-2.4.4-Linux-i686.tar.gz 80913003 SHA256 0f822861fd38b45132f2529fea0d9662407a6f232cb842ecc29c3cddc8e7e448 SHA512 88ab0c46a6bdb4c524e66f5f58a8a32f5cb0b728129eadda4c5002625c4fcedd48f4c6328af3745bcdae5a6c2d17c77dbd72b860b35728f16379d3f98add412a WHIRLPOOL 59ecd56e98584b8f7378671f592a9a130c0c86a6c36735a06dec4fe6a069cd52d1df1627363c257ff4362fc4c176838eaff614bc674c5f38abc4adf4aa2c284c
+DIST percona-xtrabackup-2.4.4-Linux-x86_64.tar.gz 82348558 SHA256 1e59e4d061d9af9bbb821dc70dd8ee98a25afd70c5663f3c43d1011468d28b47 SHA512 265ffc8a6976daaa8de2a22e1db2a15734fcbfe4881cb3482130fccbc69bda7302b013adb2c52cf93a1881baaaec2b08e98f3e5252b295802a426a2597960039 WHIRLPOOL 5aef403ee24473b0300bd1f7c47c94ea9b34464f62273a4889cac814736764e1312455dc913a6556b97eebb70e3ec7fb365d72b24c8315f8029ed88f5f4c3036
+DIST percona-xtrabackup-2.4.6-Linux-i686.tar.gz 80985248 SHA256 1a8ab6d7b03fbdcf641fbcf041d0e278971ebcd3d0c59acca5e5cd4238630fa9 SHA512 89e41b4aadf4506d6bc5ce99d6fdee9a6ef3456e6a8ffc0db0f421792d64d8df109557eca84f841825807b5b27077b7c194efa08c1b33ea7b41e65d6935d0b73 WHIRLPOOL 8b4ddf73659e2c7d93581114f909c46d2e572be082ace80036f19c58fdb5608b16be19366d423811364cc1c454ee652d31732ec46d5a5d115999ea0aadd341a0
+DIST percona-xtrabackup-2.4.6-Linux-x86_64.tar.gz 82382422 SHA256 d1919ee82b887849d27d4d372669796a4226909f400e9d33f5c0015ecb996a67 SHA512 7299f7e47417e62fdad5fdfb0637d4ba7e94e0804207ad690cd8573fc83e5eea15d0c5504bc084f24cec074765f51fafdb780115bbd336dd7e36ad123fae218e WHIRLPOOL 0d19d0a389e24912d054e9e77ffe03f08cef5dcee5c8ea8ce6aac3242e4e9d0ad6fa239b8b6ae5e82b79203f2255af9da0b81ddd6d1313949693e09d8758bd48
+EBUILD xtrabackup-bin-2.4.4.ebuild 1464 SHA256 152a21dcaf656961ee3231b8403af355caaf3389f76ca411f465610629b25242 SHA512 75c9a39ac6041da81cb09937d4b3a0495861184e7b437521b705f0e8e7e227f81118c875a9f1a0f07a926867f7cf5fa88d5e3f16800823dd57729a20d414c4a3 WHIRLPOOL fe0a133dc42cdf5f906178b117d7429d87c0186adb3b2e7430af7afc16431f711ec5080d825dc8c243aea1e1b8bff5ec21443b2231e385ad7f30699062f2bcd4
+EBUILD xtrabackup-bin-2.4.6.ebuild 1466 SHA256 a196da844e571ee8e25484300f0ee788fd457bbdd7386953479b541df3d011ef SHA512 f4a8762dfbb69e3c64d04a8bae09d34499b47371febeb1f96fd3aad0f753d1a621da2fd58a5886d751c5b07a6da153bc1236a2413e274e532309df6cbc00cc26 WHIRLPOOL 606880e21b36d881a45f54b30c9845c8bfe49417bbdabed88de49c83f86cfbdde7cf9c8d554ba2ec2c0acd6f89e757beecd491123daf052e85a18a98dd927bd4
+MISC ChangeLog 4097 SHA256 0753d07193cb3138a7a37e7f118336e1ae24ef29ef8e1d39c6712506072b0160 SHA512 e927a3d0562258196d6aa7bd7f8f57efeec8f02b66a87a2e45843a8d56dbb245df8fa8971e6910d040e6538676bec833edcb18c6e4947db299671845fe1e3069 WHIRLPOOL 0186c143bf952266d8daa28e78119222b736cf976434a3fc323856ff7b842a0d20a6c518ffd821d0c22a0bf92d502f2b5bf4d332ca053096202ca4d1c681231a
+MISC ChangeLog-2015 2334 SHA256 50d431279503e70fdfb8ed8bed13db448b62804cc675b66419d5ed48952ab393 SHA512 2996428ac8fd284bb2ae38a17151978eccb16b1a834dd9b5a1b88a57d63cda90be191f6f1248252bd994e829ebeec5e41ba8260e39424247267397322e848d90 WHIRLPOOL ec66bbd4acfd583545d69dc345d8a7dc20d1190664e35cb0f5a605d72c65f3a718ed4a6ee8067469f45287c3e5a813cb3de7e4fc273c82720b5d8a66dae9660b
+MISC metadata.xml 249 SHA256 15c3b8c41a629764f3ac3005ca017fa7df49f48f540211a22549d7d2900ef03b SHA512 1723b9b2663814b898832e18aea1a02520775e545e256fb70a8829e2b0515e59b5abab985c995b9ae2f509d95ea4601ac0085ab0d1653cdda0ebe90f775f6e5b WHIRLPOOL 4fd539d6cb011d39a83d0c854c61363f15b2ae0fee1e9036056f384222307fc5910ab87429ace43bbe330b6a5156dbd41c32f80776ea56f3b35892a7ed84107d
diff --git a/dev-db/xtrabackup-bin/metadata.xml b/dev-db/xtrabackup-bin/metadata.xml
new file mode 100644
index 000000000000..5840601f180f
--- /dev/null
+++ b/dev-db/xtrabackup-bin/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-db/xtrabackup-bin/xtrabackup-bin-2.4.4.ebuild b/dev-db/xtrabackup-bin/xtrabackup-bin-2.4.4.ebuild
new file mode 100644
index 000000000000..1c2d0f595dc4
--- /dev/null
+++ b/dev-db/xtrabackup-bin/xtrabackup-bin-2.4.4.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN="percona-${PN/-bin}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="MySQL hot backup software. non-blocking backups for InnoDB/XtraDB databases"
+HOMEPAGE="http://www.percona.com/software/percona-xtrabackup"
+SRC_URI="
+ amd64? (
+ http://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-x86_64.tar.gz
+ )
+ x86? (
+ http://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-i686.tar.gz
+ )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# NOTE: dev-perl/DBD-mysql still necessary, now for bin/xtrabackup?
+DEPEND=""
+RDEPEND="dev-libs/libaio
+ dev-libs/libgcrypt:11/11
+ dev-libs/libgpg-error
+ dev-perl/DBD-mysql
+ sys-libs/zlib"
+
+src_unpack() {
+ default
+
+ if use amd64; then
+ S="${WORKDIR}/${MY_P}-Linux-x86_64"
+ elif use x86; then
+ S="${WORKDIR}/${MY_P}-Linux-i686"
+ fi
+}
+
+src_install() {
+ # Two new tools with an old libcurl.so.3 dep...
+ # TODO: Wait for a new release using libcurl.so.4
+ # net-misc/curl dev-libs/libev
+ # dobin bin/xbcloud{,_osenv}
+
+ for tool in xbcrypt xbstream xtrabackup; do
+ dobin bin/${tool}
+ done
+
+ for man in innobackupex xbcrypt xbstream xtrabackup; do
+ doman man/man1/${man}.1
+ done
+
+ dosym xtrabackup /usr/bin/innobackupex
+}
+
+pkg_postinst() {
+ ewarn "innobackupex got deprecated in 2.3.x series and is just a symlink to xtrabackup"
+}
diff --git a/dev-db/xtrabackup-bin/xtrabackup-bin-2.4.6.ebuild b/dev-db/xtrabackup-bin/xtrabackup-bin-2.4.6.ebuild
new file mode 100644
index 000000000000..720c6176b78c
--- /dev/null
+++ b/dev-db/xtrabackup-bin/xtrabackup-bin-2.4.6.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+MY_PN="percona-${PN/-bin}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="MySQL hot backup software. non-blocking backups for InnoDB/XtraDB databases"
+HOMEPAGE="http://www.percona.com/software/percona-xtrabackup"
+SRC_URI="
+ amd64? (
+ http://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-x86_64.tar.gz
+ )
+ x86? (
+ http://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-${PV}/binary/tarball/${MY_P}-Linux-i686.tar.gz
+ )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# NOTE: dev-perl/DBD-mysql still necessary, now for bin/xtrabackup?
+DEPEND=""
+RDEPEND="dev-libs/libaio
+ dev-libs/libgcrypt:11/11
+ dev-libs/libgpg-error
+ dev-perl/DBD-mysql
+ sys-libs/zlib"
+
+src_unpack() {
+ default
+
+ if use amd64; then
+ S="${WORKDIR}/${MY_P}-Linux-x86_64"
+ elif use x86; then
+ S="${WORKDIR}/${MY_P}-Linux-i686"
+ fi
+}
+
+src_install() {
+ # Two new tools with an old libcurl.so.3 dep...
+ # TODO: Wait for a new release using libcurl.so.4
+ # net-misc/curl dev-libs/libev
+ # dobin bin/xbcloud{,_osenv}
+
+ for tool in xbcrypt xbstream xtrabackup; do
+ dobin bin/${tool}
+ done
+
+ for man in innobackupex xbcrypt xbstream xtrabackup; do
+ doman man/man1/${man}.1
+ done
+
+ dosym xtrabackup /usr/bin/innobackupex
+}
+
+pkg_postinst() {
+ ewarn "innobackupex got deprecated in 2.3.x series and is just a symlink to xtrabackup"
+}