summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-08-19 10:25:11 +0200
committerMichał Górny <mgorny@gentoo.org>2018-08-19 10:38:00 +0200
commit36fee0a0b502c1a69b52112f7c61734cc3718505 (patch)
tree0b6d4b4227d8dc1e8a61ef80bf01d76cedfce26e /sys-auth/google-authenticator-wrappers/google-authenticator-wrappers-3.ebuild
parentmedia-gfx/kphotoalbum: Fix build with GCC-8 (diff)
downloadgentoo-36fee0a0b502c1a69b52112f7c61734cc3718505.tar.gz
gentoo-36fee0a0b502c1a69b52112f7c61734cc3718505.tar.bz2
gentoo-36fee0a0b502c1a69b52112f7c61734cc3718505.zip
sys-auth/google-authenticator-wrappers: Bump to v3
Diffstat (limited to 'sys-auth/google-authenticator-wrappers/google-authenticator-wrappers-3.ebuild')
-rw-r--r--sys-auth/google-authenticator-wrappers/google-authenticator-wrappers-3.ebuild52
1 files changed, 52 insertions, 0 deletions
diff --git a/sys-auth/google-authenticator-wrappers/google-authenticator-wrappers-3.ebuild b/sys-auth/google-authenticator-wrappers/google-authenticator-wrappers-3.ebuild
new file mode 100644
index 000000000000..f1d2f1cb4b31
--- /dev/null
+++ b/sys-auth/google-authenticator-wrappers/google-authenticator-wrappers-3.ebuild
@@ -0,0 +1,52 @@
+# 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
+}