mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 14:52:05 +01:00
Refactor debian-packager.sh, rename launcher scripts (#303)
* Improve windows-bundler.sh * Overhaul debian-packager.sh. Rename base package name to tachidesk-server * Add -electron-launcher-debian.sh
This commit is contained in:
@@ -6,43 +6,46 @@
|
|||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
echo "creating debian package"
|
echo "Creating DEB Package"
|
||||||
|
pkgname="tachidesk-server"
|
||||||
|
PkgName="Tachidesk-Server"
|
||||||
jar=$(ls ../server/build/*.jar | tail -n1)
|
jar=$(ls ../server/build/*.jar | tail -n1)
|
||||||
release_ver=$(tmp="${jar%-*}" && echo "${tmp##*-}" | tr -d v)
|
pkgver="$(tmp="${jar%-*}" && echo "${tmp##*-}" | tr -d v)"
|
||||||
orig_dir="tachidesk-$release_ver" # dir uses hyphen "-"
|
pkgrel=1
|
||||||
orig_tar_gz="tachidesk_$release_ver.orig.tar.gz" # orig file uses underscore "_"
|
|
||||||
package_name="tachidesk_$release_ver-1_all.deb"
|
|
||||||
|
|
||||||
# copy artifacts
|
srcdir="$pkgname-$pkgver" # uses hyphen "-"
|
||||||
mkdir "$orig_dir"
|
srctgz="${pkgname}_$pkgver.orig.tar.gz" # uses underscore "_"
|
||||||
cp "$jar" "$orig_dir/Tachidesk.jar"
|
deb="${pkgname}_$pkgver-${pkgrel}_all.deb"
|
||||||
cp -r "resources/debian" "$orig_dir"
|
Deb="${PkgName}_$pkgver-${pkgrel}_all.deb"
|
||||||
cp "resources/tachidesk-browser-launcher-standalone.sh" "$orig_dir/debian"
|
|
||||||
cp "resources/tachidesk-debug-launcher-standalone.sh" "$orig_dir/debian"
|
|
||||||
cp "resources/tachidesk-electron-launcher-standalone.sh" "$orig_dir/debian"
|
|
||||||
cp "resources/tachidesk.desktop" "$orig_dir/debian"
|
|
||||||
cp "../server/src/main/resources/icon/faviconlogo.png" "$orig_dir/debian/tachidesk.png"
|
|
||||||
|
|
||||||
# prepare
|
# Prepare
|
||||||
tar cvzf "$orig_tar_gz" "$orig_dir/Tachidesk.jar"
|
mkdir "$srcdir/"
|
||||||
sed -i "s/\${version}/$release_ver/" "$orig_dir/debian/changelog"
|
cp "$jar" "$srcdir/$pkgname.jar"
|
||||||
|
cp "resources/$pkgname-browser-launcher.sh" "$srcdir/"
|
||||||
|
cp "resources/$pkgname-debug-launcher.sh" "$srcdir/"
|
||||||
|
cp "resources/$pkgname-electron-launcher-debian.sh" "$srcdir/$pkgname-electron-launcher.sh"
|
||||||
|
cp "resources/$pkgname.desktop" "$srcdir/"
|
||||||
|
cp "../server/src/main/resources/icon/faviconlogo.png" "$srcdir/$pkgname.png"
|
||||||
|
|
||||||
# build
|
GZIP=-9 tar -cvzf "$srctgz" "$srcdir/"
|
||||||
mkdir "build"
|
|
||||||
mv $orig_dir $orig_tar_gz "build/"
|
cp -r "resources/debian" "$srcdir/"
|
||||||
cd "build/$orig_dir/debian"
|
sed -i "s/\${pkgver}/$pkgver/" "$srcdir/debian/changelog"
|
||||||
|
sed -i "s/\${pkgrel}/$pkgrel/" "$srcdir/debian/changelog"
|
||||||
|
|
||||||
|
# Build
|
||||||
|
mkdir "debuild/"
|
||||||
|
mv "$srctgz" "$srcdir/" "debuild/"
|
||||||
sudo apt install devscripts build-essential dh-exec
|
sudo apt install devscripts build-essential dh-exec
|
||||||
# --lintian-opts --profile debian: build Debian packages on Ubuntu
|
# --lintian-opts --profile are for building Debian packages on Ubuntu
|
||||||
|
cd "debuild/$srcdir/debian"
|
||||||
debuild -uc -us --lintian-opts --profile debian
|
debuild -uc -us --lintian-opts --profile debian
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# clean build directory
|
|
||||||
mv "build/$package_name" "./"
|
|
||||||
rm -rf "build"
|
|
||||||
|
|
||||||
# clean up from possible previous runs
|
# clean up from possible previous runs
|
||||||
if [ -f "../server/build/$package_name" ]; then
|
if [ -f "../server/build/$Deb" ]; then
|
||||||
rm "../server/build/$package_name"
|
rm "../server/build/$Deb"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv "$package_name" "../server/build/"
|
mv "debuild/$deb" "../server/build/$Deb"
|
||||||
|
rm -rf "debuild/"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
tachidesk (${version}-1) unstable; urgency=medium
|
tachidesk-server (${pkgver}-${pkgrel}) unstable; urgency=medium
|
||||||
|
|
||||||
* See CHANGELOG.md on https://github.com/Suwayomi/Tachidesk-Server
|
* See CHANGELOG.md on https://github.com/Suwayomi/Tachidesk-Server
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Source: tachidesk
|
Source: tachidesk-server
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Mahor Foruzesh <mahorforuzesh@pm.me>
|
Maintainer: Mahor Foruzesh <mahorforuzesh@pm.me>
|
||||||
@@ -6,7 +6,7 @@ Build-Depends: debhelper-compat (= 12), dh-exec
|
|||||||
Standards-Version: 4.5.1
|
Standards-Version: 4.5.1
|
||||||
Homepage: https://github.com/Suwayomi/Tachidesk-Server
|
Homepage: https://github.com/Suwayomi/Tachidesk-Server
|
||||||
|
|
||||||
Package: tachidesk
|
Package: tachidesk-server
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: ${misc:Depends}, default-jre-headless (>= 8)
|
Depends: ${misc:Depends}, default-jre-headless (>= 8)
|
||||||
Description: Manga Reader
|
Description: Manga Reader
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Upstream-Name: tachidesk
|
Upstream-Name: tachidesk-server
|
||||||
Upstream-Contact: https://discord.gg/DDZdqZWaHA
|
Upstream-Contact: https://discord.gg/DDZdqZWaHA
|
||||||
Source: https://github.com/Suwayomi/Tachidesk-Server
|
Source: https://github.com/Suwayomi/Tachidesk-Server
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/usr/bin/dh-exec
|
#!/usr/bin/dh-exec
|
||||||
|
|
||||||
debian/tachidesk-browser-launcher-standalone.sh => usr/bin/tachidesk
|
tachidesk-server-browser-launcher.sh => usr/bin/tachidesk-server-browser
|
||||||
debian/tachidesk-browser-launcher-standalone.sh => usr/bin/tachidesk-browser
|
tachidesk-server-debug-launcher.sh => usr/bin/tachidesk-server-debug
|
||||||
debian/tachidesk-debug-launcher-standalone.sh => usr/bin/tachidesk-debug
|
tachidesk-server-electron-launcher.sh => usr/bin/tachidesk-server-electron
|
||||||
debian/tachidesk-electron-launcher-standalone.sh => usr/bin/tachidesk-electron
|
tachidesk-server.jar usr/share/java/tachidesk-server/
|
||||||
Tachidesk.jar => usr/share/java/tachidesk/tachidesk.jar
|
tachidesk-server.png usr/share/pixmaps/
|
||||||
debian/tachidesk.png usr/share/pixmaps/
|
tachidesk-server.desktop usr/share/applications/
|
||||||
debian/tachidesk.desktop usr/share/applications/
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
debian/tachidesk.png
|
tachidesk-server.png
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
exec /usr/bin/java -jar /usr/share/java/tachidesk/tachidesk.jar
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
./jre/bin/java -jar Tachidesk.jar
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
./jre/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
./jre/bin/java "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/electron" -jar Tachidesk.jar
|
|
||||||
2
scripts/resources/tachidesk-server-browser-launcher.sh
Normal file
2
scripts/resources/tachidesk-server-browser-launcher.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec /usr/bin/java -jar /usr/share/java/tachidesk-server/tachidesk-server.jar
|
||||||
2
scripts/resources/tachidesk-debug-launcher-standalone.sh → scripts/resources/tachidesk-server-debug-launcher.sh
Executable file → Normal file
2
scripts/resources/tachidesk-debug-launcher-standalone.sh → scripts/resources/tachidesk-server-debug-launcher.sh
Executable file → Normal file
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar /usr/share/java/tachidesk/tachidesk.jar
|
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar /usr/share/java/tachidesk-server/tachidesk-server.jar
|
||||||
10
scripts/resources/tachidesk-electron-launcher-standalone.sh → scripts/resources/tachidesk-server-electron-launcher-debian.sh
Executable file → Normal file
10
scripts/resources/tachidesk-electron-launcher-standalone.sh → scripts/resources/tachidesk-server-electron-launcher-debian.sh
Executable file → Normal file
@@ -1,14 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ ! -f /usr/bin/electron ]; then
|
if [ ! -f /usr/bin/electron ]; then
|
||||||
echo "Electron executable was not found!
|
echo "Electron executable was not found
|
||||||
In order to run this launcher, you need Electron installed.
|
In order to run this launcher, you need Electron installed.
|
||||||
|
|
||||||
You can install it with these commands:
|
You can install it with these commands:
|
||||||
sudo apt install npm
|
sudo apt install npm
|
||||||
sudo npm install electron -g
|
sudo npm install electron -g"
|
||||||
"
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.webUIInterface=electron -Dsuwayomi.tachidesk.config.server.electronPath=/usr/bin/electron -jar /usr/share/java/tachidesk/tachidesk.jar
|
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.webUIInterface=electron -Dsuwayomi.tachidesk.config.server.electronPath=/usr/bin/electron -jar /usr/share/java/tachidesk-server/tachidesk-server.jar
|
||||||
3
scripts/resources/tachidesk-server-electron-launcher.sh
Normal file
3
scripts/resources/tachidesk-server-electron-launcher.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.webUIInterface=electron -Dsuwayomi.tachidesk.config.server.electronPath=/usr/bin/electron -jar /usr/share/java/tachidesk-server/tachidesk-server.jar
|
||||||
8
scripts/resources/tachidesk-server.desktop
Normal file
8
scripts/resources/tachidesk-server.desktop
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=Tachidesk-Server
|
||||||
|
Comment=Manga Reader
|
||||||
|
Exec=/usr/bin/java -jar /usr/share/java/tachidesk-server/tachidesk-server.jar "\\$@"
|
||||||
|
Icon=tachidesk-server
|
||||||
|
Terminal=false
|
||||||
|
Categories=Network;
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=Tachidesk
|
|
||||||
Comment=Manga Reader
|
|
||||||
Exec=/usr/bin/java -jar /usr/share/java/tachidesk/tachidesk.jar "\\$@"
|
|
||||||
Icon=tachidesk
|
|
||||||
Terminal=false
|
|
||||||
Categories=Network;
|
|
||||||
@@ -57,11 +57,11 @@ fi
|
|||||||
unzip $electron -d $release_name/electron
|
unzip $electron -d $release_name/electron
|
||||||
|
|
||||||
# copy artifacts
|
# copy artifacts
|
||||||
cp $jar $release_name/Tachidesk.jar
|
cp $jar $release_name/Tachidesk-Server.jar
|
||||||
if [ $os = linux ]; then
|
if [ $os = linux ]; then
|
||||||
cp "resources/tachidesk-browser-launcher.sh" $release_name
|
cp "resources/tachidesk-server-browser-launcher.sh" $release_name
|
||||||
cp "resources/tachidesk-debug-launcher.sh" $release_name
|
cp "resources/tachidesk-server-debug-launcher.sh" $release_name
|
||||||
cp "resources/tachidesk-electron-launcher.sh" $release_name
|
cp "resources/tachidesk-server-electron-launcher.sh" $release_name
|
||||||
elif [ $os = macOS ]; then
|
elif [ $os = macOS ]; then
|
||||||
cp "resources/Tachidesk Browser Launcher.command" $release_name
|
cp "resources/Tachidesk Browser Launcher.command" $release_name
|
||||||
cp "resources/Tachidesk Debug Launcher.command" $release_name
|
cp "resources/Tachidesk Debug Launcher.command" $release_name
|
||||||
|
|||||||
Reference in New Issue
Block a user