Changeset - r9694:c3989dff0985
[Not reviewed]
master
0 2 0
skidd13 - 16 years ago 2008-07-23 15:37:20
skidd13@openttd.org
(svn r13801) -Add: further configuration options to make packaging more union
-Add: Unix man file gets now installed if necessary
2 files changed with 126 insertions and 16 deletions:
0 comments (0 inline, 0 general)
Makefile.in
Show inline comments
 
@@ -14,6 +14,8 @@ CONFIG_CACHE_SOURCE_LIST = !!CONFIG_CACH
 
CONFIGURE_FILES = !!CONFIGURE_FILES!!
 
LIPO = !!LIPO!!
 
BIN_DIR = !!BIN_DIR!!
 
ICON_THEME_DIR = !!ICON_THEME_DIR!!
 
MAN_DIR = !!MAN_DIR!!
 
MENU_DIR = !!MENU_DIR!!
 
SRC_DIR = !!SRC_DIR!!
 
ROOT_DIR = !!ROOT_DIR!!
 
@@ -21,9 +23,12 @@ BUNDLE_DIR = "$(ROOT_DIR)/bundle"
 
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
 
INSTALL_DIR = !!INSTALL_DIR!!
 
INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
 
INSTALL_MAN_DIR = "$(INSTALL_DIR)/$(MAN_DIR)"
 
INSTALL_MENU_DIR = "$(INSTALL_DIR)/$(MENU_DIR)"
 
INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
 
INSTALL_ICON_THEME_DIR = "$(INSTALL_DIR)/$(ICON_THEME_DIR)"
 
INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
 
INSTALL_DOC_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
 
TTD = !!TTD!!
 
TTDS = $(SRC_DIRS:%=%/$(TTD))
 
OS = !!OS!!
 
@@ -203,9 +208,13 @@ endif
 
	$(Q)cp "$(ROOT_DIR)/docs/multiplayer.txt" "$(BUNDLE_DIR)/docs/"
 
	$(Q)cp "$(ROOT_DIR)/docs/32bpp.txt"       "$(BUNDLE_DIR)/docs/"
 
	$(Q)cp "$(ROOT_DIR)/changelog.txt"        "$(BUNDLE_DIR)/docs/"
 
	$(Q)cp "$(ROOT_DIR)/media/openttd.64.png" "$(BUNDLE_DIR)/media/"
 
ifdef MAN_DIR
 
	$(Q)mkdir -p "$(BUNDLE_DIR)/man/"
 
	$(Q)cp "$(ROOT_DIR)/docs/openttd.6"       "$(BUNDLE_DIR)/man/"
 
	$(Q)gzip "$(BUNDLE_DIR)/man/openttd.6"
 
endif
 
	$(Q)cp "$(ROOT_DIR)/media/openttd.32.xpm" "$(BUNDLE_DIR)/media/"
 
	$(Q)cp "$(ROOT_DIR)/media/openttd.32.bmp" "$(BUNDLE_DIR)/media/"
 
	$(Q)cp "$(ROOT_DIR)/media/openttd."*.png  "$(BUNDLE_DIR)/media/"
 
ifdef MENU_DIR
 
	$(Q)cp "$(ROOT_DIR)/media/openttd.desktop" "$(BUNDLE_DIR)/media/"
 
endif
 
@@ -274,10 +283,29 @@ install: bundle
 
	$(Q)install -m 755 "$(BUNDLE_DIR)/$(TTD)" "$(INSTALL_BINARY_DIR)"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/lang/"* "$(INSTALL_DATA_DIR)/lang"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/data/"* "$(INSTALL_DATA_DIR)/data"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(INSTALL_DATA_DIR)/docs"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.64.png" "$(INSTALL_ICON_DIR)"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(INSTALL_DOC_DIR)"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.xpm" "$(INSTALL_ICON_DIR)"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.bmp" "$(INSTALL_ICON_DIR)"
 
ifdef ICON_THEME_DIR
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)"
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/16x16/apps"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.16.png" "$(INSTALL_ICON_THEME_DIR)/16x16/apps"
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/32x32/apps"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.png" "$(INSTALL_ICON_THEME_DIR)/32x32/apps"
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/48x48/apps"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.48.png" "$(INSTALL_ICON_THEME_DIR)/48x48/apps"
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/64x64/apps"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.64.png" "$(INSTALL_ICON_THEME_DIR)/64x64/apps"
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/128x128/apps"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.128.png" "$(INSTALL_ICON_THEME_DIR)/128x128/apps"
 
	$(Q)install -d "$(INSTALL_ICON_THEME_DIR)/256x256/apps"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.256.png" "$(INSTALL_ICON_THEME_DIR)/256x256/apps"
 
