summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralex <alex@ASUS>2018-09-02 20:23:01 +0200
committeralex <alex@ASUS>2018-09-02 20:23:01 +0200
commita61b1c97b0a49afe8877c93d031ee189759ea865 (patch)
treebd65c447b25fa301ebf5c0727151faea13296ed9
parent1a9e528892b29eb57614ead716de9bae58dbc585 (diff)
Modify Makefile and other files to build for Debian (unfinished)
-rw-r--r--COPYING.txt5
-rw-r--r--Makefile74
-rw-r--r--debian/changelog4
-rw-r--r--debian/control17
-rw-r--r--debian/copyright22
-rw-r--r--debian/rules1
-rw-r--r--share/COPYRIGHT.txt2
-rw-r--r--share/HELP.txt16
-rw-r--r--share/LICENSE.txt2
-rw-r--r--share/README.txt12
-rw-r--r--share/USAGE.txt4
11 files changed, 100 insertions, 59 deletions
diff --git a/COPYING.txt b/COPYING.txt
index a6eb0fa..81c77e6 100644
--- a/COPYING.txt
+++ b/COPYING.txt
@@ -1,14 +1,11 @@
NOTE! The GPL below is copyrighted by the Free Software
- Foundation, but the instance of code that it refers to (mine_sweeper)
+ Foundation, but the instance of code that it refers to (mine-sweeper)
is copyrighted by me who actually wrote it.
Also note that the only valid version of the GPL is _this_ particular
version of the license (ie v2, not v2.2 or v3.x or whatever), unless
explicitly otherwise stated.
- Also note that the code is copyrighted by me, but the original game,
- Mine, was written in 1990 by Robert Donner & Curt Johnson at Duff Software.
-
Alejandro Colomar
----------------------------------------
diff --git a/Makefile b/Makefile
index 2359e5b..dadd997 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
-# License: GPL-2.0
-# This Makefile has parts of the linux kernel Makefile code.
+#!/usr/bin/make -f
+
VERSION = 3
-PATCHLEVEL = b
-SUBLEVEL = 4
+PATCHLEVEL = ~b4
+SUBLEVEL =
EXTRAVERSION =
NAME = instalable
@@ -11,6 +11,12 @@ export PATCHLEVEL
export SUBLEVEL
################################################################################
+# *AUTHOR*
+
+# EMAIL "1903716@gmail.com"
+# FULL NAME "Alejandro Colomar Andrés"
+
+################################################################################
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README.txt
@@ -18,24 +24,12 @@ export SUBLEVEL
# expect to learn how to build mine_sweeper reading this file.
################################################################################
-# Beautify output FIXME
+# Beautify output
# ---------------------------------------------------------------------------
-#
-# Normally, we echo the whole command before executing it. We now
-# have the possibility to choose other forms of output instead, e.g.
-#
-# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
-# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
-#
-# If $(Q) is empty, the whole command will be printed.
-# If it is set to "quiet_", only the short version will be printed.
-# If it is set to "silent_", nothing will be printed at all, since
-# the variable $(silent_cmd_cc_o_c) doesn't exist.
-#
-# A simple variant is to prefix commands with $(Q) - that's useful
+# Prefix commands with $(Q) - that's useful
# for commands that shall be hidden in non-verbose mode.
#
-# $(Q)ln $@ :<
+# $(Q)some command here
#
# If BUILD_VERBOSE equals 0 then the above command will be hidden.
# If BUILD_VERBOSE equals 1 then the above command is displayed.
@@ -52,10 +46,8 @@ endif
ifeq ($(BUILD_VERBOSE), 1)
Q =
- QQ =
else
Q = @
- QQ =
endif
# If the user is running make -s (silent mode), suppress echoing of
@@ -63,11 +55,9 @@ endif
ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
Q = @
- QQ = @
endif
export Q
-export QQ
export BUILD_VERBOSE
################################################################################
@@ -77,7 +67,7 @@ export BUILD_VERBOSE
MAKEFLAGS += --no-print-directory
################################################################################
-PROGRAMVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+PROGRAMVERSION = $(VERSION)$(if $(PATCHLEVEL),$(PATCHLEVEL)$(if $(SUBLEVEL),$(SUBLEVEL)))$(EXTRAVERSION)
export PROGRAMVERSION
################################################################################
@@ -103,11 +93,15 @@ export MAIN_DIR
export LIBALX_DIR
export MODULES_DIR
+# FIXME: Set local or not local when building a package
ifeq ($(OS), linux)
- INSTALL_BIN_DIR = /usr/local/games/
- INSTALL_SHARE_DIR = /usr/local/share/
+ INSTALL_BIN_DIR = $(DESTDIR)/usr/local/games/
+# INSTALL_BIN_DIR = $(DESTDIR)/usr/games/
+ INSTALL_SHARE_DIR = $(DESTDIR)/usr/local/share/
+# INSTALL_SHARE_DIR = $(DESTDIR)/usr/share/
SHARE_DIR = mine-sweeper/
- INSTALL_VAR_DIR = /var/local/
+ INSTALL_VAR_DIR = $(DESTDIR)/var/local/
+# INSTALL_VAR_DIR = $(DESTDIR)/var/games/
VAR_DIR = mine-sweeper/
else ifeq ($(OS), win)
INSTALL_DIR = c:/Program files (x86)/
@@ -146,7 +140,7 @@ export CC
export LD
################################################################################
-CFLAGS = -std=c11
+CFLAGS = -std=c11 -v
CFLAGS += -D PROG_VERSION=\"$(PROGRAMVERSION)\"
CFLAGS += -D 'INSTALL_SHARE_DIR="$(INSTALL_SHARE_DIR)"'
CFLAGS += -D SHARE_DIR=\"$(SHARE_DIR)\"
@@ -196,24 +190,26 @@ binary:
PHONY += install
install: uninstall
+ @echo "Create $(INSTALL_BIN_DIR)/"
+ $(Q)mkdir -p $(INSTALL_BIN_DIR)/
@echo "Copy $(BIN_NAME)"
- $(Q)cp $(BIN_DIR)/$(BIN_NAME) $(INSTALL_BIN_DIR)/
+ $(Q)cp $(BIN_DIR)/$(BIN_NAME) $(INSTALL_BIN_DIR)/
@echo ""
@echo "Create $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/"
- $(Q)mkdir $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/
+ $(Q)mkdir -p $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/
@echo "Copy share/*"
- $(Q)cp -r ./share/* $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/
+ $(Q)cp -r ./share/* $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/
@echo "Create $(INSTALL_VAR_DIR)/$(VAR_DIR)/"
- $(Q)mkdir $(INSTALL_VAR_DIR)/$(VAR_DIR)/
+ $(Q)mkdir -p $(INSTALL_VAR_DIR)/$(VAR_DIR)/
@echo "Copy var/*"
- $(Q)cp -r ./var/* $(INSTALL_VAR_DIR)/$(VAR_DIR)/
+ $(Q)cp -r ./var/* $(INSTALL_VAR_DIR)/$(VAR_DIR)/
@echo "Change owner"
- $(Q)chown root:games -R $(INSTALL_VAR_DIR)/$(VAR_DIR)/
+ $(Q)chown root:games -R $(INSTALL_VAR_DIR)/$(VAR_DIR)/
@echo "Change permissions"
- $(Q)chmod 664 -R $(INSTALL_VAR_DIR)/$(VAR_DIR)/
- $(Q)chmod +X -R $(INSTALL_VAR_DIR)/$(VAR_DIR)/
+ $(Q)chmod 664 -R $(INSTALL_VAR_DIR)/$(VAR_DIR)/
+ $(Q)chmod +X -R $(INSTALL_VAR_DIR)/$(VAR_DIR)/
@echo ""
@echo "Done"
@@ -221,9 +217,9 @@ install: uninstall
PHONY += uninstall
uninstall:
- $(Q)rm -f $(INSTALL_BIN_DIR)/$(BIN_NAME)
- $(Q)rm -f -r $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/
- $(Q)rm -f -r $(INSTALL_VAR_DIR)/$(VAR_DIR)/
+ $(Q)rm -f $(INSTALL_BIN_DIR)/$(BIN_NAME)
+ $(Q)rm -f -r $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/
+ $(Q)rm -f -r $(INSTALL_VAR_DIR)/$(VAR_DIR)/
@echo "Clean old installations"
@echo ""
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..68352a4
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,4 @@
+mine-sweeper (3~b5) unstable; urgency=low
+
+ * Initial Release.
+ * This is my first Debian package.
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..a2aa10b
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,17 @@
+Source: mine-sweeper
+Maintainer: Alejandro Colomar Andrés <1903716@gmail.com>
+Uploaders: Alejandro Colomar Andrés <1903716@gmail.com>
+Section: games
+Priority: optional
+Build-Depends: libc6-dev libncursesw5-dev libtinfo-dev
+Standards-Version: 4.2.1.0
+Homepage: https://github.com/AlejandroColomar/mine-sweeper/
+
+Package: mine-sweeper
+Architecture: any
+Section: games
+Priority: optional
+Essential: no
+Depends: libc6,libncursesw5,libtinfo5
+Description: Terminal game based on 'Mine'.
+Homepage: https://github.com/AlejandroColomar/mine-sweeper/
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..c8688ed
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,22 @@
+Based on the game 'Mine', written in 1990 by
+Robert Donner & Curt Johnson at Duff Software.
+
+Check this: https://tcrf.net/Proto:Minesweeper_(Windows,_1990)
+
+----------------------------------------------------------------
+
+mine-sweeper Copyright (C) 2015 Alejandro COLOMAR ANDRES
+
+This program comes with ABSOLUTELY NO WARRANTY.
+This is free software, and you are welcome to redistribute it
+under the conditions of the GNU GPL-2; see the file COPYING.txt for details.
+
+----------------------------------------------------------------
+
+ NOTE! The only valid version of the GPL is _this_ particular
+ version of the license (ie v2, not v2.2 or v3.x or whatever), unless
+ explicitly otherwise stated.
+
+ Alejandro Colomar
+
+----------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
new file mode 100644
index 0000000..f549901
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1 @@
+#!/usr/bin/make -f
diff --git a/share/COPYRIGHT.txt b/share/COPYRIGHT.txt
index bcdd5ef..f4b79da 100644
--- a/share/COPYRIGHT.txt
+++ b/share/COPYRIGHT.txt
@@ -7,7 +7,7 @@
----------------------------------------------------------------
- mine_sweeper Copyright (C) 2015 Alejandro COLOMAR ANDRES
+ mine-sweeper Copyright (C) 2015 Alejandro COLOMAR ANDRES
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
diff --git a/share/HELP.txt b/share/HELP.txt
index db2316e..def3501 100644
--- a/share/HELP.txt
+++ b/share/HELP.txt
@@ -1,4 +1,4 @@
-Usage: ./mine_sweeper [OPTION...]
+Usage: $ mine-sweeper [OPTION...]
-a, --rows=ROWS set number of rows
-b, --columns=COLS set number of columns
@@ -26,13 +26,13 @@ for any corresponding short options.
Examples:
- $ mine_sweeper
- $ mine_sweeper --version
- $ mine_sweeper --license
- $ mine_sweeper -i 1
- $ mine_sweeper -a 5 -b 15 -p 0.1
- $ mine_sweeper -a 15 -b 20 -p 0.3 -s 1 -x
- $ mine_sweeper -f ../files/saved/saved_000.mine -s 2 -x
+ $ mine-sweeper
+ $ mine-sweeper --version
+ $ mine-sweeper --license
+ $ mine-sweeper -i 1
+ $ mine-sweeper -a 5 -b 15 -p 0.1
+ $ mine-sweeper -a 15 -b 20 -p 0.3 -s 1 -x
+ $ mine-sweeper -f ../files/saved/saved_000.mine -s 2 -x
Report bugs to: 1903716@gmail.com
diff --git a/share/LICENSE.txt b/share/LICENSE.txt
index 3e7566d..81c77e6 100644
--- a/share/LICENSE.txt
+++ b/share/LICENSE.txt
@@ -1,5 +1,5 @@
NOTE! The GPL below is copyrighted by the Free Software
- Foundation, but the instance of code that it refers to (mine_sweeper)
+ Foundation, but the instance of code that it refers to (mine-sweeper)
is copyrighted by me who actually wrote it.
Also note that the only valid version of the GPL is _this_ particular
diff --git a/share/README.txt b/share/README.txt
index edf3327..a7132c9 100644
--- a/share/README.txt
+++ b/share/README.txt
@@ -4,7 +4,7 @@
* *
* Check this: https://tcrf.net/Proto:Minesweeper_(Windows,_1990) *
******************************************************************************
- * mine_sweeper Copyright (C) 2015 Alejandro Colomar Andrés *
+ * mine-sweeper Copyright (C) 2015 Alejandro Colomar Andrés *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -50,18 +50,22 @@ COMPILE:
INSTALL:
linux:
# make install
+ windows:
+ double click on SETUP.cmd
RUN:
linux:
- $ mine_sweeper
+ $ mine-sweeper
if it doesn't work:
- $ /usr/local/games/mine_sweeper
+ $ /usr/local/games/mine-sweeper
windows:
- double click on bin/mine_sweeper.exe
+ double click on bin/mine-sweeper.exe
UNINSTALL:
linux:
# make uninstall
+ windows:
+ double click on UNINSTALL.cmd
THE PROGRAM DOES:
diff --git a/share/USAGE.txt b/share/USAGE.txt
index 5ed5a99..152f108 100644
--- a/share/USAGE.txt
+++ b/share/USAGE.txt
@@ -1,8 +1,8 @@
- Usage: $ mine_sweeper [--exit] [--help] [--license] [--usage]
+ Usage: $ mine-sweeper [--exit] [--help] [--license] [--usage]
[--verbose=LEVEL] [--version]
[--rows=ROWS] [--columns=COLS] [--file=FILE]
[--iface=IFACE] [--proportion=PROPORTION]
[--rand-seed=SEED] [--start=START_MODE]
- Type '$ mine_sweeper --help' for a full description.
+ Type '$ mine-sweeper --help' for a full description.