r4006 - in packages/trunk/sdmkun: . debian debian/patches

Miriam Ruiz baby-guest at alioth.debian.org
Thu Aug 30 18:50:51 UTC 2007


Author: baby-guest
Date: 2007-08-30 18:50:51 +0000 (Thu, 30 Aug 2007)
New Revision: 4006

Added:
   packages/trunk/sdmkun/debian/
   packages/trunk/sdmkun/debian/changelog
   packages/trunk/sdmkun/debian/compat
   packages/trunk/sdmkun/debian/control
   packages/trunk/sdmkun/debian/copyright
   packages/trunk/sdmkun/debian/docs
   packages/trunk/sdmkun/debian/install
   packages/trunk/sdmkun/debian/menu
   packages/trunk/sdmkun/debian/patches/
   packages/trunk/sdmkun/debian/patches/build.patch
   packages/trunk/sdmkun/debian/patches/directories.patch
   packages/trunk/sdmkun/debian/patches/series
   packages/trunk/sdmkun/debian/rules
Log:
[svn-inject] Applying Debian modifications to trunk


Property changes on: packages/trunk/sdmkun/debian
___________________________________________________________________
Name: mergeWithUpstream
   + 1

Added: packages/trunk/sdmkun/debian/changelog
===================================================================
--- packages/trunk/sdmkun/debian/changelog	                        (rev 0)
+++ packages/trunk/sdmkun/debian/changelog	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,5 @@
+sdmkun (1.5.8.dfsg1-1) unstable; urgency=low
+
+  * Initial release
+
+ -- Miriam Ruiz <little_miry at yahoo.es>  Sat, 25 Aug 2007 19:58:40 +0000

Added: packages/trunk/sdmkun/debian/compat
===================================================================
--- packages/trunk/sdmkun/debian/compat	                        (rev 0)
+++ packages/trunk/sdmkun/debian/compat	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1 @@
+5

Added: packages/trunk/sdmkun/debian/control
===================================================================
--- packages/trunk/sdmkun/debian/control	                        (rev 0)
+++ packages/trunk/sdmkun/debian/control	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,18 @@
+Source: sdmkun
+Section: games
+Priority: extra
+Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org> 
+Uploaders: Miriam Ruiz <little_miry at yahoo.es>
+Build-Depends: debhelper (>= 5), quilt, 
+ liblua50-dev, libbulletml-dev, libboost-dev,
+ libglu1-mesa-dev | libglu-dev, libgl1-mesa-dev | libgl-dev,
+ libsdl1.2-dev, libsdl-mixer1.2-dev
+Standards-Version: 3.7.2
+
+Package: sdmkun
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: shiroi danmakukun
+ Program to test the possibilities of BulletML.
+ .
+  Homepage: http://shinh.skr.jp/sdmkun/

