-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
65 lines (54 loc) · 2.05 KB
/
installer.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
#!/bin/bash
# Script de instalación para ProFileX
# Mantained by: Felipe Alfonso Gonzalez <[email protected]>
# Version: 0.0.5
# Description: ProFileX is a Linux file management tool with a GTK3-based GUI.
# License: BSD-3-Clause
# URL: https://github.com/felipealfonsog/ProFileX
# Variables
pkgname="profilex"
pkgver="0.0.6"
srcdir="/tmp/${pkgname}-${pkgver}"
source="https://github.com/felipealfonsog/ProFileX/archive/refs/tags/v.${pkgver}.tar.gz"
bin_path="/usr/local/bin/profilex"
icon_path="/usr/share/pixmaps/profilex.png"
desktop_path="/usr/share/applications/profilex.desktop"
# Mostrar créditos
echo "************************************************************"
echo "* Welcome to the installation of ProFileX *"
echo "* Maintained by: Felipe Alfonso Gonzalez <[email protected]> *"
echo "* Version: ${pkgver} *"
echo "* Description: ProFileX is a Linux file management tool with a GTK3-based GUI. *"
echo "* License: BSD-3-Clause *"
echo "* More info: https://github.com/felipealfonsog/ProFileX *"
echo "* Dependencies: gtk3, gcc *"
echo "************************************************************"
echo ""
# Función para preparar el entorno
prepare() {
echo "Preparing build environment..."
mkdir -p "$srcdir"
wget -O "${srcdir}/v.${pkgver}.tar.gz" "$source"
tar xf "${srcdir}/v.${pkgver}.tar.gz" -C "$srcdir" --strip-components=1
}
# Función para construir el paquete
build() {
echo "Building package..."
cd "$srcdir"
gcc $(pkg-config --cflags gtk+-3.0) -o profilex src/main.c src/file_manager.c $(pkg-config --libs gtk+-3.0)
}
# Función para instalar el paquete
package() {
echo "Installing package..."
# Instalación del binario
sudo install -Dm755 profilex "$bin_path"
# Instalación del icono
sudo install -Dm644 src/profilex-iconlogo.png "$icon_path"
# Instalación del archivo .desktop
sudo install -Dm644 src/profilex.desktop "$desktop_path"
}
# Ejecutar funciones
prepare
build
package
echo "Installation complete!"