forked from wifislax-ng/wifislax-updaters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlazarus_updater
executable file
·100 lines (88 loc) · 2.77 KB
/
lazarus_updater
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
#!/bin/sh
# Script by www.seguridadwireless.net
SCRIPT_VERSION=20160219
############################################################
## Funciones comunes. Su nombre empieza por f_ ##
############################################################
f_variables(){
. /opt/wifislax-updaters/Funciones/funciones_updater
}
############################################################
## Funciones propias del script. Su nombre empieza por F_ ##
############################################################
# Definicion de variables
F_variables() {
PRGNAM=lazarus
echo -ne "\033]2;${PRGNAM}_updater\007"
WEB=https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/
RAMA=$(curl -s $WEB | grep -m1 "class=\"folder"|sed 's/ //g'|cut -d '"' -f2|sed 's/Lazarus//g')
VERSION=`curl -s ${WEB}Lazarus%20${RAMA}/|grep tar.gz|head -1|cut -d- -f2|sed 's/ //g'`
EXTENSION=tar.gz
SOURCES=$PRGNAM-$VERSION-0.$EXTENSION
DOWNLOAD="https://sourceforge.net/projects/$PRGNAM/files/Lazarus%20Zip%20_%20GZip/Lazarus%201.6/$SOURCES"
}
# Comprobar dependencias
F_dependencias(){
DEPENDENCIAS="fpc"
f_dependencias
}
# Descomprimimos el fichero descargado y compilamos
F_compilar(){
LCL=${LCL:-gtk2}
if [ "$LCL" = "qt" ]; then
OPT="-dUSE_QT_45"
fi
# Compilation doesn't need ./configure
make clean
make -j1 all \
PREFIX=/usr \
LCL_PLATFORM=${LCL} \
OPT=${OPT} || exit 1
make install \
INSTALL_PREFIX=$PKG/usr \
INSTALL_MAN_DIR=$PKG/usr/man
# fix links at /usr/bin
( cd $PKG/usr/bin
ln -sf ../share/lazarus/lazarus
ln -sf ../share/lazarus/lazbuild
ln -sf ../share/lazarus/startlazarus
)
# Install desktop file, icon, and mime entry
mkdir -p $PKG/usr/share/{applications,pixmaps,mime/packages}
cat install/lazarus.desktop > $PKG/usr/share/applications/lazarus.desktop
cat images/ide_icon48x48.png > $PKG/usr/share/pixmaps/lazarus.png
cat install/lazarus-mime.xml > $PKG/usr/share/mime/packages/lazarus-mime.xml
}
###################################
## BLOQUE PRINCIPAL DE EJECUCION ##
###################################
# Si se cierra el script inesperadamente, ejecutar la funcion de limpieza
trap f_exitmode SIGHUP SIGINT
#Inicializamos las variables globales
f_variables
#Comprobamos conexion a Internet
f_comprobarConexion
#Inicializamos las variables del script
F_variables
#Creamos directorio de trabajo
f_directorioTemporal
#Mostramos el mensaje de presentacion
f_presentacion
#Comprobamos updates del script
f_comprobarUpdates
#Asignamos o detectamos arquitectura
f_arquitectura
#Comprobamos version instalada del paquete
f_versionInstalada
#Compronar dependencias
F_dependencias
#Si no existe el fichero se descargara
f_download
#Preparando entorno
f_preparar
#Descomprimir fichero descargado y compilamos
F_compilar
#Hacemos strip sobre el paquete
f_strip
#Creamos xzm , instalamos y salimos
f_tareasFinales