summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreroen <eroen-overlay@occam.eroen.eu>2016-09-18 18:02:51 +0200
committereroen <eroen-overlay@occam.eroen.eu>2016-09-18 18:02:51 +0200
commite27a3dcc848c1b15096ff8423d5b1088757f7954 (patch)
treed13992fc253f748d7ebb1189e3e4076f3c7eee4e
parentopenmw-0.40.0 is released (diff)
downloaderoen-e27a3dcc848c1b15096ff8423d5b1088757f7954.tar.gz
eroen-e27a3dcc848c1b15096ff8423d5b1088757f7954.tar.bz2
eroen-e27a3dcc848c1b15096ff8423d5b1088757f7954.zip
steam.eclass - move steamcli to separate package
-rw-r--r--eclass/steam.eclass24
-rw-r--r--net-misc/steamcmd-bin/Manifest1
-rw-r--r--net-misc/steamcmd-bin/metadata.xml10
-rw-r--r--net-misc/steamcmd-bin/steamcmd-bin-0.ebuild49
4 files changed, 74 insertions, 10 deletions
diff --git a/eclass/steam.eclass b/eclass/steam.eclass
index eb5ceae..e426774 100644
--- a/eclass/steam.eclass
+++ b/eclass/steam.eclass
@@ -32,11 +32,8 @@ inherit linux-info python-any-r1
EXPORT_FUNCTIONS pkg_setup src_unpack
-SRC_URI="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
-
DEPEND="${PYTHON_DEPS}
- sys-devel/gcc[cxx]
- amd64? ( sys-devel/gcc[cxx,multilib] )"
+ net-misc/steamcmd-bin"
# @ECLASS-VARIABLE: STEAM_app_id
# @DEFAULT_UNSET
@@ -85,6 +82,12 @@ DEPEND="${PYTHON_DEPS}
# Directory where the eclass expects to find its internal files.
STEAM_FILESDIR="${BASH_SOURCE[0]%/*}/files"
+# @ECLASS-VARIABLE: STEAM_STEAMCMD
+# @INTERNAL
+# @DESCRIPTION:
+# Absolute path to steamcmd.sh
+STEAM_STEAMCMD=$T/steamcmd/steamcmd.sh
+
# @FUNCTION: steam_pkg_setup
# @DESCRIPTION:
# This function is exported. It makes sanity checks and fails early for some
@@ -95,7 +98,7 @@ steam_pkg_setup() {
if linux_config_exists; then
if [[ -n $(linux_chkconfig_string PAX_ELFRELOCS) ]] && \
! linux_chkconfig_present PAX_ELFRELOCS; then
- die "Need support for x86 TEXTRELs"
+ die "steamcmd needs support for x86 TEXTRELs to run"
fi
else
ewarn "Could not find kernel config. The install will fail later if"
@@ -141,7 +144,7 @@ steam_get_mail() {
esteamcmd() {
# Supply password on stdin to avoid leaking it in /proc/$pid/cmdline
printf "%s\n" "$(steam_get_cred STEAM_PASS)" \
- | ./steamcmd.sh \
+ | "$STEAM_STEAMCMD" \
"+@ShutdownOnFailedCommand 1" \
"+@NoPromptForPassword 0" \
"+login $(steam_get_cred STEAM_USER)" \
@@ -157,19 +160,19 @@ esteamcmd() {
steam_firstlogin() {
# make steam up to date
einfo "Update steam"
- ./steamcmd.sh "+quit" || die "unable to run steamcmd.sh"
+ "$STEAM_STEAMCMD" "+quit" || die "unable to run steamcmd.sh"
# generate the 'special access code'
einfo "Attempt to log in, generate special access code email"
printf "%s\n" "$(steam_get_cred STEAM_PASS)" \
- | ./steamcmd.sh "+login $(steam_get_cred STEAM_USER)" "+quit"
+ | "$STEAM_STEAMCMD" "+login $(steam_get_cred STEAM_USER)" "+quit"
if [[ $? == 5 ]]; then
local i imax=5
for (( i=1; i<=imax; i++ )); do
# supply 'special access code'
einfo "Supply special access code, attempt $i of $imax"
printf "%s\n" "$(steam_get_cred STEAM_PASS)" \
- | ./steamcmd.sh "+set_steam_guard_code $(steam_get_mail)" \
+ | "$STEAM_STEAMCMD" "+set_steam_guard_code $(steam_get_mail)" \
"+login $(steam_get_cred STEAM_USER)" \
"+quit" && break
@@ -195,7 +198,8 @@ steam_src_unpack() {
die "\$STEAM_app_id is not set, $FUNCNAME cannot be used"
fi
- default
+ cp -rf "$EROOT/opt/steamcmd" "${STEAM_STEAMCMD%/*}" || die
+
steam_firstlogin
local cmd_platform=
diff --git a/net-misc/steamcmd-bin/Manifest b/net-misc/steamcmd-bin/Manifest
new file mode 100644
index 0000000..1857bb6
--- /dev/null
+++ b/net-misc/steamcmd-bin/Manifest
@@ -0,0 +1 @@
+DIST steamcmd_linux.tar.gz 3170982 SHA256 c7e382f81d5a44036ebb21fd6aa77f68fb4ac0b6d6f4c209ef389b05eba0f9b8 SHA512 747c1cda5cb11e1533b242785fb2d83d8f4b11506e46884c0956769859854ce0c5f450a195f60ffc2da9381a220857f3183c87ee0cfb85d56dc3dfea5db9a155 WHIRLPOOL aaf2ac96bb2ca506323775d897ea6e5dc57a361cbef310941623bead1b7615cdd3d6c7920b9ed4a2eab84a382e5fe4d6b36ceb2bb5701d76ede468a97bb0c68b
diff --git a/net-misc/steamcmd-bin/metadata.xml b/net-misc/steamcmd-bin/metadata.xml
new file mode 100644
index 0000000..a94dac1
--- /dev/null
+++ b/net-misc/steamcmd-bin/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>eroen-overlay@occam.eroen.eu</email>
+ <name>eroen</name>
+ </maintainer>
+ <longdescription lang="en">
+ </longdescription>
+</pkgmetadata>
diff --git a/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild b/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild
new file mode 100644
index 0000000..124e3b9
--- /dev/null
+++ b/net-misc/steamcmd-bin/steamcmd-bin-0.ebuild
@@ -0,0 +1,49 @@
+# 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.
+# $Id$
+
+EAPI=6
+
+inherit linux-info
+
+DESCRIPTION="Used by steam.eclass"
+HOMEPAGE="https://developer.valvesoftware.com/wiki/SteamCMD"
+SRC_URI="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
+LICENSE="all-rights-reserved"
+RESTRICT="bindist mirror"
+S=$WORKDIR
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ sys-devel/gcc[cxx]
+ amd64? ( sys-devel/gcc[cxx,multilib] )"
+
+pkg_setup() {
+ # CONFIG_PAX_ELFRELOCS must not be disabled (if present).
+ # Textrels are all over the place :(
+ if linux_config_exists; then
+ if [[ -n $(linux_chkconfig_string PAX_ELFRELOCS) ]] && \
+ ! linux_chkconfig_present PAX_ELFRELOCS &&
+ [[ -z $I_KNOW_WHAT_I_AM_DOING ]]; then
+ die "$PN needs support for x86 TEXTRELs to run"
+ fi
+ else
+ ewarn "Could not find kernel config. The install will fail later if"
+ ewarn "x86 TEXTRELs are not supported on the system."
+ fi
+}
+
+src_unpack() {
+ default
+}
+
+src_install() {
+ exeinto /opt/steamcmd/linux32
+ doexe linux32/steamcmd
+ exeinto /opt/steamcmd
+ doexe steamcmd.sh steam.sh
+}