/ programs / i686 / supertuxkart
supertuxkart
  1  #!/bin/sh
  2  
  3  # AM INSTALL SCRIPT VERSION 3. 
  4  set -u
  5  APP=supertuxkart
  6  SITE="supertuxkart/stk-code"
  7  
  8  # CREATE DIRECTORIES AND ADD REMOVER
  9  [ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
 10  printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > ../remove
 11  printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove
 12  chmod a+x ../remove || exit 1
 13  
 14  # DOWNLOAD AND PREPARE THE APP, $version is also used for updates
 15  version=$(curl -Ls https://api.github.com/repos/supertuxkart/stk-code/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*linux.*tar.xz$" | grep -v "arm\|64" | head -1)
 16  wget "$version" || exit 1
 17  [ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z
 18  [ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.*
 19  [ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip
 20  cd ..
 21  if [ -d ./tmp/* 2>/dev/null ]; then mv ./tmp/*/* ./; else mv ./tmp/* ./"$APP" 2>/dev/null || mv ./tmp/* ./; fi
 22  rm -R -f ./tmp || exit 1
 23  echo "$version" > ./version
 24  chmod a+x ./run_game.sh || exit 1
 25  
 26  # LINK TO PATH
 27  ln -s "/opt/$APP/run_game.sh" "/usr/local/bin/$APP"
 28  
 29  # SCRIPT TO UPDATE THE PROGRAM
 30  cat >> ./AM-updater << 'EOF'
 31  #!/bin/sh
 32  set -u
 33  APP=supertuxkart
 34  SITE="supertuxkart/stk-code"
 35  version0=$(cat "/opt/$APP/version")
 36  version=$(curl -Ls https://api.github.com/repos/supertuxkart/stk-code/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*linux.*tar.xz$" | grep -v "arm\|64" | head -1)
 37  [ -n "$version" ] || { echo "Error getting link"; exit 1; }
 38  if [ "$version" != "$version0" ]; then
 39  	mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
 40  	notify-send "A new version of $APP is available, please wait"
 41  	wget "$version" || exit 1
 42  	[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z
 43  	[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.*
 44  	[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip
 45  	cd ..
 46  	if [ -d ./tmp/* 2>/dev/null ]; then mv --backup=t ./tmp/*/* ./; else mv --backup=t ./tmp/* ./"$APP" 2>/dev/null || mv --backup=t ./tmp/* ./; fi
 47  	chmod a+x ./run_game.sh || exit 1
 48  	echo "$version" > ./version
 49  	rm -R -f ./tmp ./*~
 50  	notify-send "$APP is updated!"
 51  else
 52  	echo "Update not needed!"
 53  fi
 54  EOF
 55  chmod a+x ./AM-updater || exit 1
 56  
 57  # ICON
 58  mkdir -p icons
 59  cp ./data/*512.png ./icons/"$APP" 2> /dev/null
 60  
 61  # LAUNCHER
 62  echo "[Desktop Entry]
 63  Name=SuperTuxKart
 64  Icon=/opt/$APP/icons/$APP
 65  #I18N: Generic name in desktop file entry, summary in AppData and short description in Google Play
 66  GenericName[ar]=لعبة سباق سيارات ثلاثية الأبعاد مفتوحة المصدر
 67  GenericName[be]=3D-гульня для гонак на картах з адкрытым зыходным кодам
 68  GenericName[bg]=3-измерна състезателна игра с колички, с отворен код
 69  GenericName[ca]=Un joc de curses de karts en 3D de codi obert.
 70  GenericName[cs]=3D open source závodní hra motokár
 71  GenericName[da]=Et 3D-kartracerspil i open source
 72  GenericName[de]=Ein Open-Source 3D-Kart-Rennspiel
 73  GenericName[el]=Ενα 3D ανοιχτού κώδικα παιχνίδι  αγώνων με κάρτ 
 74  GenericName[eo]=3D-a malfermitkoda karta vetkurad-ludo
 75  GenericName[es]=Un juego de carreras de karts en 3D de código abierto.
 76  GenericName[eu]=Kart lasterketetako 3D jolas librea
 77  GenericName[fi]=Avoimen lähdekoodin kolmiulotteinen kilpa-ajopeli
 78  GenericName[fil]=Isang 3D at open-source na kart racing game.
 79  GenericName[fr]=Un jeu libre de course de karts en 3D
 80  GenericName[gd]=Geama rèisidh chartaichean 3D le bun-tùs fosgailte
 81  GenericName[gl]=Un xogo de carreiras de karts en 3D e de código aberto.
 82  GenericName[he]=משחק מֵרוצי מכוניות בתלת־ממד ובקוד פתוח
 83  GenericName[hu]=Egy 3D-s, nyílt forráskódú gokartverseny játék
 84  GenericName[id]=Sebuah permainan balap kart 3D sumber-terbuka
 85  GenericName[it]=Un gioco open-source 3D di corse su kart
 86  GenericName[ja]=オープンソースな3Dレーシングカートゲーム
 87  GenericName[ko]=3D 오픈소스 카트 경주 게임
 88  GenericName[mk]=3D open-source тркачка картинг игра
 89  GenericName[ml]=ഒരു സ്വതന്ത്ര 3D കാർട്ട് റേസിംഗ് ഗെയിം
 90  GenericName[nl]=Een open source 3D kartracespel
 91  GenericName[nn]=Eit racerspel i 3D med open kjeldekode
 92  GenericName[oc]=Un jòc de corsa de kart liure en 3D
 93  GenericName[pl]=Trójwymiarowe wyścigi gokartów open-source
 94  GenericName[pt]=Um jogo 3D de karting com mascotes de aplicativos open source.
 95  GenericName[pt_BR]=Corridas de kart em 3D e código aberto
 96  GenericName[ro]=Un joc de curse 3D open-source
 97  GenericName[ru]=Свободная трёхмерная гоночная игра на машинках
 98  GenericName[rue]=3х-мірна возикова перебігова бавка
 99  GenericName[sk]=3D open-source závodná hra v štýle arkády
100  GenericName[sl]=3D odprtokodna dirkalna igra
101  GenericName[sr]=Игра тркања колицима слободног кода
102  GenericName[sv]=Ett 3D-racingspel med öppen källkod
103  GenericName[th]=เกมแข่งรถโอเพ่นซอร์ส 3 มิติ
104  GenericName[tr]=3D açık kaynaklı kart yarış oyunu
105  GenericName[zh_CN]=一个三维开源赛车游戏
106  GenericName[zh_HK]=3D 開源卡丁車賽車遊戲
107  GenericName[zh_TW]=3D 開源卡丁車賽車遊戲
108  GenericName=A 3D open-source kart racing game
109  Exec=supertuxkart
110  Terminal=false
111  StartupNotify=false
112  Type=Application
113  Categories=Game;ArcadeGame;
114  #I18N: Keywords in desktop entry, translators please keep it separated with semicolons
115  Keywords[ar]=بطريق؛لعبة؛سباق؛
116  Keywords[be]=tux;game;race;тукс;такс;гульня;гонка;футбол;
117  Keywords[bg]=тъкс;кола;коли;количка;колички;състезание;състезания
118  Keywords[ca]=tux;joc;cursa;
119  Keywords[cs]=tux;hra;závod;
120  Keywords[da]=tux;spil;racerløb;
121  Keywords[de]=tux;spiel;rennen;
122  Keywords[el]=tux;παιχνίδι;αγώνας;
123  Keywords[eo]=tukso;ludo;vetkuro;
124  Keywords[es]=tux;juego;carreras;
125  Keywords[fi]=tux;game;race;peli;ralli;kilpa-ajo;autopeli;
126  Keywords[fil]=tux;game;race;
127  Keywords[fr]=tux;jeu;course;
128  Keywords[gd]=tux;game;race;geama;rèis;rèiseadh;
129  Keywords[gl]=tux;xogo;carreira;
130  Keywords[he]=tux;game;race;טקס;טאקס;טוקס;משחק;מרוץ;מרוצים;מירוץ;מירוצים;
131  Keywords[hr]=tux;igra;utrka
132  Keywords[hu]=tux;játék;verseny;
133  Keywords[id]=tux;permainan;balapan;
134  Keywords[it]=tux;gioco;gara;
135  Keywords[ja]=tux;game;race;
136  Keywords[ko]=턱스;게임;경주
137  Keywords[mk]=тукс;игра;трка;
138  Keywords[ml]=ടക്സ്;ഗെയിം;റേസ്;
139  Keywords[nl]=tux;game;race;spel;kart;super;auto;parcours;
140  Keywords[nn]=tux;spel;billøp;racerspel;
141  Keywords[oc]=tux;game;race;corsa;jòc;
142  Keywords[pl]=tux;gra;wyścigi;
143  Keywords[pt]=tux;jogo;corrida
144  Keywords[pt_BR]=tux;jogo;corrida;
145  Keywords[ro]=tux;joc;cursa
146  Keywords[ru]=такс;игра;гонка;
147  Keywords[rue]=tux;бавка;гонитва;
148  Keywords[sk]=tučniak;hra;závody;
149  Keywords[sl]=tuks;igra;dirka;
150  Keywords[sr]=такс;игра;трка;тукс;игрица;
151  Keywords[sv]=tux;spel;tävla;
152  Keywords[th]=tux;game;race;
153  Keywords[tr]=tux;oyun;yarış;
154  Keywords[tt]=tux;game;race;
155  Keywords[uk]=пінгвін;гра;перегони;
156  Keywords[zh_CN]=企鹅、游戏、赛车
157  Keywords[zh_HK]=tux;game;race;
158  Keywords[zh_TW]=tux;game;race;
159  Keywords=tux;game;race;
160  PrefersNonDefaultGPU=true" > /usr/local/share/applications/"$APP"-AM.desktop