--- pathological-1.1.3.orig/Makefile +++ pathological-1.1.3/Makefile @@ -2,59 +2,60 @@ DATADIR = $(DESTDIR)/usr/share/games/pathological -all: write-highscores html/wheel.png +all: write-highscores docs write-highscores: write-highscores.c gcc -s -o write-highscores write-highscores.c +docs: html/wheel.png html/wheel.png: ./makehtml -install: all - mkdir -p $(DATADIR) - cp pathological.py $(DATADIR)/ - cp -r circuits graphics music sounds $(DATADIR)/ +install: install-dep install-indep install-scores + +# Install architecture-independent data +install-indep: + install -d $(DATADIR) + install -D -m 755 pathological.py $(DATADIR)/pathological.py + cp -r circuits graphics sounds $(DATADIR)/ rm -f $(DATADIR)/graphics/*.xcf rm -f $(DATADIR)/sounds/*.orig - mkdir -p $(DESTDIR)/usr/games - cp pathological $(DESTDIR)/usr/games/ - - mkdir -p $(DESTDIR)/usr/lib/pathological/bin - cp write-highscores $(DESTDIR)/usr/lib/pathological/bin - - # The following changes should also be performed in a post-install script - -chgrp games $(DESTDIR)/usr/lib/pathological/bin/write-highscores - -chmod 2755 $(DESTDIR)/usr/lib/pathological/bin/write-highscores + install -D -m 755 pathological $(DESTDIR)/usr/games/pathological - mkdir -p $(DESTDIR)/usr/X11R6/include/X11/pixmaps - cp pathological.xpm $(DESTDIR)/usr/X11R6/include/X11/pixmaps + zcat pathological.6.gz > pathological.6 + install -D -m 644 pathological.6 $(DESTDIR)/usr/share/man/man6/pathological.6 - mkdir -p $(DESTDIR)/var/games - cp pathological_scores $(DESTDIR)/var/games - - # The following changes should also be performed in a post-install script - -chgrp games $(DESTDIR)/var/games/pathological_scores - -chmod 664 $(DESTDIR)/var/games/pathological_scores + install -d $(DESTDIR)/usr/share/doc/pathological + cp -r html $(DESTDIR)/usr/share/doc/pathological - mkdir -p $(DESTDIR)/usr/share/man/man6 - cp pathological.6.gz $(DESTDIR)/usr/share/man/man6 + install -D -m 644 pathological.xpm $(DESTDIR)/usr/share/pixmaps/pathological.xpm - mkdir -p $(DESTDIR)/usr/share/doc/pathological - cp -r html $(DESTDIR)/usr/share/doc/pathological +# Install architecture-dependent data +install-dep: + install -d $(DESTDIR)/var/games + install -D -m 2755 --owner=root --group=games write-highscores $(DESTDIR)/usr/lib/games/pathological/bin/write-highscores + +# Install the scores file, if it doesn't already exist. +install-scores: + if [ ! -e $(DESTDIR)/var/games/pathological_scores ]; then \ + install -D -m 644 pathological_scores $(DESTDIR)/var/games/pathological_scores; \ + fi uninstall: rm -rf $(DATADIR) - rm -rf $(DESTDIR)/usr/lib/pathological + rm -rf $(DESTDIR)/usr/lib/games/pathological rm -f $(DESTDIR)/usr/games/pathological - rm -f $(DESTDIR)/usr/X11R6/include/X11/pixmaps/pathological.xpm + rm -f $(DESTDIR)/usr/share/pixmaps/pathological.xpm rm -f $(DESTDIR)/usr/share/man/man6/pathological.6.gz purge: uninstall rm -f $(DESTDIR)/var/games/pathological_scores empty: distclean +distclean: clean -distclean: +clean: rm -f write-highscores rm -f html/*.png + rm -f pathological.6 --- pathological-1.1.3.orig/pathological.py +++ pathological-1.1.3/pathological.py @@ -1,6 +1,8 @@ #!/usr/bin/python +# -*- coding: iso-8859-1 -*- """ Copyright (C) 2003 John-Paul Gignac + (C) 2004 Joe Wreschnig 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 @@ -22,7 +24,7 @@ from pygame.locals import * # Parse the command line -highscores_file = "pathological_scores" +highscores_file = os.path.join(os.environ["HOME"], ".pathological_scores") screenshot = 0 fullscreen = 0 colorblind = 0 @@ -51,7 +53,7 @@ # The location of the setgid script for writing highscores # This script is only used if the highscores file is not writable directly -write_highscores = "/usr/lib/pathological/bin/write-highscores" +write_highscores = "/usr/lib/games/pathological/bin/write-highscores" # Game constants wheel_steps = 9 @@ -1562,7 +1564,7 @@ pygame.display.update( popup_rc[1]) class Game: - def __init__(self, screen, circuit, highscores): + def __init__(self, screen, circuit, highscores, level = 0): self.screen = screen self.circuit = circuit self.highscores = highscores @@ -1578,7 +1580,7 @@ f.close() self.numlevels = j / vert_tiles - self.level = 0 + self.level = level self.score = 0 self.lives = initial_lives @@ -1829,6 +1831,7 @@ class IntroScreen: menu = ("Start Game", "High Scores", "Fullscreen:", "Music:", "Sound Effects:", "Quit Game") + start_level = 1 menu_width = 240 menu_pos = ((800 - menu_width)/2, 145) menu_font_height = 32 @@ -1914,6 +1917,14 @@ self.screen.blit( menu_option, (self.menu_pos[0], y)) y += self.menu_font_height + levelt = self.menu_font.render("(Lvl. %d)" % + IntroScreen.start_level, + 1, self.menu_color) + lt_r = levelt.get_rect() + lt_r.right = self.menu_pos[0] + self.menu_option_left + 40 + lt_r.top = self.menu_pos[1] + self.screen.blit(levelt, lt_r) + if fullscreen: offon = 'On' else: offon = 'Off' offon = self.menu_font.render( offon, 1, self.menu_color) @@ -1966,6 +1977,15 @@ self.curpage = 1 self.draw_menu() + def inc_level(self): + if (IntroScreen.start_level < + max([s[2] for s in self.highscores.scores])): + IntroScreen.start_level += 1 + + def dec_level(self): + if IntroScreen.start_level > 1: + IntroScreen.start_level -= 1 + def do(self, show_highscores=0): self.scroller_pos = -self.scroller_rect[2] @@ -2028,7 +2048,15 @@ self.draw_menu() elif event.key == K_SPACE or event.key == K_RETURN: rc = self.menu_select( self.menu_cursor) - if rc < 1: return rc + if rc: return rc + elif event.key == K_LEFT: + if self.menu_cursor == 0: + self.dec_level() + self.draw_menu() + elif event.key == K_RIGHT: + if self.menu_cursor == 0: + self.inc_level() + self.draw_menu() continue elif event.type is MOUSEBUTTONDOWN: if self.curpage == 1: @@ -2044,9 +2072,8 @@ if pos[1] < self.menu_pos[1]: continue i = (pos[1] - self.menu_pos[1]) / self.menu_font_height if i >= len(self.menu): continue - rc = self.menu_select( i) - if rc < 1: return rc + if rc: return rc pygame.display.update( self.dirty_rects) @@ -2057,7 +2084,7 @@ # 1 - Unknown option def menu_select( self, i): if i == 0: - return 0 + return IntroScreen.start_level elif i == 1: play_sound( menu_select) self.go_to_highscores() @@ -2075,7 +2102,7 @@ self.draw_menu() elif i == 5: return -1 - return 1 + return 0 hs_font_height = 24 hs_width = 320 @@ -2157,7 +2184,15 @@ pygame.mixer.pre_init(44100,-16,1,4096) # Initialize the game module - pygame.init() + pygame.display.init() + try: + pygame.mixer.init() + except: + print "error on pygame.mixer.init() inside setup_everything():" + print sys.exc_info()[0],":",sys.exc_info()[1] + print "...ignoring it" + pygame.font.init() + pygame.key.set_repeat(500, 30) if not pygame.font: print 'Warning, fonts disabled' if not pygame.mixer: print 'Warning, sound disabled' @@ -2189,7 +2224,8 @@ if rc < 0: break # Handle the QUIT message - game = Game(screen, 'all-boards', highscores) + # If rc is positive, it's a level. + game = Game(screen, 'all-boards', highscores, rc - 1) show_highscores = 1 --- pathological-1.1.3.orig/pathological +++ pathological-1.1.3/pathological @@ -32,8 +32,4 @@ cd /usr/share/games/pathological -if [ -z "$scoresfile" ]; then - scoresfile=/var/games/pathological_scores -fi - -exec ./pathological.py $options $scoresfile +exec ./pathological.py $options --- pathological-1.1.3.orig/debian/README.Debian +++ pathological-1.1.3/debian/README.Debian @@ -0,0 +1,6 @@ +write-highscores +---------------- +Normally, pathological comes with a small score writer program, that is +installed setgid. Since there is some debate at this time (Aug 01 2003) on +debian-devel as to how to properly handle packages like this, Pathological +in Debian currently only writes scores to your home directory. --- pathological-1.1.3.orig/debian/pathological.desktop +++ pathological-1.1.3/debian/pathological.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=Pathological +Icon=pathological.xpm +GenericName=A puzzle game involving paths and marbles +Exec=pathological +Categories=Game;LogicGame; --- pathological-1.1.3.orig/debian/changelog +++ pathological-1.1.3/debian/changelog @@ -0,0 +1,70 @@ +pathological (1.1.3-8ubuntu1) feisty; urgency=low + + * Re-sync with Debian. Kept changes: + * pathological.py Add exception handling for pygame.mixer.init() + - Thanks to Paul Dufresne for the patch + * Fix .desktop file to validate + + -- Barry deFreese Fri, 12 Jan 2007 22:39:06 -0500 + +pathological (1.1.3-8) unstable; urgency=low + + * placing new adress of FSF in debian/copyright + + -- Alexander Schmehl Fri, 12 Jan 2007 18:24:50 +0100 + +pathological (1.1.3-7) unstable; urgency=low + + * New Maintainer: Debian Games Team (Closes: #388358) + * Adding Homepage header to package description + + -- Alexander Schmehl Fri, 12 Jan 2007 18:01:07 +0100 + +pathological (1.1.3-6) unstable; urgency=low + + * Fix mouse handling in menus. Sorry I took so long to do this. + (Closes: #311432) + + -- Joe Wreschnig Tue, 21 Jun 2005 10:45:11 -0500 + +pathological (1.1.3-5) unstable; urgency=low + + * Patch main menu to allow initial level selection, up to the + highest level you have beaten. (Closes: #257876) + * Initialize display, mixer, font individually. (Closes: #269684) + + -- Joe Wreschnig Thu, 23 Sep 2004 21:39:12 -0500 + +pathological (1.1.3-4) unstable; urgency=low + + * Remove pathological-score-related cruft in debian/. + * Add an fd.o .desktop entry. (Closes: #235860) + * Add an encoding string to pathological.py. (Closes: #217116) + * Quote the section and environment in the menu file. + + -- Joe Wreschnig Fri, 01 Aug 2003 14:46:15 -0500 + +pathological (1.1.3-3) unstable; urgency=low + + * On second thought, remove the setgid program altogether, and only + write to the users' high score file, based on discussions about + things I'm probably doing wrong on d-devel. + + -- Joe Wreschnig Fri, 01 Aug 2003 14:46:15 -0500 + +pathological (1.1.3-2) unstable; urgency=low + + * Fix the short description. (Closes: #203480) + * Split off the music from the main package. (Closes: #203479) + * Add correct Build-Depends-Indep. + * Remove dh_python call (we don't use any of the compiled stuff.) + + -- Joe Wreschnig Wed, 30 Jul 2003 14:37:39 -0500 + +pathological (1.1.3-1) unstable; urgency=low + + * Initial Release. (Closes: #200178) + * Patch the upstream Makefile to separate the build rules, and use + install(1) instead of cp(1). + + -- Joe Wreschnig Sat, 19 Jul 2003 13:40:00 -0500 --- pathological-1.1.3.orig/debian/compat +++ pathological-1.1.3/debian/compat @@ -0,0 +1 @@ +4 --- pathological-1.1.3.orig/debian/pathological.docs +++ pathological-1.1.3/debian/pathological.docs @@ -0,0 +1,2 @@ +README +TODO --- pathological-1.1.3.orig/debian/pathological.menu +++ pathological-1.1.3/debian/pathological.menu @@ -0,0 +1,3 @@ +?package(pathological):needs="X11" section="Games/Puzzles"\ + title="Pathological" command="/usr/games/pathological"\ + icon="/usr/share/pixmaps/pathological.xpm" --- pathological-1.1.3.orig/debian/rules +++ pathological-1.1.3/debian/rules @@ -0,0 +1,66 @@ +#!/usr/bin/make -f +# Based off the dh_make template for multiple binary packages. +# Also based off John-Paul Gignac's original Pathological package for woody + +export DH_OPTIONS + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp + +build: + $(MAKE) docs + +clean: + dh_testdir + dh_testroot + rm -f configure-stamp + + -$(MAKE) clean + + dh_clean + +install: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install-indep DESTDIR=$(CURDIR)/debian/pathological + install -D -m 644 debian/pathological.desktop $(CURDIR)/debian/pathological//usr/share/applications/pathological.desktop + + dh_install + +# Build architecture independant packages using the common target. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs changelog + dh_installdocs + dh_installexamples + dh_installmenu + dh_installman + dh_shlibdeps + dh_link + dh_strip + dh_compress + #dh_fixperms -Xwrite-highscores + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure --- pathological-1.1.3.orig/debian/control +++ pathological-1.1.3/debian/control @@ -0,0 +1,20 @@ +Source: pathological +Section: games +Priority: optional +Maintainer: Debian Games Team +Uploaders: Alexander Schmehl +Build-Depends-Indep: debhelper (>> 4.0.0), netpbm +Standards-Version: 3.7.2 + +Package: pathological +Architecture: all +Depends: python, python-pygame, pathological-music +Conflicts: pathological-scores +Description: puzzle game involving paths and marbles + Pathological is an enriched clone of the game "Logical" by Rainbow Arts. + To solve a level, fill each wheel with four marbles of matching color. + Various board elements such as teleporters, switches, filters, etc., make + the game interesting and challenging. New levels can be created using your + favorite text editor. + . + Homepage: http://pathological.sourceforge.net/ --- pathological-1.1.3.orig/debian/copyright +++ pathological-1.1.3/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Joe Wreschnig on +Sat, 19 Jul 2003 13:40:00 -0500. + +The Debian Games Team took over maintenance of this package +on Fri, 12 Jan 2007 18:01:07 +0100. + +It was downloaded from http://pathological.sourceforge.net/ + +Copyright (C) 2003 John-Paul Gignac + +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. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'.