chiark / gitweb /
First-draft Debian packaging implementation.
authorSimon Tatham <anakin@pobox.com>
Sat, 16 Jan 2021 14:31:48 +0000 (14:31 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 18 Jan 2021 21:25:14 +0000 (21:25 +0000)
I've split up the installed files into three packages. Following the
upstream names of the binaries, the package 'chroma' contains the
graphical SDL version of the game, and 'chroma-curses' contains the
terminal-based version. They're in separate packages so that each one
can avoid the library dependencies of the other.

The shared data between the two (mostly level designs) lives in a
third package 'chroma-data'. But not all the stuff upstream installs
in /usr/share/chroma goes in there: the SVG graphics used only by the
SDL binary can live in the 'chroma' package.

Upstream's makefile installs binaries in /usr/bin; per Debian policy,
the packaging moves them to /usr/games.

An icon for the .desktop file is constructed from one of the SVGs in
the upstream tarball, but because that SVG contains two images side by
side, I had to provide a small Python script that extracts just one of
them (and then passes it to Inkscape to render into a PNG).

13 files changed:
.gitignore [new file with mode: 0644]
Makefile.in
debian/.gitignore [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/chroma-curses.install [new file with mode: 0755]
debian/chroma-data.install [new file with mode: 0755]
debian/chroma.desktop [new file with mode: 0644]
debian/chroma.install [new file with mode: 0755]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/make-debian-icons.py [new file with mode: 0755]
debian/not-installed [new file with mode: 0644]
debian/rules [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..319fc5c
--- /dev/null
@@ -0,0 +1,10 @@
+# Downstream .gitignore added for Debian packaging repository
+/autom4te.cache
+/config.log
+/config.status
+/chroma
+/chroma-curses
+/resources/icon.png
+/resources/icon.svg
+/Makefile
+*.o
index ec589daa7999146dfdcf6d2d6ccf4e8b8fdf139b..6b28e45153a2bf6d395b3385886a282bd2171bdf 100644 (file)
@@ -41,7 +41,7 @@ install: @TARGETSINSTALL@
        done
        for datafile in colours/* help/* levels/* levels/*/* locale/* locale/*/* locale/*/*/*; do \
        if [ -f $$datafile ]; then \
-       ${INSTALL} $$datafile $(DESTDIR)$(datadir)/chroma/$$datafile; \
+       ${INSTALL} -m 0644 $$datafile $(DESTDIR)$(datadir)/chroma/$$datafile; \
        fi; \
        done
 
@@ -59,6 +59,6 @@ install-sdl:
        done
        for datafile in graphics/* graphics/*/*; do \
         if [ -f $$datafile ]; then \
-        ${INSTALL} $$datafile $(DESTDIR)$(datadir)/chroma/$$datafile; \
+        ${INSTALL} -m 0644 $$datafile $(DESTDIR)$(datadir)/chroma/$$datafile; \
         fi; \
         done
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644 (file)
index 0000000..05e7d9f
--- /dev/null
@@ -0,0 +1,11 @@
+/.debhelper
+/tmp
+/chroma-curses
+/chroma-data
+/chroma
+*.debhelper.log
+*.substvars
+/autoreconf.before
+/autoreconf.after
+/files
+/debhelper-build-stamp
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..0743687
--- /dev/null
@@ -0,0 +1,5 @@
+chroma (1.18-1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Simon Tatham <anakin@pobox.com>  Sat, 16 Jan 2021 14:31:43 +0000
diff --git a/debian/chroma-curses.install b/debian/chroma-curses.install
new file mode 100755 (executable)
index 0000000..e3749e0
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/dh-exec
+usr/games/chroma-curses
+usr/share/chroma/help/README usr/share/doc/chroma-curses
+debian/copyright usr/share/doc/chroma-curses
diff --git a/debian/chroma-data.install b/debian/chroma-data.install
new file mode 100755 (executable)
index 0000000..fe07f24
--- /dev/null
@@ -0,0 +1,6 @@
+#!/usr/bin/dh-exec
+usr/share/chroma/colours
+usr/share/chroma/help
+usr/share/chroma/levels
+usr/share/chroma/locale
+debian/copyright usr/share/doc/chroma-data
diff --git a/debian/chroma.desktop b/debian/chroma.desktop
new file mode 100644 (file)
index 0000000..c80f649
--- /dev/null
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Chroma
+Comment=Puzzle game similar to "XOR"
+Exec=/usr/games/chroma
+Icon=chroma
+Terminal=false
+Type=Application
+Categories=Game;LogicGame;
+StartupNotify=true
diff --git a/debian/chroma.install b/debian/chroma.install
new file mode 100755 (executable)
index 0000000..0184cbd
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/dh-exec
+usr/games/chroma
+resources/icon.svg => usr/share/pixmaps/chroma.svg
+resources/icon.png => usr/share/pixmaps/chroma.png
+debian/chroma.desktop usr/share/applications
+usr/share/chroma/graphics/*.chroma
+usr/share/chroma/graphics/chroma-*
+usr/share/chroma/help/README usr/share/doc/chroma
+debian/copyright usr/share/doc/chroma
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..9ee1c19
--- /dev/null
@@ -0,0 +1,61 @@
+Source: chroma
+Maintainer: Simon Tatham <anakin@pobox.com>
+Section: games
+Priority: optional
+Build-Depends: debhelper-compat (= 12),
+               imagemagick,
+               inkscape,
+               libfreetype-dev,
+               libncurses5-dev,
+               libsdl2-dev,
+               netpbm,
+               pngcrush,
+               python3
+Standards-Version: 4.5.1.0
+Homepage: http://level7.org.uk/chroma/
+Rules-Requires-Root: no
+
+Package: chroma-data
+Architecture: all
+Description: Abstract puzzle game - data files
+ This package contains architecture-independent data shared between
+ the graphical and terminal versions of Chroma, such as the level
+ designs and help.
+ .
+ This package is not intended to be installed directly. It is a
+ dependency of the 'chroma' and 'chroma-curses' packages.
+
+Package: chroma-curses
+Architecture: any
+Depends: ${misc:Depends},
+         ${shlibs:Depends},
+         chroma-data
+Description: Abstract puzzle game - terminal version
+ Chroma is an abstract puzzle game. A variety of colourful shapes are
+ arranged in a series of increasingly complex patterns, forming
+ fiendish traps that must be disarmed and mysterious puzzles that must
+ be manipulated in order to give up their subtle secrets. Initially so
+ straightforward that anyone can pick it up and begin to play, yet
+ gradually becoming difficult enough to tax even the brightest of
+ minds. Have you got what it takes to solve Chroma?
+ .
+ A graphical version of this game is available in the 'chroma'
+ package.
+
+Package: chroma
+Architecture: any
+Depends: ${misc:Depends},
+         ${shlibs:Depends},
+         chroma-data,
+         fonts-dejavu-core
+Description: Abstract puzzle game - graphical version
+ Chroma is an abstract puzzle game. A variety of colourful shapes are
+ arranged in a series of increasingly complex patterns, forming
+ fiendish traps that must be disarmed and mysterious puzzles that must
+ be manipulated in order to give up their subtle secrets. Initially so
+ straightforward that anyone can pick it up and begin to play, yet
+ gradually becoming difficult enough to tax even the brightest of
+ minds. Have you got what it takes to solve Chroma?
+ .
+ A terminal-based version of this game is available in the 'chroma'
+ package.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..added97
--- /dev/null
@@ -0,0 +1,130 @@
+This package was Debianized by Simon Tatham <anakin@pobox.com> on
+Sat, 16 Jan 2021 17:33:36 +0000.
+
+It was downloaded from <http://level7.org.uk/chroma/>.
+
+The Debian packaging and Debianization changes are copyright 2021
+Simon Tatham, and under the same license as the upstream source they
+apply to.
+
+Copyright:
+
+  Chroma is Copyright (C) 2010-2021 Amf
+
+  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
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program 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.
+
+The GPL may be found in /usr/share/common-licenses/GPL on a Debian system.
+
+The upstream source archive also includes a copy of the font DejaVu
+Sans. This is omitted from the binary packages, which instead refer to
+the copy in fonts-dejavu-core.
+
+Copyright for the font in the source archive:
+
+  Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
+  Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
+
+  Bitstream Vera Fonts Copyright
+  ------------------------------
+
+  Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
+  a trademark of Bitstream, Inc.
+
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of the fonts accompanying this license ("Fonts") and associated
+  documentation files (the "Font Software"), to reproduce and distribute the
+  Font Software, including without limitation the rights to use, copy, merge,
+  publish, distribute, and/or sell copies of the Font Software, and to permit
+  persons to whom the Font Software is furnished to do so, subject to the
+  following conditions:
+
+  The above copyright and trademark notices and this permission notice shall
+  be included in all copies of one or more of the Font Software typefaces.
+
+  The Font Software may be modified, altered, or added to, and in particular
+  the designs of glyphs or characters in the Fonts may be modified and
+  additional glyphs or characters may be added to the Fonts, only if the fonts
+  are renamed to names not containing either the words "Bitstream" or the word
+  "Vera".
+
+  This License becomes null and void to the extent applicable to Fonts or Font
+  Software that has been modified and is distributed under the "Bitstream
+  Vera" names.
+
+  The Font Software may be sold as part of a larger software package but no
+  copy of one or more of the Font Software typefaces may be sold by itself.
+
+  THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+  OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
+  TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
+  FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
+  ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+  THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
+  FONT SOFTWARE.
+
+  Except as contained in this notice, the names of Gnome, the Gnome
+  Foundation, and Bitstream Inc., shall not be used in advertising or
+  otherwise to promote the sale, use or other dealings in this Font Software
+  without prior written authorization from the Gnome Foundation or Bitstream
+  Inc., respectively. For further information, contact: fonts at gnome dot
+  org.
+
+  Arev Fonts Copyright
+  ------------------------------
+
+  Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
+
+  Permission is hereby granted, free of charge, to any person obtaining
+  a copy of the fonts accompanying this license ("Fonts") and
+  associated documentation files (the "Font Software"), to reproduce
+  and distribute the modifications to the Bitstream Vera Font Software,
+  including without limitation the rights to use, copy, merge, publish,
+  distribute, and/or sell copies of the Font Software, and to permit
+  persons to whom the Font Software is furnished to do so, subject to
+  the following conditions:
+
+  The above copyright and trademark notices and this permission notice
+  shall be included in all copies of one or more of the Font Software
+  typefaces.
+
+  The Font Software may be modified, altered, or added to, and in
+  particular the designs of glyphs or characters in the Fonts may be
+  modified and additional glyphs or characters may be added to the
+  Fonts, only if the fonts are renamed to names not containing either
+  the words "Tavmjong Bah" or the word "Arev".
+
+  This License becomes null and void to the extent applicable to Fonts
+  or Font Software that has been modified and is distributed under the
+  "Tavmjong Bah Arev" names.
+
+  The Font Software may be sold as part of a larger software package but
+  no copy of one or more of the Font Software typefaces may be sold by
+  itself.
+
+  THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+  OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+  TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+  DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+  OTHER DEALINGS IN THE FONT SOFTWARE.
+
+  Except as contained in this notice, the name of Tavmjong Bah shall not
+  be used in advertising or otherwise to promote the sale, use or other
+  dealings in this Font Software without prior written authorization
+  from Tavmjong Bah. For further information, contact: tavmjong @ free
+  . fr.
+
+  $Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
diff --git a/debian/make-debian-icons.py b/debian/make-debian-icons.py
new file mode 100755 (executable)
index 0000000..935424b
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+import subprocess
+import xml.etree.ElementTree as ET
+
+tree = ET.parse('icons.svg')
+root = tree.getroot()
+
+root.attrib['width'] = root.attrib['height']
+
+for elt in list(root):
+    if elt.tag == '{http://www.w3.org/2000/svg}g' and elt.attrib['id'] == 'curses icon':
+        root.remove(elt)
+    if elt.tag == '{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}namedview':
+        elt.attrib['width'] = elt.attrib['height']
+
+tree.write('icon.svg')
+
+subprocess.check_call(["inkscape","-e","icon.png","icon.svg"])
diff --git a/debian/not-installed b/debian/not-installed
new file mode 100644 (file)
index 0000000..47b1929
--- /dev/null
@@ -0,0 +1,3 @@
+usr/share/chroma/graphics/icon.png
+usr/share/chroma/graphics/font.ttf
+usr/share/chroma/graphics/font.txt
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..f64a235
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+%:
+       dh $@
+
+override_dh_auto_configure:
+       dh_auto_configure -- --bindir=/usr/games
+
+override_dh_auto_build-arch:
+       dh_auto_build
+       cd resources && ./make-graphics.sh
+       cd resources && ../debian/make-debian-icons.py