import depotdownloader, ok solene@

DESCR:
Steam depot downloader utilizing the SteamKit2 library. Supports
.NET Core 2.0. Client to download apps and Workshop items from
Steam.
This commit is contained in:
thfr 2019-06-24 16:49:48 +00:00
parent 0ff18b80e8
commit 746fa66ab2
6 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,36 @@
# $OpenBSD: Makefile,v 1.1.1.1 2019/06/24 16:49:48 thfr Exp $
ONLY_FOR_ARCHS = ${MONO_ARCHS}
COMMENT = Steam depot downloader utilizing the SteamKit2 library
V = 2.3.0pl1
DISTNAME = depotdownloader-${V:S/pl/-hotfix/g}
PKGNAME = depotdownloader-${V}
CATEGORIES = games
HOMEPAGE = https://github.com/SteamRE/DepotDownloader
MAINTAINER = Thomas Frohwein <thfr@openbsd.org>
# GPLv2, bundles SteamKit2 (LGPL-2.1)
PERMIT_PACKAGE = Yes
MASTER_SITES = https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_${V:S/pl1//g}/
EXTRACT_SUFX = .zip
RUN_DEPENDS = lang/mono
NO_BUILD = Yes
do-install:
mkdir -p ${PREFIX}/share/depotdownloader
${INSTALL_DATA} ${WRKDIR}/DepotDownloader.dll{,.config} \
${WRKDIR}/DepotDownloader.pdb \
${WRKDIR}/DepotDownloader.{deps,runtimeconfig}.json \
${WRKDIR}/README.md \
${WRKDIR}/SteamKit2.dll \
${WRKDIR}/protobuf-net.dll \
${PREFIX}/share/depotdownloader/
${SUBST_CMD} -c -m 755 ${FILESDIR}/depotdownloader.sh \
${PREFIX}/bin/depotdownloader
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (depotdownloader-2.3.0-hotfix1.zip) = +VUkjA/SRl+lti4X6RDLxgj+C7xQCFKMPDTieOYVAzU=
SIZE (depotdownloader-2.3.0-hotfix1.zip) = 1563537

View File

@ -0,0 +1,45 @@
#!/bin/sh
app=
appentry=
appid=
appname=
dd_args=$@
realappname=
if $(echo "$*" | grep -qm 1 "[[:blank:]]\-dir[[:blank:]]"); then
dirpath=""
else
mkdir -p ~/games/steamdepots
cd ~/games/steamdepots
dirpath="$HOME/games/steamdepots"
fi
while [ $# -gt 0 ]; do
case "$1" in
-appname) appname="$2"; shift;;
-app) appname="$2"; shift;;
esac
shift
done
if [ -n "$appname" ]; then
appentry="$(ftp -Vo - https://api.steampowered.com/ISteamApps/GetAppList/v0002 \
| grep -Eio "\{[^\{]*\"[[:blank:]]*$appname[[:blank:]]*\"")"
appid="$(echo "$appentry" | grep -Eo '[[:digit:]]+')"
if [ -z "$appid" ]; then
echo "Could not find AppId for \"$appname\""
exit 1
fi
realappname="$(echo "$appentry" | grep -io "$appname")"
dirpath="$dirpath/$realappname"
appid="-app $appid"
elif [ -n "$dirpath" ] ; then
dirpath="$dirpath/app"
fi
dirpath=$(echo $dirpath | sed -E 's,[[:blank:]],_,g')
dirpath="-dir $dirpath"
dd_args="$(echo "$dd_args" | sed -E "s,\-appname[[:blank:]]+$appname,,g")"
MONO_PATH=/usr/local/share/depotdownloader mono \
/usr/local/share/depotdownloader/DepotDownloader.dll $appid $dirpath $dd_args

View File

@ -0,0 +1,3 @@
Steam depot downloader utilizing the SteamKit2 library. Supports
.NET Core 2.0. Client to download apps and Workshop items from
Steam.

View File

@ -0,0 +1,12 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/06/24 16:49:48 thfr Exp $
bin/depotdownloader
share/depotdownloader/
share/depotdownloader/DepotDownloader.deps.json
share/depotdownloader/DepotDownloader.dll
share/depotdownloader/DepotDownloader.dll.config
share/depotdownloader/DepotDownloader.pdb
share/depotdownloader/DepotDownloader.runtimeconfig.json
share/depotdownloader/README.md
share/depotdownloader/SteamKit2.dll
share/depotdownloader/protobuf-net.dll
share/doc/pkg-readmes/${PKGSTEM}

View File

@ -0,0 +1,24 @@
$OpenBSD: README,v 1.1.1.1 2019/06/24 16:49:48 thfr Exp $
+-------------------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-------------------------------------------------------------------------------
The wrapper script of ${PKGSTEM} adds the following functionality:
1. Adds the flag '-appname <name>' which is the name of the Steam app to
download. To be used instead of '-app <AppID>'.
2. If '-dir <installdir>' is not provided, it will install the depot in
~/games/steamdepots/<AppName> or ~/games/steamdepots/<AppId> instead of the
current working directory.
Note that in some cases '-os windows' needs to be added if the depot advertises
itself as only for the Windows platform.
Further CLI documentation can be found at:
https://github.com/SteamRE/DepotDownloader
Example:
$ depotdownloader -appname "salt and sanctuary" -username <username>