From d1a88cbbca61f017ebb21e3963240e1b8b76dc87 Mon Sep 17 00:00:00 2001 From: bjarni Date: Sat, 18 Sep 2004 16:29:12 +0000 Subject: (svn r291) Minor fix to english.txt added debian support (blathijs) improved make install (blathijs) --- Makefile | 115 +++++++++++++++++++++++++++---------- lang/english.txt | 2 +- makefiledir/Makefile.config_writer | 11 ++-- os/debian/README.Debian | 19 ++++++ os/debian/changelog | 6 ++ os/debian/compat | 1 + os/debian/control | 15 +++++ os/debian/copyright | 25 ++++++++ os/debian/docs | 4 ++ os/debian/menu | 2 + os/debian/postinst | 45 +++++++++++++++ os/debian/postrm | 45 +++++++++++++++ os/debian/rules | 102 ++++++++++++++++++++++++++++++++ 13 files changed, 355 insertions(+), 37 deletions(-) create mode 100644 os/debian/README.Debian create mode 100644 os/debian/changelog create mode 100644 os/debian/compat create mode 100644 os/debian/control create mode 100644 os/debian/copyright create mode 100644 os/debian/docs create mode 100644 os/debian/menu create mode 100644 os/debian/postinst create mode 100644 os/debian/postrm create mode 100644 os/debian/rules diff --git a/Makefile b/Makefile index 188c5ed9f..50b85d8ab 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,34 @@ # NOVERBOSE: supress all warnings and errors during compilation. # It looks nicer, but you will not know what went wrong. Use it on released (stable) sources only # -# DATA_DIR_PREFIX: This sets the dir OpenTTD looks for the needed files. -# MUST END WITH / if defined +# Paths: +# INSTALL: If not set, the game uses the directory of the binary to +# store everything (lang, data, gm, save and openttd.cfg), this is the `old' behaviour. +# In this case, none of the following paths are used, you also should _not_ +# use `make install', but copy the required stuff yourself (or just play out +# of you source directory, which should work fine). +# If you want to use `make install' to install the game globally, you should +# define it _before_ you build the game. If you only define INSTALL when you +# do `make install', the game won't be able to find it's files (so you should +# also define all the following paths before building). +# +# So, the following paths should be defined if INSTALL is defined. +# None of these paths have to end with / +# PREFIX: Normally /usr/local +# BINARY_DIR: The location of the binary, normally games. (Will be prefixed +# with $PREFIX) +# DATA_DIR: The location of the data (lang, data and gm), normally +# share/games/openttd. (Will be prefixed with $PREFIX) +# PERSONAL_DIR: The directory where openttd.cfg and the save folder will be +# stored. You cannot use ~ here, define USE_HOMEDIR for that. +# USE_HOMEDIR: If this variable is set, PERSONAL_DIR will be prefixed with +# ~/ at runtime (the user's homedir) +# +# DEST_DIR: make install will use this directory instead of the filesystem +# root to install its files. This should normally not be used by +# ordinary users, currently it is only used for the debian +# packaging. This value should only be set when calling `make +# install' and is not saved in Makefile.config # # STATIC: link statically # CYGWIN: build in Cygwin environment @@ -127,7 +153,17 @@ endif # this is used if there aren't any makefile.config ifndef CONFIG_INCLUDED -ENABLE_NETWORK:=1 # sets network on by default if there aren't any config file +# sets network on by default if there aren't any config file +ENABLE_NETWORK:=1 + +# paths for make install +# disabled as they would break it for some (many?) people if they were default +#PREFIX:=/usr/local +#DATA_DIR:=share/games/openttd +#BINARY_DIR:=games +#PERSONAL_DIR:=.openttd +#USE_HOMEDIR:=1 + -include $(LIB_DETECTION) endif @@ -375,18 +411,6 @@ else STRGEN_FLAGS= endif -# file paths setup -ifdef GAME_DATA_DIR -CDEFS += -DGAME_DATA_DIR=\"$(GAME_DATA_DIR)\" -endif - -ifdef PERSONAL_DIR -CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)\" -endif - -ifdef USE_HOMEDIR -CDEFS += -DUSE_HOMEDIR -endif # MIDI setup ifdef OSX @@ -426,15 +450,27 @@ TTDLDFLAGS += -Wl,--subsystem,windows endif # sets up the paths for use for make install -ifdef BINARY_DIR -BINARY_INSTALL:=$(BINARY_DIR)$(TTD) -else -BINARY_INSTALL:=$(INSTALL_DIR)$(TTD) +ifdef INSTALL +# We use _PREFIXED vars here, so the paths are recalculated every time, and +# the prefix is not prepended in the makefile config +BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR) +DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR) +# We use _INSTALL vars here, these vars are the locations where the files will +# be installed +DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED) +BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED) +# Let the code know where to find stuff +ifdef DATA_DIR_PREFIXED +CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\" +endif + +ifdef PERSONAL_DIR +CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\" +endif + +ifdef USE_HOMEDIR +CDEFS += -DUSE_HOMEDIR endif -ifdef DATA_DIR_PREFIX -DATA_DIR:=$(DATA_DIR_PREFIX) -else -DATA_DIR:=$(INSTALL_DIR) endif ############################################################################## @@ -594,15 +630,34 @@ mrproper: clean ifndef OSX ifndef MORPHOS install: - @if [ "$(INSTALL)" == "" ]; then $(error make install is highly experimental at his state and not\ +ifeq ($(INSTALL),) + $(error make install is highly experimental at his state and not\ tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure makefile.config\ is set correctly up - run \"make upgradeconf\") - @if [ "$(DATA_DIR)" == "" ]; then $(error no install path set - check makefile.config) - mkdir -p $(DATA_DIR)/lang - mkdir -p $(DATA_DIR)/data - cp $(TTD) $(BINARY_INSTALL) - cp lang/*.lng $(DATA_DIR)/lang - cp data/*.grf $(DATA_DIR)/data +endif + +ifeq ($(PREFIX), ) + $(error no prefix set - check makefile.config) +endif +# We compare against the non prefixed version here, so we won't install +# if only the prefix has been set +ifeq ($(DATA_DIR),) + $(error no data path set - check makefile.config) +endif +ifeq ($(BINARY_DIR),) + $(error no binary path set - check makefile.config) +endif +# We'll install in $DEST_DIR instead of root if it is set (we don't +# care about extra /'s + mkdir -p $(DATA_DIR_INSTALL)/lang + mkdir -p $(DATA_DIR_INSTALL)/data + mkdir -p $(DATA_DIR_INSTALL)/gm + mkdir -p $(BINARY_DIR_INSTALL) + cp $(TTD) $(BINARY_DIR_INSTALL) + cp lang/*.lng $(DATA_DIR_INSTALL)/lang + cp data/*.grf $(DATA_DIR_INSTALL)/data + cp data/opntitle.dat $(DATA_DIR_INSTALL)/data + cp media/openttd.64.png $(DATA_DIR_INSTALL) else #MorphOS install: $(error make install is not supported on MorphOS) diff --git a/lang/english.txt b/lang/english.txt index b98f7aa45..569bb6650 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -342,7 +342,7 @@ STR_0157_PERFORMANCE_HISTORY_GRAPH :Performance history graph STR_0158_COMPANY_VALUE_GRAPH :Company value graph STR_0159_CARGO_PAYMENT_RATES :Cargo payment rates STR_015A_COMPANY_LEAGUE_TABLE :Company league table -STR_PERFORMANCE_DETAIL_MENU :Detail performance rating +STR_PERFORMANCE_DETAIL_MENU :Detailed performance rating ############ range for menu ends STR_015B_OPENTTD :{WHITE}About OpenTTD diff --git a/makefiledir/Makefile.config_writer b/makefiledir/Makefile.config_writer index 529accfee..e2c698e99 100644 --- a/makefiledir/Makefile.config_writer +++ b/makefiledir/Makefile.config_writer @@ -27,14 +27,13 @@ $(MAKE_CONFIG): $(call CONFIG_LINE,SUPRESS_LANG_ERRORS:=$(SUPRESS_LANG_ERRORS)) $(call CONFIG_LINE,) - $(call CONFIG_LINE,\# DATA_DIR_PREFIX is the path to OpenTTD. It can be absolute or relative) - $(call CONFIG_LINE,\# USE_HOMEDIR sets \~/ in front of DATA_DIR_PREFIX so it uses the homedir) - $(call CONFIG_LINE,\# do not type \~/ yourself because that will not work) - $(call CONFIG_LINE,\# Folders should end with /) + $(call CONFIG_LINE,\# See Makefile for details on these paths) + $(call CONFIG_LINE,\# Folders should not end with /) + $(call CONFIG_LINE,INSTALL:=$(INSTALL)) + $(call CONFIG_LINE,PREFIX:=$(PREFIX)) $(call CONFIG_LINE,BINARY_DIR:=$(BINARY_DIR)) - $(call CONFIG_LINE,INSTALL_DIR:=$(INSTALL_DIR)) + $(call CONFIG_LINE,DATA_DIR:=$(DATA_DIR)) $(call CONFIG_LINE,USE_HOMEDIR:=$(USE_HOMEDIR)) - $(call CONFIG_LINE,GAME_DATA_DIR:=$(GAME_DATA_DIR)) $(call CONFIG_LINE,PERSONAL_DIR:=$(PERSONAL_DIR)) $(call CONFIG_LINE,) diff --git a/os/debian/README.Debian b/os/debian/README.Debian new file mode 100644 index 000000000..489c82deb --- /dev/null +++ b/os/debian/README.Debian @@ -0,0 +1,19 @@ +openttd for Debian +------------------ + +To properly play this game, original data files are needed. +You should copy the data files from the original TTD into the data directory +(/usr/share/games/openttd/data). You should copy all .grf files there. + +-Music + For in game music (optional), you should copy all files in the data/gm + folder of you ttd installation to /usr/share/games/openttd/gm. You + should also install timdity and a soundfont (freepats is packaged in + debian and works out of the box). + + Don't forget to use -m extmidi if you want music, and if you have + problems, remember that not all audio devices support multiple + audiostreams (music and sound), so you might have to use software + mixing. AC97 codec cannot do hardware mixing, for example. + + -- Matthijs Kooijman , Wed, 15 Sep 2004 00:24:01 +0200 diff --git a/os/debian/changelog b/os/debian/changelog new file mode 100644 index 000000000..9161cf5ad --- /dev/null +++ b/os/debian/changelog @@ -0,0 +1,6 @@ +openttd (0.3.4.1-1) unstable; urgency=low + + * Initial Release. + + -- Matthijs Kooijman Thu, 16 Sep 2004 00:59:38 +0200 + diff --git a/os/debian/compat b/os/debian/compat new file mode 100644 index 000000000..b8626c4cf --- /dev/null +++ b/os/debian/compat @@ -0,0 +1 @@ +4 diff --git a/os/debian/control b/os/debian/control new file mode 100644 index 000000000..4a819253d --- /dev/null +++ b/os/debian/control @@ -0,0 +1,15 @@ +Source: openttd +Section: games +Priority: optional +Maintainer: Matthijs Kooijman +Build-Depends: debhelper (>= 4.0.0), libsdl-dev, zlib1g-dev, libpng-dev +Standards-Version: 3.6.0 + +Package: openttd +Architecture: any +Depends: ${shlibs:Depends} +Description: An open source clone of the Microprose game "Transport Tycoon Deluxe" + An enhanced open source clone of the Microprose game "Transport Tycoon Deluxe". + You require the data files of the original Transport Tycoon Deluxe + for Windows to play the game. You have to MANUALLY copy them to the + game data directory! (see README.Debian for details) diff --git a/os/debian/copyright b/os/debian/copyright new file mode 100644 index 000000000..322d1ce27 --- /dev/null +++ b/os/debian/copyright @@ -0,0 +1,25 @@ +This package was debianized by Matthijs Kooijman on +Wed, 15 Sep 2004 00:24:01 +0200. + +It was downloaded from http://sourceforge.net/projects/openttd + +Upstream Author(s): Ludvig Strigeus (ludde) and many others + +Copyright: + + 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; version 2 dated June, 1991. + + 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., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. diff --git a/os/debian/docs b/os/debian/docs new file mode 100644 index 000000000..24a607f07 --- /dev/null +++ b/os/debian/docs @@ -0,0 +1,4 @@ +changelog.txt +readme.txt +docs/Manual.txt +docs/multiplayer.txt diff --git a/os/debian/menu b/os/debian/menu new file mode 100644 index 000000000..7419bf164 --- /dev/null +++ b/os/debian/menu @@ -0,0 +1,2 @@ +?package(openttd):needs=X11 section=Games/Simulation title="Openttd"\ +command="/usr/games/openttd" icon="/usr/share/games/openttd/openttd.64.png" diff --git a/os/debian/postinst b/os/debian/postinst new file mode 100644 index 000000000..f3b229a19 --- /dev/null +++ b/os/debian/postinst @@ -0,0 +1,45 @@ +#! /bin/sh +# postinst script for openttd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +case "$1" in + configure) + cat <&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/os/debian/postrm b/os/debian/postrm new file mode 100644 index 000000000..7a597deef --- /dev/null +++ b/os/debian/postrm @@ -0,0 +1,45 @@ +#! /bin/sh +# postrm script for openttd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove) + cat <&2 + exit 1 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/os/debian/rules b/os/debian/rules new file mode 100644 index 000000000..8c67770b7 --- /dev/null +++ b/os/debian/rules @@ -0,0 +1,102 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +#not supported by openttd makefile +#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 + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + + # we specifiy MANUAL_CONFIG here, so our settings take precedence over + # the ones in the existing Makefile.config (actually, the existing + # Makefile.config is not used at all, though it is overwritten) + rm Makefile.config + $(MAKE) PREFIX=/usr MIDI=/usr/bin/timidity INSTALL=1 + + #/usr/bin/docbook-to-man debian/openttd.sgml > openttd.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/openttd. + $(MAKE) DEST_DIR=debian/openttd install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs changelog.txt + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman docs/openttd.6 + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure -- cgit v1.2.3-54-g00ecf