Add dev-db/mariadb-sha2-functions
authorKristian Fiskerstrand <kf@sumptuouscapital.com>
Sun, 8 Nov 2015 18:26:14 +0000 (19:26 +0100)
committerKristian Fiskerstrand <kf@sumptuouscapital.com>
Sun, 8 Nov 2015 18:26:14 +0000 (19:26 +0100)
dev-db/mariadb-sha2-functions/Manifest [new file with mode: 0644]
dev-db/mariadb-sha2-functions/mariadb-sha2-functions-0.1.ebuild [new file with mode: 0644]

diff --git a/dev-db/mariadb-sha2-functions/Manifest b/dev-db/mariadb-sha2-functions/Manifest
new file mode 100644 (file)
index 0000000..8fe0f59
--- /dev/null
@@ -0,0 +1,2 @@
+DIST mysql_sha.cpp 3802 SHA256 e70d3cf4186fc0dc311d59594f82903bf61e50952969da111b4fb2459d192363 SHA512 12fa626f56fe96643b2e900fc13aaecec0e3df391893ccf5c7bcf7518047d44b0528beff2cdfc712b2d8f92f360d84fa3b0d1271086143a2efcd54a184a684f3 WHIRLPOOL 396b2814d970e21e5592e182c7cc716f4b4868ad97cbce00996c4c9fda7e3c53a700593f61bf3cc830155d617c9fb189609ada64193957d6f5f23e7589ebae5e
+EBUILD mariadb-sha2-functions-0.1.ebuild 1366 SHA256 6286196ae021d5207048bf278931e812893adbd638a0000e70e99dbd97eb852a SHA512 528ce5d08b73b5ef22d1ad8b2ca3cc6f0ffafaf21f6e6e0e82582b1f5a9cd18d4b6450198cc0eeca989f2d50a896b255584899629a4ba70bd11064d58932c0d1 WHIRLPOOL bf14b1b93d9804516691ee0ee3e2581909c99d61645185cfeb0738c1a2bdccfa65b84c4a753b790e0510ca23da77ebde01243ec0105db2c0a2bcaf27de6e5329
diff --git a/dev-db/mariadb-sha2-functions/mariadb-sha2-functions-0.1.ebuild b/dev-db/mariadb-sha2-functions/mariadb-sha2-functions-0.1.ebuild
new file mode 100644 (file)
index 0000000..8ed67f2
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="SHA2 family (SHA256, SHA384, SHA512) functions for MariaDB/MySQL"
+HOMEPAGE="http://www.kfwebs.net/articles/article/12/SHA512-SHA384-and-SHA256-support-in-MySQL"
+
+LICENSE="WTFPL-2"
+SLOT="0"
+IUSE=""
+SRC_URI="http://download.sumptuouscapital.com/gentoo/releases/${CATEGORY}/${PN}/mysql_sha-${PV}.cpp -> mysql_sha.cpp"
+
+KEYWORDS="~amd64 ~x86"
+
+CDEPEND="virtual/mysql
+       dev-libs/crypto++"
+
+DEPEND="${CDEPEND}"
+RDEPEND="${CDEPEND}"
+
+src_unpack()
+{
+       #This package ships as a single .cpp file, manual unpack to ensure the file is copied to the work dir
+       mkdir -p "${S}" || die 
+       cp "${DISTDIR}/mysql_sha.cpp" "${S}" || die
+}
+
+src_compile()
+{
+       #This package ships as a single .c file, manual compile process needed
+       $(tc-getCXX) -shared -I/usr/include/mysql -L/usr/lib -fPIC -lcrypto++ -o mysql_sha.so mysql_sha.cpp || die
+}
+
+src_install()
+{
+       insinto /usr/lib/mysql/plugin/
+       doins mysql_sha.so
+       elog "###########################"
+       elog "Manual configuration steps"
+       elog "###########################"
+       elog "CREATE FUNCTION sha256 RETURNS STRING SONAME 'mysql_sha.so';"
+       elog "CREATE FUNCTION sha384 RETURNS STRING SONAME 'mysql_sha.so';"
+       elog "CREATE FUNCTION sha512 RETURNS STRING SONAME 'mysql_sha.so';"
+}