-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-spm.sh
executable file
·91 lines (83 loc) · 3.71 KB
/
build-spm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash -e
# Title: spm
# Description: Downloads and installs AppImages and precompiled tar archives. Can also upgrade and remove installed packages.
# Dependencies: GNU coreutils, tar, wget
# Author: simonizor
# Website: http://www.simonizor.gq
# License: GPL v2.0 only
# Script for building releases of spm
BUILD_DIR="/run/media/simonizor/USBHDD/github/all-releases"
VERSION="0.6.4"
mkdir -p "$BUILD_DIR"/deps/extracted
mkdir "$BUILD_DIR"/spm.AppDir
debiangetlatestdebfunc () {
DEB_RELEASE="$1"
DEB_ARCH="$2"
DEB_NAME="$3"
LATEST_DEB_URL="$(wget "https://packages.debian.org/$DEB_RELEASE/$DEB_ARCH/$DEB_NAME/download" -qO - | grep "<li>*..*$DEB_ARCH.deb" | cut -f2 -d'"' | head -n 1)"
wget --no-verbose --read-timeout=30 "$LATEST_DEB_URL" -O "$BUILD_DIR"/deps/"$DEB_NAME".deb
}
debiangetlatestdebfunc "buster" amd64 "wget"
debiangetlatestdebfunc "buster" amd64 "libgnutls30"
debiangetlatestdebfunc "buster" amd64 "libidn2-0"
debiangetlatestdebfunc "buster" amd64 "libunistring2"
debiangetlatestdebfunc "buster" amd64 "libnettle6"
debiangetlatestdebfunc "buster" amd64 "libpcre3"
debiangetlatestdebfunc "buster" amd64 "libpsl5"
debiangetlatestdebfunc "buster" amd64 "libuuid1"
debiangetlatestdebfunc "buster" amd64 "zlib1g"
cd "$BUILD_DIR"/deps/extracted
debextractfunc () {
ar x "$BUILD_DIR"/deps/"$1"
rm -f "$BUILD_DIR"/deps/extracted/control.tar.gz
rm -f "$BUILD_DIR"/deps/extracted/debian-binary
tar -xf "$BUILD_DIR"/deps/extracted/data.tar.* -C "$BUILD_DIR"/deps/extracted/
rm -f "$BUILD_DIR"/deps/extracted/data.tar.*
if [ -f "$BUILD_DIR"/deps/extracted/usr/share/doc/git/contrib/subtree/COPYING ]; then
rm "$BUILD_DIR"/deps/extracted/usr/share/doc/git/contrib/subtree/COPYING
fi
if [ -f "$BUILD_DIR"/deps/extracted/usr/share/doc/git/contrib/persistent-https/LICENSE ]; then
rm "$BUILD_DIR"/deps/extracted/usr/share/doc/git/contrib/persistent-https/LICENSE
fi
cp -r "$BUILD_DIR"/deps/extracted/* "$BUILD_DIR"/spm.AppDir/
rm -rf "$BUILD_DIR"/deps/extracted/*
}
debextractfunc "wget.deb"
debextractfunc "libgnutls30.deb"
debextractfunc "libnettle6.deb"
debextractfunc "libidn2-0.deb"
debextractfunc "libunistring2.deb"
debextractfunc "libpcre3.deb"
debextractfunc "libpsl5.deb"
debextractfunc "libuuid1.deb"
debextractfunc "zlib1g.deb"
rm -rf "$BUILD_DIR"/deps
mkdir -p "$BUILD_DIR"/spm.AppDir/usr/share/spm
cp ~/github/spm_repo/spm "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/spm.1 "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/spmfunctions.sh "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/appimgfunctions.sh "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/tarfunctions.sh "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/LICENSE "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/jq "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/yaml "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/ssft.sh "$BUILD_DIR"/spm.AppDir/usr/share/spm/
cp ~/github/spm_repo/spm.desktop "$BUILD_DIR"/spm.AppDir/
cp ~/github/spm_repo/spm.png "$BUILD_DIR"/spm.AppDir/
wget "https://raw.githubusercontent.com/simoniz0r/spm-repo/aibs/resources/AppRun" -O "$BUILD_DIR"/spm.AppDir/AppRun
chmod a+x "$BUILD_DIR"/spm.AppDir/AppRun
cat >"$BUILD_DIR"/AppRun.conf << EOL
APPRUN_SET_PATH="TRUE"
APPRUN_SET_LD_LIBRARY_PATH="TRUE"
APPRUN_SET_PYTHONPATH="FALSE"
APPRUN_SET_PYTHONHOME="FALSE"
APPRUN_SET_PYTHONDONTWRITEBYTECODE="FALSE"
APPRUN_SET_XDG_DATA_DIRS="TRUE"
APPRUN_SET_PERLLIB="FALSE"
APPRUN_SET_GSETTINGS_SCHEMA_DIR="FALSE"
APPRUN_SET_QT_PLUGIN_PATH="FALSE"
APPRUN_EXEC="./usr/share/spm/spm"
EOL
appimagetool "$BUILD_DIR"/spm.AppDir "$BUILD_DIR"/spm-"$VERSION"-x86_64.AppImage || exit 1
rm -rf "$BUILD_DIR"/spm.AppDir
exit 0