[Docker] build khanat_client, and prepare package khanat_client - web page to download this package

This commit is contained in:
Jerome Sagnole 2017-09-15 22:44:13 +02:00
parent d37b1a5041
commit 489101ff34
10 changed files with 183 additions and 8 deletions

View file

@ -29,6 +29,7 @@ declare DIRBUILD=""
declare CLEANDOCKER=0
declare -i CLEANIMAGENONE=0
declare -i AUTODETEC=1
declare DOCKERBUILDOPT=""
declare IMAGEDOCKER="builder_khanat_debian_jessie_i686"
declare LOCALBUILDDIR="build/$IMAGEDOCKER"
@ -112,6 +113,7 @@ do
;;
-f|--force-create-image)
IMAGE=1
DOCKERBUILDOPT="$DOCKERBUILDOPT --no-cache"
shift
;;
-j)
@ -216,7 +218,7 @@ EOF
if [[ $IMAGE -ne 0 ]]
then
msg_info "GENERATE DOCKER IMAGE"
cd $rootdir; docker build . -t ${IMAGEDOCKER} \
cd $rootdir; docker build . ${DOCKERBUILDOPT} -t ${IMAGEDOCKER} \
--file "${basedir}/Dockerfile" || exit 2
fi

View file

@ -34,8 +34,49 @@ RUN apt-get update
RUN apt-get dist-upgrade -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
RUN apt-get install -y apache2 php5 libapache2-mod-php5 php5-mysql apache2-utils php5-gd php5-imagick
RUN apt-get install -y git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential libpng12-dev libjpeg62-turbo-dev rrdtool bison libxmu-dev autoconf automake libmysqlclient-dev libgif-dev cpputest libssl-dev liblzma-dev unzip zlib1g-dev libssh-dev libboost-all-dev libopenal-dev libgl1-mesa-dev libogg-dev
RUN apt-get install -y apache2 \
php5 \
libapache2-mod-php5 \
php5-mysql \
apache2-utils \
php5-gd \
php5-imagick
RUN apt-get install -y git \
libcurl4-openssl-dev \
libluabind-dev \
libfreetype6-dev \
libx11-dev \
libgl1-mesa-dev \
libxxf86vm-dev \
libxrandr-dev \
libxrender-dev \
libopenal-dev \
libogg-dev \
libvorbis-dev \
libxml2-dev \
cmake build-essential \
libpng12-dev \
libjpeg62-turbo-dev \
rrdtool \
bison \
libxmu-dev \
autoconf \
automake \
libmysqlclient-dev \
libgif-dev \
cpputest \
libssl-dev \
liblzma-dev \
unzip \
zlib1g-dev \
libssh-dev \
libboost-all-dev \
libopenal-dev \
libgl1-mesa-dev \
libogg-dev \
mercurial
RUN apt-get install -y wget
@ -48,7 +89,7 @@ RUN rm -rf /opt/src/cpptest
RUN tar xvf /opt/src/cpptest.tar.gz -C /opt/src --strip 1
RUN cd /opt/src/cpptest && ./autogen.sh && ./configure && make && make install
## Build & Install Build squish
## Build & Install squish
RUN mkdir -p /opt/src
RUN cd /opt/src; wget -c https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libsquish/squish-1.11.zip
RUN cd /opt/src; unzip squish-1.11.zip
@ -56,3 +97,16 @@ COPY dist/docker/builder/common/squish-limit.patch /opt/squish-limit.patch
RUN cd /opt/src/squish-1.11; patch -i /opt/squish-limit.patch
RUN cd /opt/src/squish-1.11; make
RUN cd /opt/src/squish-1.11; make install
## Build & Install CURL - 7.46.0
#RUN hg clone http://hg.kervala.net/packaging/
#RUN mkdir -p packaging/curl/build
#RUN cd packaging/curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DBUILD_CURL_TESTS=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a ..
#RUN cd packaging/curl/build; make
#RUN cd packaging/curl/build; make install
RUN wget -q https://curl.haxx.se/download/curl-7.46.0.tar.gz -O /opt/src/curl.tar.gz
RUN mkdir -p /opt/src/curl/build
RUN tar xvf /opt/src/curl.tar.gz -C /opt/src/curl --strip 1
RUN cd /opt/src/curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DBUILD_CURL_TESTS=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a ..
RUN cd /opt/src/curl/build; make
RUN cd /opt/src/curl/build; make install

