forked from wifislax-ng/wifislax-updaters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyad_updater
executable file
·116 lines (100 loc) · 2.88 KB
/
yad_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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/sh
# Script by www.seguridadwireless.net
SCRIPT_VERSION=20160211
############################################################
## 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() {
WEB=https://sourceforge.net/projects/yad-dialog/files/
VERSION=`curl -s $WEB|grep /latest|cut -d "-" -f3|cut -d "t" -f1|sed "s/.$//g"`
PRGNAM=yad
echo -ne "\033]2;${PRGNAM}_updater\007"
EXTENSION=tar.xz
SOURCES=${PRGNAM}-${VERSION}.$EXTENSION
DOWNLOAD=${WEB}$SOURCES
}
# Descomprimimos el fichero descargado y compilamos
F_compilar(){
if [ $VERSION = 0.29.0 ]; then
echo
echo "$VERDE"Detectada version 0.29.0 parcheando ..."$CIERRE"
sleep 1
cat > $PRGNAM.patch << "EOF"
diff -ru a/src/main.c b/src/main.c
--- a/src/main.c 2015-07-22 22:02:17.451773876 -0400
+++ b/src/main.c 2015-07-22 22:02:34.618281726 -0400
@@ -765,6 +765,7 @@
ret = yad_print_run ();
break;
+#ifdef HAVE_HTML
case YAD_MODE_HTML:
/* Webkit doesn't handle focus for child dialogs when gtk_dialog_run() is used */
/* FIXME: maybe this solution must be expanded to all dialogs */
@@ -775,6 +776,7 @@
gtk_main ();
break;
+#endif
default:
dialog = create_dialog ();
EOF
patch -p1 -i $TMP/$PRGNAM-$VERSION/$PRGNAM.patch
fi
echo
echo "$VERDE"Configurando ..."$CIERRE"
sleep 1
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--enable-icon-browser \
--disable-html \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
echo
echo "$VERDE"Compilamos ..."$CIERRE"
sleep 1
make || exit 1
make install-strip DESTDIR=$PKG
}
###################################
## 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
#Si no existe el fichero se descargara
f_download
#Preparamos entorno
f_preparar
#Descomprimir fichero descargado y compilamos
F_compilar
#Hacemos strip sobre el paquete
f_strip
#Creamos xzm , instalamos y salimos
f_tareasFinales