Changeset 3366
- Timestamp:
- Jan 19, 2017, 12:42:52 PM (4 years ago)
- Location:
- lliurex-analytics-server/trunk/fuentes/debian
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-analytics-server/trunk/fuentes/debian/changelog
r2881 r3366 1 lliurex-analytics-server (0.1.1) xenial; urgency=medium 2 3 * Improved installation & deinstallation scripts 4 * Fix bug in servername from apache configured site 5 * Fix bug in php configuration file template 6 7 -- M.Angel Juan <m.angel.juan@gmail.com> Thu, 19 Jan 2017 12:36:01 +0100 8 1 9 lliurex-analytics-server (0.1.0) xenial; urgency=medium 2 10 -
lliurex-analytics-server/trunk/fuentes/debian/postinst
r350 r3366 1 1 #!/bin/bash 2 # postinst script 3 # 4 # see: dh_installdeb(1) 5 6 #set -e 7 8 . /usr/share/debconf/confmodule 9 10 # summary of how this script can be called: 11 # * <postinst> `configure' <most-recently-configured-version> 12 # * <old-postinst> `abort-upgrade' <new version> 13 # * <conflictor's-postinst> `abort-remove' `in-favour' <package> 14 # <new-version> 15 # * <postinst> `abort-remove' 16 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' 17 # <failed-install-package> <version> `removing' 18 # <conflicting-package> <version> 19 # for details, see http://www.debian.org/doc/debian-policy/ or 20 # the debian-policy package 2 21 3 22 do_dialog(){ 4 input=$(dialog 5 --title "$1"\6 --inputbox "$2" 0 0\7 8 23 input=$(dialog \ 24 --title "$1" \ 25 --inputbox "$2" 0 0 \ 26 3>&1 1>&2 2>&3 3>&-) 27 clear 9 28 } 10 29 ask_question(){ 11 30 dialog --yesno "$1" 0 0 12 31 if [ $? -eq 0 ]; then 13 32 input=yes 14 33 else 15 34 input=no 16 35 fi 17 36 clear 18 37 } 19 38 39 case "$1" in 40 configure) 20 41 21 ask_question 'Desea configurar la base de datos analytics?' 22 if [ "x$input" == "xyes" ]; then 23 create_db=$input 24 ask_question 'Desea crear usuario para la tabla de la base de datos?' 25 create_user=$input 26 if [ "x$input" == "xyes" ]; then 27 do_dialog 'Database configuration' 'Nombre del usuario para crear:' 28 user=$input 29 do_dialog 'Database configuration' 'Password del usuario para crear:' 30 pass=$input 42 ASK="no" 43 44 #CHECK OLD CONFIG 45 if [ ! -d "/etc/lliurex-analytics-server" ]; then 46 ASK="yes" 47 mkdir /etc/lliurex-analytics-server 31 48 else 32 do_dialog 'Database configuration' 'Usuario con permiso en bd analytics?' 33 user=$input 34 do_dialog 'Database configuration' 'Password del usuario con permiso en bd analytics?' 35 pass=$input 49 if [ -f "/etc/lliurex-analytics-server/config_db" ]; then 50 USER=$(cat /etc/lliurex-analytics-server/config_db|perl -ne "/user=(.*)/i && print $1") 51 PASS=$(cat /etc/lliurex-analytics-server/config_db|perl -ne "/pass=(.*)/i && print $1") 52 if [ -n "${USER}" -a -n "${PASS}" ]; then 53 RES=$(echo 'show tables;'|mysql -u${USER} -p${PASS} -s analytics 2>/dev/null) 54 if [ -n "${RES}" ]; then 55 user="${USER}" 56 pass="${PASS}" 57 ASK="no" 58 else 59 ASK="yes" 60 fi 61 else 62 ASK="yes" 63 fi 64 else 65 ASK="yes" 66 fi 36 67 fi 37 do_dialog 'Database configuration' 'Password root de mysql?' 38 rootpass=$input 39 else 40 echo 41 echo "To import database schema use:" 42 echo "" 43 echo "echo \"create user '<user>'@'%' identified by '<password>';\" | mysql -u root -p<root_password>" 44 echo "echo \"grant all privileges on analytics.* to '<user>'@'%';\" | mysql -u root -p<root_password>" 45 echo "echo \"flush privileges; \" | mysql -u root -p<root_password>" 46 echo "mysql -u <user> -p<root_password> < /usr/lib/analytics-server/analytics.sql" 47 echo "After that, edit /usr/lib/analytics-server/analytics/config.php" 48 echo 49 echo 50 fi 68 69 # ASK QUESTIONS 70 if [ "${ASK}" = "yes" ] 71 ask_question 'Desea configurar la base de datos analytics?' 72 if [ "x$input" == "xyes" ]; then 73 create_db=$input 74 ask_question 'Desea crear usuario para la tabla de la base de datos?' 75 create_user=$input 76 if [ "x$input" == "xyes" ]; then 77 do_dialog 'Database configuration' 'Nombre del usuario para crear:' 78 user=$input 79 do_dialog 'Database configuration' 'Password del usuario para crear:' 80 pass=$input 81 else 82 do_dialog 'Database configuration' 'Usuario con permiso en bd analytics?' 83 user=$input 84 do_dialog 'Database configuration' 'Password del usuario con permiso en bd analytics?' 85 pass=$input 86 fi 87 do_dialog 'Database configuration' 'Password root de mysql?' 88 rootpass=$input 89 else 90 echo 91 echo "To import database schema use:" 92 echo "" 93 echo "echo \"create user '<user>'@'%' identified by '<password>';\" | mysql -u root -p<root_password>" 94 echo "echo \"grant all privileges on analytics.* to '<user>'@'%';\" | mysql -u root -p<root_password>" 95 echo "echo \"flush privileges; \" | mysql -u root -p<root_password>" 96 echo "mysql -u <user> -p<root_password> < /usr/lib/analytics-server/analytics.sql" 97 echo "After that, edit /usr/lib/analytics-server/analytics/config.php" 98 echo 99 echo 100 fi 101 else 102 #ASK=no 103 create_db="no" 104 create_user="no" 105 fi 106 107 #INITIALIZE DB 108 109 if [ "x$create_db" == "xyes" ]; then 110 if [ "x$rootpass" == "x" ]; then 111 mysqlroot="mysql -uroot" 112 mysqluser="mysql -u$user -p$pass" 113 else 114 mysqlroot="mysql -uroot -p$rootpass" 115 mysqluser="mysql -u$user -p$pass" 116 fi 117 if [ "x$create_user" == "xyes" ]; then 118 echo "create user '$user'@'%' identified by '$pass';" | $mysqlroot 119 echo "grant all privileges on analytics.* to '$user'@'%';" | $mysqlroot 120 echo "flush privileges;" | $mysqlroot 121 echo "user=$user" >> /etc/lliurex-analytics-server/config_db 122 echo "pass=$pass" >> /etc/lliurex-analytics-server/config_db 123 fi 124 $mysqluser < /usr/lib/analytics-server/analytics.sql 125 else 126 if [ "x$create_user" != "xyes" ]; then 127 do_dialog 'Analytics configuration' 'Usuario con permiso en bd analytics?' 128 user=$input 129 do_dialog 'Analytics configuration' 'Password del usuario con permiso en bd analytics?' 130 pass=$input 131 echo "user=$user" >> /etc/lliurex-analytics-server/config_db 132 echo "pass=$pass" >> /etc/lliurex-analytics-server/config_db 133 134 fi 135 fi 136 137 RES1=$(grep -o '@phpuser@' /usr/lib/analytics-server/analytics/config.php) 138 RES2=$(grep -o '@phppass@' /usr/lib/analytics-server/analytics/config.php) 139 140 if [ -n "${RES1}" -a -n "${RES2}" ]; then 141 sed -i.old -e "s/@phpuser@/$user/g" -e "s/@phppass@/$pass/g" /usr/lib/analytics-server/analytics/config.php 142 rm /usr/lib/analytics-server/analytics/config.php.old 143 else 144 echo "BUG !! WARNING: replace tags @phpuser@ & @phppass@ not found in /usr/lib/analytics-server/analytics/config.php" 145 echo "Installation may not work succesfully, report bug to developers" 146 fi 51 147 52 148 53 if [ "x$create_db" == "xyes" ]; then 54 if [ "x$rootpass" == "x" ]; then 55 mysqlroot="mysql -uroot" 56 mysqluser="mysql -u$user -p$pass" 57 else 58 mysqlroot="mysql -uroot -p$rootpass" 59 mysqluser="mysql -u$user -p$pass" 60 fi 61 if [ "x$create_user" == "xyes" ]; then 62 echo "create user '$user'@'%' identified by '$pass';" | $mysqlroot 63 echo "grant all privileges on analytics.* to '$user'@'%';" | $mysqlroot 64 echo "flush privileges;" | $mysqlroot 65 fi 66 $mysqluser < /usr/lib/analytics-server/analytics.sql 67 sed -i.old -e "s/@phpuser@/$user/g" -e "s/@phppass@/$pass/g" /usr/lib/analytics-server/analytics/config.php 68 rm /usr/lib/analytics-server/analytics/config.php.old 69 else 70 if [ "x$create_user" != "xyes" ]; then 71 do_dialog 'Analytics configuration' 'Usuario con permiso en bd analytics?' 72 user=$input 73 do_dialog 'Analytics configuration' 'Password del usuario con permiso en bd analytics?' 74 pass=$input 75 sed -i.old -e "s/@phpuser@/$user/g" -e "s/@phppass@/$pass/g" /usr/lib/analytics-server/analytics/config.php 76 rm /usr/lib/analytics-server/analytics/config.php.old 77 fi 78 fi 79 a2enmod rewrite 80 a2ensite analytics 81 service apache2 restart 149 # CONFIG APACHE 150 151 a2enmod rewrite 152 a2ensite analytics 153 service apache2 restart 154 155 ;; 156 157 abort-upgrade|abort-remove|abort-deconfigure) 158 ;; 159 160 *) 161 echo "postinst called with unknown argument \`$1'" >&2 162 exit 1 163 ;; 164 esac 165 166 # dh_installdeb will replace this with shell code automatically 167 # generated by other debhelper scripts. 168 169 #DEBHELPER# 170 171 exit 0 172 173 -
lliurex-analytics-server/trunk/fuentes/debian/prerm
r350 r3366 1 1 #!/bin/bash 2 # prerm script 3 # 4 # see: dh_installdeb(1) 2 5 3 a2dissite analytics 6 #set -e 7 8 # summary of how this script can be called: 9 # * <prerm> `remove' 10 # * <old-prerm> `upgrade' <new-version> 11 # * <new-prerm> `failed-upgrade' <old-version> 12 # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> 13 # * <deconfigured's-prerm> `deconfigure' `in-favour' 14 # <package-being-installed> <version> `removing' 15 # <conflicting-package> <version> 16 # for details, see http://www.debian.org/doc/debian-policy/ or 17 # the debian-policy package 18 19 20 case "$1" in 21 remove|upgrade|deconfigure) 22 a2dissite analytics 23 ;; 24 25 failed-upgrade) 26 ;; 27 28 *) 29 echo "prerm called with unknown argument \`$1'" >&2 30 exit 1 31 ;; 32 esac 33 34 # dh_installdeb will replace this with shell code automatically 35 # generated by other debhelper scripts. 36 37 #DEBHELPER# 38 39 exit 0 -
lliurex-analytics-server/trunk/fuentes/debian/rules
r350 r3366 1 1 #!/usr/bin/make -f 2 2 3 #LDFLAGS+=-Wl,--as-needed4 3 # 5 4 %: 6 5 dh $@ 7 #--with autoreconf --fail-missing8 #9 #override_dh_autoreconf:10 # NOCONFIGURE=1 dh_autoreconf ./autogen.sh11 #12 #13 #override_dh_auto_build:14 # dh_auto_build15 # ./src/logo-generator --logo data/logo-bare.png --text '14.04 LTS' --output logo.png16 #17 #override_dh_auto_install:18 # dh_auto_install19 # cp logo.png debian/unity-greeter/usr/share/unity-greeter/logo.png20 #21 #override_dh_auto_clean:22 # dh_auto_clean23 # rm -f logo.png
Note: See TracChangeset
for help on using the changeset viewer.