diff options
author | eroen <eroen-overlay@occam.eroen.eu> | 2016-10-12 21:49:53 +0200 |
---|---|---|
committer | eroen <eroen-overlay@occam.eroen.eu> | 2016-10-12 21:49:53 +0200 |
commit | 8870131b1fa79c86c8143efbff1bd84a6cf8e515 (patch) | |
tree | 2c048cf9e55f5d741ecdde88fb005d6fd55fe212 /net-misc | |
parent | termite,vte - bump, fixes build with gcc 6 (diff) | |
download | eroen-8870131b1fa79c86c8143efbff1bd84a6cf8e515.tar.gz eroen-8870131b1fa79c86c8143efbff1bd84a6cf8e515.tar.bz2 eroen-8870131b1fa79c86c8143efbff1bd84a6cf8e515.zip |
steam.eclass - put scripts in a separate package
Move installation paths for helper packages to the eclass.
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/steam-eclass-utils/files/steam-mail.py | 47 | ||||
-rw-r--r-- | net-misc/steam-eclass-utils/metadata.xml | 13 | ||||
-rw-r--r-- | net-misc/steam-eclass-utils/steam-eclass-utils-0.ebuild | 34 | ||||
-rw-r--r-- | net-misc/steamcmd-bin/steamcmd-bin-0.ebuild | 11 |
4 files changed, 98 insertions, 7 deletions
diff --git a/net-misc/steam-eclass-utils/files/steam-mail.py b/net-misc/steam-eclass-utils/files/steam-mail.py new file mode 100644 index 0000000..51bebab --- /dev/null +++ b/net-misc/steam-eclass-utils/files/steam-mail.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# By eroen <eroen-overlay@occam.eroen.eu>, 2016 +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. + +from __future__ import print_function + +from imaplib import IMAP4_SSL +import re +import sys + + +SERVER = sys.stdin.readline().strip() +USER = sys.stdin.readline().strip() +PASS = sys.stdin.readline().strip() + +if len(SERVER) * len(USER) * len(PASS) <= 0: + print('server, username, and password separated by newlines must be ' + 'supplied on stdin', file=sys.stderr) + sys.exit(1) + +print('conncting to "{}"'.format(SERVER), file=sys.stderr) +M = IMAP4_SSL(SERVER) +# M.enable('UTF8=ACCEPT') +# print(M.capabilities) +print('authenticating', file=sys.stderr) +M.authenticate('PLAIN', lambda response: b'\0' + USER.encode() + b'\0' + + PASS.encode()) +M.select('INBOX') +typ, data = M.search(None, '(FROM "Steam Support")') +index = data[0].split()[-1] +print('found message "{}"'.format(index.decode()), file=sys.stderr) +typ, data = M.fetch(index, '(RFC822)') +message = data[0][1].splitlines() +# print(message) + +r = re.compile(b'Date: ') +date = [l.decode('utf8') for l in message if r.match(l)] +print('message date: "{}"'.format(date[0][6:]), file=sys.stderr) + +r = re.compile(b'[A-Z1-9]{5}$') +keys = [l.decode('utf8') for l in message if r.match(l)] +print(keys[0]) + +M.logout() diff --git a/net-misc/steam-eclass-utils/metadata.xml b/net-misc/steam-eclass-utils/metadata.xml new file mode 100644 index 0000000..e672fb6 --- /dev/null +++ b/net-misc/steam-eclass-utils/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="person"> + <email>eroen-overlay@occam.eroen.eu</email> + <name>eroen</name> + </maintainer> + <longdescription lang="en"> + </longdescription> + <use> + <flag name="steam-guard">Enable experimental authentication with "Steam Guard" enabled accounts</flag> + </use> +</pkgmetadata> diff --git a/net-misc/steam-eclass-utils/steam-eclass-utils-0.ebuild b/net-misc/steam-eclass-utils/steam-eclass-utils-0.ebuild new file mode 100644 index 0000000..6cd6e6e --- /dev/null +++ b/net-misc/steam-eclass-utils/steam-eclass-utils-0.ebuild @@ -0,0 +1,34 @@ +# By eroen <eroen-overlay@occam.eroen.eu>, 2016 +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. + +EAPI=6 +PYTHON_COMPAT=(python2_7 python3_3 python3_4 python3_5) +PYTHON_REQ_USE="ssl" + +# steam.eclass used for $ESTEAM_SCRIPTDIR +inherit steam python-r1 + +DESCRIPTION="Utilities used by steam.eclass" +HOMEPAGE="http://eroen.eu" +SRC_URI="" +LICENSE="ISC" +S=$WORKDIR + +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="steam-guard" + +DEPEND="" +RDEPEND="${DEPEND} + steam-guard? ( $PYTHON_DEPS )" +REQUIRED_USE="steam-guard? ( ${PYTHON_REQUIRED_USE} )" + +src_install() { + if use steam-guard; then + exeinto "$ESTEAM_SCRIPTDIR" + doexe "$FILESDIR"/steam-mail.py + python_replicate_script "$ED/$ESTEAM_SCRIPTDIR"/steam-mail.py + fi +} diff --git a/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild b/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild index 1a7ef66..e43aadf 100644 --- a/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild +++ b/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild @@ -6,7 +6,8 @@ EAPI=6 -inherit linux-info +# steam.eclass inherited for $ESTEAM_STEAMCMD_SYSTEM +inherit linux-info steam DESCRIPTION="Used by steam.eclass" HOMEPAGE="https://developer.valvesoftware.com/wiki/SteamCMD" @@ -37,13 +38,9 @@ pkg_setup() { fi } -src_unpack() { - default -} - src_install() { - exeinto /opt/steamcmd/linux32 + exeinto "$ESTEAM_STEAMCMD_SYSTEM/linux32" doexe linux32/steamcmd - exeinto /opt/steamcmd + exeinto "$ESTEAM_STEAMCMD_SYSTEM" doexe steamcmd.sh } |