else
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/"*.png "$(INSTALL_ICON_DIR)"
 
endif
 
ifdef MAN_DIR
 
	$(Q)install -d "$(INSTALL_MAN_DIR)"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/man/openttd.6.gz" "$(INSTALL_MAN_DIR)"
 
endif
 
ifdef MENU_DIR
 
	$(Q)install -d "$(INSTALL_MENU_DIR)"
 
	$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.desktop" "$(INSTALL_MENU_DIR)"
config.lib
Show inline comments
 
@@ -28,11 +28,14 @@ set_default() {
 
	prefix_dir="/usr/local"
 
	binary_dir="games"
 
	data_dir="share/games/openttd"
 
	doc_dir="1"
 
	icon_dir="share/pixmaps"
 
	icon_theme_dir="1"
 
	personal_dir="1"
 
	shared_dir="1"
 
	install_dir="/"
 
	menu_dir=""
 
	man_dir="1"
 
	menu_dir="1"
 
	menu_group="Game;"
 
	enable_debug="0"
 
	enable_desync_debug="0"
 
@@ -50,7 +53,7 @@ set_default() {
 
	enable_cocoa_quickdraw="1"
 
	with_osx_sysroot="1"
 
	with_application_bundle="1"
 
	with_menu_entry="2"
 
	with_menu_entry="1"
 
	with_sdl="1"
 
	with_cocoa="1"
 
	with_zlib="1"
 
@@ -88,7 +91,10 @@ set_default() {
 
		prefix_dir
 
		binary_dir
 
		data_dir
 
		doc_dir
 
		icon_dir
 
		icon_theme_dir
 
		man_dir
 
		menu_dir
 
		personal_dir
 
		shared_dir
 
@@ -194,11 +200,22 @@ detect_params() {
 
			--data-dir)                   prevp_p="data-dir";;
 
			--data-dir=*)                 data_dir="$optarg";;
 

	
 
			--doc-dir)                    prevp_p="doc-dir";;
 
			--doc-dir=*)                  doc_dir="$optarg";;
 

	
 
			--icon-dir)                   prevp_p="icon-dir";;
 
			--icon-dir=*)                 icon_dir="$optarg";;
 

	
 
			--icon-theme-dir)             prevp_p="icon-theme-dir";;
 
			--icon-theme-dir=*)           icon_theme_dir="$optarg";;
 
			--without-icon-theme)         icon_theme_dir="";;
 

	
 
			--menu-dir)                   prevp_p="menu_dir";;
 
			--menu-dir=*)                 menu_dir="$optarg";;
 
			--without-menu-entry)         menu_dir="";;
 

	
 
			--man-dir)                    prevp_p="man_dir";;
 
			--man-dir=*)                  menu_dir="$optarg";;
 

	
 
			--personal-dir)               prevp_p="personal-dir";;
 
			--personal-dir=*)             personal_dir="$optarg";;
 
@@ -213,10 +230,6 @@ detect_params() {
 

	
 

	
 

	
 
			--with-menu-entry)            with_menu_entry="1";;
 
			--with-menu-entry=*)          with_menu_entry="$optarg";;
 
			--without-menu-entry)         with_menu_entry="0";;
 

	
 
			--menu-group)                 prevp_p="menu_group";;
 
			--menu-group=*)               menu_group="$optarg";;
 

	
 
