source: jclic/trunk/fuentes/debian/patches/zero-center.patch @ 6747

Last change on this file since 6747 was 6747, checked in by Juanma, 3 years ago

Renamed zero-jclic to zero-jclic-reports

File size: 5.6 KB
RevLine 
[116]1Description: <short summary of the patch>
2 TODO: Put a short summary on the line above and replace this paragraph
3 with a longer explanation of this change. Complete the meta-information
4 with other relevant fields (see below for details). To make it easier, the
5 information below has been extracted from the changelog. Adjust it or drop
6 it.
7 .
[3466]8 jclic (0.3.2.1) Xenial; urgency=medium
[116]9 .
[3466]10   * Firts xenial release
11Author: Juanma Navarro Mañez <juanma1980@gmail.com>
[116]12
13---
14The information above should follow the Patch Tagging Guidelines, please
15checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
16are templates for supplementary fields that you might want to add:
17
18Origin: <vendor|upstream|other>, <url of original patch>
19Bug: <url in upstream bugtracker>
[3466]20Bug-Debian: https://bugs.debian.org/<bugnumber>
[116]21Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
22Forwarded: <no|not-needed|url proving that it has been forwarded>
23Reviewed-By: <name and email of someone who approved the patch>
24Last-Update: <YYYY-MM-DD>
25
26--- /dev/null
[6544]27+++ b/jclic.install-files/etc/lliurex-sgbd/jclic.sgbd
[3466]28@@ -0,0 +1,35 @@
[116]29+######################################################################################
30+# file name app.sgbd
31+# DB_NAME name of your database
32+# DB_USER name of your database user
33+# MYSQL_DATA_FILE place where you leave your mysql file to be injected on database (optional)
34+# INCLUDE_PATH place where leave your database include file with slash (must exist path)
35+# BACKUP_PATH place where leave your database automatic backup with slash (must exist path)
36+# USE_TEMPLATE (YES or NO) create your own template following debconf format
37+# you can use "lliurex-sgbd --template" to generate this template
38+# Copy this file modified with your own parameters in your debian package directory
39+#
40+# The include generated file will be INCLUDE_PATH/debian-db.php
41+#
42+######################################################################################
43+#
44+#      SAMPLE
45+# file name pmb.sgbd
46+#
47+# DB_NAME              = pmb
48+# DB_USER              = pmb_user
49+# MYSQL_DATA_FILE      = /usr/share/pmb/www/lliurex/pmb4_base.sql
50+# INCLUDE_PATH         = /etc/pmb/
51+# BACKUP_PATH          = /etc/pmb/backup/
52+# USE_TEMPLATE         = YES
53+#
54+######################################################################################
55+
56+[parameters]
57+DB_NAME                = JClicReports
58+DB_USER                = jclic_user
[3466]59+DB_PASS                = jclic_pwd
[116]60+MYSQL_DATA_FILE        =
61+INCLUDE_PATH   = /etc/jclic/
62+BACKUP_PATH    = /etc/jclic/backup/
63+USE_TEMPLATE   = NO
[3466]64--- /dev/null
[6544]65+++ b/zero-jclic.zlaunchers/zero-jclic.app
[3466]66@@ -0,0 +1,18 @@
67+Name=zero-jclic
68+Name[en]=zero-jclic
69+Name[es]=Configuracion del Jclic Reportserver
70+Name[qcv]=Configuraciò del Jclic Reportserver
71+Name[ca]=Configuraciò del Jclic Reportserver
72+Comment=Client Configuration of Jclic Reportserver
73+Comment[en]=Client Configuration of Jclic Reportserver
74+Comment[es]=Configuración del servidor de informes de Jclic
75+Comment[qcv]=Configuraciò del servidor de informes de Jclic
76+Comment[ca]=Configuraciò del servidor de informes de Jclic
77+Icon=jclic
78+Category=Software
79+ScriptPath=zero-jclic.zmd
80+Groups=adm;admins;teachers
81+Using=pe
82+Service=True
83+Modal=True
84+Locks=zero-jclic
85--- /dev/null
[6544]86+++ b/zero-jclic.zlaunchers/zero-jclic.zmd
87@@ -0,0 +1,89 @@
[3466]88+#!/bin/bash
89+
90+export TEXTDOMAIN="zero-jclic"
[6544]91+export DEBIAN_FRONTEND="noninteractive"
[3466]92+MSG_ERROR_MYSQL=$(gettext "You must install and run mysql")
93+MSG_NOCONFIGURE=$(gettext "Leaving unconfigured")
94+MSG_PASSWD=$(gettext "Administrator password for Jclic Reports: /etc/lliurex-sgbd/jclic.sgbd")
[6544]95+
[3466]96+PACKAGE="lliurex-sgbd"
97+
98+
99+function test_install {
100+               #Testeamos si el paquete esta instalado, no haciendo nada en el caso afirmativo o instalandolo en el caso negativo.
101+               TEST=$( dpkg-query -s $1 2> /dev/null| grep Status | cut -d " " -f 4 )
102+               if [ "$TEST" = 'installed' ]; then
103+                       echo "Package $1 already installed, we have to uninstall it"
[6747]104+                       notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg 'Zero-Installer' "$1 is already installed in your system, now we are goig to remove it and install it again."
[3466]105+                       zero-installer remove $1
106+               fi
107+
108+       }
109+
110+
111+
112+##############################MAIN###########################
113+
114+zero-center add-pulsating-color zero-jclic
115+
116+(
117+echo "# Updating Repositories...."
118+zero-repos-update
119+echo "20"
120+echo "Testing if package was installed in your system"
121+test_install "$PACKAGE"
122+echo "30"
123+echo "# Installing lliurex-sgbd...."
124+zero-installer install "$PACKAGE"
125+
126+
127+
128+if [ $? -ne 0 ]; then
129+       zenity --info --text="$MSG_NOCONFIGURE"
130+       zero-center remove-pulsating-color zero-jclic
131+       exit 0
132+fi
133+
134+#Testear el mysql
135+echo "40"
136+echo "# Testing mysql...."
137+RESULT=$(mysql_root_passwd -a)
138+if [ "$RESULT" = "NO" ]; then
139+       zenity --error --text "$MSG_ERROR_MYSQL"
140+       zero-center remove-pulsating-color zero-jclic
141+       exit 0
142+fi
143+
144+#Inicializar mysql
145+echo "60"
146+echo "# Customing mysql....."
147+mysql_root_passwd -i
148+
149+#Crear la base de datos y el usuario, si no existe
150+resp=$(lliurex-sgbd --db_is_present jclic )
151+if [ "$resp" = "NO" ] ; then
152+       lliurex-sgbd --install jclic
153+else
154+       lliurex-sgbd --upgrade jclic
155+fi
156+
157+#Crear un fichero de inicialización
158+echo "80"
159+echo "# Executing last scripts......."
160+touch /etc/.jclic.conf
161+cat > /etc/.jclic.conf << EOF
162+*********************************************
163+Creado al configurar con zero-center el jclic
164+*********************************************
165+EOF
166+sleep 1
167+) | zenity --progress --title="Jclic Report Server" --percentage=0 --auto-close --auto-kill --width="500" --no-cancel
168+
169+
170+zenity --warning --text="$MSG_PASSWD" &
171+
172+#Deshabilitar después de configurar
173+zero-center remove-pulsating-color zero-jclic
174+zero-center set-configured zero-jclic
175+
176+exit 0
Note: See TracBrowser for help on using the repository browser.