upstream v20181124, with provided single-user Linux installer

master
Y 2019-08-11 20:56:55 +02:00
parent 440d893b68
commit 444a5da7b2
5 changed files with 55 additions and 91 deletions

View File

@ -1,26 +1,15 @@
# Generated by makepkg 4.2.1
# Tue Jun 9 17:02:44 UTC 2015
pkgbase = ysflight
pkgdesc = A portable flight simulator
pkgver = 20150523
pkgrel = 2
pkgver = 20181124
pkgrel = 1
url = http://wwwe.ysflight.com/
arch = i686
arch = x86_64
license = freeware
depends = zenity
depends = lib32-libpulse
depends = lib32-glu
source = http://ysflight.in.coocan.jp/download/YsflightForLinux.zip
source = ysflight.desktop
source = ysflight-server.desktop
source = ysflight.png
makedepends = python
source = YsflightForLinux.zip::https://forum.ysfhq.com/download/file.php?id=499
source = ysflight.sh
md5sums = 2257ce6d2041f55f7a17a1d4034983af
md5sums = d137828b093f2e16f289f5a3d922f31c
md5sums = eb042809766b50b7195065f8d2e0692b
md5sums = a544483da4de1585434c0c134eb60be0
md5sums = a72ce06ebea39126edd88d512d763115
md5sums = 26a8f7bcc79eb710895547f052a09fef
md5sums = 540ca8dec29fec23c67f830c6cce5d5c
pkgname = ysflight

View File

