summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeSnake042021-07-25 22:50:04 +0200
committerLeSnake042021-07-25 22:50:04 +0200
commitc966459631a5323de391f35e9c14b60221646bab (patch)
tree31e5f7c83f7fbf00283048a9d750ffd6716acaa6
parentf89a76121cf9125ea17be293c3781a2dd451f61c (diff)
downloadaur-c966459631a5323de391f35e9c14b60221646bab.tar.gz
added script to install data files
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD53
-rw-r--r--flashpoint-install-data-files.sh78
-rw-r--r--flashpoint-launcher-bin.install6
5 files changed, 122 insertions, 39 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fd36efceff2c..b251ff2852df 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = flashpoint-launcher-bin
- pkgdesc = Launcher for BlueMaxima's Flashpoint - Does not include data files! - Launcher software only.
+ pkgdesc = Launcher for BlueMaxima's Flashpoint with script to install data files
pkgver = 10.0.0
- pkgrel = 2
+ pkgrel = 4
url = https://github.com/FlashpointProject/launcher
+ install = flashpoint-launcher-bin.install
arch = x86_64
license = MIT
depends = nss>=3.0
@@ -13,14 +14,11 @@ pkgbase = flashpoint-launcher-bin
optdepends = flashplayer-standalone: native Flash support
conflicts = flashpoint-bin
conflicts = flashpoint-launcher-git
- source = flashpoint-launcher-bin-10.0.0.7z::https://github.com/FlashpointProject/launcher/releases/download/10.0.0/Flashpoint-10.0.0_linux-x64.7z
- source = icon.png::https://aur.archlinux.org/cgit/aur.git/plain/icon.png?h=flashpoint-launcher-bin
- source = flashpoint.desktop::https://aur.archlinux.org/cgit/aur.git/plain/flashpoint.desktop?h=flashpoint-launcher-bin
- md5sums = cfdebf0c15b03c1a7a6910cc4af7df49
- md5sums = 8d71d8d61a0a39586b81faf9addaeb7a
- md5sums = 4c4d02df6388d9859776a629f0b775ac
- sha256sums = fbcb0403c856a5b738f9837c5dbfea8e5cdc6ff2160b5423d1fd7955d98e3c2a
- sha256sums = 942e3a0c70833fadb25b3bf44503e7590d976f048d04fbe29ae4fc35dbcd5037
- sha256sums = fe9a7031d0b092b205ffac08fb29fc5ff1d96cd29a004b16da1653cda21ce069
+ source = https://github.com/FlashpointProject/launcher/releases/download/10.0.0/Flashpoint-10.0.0_linux-amd64.deb
+ source = flashpoint-install-data-files.sh
+ md5sums = 8e998d8d9c77027a67b30ddd3250ffc5
+ md5sums = 775dd2b78c17a73edb75040fc86ebfe6
+ sha256sums = 19ba5cd803fd05d944df616719eb0e22051d3cc051e8817f4a057d02bf139bfc
+ sha256sums = 3591c14565552897c1028ddc513dfbe0a306b96f571d41509886f83a7bd92cc9
pkgname = flashpoint-launcher-bin
diff --git a/.gitignore b/.gitignore
index 521831c7289c..37f9f0319c00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,6 @@
!.SRCINFO
!PKGBUILD
!icon.png
-!flashpoint.desktop
+!flashpoint-launcher-bin.install
+!flashpoint-install-data-files.sh
+
diff --git a/PKGBUILD b/PKGBUILD
index f56499afde6a..0e7e021cf52e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,8 +2,8 @@
pkgname=flashpoint-launcher-bin
pkgver=10.0.0
-pkgrel=2
-pkgdesc="Launcher for BlueMaxima's Flashpoint - Does not include data files! - Launcher software only."
+pkgrel=4
+pkgdesc="Launcher for BlueMaxima's Flashpoint with script to install data files"
arch=('x86_64')
url="https://github.com/FlashpointProject/launcher"
license=('MIT')
@@ -14,35 +14,34 @@ depends=('nss>=3.0'
'wine')
optdepends=('flashplayer-standalone: native Flash support')
conflicts=('flashpoint-bin' 'flashpoint-launcher-git')
-source=("$pkgname-$pkgver.7z"::"https://github.com/FlashpointProject/launcher/releases/download/10.0.0/Flashpoint-10.0.0_linux-x64.7z"
- "icon.png"::"https://aur.archlinux.org/cgit/aur.git/plain/icon.png?h=flashpoint-launcher-bin"
- "flashpoint.desktop"::"https://aur.archlinux.org/cgit/aur.git/plain/flashpoint.desktop?h=flashpoint-launcher-bin")
-sha256sums=('fbcb0403c856a5b738f9837c5dbfea8e5cdc6ff2160b5423d1fd7955d98e3c2a'
- '942e3a0c70833fadb25b3bf44503e7590d976f048d04fbe29ae4fc35dbcd5037'
- 'fe9a7031d0b092b205ffac08fb29fc5ff1d96cd29a004b16da1653cda21ce069')
-md5sums=('cfdebf0c15b03c1a7a6910cc4af7df49'
- '8d71d8d61a0a39586b81faf9addaeb7a'
- '4c4d02df6388d9859776a629f0b775ac')
+source=("https://github.com/FlashpointProject/launcher/releases/download/10.0.0/Flashpoint-10.0.0_linux-amd64.deb"
+ "flashpoint-install-data-files.sh")
+sha256sums=('19ba5cd803fd05d944df616719eb0e22051d3cc051e8817f4a057d02bf139bfc'
+ '3591c14565552897c1028ddc513dfbe0a306b96f571d41509886f83a7bd92cc9')
+md5sums=('8e998d8d9c77027a67b30ddd3250ffc5'
+ '775dd2b78c17a73edb75040fc86ebfe6')
+install=flashpoint-launcher-bin.install
package(){
- # Symlink to binary (WIP)
- #ln -sf /opt/flashpoint/linux-unpacked/flashpoint-launcher $pkgdir/usr/bin/flashpoint-launcher
+ # Extract package data
+ tar xf data.tar.xz -C ${pkgdir}
- # Desktop Entry
- install -Dm644 $srcdir/flashpoint.desktop $pkgdir/usr/share/applications/flashpoint.desktop
+ # Symlink to binary
+ install -d $pkgdir/usr/bin/
+ ln -sf /opt/Flashpoint/flashpoint-launcher $pkgdir/usr/bin/flashpoint-launcher
# License
- install -Dm644 $srcdir/licenses/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-
- # Icon
- install -Dm644 $srcdir/icon.png "$pkgdir/usr/share/pixmaps/flashpoint.png"
-
- rm $srcdir/$pkgname-$pkgver.7z
- rm $srcdir/icon.png
- rm $srcdir/flashpoint.desktop
-
- # Application
- mkdir -p $pkgdir/opt/flashpoint $pkgdir/usr/share/pixmaps/
- cp -R $srcdir/* "$pkgdir/opt/flashpoint"
+ install -d $pkgdir/usr/share/licenses/
+ mv $pkgdir/opt/Flashpoint/licenses/ $pkgdir/usr/share/licenses/Flashpoint
+
+ install -Dm755 $srcdir/flashpoint-install-data-files.sh $pkgdir/usr/bin/flashpoint-install-data-files
+
+ # Make config and preferences writable by all
+ touch "${pkgdir}/opt/Flashpoint/config.json"
+ chmod 666 "${pkgdir}/opt/Flashpoint/config.json"
+ touch "${pkgdir}/opt/Flashpoint/preferences.json"
+ chmod 666 "${pkgdir}/opt/Flashpoint/preferences.json"
+ touch "${pkgdir}/opt/Flashpoint/launcher.log"
+ chmod 666 "${pkgdir}/opt/Flashpoint/launcher.log"
}
diff --git a/flashpoint-install-data-files.sh b/flashpoint-install-data-files.sh
new file mode 100644
index 000000000000..d894fe1190f1
--- /dev/null
+++ b/flashpoint-install-data-files.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+FILENAME="./infinity-data-8-2-2b.7z"
+DOWNLOAD_URL="https://bluepload.unstable.life/selif/infinity-data-8-2-2b.7z"
+VALID_SIGNATURE="73ba75598b352244e4a0fda80800fcd1c99f8d98723a83cb495d152f28fcdfed $FILENAME"
+DOWNLOAD_PATH=~/.cache/flashpoint-data
+DOWNLOAD_FULLPATH="$DOWNLOAD_PATH/$FILENAME"
+TARGET_PATH=~/.local/share/flashpoint
+
+downloaddata(){
+ echo "Downloading to $DOWNLOAD_FULLPATH"
+ wget $DOWNLOAD_URL
+}
+
+getfilesignature(){
+ sha256sum $FILENAME
+}
+
+printfilesignature(){
+ printf "Actual file signature: \n$(getfilesignature)\nExpected file signature: \n$VALID_SIGNATURE\n"
+}
+
+checkfilesignature(){
+ if [ "$(getfilesignature)" = "$VALID_SIGNATURE" ]; then
+ echo true
+ else
+ echo false
+ fi
+}
+
+unpackfiles(){
+ echo "Unpacking files ..."
+ mkdir -p $TARGET_PATH
+ 7z x $FILENAME -o$TARGET_PATH -aoa
+}
+
+installwithcheck(){
+ mkdir -p $DOWNLOAD_PATH
+ cd $DOWNLOAD_PATH
+# Download Archive
+ echo "Downloading data ..."
+ if [ -f $FILENAME ]; then
+ echo "File already found"
+ if $(checkfilesignature); then
+ echo "valid signature > using cached file"
+ else
+ echo "Invalid signature > redownloading"
+ rm $FILENAME
+ downloaddata
+ fi
+ else
+ downloaddata
+ fi
+ printfilesignature
+# Extract archive
+ if $(checkfilesignature) ; then
+ echo "Valid signature"
+ unpackfiles
+ else
+ echo "invalid file signature"
+ fi
+}
+
+case $1 in
+ 'install' )
+ installwithcheck
+ ;;
+ 'force-install' )
+ rm -f $FILENAME
+ downloaddata
+ unpackfiles
+ ;;
+# check' )
+# if [ -f $TARGET_PATH/flashpoint.sqlite ]
+# ;;
+ * )
+ printf "Command line tool to install package files \nCommands:\ninstall : install with integrity check\nforce--install: install without integrity check"
+esac
diff --git a/flashpoint-launcher-bin.install b/flashpoint-launcher-bin.install
new file mode 100644
index 000000000000..5306b65af3d7
--- /dev/null
+++ b/flashpoint-launcher-bin.install
@@ -0,0 +1,6 @@
+post_install(){
+ echo "make sure to install data files with 'flashpoint-install-data-files install'"
+}
+post_upgrade(){
+ echo "make sure to install data files with 'flashpoint-install-data-files install'"
+}