Skip to content

Commit

Permalink
5: Adds installation scripts and updates readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pbarnum committed Mar 31, 2017
1 parent cbe5e48 commit b78f14f
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build/
dist/
*.pyc
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# AcesUp

A solitaire game played in Terminal

To play, simply execute the `./acesup` script.

# Installation
Linux only:
You can compile and install the game by executing the `./install.sh` script using root privileges.

You can also compile the game into a binary using the command `pyinstaller acesup.spec --onefile`. This will place
the compiled binary program in the `./dist` directory

# Bugs
Please report any issues to https://github.com/pbarnum/acesup
1 change: 1 addition & 0 deletions src/AcesUp/main.py → acesup
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python

import sys
sys.path.append('./src/AcesUp')
from AcesUp import AcesUp

game = AcesUp()
Expand Down
28 changes: 28 additions & 0 deletions acesup.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- mode: python -*-

block_cipher = None


a = Analysis(['acesup'],
pathex=['/home/p-trick/Projects/acesup'],
binaries=[],
datas=[],
hiddenimports=["enum", "json"],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='acesup',
debug=False,
strip=False,
upx=True,
console=True )
25 changes: 25 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# we need root to run
if [[ `id -u` -ne 0 ]]; then
echo "Please run as root"
exit
fi

# vars
NAME=acesup
SPEC=$NAME.spec
DIST_BIN=./dist/$NAME
PATH_BIN=/usr/bin/$NAME

# build the game
echo -e "Building $NAME...\n"
pyinstaller $SPEC --onefile

# move the binary to the path
echo -e "\nAdding $NAME to path..."
mv $DIST_BIN $PATH_BIN

# change group/owner for game
echo -e "\nChanging ownership for $NAME..."
chown root:$USER $PATH_BIN
Empty file removed src/AcesUp/__init__.py
Empty file.

0 comments on commit b78f14f

Please sign in to comment.