Added: packages/trunk/sdmkun/debian/copyright
===================================================================
--- packages/trunk/sdmkun/debian/copyright	                        (rev 0)
+++ packages/trunk/sdmkun/debian/copyright	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,50 @@
+This package was debianized by Miriam Ruiz <little_miry at yahoo.es> on
+Sat, 25 Aug 2007 19:58:40 +0000.
+
+It was downloaded from http://shinh.skr.jp/sdmkun/
+
+Upstream Author: 
+
+    shinichiro.h <hamaji at nii.ac.jp> ( http://shinh.skr.jp/ )
+
+Copyright: 
+
+    Copyright (c) 2003  shinichiro.h <hamaji at nii.ac.jp>
+
+   compose.hpp and compose_ct.h: (C) 1999 Copyright Nicolai M. Josuttis
+
+
+License:
+
+    This package 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 package 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 package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+
+src/boost/compose.hpp and src/util/compose_ct.h:
+
+    The following code example is taken from the book
+    "The C++ Standard Library - A Tutorial and Reference"
+    by Nicolai M. Josuttis, Addison-Wesley, 1999
+
+    Permission to copy, use, modify, sell and distribute this software
+    is granted provided this copyright notice appears in all copies.
+    This software is provided "as is" without express or implied
+    warranty, and with no claim as to its suitability for any purpose.
+
+
+The Debian packaging is (C) 2007, Miriam Ruiz <little_miry at yahoo.es> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

Added: packages/trunk/sdmkun/debian/docs
===================================================================
--- packages/trunk/sdmkun/debian/docs	                        (rev 0)
+++ packages/trunk/sdmkun/debian/docs	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,3 @@
+README.en.txt
+README.txt
+

Added: packages/trunk/sdmkun/debian/install
===================================================================
--- packages/trunk/sdmkun/debian/install	                        (rev 0)
+++ packages/trunk/sdmkun/debian/install	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,13 @@
+src/sdmkun usr/games/
+bosses.d usr/share/games/sdmkun/
+bmp usr/share/games/sdmkun/
+data usr/share/games/sdmkun/
+fonts usr/share/games/sdmkun/
+inspection usr/share/games/sdmkun/
+model usr/share/games/sdmkun/
+replay usr/share/games/sdmkun/
+save usr/share/games/sdmkun/
+shots usr/share/games/sdmkun/
+user usr/share/games/sdmkun/
+#debian/*.xpm usr/share/pixmaps/
+#debian/*.desktop usr/share/applications/

Added: packages/trunk/sdmkun/debian/menu
===================================================================
--- packages/trunk/sdmkun/debian/menu	                        (rev 0)
+++ packages/trunk/sdmkun/debian/menu	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,2 @@
+?package(sdmkun):needs="X11" section="Games/Toys"\
+  title="shiroi danmakukun" command="/usr/games/sdmkun"

Added: packages/trunk/sdmkun/debian/patches/build.patch
===================================================================
--- packages/trunk/sdmkun/debian/patches/build.patch	                        (rev 0)
+++ packages/trunk/sdmkun/debian/patches/build.patch	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,109 @@
+# Copyright (C) 2007  Miriam Ruiz <little_miry at yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: sdmkun-1.5.8.dfsg1/src/Makefile
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/Makefile	2007-08-30 18:10:39.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/Makefile	2007-08-30 18:10:57.000000000 +0000
+@@ -1,45 +1,41 @@
+-INCLUDES += `sdl-config --cflags` -Iutil -Icpu -I. -Ilua-5.0/include
+-LIBS += `sdl-config --libs` SDL_kanji_f1b/SDL_kanji.o cpu/libcpu.a bulletml/libbulletml.a util/libutil.a lua-5.0/lib/*.a
+-#LIBS += -llua -llualib
++INCLUDES += `sdl-config --cflags` -Iutil -Icpu -I. -I/usr/include/lua50
++LIBS += SDL_kanji_f1b/SDL_kanji.o cpu/libcpu.a util/libutil.a bulletml/libbulletml.a
++LIBS += `sdl-config --libs`
++LIBS += -lbulletml
++LIBS += -llua50 -llualib50
+ #CXXFLAGS += -g -W -Wall
+ #CXXFLAGS := -pg -O -W -Wall
+ #CXXFLAGS = -O2 -W -Wall
+ #CXXFLAGS = -DNDEBUG -O2 -W -Wall -ffast-math
+ CXXFLAGS = -g -DNDEBUG -O2 -W -Wall -ffast-math
+ CFLAGS = -O2
+-SUBDIRS = cpu util bulletml SDL_kanji_f1b
++SUBDIRS = cpu util SDL_kanji_f1b
+ SOURCES=$(wildcard *.cc)
+ OBJS=$(SOURCES:.cc=.o)
++DEFINES = -DDATA_DIR=\"/usr/share/games/sdmkun/\"
+ 
+ MAKE_INCLUDES=`sdl-config --cflags` -I.. -I../util
+ 
+-MAKE_WITH="CXXFLAGS=$(CXXFLAGS)" "CFLAGS=$(CFLAGS)" "INCLUDES=$(MAKE_INCLUDES)"
++MAKE_WITH=CXXFLAGS="$(CXXFLAGS)" CFLAGS="$(CFLAGS)" INCLUDES="$(MAKE_INCLUDES)" DEFINES='$(DEFINES)'
+ 
+ all: sdmkun
+ 
+ sdmkun: subdir $(OBJS)
+ 	$(CXX) -o sdmkun $(OBJS) $(LIBS) $(CXXFLAGS) $(INCLUDES)
+ 
+-lua_config: lua-5.0/Makefile
+-
+-lua-5.0/Makefile:
+-	cd lua-5.0; ./configure
+-
+-subdir: lua_config
+-	$(MAKE) -C lua-5.0
++subdir:
+ 	$(MAKE) -C util $(MAKE_WITH)
+ 	$(MAKE) -C bulletml $(MAKE_WITH)
+ 	$(MAKE) -C cpu $(MAKE_WITH)
+ 	$(MAKE) -C SDL_kanji_f1b $(MAKE_WITH)
+ 
+ %.o:%.cc
+-	$(CXX) -c $(CXXFLAGS) $(INCLUDES) $<
++	$(CXX) -c $(CXXFLAGS) $(INCLUDES) $(DEFINES) $<
+ 
+-clean: lua_config
+-	$(MAKE) clean -C lua-5.0
++clean:
+ 	$(MAKE) clean -C util
+-	$(MAKE) clean -C bulletml
+ 	$(MAKE) clean -C cpu
++	$(MAKE) clean -C bulletml
+ 	$(MAKE) clean -C SDL_kanji_f1b
+ 	rm -f $(OBJS) sdmkun
+ 
+Index: sdmkun-1.5.8.dfsg1/src/select.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/select.cc	2007-08-30 18:10:39.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/select.cc	2007-08-30 18:11:54.000000000 +0000
+@@ -9,6 +9,7 @@
+ #include <boost/lexical_cast.hpp>
+ #include <boost/functional.hpp>
+ #include <boost/ref.hpp>
++#include <boost/archive/iterators/istream_iterator.hpp>
+ 
+ #include <compose_ct.h>
+ 
+@@ -677,8 +678,8 @@
+ 	const Rect& r4 = Screen::PLAYERINFO_FRAME;
+ 	screen_->fillRect(Rect(r4.x()+RECMARGIN,r4.y()+RECMARGIN,
+ 						   r4.x2()-RECMARGIN,r4.y2()-RECMARGIN), Color::BLACK);
+-	int come = info->getCome();
+-	int damage = info->getDamage();
++	/*int come =*/ info->getCome();
++	/*int damage =*/ info->getDamage();
+ 	int success = info->getSuccessPer();
+ 	int rank = info->getLimit();
+ 	std::vector<std::string> strs;
+Index: sdmkun-1.5.8.dfsg1/src/cpu/Makefile
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/cpu/Makefile	2007-08-30 18:10:39.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/cpu/Makefile	2007-08-30 18:10:57.000000000 +0000
+@@ -5,6 +5,7 @@
+ SOURCES=$(wildcard *.cc)
+ OBJS=$(SOURCES:.cc=.o)
+ TARGET=libcpu.a
++DEFINES = 
+ 
+ all: $(TARGET)
+ 
+@@ -13,7 +14,7 @@
+ 	$(RANLIB) $(TARGET)
+ 
+ %.o:%.cc
+-	$(CXX) -c $(CXXFLAGS) $(INCLUDES) $<
++	$(CXX) -c $(CXXFLAGS) $(INCLUDES) $(DEFINES) $<
+ 
+ clean:
+ 	rm -f $(OBJS) $(TARGET)

Added: packages/trunk/sdmkun/debian/patches/directories.patch
===================================================================
--- packages/trunk/sdmkun/debian/patches/directories.patch	                        (rev 0)
+++ packages/trunk/sdmkun/debian/patches/directories.patch	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,466 @@
+# Copyright (C) 2007  Miriam Ruiz <little_miry at yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: sdmkun-1.5.8.dfsg1/src/bulletinfo.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/bulletinfo.cc	2006-04-08 01:30:06.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/bulletinfo.cc	2007-08-30 18:32:15.000000000 +0000
+@@ -18,6 +18,11 @@
+ # include <dirent.h>
+ #endif
+ 
++#ifndef _WIN32
++#include <unistd.h>
++#include <sys/stat.h>
++#endif
++
+ namespace {
+ 	std::string bml_getline(std::istream& is, std::string errorMsg) {
+ 		std::string ret = my_getline(is);
+@@ -45,7 +50,15 @@
+ }
+ 
+ void BulletDescription::loadUserInfo(const std::string& userName) {
+-	std::ifstream is(("save/"+userName+file_+".dat").c_str());
++#ifndef _WIN32
++	char *home = getenv("HOME"); if (!home) home="/tmp";
++	std::string str(home);
++	str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	str += "/save"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	std::ifstream is((str+"/"+userName+file_+".dat").c_str());
++#else
++	std::ifstream is((DATA_DIR "save/"+userName+file_+".dat").c_str());
++#endif
+ 	if (is.is_open()) {
+ 		is >> come_ >> damage_ >> limit_;
+ 	}
+@@ -55,7 +68,15 @@
+ }
+ 
+ void BulletDescription::saveUserInfo(const std::string& userName) const {
+-	std::ofstream os(("save/"+userName+file_+".dat").c_str());
++#ifndef _WIN32
++	char *home = getenv("HOME"); if (!home) home="/tmp";
++	std::string str(home);
++	str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	str += "/save"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	std::ofstream os((str+"/"+userName+file_+".dat").c_str());
++#else
++	std::ofstream os((DATA_DIR "save/"+userName+file_+".dat").c_str());
++#endif
+ 	os << come_ << std::endl
+ 	   << damage_ << std::endl
+ 	   << limit_ << std::endl;
+@@ -82,10 +103,10 @@
+ 	}
+ 	else {
+ #ifdef HAVE_LUA
+-		if (lua_) return "bosses.d/" + file() + ".lua";
++		if (lua_) return DATA_DIR "bosses.d/" + file() + ".lua";
+ 		else
+ #endif
+-			return "bosses.d/" + file() + ".xml";
++			return DATA_DIR "bosses.d/" + file() + ".xml";
+ 	}
+ }
+ 
+@@ -138,7 +159,15 @@
+ 				TiXmlElement* elem = node3->ToElement();
+ 				if (elem != 0) {
+ 					if (elem->Value() == "filename") {
+-						std::string fn = "user/" + get_text(elem) + ".bml";
++#ifndef _WIN32
++						char *home = getenv("HOME"); if (!home) home="/tmp";
++						std::string str(home);
++						str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++						str += "/user"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++						std::string fn = str + "/" + get_text(elem) + ".bml";
++#else
++						std::string fn = DATA_DIR "user/" + get_text(elem) + ".bml";
++#endif
+ 						if (fn != file_) {
+ 							std::cout << "rename " + file_ + " to " + fn
+ 									  << std::endl;
+@@ -253,7 +282,7 @@
+ #endif
+ 
+ 	if (file_ != "main" && !file_.empty()) {
+-		std::string bmp("shots/" + file_ + ".bmp");
++		std::string bmp(DATA_DIR "shots/" + file_ + ".bmp");
+ 		if (std::ifstream(bmp.c_str()).is_open()) {
+ 			hasShot_ = true;
+ 			if (Conf::instance()->preloadShots()) {
+@@ -266,7 +295,7 @@
+ 		}
+ 	}
+ 
+-	std::ifstream ifs(("inspection/" + file() + ".dat").c_str());
++	std::ifstream ifs((DATA_DIR "inspection/" + file() + ".dat").c_str());
+ 	if (ifs.is_open()) {
+ 		std::string dummy;
+ 		eval_ = true;
+@@ -281,8 +310,8 @@
+ GroupInfo::GroupInfo() {
+ 	static const int MAXBUF = 1000;
+ 
+-	std::ifstream is("data/groups.dat");
+-	check(is.is_open(), "data/groups.dat is not found.");
++	std::ifstream is(DATA_DIR "data/groups.dat");
++	check(is.is_open(), DATA_DIR "data/groups.dat is not found.");
+ 
+ 	while (!is.eof()) {
+ 		std::string sysname, name;
+@@ -303,8 +332,8 @@
+ }
+ 
+ BulletInfo::BulletInfo() {
+-	std::ifstream is("data/bosses.dat");
+-	check(is.is_open(), "data/bosses.dat is not found.");
++	std::ifstream is(DATA_DIR "data/bosses.dat");
++	check(is.is_open(), DATA_DIR "data/bosses.dat is not found.");
+ 
+ 	int i = 0;
+ 	while (!is.eof()) {
+@@ -334,10 +363,18 @@
+ 
+ #ifdef HAVE_DIRENT_H
+ 
+-	DIR* dir = opendir("user");
++	DIR* dir = opendir(DATA_DIR "user");
+ 	int j = 0;
+ 	while (dirent* d = readdir(dir)) {
+-		std::string name(std::string("user/") + d->d_name);
++#ifndef _WIN32
++		char *home = getenv("HOME"); if (!home) home="/tmp";
++		std::string str(home);
++		str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++		str += "/user"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++		std::string name(str + "/" + d->d_name);
++#else
++		std::string name(std::string(DATA_DIR "user/") + d->d_name);
++#endif
+ 
+ 		bool isXml = (name.find(".xml") == name.size() - 4 ||
+ 					  name.find(".lua") == name.size() - 4);
+Index: sdmkun-1.5.8.dfsg1/src/conf.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/conf.cc	2006-04-01 12:49:06.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/conf.cc	2007-08-30 18:32:15.000000000 +0000
+@@ -27,6 +27,11 @@
+ #include <getopt.h>
+ #endif
+ 
++#ifndef _WIN32
++#include <unistd.h>
++#include <sys/stat.h>
++#endif
++
+ const std::string Conf::nameCacheFile_("name.cache");
+ 
+ void Conf::saveNameCache(const std::string& str) const {
+@@ -242,7 +247,16 @@
+ 			std::string file;
+ 			if (slashIndex == std::string::npos) file = extraOption;
+ 			else file = extraOption.substr(slashIndex+1);
+-			std::string bmlfile("user/" + file);
++
++#ifndef _WIN32
++			char *home = getenv("HOME"); if (!home) home="/tmp";
++			std::string str(home);
++			str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++			str += "/user"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++			std::string bmlfile((str + "/" + file).c_str());
++#else
++			std::string bmlfile(DATA_DIR "user/" + file);
++#endif
+ 
+ 			if (bmlfile != extraOption) {
+ 				std::cout
+Index: sdmkun-1.5.8.dfsg1/src/conf.h
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/conf.h	2003-10-21 07:47:58.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/conf.h	2007-08-30 18:32:15.000000000 +0000
+@@ -65,7 +65,7 @@
+ 	bool isReplay() const { return replay_; }
+ 	const std::string& title() const { return title_; }
+ 	int humanConfidence() const { return humanConfidence_; }
+-	std::string bmpdir() const { return "bmp/" + skin_; }
++	std::string bmpdir() const { return DATA_DIR "bmp/" + skin_; }
+ 
+ private:
+     void loadName();
+Index: sdmkun-1.5.8.dfsg1/src/enemy.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/enemy.cc	2004-04-10 23:50:35.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/enemy.cc	2007-08-30 18:32:15.000000000 +0000
+@@ -111,8 +111,8 @@
+ 		parseActionFile(is);
+     }
+ 	else {
+-		std::ifstream is("bosses.d/main.act");
+-		check(is.is_open(), "bosses.d/main.act: action File not Found!\n");
++		std::ifstream is(DATA_DIR "bosses.d/main.act");
++		check(is.is_open(), DATA_DIR "bosses.d/main.act: action File not Found!\n");
+ 		parseActionFile(is);
+ 	}
+ }
+Index: sdmkun-1.5.8.dfsg1/src/game.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/game.cc	2004-07-22 10:40:23.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/game.cc	2007-08-30 18:32:15.000000000 +0000
+@@ -27,6 +27,11 @@
+ 
+ #include <SDL.h>
+ 
++#ifndef _WIN32
++#include <unistd.h>
++#include <sys/stat.h>
++#endif
++
+ const double Game::framePerSecond_ = 60.0 / 960.0;
+ 
+ int Game::getFrameTurn() const {
+@@ -144,8 +149,18 @@
+ 
+ 	joystickMgr_.reset(new MSDL::JoystickMgr);
+ 
++#ifndef _WIN32
++	char *home = getenv("HOME"); if (!home) home="/tmp";
++	std::string str(home);
++	str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	str += "/save"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+ 	inputMgr_.reset(
+-		MSDL::generateInputFromConf("save/key.conf").release());
++		MSDL::generateInputFromConf((str+"/key.conf").c_str()).release());
++
++#else
++	inputMgr_.reset(
++		MSDL::generateInputFromConf(DATA_DIR "save/key.conf").release());
++#endif
+ 
+ 	screen_ = new Screen;
+ 	Select select;
+@@ -154,9 +169,9 @@
+ //	switchScreenMode(!Conf::instance()->isFastMode());
+ 	screen_->printInformation(std::cout);
+ 
+-//	font_ = Kanji_OpenFont("fonts/K12-1.bdf", 12);
+-//	Kanji_AddFont(font_, "fonts/6x12.bdf");
+-	font_ = Kanji_OpenFont("fonts/K12-1_6x12.f1b", 12);
++//	font_ = Kanji_OpenFont(DATA_DIR "fonts/K12-1.bdf", 12);
++//	Kanji_AddFont(font_, DATA_DIR "fonts/6x12.bdf");
++	font_ = Kanji_OpenFont(DATA_DIR "fonts/K12-1_6x12.f1b", 12);
+ 	Kanji_SetCodingSystem(font_, KANJI_SJIS);
+ 
+ 	initBMP();
+Index: sdmkun-1.5.8.dfsg1/src/select.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/select.cc	2007-08-30 18:32:15.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/select.cc	2007-08-30 18:32:15.000000000 +0000
+@@ -21,13 +21,32 @@
+ // #include ‚µ‚È‚¯‚è‚á‚È‚ç‚ñ‚ÆŽv‚¤B
+ #include <ctype.h>
+ 
++#ifndef _WIN32
++#include <unistd.h>
++#include <sys/stat.h>
++#endif
++
++static const std::string getSaveDir()
++{
++#ifndef _WIN32
++	char *home = getenv("HOME"); if (!home) home="/tmp";
++	std::string str(home);
++	str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	str += "/save"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	return str + "/";
++#else
++	return str::string(DATA_DIR "save/");
++#endif
++
++}
++
+ size_t Select::zero = 0;
+ std::vector<std::string> Select::nullvec;
+ 
+ Select::Select(MSDL::InputBase& input)
+ 	: input_(&input), state_(TITLE), temporaryUse_(false)
+ {
+- 	std::ifstream is("save/score.dat");
++ 	std::ifstream is((getSaveDir()+"score.dat").c_str());
+  	std::string s;
+ 	int d;
+ 	int i;
+@@ -211,7 +230,7 @@
+ 	{
+ 		int bullet = getSizeFromMap(conf_, "bullet");
+ 		std::string pre =
+-			"model/" +
++			DATA_DIR "model/" +
+ 			Game::instance()->getBulletInfo()->descriptions()[bullet]->file();
+ 		startReplay(pre);
+ 	}
+@@ -220,7 +239,7 @@
+ void Select::loadConf() {
+ 	ConfMapGenerater cmg;
+ 	cmg.setReportDevice(std::cerr);
+-	cmg.generate("save/conf", conf_);
++	cmg.generate((getSaveDir()+"conf").c_str(), conf_);
+ 
+ }
+ 
+@@ -271,13 +290,13 @@
+ 		}
+ 
+ 		ConfMapGenerater cmg;
+-		cmg.save("save/conf", conf_);
++		cmg.save((getSaveDir()+"conf").c_str(), conf_);
+ 
+ 		if (state_ == END) setConf();
+ 	}
+ 
+ 	if (state_ == START_REPLAY) {
+-		std::string prefix = "replay/" + getStringFromMap(conf_, "replay_num");
++		std::string prefix = DATA_DIR "replay/" + getStringFromMap(conf_, "replay_num");
+ 		startReplay(prefix);
+ 		Game::instance()->getBulletInfo()->loadUserInfo(
+ 			getStringFromMap(conf_, "name"));
+@@ -523,7 +542,7 @@
+ 	while (name[name.size()-1] == ' ') name.erase(name.size()-1);
+ 	conf_["name"] = name;
+ 
+-	std::ifstream is("save/names");
++	std::ifstream is((getSaveDir()+"names").c_str());
+ 	while (!is.eof()) {
+ 		std::string n;
+ 		is >> n;
+@@ -531,7 +550,7 @@
+ 	}
+ 	is.close();
+ 
+-	std::ofstream os("save/names", std::ios::app);
++	std::ofstream os((getSaveDir()+"names").c_str(), std::ios::app);
+ 	os << name << std::endl;
+ }
+ 
+@@ -539,7 +558,7 @@
+ 	std::vector<std::string> strs, nums;
+ 	for (int i = 0; i < 10; i++) {
+ 		std::string numStr = boost::lexical_cast<std::string>(i);
+-		std::ifstream is(("replay/"+numStr+"-name.dat").c_str());
++		std::ifstream is((DATA_DIR "replay/"+numStr+"-name.dat").c_str());
+ 		if (is.is_open()) {
+ 			std::string title, score;
+ 			is >> title >> score;
+@@ -745,7 +764,7 @@
+ 		}
+ 		else {
+ 			screen_->loadBMP(
+-				std::string("shots/")+desc[bulletId]->file()+".bmp",
++				std::string(DATA_DIR "shots/")+desc[bulletId]->file()+".bmp",
+ 				r3.start()+Point(DIM-1, DIM+1));
+ 		}
+ 	}
+@@ -778,7 +797,7 @@
+ 				}
+ 				else {
+ 					screen_->loadBMP(
+-						std::string("shots/")+desc[bulletId]->file()+".bmp",
++						std::string(DATA_DIR "shots/")+desc[bulletId]->file()+".bmp",
+ 						r3.start()+Point(DIM-1, DIM+1));
+ 				}
+ 			}
+@@ -884,7 +903,7 @@
+ 		}
+ 		else {
+ 			screen_->loadBMP(
+-				std::string("shots/")+desc[bulletId]->file()+".bmp",
++				std::string(DATA_DIR "shots/")+desc[bulletId]->file()+".bmp",
+ 				r3.start()+Point(DIM-1, DIM+1));
+ 		}
+ 	}
+@@ -915,7 +934,7 @@
+ 				}
+ 				else {
+ 					screen_->loadBMP(
+-						std::string("shots/")+desc[bulletId]->file()+".bmp",
++						std::string(DATA_DIR "shots/")+desc[bulletId]->file()+".bmp",
+ 						r3.start()+Point(DIM-1, DIM+1));
+ 				}
+ 			}
+@@ -1054,7 +1073,7 @@
+ 	static const int yspace = 20;
+ 
+ 	while (1) {
+-		Action act = selectConfigMenu("data/BulletDetail.dat", p,
++		Action act = selectConfigMenu(DATA_DIR "data/BulletDetail.dat", p,
+ 									  p+Point(200,0), p+Point(0,300), yspace);
+ 
+ 		if (act == ACT_CANCEL) {
+@@ -1080,7 +1099,7 @@
+ 	addstrs.push_back("V‹KƒvƒŒƒCƒ„[ (new player)");
+ 
+ 	while (1) {
+-		Action act = selectConfigMenu("data/Config.dat", p, p+Point(200,0),
++		Action act = selectConfigMenu(DATA_DIR "data/Config.dat", p, p+Point(200,0),
+ 									  p+Point(0, 320), yspace, addstrs);
+ 
+ 		if (act == ACT_CANCEL) {
+@@ -1186,7 +1205,7 @@
+ 		ite++;
+ 	}
+ 
+-	std::ofstream os("save/score.dat");
++	std::ofstream os((getSaveDir()+"score.dat").c_str());
+ 	for (i = 0; i < 10; i++) {
+ 		os << normalRanking_[i].first << '\t'
+ 		   << normalRanking_[i].second << std::endl;
+@@ -1231,7 +1250,7 @@
+ 					else if (!isdigit((unsigned char)key)) continue;
+ 					Game::instance()->saveReplay(name);
+ 					ConfMapGenerater cmg;
+-					cmg.save(std::string("replay/")+name+"-conf.dat", conf_);
++					cmg.save(std::string(DATA_DIR "replay/")+name+"-conf.dat", conf_);
+ 					s->fillRect(Rect(5, 365, 295, 390), Color::BLACK);
+ 					putDimmedString(std::string("")+name+"‚É•Û‘¶‚µ‚Ü‚µ‚½",
+ 									Point(10, 370), Color::WHITE, s);
+Index: sdmkun-1.5.8.dfsg1/src/dmkun.cc
+===================================================================
+--- sdmkun-1.5.8.dfsg1.orig/src/dmkun.cc	2004-03-25 19:26:48.000000000 +0000
++++ sdmkun-1.5.8.dfsg1/src/dmkun.cc	2007-08-30 18:35:28.000000000 +0000
+@@ -13,6 +13,12 @@
+ #include <dir.h>
+ #endif
+ 
++#ifndef _WIN32
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/stat.h>
++#endif
++
+ void displayError(const std::string& msg, const std::string& kind) {
+ 	Screen* scr = Game::instance()->screen();
+ 
+@@ -75,6 +81,22 @@
+     chdir("sdmkun.app/Contents/Resources");
+ #endif
+ 
++#ifndef _WIN32
++	char *home = getenv("HOME");
++
++	if (!home)
++	{
++		std::cerr << "Error: $HOME not defined" << std::endl;
++		return 1;
++	}
++
++	std::string str(home);
++	str += "/.sdmkun"; mkdir(str.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++
++	system("test -d \"$HOME/.sdmkun/user\" || ( mkdir \"$HOME/.sdmkun/user\" && cp " DATA_DIR "user/* \"$HOME/.sdmkun/user/\")");
++	system("test -d \"$HOME/.sdmkun/save\" || ( mkdir \"$HOME/.sdmkun/save\" && cp " DATA_DIR "save/* \"$HOME/.sdmkun/save/\")");
++#endif
++
+ 	Game* game = new Game;
+ 
+ 	try {

Added: packages/trunk/sdmkun/debian/patches/series
===================================================================
--- packages/trunk/sdmkun/debian/patches/series	                        (rev 0)
+++ packages/trunk/sdmkun/debian/patches/series	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,2 @@
+build.patch
+directories.patch

Added: packages/trunk/sdmkun/debian/rules
===================================================================
--- packages/trunk/sdmkun/debian/rules	                        (rev 0)
+++ packages/trunk/sdmkun/debian/rules	2007-08-30 18:50:51 UTC (rev 4006)
@@ -0,0 +1,92 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS = -Wall -g -rdynamic
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2 -DNDEBUG
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	tar xvfj src.tar.bz2
+	mv src/boost/compose.hpp _compose.hpp
+	rm -r src/boost
+	mkdir src/boost
+	mv _compose.hpp src/boost/compose.hpp
+	#rm -r src/bulletml
+	rm -r src/lua-5.0
+	rm -r src/regmod
+	$(MAKE) -f /usr/share/quilt/quilt.make patch
+	touch $@
+
+build: build-stamp
+build-stamp: configure-stamp 
+	dh_testdir
+	$(MAKE) -C src CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)"
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	#[ ! -f Makefile ] || $(MAKE) clean
+	rm -f `find . -name "*.o"`
+	rm -f `find . -name "*.so*"`
+	rm -f `find . -name "*.a"`
+	$(MAKE) -f /usr/share/quilt/quilt.make unpatch
+	rm -rf src
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+# Build architecture-independent files here.
+binary-indep: build install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs 
+	dh_installdocs
+	dh_installexamples
+	dh_install
+	cat bosses.d/main.act | sed -e 's|bosses.d/|/usr/share/games/sdmkun/bosses.d/|g' \
+		> debian/sdmkun/usr/share/games/sdmkun/bosses.d/main.act
+	cat data/Config.dat \
+		| sed -e "s|English\tEnglish\tenglish\toff|English\tEnglish\tenglish\ton|g" \
+		| sed -e "s|default\tDIR\tbmp|default\tDIR\t/usr/share/games/sdmkun/bmp|g" \
+		> debian/sdmkun/usr/share/games/sdmkun/data/Config.dat
+	dh_installmenu
+	#dh_installman debian/*.6
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+get-orig-source:
+	dh_testdir
+	dh_testroot
+	wget http://shinh.skr.jp/sdmkun/sdmkun-1.5.8.zip
+	unzip sdmkun-1.5.8.zip
+	rm sdmkun/*.dll
+	rm sdmkun/*.exe
+	tar cvfz ../sdmkun_1.5.8.dfsg1.orig.tar.gz sdmkun
+	rm -rf sdmkun-1.5.8.zip sdmkun
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source


Property changes on: packages/trunk/sdmkun/debian/rules
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-games-commits mailing list