DIST google-authenticator-wrappers-1.tar.gz 1379 BLAKE2B b8566281ade004a6b8996b18138754bab0f8ad2c4c23f4481b8a4f511a779a661fa7f1d68d22f43d0a077b9cef6dc5979d6ec522736d66e969db25c38a89062c SHA512 28d85206486c7aef9c1aee6e97e99950dd152c2114ae72c96c0af53debb1108e3d021766349d175cc6e402948f0ecd51a289575ebaa86680010ac50316e0146b
DIST google-authenticator-wrappers-2.tar.gz 1615 BLAKE2B 313283bf2672e36883aa21d1520595afab90120ea106ef79e1dd7f2561d4a13f9ccb767ff3496f54eb2943b4a8fb55edce21e9b7f4ba9acb2845a97afbbbabde SHA512 5edcd57a1494fb6750a45396c9c5746dc952a9c7935c15bbae5e9ffce9175c9e1db92ee136ffe9cf513828425ab3dca0d976d1cc82737375b139f646717519cb
+DIST google-authenticator-wrappers-3.tar.gz 6128 BLAKE2B a2c2b35a0c780213a6ba2940c05a205a8ccb043b6ff0808eb47a45c7d52da215293ca785c968f26ec99b7a97e770b127b391fb104b85db6c09efd6af31531786 SHA512 471beb9fdc0225d59efef5c24cbfe1beec5fc4916521c4205c8aec5c4b3dfb473e53fbc5ada337cf0118a715aee9f5e045411b6d43c301d94fc08cccdbc889da
--- /dev/null
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils eapi7-ver user
+
+DESCRIPTION="Set of scripts to manage google-auth setup on Gentoo Infra"
+HOMEPAGE="https://github.com/mgorny/google-authenticator-wrappers"
+SRC_URI="https://github.com/mgorny/google-authenticator-wrappers/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="sys-auth/google-authenticator"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ver_test "${v}" -lt 3; then
+ ewarn "google-authenticator-wrappers v3 switches the secret store mechanism"
+ ewarn "from user-owned files to /var/lib/gauth. To migrate secrets, move"
+ ewarn "and chown, e.g.:"
+ ewarn
+ ewarn " mv /home/myuser/.google_authenticator /var/lib/gauth/myuser"
+ ewarn " chown gauth /var/lib/gauth/myuser"
+ ewarn
+ ewarn "If you do not migrate or reset secrets, second step authentication"
+ ewarn "will be disabled after the upgrade."
+ break
+ fi
+ done
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGAUTH_USERNAME=gauth
+ )
+
+ cmake-utils_src_configure
+}
+
+pkg_preinst() {
+ enewgroup gauth
+ enewuser gauth -1 -1 -1 gauth
+ fowners gauth:gauth /var/lib/gauth /usr/bin/gauthctl /usr/bin/gauth-test
+ fperms ug+s /usr/bin/gauthctl /usr/bin/gauth-test
+}