[gnome-games] sudoku: reduce autogenerated python files



commit a7101c530119066f95a448d351c1ed70963cad4a
Author: John Stowers <john stowers gmail com>
Date:   Tue May 24 17:46:16 2011 +1200

    sudoku: reduce autogenerated python files
    
    	* No need to transform gnome-sudoku.in.in and
    	  defaults.in just for @prefix@ and @VERSION   Add
    	  a defs.py.in containing just these and use it instead
    	* Clean up gnome-sudoku and defaults.py subsequently

 configure.in                        |    3 +-
 gnome-sudoku/src/Makefile.am        |    4 --
 gnome-sudoku/src/gnome-sudoku       |   23 ++++++++++++
 gnome-sudoku/src/gnome-sudoku.in.in |   67 -----------------------------------
 gnome-sudoku/src/lib/Makefile.am    |    3 +-
 gnome-sudoku/src/lib/defaults.py.in |   56 -----------------------------
 gnome-sudoku/src/lib/defs.py.in     |    2 +
 7 files changed, 28 insertions(+), 130 deletions(-)
---
diff --git a/configure.in b/configure.in
index 86e97ee..9a39f29 100644
--- a/configure.in
+++ b/configure.in
@@ -891,10 +891,9 @@ glchess/gnuchess/Makefile
 glchess/help/Makefile
 glchess/src/Makefile
 gnome-sudoku/Makefile
-gnome-sudoku/src/gnome-sudoku.in
 gnome-sudoku/src/Makefile
 gnome-sudoku/src/lib/Makefile
-gnome-sudoku/src/lib/defaults.py
+gnome-sudoku/src/lib/defs.py
 gnome-sudoku/src/lib/gtk_goodies/Makefile
 gnome-sudoku/data/Makefile
 gnome-sudoku/images/Makefile
diff --git a/gnome-sudoku/src/Makefile.am b/gnome-sudoku/src/Makefile.am
index cb34ee0..4f78e5a 100644
--- a/gnome-sudoku/src/Makefile.am
+++ b/gnome-sudoku/src/Makefile.am
@@ -4,9 +4,5 @@ SUBDIRS = lib
 
 ## Executable
 bin_SCRIPTS = gnome-sudoku
-CLEANFILES  = gnome-sudoku gnome-sudoku.in
-
-gnome-sudoku: gnome-sudoku.in
-	$(AM_V_GEN) cp gnome-sudoku.in $@ && chmod u+x $@
 
 -include $(top_srcdir)/git.mk
diff --git a/gnome-sudoku/src/gnome-sudoku b/gnome-sudoku/src/gnome-sudoku
new file mode 100755
index 0000000..69e10be
--- /dev/null
+++ b/gnome-sudoku/src/gnome-sudoku
@@ -0,0 +1,23 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# GNOME Sudoku is a simple sudoku generator and player. Sudoku is a
+# japanese logic puzzle.
+#
+# Copyright (c) 2005 Tom Hinkle You may use and distribute this
+# software under the terms of the GNU General Public License, version
+# 2 or later.
+
+try:
+    import bugbuddy
+    bugbuddy.install('gnome-sudoku')
+except:
+    pass
+
+try:
+    # Import gnome-sudoku module from source distribution.
+    from lib.gnome_sudoku import start_game
+except ImportError:
+    from gnome_sudoku.gnome_sudoku import start_game
+
+start_game()
diff --git a/gnome-sudoku/src/lib/Makefile.am b/gnome-sudoku/src/lib/Makefile.am
index 7af3df4..53e7846 100644
--- a/gnome-sudoku/src/lib/Makefile.am
+++ b/gnome-sudoku/src/lib/Makefile.am
@@ -3,12 +3,13 @@ SUBDIRS = gtk_goodies
 # Don't distribute generated defaults.py. If you know a simpler way that works
 # e.g. nodist_gnomesudoku_PYTHON=defaults.py then please fix this
 dist-hook:
-	rm $(distdir)/defaults.py
+	rm $(distdir)/defs.py
 
 gnomesudokudir = $(pythondir)/gnome_sudoku
 gnomesudoku_PYTHON = \
 	colors.py	\
 	dancer.py	\
+	defs.py	\
 	defaults.py	\
 	dialog_swallower.py	\
 	game_selector.py	\
diff --git a/gnome-sudoku/src/lib/defs.py.in b/gnome-sudoku/src/lib/defs.py.in
new file mode 100644
index 0000000..642d7df
--- /dev/null
+++ b/gnome-sudoku/src/lib/defs.py.in
@@ -0,0 +1,2 @@
+PREFIX = "@prefix@"
+VERSION = "@VERSION@"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]