@ -1,44 +1,63 @@
# Maintainer: Yves G. <theYinYeti@yalis.fr>
pkgname=ysflight
pkgver=20150523
pkgrel=2
pkgver=20181124
pkgrel=1
pkgdesc="A portable flight simulator"
arch=('i686' 'x86_64')
arch=('x86_64')
url="http://wwwe.ysflight.com/"
license=('freeware')
depends=(zenity lib32-libpulse lib32-glu)
makedepends=(python)
ysflight_dir="/opt/ysflight-$pkgver"
source=('http://ysflight.in.coocan.jp/download/YsflightForLinux.zip'
'ysflight.desktop'
'ysflight-server.desktop'
'ysflight.png'
source=('YsflightForLinux.zip::https://forum.ysfhq.com/download/file.php?id=499'
'ysflight.sh')
md5sums=('2257ce6d2041f55f7a17a1d4034983af'
'd137828b093f2e16f289f5a3d922f31c'
'eb042809766b50b7195065f8d2e0692b'
'a544483da4de1585434c0c134eb60be0'
'a72ce06ebea39126edd88d512d763115')
md5sums=('26a8f7bcc79eb710895547f052a09fef'
'540ca8dec29fec23c67f830c6cce5d5c')
build() {
cd "${srcdir}/"
prepare() {
cd "${srcdir}"
sed -i "s#YSFLIGHT_DIR#${ysflight_dir}#g" ysflight.sh
cd "${srcdir}/Ysflight"
sed -ri "
s#^([[:blank:]]*)input\\(.*#\\1pass#
s#join\\(\"~\",\"Desktop\"#join(\"${pkgdir}/usr/share/applications\"#
s#Exec=\"\\+exe#Exec=/usr/bin/\"+os.path.basename(exe)#
s#isfile\\(iconfile\\)#isfile(\"${pkgdir}\"+iconfile)#
/Path=/d
s#YSFLIGHTPATH=.*#YSFLIGHTPATH=\"${ysflight_dir}\"#
s#to ~/YSFLIGHT.COM/ysflight#to ${ysflight_dir}#
s#(isdir|rmtree)\\(YSFLIGHTPATH\\)#\\1(\"${pkgdir}\"+YSFLIGHTPATH)#
s#(copytree\\(FindYsflight.*,)YSFLIGHTPATH#\1\"${pkgdir}\"+YSFLIGHTPATH#
s#(FileCheck\\()YSFLIGHT#\1\"${pkgdir}\"+YSFLIGHT#
" InstallInLinux.py
}
package() {
cd "${pkgdir}/"
echo '
[WARNING!]
[WARNING!] This installer does its best to enforce
[WARNING!] Linux standard file locations. Unfortunately,
[WARNING!]$HOME/Documents/YSFLIGHT.COM ”
[WARNING!] is hard-coded into the binary programs…
[WARNING!]
'
mkdir -p "$(dirname "${ysflight_dir#/}")"
cp -a "${srcdir}/Ysflight" "${ysflight_dir#/}"
cd "${pkgdir}"
mkdir -p usr/bin usr/share/applications opt
cd "${srcdir}/Ysflight"
python InstallInLinux.py
cd "${pkgdir}"
find "${ysflight_dir#/}" -type d -exec chmod 755 {} \;
find "${ysflight_dir#/}" ! -type d -exec chmod 444 {} \;
chmod 555 "${ysflight_dir#/}"/ysflight/ysflight*_*
install -Dm755 "${srcdir}/ysflight.sh" usr/bin/ysflight
chmod 555 "${ysflight_dir#/}"/ysflight64_*
install -Dm555 "${srcdir}/ysflight.sh" usr/bin/ysflight
touch usr/bin/ysflight
ln -s ysflight usr/bin/ysflight-server
install -Dm444 "${srcdir}/ysflight.png" usr/share/pixmaps/ysflight.png
install -Dm755 "${srcdir}/ysflight.desktop" usr/share/applications/ysflight.desktop
install -Dm755 "${srcdir}/ysflight-server.desktop" usr/share/applications/ysflight-server.desktop
ln -s ysflight usr/bin/ysflight64_gl1
ln -s ysflight usr/bin/ysflight64_gl2
ln -s ysflight usr/bin/ysflight64_nownd
}

View File

@ -1,11 +0,0 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Server for YsFlight
Name[fr]=Serveur YsFlight
Comment=A portable flight simulator
Comment[fr]=Simulateur de vol multi-plateformes
Exec=ysflight-server
Icon=ysflight
Terminal=true
Categories=Game;Simulation;

View File

@ -1,10 +0,0 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=YsFlight
Comment=A portable flight simulator
Comment[fr]=Simulateur de vol multi-plateformes
Exec=ysflight
Icon=ysflight
Terminal=false
Categories=Game;Simulation;

View File

@ -3,42 +3,19 @@
# Mirror files to the home directory
if [ ! -d "$HOME/.config/ysflight" ]; then
[ -d "$HOME/.config" ] || mkdir "$HOME/.config"
cp -r "YSFLIGHT_DIR/ysflight/config" "$HOME/.config/ysflight"
cp -r "YSFLIGHT_DIR/config" "$HOME/.config/ysflight"
fi
if [ -d "$HOME/.cache/ysflight" ] && [ "$0" -nt "$HOME/.cache/ysflight" ]; then
rm -rf "$HOME/.cache/ysflight"
fi
if [ ! -d "$HOME/.cache/ysflight" ]; then
mkdir -p "$HOME/.cache/ysflight"
# lndir without lndir…
find "YSFLIGHT_DIR/ysflight" -mindepth 1 -printf '%y\t%P\n' \
| while IFS=$'\t' read t n; do case $t in
d) mkdir "$HOME/.cache/ysflight/$n" ;;
*) ln -s "YSFLIGHT_DIR/ysflight/$n" "$HOME/.cache/ysflight/$n" ;;
esac; done
cp -rs "YSFLIGHT_DIR" "$HOME/.cache/ysflight"
rm -rf "$HOME/.cache/ysflight/config"
ln -s "$HOME/.config/ysflight" "$HOME/.cache/ysflight/config"
fi
# Launch YsFlight
cd "$HOME/.cache/ysflight/"
arch=$(uname -m | grep -o 64 || echo 32)
conf="$HOME/.config/ysflight/archlinux"
if [ "${0##*/}" == 'ysflight-server' ]; then
exec ./ysflight${arch}_nownd "$@"
else
# Setup
while [ ! -f "$HOME/.config/ysflight/archlinux" ]; do
version=$(zenity --list --radiolist --print-column=2 --hide-column=2 \
--title 'Choose your YsFlight binary' \
--text "The choice is stored in ${conf}; remove this file to get this dialog again." \
--column="Choice" --column "" --column="Binary" \
1 gl1 'OpenGL 1.x' \
2 gl2 'OpenGL 2.0' || exit 1)
[ -n "$version" ] && printf 'version="%s"\n' "$version" >"$conf"
done
. "$conf"
# Run
exec ./ysflight${arch}_${version} "$@"
fi
exe="${0##*/}"
[ -e "$exe" ] || exe="ysflight64_gl2"
exec ./$exe "$@"