File steamcmd.spec of Package steamcmd

#
# spec file for package steamcmd
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           steamcmd
Version:        0.20180105
Release:        0
Summary:        Command-line version of the Steam client
License:        SUSE-Freeware
Group:          Amusements/Games/Other
Url:            https://developer.valvesoftware.com/wiki/SteamCMD
Source0:        https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
Source1:        https://salsa.debian.org/games-team/steamcmd/raw/master/debian/steamcmd.6
Source2:        https://salsa.debian.org/games-team/steamcmd/raw/master/debian/steamcmdcommands.txt
Source3:        https://salsa.debian.org/games-team/steamcmd/raw/master/debian/steam_install_agreement.txt
ExclusiveArch:  x86_64 %{ix86}

%description
The Steam Console Client or SteamCMD is a command-line version of the Steam client.
Its primary use is to install and update various dedicated servers available on
Steam using a command-line interface. It works with games that use the SteamPipe
content system.

%prep
%setup -q -c %{name}-%{version}

%build
sed -i 's,^#!%{_bindir}/env bash$,#!%{_bindir}/bash,g' steamcmd.sh

%install
install -Dm0755 steamcmd.sh %{buildroot}%{_libexecdir}/steamcmd/steamcmd.sh
install -Dm0755 linux32/steamcmd %{buildroot}%{_libexecdir}/steamcmd/linux32/steamcmd

mkdir -p %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/steamcmd << EOF
#!/bin/sh
exec %{_libexecdir}/steamcmd/steamcmd.sh "\$@"
EOF
chmod +x %{buildroot}%{_bindir}/steamcmd

install -Dm0644 %{SOURCE1} %{buildroot}%{_mandir}/man6/steamcmd.6
install -Dm0644 %{SOURCE2} %{buildroot}%{_docdir}/steamcmd/steamcmdcommands.txt
install -Dm0644 %{SOURCE3} %{buildroot}%{_docdir}/steamcmd/steam_install_agreement.txt

%files
%defattr(-,root,root)
%{_bindir}/steamcmd
%{_libexecdir}/steamcmd
%{_mandir}/man6/steamcmd.6.*
%doc %{_docdir}/steamcmd/

%changelog
openSUSE Build Service is sponsored by