debian/0000775000000000000000000000000012266542756007207 5ustar debian/rules0000775000000000000000000000241112266542715010260 0ustar #!/usr/bin/make -f CFLAGS = -g -O3 CXXFLAGS = -g -O3 LDFLAGS += -Wl,-z,defs -Wl,--as-needed -Wl,--no-undefined TMPDIR=debian/tmp %: dh $@ --with autoreconf override_dh_auto_configure: dh_auto_configure -- \ --prefix=/usr \ --bindir=/usr/games \ --datarootdir=/usr/share \ CFLAGS="$(CFLAGS)" \ CXXFLAGS="$(CXXFLAGS)" \ LDFLAGS="$(LDFLAGS)" override_dh_auto_install: dh_auto_install sed -i 's!^Categories=.*!Categories=GTK;Game;!' \ $(TMPDIR)/usr/share/applications/gmchess.desktop sed -i 's!^Encoding=.*!!' \ $(TMPDIR)/usr/share/applications/gmchess.desktop find debian/ -name '*.la' -delete mkdir -p $(TMPDIR)/usr/share/pixmaps for size in 16 24 32 48; do \ convert $(CURDIR)/data/gmchess.png -resize $${size} \ $(TMPDIR)/usr/share/pixmaps/gmchess-$${size}.xpm || exit 1; \ mkdir -p $(TMPDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps || exit 1; \ convert $(CURDIR)/data/gmchess.png -resize $${size} \ $(TMPDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/gmchess.png || exit 1; \ done mv $(TMPDIR)/usr/share/pixmaps/gmchess-48.xpm $(TMPDIR)/usr/share/pixmaps/gmchess.xpm rm -f $(TMPDIR)/usr/share/pixmaps/gmchess.png rm -f $(TMPDIR)/usr/share/man/man6/*.6.6.gz dh_install debian/watch0000664000000000000000000000013011650310441010206 0ustar version=3 http://code.google.com/p/gmchess/downloads/list .*/gmchess-*\.*(.*)\.tar\.bz2 debian/changelog0000664000000000000000000001012012266542751011046 0ustar gmchess (0.29.6-2ubuntu1) trusty; urgency=medium * Use dh-autoreconf to get new libtool macros for ppc64el and update config.{sub,guess} for new arches. -- Logan Rosen Sat, 18 Jan 2014 13:20:08 -0500 gmchess (0.29.6-2) unstable; urgency=low * Fix build on kfreebsd-* -- Aron Xu Sun, 01 Jan 2012 23:49:28 +0800 gmchess (0.29.6-1) unstable; urgency=low * New upstream release. -- Aron Xu Sun, 25 Dec 2011 21:10:37 +0800 gmchess (0.29.4-1) unstable; urgency=low * New upstream release. * Move to Debian Chinese Team. -- Aron Xu Fri, 21 Oct 2011 23:32:08 +0800 gmchess (0.29.3-5) unstable; urgency=low * Fix FTBFS by modifying debian/rules (Closes: #638351). -- Aron Xu Fri, 19 Aug 2011 10:52:04 +0800 gmchess (0.29.3-4) unstable; urgency=low * Use my @debian.org address. * Use dh compat 8. * Enable -O3 by default, now build on ia64. while LTO only success when gold is present, not enabling. * Use new dh rules.tiny style. * Add a patch to workaround FTBFS -- Aron Xu Fri, 19 Aug 2011 01:21:44 +0800 gmchess (0.29.3-3) unstable; urgency=low * debian/control: - Remove useless ${shlibs:Depends}. + Bump std-ver: 3.9.2. * debian/libeval0-dev.install: - Wipe out dependency_libs from .la files, per Policy 10.2 (Closes: #621278). * debian/clean: - Remove useless gmchess.desktop during clean. -- Aron Xu Sat, 09 Apr 2011 14:42:01 +0800 gmchess (0.29.3-2) unstable; urgency=low * debian/control: + Correct Conflicts and Provides for libeval0-dev. * debian/clean: + Add ./output to remove it. * debian/patches: - Remove debian-changes caused by the build-time ./output file. -- Aron Xu Fri, 18 Feb 2011 22:00:00 +0800 gmchess (0.29.3-1) unstable; urgency=low * New upstream release. * debian/patch/0001-fix-the-warning-from-cppcheck.patch: - Upstream patch to fix warnings from cppcheck. -- Aron Xu Fri, 03 Dec 2010 19:24:21 +0800 gmchess (0.29.2-1) unstable; urgency=low * New upstream release: Search libeval0.so.0 instead of libeval0.so. -- Aron Xu Mon, 04 Oct 2010 19:04:43 +0800 gmchess (0.29.1-1) unstable; urgency=low * New upstream release: Add network game support. * debian/control: Bump std-ver to 3.9.1; Remove duplicate section info from binaries: gmchess, eleeye. -- Aron Xu Sun, 19 Sep 2010 18:34:12 +0800 gmchess (0.20.6-1) unstable; urgency=low * New upstream release. * debian/control: Change section of eleeye from comm to games, Raise Standards-Version from 3.8.3 to 3.8.4. * debian/source/format: using `3.0 (quilt)' format. -- Aron Xu Tue, 06 Apr 2010 18:43:48 +0800 gmchess (0.20.4-2) unstable; urgency=low * Correct location of eleeye_engine and convert_png. -- Aron Xu Mon, 14 Dec 2009 15:14:56 +0800 gmchess (0.20.4-1) unstable; urgency=low * New upstream release. -- Aron Xu Tue, 08 Dec 2009 13:38:13 +0800 gmchess (0.20.3-2) unstable; urgency=low * Add src/engine/mips.h to debian/copyrigh * Add "Replaces" section for convert-pgn, eleeye, libeval0 (closes: bug#550696). -- Aron Xu Mon, 12 Oct 2009 19:07:30 +0800 gmchess (0.20.3-1) unstable; urgency=low * New upstream release. * Split gmchess into separate packages. * Solve cross platform issue (closes: bug#544757). -- Aron Xu Fri, 9 Oct 2009 22:05:33 +0800 gmchess (0.20.2-3) unstable; urgency=low * Added menu items. (closes: bug#544510) -- Aron Xu Tue, 1 Sep 2009 21:50:25 +0800 gmchess (0.20.2-2) unstable; urgency=low * Fixed locale path. -- Aron Xu Sat, 22 Aug 2009 22:27:25 +0800 gmchess (0.20.2-1) unstable; urgency=low * Initial release (closes: bug#527040) -- Aron Xu Sat, 22 Aug 2009 21:40:25 +0800 debian/compat0000664000000000000000000000000211650310441010361 0ustar 8 debian/convert-pgn.install0000664000000000000000000000007711650310441013021 0ustar usr/share/man/man6/convert_pgn* usr/games/convert_pgn usr/bin/ debian/gmchess.install0000664000000000000000000000020211650310441012176 0ustar usr/share/gmchess/* usr/share/locale/* usr/share/applications/* usr/share/man/man6/gmchess* usr/share/pixmaps/* usr/games/gmchess debian/libeval0.install0000664000000000000000000000002611650310441012247 0ustar usr/lib/libeval.so.0* debian/copyright0000664000000000000000000000445611650310441011127 0ustar This package was debianized by Aron Xu on Fri, 9 Oct 2009 22:11:04 +0800. It was downloaded from Upstream Authors: lerosua xihes Copyright: Copyright (C) 2009 lerosua & xihes 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 version 2 for more details. You should have received a copy of the GNU General Public License version 2 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 version 2 can be found in `/usr/share/common-licenses/GPL-2'. The Debian packaging is copyright 2009, Aron Xu and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. ------------------------------------------------------------------------------- Files: data/gmchess.png Copyright: 2009 TG License: GPL-2+ ------------------------------------------------------------------------------- Files: data/p1.png,data/p2.png Copyright: 2009 李祥 License: GPL-2+ ------------------------------------------------------------------------------- Files: data/book.dat, data/wood/*, data/sound/*, src/engine/* Copyright: 2008, 黄晨 License: LGPL On Debian systems the full text of the GNU Lesser General Public License can be found in the `/usr/share/common-licenses/LGPL' file. ------------------------------------------------------------------------------- Files: src/engine/mips.h Copyright: 2009 HjjHjj License: GPL-3+ On Debian systems the full text of the GNU General Public License can be found in the `/usr/share/common-licenses/GPL-3' file. debian/source/0000775000000000000000000000000011650310441010463 5ustar debian/source/format0000664000000000000000000000001411650310441011671 0ustar 3.0 (quilt) debian/libeval0-dev.install0000664000000000000000000000003711650310441013025 0ustar usr/lib/libeval.so usr/lib/*.a debian/eleeye.install0000664000000000000000000000007211650310441012022 0ustar usr/share/man/man6/eleeye_engine* usr/games/eleeye_engine debian/menu0000664000000000000000000000036211650310441010053 0ustar ?package(gmchess):needs="X11" \ section="Games/Simulation"\ title="gmchess" \ longtitle="Xiangqi game" \ icon32x32="/usr/share/pixmaps/gmchess-32.xpm" \ icon16x16="/usr/share/pixmaps/gmchess-16.xpm" \ command="/usr/games/gmchess" debian/clean0000664000000000000000000000002511650310441010165 0ustar data/gmchess.desktop debian/control0000664000000000000000000000545212266542753010615 0ustar Source: gmchess Section: games Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Chinese Team Uploaders: Aron Xu Build-Depends: debhelper (>= 8), dh-autoreconf, intltool (>= 0.35.0), gettext, perl (>= 5.8.1), libxml2, libglademm-2.4-dev (>= 2.6.0), libtool, imagemagick Standards-Version: 3.9.2 Homepage: http://code.google.com/p/gmchess/ Package: gmchess Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, eleeye, convert-pgn Description: Chinese chess game (Xiangqi) gmchess enables you to play Chinese chess (Xiangqi) against a human opponent or the computer, read many chess manuals and improve your skills. . Chinese chess (Xiangqi) is one of the most popular chess games to have originated in China. Package: eleeye Architecture: any Replaces: gmchess (<< 0.20.3-2) Depends: ${shlibs:Depends}, ${misc:Depends}, libeval0 Description: Chinese chess (Xiangqi) engine elephant eye (eleeye) is a Chinese chess (Xiangqi) engine providing a set of functions for developing Xiangqi games using the Universal Chess Interface, which is an open communication protocol that enables a chess program engine to communicate with its user interface. . Chinese chess (Xiangqi) is one of the most popular chess games to have originated in China. Package: convert-pgn Section: utils Architecture: any Replaces: gmchess (<< 0.20.3-2) Depends: ${shlibs:Depends}, ${misc:Depends} Description: chess book format converter Convert format of given chess book from one format to PGN, the Portable Game Notation format. . PGN is an XML-like computer-processible format for recording chess games (both the moves and related data). . Supported source chess book formats: ccm, che, chn, mxq, xqf Package: libeval0 Section: libs Architecture: any Replaces: gmchess (<< 0.20.3-1) Depends: ${shlibs:Depends}, ${misc:Depends} Description: support library for eleeye elephant eye (eleeye) is a Chinese chess (Xiangqi) engine providing a set of functions for developing Xiangqi games. . This package provide library that eleeye engine used to keep algorithm's balance. . Chinese chess (Xiangqi) is one of the most popular chess games to have originated in China. Package: libeval0-dev Section: libdevel Architecture: any Provides: libeval-dev Conflicts: libeval-dev Depends: ${misc:Depends}, libeval0 (= ${binary:Version}) Description: support library for eleeye - development file elephant eye (eleeye) is a Chinese chess (Xiangqi) engine providing a set of functions for developing Xiangqi games. . This package provide development file for library that eleeye engine used to keep algorithm's balance. . Chinese chess (Xiangqi) is one of the most popular chess games to have originated in China. debian/docs0000664000000000000000000000001411650310441010031 0ustar NEWS README debian/patches/0000775000000000000000000000000011700101056010606 5ustar debian/patches/0001-fix-the-warning-from-cppcheck.patch0000664000000000000000000002406711650310441017750 0ustar From 275949a8260aa2cadfcdb2920ca3a9671703ca51 Mon Sep 17 00:00:00 2001 From: lerosua Date: Sat, 20 Nov 2010 19:06:09 +0800 Subject: [PATCH] fix the warning from cppcheck --- src/Board.cc | 12 ++++++------ src/Engine.cc | 20 ++++++++++++++------ src/MainWindow.cc | 33 ++++++++++++++++----------------- src/MainWindow.h | 5 ++--- src/engine/convert_pgn.cpp | 4 +++- src/engine/x86asm.h | 10 +++++++--- src/main.cc | 7 +++---- src/robot.h | 8 ++++---- 8 files changed, 55 insertions(+), 44 deletions(-) --- a/src/Board.cc +++ b/src/Board.cc @@ -732,8 +732,8 @@ int dst = m_engine.get_dst_xy(dst_x,dst_y,is_rev_board); int src = m_engine.get_chessman_xy(selected_chessman); int mv = m_engine.get_move(src,dst); - int eat = m_engine.get_move_eat(mv); - DLOG("Board:: src = %x dst = %x mv = %d eat = %d\n",src,dst,mv,eat); + //int eat = m_engine.get_move_eat(mv); + //DLOG("Board:: src = %x dst = %x mv = %d eat = %d\n",src,dst,mv,eat); return try_move(mv); } int Board::try_move(int mv) @@ -1349,11 +1349,11 @@ int Board::init_send_socket() { int sockfd; - char buf[1024]; + //char buf[1024]; struct sockaddr_in srvaddr; EC_THROW(-1 == (sockfd=socket(AF_INET,SOCK_STREAM,0))); - bzero(&srvaddr,sizeof(srvaddr)); + memset(&srvaddr,0,sizeof(srvaddr)); srvaddr.sin_family=AF_INET; srvaddr.sin_port=htons(GMPORT+1); srvaddr.sin_addr.s_addr=htonl(INADDR_ANY); @@ -1367,11 +1367,11 @@ { int sockfd; - char buf[1024]; + //char buf[1024]; struct sockaddr_in srvaddr; EC_THROW(-1 == (sockfd=socket(AF_INET,SOCK_STREAM,0))); - bzero(&srvaddr,sizeof(srvaddr)); + memset(&srvaddr,0,sizeof(srvaddr)); srvaddr.sin_family=AF_INET; srvaddr.sin_port=htons(GMPORT+1); srvaddr.sin_addr.s_addr=htonl(INADDR_ANY); --- a/src/Engine.cc +++ b/src/Engine.cc @@ -22,6 +22,9 @@ Engine::Engine():black_player(0) ,m_checked(0) { + memset(chessboard, 0 , sizeof(chessboard)); + memset(revchessboard, 0, sizeof(revchessboard)); + memset(chessmans, 0, sizeof(chessmans)); clean_board(); } @@ -759,7 +762,7 @@ int min_t = srcset_text(enemy_name); p2_name->set_text(me_name); @@ -934,7 +934,7 @@ Gtk::MessageDialog dialog_info(*this, _("Information"), false); Glib::ustring msg =_("You are play with network game,Please over it first!"); dialog_info.set_secondary_text(msg); - int result = dialog_info.run(); + dialog_info.run(); return ; } @@ -984,15 +984,15 @@ int result =dialog.run(); switch (result) { case (Gtk::RESPONSE_OK): { - board->send_to_socket("resign"); - Gtk::MessageDialog dialog_info(*this, _("Information"), false); - Glib::ustring msg =_("You lose the game!"); - dialog_info.set_secondary_text(msg); - int result = dialog_info.run(); - board->free_game(); - set_status(); + board->send_to_socket("resign"); + Gtk::MessageDialog dialog_info(*this, _("Information"), false); + Glib::ustring msg =_("You lose the game!"); + dialog_info.set_secondary_text(msg); + dialog_info.run(); + board->free_game(); + set_status(); break; - } + } case (Gtk::RESPONSE_CANCEL): { //board->free_game(false); @@ -1020,7 +1020,7 @@ Gtk::MessageDialog dialog(*this, _("Warning"), false); Glib::ustring msg =_("Only ask rue game when you are going,so wait a minute!"); dialog.set_secondary_text(msg); - int result = dialog.run(); + dialog.run(); } } @@ -1040,7 +1040,7 @@ Gtk::MessageDialog dialog(*this, _("Warning"), false); Glib::ustring msg =_("Only rue game when you are going,so wait a minute!"); dialog.set_secondary_text(msg); - int result = dialog.run(); + dialog.run(); } } @@ -1052,7 +1052,7 @@ Gtk::MessageDialog dialog(*this, _("Warning"), false); Glib::ustring msg =_("Only rue game when you are going,so wait a minute!"); dialog.set_secondary_text(msg); - int result = dialog.run(); + dialog.run(); } @@ -1091,7 +1091,7 @@ } Gtk::MessageDialog dialog_info(*this, _("Game End"), false); dialog_info.set_secondary_text(msg); - int result = dialog_info.run(); + dialog_info.run(); if(board->is_network_game()) auto_save_chess_file(); @@ -1120,8 +1120,7 @@ } void MainWindow::start_with(const std::string& param) { - size_t pos; - if((pos = param.find("network-game-red,"))!= std::string::npos){ + if((param.find("network-game-red,"))!= std::string::npos){ //start network game with red player std::string enemy_name,my_name; size_t pos_s,pos_e,pos_m; @@ -1133,7 +1132,7 @@ my_name = param.substr(pos_e+9,pos_m-pos_e-9); on_network_game(enemy_name,my_name,true); - }else if((pos = param.find("network-game-black,")) != std::string::npos){ + }else if((param.find("network-game-black,")) != std::string::npos){ //start network game with black player std::string enemy_name,my_name; size_t pos_s,pos_e,pos_m; --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -26,8 +26,6 @@ #include #include "Board.h" #define main_ui DATA_DIR"/gmchess.glade" -//typedef Glib::RefPtr < Gnome::Glade::Xml > GlademmXML; -typedef Glib::RefPtr < Gtk::Builder> GBuilderXML; class Board; class BookView; @@ -54,7 +52,7 @@ * @param enemy_ 对方名字 * @param role_red_ 已方角色 */ - void on_network_game(const std::string me_,const std::string& enemy_,bool role_red_=true); + void on_network_game(const std::string& me_,const std::string& enemy_,bool role_red_=true); /** gmchess最开始运行带的参数解释函数*/ void start_with(const std::string& param); /** 认输*/ @@ -134,6 +132,7 @@ Glib::RefPtr m_refTreeModel; private: + typedef Glib::RefPtr < Gtk::Builder> GBuilderXML; Board* board; GBuilderXML ui_xml; Glib::RefPtr ui_manager; --- a/src/engine/convert_pgn.cpp +++ b/src/engine/convert_pgn.cpp @@ -633,8 +633,10 @@ if (infp == NULL) { return _ERROR_OPEN; } - if((outfp=fopen(szPgnFile,"wb"))==NULL) + if((outfp=fopen(szPgnFile,"wb"))==NULL) { + fclose(infp); return _ERROR_OPEN; + } while(!feof(infp)){ c=fgetc(infp); fputc(c,outfp); --- a/src/engine/x86asm.h +++ b/src/engine/x86asm.h @@ -133,7 +133,8 @@ #else static __inline__ int Exchange(volatile int *Target, int Value) { - int eax, ebx; + int eax=0; + int ebx=0; asm __volatile__ ( "xchgl %0, (%1)" "\n\t" : "=a" (eax), "=b" (ebx) @@ -143,7 +144,9 @@ } static __inline__ int CompareExchange(volatile int *Destination, int Exchange, int Comperand) { - int eax, ebx, edx; + int eax=0; + int ebx=0; + int edx=0; asm __volatile__ ( "cmpxchgl %2, (%1)" "\n\t" : "=a" (eax), "=b" (ebx), "=d" (edx) @@ -153,7 +156,8 @@ } static __inline__ int ExchangeAdd(volatile int *Addend, int Increment) { - int eax, ebx; + int eax=0; + int ebx=0; asm __volatile__ ( "xaddl %0, (%1)" "\n\t" : "=a" (eax), "=b" (ebx) --- a/src/main.cc +++ b/src/main.cc @@ -30,13 +30,12 @@ //检测单一实例 int singleon(const std::string& url) { - int sockfd,nbytes; - char buf[1024]; - struct hostent *he; + int sockfd; + //struct hostent *he; struct sockaddr_in srvaddr; EC_THROW(-1 == (sockfd=socket(AF_INET,SOCK_STREAM,0))); - bzero(&srvaddr,sizeof(srvaddr)); + memset(&srvaddr, 0, sizeof(srvaddr)); srvaddr.sin_family=AF_INET; srvaddr.sin_port=htons(GMPORT); srvaddr.sin_addr.s_addr=htonl(INADDR_ANY); --- a/src/robot.h +++ b/src/robot.h @@ -39,12 +39,12 @@ ssize_t get_robot_log(char* buf, size_t count) { return read(child_tem, buf, count); } - typedef sigc::signal type_signal_stop; - type_signal_stop signal_stop() + typedef const sigc::signal type_signal_stop; + type_signal_stop signal_stop() const { return signal_stop_; } - typedef sigc::signal type_signal_start; - type_signal_start signal_start() + typedef const sigc::signal type_signal_start; + type_signal_start signal_start() const { return signal_start_; } protected: int my_system(char* const argv[]); debian/patches/0002-fix-potfiles-skip.patch0000664000000000000000000000061611650310441015572 0ustar Index: gmchess-0.29.3/po/POTFILES.skip =================================================================== --- gmchess-0.29.3.orig/po/POTFILES.skip 2009-09-07 12:08:47.000000000 +0000 +++ gmchess-0.29.3/po/POTFILES.skip 2011-08-18 17:55:11.398264018 +0000 @@ -1,2 +1,4 @@ data/gmchess.desktop.in src/BookView.cc +data/confwin.glade +.pc/0001-fix-the-warning-from-cppcheck.patch/src/MainWindow.cc debian/patches/series0000664000000000000000000000006511700100775012033 0ustar 0002-fix-potfiles-skip.patch 0003-fix-kfreebsd.patch debian/patches/0003-fix-kfreebsd.patch0000664000000000000000000000170511700101050014555 0ustar --- a/src/Sound.cc +++ b/src/Sound.cc @@ -77,10 +77,12 @@ void CSound::play_file(const char* filename) { gchar* argv[3]; -#ifdef __linux__ - argv[0] = "aplay"; -#elif __APPLE__ +//#ifdef __linux__ +// argv[0] = "aplay"; +#ifdef __APPLE__ argv[0] = "afplay"; +#else + argv[0] = "aplay"; #endif argv[1] = (gchar*)filename; argv[2] = NULL; --- a/src/engine/eleeye.cpp +++ b/src/engine/eleeye.cpp @@ -32,13 +32,13 @@ #ifdef _WIN32 #include const char *const cszLibEvalFile = "EVALUATE.DLL"; -#elif __linux__ - #include - #define WINAPI - const char *const cszLibEvalFile = "../lib/libeval.so.0"; #elif __APPLE__ #include const char *const cszLibEvalFile = "/usr/local/lib/libeval.0.dylib"; +#else //for __linux__ and freebsd + #include + #define WINAPI + const char *const cszLibEvalFile = "../lib/libeval.so.0"; #endif const int INTERRUPT_COUNT = 4096; // 搜索若干结点后调用中断