@@ -828,6 +841,22 @@ check_params() {
 
		fi
 
	fi
 

	
 
	if [ "$doc_dir" = "1" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			doc_dir="share/doc/openttd"
 
		else
 
			doc_dir="$data_dir/docs"
 
		fi
 
	fi
 

	
 
	if [ "$icon_theme_dir" = "1" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			icon_theme_dir="share/icons/hicolor"
 
		else
 
			icon_theme_dir=""
 
		fi
 
	fi
 

	
 
	if [ "$personal_dir" = "1" ]; then
 
		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 
			personal_dir="OpenTTD"
 
@@ -847,13 +876,21 @@ check_params() {
 
		fi
 
	fi
 

	
 
	if [ "$with_menu_entry" = "2" ]; then
 
	if [ "$man_dir" = "1" ]; then
 
		# add manpage on UNIX systems
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX"]; then
 
			man_dir="share/man/man6"
 
		else
 
			man_dir=""
 
		fi
 
	fi
 

	
 
	if [ "$menu_dir" = "1" ]; then
 
		# add a freedesktop menu item only for some UNIX systems
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			with_menu_entry="1"
 
			menu_dir="share/applications"
 
		else
 
			with_menu_entry="0"
 
			menu_dir=""
 
		fi
 
	fi
 

	
 
@@ -878,6 +915,20 @@ check_params() {
 
		log 1 "installation directory... none"
 
	fi
 

	
 
	if [ -n "$icon_theme_dir" ]
 
	then
 
		log 1 "icon theme directory... $icon_theme_dir"
 
	else
 
		log 1 "icon theme directory... none"
 
	fi
 

	
 
	if [ -n "$man_dir" ]
 
	then
 
		log 1 "manual page directory... $mean_dir"
 
	else
 
		log 1 "manual page directory... none"
 
	fi
 

	
 
	if [ -n "$menu_dir" ]
 
	then
 
		log 1 "menu item directory... $menu_dir"
 
@@ -2232,7 +2283,9 @@ make_sed() {
 
		s#!!TTD!!#$TTD#g;
 
		s#!!BINARY_DIR!!#$prefix_dir/$binary_dir#g;
 
		s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
 
		s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
 
		s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
 
		s#!!ICON_THEME_DIR!!#$prefix_dir/$icon_theme_dir#g;
 
		s#!!PERSONAL_DIR!!#$personal_dir#g;
 
		s#!!SHARED_DIR!!#$shared_dir#g;
 
		s#!!INSTALL_DIR!!#$install_dir#g;
 
@@ -2263,7 +2316,27 @@ make_sed() {
 
		s#!!DISTCC!!#$distcc#g;
 
	"
 

	
 
	if [ "$with_menu_entry" = "1" ]; then
 
	if [ "$icon_theme_dir" != "" ]; then
 
		SRC_REPLACE="$SRC_REPLACE
 
			s#!!ICON_THEME_DIR!!#$prefix_dir/$icon_theme_dir#g;
 
		"
 
	else
 
		SRC_REPLACE="$SRC_REPLACE
 
			s#!!ICON_THEME_DIR!!##g;
 
		"
 
	fi
 

	
 
	if [ "$man_dir" != "" ]; then
 
		SRC_REPLACE="$SRC_REPLACE
 
			s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
 
		"
 
	else
 
		SRC_REPLACE="$SRC_REPLACE
 
			s#!!MAN_DIR!!##g;
 
		"
 
	fi
 

	
 
	if [ "$menu_dir" != "" ]; then
 
		SRC_REPLACE="$SRC_REPLACE
 
			s#!!MENU_DIR!!#$prefix_dir/$menu_dir#g;
 
		"
 
@@ -2298,7 +2371,7 @@ generate_main() {
 
	# Make sure config.cache is OLDER then config.cache.source.list
 
	touch config.cache
 

	
 
	if [ "$with_menu_entry" = "1" ]; then
 
	if [ "$menu_dir" != "" ]; then
 
		generate_menu_item
 
	fi
 
}
 
@@ -2397,8 +2470,17 @@ showhelp() {
 
	echo "  --data-dir=dir                 location of data files (lang, data, gm)."
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	echo "                                 [$data_dir]"
 
	echo "  --doc-dir=dir                  location of the doc files"
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	echo "                                 [$doc_dir]"
 
	echo "  --icon-dir=dir                 location of icons. Will be prefixed"
 
	echo "                                 with the prefix-dir [$icon_dir]"
 
	echo "  --icon-theme-dir=dir           location of icon theme."
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	echo "                                 and postfixed with size-dirs [$icon_theme_dir]"
 
	echo "  --man-dir=dir                  location of the manual page (UNIX only)"
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	echo "                                 [$man_dir]"
 
	echo "  --menu-dir=dir                 location of the menu item. (UNIX only, except OSX)"
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	echo "                                 [$menu_dir]"
0 comments (0 inline, 0 general)