View file

@ -42,7 +42,16 @@ fi
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD START" >> $LOGFILE
cd ${DIRBUILD}; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON ${CMAKEOPTS} ../.. 1>>$LOGFILE 2>&1 || exit 2
cd ${DIRBUILD}; cmake -DWITH_NEL=ON \
-DWITH_STATIC=ON \
-DWITH_STATIC_DRIVERS=ON \
-DWITH_STATIC_EXTERNAL=ON \
-DWITH_SYMBOLS=ON \
-DWITH_LUA52=ON \
-DWITH_RYZOM_PATCH=ON \
-DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON \
${CMAKEOPTS} \
../.. 1>>$LOGFILE 2>&1 || exit 2
cd ${DIRBUILD}; make $MAKEOPTS 1>>$LOGFILE 2>&1 || exit 2

View file

@ -29,6 +29,7 @@ declare DIRBUILD=""
declare CLEANDOCKER=0
declare -i CLEANIMAGENONE=0
declare -i AUTODETEC=1
declare DOCKERBUILDOPT=""
declare IMAGEDOCKER="builder_khanat_debian_jessie_x86_64"
declare LOCALBUILDDIR="build/$IMAGEDOCKER"
@ -114,6 +115,7 @@ do
;;
-f|--force-create-image)
IMAGE=1
DOCKERBUILDOPT="$DOCKERBUILDOPT --no-cache"
shift
;;
-j)
@ -222,7 +224,7 @@ EOF
if [[ $IMAGE -ne 0 ]]
then
msg_info "GENERATE DOCKER IMAGE"
cd $rootdir; docker build . -t ${IMAGEDOCKER} \
cd $rootdir; docker build . ${DOCKERBUILDOPT} -t ${IMAGEDOCKER} \
--file "${basedir}/Dockerfile" || exit 2
fi

View file

@ -31,6 +31,7 @@ source /home/gameserver/.bashrc
# Create directory use for patch server
#mkdir -p $KHANAT_PATH/khanatweb/public_php/
mkdir -p $PATCH_CLIENT_SYSTEM/patch_game/patch
mkdir -p $KHANAT_HOME/client_service/
# configure apache
cat << EOF > /etc/apache2/sites-available/000-default.conf
@ -128,6 +129,27 @@ EOF
# Activate & deploy new configuration
a2enconf patch_service.conf
# Configuration de la page client
cat << EOF > /etc/apache2/conf-available/client_service.conf
Alias /client /home/gameserver/client_service
<Directory /home/gameserver/client_service>
Options FollowSymLinks
DirectoryIndex index.html
Require all granted
<IfModule mod_php5.c>
<IfModule mod_mime.c>
AddType application/tar .tar.gz
</IfModule>
<FilesMatch ".+\.php$">
SetHandler application/tar
</FilesMatch>
</IfModule>
</Directory>
EOF
# Activate & deploy new configuration
a2enconf client_service.conf
# Restart apache
service apache2 restart || exit 2

View file

@ -24,6 +24,8 @@
/opt/configure_database.sh || exit 2
/opt/initialize_khanat_server.sh || exit 2
/opt/initialize_patch_server.sh || exit 2
/opt/prepare_khanat_client.sh || exit 2
#
# Stop All

View file

