From b31a749950a3d1cb9ac0af7ae2ebebe5f81aa753 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Fri, 3 Dec 2010 23:24:06 -0800 Subject: [PATCH] replace hard coded paths with path from configure script use $datadir and subdirectories to store some data files. Also make files in xboard.conf use correct path. --- Makefile.am | 32 ++++++++++++++++++++++- common.h | 2 +- configure.ac | 1 + xboard.conf | 77 -------------------------------------------------------- xboard.conf.in | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 79 deletions(-) delete mode 100644 xboard.conf create mode 100644 xboard.conf.in diff --git a/Makefile.am b/Makefile.am index 8901a08..a3fe40d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,4 @@ +### if we are compiling with ZIPPY we need some extra source files if ZIPPY ZPY = zippy.c zippy.h @@ -38,22 +39,51 @@ EXTRA_DIST = pixmaps bitmaps winboard sounds filebrowser/README \ DISTCLEANFILES = stamp-h -AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ -DSYSCONFDIR='"$(sysconfdir)"' +AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ -DSYSCONFDIR='"$(sysconfdir)"' -DBITMAPDIR='"$(datadir)/games/xboard/bitmaps/"' info_TEXINFOS = xboard.texi xboard_TEXINFOS = copyright.texi man6_MANS = xboard.man + +### config file + dist_sysconf_DATA = xboard.conf + +### icon files + icondir = $(datadir)/icons/hicolor/48x48/apps dist_icon_DATA = xboard.png svgicondir = $(datadir)/icons/hicolor/scalable/apps dist_svgicon_DATA = xboard.svg + +### desktop files for KDE and gnome + Applicationsdir = $(datadir)/applications Applications_DATA = xboard.desktop +### directory and files to be used as bitmaps + +bitmapdir = $(datadir)/games/xboard/ +dist_bitmap_DATA = pixmaps/wood_d.xpm pixmaps/wood_l.xpm + + +### set correct dir in xboard.conf + +edit = sed -e 's|@bitmapdir[@]|$(bitmapdir)|g' + +xboard.conf: Makefile $(srcdir)/xboard.conf.in + rm -f $@ $@.tmp + srcdir='' + test -f ./$@.in || srcdir=$(srcdir)/; + $(edit) $${srcdir}$@.in >$@.tmp + mv $@.tmp $@ + + +### the man page depends on several files, so we add a special rule + xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false) diff --git a/common.h b/common.h index 322bd66..cf16a68 100644 --- a/common.h +++ b/common.h @@ -154,7 +154,7 @@ int pclose(FILE *); #define FIRST_HOST "localhost" #define SECOND_HOST "localhost" #define TELNET_PROGRAM "telnet" -#define DEF_BITMAP_DIR "/usr/share/games/xboard/bitmaps.xchess" /* AP: shouldn't be hardcoded directory, but better than nothing at the moment */ +#define DEF_BITMAP_DIR BITMAPDIR #define MATCH_MODE "False" #define INIT_STRING "new\nrandom\n" #define WHITE_STRING "white\ngo\n" diff --git a/configure.ac b/configure.ac index 9bcedb8..9273e45 100644 --- a/configure.ac +++ b/configure.ac @@ -437,6 +437,7 @@ echo "" echo " prefix: $prefix " echo " datarootdir: $datarootdir " echo " datadir: $datadir (icons will go in \$datadir/icons/hicolor/...)" +echo " (bitmaps will go in \$datadir/games/xboard/...)" echo " infodir: $infodir (info files will go here)" echo " sysconfdir: $sysconfdir (xboard.conf will go here)" echo "" diff --git a/xboard.conf b/xboard.conf deleted file mode 100644 index 6d06360..0000000 --- a/xboard.conf +++ /dev/null @@ -1,77 +0,0 @@ -; -; xboard 4.5 Save Settings file -; -; This file contains the system-wide settings of XBoard, in so far they -; deviate from the compiled-in defaults, and are not settable through menus, -; to comfort users that have no history of xboard usage. -; You can edit the values of options that are already set in this file, -; or add other options that you think are convenient as defaults for all users. -; This file is not automatically overwritten, because it redefines the -; -saveSettingsFile to .xboardrc in the user's home directory, so that -; user settings will be saved in a place the user has write access to. -; -; Looks -; --internetChessServerInputBox false --titleInWindow false --showButtonBar true --moveHistoryUp false --evalGraphUp false --engineOutputUp false --monoMode false --flashCount 0 --flashRate 5 --fontSizeTolerance 4 --pixmapDirectory "" --bitmapDirectory "" --liteBackTextureFile "/usr/share/games/xboard/wood_l.xpm" --darkBackTextureFile "/usr/share/games/xboard/wood_d.xpm" --overrideLineGap 0 --highlightMoveWithArrow true -; -; Behavior -; --soundProgram "aplay -q" --pasteSelection false --keepLineBreaksICS false --timeDelay 1 --autoDisplayComment true --autoDisplayTags true --lowTimeWarning false --icsAlarm false --icsAlarmTime 5000 --msLoginDelay 0 --delayBeforeQuit 0 --delayAfterQuit 0 -; -; PGN format & Game List -; --pgnExtendedInfo true --saveOutOfBookInfo true --gameListTags "eprd" -; -; Engines & adjudicatons in engine-engine games -; --firstChessProgram fairymax --secondChessProgram fairymax --niceEngines 0 --polyglotDir "" --adapterCommand 'polyglot -noini -ec "%fcp" -ed "%fd" -uci NalimovCache=%defaultCacheSizeEGTB' --defaultPathEGTB "/egtb" --egtFormats "" --testClaims true --checkMates true --materialDraws true --trivialDraws false -; -; Save user settings. -; Must be last in file to make user options prevail over system-wide settings! -; --saveSettingsOnExit true --saveSettingsFile "~/.xboardrc" --settingsFile "~/.xboardrc" -; -; Turn -inc into a volatile option, to prevent a persistent increment >= 0 dominating a command-line -mps -; --inc -1 - diff --git a/xboard.conf.in b/xboard.conf.in new file mode 100644 index 0000000..607a1e9 --- /dev/null +++ b/xboard.conf.in @@ -0,0 +1,77 @@ +; +; xboard 4.5 Save Settings file +; +; This file contains the system-wide settings of XBoard, in so far they +; deviate from the compiled-in defaults, and are not settable through menus, +; to comfort users that have no history of xboard usage. +; You can edit the values of options that are already set in this file, +; or add other options that you think are convenient as defaults for all users. +; This file is not automatically overwritten, because it redefines the +; -saveSettingsFile to .xboardrc in the user's home directory, so that +; user settings will be saved in a place the user has write access to. +; +; Looks +; +-internetChessServerInputBox false +-titleInWindow false +-showButtonBar true +-moveHistoryUp false +-evalGraphUp false +-engineOutputUp false +-monoMode false +-flashCount 0 +-flashRate 5 +-fontSizeTolerance 4 +-pixmapDirectory "" +-bitmapDirectory "" +-liteBackTextureFile "@bitmapdir@wood_l.xpm" +-darkBackTextureFile "@bitmapdir@wood_d.xpm" +-overrideLineGap 0 +-highlightMoveWithArrow true +; +; Behavior +; +-soundProgram "aplay -q" +-pasteSelection false +-keepLineBreaksICS false +-timeDelay 1 +-autoDisplayComment true +-autoDisplayTags true +-lowTimeWarning false +-icsAlarm false +-icsAlarmTime 5000 +-msLoginDelay 0 +-delayBeforeQuit 0 +-delayAfterQuit 0 +; +; PGN format & Game List +; +-pgnExtendedInfo true +-saveOutOfBookInfo true +-gameListTags "eprd" +; +; Engines & adjudicatons in engine-engine games +; +-firstChessProgram fairymax +-secondChessProgram fairymax +-niceEngines 0 +-polyglotDir "" +-adapterCommand 'polyglot -noini -ec "%fcp" -ed "%fd" -uci NalimovCache=%defaultCacheSizeEGTB' +-defaultPathEGTB "/egtb" +-egtFormats "" +-testClaims true +-checkMates true +-materialDraws true +-trivialDraws false +; +; Save user settings. +; Must be last in file to make user options prevail over system-wide settings! +; +-saveSettingsOnExit true +-saveSettingsFile "~/.xboardrc" +-settingsFile "~/.xboardrc" +; +; Turn -inc into a volatile option, to prevent a persistent increment >= 0 dominating a command-line -mps +; +-inc -1 + -- 1.7.0.4