|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +VERSION='1.0' |
| 4 | +PACKAGE_REVISION='1' |
| 5 | +# Make a temperary directory for the debian package |
| 6 | +mkdir tic-tac-toe-online_${VERSION}-${PACKAGE_REVISION} |
| 7 | +chmod 0755 tic-tac-toe-online_${VERSION}-${PACKAGE_REVISION} |
| 8 | +cd tic-tac-toe-online_${VERSION}-${PACKAGE_REVISION} |
| 9 | + |
| 10 | +# Create the DEBIAN/control file |
| 11 | +mkdir DEBIAN |
| 12 | +cat >> DEBIAN/control << EOM |
| 13 | +Package: tic-tac-toe-online |
| 14 | +Version: ${VERSION}-${PACKAGE_REVISION} |
| 15 | +Section: games |
| 16 | +Installed-Size: 226 |
| 17 | +Maintainer: Charlie Chen <Charlie@CharmySoft.com> |
| 18 | +Homepage: http://www.CharmySoft.com/app/ttt-python.htm |
| 19 | +Priority: optional |
| 20 | +Architecture: all |
| 21 | +Depends: python3 |
| 22 | +Description: Tic-Tac-Toe Online |
| 23 | + Simple yet fun noughts and crosses game online |
| 24 | +
|
| 25 | +EOM |
| 26 | + |
| 27 | +# Create 'usr' folder |
| 28 | +mkdir usr |
| 29 | +# Create 'usr/bin/tic-tac-toe-online' script |
| 30 | +mkdir usr/bin |
| 31 | +cat >> usr/bin/tic-tac-toe-online << EOM |
| 32 | +#!/bin/bash |
| 33 | +/usr/share/tic-tac-toe-online/ttt_client_gui.py |
| 34 | +EOM |
| 35 | +# Add execution permission |
| 36 | +chmod 0755 usr/bin/tic-tac-toe-online |
| 37 | +# Create 'usr/share' folder |
| 38 | +mkdir usr/share |
| 39 | +# Create a menu entry |
| 40 | +mkdir usr/share/applications |
| 41 | +cat >> usr/share/applications/tic-toc-toe-online.desktop << EOM |
| 42 | +[Desktop Entry] |
| 43 | +Name=Tic-Tac-Toe Online |
| 44 | +Version=${VERSION} |
| 45 | +Exec=tic-tac-toe-online |
| 46 | +Comment=Simple yet fun noughts and crosses game online |
| 47 | +Icon=/usr/share/pixmaps/tic-tac-toe-online.png |
| 48 | +Type=Application |
| 49 | +Terminal=false |
| 50 | +StartupNotify=true |
| 51 | +Categories=Games; |
| 52 | +EOM |
| 53 | +# Add execution permission |
| 54 | +chmod 0644 usr/share/applications/tic-toc-toe-online.desktop |
| 55 | +# Copy the application icon |
| 56 | +mkdir usr/share/pixmaps |
| 57 | +cp ../icons/icon.png usr/share/pixmaps/tic-tac-toe-online.png |
| 58 | +# Copy all the required files to 'usr/share/tic-tac-toe-online' |
| 59 | +mkdir usr/share/tic-tac-toe-online |
| 60 | +cp ../ttt_client.py usr/share/tic-tac-toe-online |
| 61 | +cp ../ttt_client_gui.py usr/share/tic-tac-toe-online |
| 62 | +cp ../res -r usr/share/tic-tac-toe-online/res |
| 63 | +# Add execution permission |
| 64 | +chmod 0755 usr/share/tic-tac-toe-online/ttt_client.py |
| 65 | +chmod 0755 usr/share/tic-tac-toe-online/ttt_client_gui.py |
| 66 | +# Build the debian package |
| 67 | +cd .. |
| 68 | +chown -R root tic-tac-toe-online_${VERSION}-${PACKAGE_REVISION} |
| 69 | +dpkg-deb --build tic-tac-toe-online_${VERSION}-${PACKAGE_REVISION} |
| 70 | + |
| 71 | +# Remove the temperary folder |
| 72 | +rm -r tic-tac-toe-online_${VERSION}-${PACKAGE_REVISION} |
0 commit comments