mirror of
https://github.com/glest/glest-source.git
synced 2025-08-24 17:02:49 +02:00
introduce shared linux shell code / externalize distribution check
This commit is contained in:
73
build-mg.sh
73
build-mg.sh
@@ -61,7 +61,7 @@ cd ${SCRIPTDIR}
|
|||||||
# will warn about it later.
|
# will warn about it later.
|
||||||
# Instead of editing this variable, consider creating a symbolic link:
|
# Instead of editing this variable, consider creating a symbolic link:
|
||||||
# ln -s ../../google-breakpad google-breakpad
|
# ln -s ../../google-breakpad google-breakpad
|
||||||
BREAKPAD_ROOT="$(dirname $(readlink -f $0))/google-breakpad/"
|
BREAKPAD_ROOT="$SCRIPTDIR/google-breakpad/"
|
||||||
|
|
||||||
# CMake options
|
# CMake options
|
||||||
# The default configuration works fine for regular developers and is also used
|
# The default configuration works fine for regular developers and is also used
|
||||||
@@ -71,8 +71,7 @@ BREAKPAD_ROOT="$(dirname $(readlink -f $0))/google-breakpad/"
|
|||||||
EXTRA_CMAKE_OPTIONS=
|
EXTRA_CMAKE_OPTIONS=
|
||||||
|
|
||||||
# Build threads
|
# Build threads
|
||||||
# By default we use all available CPU cores to build.
|
# By default we use all physical CPU cores to build.
|
||||||
# Pass '1core' as first command line argument to use only one.
|
|
||||||
NUMCORES=`lscpu -p | grep -cv '^#'`
|
NUMCORES=`lscpu -p | grep -cv '^#'`
|
||||||
echo "CPU cores detected: $NUMCORES"
|
echo "CPU cores detected: $NUMCORES"
|
||||||
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
||||||
@@ -81,76 +80,24 @@ echo "CPU cores to be used: $NUMCORES"
|
|||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Load shared functions
|
||||||
|
|
||||||
|
. $SCRIPTDIR/mk/linux/mg_shared.sh
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
if [ $MAKE_ONLY = 0 ]; then
|
if [ $MAKE_ONLY = 0 ]; then
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
CURRENTDIR="$(dirname $(readlink -f $0))"
|
|
||||||
|
|
||||||
if [ $MAKE_ONLY = 0 ]; then
|
if [ $MAKE_ONLY = 0 ]; then
|
||||||
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
|
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get distribution and architecture details
|
# Included from shared functions
|
||||||
if [ `which lsb_release`'x' = 'x' ]
|
detect_system
|
||||||
then
|
|
||||||
lsb=0
|
|
||||||
if [ -e /etc/debian_version ]; then distribution='Debian'; release='unknown release version'; codename=`cat /etc/debian_version`; fi
|
|
||||||
if [ -e /etc/SuSE-release ]; then distribution='SuSE'; release='unknown release version'; codename=`cat /etc/SuSE-release`; fi
|
|
||||||
if [ -e /etc/fedora-release ]; then distribution='Fedora'; release='unknown release version'; codename=`cat /etc/fedora-release`; fi
|
|
||||||
if [ -e /etc/redhat-release ]; then distribution='Redhat'; release='unknown release version'; codename=`cat /etc/redhat-release`; fi
|
|
||||||
if [ -e /etc/mandrake-release ]; then distribution='Mandrake'; release='unknown release version'; codename=`cat /etc/mandrake-release`; fi
|
|
||||||
else
|
|
||||||
lsb=1
|
|
||||||
|
|
||||||
# lsb_release output by example:
|
|
||||||
#
|
|
||||||
# $ lsb_release -i
|
|
||||||
# Distributor ID: Ubuntu
|
|
||||||
#
|
|
||||||
# $ lsb_release -d
|
|
||||||
# Description: Ubuntu 12.04 LTS
|
|
||||||
#
|
|
||||||
# $ lsb_release -r
|
|
||||||
# Release: 12.04
|
|
||||||
#
|
|
||||||
# $ lsb_release -c
|
|
||||||
# Codename: precise
|
|
||||||
|
|
||||||
distribution=`lsb_release -i | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
|
||||||
release=`lsb_release -r | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
|
||||||
codename=`lsb_release -c | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
|
||||||
|
|
||||||
# Some distribution examples:
|
|
||||||
#
|
|
||||||
# OpenSuSE 11.4
|
|
||||||
#LSB Version: n/a
|
|
||||||
#Distributor ID: SUSE LINUX
|
|
||||||
#Description: openSUSE 11.4 (x86_64)
|
|
||||||
#Release: 11.4
|
|
||||||
#Codename: Celadon
|
|
||||||
#
|
|
||||||
# OpenSuSE 12.1
|
|
||||||
#LSB support: 1
|
|
||||||
#Distribution: SUSE LINUX
|
|
||||||
#Release: 12.1
|
|
||||||
#Codename: Asparagus
|
|
||||||
#
|
|
||||||
# Arch
|
|
||||||
#LSB Version: n/a
|
|
||||||
#Distributor ID: archlinux
|
|
||||||
#Description: Arch Linux
|
|
||||||
#Release: rolling
|
|
||||||
#Codename: n/a
|
|
||||||
#
|
|
||||||
# Ubuntu 12.04
|
|
||||||
#Distributor ID: Ubuntu
|
|
||||||
#Description: Ubuntu 12.04 LTS
|
|
||||||
#Release: 12.04
|
|
||||||
#Codename: precise
|
|
||||||
fi
|
|
||||||
architecture=`uname -m`
|
|
||||||
|
|
||||||
echo 'We have detected the following system:'
|
echo 'We have detected the following system:'
|
||||||
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
|
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
|
||||||
|
@@ -5,6 +5,14 @@
|
|||||||
# Copyright (c) 2013 Mark Vejvoda under GNU GPL v3.0+
|
# Copyright (c) 2013 Mark Vejvoda under GNU GPL v3.0+
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Requires:
|
||||||
|
# - curl, built with SSL support, in $PATH
|
||||||
|
# - wget, built with SSL support, in $PATH
|
||||||
|
# - 7z (command line utility of 7-zip), in $PATH
|
||||||
|
# - Coverity Scan Build Tool, in $PATH
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
# Default to English language output so we can understand your bug reports
|
# Default to English language output so we can understand your bug reports
|
||||||
export LANG=C
|
export LANG=C
|
||||||
@@ -12,14 +20,8 @@ export LANG=C
|
|||||||
CURRENTDIR="$(dirname $(readlink -f $0))"
|
CURRENTDIR="$(dirname $(readlink -f $0))"
|
||||||
echo "Script path [${CURRENTDIR}]"
|
echo "Script path [${CURRENTDIR}]"
|
||||||
|
|
||||||
#
|
# Load shared functions
|
||||||
# Upload Coverity s
|
. $CURRENTDIR/mg_shared.sh
|
||||||
# Requires:
|
|
||||||
# - data\glest_game\curl.exe, built with SSL support: http://curl.haxx.se/download.html
|
|
||||||
# - ..\..\data\glest_game\wget.exe (should get installed automatically during a build)
|
|
||||||
# - ..\..\data\glest_game\7z.exe (should get installed automatically during a build)
|
|
||||||
# - Coverity Scan Build Tool installed and in %PATH%
|
|
||||||
#
|
|
||||||
|
|
||||||
# Project name (case sensitive)
|
# Project name (case sensitive)
|
||||||
PROJECT=MegaGlest
|
PROJECT=MegaGlest
|
||||||
@@ -42,36 +44,10 @@ fi
|
|||||||
# echo "Read config values: TOKEN [$TOKEN] EMAIL [$EMAIL] COVERITY_ANALYSIS_ROOT [$COVERITY_ANALYSIS_ROOT] NUMCORES [${NUMCORES}]"
|
# echo "Read config values: TOKEN [$TOKEN] EMAIL [$EMAIL] COVERITY_ANALYSIS_ROOT [$COVERITY_ANALYSIS_ROOT] NUMCORES [${NUMCORES}]"
|
||||||
# exit 1
|
# exit 1
|
||||||
|
|
||||||
# Description of this build (can be any string)
|
# Included from shared functions
|
||||||
# Determine distro title, release, codename
|
detect_system
|
||||||
LSB_PATH=$(which lsb_release)
|
|
||||||
if [ '${LSB_PATH}x' = 'x' ] ; then
|
|
||||||
lsb=0
|
|
||||||
if [ -e /etc/debian_version ]
|
|
||||||
then distribution='Debian'; release='unknown release version'; codename=`cat /etc/debian_version`
|
|
||||||
elif [ -e /etc/SuSE-release ]
|
|
||||||
then distribution='SuSE'; release='unknown release version'; codename=`cat /etc/SuSE-release`
|
|
||||||
elif [ -e /etc/redhat-release ]
|
|
||||||
then
|
|
||||||
if [ -e /etc/fedora-release ]
|
|
||||||
then distribution='Fedora'; release='unknown release version'; codename=`cat /etc/fedora-release`
|
|
||||||
else distribution='Redhat'; release='unknown release version'; codename=`cat /etc/redhat-release`
|
|
||||||
fi
|
|
||||||
elif [ -e /etc/fedora-release ]
|
|
||||||
then distribution='Fedora'; release='unknown release version'; codename=`cat /etc/fedora-release`
|
|
||||||
elif [ -e /etc/mandrake-release ]
|
|
||||||
then distribution='Mandrake'; release='unknown release version'; codename=`cat /etc/mandrake-release`
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
lsb=1
|
|
||||||
|
|
||||||
distribution=$(lsb_release -i | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }')
|
|
||||||
release=$(lsb_release -r | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }')
|
|
||||||
codename=$(lsb_release -c | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }')
|
|
||||||
fi
|
|
||||||
|
|
||||||
computername=$(hostname)
|
computername=$(hostname)
|
||||||
architecture=$(uname -m)
|
|
||||||
#DESCRIPTION=${distribution}-${release}-${architecture}_${computername}
|
#DESCRIPTION=${distribution}-${release}-${architecture}_${computername}
|
||||||
DESCRIPTION=${distribution}-${architecture}_${computername}
|
DESCRIPTION=${distribution}-${architecture}_${computername}
|
||||||
|
|
||||||
|
94
mk/linux/mg_shared.sh
Normal file
94
mk/linux/mg_shared.sh
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Functions shared by several scripts
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
function detect_system {
|
||||||
|
# Determine distro title, release, codename
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# -/-
|
||||||
|
#
|
||||||
|
# Output:
|
||||||
|
# No direct output, but the following variables are set:
|
||||||
|
# lsb: whether (1) or not (0) system information was retrieved from 'lsb_release'
|
||||||
|
# distribution: detected Linux distribution (string)
|
||||||
|
# release: detected distribution release / version (string)
|
||||||
|
# codename: codename of the detected Linux distribution (string)
|
||||||
|
# architecture: detected machine architecture (string)
|
||||||
|
|
||||||
|
if [[ `which lsb_release` = '' ]]
|
||||||
|
then
|
||||||
|
lsb=0
|
||||||
|
if [ -e /etc/debian_version ]
|
||||||
|
then
|
||||||
|
distribution='Debian'
|
||||||
|
release='unknown release version'
|
||||||
|
codename=`cat /etc/debian_version`
|
||||||
|
elif [ -e /etc/SuSE-release ]
|
||||||
|
then
|
||||||
|
distribution='SuSE'
|
||||||
|
release='unknown release version'
|
||||||
|
codename=`cat /etc/SuSE-release`
|
||||||
|
elif [ -e /etc/redhat-release ]
|
||||||
|
then
|
||||||
|
if [ -e /etc/fedora-release ]
|
||||||
|
then
|
||||||
|
distribution='Fedora'
|
||||||
|
release='unknown release version'
|
||||||
|
codename=`cat /etc/fedora-release`
|
||||||
|
else
|
||||||
|
distribution='Redhat'
|
||||||
|
release='unknown release version'
|
||||||
|
codename=`cat /etc/redhat-release`
|
||||||
|
fi
|
||||||
|
elif [ -e /etc/fedora-release ]
|
||||||
|
then
|
||||||
|
distribution='Fedora'
|
||||||
|
release='unknown release version'
|
||||||
|
codename=`cat /etc/fedora-release`
|
||||||
|
elif [ -e /etc/mandrake-release ]
|
||||||
|
then
|
||||||
|
distribution='Mandrake'
|
||||||
|
release='unknown release version'
|
||||||
|
codename=`cat /etc/mandrake-release`
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
lsb=1
|
||||||
|
|
||||||
|
distribution=`lsb_release -i | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
||||||
|
release=`lsb_release -r | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
||||||
|
codename=`lsb_release -c | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
||||||
|
|
||||||
|
# Some distribution examples:
|
||||||
|
#
|
||||||
|
# OpenSuSE 11.4
|
||||||
|
# LSB Version: n/a
|
||||||
|
# Distributor ID: SUSE LINUX
|
||||||
|
# Description: openSUSE 11.4 (x86_64)
|
||||||
|
# Release: 11.4
|
||||||
|
# Codename: Celadon
|
||||||
|
#
|
||||||
|
# OpenSuSE 12.1
|
||||||
|
# LSB support: 1
|
||||||
|
# Distribution: SUSE LINUX
|
||||||
|
# Release: 12.1
|
||||||
|
# Codename: Asparagus
|
||||||
|
#
|
||||||
|
# Arch
|
||||||
|
# LSB Version: n/a
|
||||||
|
# Distributor ID: archlinux
|
||||||
|
# Description: Arch Linux
|
||||||
|
# Release: rolling
|
||||||
|
# Codename: n/a
|
||||||
|
#
|
||||||
|
# Ubuntu 12.04
|
||||||
|
# Distributor ID: Ubuntu
|
||||||
|
# Description: Ubuntu 12.04 LTS
|
||||||
|
# Release: 12.04
|
||||||
|
# Codename: precise
|
||||||
|
fi
|
||||||
|
architecture=`uname -m`
|
||||||
|
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Use this script to install build dependencies on a number of Linux platforms
|
# Use this script to install build dependencies on a number of Linux platforms
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -9,6 +9,12 @@
|
|||||||
|
|
||||||
LANG=C
|
LANG=C
|
||||||
|
|
||||||
|
SCRIPTDIR="$(dirname $(readlink -f $0))"
|
||||||
|
gitcommit=`git log -1 --pretty=tformat:"%H" $SCRIPTDIR/../..`
|
||||||
|
|
||||||
|
# Load shared functions
|
||||||
|
. $SCRIPTDIR/mg_shared.sh
|
||||||
|
|
||||||
# Got root?
|
# Got root?
|
||||||
if [ `id -u`'x' != '0x' ]
|
if [ `id -u`'x' != '0x' ]
|
||||||
then
|
then
|
||||||
@@ -32,80 +38,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
mypath=`readlink -f $0 | xargs dirname`
|
# Included from shared functions
|
||||||
gitcommit=`git log -1 --pretty=tformat:"%H" $mypath/../..`
|
detect_system
|
||||||
|
|
||||||
|
|
||||||
# Determine distro title, release, codename
|
|
||||||
if [ `which lsb_release`'x' = 'x' ]
|
|
||||||
then
|
|
||||||
lsb=0
|
|
||||||
if [ -e /etc/debian_version ]
|
|
||||||
then distribution='Debian'; release='unknown release version'; codename=`cat /etc/debian_version`
|
|
||||||
elif [ -e /etc/SuSE-release ]
|
|
||||||
then distribution='SuSE'; release='unknown release version'; codename=`cat /etc/SuSE-release`
|
|
||||||
elif [ -e /etc/redhat-release ]
|
|
||||||
then
|
|
||||||
if [ -e /etc/fedora-release ]
|
|
||||||
then distribution='Fedora'; release='unknown release version'; codename=`cat /etc/fedora-release`
|
|
||||||
else distribution='Redhat'; release='unknown release version'; codename=`cat /etc/redhat-release`
|
|
||||||
fi
|
|
||||||
elif [ -e /etc/fedora-release ]
|
|
||||||
then distribution='Fedora'; release='unknown release version'; codename=`cat /etc/fedora-release`
|
|
||||||
elif [ -e /etc/mandrake-release ]
|
|
||||||
then distribution='Mandrake'; release='unknown release version'; codename=`cat /etc/mandrake-release`
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
lsb=1
|
|
||||||
|
|
||||||
# lsb_release output by example:
|
|
||||||
#
|
|
||||||
# $ lsb_release -i
|
|
||||||
# Distributor ID: Ubuntu
|
|
||||||
#
|
|
||||||
# $ lsb_release -d
|
|
||||||
# Description: Ubuntu 12.04 LTS
|
|
||||||
#
|
|
||||||
# $ lsb_release -r
|
|
||||||
# Release: 12.04
|
|
||||||
#
|
|
||||||
# $ lsb_release -c
|
|
||||||
# Codename: precise
|
|
||||||
|
|
||||||
distribution=`lsb_release -i | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
|
||||||
release=`lsb_release -r | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
|
||||||
codename=`lsb_release -c | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
|
|
||||||
|
|
||||||
# Some distribution examples:
|
|
||||||
#
|
|
||||||
# OpenSuSE 11.4
|
|
||||||
#LSB Version: n/a
|
|
||||||
#Distributor ID: SUSE LINUX
|
|
||||||
#Description: openSUSE 11.4 (x86_64)
|
|
||||||
#Release: 11.4
|
|
||||||
#Codename: Celadon
|
|
||||||
#
|
|
||||||
# OpenSuSE 12.1
|
|
||||||
#LSB support: 1
|
|
||||||
#Distribution: SUSE LINUX
|
|
||||||
#Release: 12.1
|
|
||||||
#Codename: Asparagus
|
|
||||||
#
|
|
||||||
# Arch
|
|
||||||
#LSB Version: n/a
|
|
||||||
#Distributor ID: archlinux
|
|
||||||
#Description: Arch Linux
|
|
||||||
#Release: rolling
|
|
||||||
#Codename: n/a
|
|
||||||
#
|
|
||||||
# Ubuntu 12.04
|
|
||||||
#Distributor ID: Ubuntu
|
|
||||||
#Description: Ubuntu 12.04 LTS
|
|
||||||
#Release: 12.04
|
|
||||||
#Codename: precise
|
|
||||||
fi
|
|
||||||
|
|
||||||
architecture=`uname -m`
|
|
||||||
|
|
||||||
echo 'We have detected the following system:'
|
echo 'We have detected the following system:'
|
||||||
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
|
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
|
||||||
@@ -122,7 +56,7 @@ unsupported_distribution () {
|
|||||||
echo ''
|
echo ''
|
||||||
echo 'Please report a bug at http://bugs.megaglest.org providing the following information:'
|
echo 'Please report a bug at http://bugs.megaglest.org providing the following information:'
|
||||||
echo '--- snip ---'
|
echo '--- snip ---'
|
||||||
echo 'SVN version: '"$gitcommit"
|
echo 'Git revision: '"$gitcommit"
|
||||||
echo 'LSB support: '"$lsb"
|
echo 'LSB support: '"$lsb"
|
||||||
echo 'Distribution: '"$distribution"
|
echo 'Distribution: '"$distribution"
|
||||||
echo 'Release: '"$release"
|
echo 'Release: '"$release"
|
||||||
@@ -139,7 +73,7 @@ unsupported_release () {
|
|||||||
echo ''
|
echo ''
|
||||||
echo 'Please report a bug at http://bugs.megaglest.org providing the following information:'
|
echo 'Please report a bug at http://bugs.megaglest.org providing the following information:'
|
||||||
echo '--- snip ---'
|
echo '--- snip ---'
|
||||||
echo 'SVN version: '"$gitcommit"
|
echo 'Git revision: '"$gitcommit"
|
||||||
echo 'LSB support: '"$lsb"
|
echo 'LSB support: '"$lsb"
|
||||||
echo 'Distribution: '"$distribution"
|
echo 'Distribution: '"$distribution"
|
||||||
echo 'Release: '"$release"
|
echo 'Release: '"$release"
|
||||||
@@ -160,7 +94,7 @@ error_during_installation () {
|
|||||||
echo ''
|
echo ''
|
||||||
echo 'Please report a bugs at http://bugs.megaglest.org providing the following information:'
|
echo 'Please report a bugs at http://bugs.megaglest.org providing the following information:'
|
||||||
echo '--- snip ---'
|
echo '--- snip ---'
|
||||||
echo 'SVN version: '"$gitcommit"
|
echo 'Git revision: '"$gitcommit"
|
||||||
echo 'LSB support: '"$lsb"
|
echo 'LSB support: '"$lsb"
|
||||||
echo 'Distribution: '"$distribution"
|
echo 'Distribution: '"$distribution"
|
||||||
echo 'Release: '"$release"
|
echo 'Release: '"$release"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Use this script to install build dependencies on a number of Linux platforms
|
# Use this script to install build dependencies on a number of Linux platforms
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -6,28 +6,56 @@
|
|||||||
# Rewritten by Tom Reynolds <tomreyn@megaglest.org>
|
# Rewritten by Tom Reynolds <tomreyn@megaglest.org>
|
||||||
# Copyright (c) 2012 Mark Vejvoda, Tom Reynolds under GNU GPL v3.0
|
# Copyright (c) 2012 Mark Vejvoda, Tom Reynolds under GNU GPL v3.0
|
||||||
|
|
||||||
|
SCRIPTDIR="$(dirname $(readlink -f $0))"
|
||||||
|
|
||||||
|
# Load shared functions
|
||||||
|
. $SCRIPTDIR/../../../mk/linux/mg_shared.sh
|
||||||
|
|
||||||
echo 'Downloading Javascript libraries...'
|
echo 'Downloading Javascript libraries...'
|
||||||
wget http://code.jquery.com/jquery-1.5.2.js -O media/jquery-1.5.min.js
|
wget http://code.jquery.com/jquery-1.5.2.js -O media/jquery-1.5.min.js
|
||||||
wget http://www.datatables.net/download/build/jquery.dataTables.min.js -O media/jquery.dataTables.min.js
|
wget http://www.datatables.net/download/build/jquery.dataTables.min.js -O media/jquery.dataTables.min.js
|
||||||
|
|
||||||
echo 'Installing dependencies...'
|
echo 'Detecting system and installing dependencies...'
|
||||||
# This should actually use /etc/issue
|
# Included from shared functions
|
||||||
if [ -f /etc/fedora-release ]; then
|
detect_system
|
||||||
echo 'Fedora...'
|
|
||||||
#sudo yum groupinstall "Development Tools"
|
echo 'We have detected the following system:'
|
||||||
#sudo yum install subversion automake autoconf autogen jam
|
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
|
||||||
elif [ -f /etc/SuSE-release ]; then
|
|
||||||
echo '(Open)SuSE...'
|
|
||||||
sudo zypper install graphviz-perl perl-GraphViz perl-Config-IniFiles perl-PerlMagick
|
case $distribution in
|
||||||
elif [ -f /etc/debian_version ]; then
|
SuSE|SUSE?LINUX|Opensuse)
|
||||||
echo 'Debian / Ubuntu...'
|
case $release in
|
||||||
sudo apt-get install perl graphviz libgraphviz-perl libconfig-inifiles-perl perlmagick
|
*)
|
||||||
#sudo apt-get install libimage-size-perl
|
echo '(Open)SuSE...'
|
||||||
else
|
sudo zypper install graphviz-perl perl-GraphViz perl-Config-IniFiles perl-PerlMagick
|
||||||
echo 'ERROR: Unknown distribution. Stopping here.' >&2
|
;;
|
||||||
exit 1
|
esac
|
||||||
fi
|
;;
|
||||||
|
|
||||||
|
Fedora)
|
||||||
|
case $release in
|
||||||
|
*)
|
||||||
|
echo 'Fedora...'
|
||||||
|
#sudo yum groupinstall "Development Tools"
|
||||||
|
#sudo yum install subversion automake autoconf autogen jam
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
Debian|Ubuntu|LinuxMint)
|
||||||
|
case $release in
|
||||||
|
*)
|
||||||
|
echo 'Debian / Ubuntu...'
|
||||||
|
sudo apt-get install perl graphviz libgraphviz-perl libconfig-inifiles-perl perlmagick
|
||||||
|
#sudo apt-get install libimage-size-perl
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo 'ERROR: Unknown distribution. Stopping here.' >&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
echo 'To run the techtree html builder edit mg.ini and run the script as follows:'
|
echo 'To create techtree HTML pages copy / edit megapack.ini and run the script:'
|
||||||
echo './convert_faction_xml2html.pl megapack.ini'
|
echo './convert_faction_xml2html.pl megapack.ini'
|
||||||
|
Reference in New Issue
Block a user