Skip to content

Instantly share code, notes, and snippets.

@Majkl578
Last active December 11, 2015 04:19
Show Gist options
  • Select an option

  • Save Majkl578/4544397 to your computer and use it in GitHub Desktop.

Select an option

Save Majkl578/4544397 to your computer and use it in GitHub Desktop.
Steam .deb package repacker to achieve compatibility on Debian.
#!/bin/bash
if [[ ! $# -eq 1 ]] ; then
echo "Usage: ./debianize.sh steam_version.deb"
exit
fi
VERSION_APPEND="+repack.1"
TMP=/tmp/steam-repack
NAME=$1
TARGET=`echo $NAME | sed -E "s/\.deb/$VERSION_APPEND.deb/"`
if [[ ! -f $NAME ]] ; then
echo "Error: File not found."
exit
fi
echo "Unpacking..."
dpkg-deb -R $NAME $TMP
echo "Patching..."
# fix dependencies
sed -i -E "s/libpulse0 \(>= 1:(.*)\),/libpulse0 (>= \1),/;s/Version: (.+)/Version: \1$VERSION_APPEND/" $TMP/DEBIAN/control
# make crappy steamdeps silent
echo -e "#!/bin/bash\n\nexit 0" > $TMP/usr/bin/steamdeps
echo "Building..."
dpkg-deb -b $TMP/ $TARGET > /dev/null
rm -rf $TMP
echo "Finished!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment