Page MenuHomePhabricator (Chris)

No OneTemporary

Size
26 KB
Referenced Files
None
Subscribers
None
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..669011e
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+darthinvaders (1.0-2) groovy; urgency=medium
+
+ * Initial release for groovy
+
+ -- Chris <dpkg@chris-nz.com> Fri, 07 Aug 2020 16:50:09 +1200
\ No newline at end of file
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..041e2a1
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,18 @@
+Source: darthinvaders
+Section: games
+Priority: optional
+Maintainer: Chris <sneaky@yellow.lan>
+Build-Depends: debhelper-compat (= 12), liballegro5-dev
+Standards-Version: 4.4.1
+Homepage: https://github.com/movaid7/DarthInvaders
+
+Package: darthinvaders
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Star Wars themed Space Invaders Clone
+ Space Invaders is one of the earliest arcade shoot 'em up games. The player
+ can move horizontally across the bottom of the screen and must shoot at an
+ incoming wave of aliens before they reach the bottom.
+ .
+ DarthInvaders is Space Invaders with a Star Wars feel, and was created
+ for "Computer Methods Game Collaboration".
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..1eeb65e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,31 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: darthinvaders
+Upstream-Contact: Muhammad Vaid <molvy32@gmail.com>
+Source: https://github.com/movaid7/DarthInvaders
+
+Files: *
+Copyright: 2017 Muhammad Vaid et al<molvy32@gmail.com>
+License: All Rights Reserved
+ This would need an explicit dfsg-ok licence for debian.
+ Unfortunately one hasn't been provided. Haven't filed a bug.
+ The art, some of that looks nonfree but is fair use etc.
+
+Files: debian/*
+Copyright: 2020 Chris <sneaky@yellow.lan>
+License: GPL-2+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
diff --git a/debian/darthinvaders.1 b/debian/darthinvaders.1
new file mode 100644
index 0000000..e6bb65f
--- /dev/null
+++ b/debian/darthinvaders.1
@@ -0,0 +1,32 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" (C) Copyright 2017 Muhammad Vaid <molvy32@gmail.com>
+.\"
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH DARTHINVADERS 1 "August 7 2020"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+darthinvaders \- space invaders game
+.SH SYNOPSIS
+.B darthinvaders
+.SH DESCRIPTION
+This program does not accept any command-line arguyments.
+This man page was written because the program didn't have one.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+.SH OPTIONS
+This program does not have any options.
diff --git a/debian/data/Makefile b/debian/data/Makefile
new file mode 100644
index 0000000..c63abb3
--- /dev/null
+++ b/debian/data/Makefile
@@ -0,0 +1,133 @@
+# Might be lots of junk in here
+# it was originally generated by qmake
+EQ = =
+
+####### Compiler, tools and options
+
+CC = gcc
+CXX = g++
+DEFINES =
+CFLAGS = -pipe -Os -Wall -W -D_REENTRANT -fPIC $(DEFINES)
+CXXFLAGS = -pipe -Os -std=gnu++11 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
+INCPATH = -I.
+DEL_FILE = rm -f
+CHK_DIR_EXISTS= test -d
+MKDIR = mkdir -p
+COPY = cp -f
+COPY_FILE = cp -f
+COPY_DIR = cp -f -R
+INSTALL_FILE = install -m 644 -p
+INSTALL_PROGRAM = install -m 755 -p
+INSTALL_DIR = cp -f -R
+DEL_FILE = rm -f
+SYMLINK = ln -f -s
+DEL_DIR = rmdir
+MOVE = mv -f
+TAR = tar -cf
+COMPRESS = gzip -9f
+DISTNAME = darthinvaders-1.0
+DISTDIR = /tmp/DarthInvaders_/.tmp/DarthInvaders-1.0
+LINK = g++
+LFLAGS = -Wl,-O1
+LIBS = -lallegro_image -lallegro_ttf -lallegro_font -lallegro_audio -lallegro_primitives -lallegro_acodec -lallegro_dialog -lallegro -lpthread
+AR = ar cqs
+RANLIB =
+SED = sed
+STRIP = strip
+
+####### Output directory
+
+OBJECTS_DIR = ./
+
+####### Files
+
+SOURCES = BackGround.cpp \
+ Barrier.cpp \
+ Bullet.cpp \
+ Enemy.cpp \
+ Global.cpp \
+ Highscores.cpp \
+ Spaceship.cpp \
+ Test.cpp
+OBJECTS = BackGround.o \
+ Barrier.o \
+ Bullet.o \
+ Enemy.o \
+ Global.o \
+ Highscores.o \
+ Spaceship.o \
+ Test.o
+DIST = BackGround.h \
+ Barrier.h \
+ Bullet.h \
+ Enemy.h \
+ Global.h \
+ Highscores.h \
+ Spaceship.h BackGround.cpp \
+ Barrier.cpp \
+ Bullet.cpp \
+ Enemy.cpp \
+ Global.cpp \
+ Highscores.cpp \
+ Spaceship.cpp \
+ Test.cpp
+DESTDIR =
+TARGET = darthinvaders
+
+
+first: all
+####### Build rules
+
+darthinvaders: $(OBJECTS)
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+all: darthinvaders
+
+clean:
+ $(DEL_FILE) $(TARGET)
+ $(DEL_FILE) $(OBJECTS)
+
+####### Sub-libraries
+
+check: first
+
+benchmark: first
+
+####### Compile
+
+BackGround.o: BackGround.cpp BackGround.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o BackGround.o BackGround.cpp
+
+Barrier.o: Barrier.cpp Barrier.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Barrier.o Barrier.cpp
+
+Bullet.o: Bullet.cpp Bullet.h \
+ Spaceship.h \
+ Global.h \
+ Enemy.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Bullet.o Bullet.cpp
+
+Enemy.o: Enemy.cpp Enemy.h \
+ Global.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Enemy.o Enemy.cpp
+
+Global.o: Global.cpp Global.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Global.o Global.cpp
+
+Highscores.o: Highscores.cpp Highscores.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Highscores.o Highscores.cpp
+
+Spaceship.o: Spaceship.cpp Spaceship.h \
+ Global.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Spaceship.o Spaceship.cpp
+
+Test.o: Test.cpp Enemy.h \
+ Global.h \
+ Spaceship.h \
+ Bullet.h \
+ BackGround.h \
+ Barrier.h \
+ Highscores.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Test.o Test.cpp
+
+
diff --git a/debian/data/darthinvaders.desktop b/debian/data/darthinvaders.desktop
new file mode 100644
index 0000000..f7b54ca
--- /dev/null
+++ b/debian/data/darthinvaders.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=Darth Invaders
+GenericName=Space game
+GenericName[de]=Weltraumspiel
+GenericName[fr]=Jeu spatial
+Comment=Space combat game
+Comment[de]=Weltraumkampfsimulator
+Comment[fr]=Jeu de combat dans l'espace
+Exec=darthinvaders
+Icon=darthinvaders
+Terminal=false
+Type=Application
+Keywords=game;space;
+Categories=Game;Simulation;
diff --git a/debian/data/darthinvaders.png b/debian/data/darthinvaders.png
new file mode 100644
index 0000000..724bbe9
Binary files /dev/null and b/debian/data/darthinvaders.png differ
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..2598f12
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,8 @@
+debian/data/darthinvaders.desktop /usr/share/applications
+debian/data/darthinvaders.png /usr/share/icons/hicolor/128x128/apps
+darthinvaders /usr/bin
+Pictures /usr/share/darthinvaders
+Sounds /usr/share/darthinvaders
+Fonts /usr/share/darthinvaders
+darthinvaders-scores.txt /usr/share/darthinvaders
+
diff --git a/debian/patches/Add-rudimentary-makefile-for-debhelper b/debian/patches/Add-rudimentary-makefile-for-debhelper
new file mode 100644
index 0000000..df8805e
--- /dev/null
+++ b/debian/patches/Add-rudimentary-makefile-for-debhelper
@@ -0,0 +1,144 @@
+Description: Add rudimentary makefile
+ Add a Makefile to the source (it is overwritten during dh_make anyway).
+ This is a very simple Makefile which can build and clean only.
+ Installation is currently done by debian's tools.
+
+Forwarded: not-needed
+Last-Update: 2020-08-07
+
+--- /dev/null
++++ darthinvaders-1.0/Makefile
+@@ -0,0 +1,133 @@
++# Might be lots of junk in here
++# it was originally generated by qmake
++EQ = =
++
++####### Compiler, tools and options
++
++CC = gcc
++CXX = g++
++DEFINES =
++CFLAGS = -pipe -Os -Wall -W -D_REENTRANT -fPIC $(DEFINES)
++CXXFLAGS = -pipe -Os -std=gnu++11 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
++INCPATH = -I.
++DEL_FILE = rm -f
++CHK_DIR_EXISTS= test -d
++MKDIR = mkdir -p
++COPY = cp -f
++COPY_FILE = cp -f
++COPY_DIR = cp -f -R
++INSTALL_FILE = install -m 644 -p
++INSTALL_PROGRAM = install -m 755 -p
++INSTALL_DIR = cp -f -R
++DEL_FILE = rm -f
++SYMLINK = ln -f -s
++DEL_DIR = rmdir
++MOVE = mv -f
++TAR = tar -cf
++COMPRESS = gzip -9f
++DISTNAME = darthinvaders-1.0
++DISTDIR = /tmp/DarthInvaders_/.tmp/DarthInvaders-1.0
++LINK = g++
++LFLAGS = -Wl,-O1
++LIBS = -lallegro_image -lallegro_ttf -lallegro_font -lallegro_audio -lallegro_primitives -lallegro_acodec -lallegro_dialog -lallegro -lpthread
++AR = ar cqs
++RANLIB =
++SED = sed
++STRIP = strip
++
++####### Output directory
++
++OBJECTS_DIR = ./
++
++####### Files
++
++SOURCES = BackGround.cpp \
++ Barrier.cpp \
++ Bullet.cpp \
++ Enemy.cpp \
++ Global.cpp \
++ Highscores.cpp \
++ Spaceship.cpp \
++ Test.cpp
++OBJECTS = BackGround.o \
++ Barrier.o \
++ Bullet.o \
++ Enemy.o \
++ Global.o \
++ Highscores.o \
++ Spaceship.o \
++ Test.o
++DIST = BackGround.h \
++ Barrier.h \
++ Bullet.h \
++ Enemy.h \
++ Global.h \
++ Highscores.h \
++ Spaceship.h BackGround.cpp \
++ Barrier.cpp \
++ Bullet.cpp \
++ Enemy.cpp \
++ Global.cpp \
++ Highscores.cpp \
++ Spaceship.cpp \
++ Test.cpp
++DESTDIR =
++TARGET = darthinvaders
++
++
++first: all
++####### Build rules
++
++darthinvaders: $(OBJECTS)
++ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
++
++all: darthinvaders
++
++clean:
++ $(DEL_FILE) $(TARGET)
++ $(DEL_FILE) $(OBJECTS)
++
++####### Sub-libraries
++
++check: first
++
++benchmark: first
++
++####### Compile
++
++BackGround.o: BackGround.cpp BackGround.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o BackGround.o BackGround.cpp
++
++Barrier.o: Barrier.cpp Barrier.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Barrier.o Barrier.cpp
++
++Bullet.o: Bullet.cpp Bullet.h \
++ Spaceship.h \
++ Global.h \
++ Enemy.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Bullet.o Bullet.cpp
++
++Enemy.o: Enemy.cpp Enemy.h \
++ Global.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Enemy.o Enemy.cpp
++
++Global.o: Global.cpp Global.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Global.o Global.cpp
++
++Highscores.o: Highscores.cpp Highscores.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Highscores.o Highscores.cpp
++
++Spaceship.o: Spaceship.cpp Spaceship.h \
++ Global.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Spaceship.o Spaceship.cpp
++
++Test.o: Test.cpp Enemy.h \
++ Global.h \
++ Spaceship.h \
++ Bullet.h \
++ BackGround.h \
++ Barrier.h \
++ Highscores.h
++ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Test.o Test.cpp
++
++
diff --git a/debian/patches/Fix-for-Earth-Graphic-crash b/debian/patches/Fix-for-Earth-Graphic-crash
new file mode 100644
index 0000000..b782f41
--- /dev/null
+++ b/debian/patches/Fix-for-Earth-Graphic-crash
@@ -0,0 +1,17 @@
+Description: Fix for Earth Graphic crash
+ Change filename String for bitmap loader re: EARTH.png.
+ This prevents crash on certain conditions like Game Over.
+
+Forwarded: not-needed
+
+--- darthinvaders-1.0.orig/Test.cpp
++++ darthinvaders-1.0/Test.cpp
+@@ -157,7 +157,7 @@ int main(void)
+ emperor1 = al_load_sample("Sounds/Emperor1.ogg");
+ emperor2 = al_load_sample("Sounds/Emperor2.ogg");
+ emperor3 = al_load_sample("Sounds/Emperor3.ogg");
+- State3 = al_load_bitmap("Pictures/EARTH.png");
++ State3 = al_load_bitmap("Pictures/Earth.png");
+ State4 = al_load_bitmap("Pictures/DeathStar.png");
+
+ //Load Pictures
diff --git a/debian/patches/Fix-include-file-paths b/debian/patches/Fix-include-file-paths
new file mode 100644
index 0000000..6bdee7a
--- /dev/null
+++ b/debian/patches/Fix-include-file-paths
@@ -0,0 +1,116 @@
+Description: Fix include file paths
+ Change slash direction in includes.
+
+Forwarded: not-needed
+
+--- darthinvaders-1.0.orig/BackGround.h
++++ darthinvaders-1.0/BackGround.h
+@@ -1,7 +1,7 @@
+ #pragma once
+
+-#include<allegro5\allegro.h>
+-#include<allegro5\allegro_image.h>
++#include<allegro5/allegro.h>
++#include<allegro5/allegro_image.h>
+
+ class BackGround
+ {
+--- darthinvaders-1.0.orig/Barrier.h
++++ darthinvaders-1.0/Barrier.h
+@@ -1,6 +1,6 @@
+ #pragma once
+-#include<allegro5\allegro.h>
+-#include<allegro5\allegro_image.h>
++#include<allegro5/allegro.h>
++#include<allegro5/allegro_image.h>
+ using namespace std;
+ class Barrier
+ {
+--- darthinvaders-1.0.orig/SpaceInvadersTest.vcxproj
++++ darthinvaders-1.0/SpaceInvadersTest.vcxproj
+@@ -16,7 +16,7 @@
+ <ProjectName>DarthInvaders</ProjectName>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
++ <Import Project="$(VCTargetsPath)/Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+@@ -30,14 +30,14 @@
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
++ <Import Project="$(VCTargetsPath)/Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
++ <Import Project="$(UserRootDir)/Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)/Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
++ <Import Project="$(UserRootDir)/Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)/Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+@@ -100,16 +100,16 @@
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
++ <Import Project="$(VCTargetsPath)/Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+- <Import Project="packages\AllegroDeps.1.5.0.1\build\native\AllegroDeps.targets" Condition="Exists('packages\AllegroDeps.1.5.0.1\build\native\AllegroDeps.targets')" />
+- <Import Project="packages\Allegro.5.2.2.1\build\native\Allegro.targets" Condition="Exists('packages\Allegro.5.2.2.1\build\native\Allegro.targets')" />
++ <Import Project="packages/AllegroDeps.1.5.0.1/build/native/AllegroDeps.targets" Condition="Exists('packages/AllegroDeps.1.5.0.1/build/native/AllegroDeps.targets')" />
++ <Import Project="packages/Allegro.5.2.2.1/build/native/Allegro.targets" Condition="Exists('packages/Allegro.5.2.2.1/build/native/Allegro.targets')" />
+ </ImportGroup>
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+- <Error Condition="!Exists('packages\AllegroDeps.1.5.0.1\build\native\AllegroDeps.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\AllegroDeps.1.5.0.1\build\native\AllegroDeps.targets'))" />
+- <Error Condition="!Exists('packages\Allegro.5.2.2.1\build\native\Allegro.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Allegro.5.2.2.1\build\native\Allegro.targets'))" />
++ <Error Condition="!Exists('packages/AllegroDeps.1.5.0.1/build/native/AllegroDeps.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages/AllegroDeps.1.5.0.1/build/native/AllegroDeps.targets'))" />
++ <Error Condition="!Exists('packages/Allegro.5.2.2.1/build/native/Allegro.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages/Allegro.5.2.2.1/build/native/Allegro.targets'))" />
+ </Target>
+ </Project>
+\ No newline at end of file
+--- darthinvaders-1.0.orig/Spaceship.h
++++ darthinvaders-1.0/Spaceship.h
+@@ -1,7 +1,7 @@
+ #pragma once
+
+-#include<allegro5\allegro.h>
+-#include<allegro5\allegro_primitives.h>
++#include<allegro5/allegro.h>
++#include<allegro5/allegro_primitives.h>
+ #include "Global.h"
+
+ class Spaceship
+--- darthinvaders-1.0.orig/Test.cpp
++++ darthinvaders-1.0/Test.cpp
+@@ -1,13 +1,13 @@
+ #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") //no console window behind game window
+
+-#include<allegro5\allegro.h>
+-#include<allegro5\allegro_native_dialog.h>
+-#include<allegro5\allegro_primitives.h>
+-#include<allegro5\allegro_image.h>
+-#include <allegro5\allegro_font.h>
+-#include <allegro5\allegro_ttf.h>
+-#include <allegro5\allegro_audio.h>
+-#include <allegro5\allegro_acodec.h>
++#include<allegro5/allegro.h>
++#include<allegro5/allegro_native_dialog.h>
++#include<allegro5/allegro_primitives.h>
++#include<allegro5/allegro_image.h>
++#include <allegro5/allegro_font.h>
++#include <allegro5/allegro_ttf.h>
++#include <allegro5/allegro_audio.h>
++#include <allegro5/allegro_acodec.h>
+ #include <string>
+ #include <string.h>
+ #include <iostream>
diff --git a/debian/patches/Massage-Sauce-for-Filesystem-Hierarchy-Standard b/debian/patches/Massage-Sauce-for-Filesystem-Hierarchy-Standard
new file mode 100644
index 0000000..9072698
--- /dev/null
+++ b/debian/patches/Massage-Sauce-for-Filesystem-Hierarchy-Standard
@@ -0,0 +1,113 @@
+Description: Massage Sauce for Filesystem Hierarchy Standard
+ On Linux, game can now read data files from /usr/share/darthinvaders.
+ This may vary by prefix.
+ Also it has (per-user due to convention) writable high scores, which
+ will be kept in /home/.config or similar, if it exists.
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Forwarded: not-needed
+Last-Update: 2020-08-07
+
+--- darthinvaders-1.0.orig/Test.cpp
++++ darthinvaders-1.0/Test.cpp
+@@ -13,6 +13,13 @@
+ #include <iostream>
+ #include <fstream>
+
++#ifdef __linux__
++#include <unistd.h>
++#include <sys/types.h>
++#include <pwd.h>
++#include <libgen.h>
++#endif
++
+ #include "Enemy.h"
+ #include "Spaceship.h"
+ #include "Bullet.h"
+@@ -79,23 +86,61 @@ BackGround BG;
+ BackGround MG;
+ BackGround FG;
+ BackGround MM;
+-
++std::string confdir;
+
+ int main(void)
+ {
++ if (!al_init()) {
++ al_show_native_message_box(NULL, NULL, NULL, "Could not initialize allegro",
++ NULL, NULL);
++ return -1;
++ }
++
++#ifdef __linux__
++ ALLEGRO_PATH* exepath = al_get_standard_path(ALLEGRO_EXENAME_PATH);
++ al_set_path_filename(exepath , NULL);
++ al_change_directory(al_path_cstr(exepath, '/'));
++ al_change_directory((string{dirname(strdup(al_path_cstr(exepath, '/')))} +"/share/darthinvaders").c_str());
++ al_destroy_path(exepath);
++
++ char const* cf = getenv("XDG_CONFIG_HOME");
++ if (!cf) {
++ char const* hd = getenv("HOME");
++ std::string homedir = getenv("HOME");
++ if (!hd) {
++ homedir = getpwuid(getuid())->pw_dir;
++ } else {
++ confdir = std::string(hd) + "/.config";
++ }
++ } else {
++ confdir = getenv("XDG_CONFIG_HOME");
++ }
++
++ confdir += "/";
++
++ // if scores file is not user's dir, copy it in.
++ // it'll still degrade gracefully if you can't write here
++ // Filesystem standard says to put highscores in /var/games but then new users have no write perms??
++ std::string path = confdir + "/scores.txt";
++ if (access (confdir.c_str(), F_OK) == 0 && access(path.c_str(), F_OK) != 0 && access (confdir.c_str(), W_OK) == 0) {
++ ifstream source("scores.txt", ios::binary);
++ ofstream dest(path, ios::binary);
++
++ dest << source.rdbuf();
++
++ source.close();
++ dest.close();
++ }
++#else
++ confdir = "";
++#endif
+ readScores(); //reads in scores from textfile
+ setEnemy();
+ enemyBullet.isFriendly = false;
+ srand((unsigned)time(NULL));
+-
+ //variables
+
+
+- if (!al_init())
+- {
+- al_show_native_message_box(NULL, NULL, NULL, "Could not initialize allegro", NULL, NULL);
+- return -1;
+- }
+
+ //Allegro variables
+ ALLEGRO_DISPLAY *DISPLAY = NULL;
+@@ -942,7 +987,7 @@ void DrawAnimation(ALLEGRO_BITMAP *pic,
+
+ void readScores()
+ {
+- ifstream myfile("scores.txt");
++ ifstream myfile(confdir+"scores.txt");
+ string line;
+ Highscores temp;
+ int count = 0;
+@@ -976,7 +1021,7 @@ void writeScore()
+ arrScores[pos + 1].score = score;
+ arrScores[pos + 1].name = nameString;
+
+- ofstream OutputFile("scores.txt");
++ ofstream OutputFile(confdir+"scores.txt");
+ for (i = 0; i < 9; i++)
+ {
+ if (arrScores[i].name == "")
diff --git a/debian/patches/Update-Score-Filenames-for-Better-.config-integration b/debian/patches/Update-Score-Filenames-for-Better-.config-integration
new file mode 100644
index 0000000..02ad3bb
--- /dev/null
+++ b/debian/patches/Update-Score-Filenames-for-Better-.config-integration
@@ -0,0 +1,68 @@
+Description: Make score textfile name distinct
+ Rename scores.txt because it could have a namespace collision
+ with something else that uses XDG standard but then calls its
+ config file "scores.txt".
+
+Forwarded: not-needed
+Last-Update: 2020-08-07
+
+--- darthinvaders-1.0.orig/Test.cpp
++++ darthinvaders-1.0/Test.cpp
+@@ -121,9 +121,9 @@ int main(void)
+ // if scores file is not user's dir, copy it in.
+ // it'll still degrade gracefully if you can't write here
+ // Filesystem standard says to put highscores in /var/games but then new users have no write perms??
+- std::string path = confdir + "/scores.txt";
++ std::string path = confdir + "/darthinvaders-scores.txt";
+ if (access (confdir.c_str(), F_OK) == 0 && access(path.c_str(), F_OK) != 0 && access (confdir.c_str(), W_OK) == 0) {
+- ifstream source("scores.txt", ios::binary);
++ ifstream source("darthinvaders-scores.txt", ios::binary);
+ ofstream dest(path, ios::binary);
+
+ dest << source.rdbuf();
+@@ -987,7 +987,7 @@ void DrawAnimation(ALLEGRO_BITMAP *pic,
+
+ void readScores()
+ {
+- ifstream myfile(confdir+"scores.txt");
++ ifstream myfile(confdir+"darthinvaders-scores.txt");
+ string line;
+ Highscores temp;
+ int count = 0;
+@@ -1021,7 +1021,7 @@ void writeScore()
+ arrScores[pos + 1].score = score;
+ arrScores[pos + 1].name = nameString;
+
+- ofstream OutputFile(confdir+"scores.txt");
++ ofstream OutputFile(confdir+"darthinvaders-scores.txt");
+ for (i = 0; i < 9; i++)
+ {
+ if (arrScores[i].name == "")
+--- /dev/null
++++ darthinvaders-1.0/darthinvaders-scores.txt
+@@ -0,0 +1,10 @@
++99999999 Vaid
++5320 jazz
++4870 mo
++4110 muhammad
++4020 dead
++1980 jazz
++1400 mo
++1320 mall
++1140 jazz
++730 mo
+\ No newline at end of file
+--- darthinvaders-1.0.orig/scores.txt
++++ /dev/null
+@@ -1,10 +0,0 @@
+-99999999 Vaid
+-5320 jazz
+-4870 mo
+-4110 muhammad
+-4020 dead
+-1980 jazz
+-1400 mo
+-1320 mall
+-1140 jazz
+-730 mo
+\ No newline at end of file
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..bb8b354
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+Fix-for-Earth-Graphic-crash
+Fix-include-file-paths
+Massage-Sauce-for-Filesystem-Hierarchy-Standard
+Add-rudimentary-makefile-for-debhelper
+Update-Score-Filenames-for-Better-.config-integration
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..36dad2e
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export DEB_CXXFLAGS_MAINT_APPEND = -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT
+
+%:
+ cp debian/data/Makefile .
+ dh $@
+
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
new file mode 100644
index 0000000..7ea91e0
--- /dev/null
+++ b/debian/source/include-binaries
@@ -0,0 +1,3 @@
+debian/data/darthinvaders.png
+debian/data/darthinvaders.desktop
+

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 11, 2:00 PM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42681
Default Alt Text
(26 KB)

Event Timeline