Skip to content

Commit

Permalink
Add debian
Browse files Browse the repository at this point in the history
  • Loading branch information
fmowl10 committed Jun 9, 2021
1 parent b77c35c commit fc98498
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ compile_commands.json

# End of https://www.toptal.com/developers/gitignore/api/c++,meson,visualstudiocode

doc/*
doc/*

debian/.debhelper
debian/.snake-clone
debian/snake-clone.substvars
debian/files
debian/snake-clone
debian/debhelper-build-stamp
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define PROJECT_NAME_STR string("@name@")
11 changes: 11 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
snake-clone (1.0.0-1ubuntu1) hirsute; urgency=medium

* stage file

-- Jinseok Kim <[email protected]> Wed, 09 Jun 2021 14:06:03 +0900

snake-clone (1.0.0-1) hirsute; urgency=medium

* Initial release

-- Jinseok Kim <[email protected]> Wed, 09 Jun 2021 13:31:15 +0900
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: snake-clone
Section: unknown
Priority: optional
Maintainer: Jinseok Kim <[email protected]>
Build-Depends: debhelper-compat (= 13), libncurses-dev, libncurses5-dev
Standards-Version: 4.5.1
#Vcs-Browser: https://github.com/fmowl10/snake-clone
Vcs-Git: https://gihtub.com/fmowl10/snake-clone.git
Rules-Requires-Root: no

Package: snake-clone
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: snake-clone for Kookmin university C++ project
31 changes: 31 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: snake-clone
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: https://gihtub.com/fmowl10/snake-clone.git

Files: *
Copyright: 2021 Kim Jinseok
2021 Kim Jeaha
License: MIT

MIT License

Copyright (c) 2021 fmowl10

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 25 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
dh $@ --buildsystem=meson


# 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)
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
11 changes: 10 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ project('snake-clone', 'cpp', version:'0.0.1')
src=['src/board.cpp', 'src/main.cpp', 'src/snake.cpp',]
dep=[dependency('ncurses')]

executable(meson.project_name(), src, dependencies:dep)
conf_data = configuration_data()
conf_data.set('name', meson.project_name())

configure_file(input : 'config.h.in', output : 'config.h', configuration: conf_data)
conf_inc = include_directories('.')


install_data(['stage-1.map', 'stage-2.map', 'stage-3.map', 'stage-4.map', 'stage-5.map' ])
executable(meson.project_name(), src, dependencies:dep, install:true, include_directories : conf_inc)

11 changes: 11 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "board.h"
#include <config.h>
#include <cstring>
#include <iostream>
#include <ncurses.h>
Expand All @@ -9,13 +10,23 @@
#define STAGECOUNT 5
using namespace std;

#ifndef DEBUG
const string StageFile[STAGECOUNT] = {
"/usr/share/" + string(PROJECT_NAME_STR) + "/stage-1.map",
"/usr/share/" + string(PROJECT_NAME_STR) + "/stage-2.map",
"/usr/share/" + string(PROJECT_NAME_STR) + "/stage-3.map",
"/usr/share/" + string(PROJECT_NAME_STR) + "/stage-4.map",
"/usr/share/" + string(PROJECT_NAME_STR) + "/stage-5.map",
};
#else
const string StageFile[STAGECOUNT] = {
"stage-1.map",
"stage-2.map",
"stage-3.map",
"stage-4.map",
"stage-5.map",
};
#endif

const char *stageClearMessage = "you clear stage %d press any button to start next stage";
const char *gameClearMessage = "you clear the game press any button to exit the game";
Expand Down

0 comments on commit fc98498

Please sign in to comment.