-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathAeon
130 lines (113 loc) · 3.89 KB
/
Aeon
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
# Update and upgrade system packages
update_system() {
apt-get update && apt-get upgrade -y
}
# Install Python 3.12 and essential dependencies
install_python() {
apt-get install -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.12 python3.12-dev python3.12-venv python3-pip libpython3.12 libpython3.12-dev
}
# Install additional system dependencies
install_dependencies() {
apt-get install -y --no-install-recommends \
apt-utils aria2 curl zstd git libmagic-dev \
locales mediainfo neofetch p7zip-full \
p7zip-rar tzdata wget autoconf automake \
build-essential cmake g++ gcc gettext \
gpg-agent intltool libtool make unzip zip \
libcurl4-openssl-dev libsodium-dev libssl-dev \
libcrypto++-dev libc-ares-dev libsqlite3-dev \
libfreeimage-dev swig libboost-all-dev \
libpthread-stubs0-dev zlib1g-dev
}
# Download and install qbittorrent-nox based on system architecture
install_qbittorrent() {
ARCH=$(uname -m)
mkdir -p /usr/local/bin
case "$ARCH" in
x86_64)
wget -qO /usr/local/bin/xnox https://github.com/userdocs/qbittorrent-nox-static/releases/latest/download/x86_64-qbittorrent-nox
;;
aarch64)
wget -qO /usr/local/bin/xnox https://github.com/userdocs/qbittorrent-nox-static/releases/latest/download/aarch64-qbittorrent-nox
;;
*)
echo "Unsupported architecture for qbittorrent-nox: $ARCH"
exit 1
;;
esac
chmod 700 /usr/local/bin/xnox
}
# Install FFmpeg based on system architecture
install_ffmpeg() {
ARCH=$(uname -m)
mkdir -p /Temp
cd /Temp
case "$ARCH" in
x86_64)
wget https://github.com/5hojib/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-linux64-gpl-7.1.tar.xz
;;
aarch64)
wget https://github.com/5hojib/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-linuxarm64-gpl-7.1.tar.xz
;;
*)
echo "Unsupported architecture for FFmpeg: $ARCH"
exit 1
;;
esac
7z x ffmpeg-n7.1-latest-linux*-gpl-7.1.tar.xz
7z x ffmpeg-n7.1-latest-linux*-gpl-7.1.tar
mv /Temp/ffmpeg-n7.1-latest-linux*/bin/ffmpeg /usr/bin/xtra
mv /Temp/ffmpeg-n7.1-latest-linux*/bin/ffprobe /usr/bin/ffprobe
mv /Temp/ffmpeg-n7.1-latest-linux*/bin/ffplay /usr/bin/ffplay
chmod +x /usr/bin/xtra /usr/bin/ffprobe /usr/bin/ffplay
}
# Install rclone and rename binaries
install_rclone() {
curl https://rclone.org/install.sh | bash
mv /usr/bin/rclone /usr/bin/xone
mv /usr/bin/aria2c /usr/bin/xria
}
# Install Python packages
install_python_packages() {
pip3 install --break-system-packages --no-cache-dir -U setuptools uv
}
# Clone and build MEGA SDK
build_mega_sdk() {
git clone https://github.com/meganz/sdk.git --depth=1 -b v4.8.0 /home/sdk
cd /home/sdk
rm -rf .git
autoupdate -fIv && ./autogen.sh
./configure --disable-silent-rules --enable-python --with-sodium --disable-examples
make -j$(nproc --all)
cd bindings/python/
python3.12 setup.py bdist_wheel
pip3 install --break-system-packages --no-cache-dir dist/megasdk-4.8.0-*.whl
}
# Clean up unnecessary packages and temporary files
cleanup() {
apt-get remove -y \
autoconf automake build-essential cmake g++ gcc gettext \
gpg-agent intltool libtool make unzip zip libcurl4-openssl-dev \
libssl-dev libc-ares-dev libsqlite3-dev swig libboost-all-dev \
libpthread-stubs0-dev zlib1g-dev
apt-get autoremove -y
apt-get autoclean -y
rm -rf /Temp Aeon Dockerfile
}
# Main script execution
main() {
update_system
install_python
install_dependencies
install_qbittorrent
install_ffmpeg
install_rclone
install_python_packages
build_mega_sdk
cleanup
}
main