@ -0,0 +1,81 @@
#!/bin/bash
#
# Script to create package khanat_client
# Copyright (C) 2017 AleaJactaEst
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 program. If not, see <http://www.gnu.org/licenses/>.
echo "PREPARE PACKAGE KHANAT CLIENT"
# Load Environment
export KHANAT_CLIENT_VERSION=1
if [[ ! -f /home/gameserver/.bashrc ]]
then
echo "ERROR - missing /home/gameserver/.bashrc"
exit 2
fi
source /home/gameserver/.bashrc
declare DIRCLIENT="Khanat_Linux64"
declare HOME_PREPARE_CLIENT="$KHANAT_HOME/prepare_client/$DIRCLIENT"
declare HOME_CLIENT="$KHANAT_HOME/client_service"
# Create directory
mkdir -p $HOME_PREPARE_CLIENT || exit 2
mkdir -p $HOME_PREPARE_CLIENT/{data,cfg,save,user,cache} || exit 2
mkdir -p $HOME_CLIENT || exit 2
# Copy all data
cp /usr/local/games/khanat_client $HOME_PREPARE_CLIENT/. || exit 2
cp /usr/local/etc/ryzom/client_default.cfg $HOME_PREPARE_CLIENT/. || exit 2
sed -i -r 's/PatchWanted = 0;/PatchWanted = 1;/g' $HOME_PREPARE_CLIENT/client_default.cfg || exit 2
cp $PATCH_HOME/patch_service/patch_game/bnp/kh_translate_{wk,fr,en}.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
cp $PATCH_HOME/patch_service/dataserver/client/exedll_linux64/khanat.png $HOME_PREPARE_CLIENT/data/. || exit 2
cp $PATCH_HOME/patch_service/dataserver/data/fonts.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
cp $PATCH_HOME/patch_service/patch_game/bnp/kh_interfaces.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
cp $PATCH_HOME/patch_service/patch_game/bnp/ryz_zzz_bazaar.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
cp $PATCH_HOME/khanat/client/cfg/* $HOME_PREPARE_CLIENT/cfg/. || exit 2
# TODO - we need search where are define some files
# .DS_Store : function ?
# khanat_install_desktop_menu.sh : script to install khanat on desktop
# khanat.desktop.in : config desktop for khanat
# khanat_install_desktop_menu.sh : script to uninstall khanat on desktop
# Generate package
#(cd $PATCH_HOME/..; 7z a smokey_linux64.7z $DIRCLIENT)
(cd $HOME_PREPARE_CLIENT/..; tar cfz $HOME_CLIENT/smokey_linux64.tar.gz $DIRCLIENT)
# create index for client
cat << EOF > $HOME_CLIENT/index.html
<!DOCTYPE html>
<html>
<head>
<title>KHANAT CLIENT</title>
</head>
<body>
<h1>You can download khanat client</h1>
<a href="smokey_linux64.tar.gz">khanat client</a>
</body>
</html>
EOF
chown -R gameserver:www-data $HOME_CLIENT
#################################
#
#################################

View file

@ -26,7 +26,7 @@ RUN apt-get dist-upgrade -y
RUN apt-get install -y curl nano vim less bash-completion cron logrotate bsd-mailx
RUN apt-get install -y openssh-server sudo net-tools
RUN apt-get install -y lzma xdelta
RUN apt-get install -y lzma xdelta p7zip p7zip-full
# adding account gameserver, password khanat
RUN useradd -G sudo,www-data -c /home -d /home/gameserver -c "Khanat account GAME" -m -p '$6$nxHX/3u.$azS0.eldpfKqxqOLDjgZj8.hPOLC64arXDTUVX0fs7RZvRBX/pNqPzDR89ccP5XkEE/daOyaD3wVtDGDUND5b/' -s /bin/bash -U gameserver

View file

@ -33,6 +33,7 @@ COPY dist/docker/server/debian/common/configure_database.sh /opt/
COPY dist/docker/server/debian/common/initialize_khanat_server.sh /opt/
COPY dist/docker/server/debian/common/initialize_patch_server.sh /opt/
COPY dist/docker/server/debian/common/prepare_start_server.sh /opt/
COPY dist/docker/server/debian/common/prepare_khanat_client.sh /opt/
COPY ryzomcore.tar.gz /opt/
COPY ryzom-ressources.tar.gz /opt/

View file

@ -34,6 +34,7 @@ declare -i KHANAT_CLIENT_VERSION=1
declare -i SHOWIPKHANATSERVER=0
declare -i METHODSTARTSERVER=1
declare -i CLEANIMAGENONE=0
declare DOCKERBUILDOPT=""
declare IMAGEGENERICSERVER="server_generic_debian_jessie_x86_64"
declare IMAGEKHANATSERVER="server_khanat_debian_jessie_x86_64"
@ -134,6 +135,7 @@ do
;;
-b|--force-basic)
BASICSERVER=1
DOCKERBUILDOPT="$DOCKERBUILDOPT --no-cache"
shift
;;
-n|--no-launch-khanat)
@ -377,7 +379,7 @@ fi
if [[ $BASICSERVER -ne 0 ]]
then
msg_info "GENERATE DOCKER IMAGE BASIC SERVER"
cd $rootdir; docker build . -t ${IMAGEGENERICSERVER} \
cd $rootdir; docker build . ${DOCKERBUILDOPT} -t ${IMAGEGENERICSERVER} \
--file "${basedir}/Dockerfile" || exit 2
fi