Commit f7519dc4e7e6e0ec0c705e9282a84d317179b17e

Authored by Edmar Moretti
1 parent 5ebeaaa3
Exists in master

Scripts para criação do live cd

gisvm/bootstrap.sh 0 → 100755
... ... @@ -0,0 +1,63 @@
  1 +#!/bin/sh
  2 +# Copyright (c) 2009-2012 The Open Source Geospatial Foundation.
  3 +# Licensed under the GNU LGPL.
  4 +#
  5 +# This library is free software; you can redistribute it and/or modify it
  6 +# under the terms of the GNU Lesser General Public License as published
  7 +# by the Free Software Foundation, either version 2.1 of the License,
  8 +# or any later version. This library is distributed in the hope that
  9 +# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
  10 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11 +# See the GNU Lesser General Public License for more details, either
  12 +# in the "LICENSE.LGPL.txt" file distributed with this software or at
  13 +# web page "http://www.fsf.org/licenses/lgpl.html".
  14 +
  15 +# About:
  16 +# =====
  17 +# This script provides the steps to be run on the LiveDVD in order to get the
  18 +# install scripts onto the LiveDVD, and start installing.
  19 +# For detailed build instructions, refer to:
  20 +# http://wiki.osgeo.org/wiki/GISVM_Build#Creating_a_fresh_Virtual_Machine
  21 +
  22 +
  23 +# Running:
  24 +# =======
  25 +# sudo ./boostrap.sh
  26 +
  27 +SCRIPT_DIR=/usr/local/share
  28 +
  29 +if [ -z "$USER_NAME" ] ; then
  30 + USER_NAME="i3geosaude"
  31 +fi
  32 +USER_HOME="/home/$USER_NAME"
  33 +
  34 +# copy in pre-downloaded data files. flavour to suit or just skip
  35 +# rsync -avz cshorter@192.168.2.166::/media/Shorter/repository/livedvd/Arramagong_tmp/ /tmp/
  36 +apt-get --assume-yes autoremove
  37 +apt-get --assume-yes install subversion
  38 +
  39 +# check out the install scripts from subversion
  40 +cd "$SCRIPT_DIR"
  41 +
  42 +# Use "svn export" instead of "svn checkout" to save space by not having the
  43 +# cached .svn/ files stored locally (n.b. later cleansed by build_iso.sh)
  44 +#svn export http://svn.osgeo.org/osgeo/livedvd/gisvm/trunk gisvm
  45 +svn checkout "http://svn.osgeo.org/osgeo/livedvd/gisvm/trunk" /usr/local/share/gisvm
  46 +
  47 +chown -R "$USER_NAME":"$USER_NAME" /usr/local/share/gisvm
  48 +cd "$USER_HOME"
  49 +ln -s "$SCRIPT_DIR/gisvm" .
  50 +ln -s "$SCRIPT_DIR/gisvm" /etc/skel/gisvm
  51 +
  52 +# make a directory for the install logs
  53 +mkdir /var/log/osgeolive/
  54 +
  55 +# FIXME: a+w is to be avoided always!
  56 +chmod a+wr /var/log/osgeolive/
  57 +
  58 +
  59 +echo "If you have a local copy if the tmp/ directory and wish to"
  60 +echo "save bandwidth, then copy it across to your DVD now, using a"
  61 +echo "command like:"
  62 +echo " rsync -avz username@hostname.org:/path_to_tmp_dir/ /tmp/"
  63 +echo " rsync -avz username@hostname.org:/path_to_tmp_apt_dir/ /var/cache/apt/"
... ...
gisvm/build_chroot_release.sh 0 → 100755
... ... @@ -0,0 +1,275 @@
  1 +#!/bin/sh
  2 +#############################################################################
  3 +#
  4 +# Purpose: Creating OSGeoLive as an Ubuntu customization
  5 +# https://help.ubuntu.com/community/LiveCDCustomization
  6 +# Authors: Alex Mandel <tech_dev@wildintellect.com>
  7 +# Angelos Tzotsos <tzotsos@gmail.com>
  8 +#
  9 +#############################################################################
  10 +# Copyright (c) 2010 Open Source Geospatial Foundation (OSGeo)
  11 +#
  12 +# Licensed under the GNU LGPL.
  13 +#
  14 +# This library is free software; you can redistribute it and/or modify it
  15 +# under the terms of the GNU Lesser General Public License as published
  16 +# by the Free Software Foundation, either version 2.1 of the License,
  17 +# or any later version. This library is distributed in the hope that
  18 +# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
  19 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20 +# See the GNU Lesser General Public License for more details, either
  21 +# in the "LICENSE.LGPL.txt" file distributed with this software or at
  22 +# web page "http://www.fsf.org/licenses/lgpl.html".
  23 +#############################################################################
  24 +
  25 +# System Requirements
  26 +#
  27 +# 1. At least 3-5 GB of free space
  28 +# 2. At least 512 MB RAM and 1 GB swap (recommended)
  29 +# 3. squashfs-tools
  30 +# 4. genisoimage, which provides mkisofs
  31 +# 5. An Ubuntu kernel with squashfs support (present in Ubuntu 6.06 and later)
  32 +# 6. QEMU/KVM, VirtualBox or VMware for testing (optional)
  33 +#
  34 +
  35 +if [ "$1" != "i386" ] && [ "$1" != "amd64" ] ; then
  36 + echo "Did not find build architecture, try using i386 or amd64 as an argument"
  37 + exit 1
  38 +fi
  39 +ARCH="$1"
  40 +I3="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  41 +DIR="/usr/local/share/gisvm/bin"
  42 +SVN_DIR="/usr/local/share/gisvm"
  43 +VERSION=`cat "$DIR"/../VERSION.txt`
  44 +PACKAGE_NAME="osgeo-live"
  45 +cd "$SVN_DIR"
  46 +REVISION=`svn info | grep "Revision" | sed 's/Revision: //'`
  47 +
  48 +#Is it a public or an internal build?
  49 +ISO_NAME="$PACKAGE_NAME-mini-$VERSION-$ARCH"
  50 +#ISO_NAME="$PACKAGE_NAME-mini-build$REVISION"
  51 +#volume name, max 11 chars:
  52 +IMAGE_NAME=OSGEOLIVE`echo "$VERSION" | sed -e 's/\.//' -e 's/rc.*//'`
  53 +
  54 +echo
  55 +echo "==============================================================="
  56 +echo "Start Building $ISO_NAME"
  57 +echo "==============================================================="
  58 +
  59 +#Some initial cleaning
  60 +# when run as root, ~ is /root/.
  61 +rm -rf ~/livecdtmp/edit
  62 +rm -rf ~/livecdtmp/lzfiles
  63 +
  64 +echo
  65 +echo "Installing squashfs and genisoimage"
  66 +echo "==================================="
  67 +
  68 +sudo apt-get install --yes squashfs-tools genisoimage lzip
  69 +
  70 +#TODO add wget to grab a fresh image, optional
  71 +
  72 +echo
  73 +echo "Downloading Xubuntu original image..."
  74 +echo "====================================="
  75 +
  76 +#Stuff to be done the 1st time, should already be in place for additional builds
  77 +#Download into an empty directory
  78 +mkdir -p ~/livecdtmp
  79 +cd ~/livecdtmp
  80 +#mv ubuntu-9.04-desktop-i386.iso ~/livecdtmp
  81 +UBU_MIRROR="http://se.archive.ubuntu.com/mirror/cdimage.ubuntu.com"
  82 +UBU_RELEASE="12.04"
  83 +ISO_RELEASE="12.04.4"
  84 +UBU_ISO="xubuntu-${ISO_RELEASE}-desktop-$ARCH.iso"
  85 +wget -c --progress=dot:mega \
  86 + "$UBU_MIRROR/xubuntu/releases/$UBU_RELEASE/release/$UBU_ISO"
  87 +
  88 +#Start with a fresh copy
  89 +#Mount the Desktop .iso
  90 +mkdir mnt
  91 +sudo mount -o loop "$UBU_ISO" mnt
  92 +echo "Xubuntu $ISO_RELEASE $ARCH image mounted."
  93 +
  94 +#Extract .iso contents into dir 'extract-cd'
  95 +mkdir "extract-cd"
  96 +rsync --exclude=/casper/filesystem.squashfs -a mnt/ "extract-cd"
  97 +
  98 +echo
  99 +echo "Extracting squashfs from Xubuntu image"
  100 +echo "======================================"
  101 +#Extract the SquashFS filesystem
  102 +sudo unsquashfs mnt/casper/filesystem.squashfs
  103 +#Does the above need to be done every time or can it be done once, and then
  104 +# just make a fresh copy of the chroot for each builds
  105 +sudo mv squashfs-root edit
  106 +
  107 +echo
  108 +echo "Setting up network for chroot"
  109 +echo "======================================"
  110 +#If you need the network connection within chroot
  111 +sudo cp /etc/resolv.conf edit/etc/
  112 +sudo cp /etc/hosts edit/etc/
  113 +
  114 +#These mount important directories of your host system - if you later
  115 +# decide to delete the edit/ directory, then make sure to unmount
  116 +# before doing so, otherwise your host system will become unusable at
  117 +# least temporarily until reboot
  118 +sudo mount --bind /dev/ edit/dev
  119 +
  120 +echo
  121 +echo "Starting build in chroot"
  122 +echo "======================================"
  123 +
  124 +#NOW IN CHROOT
  125 +#sudo chroot edit
  126 +sudo cp "$DIR"/inchroot_release.sh ~/livecdtmp/edit/tmp/
  127 +sudo cp "$SVN_DIR"/VERSION.txt ~/livecdtmp/edit/tmp/
  128 +sudo cp "$SVN_DIR"/CHANGES.txt ~/livecdtmp/edit/tmp/
  129 +sudo chroot edit /bin/sh /tmp/inchroot_release.sh
  130 +
  131 +#exit
  132 +#OUT OF CHROOT
  133 +echo
  134 +echo "Finished chroot part"
  135 +echo "======================================"
  136 +cd ~/livecdtmp
  137 +sudo umount edit/dev
  138 +
  139 +#compress osgeolive build logs
  140 +#tar czf osgeo-live-${VERSION}-log.tar.gz -C edit/var/log osgeolive
  141 +
  142 +echo
  143 +echo "Remastering the dvd..."
  144 +echo "======================================"
  145 +#remaster the dvd
  146 +
  147 +#Method 1 requires that dist-upgrade is run on both the host and chroot
  148 +#need to make sure modules.dep exists for the current kernel before next step
  149 +#sudo depmod
  150 +#sudo chroot edit depmod
  151 +#sudo chroot edit mkinitramfs -c lzma -o /initrd.lz
  152 +
  153 +#Method 2 hardcode default kernel from xubuntu
  154 +#need to repack the initrd.lz to pick up the change to casper.conf and kernel update
  155 +sudo chroot edit mkinitramfs -c lzma -o /initrd.lz 3.2.0-58-generic
  156 +
  157 +#continue
  158 +mkdir lzfiles
  159 +cd lzfiles
  160 +lzma -dc -S .lz ../edit/initrd.lz | cpio -imvd --no-absolute-filenames
  161 +
  162 +cp ../../gisvm/app-conf/build_chroot/casper.conf etc/casper.conf
  163 +#cp ../../gisvm/app-conf/build_chroot/27osgeo_groups scripts/casper-bottom/27osgeo_groups
  164 +#cat << EOF >> scripts/casper-bottom/ORDER
  165 +#/scripts/casper-bottom/27osgeo_groups
  166 +#[ -e /conf/param.conf ] && ./conf/param.conf
  167 +#EOF
  168 +
  169 +mv scripts/casper-bottom/25adduser scripts/casper-bottom/25adduser.ORIG
  170 +cat scripts/casper-bottom/25adduser.ORIG \
  171 + ../../gisvm/app-conf/build_chroot/27osgeo_groups \
  172 + > scripts/casper-bottom/25adduser
  173 +rm scripts/casper-bottom/25adduser.ORIG
  174 +chmod a+x scripts/casper-bottom/25adduser
  175 +
  176 +
  177 +#replace the user password, potentially also set backgrounds here
  178 +sed -i -e 's/U6aMy0wojraho/eLyJdzDtonrIc/g' scripts/casper-bottom/25adduser
  179 +
  180 +#Change the text on the loader
  181 +sed -i -e "s/title=Xubuntu $UBU_RELEASE/title=i3GeoSaúde $VERSION/g" \
  182 + lib/plymouth/themes/xubuntu-text/xubuntu-text.plymouth
  183 +#might be in this file
  184 +sed -i -e "s/title=Xubuntu $UBU_RELEASE/title=i3GeoSaúde $VERSION/g" \
  185 + lib/plymouth/themes/text.plymouth
  186 +
  187 +#Optional change it in the .disk/info too
  188 +sed -i -e "s/title=Xubuntu $UBU_RELEASE/title=i3GeoSaúde $VERSION/g" ../extract-cd/.disk/info
  189 +
  190 +#copy in a different background
  191 +cp ../../gisvm/desktop-conf/osgeo-desktop.png \
  192 + lib/plymouth/themes/xubuntu-logo/xubuntu-greybird.png
  193 +
  194 +find . | cpio --quiet --dereference -o -H newc | \
  195 + lzma -7 > ../extract-cd/casper/initrd.lz
  196 +
  197 +#sudo cp edit/initrd.lz extract-cd/casper/initrd.lz
  198 +cd ..
  199 +
  200 +echo
  201 +echo "Regenerating manifest..."
  202 +echo "======================================"
  203 +
  204 +#Regenerate manifest
  205 +chmod +w extract-cd/casper/filesystem.manifest
  206 +sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > \
  207 + extract-cd/casper/filesystem.manifest
  208 +sudo cp extract-cd/casper/filesystem.manifest \
  209 + extract-cd/casper/filesystem.manifest-desktop
  210 +sudo sed -i '/ubiquity/d' \
  211 + extract-cd/casper/filesystem.manifest-desktop
  212 +sudo sed -i '/casper/d' \
  213 + extract-cd/casper/filesystem.manifest-desktop
  214 +
  215 +echo
  216 +echo "Compressing filesystem..."
  217 +echo "======================================"
  218 +#Compress filesystem
  219 +sudo rm extract-cd/casper/filesystem.squashfs
  220 +sudo mksquashfs edit extract-cd/casper/filesystem.squashfs -no-progress
  221 +
  222 +echo
  223 +echo "Calculating new filesystem size..."
  224 +echo "======================================"
  225 +#Update the filesystem.size file, which is needed by the installer:
  226 +# TODO: get it to run as sudo no sudo su
  227 +chmod +w extract-cd/casper/filesystem.size
  228 +printf $(sudo du -sx --block-size=1 edit | cut -f1) > \
  229 + extract-cd/casper/filesystem.size
  230 +chmod -w extract-cd/casper/filesystem.size
  231 +
  232 +#this is now compressed in squashfs so we delete to save VM disk space
  233 +cd ~/livecdtmp
  234 +sudo rm -rf edit
  235 +
  236 +#Set an image name in extract-cd/README.diskdefines
  237 +#KVM VNC doesn't pass ctrl, can't use vim or nano
  238 +#Can probably use sed magic or copy a predefined file from gisvm/app-data
  239 +#sudo nano extract-cd/README.diskdefines
  240 +# fixme: can you copy from the local ../filesystem instead?
  241 +wget -nv https://svn.osgeo.org/osgeo/livedvd/gisvm/trunk/app-conf/build_chroot/README.diskdefines \
  242 + --output-document=extract-cd/README.diskdefines
  243 +
  244 +echo
  245 +echo "Calculating new md5 sums..."
  246 +echo "======================================"
  247 +#Remove old md5sum.txt and calculate new md5 sums
  248 +cd extract-cd
  249 +sudo rm md5sum.txt
  250 +find -type f -print0 | sudo xargs -0 md5sum | \
  251 + grep -v isolinux/boot.cat | sudo tee md5sum.txt
  252 +
  253 +echo
  254 +echo "Creating iso..."
  255 +echo "======================================"
  256 +#Create the ISO image
  257 +sudo mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -quiet -b \
  258 + isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
  259 + -boot-load-size 4 -boot-info-table -o ../"$ISO_NAME.iso" .
  260 +
  261 +echo
  262 +echo "Cleaning up..."
  263 +echo "======================================"
  264 +#Clear things up and prepare for next build
  265 +cd ~/livecdtmp
  266 +sudo rm -rf extract-cd
  267 +sudo umount mnt
  268 +sudo rm -rf mnt
  269 +sudo rm -rf lzfiles
  270 +
  271 +echo
  272 +echo "==============================================================="
  273 +echo "Finished building $ISO_NAME"
  274 +echo "==============================================================="
  275 +cd "$I3"
... ...
gisvm/cron 0 → 100755
... ... @@ -0,0 +1,6 @@
  1 +# DO NOT EDIT THIS FILE - edit the master and reinstall.
  2 +# (/tmp/tmpUzwqdH installed on Fri Mar 7 01:11:24 2014)
  3 +# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
  4 +0 0 * * * sudo rm -Rf /tmp/ms_tmp >/dev/null 2>&1 # JOB_ID_1
  5 +0 * * * * sudo svn cleanup /var/www # JOB_ID_2
  6 +30 * * * * sudo svn update/var/www # JOB_ID_3
... ...
gisvm/inchroot_release.sh 0 → 100755
... ... @@ -0,0 +1,215 @@
  1 +#!/bin/sh
  2 +#################################################
  3 +#
  4 +# Purpose: Creating OSGeoLive as an Ubuntu customization. In chroot part
  5 +# https://help.ubuntu.com/community/LiveCDCustomization
  6 +# Author: Stefan Hansen <shansen@lisasoft.com>
  7 +# Alex Mandel <tech_dev@wildintellect.com>
  8 +# Angelos Tzotsos <tzotsos@gmail.com>
  9 +#
  10 +#################################################
  11 +# Copyright (c) 2010 Open Source Geospatial Foundation (OSGeo)
  12 +# Copyright (c) 2009 LISAsoft
  13 +#
  14 +# Licensed under the GNU LGPL version >= 2.1.
  15 +#
  16 +# This library is free software; you can redistribute it and/or modify it
  17 +# under the terms of the GNU Lesser General Public License as published
  18 +# by the Free Software Foundation, either version 2.1 of the License,
  19 +# or any later version. This library is distributed in the hope that
  20 +# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
  21 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  22 +# See the GNU Lesser General Public License for more details, either
  23 +# in the "LICENSE.LGPL.txt" file distributed with this software or at
  24 +# web page "http://www.fsf.org/licenses/lgpl.html".
  25 +##################################################
  26 +
  27 +run_installer()
  28 +{
  29 + SCRIPT=$1
  30 + echo "===================================================================="
  31 + echo "Starting: $SCRIPT"
  32 + echo "===================================================================="
  33 + sh "$SCRIPT"
  34 +}
  35 +
  36 +mount -t proc none /proc
  37 +mount -t sysfs none /sys
  38 +mount -t devpts none /dev/pts
  39 +
  40 +#To avoid locale issues and in order to import GPG keys
  41 +export HOME=/roots
  42 +export LC_ALL=C
  43 +
  44 +#In 9.10, before installing or upgrading packages you need to run
  45 +#TODO: Check/ask if this needs to be done in 12.04
  46 +dbus-uuidgen > /var/lib/dbus/machines-id
  47 +dpkg-divert --local --rename --add /sbin/initctl
  48 +ln -s /bin/true /sbin/initctl
  49 +
  50 +#To view installed packages by size
  51 +#dpkg-query -W --showformat='${Installed-Size}\t${Package}\n' | sort -nr | less
  52 +#When you want to remove packages remember to use purge
  53 +#aptitude purge package-name
  54 +
  55 +#Execute the osgeolive build
  56 +#Adding "user" to help the build process
  57 +adduser user --disabled-password --gecos user
  58 +
  59 +#change ID under 999 so that iso boot does not fail
  60 +#usermod -u 500 user
  61 +#TODO Set the password for "user"
  62 +mkdir -p /home/user/Desktop
  63 +chown user:user /home/user/Desktop
  64 +
  65 +cd /tmp/
  66 +
  67 +wget -nv "https://svn.osgeo.org/osgeo/livedvd/gisvm/trunk/bin/bootstrap.sh"
  68 +
  69 +chmod a+x bootstrap.sh
  70 +
  71 +./bootstrap.sh
  72 +
  73 +cd /usr/local/share/gisvm/bin
  74 +
  75 +#copy external version information to be able to rename the builds
  76 +cp /tmp/VERSION.txt /usr/local/share/gisvm/
  77 +cp /tmp/CHANGES.txt /usr/local/share/gisvm/
  78 +
  79 +#Redirecting to main_install.log does not allow main.sh to exit properly
  80 +#./main.sh 2>&1 | tee /var/log/osgeolive/main_install.log
  81 +#./main.sh
  82 +
  83 +USER_NAME="user"
  84 +export USER_NAME
  85 +
  86 +./setup.sh release
  87 +./install_services.sh
  88 +./install_language.sh
  89 +#./install_mysql.sh
  90 +./install_java.sh
  91 +./install_apache2.sh
  92 +./install_tomcat6.sh
  93 +./install_ipython.sh
  94 +#./install_django.sh
  95 +
  96 +#./install_geoserver.sh
  97 +#./install_geomajas.sh
  98 +./install_geonetwork.sh
  99 +#./install_deegree.sh
  100 +#./install_52nWPS.sh
  101 +#./install_kosmo.sh
  102 +#./install_udig.sh
  103 +#./install_openjump.sh
  104 +./install_postgis.sh
  105 +#./install_osm.sh
  106 +./load_postgis.sh
  107 +#./install_pgrouting.sh
  108 +#./install_sahana.sh
  109 +#./install_ushahidi.sh
  110 +./install_mapserver.sh
  111 +#./install_mapbender3.sh
  112 +#./install_geokettle.sh
  113 +#./install_gmt.sh
  114 +#./install_grass.sh
  115 +./install_qgis.sh
  116 +./install_qgis_mapserver.sh
  117 +#./install_saga.sh
  118 +#./install_mapnik.sh
  119 +#./install_mapproxy.sh
  120 +#./install_maptiler.sh
  121 +#./install_marble.sh
  122 +#./install_opencpn.sh
  123 +#./install_prune.sh
  124 +#./install_viking.sh
  125 +#./install_zygrib.sh
  126 +#./install_liblas.sh
  127 +#./install_gpsdrive.sh
  128 +#./install_mapfish.sh
  129 +#./install_openlayers.sh
  130 +#./install_leaflet.sh
  131 +./install_R.sh
  132 +#./install_ossim.sh
  133 +#./install_osgearth.sh
  134 +#./install_spatialite.sh
  135 +#./install_zoo-project.sh
  136 +#./install_52nSOS.sh
  137 +#./install_otb.sh
  138 +#./install_rasdaman.sh
  139 +#./install_tinyows.sh
  140 +#./install_pycsw.sh
  141 +#./install_geomoose.sh
  142 +./install_mb-system.sh
  143 +./install_gvsig.sh
  144 +#./install_tilemill.sh
  145 +#./install_eoxserver.sh
  146 +#./install_cartaro.sh
  147 +#./install_iris.sh
  148 +#./install_ncWMS.sh
  149 +#./install_geonode.sh
  150 +
  151 +#./load_gisdata.sh
  152 +#./install_docs.sh
  153 +#./install_edutools.sh
  154 +
  155 +./install_i3geo.sh
  156 +
  157 +./install_desktop.sh
  158 +./install_icons_and_menus.sh
  159 +./setdown.sh
  160 +
  161 +
  162 +#Remove doc folder to save space
  163 +#rm -rf /usr/local/share/gisvm/doc
  164 +
  165 +# save space on ISO by removing the .svn/ dirs
  166 +# (or control this in bootstrap.sh by uncommenting the 'svn export' line)
  167 +for DIR in `find /usr/local/share/gisvm | grep '\.svn$'` ; do
  168 + rm -rf "$DIR"
  169 +done
  170 +# user shouldn't own outside of /home
  171 +chown -R root.root /usr/local/share/gisvm
  172 +
  173 +# Update the file search index
  174 +updatedb
  175 +
  176 +#Experimental dist variant, comment out and swap to backup below
  177 +#Do we need to change the user to ubuntu in all scripts for this method?
  178 +# -- No, set user in casper.conf
  179 +tar -zcf /tmp/user_home.tar.gz -C /home/user .
  180 +tar -zxf /tmp/user_home.tar.gz -C /etc/skel .
  181 +rm /tmp/user_home.tar.gz
  182 +cp -a /home/user/* /etc/skel
  183 +chown -hR root:root /etc/skel
  184 +
  185 +#TODO: Should we remove the "user" after the installation?
  186 +#By keeping this user, /home/user exists and installation fails if someone uses the same username.
  187 +#killall -u user
  188 +#userdel -r user
  189 +deluser --remove-home user
  190 +
  191 +#Copy casper.conf with default username and hostname
  192 +#FIXME: User is still "xubuntu" in live session... perhaps because user is already created?
  193 +cp /usr/local/share/gisvm/app-conf/build_chroot/casper.conf /etc/casper.conf
  194 +
  195 +#After the build
  196 +#Check for users above 999
  197 +awk -F: '$3 > 999' /etc/passwd
  198 +
  199 +#Cleanup
  200 +#Be sure to remove any temporary files which are no longer needed, as space on a CD is limited
  201 +apt-get clean
  202 +#Or delete temporary files
  203 +rm -rf /tmp/* ~/.bash_history
  204 +#Or delete hosts file
  205 +rm /etc/hosts
  206 +#Or nameserver settings
  207 +rm /etc/resolv.conf
  208 +#If you installed software, be sure to run
  209 +rm /var/lib/dbus/machine-id
  210 +rm /sbin/initctl
  211 +dpkg-divert --rename --remove /sbin/initctl
  212 +#now umount (unmount) special filesystems and exit chroot
  213 +umount /proc || umount -lf /proc
  214 +umount /sys
  215 +umount /dev/pts
... ...
gisvm/install_i3geo.sh 0 → 100755
... ... @@ -0,0 +1,170 @@
  1 +#!/bin/bash
  2 +# Copyright (c) 2009-2010 The Open Source Geospatial Foundation.
  3 +# Licensed under the GNU LGPL version >= 2.1.
  4 +#
  5 +# This library is free software; you can redistribute it and/or modify it
  6 +# under the terms of the GNU Lesser General Public License as published
  7 +# by the Free Software Foundation, either version 2.1 of the License,
  8 +# or any later version. This library is distributed in the hope that
  9 +# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
  10 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11 +# See the GNU Lesser General Public License for more details, either
  12 +# in the "LICENSE.LGPL.txt" file distributed with this software or at
  13 +# web page "http://www.fsf.org/licenses/lgpl.html".
  14 +#
  15 +# Requires: apache2 php5 libapache2-mod-php5 cgi-mapserver mapserver-bin
  16 +# php5-mapscript php5-gd php5-sqlite gfortran r-base r-base-core
  17 +# r-base-sp r-cran-maptools
  18 +#
  19 +# Uninstall:
  20 +# ============
  21 +# sudo rm -rf /var/www/i3geo
  22 +# sudo rm -rf /var/www/ms_tmp
  23 +# sudo rm -rf /tmp/ms_tmp
  24 +
  25 +./diskspace_probe.sh "`basename $0`" begin
  26 +BUILD_DIR=`pwd`
  27 +####
  28 +
  29 +
  30 +#OSGEO live username is "user"
  31 +if [ -z "$USER_NAME" ] ; then
  32 + USER_NAME="user"
  33 +fi
  34 +
  35 +#Repository url
  36 +echo "Baixando arquivos do svn http://svn.gvsig.org/svn/i3geo/subgrupos/i3geosaude para /var/www"
  37 +svn checkout "http://svn.gvsig.org/svn/i3geo/subgrupos/i3geosaude" /var/www
  38 +
  39 +
  40 +#i3GEO dependencies
  41 +I3GEO_DEPENDENCIES=(apache2 php5 libapache2-mod-php5 cgi-mapserver mapserver-bin php5-mapscript php5-gd php5-sqlite php5-curl)
  42 +R_DEPENDENCIES=(r-cran-maptools)
  43 +
  44 +#Installation variables
  45 +ROOT_DIR="/var/www"
  46 +TMP_DIR="/tmp"
  47 +LOCAPLIC="$ROOT_DIR/i3geo"
  48 +
  49 +rm -Rf /var/www/*
  50 +
  51 +#Temporary directory, symbolic link to temporary directory
  52 +mkdir "$TMP_DIR/ms_tmp"
  53 +ln -s "$TMP_DIR/ms_tmp" "$ROOT_DIR/ms_tmp"
  54 +#Temporary directory permissions
  55 +chown -R www-data:www-data "$TMP_DIR/ms_tmp"
  56 +chown -R www-data:www-data "$ROOT_DIR/ms_tmp"
  57 +chmod -R 755 "$TMP_DIR/ms_tmp"
  58 +chmod -R 755 "$ROOT_DIR/ms_tmp"
  59 +
  60 +#Deploy i3geo
  61 +cd "$TMP_DIR"
  62 +
  63 +#Change permissions
  64 +cd /var/www
  65 +chown -R www-data i3geo/
  66 +chgrp -R www-data i3geo/
  67 +chmod -R 755 i3geo/
  68 +
  69 +
  70 +#add R repository to have the latest version of R
  71 +#cd /etc/apt/
  72 +#echo "deb http://cran.es.r-project.org/bin/linux/debian squeeze-cran/" >> sources.list
  73 +#apt-key adv --keyserver subkeys.pgp.net --recv-key 381BA480
  74 +#apt-get update
  75 +
  76 +#Install i3geo dependencies
  77 +for i in "${I3GEO_DEPENDENCIES[@]}"; do
  78 + IS_INSTALLED=$(dpkg --get-selections | grep -w $i | grep -w install)
  79 + if [ -z "$IS_INSTALLED" ]; then
  80 + echo "Package $i is not installed"
  81 + echo "Installing $i ..."
  82 + apt-get -y install "$i"
  83 + else
  84 + echo "$i package is allready installed"
  85 + fi
  86 +done
  87 +
  88 +#Install R and dependencies
  89 +echo "Installing R"
  90 +for i in "${R_DEPENDENCIES[@]}"; do
  91 + IS_INSTALLED=$(dpkg --get-selections | grep -w $i | grep -w install)
  92 + if [ -z "$IS_INSTALLED" ]; then
  93 + echo "Package $i is not installed"
  94 + echo "Installing $i ..."
  95 + apt-get -y install "$i"
  96 + else
  97 + echo "$i package is allready installed"
  98 + # ==> why the reinstall? this isn't Windows.
  99 + apt-get --reinstall install "$i"
  100 + fi
  101 +done
  102 +
  103 +# get R libraries
  104 +echo "Downloading R required libraries"
  105 +cd "$TMP_DIR"
  106 +wget http://cran.r-project.org/src/contrib/gpclib_1.5-3.tar.gz
  107 +wget http://cran.r-project.org/src/contrib/deldir_0.0-21.tar.gz
  108 +wget http://cran.r-project.org/src/contrib/spatstat_1.30-0.tar.gz
  109 +
  110 +# install R libraries
  111 +echo "Installing R required libraries"
  112 +R CMD INSTALL gpclib_1.5-3.tar.gz
  113 +R CMD INSTALL deldir_0.0-21.tar.gz
  114 +R CMD INSTALL spatstat_1.30-0.tar.gz
  115 +
  116 +#Cleaning temp files
  117 +rm gpclib_1.5-3.tar.gz
  118 +rm deldir_0.0-21.tar.gz
  119 +rm spatstat_1.30-0.tar.gz
  120 +
  121 +# Reload Apache
  122 +/etc/init.d/apache2 force-reload
  123 +
  124 +### install desktop icon ##
  125 +echo "Installing i3geo desktop icon"
  126 +if [ ! -e "/usr/local/share/icons/i3geo1.png" ] ; then
  127 + mkdir -p /usr/local/share/icons
  128 + cp /var/www/i3geo/imagens/i3geo1.png /usr/local/share/icons/
  129 +fi
  130 +
  131 +#Add Launch icon to desktop
  132 +if [ ! -e /usr/local/share/applications/i3geo.desktop ] ; then
  133 + mkdir -p /usr/local/share/applications
  134 + cat << EOF > /usr/local/share/applications/i3geo.desktop
  135 +[Desktop Entry]
  136 +Type=Application
  137 +Encoding=UTF-8
  138 +Name=i3geo
  139 +Comment=i3geo
  140 +Categories=Application;Geography;Geoscience;Education;
  141 +Exec=firefox http://localhost/i3geo/ms_criamapa.php?idioma=en
  142 +Icon=/usr/local/share/icons/i3geo1.png
  143 +Terminal=false
  144 +StartupNotify=false
  145 +EOF
  146 +fi
  147 +
  148 +# Add lanuncher into the Desktop folder
  149 +USER_HOME="/home/i3geosaude"
  150 +USER_DESKTOP="$USER_HOME/Desktop/"
  151 +# Add desktop icon
  152 +if [ -d "$USER_DESKTOP" ] ; then
  153 + echo "Copying icon to desktop at $USER_DESKTOP"
  154 + cp /usr/local/share/applications/i3geo.desktop "$USER_DESKTOP/i3geo.desktop"
  155 + chown $USER_NAME:$USER_NAME "$USER_DESKTOP/i3geo.desktop"
  156 + chmod +x "$USER_DESKTOP/i3geo.desktop"
  157 +fi
  158 +
  159 +# Fix path to natural_earth
  160 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/aplicmap/geral1debianv6.map
  161 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/aplicmap/estadosldebian.map
  162 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/aplicmap/estadosl.map
  163 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/temas/states_provinces.map
  164 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/temas/populated_places_simple.map
  165 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/temas/geography_regions_polys.map
  166 +#sed -i -e 's/natural_earth/natural_earth2/' /var/www/i3geo/temas/estadosl.map
  167 +
  168 +
  169 +####
  170 +"$BUILD_DIR"/diskspace_probe.sh "`basename $0`" end
... ...
gisvm/install_icons_and_menus.sh 0 → 100755
... ... @@ -0,0 +1,437 @@
  1 +#!/bin/sh
  2 +# Author: Hamish Bowman
  3 +# Copyright (c) 2013 The Open Source Geospatial Foundation.
  4 +# Licensed under the GNU LGPL version >= 2.1.
  5 +#
  6 +# This library is free software; you can redistribute it and/or modify it
  7 +# under the terms of the GNU Lesser General Public License as published
  8 +# by the Free Software Foundation, either version 2.1 of the License,
  9 +# or any later version. This library is distributed in the hope that
  10 +# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
  11 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12 +# See the GNU Lesser General Public License for more details, either
  13 +# in the "LICENSE.LGPL.txt" file distributed with this software or at
  14 +# web page "http://www.fsf.org/licenses/lgpl.html".
  15 +#
  16 +# About:
  17 +# =====
  18 +# This script will take program icons collected on the Desktop, sort them
  19 +# into folders, and create the Geospatial menu on the top-bar from them.
  20 +# All the member-project's install_project.sh script has to do is place
  21 +# the icon on the Desktop, this script does the rest.
  22 +#
  23 +
  24 +./diskspace_probe.sh "`basename $0`" begin
  25 +BUILD_DIR=`pwd`
  26 +####
  27 +
  28 +
  29 +if [ -z "$USER_NAME" ] ; then
  30 + USER_NAME="user"
  31 +fi
  32 +USER_HOME="/home/$USER_NAME"
  33 +
  34 +
  35 +################################################
  36 +
  37 +#Desktop apps part 1 (traditional analytic GIS)
  38 +DESKTOP_APPS="qgis gvsig"
  39 +#disabled: atlasstyler geopublisher
  40 +
  41 +#Desktop apps part 2 (geodata viewers and editors)
  42 +NAV_APPS=""
  43 +
  44 +#Server apps part 1 (web-enabled GIS; interactive/WPS)
  45 +WEB_SERVICES="*geonetwork* mapserver qgis-mapserver"
  46 +#disabled: mapguide*
  47 +
  48 +#Server apps part 2 (web based viewers; data only flows down to user)
  49 +BROWSER_CLIENTS="Geosaúde"
  50 +#disabled: i3geo
  51 +
  52 +#Infrastructure and miscellanea
  53 +SPATIAL_TOOLS="r"
  54 +
  55 +#Future home of PostGIS and Spatialite; pgRouting???
  56 +# pgadmin, sqlitebrowser, etc (parts of this one are automatic)
  57 +DB_APPS=""
  58 +
  59 +#Server apps part 3 (public good theme)
  60 +RELIEF_APPS=""
  61 +
  62 +################################################
  63 +
  64 +
  65 +# Ubuntu 9.10 (GNOME but not Xfce) wants to see the ~/Desktop/*.desktop
  66 +# files be executable, and start with this shebang: #!/usr/bin/env xdg-open
  67 +# By this point all scripts should have run, if they haven't, too bad, they
  68 +# should move to where they should be, earlier in the build process.
  69 +#-uncomment if needed for Xubuntu
  70 +##chmod u+x "$USER_HOME"/Desktop/*.desktop
  71 +
  72 +### get list of *.desktop from bin/install_*.sh :
  73 +# grep '\.desktop' * | sed -e 's/\.desktop.*/.desktop/' -e 's+^.*[/" ]++' | sort | uniq
  74 +
  75 +
  76 +####################################
  77 +#### sort out the desktop icons ####
  78 +####################################
  79 +cd "$USER_HOME/Desktop"
  80 +
  81 +
  82 +##### create and populate the Geospatial menu, add launchers to the panel
  83 +
  84 +## OSGeo menu and CPU load for top taskbar:
  85 +
  86 +if [ `grep -c 'value="Geospatial"' /etc/xdg/xdg-xubuntu/xfce4/panel/default.xml` -eq 0 ] ; then
  87 + #present full applications menu name
  88 + sed -i -e 's+\(name="show-button-title" type="bool"\) value="false"/>+\1 value="true"/>\n <property name="button-title" type="string" value="Applications"/>+' \
  89 + /etc/xdg/xdg-xubuntu/xfce4/panel/default.xml
  90 +
  91 + #add new things to the top menubar
  92 + sed -i -e 's+\(<value type="int" value="1"/>\)+\1\n\t<value type="int" value="360"/>\n\t<value type="int" value="365"/>+' \
  93 + -e 's+<value type="int" value="6"/>+<value type="int" value="362"/>+' \
  94 + -e 's+\(<value type="int" value=\)"26"/>+\1"363"/>\n \1"26"/>+' \
  95 + -e 's+^\( </property>\)+ <property name="plugin-365" type="string" value="separator">\n <property name="style" type="uint" value="3"/>\n </property>\n <property name="plugin-360" type="string" value="applicationsmenu">\n <property name="custom-menu" type="bool" value="true"/>\n <property name="custom-menu-file" type="string" value="/usr/local/share/xfce/xfce-osgeo.menu"/>\n <property name="button-icon" type="string" value="gnome-globe"/>\n <property name="button-title" type="string" value="Geospatial"/>\n </property>\n <property name="plugin-362" type="string" value="cpugraph"/>\n <property name="plugin-363" type="string" value="xkb-plugin"/>\n\1+' \
  96 + /etc/xdg/xdg-xubuntu/xfce4/panel/default.xml
  97 +fi
  98 +
  99 +if [ -e "$USER_HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" ] ; then
  100 + cp -f /etc/xdg/xdg-xubuntu/xfce4/panel/default.xml \
  101 + "$USER_HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
  102 +fi
  103 +
  104 +cp "$BUILD_DIR"/../desktop-conf/xfce/cpugraph-362.rc /etc/xdg/xdg-xubuntu/xfce4/panel/
  105 +cp "$BUILD_DIR"/../desktop-conf/xfce/xkb-plugin-363.rc /etc/xdg/xdg-xubuntu/xfce4/panel/
  106 +
  107 +mkdir -p /usr/local/share/xfce
  108 +mkdir -p /usr/local/share/applications
  109 +
  110 +# pared down copy of /etc/xdg/xdg-xubuntu/menus/xfce-applications.menu
  111 +cp "$BUILD_DIR"/../desktop-conf/xfce/xfce-osgeo.menu /usr/local/share/xfce/
  112 +cp "$BUILD_DIR"/../desktop-conf/xfce/xfce-*.directory /usr/share/desktop-directories/
  113 +sed -e 's/^Name=.*/Name=OSGeo Software Help/' live_GIS_help.desktop \
  114 + > /usr/local/share/applications/osgeo-help.desktop
  115 +cp live_GIS_data.desktop /usr/local/share/applications/osgeo-sample_data.desktop
  116 +
  117 +
  118 +# create individual menu entries from desktop icons:
  119 +for APP in $DESKTOP_APPS ; do
  120 + APPL=`basename $APP .desktop`.desktop
  121 + #echo "[$APP] -> [$APPL]"
  122 + if [ -e "$APPL" ] ; then
  123 + sed -e 's/^Categories=.*/Categories=Geospatial;Desktop GIS;/' \
  124 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  125 + fi
  126 +done
  127 +
  128 +for APP in $NAV_APPS ; do
  129 + APPL=`basename $APP .desktop`.desktop
  130 + #echo "[$APP] -> [$APPL]"
  131 + if [ -e "$APPL" ] ; then
  132 + sed -e 's/^Categories=.*/Categories=Geospatial;Navigation;/' \
  133 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  134 +
  135 + case "$APP" in
  136 + josm | merkaartor | osm_online) GROUP=OpenStreetMap;;
  137 + *) unset GROUP;;
  138 + esac
  139 + if [ -n "$GROUP" ] ; then
  140 + sed -i -e "s/^\(Categories=.*\)/\1$GROUP;/" \
  141 + "/usr/local/share/applications/osgeo-$APPL"
  142 + fi
  143 + fi
  144 +done
  145 +
  146 +for APP in $WEB_SERVICES ; do
  147 + APPL=`basename $APP .desktop`.desktop
  148 + #echo "[$APP] -> [$APPL]"
  149 + if [ -e "$APPL" ] ; then
  150 + sed -e 's/^Categories=.*/Categories=Geospatial;Geoservers;/' \
  151 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  152 +
  153 + case "$APPL" in
  154 + 52n*) GROUP=52North;;
  155 + deegree-*) GROUP=deegree;;
  156 + geoserver-*) GROUP=GeoServer;;
  157 + *geonetwork*) GROUP=GeoNetwork;;
  158 + mapproxy-*) GROUP=MapProxy;;
  159 + ncWMS-*) GROUP=ncWMS;;
  160 + *) unset GROUP;;
  161 + esac
  162 + if [ -n "$GROUP" ] ; then
  163 + sed -i -e "s/^\(Categories=.*\)/\1$GROUP;/" \
  164 + "/usr/local/share/applications/osgeo-$APPL"
  165 + fi
  166 + fi
  167 +done
  168 +
  169 +for APP in $BROWSER_CLIENTS ; do
  170 + APPL=`basename $APP .desktop`.desktop
  171 + #echo "[$APP] -> [$APPL]"
  172 + if [ -e "$APPL" ] ; then
  173 + sed -e 's/^Categories=.*/Categories=Geospatial;Geoclients;/' \
  174 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  175 +
  176 + case "$APPL" in
  177 + cartaro-*) GROUP=Cartaro;;
  178 + geomajas-*) GROUP=Geomajas;;
  179 + geonode-*) GROUP=GeoNode;;
  180 + MapFish-*) GROUP=MapFish;;
  181 + *) unset GROUP;;
  182 + esac
  183 + if [ -n "$GROUP" ] ; then
  184 + sed -i -e "s/^\(Categories=.*\)/\1$GROUP;/" \
  185 + "/usr/local/share/applications/osgeo-$APPL"
  186 + fi
  187 + fi
  188 +done
  189 +
  190 +for APP in $SPATIAL_TOOLS ; do
  191 + APPL=`basename $APP .desktop`.desktop
  192 + #echo "[$APP] -> [$APPL]"
  193 + if [ -e "$APPL" ] ; then
  194 + sed -e 's/^Categories=.*/Categories=Geospatial;Spatial Tools;/' \
  195 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  196 + fi
  197 +done
  198 +
  199 +for APP in $DB_APPS ; do
  200 + APPL=`basename $APP .desktop`.desktop
  201 + #echo "[$APP] -> [$APPL]"
  202 + if [ -e "$APPL" ] ; then
  203 + sed -e 's/^Categories=.*/Categories=Geospatial;Database;/' \
  204 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  205 +
  206 + case "$APPL" in
  207 + *asdaman*) GROUP=Rasdaman;;
  208 + *) unset GROUP;;
  209 + esac
  210 + if [ -n "$GROUP" ] ; then
  211 + sed -i -e "s/^\(Categories=.*\)/\1$GROUP;/" \
  212 + "/usr/local/share/applications/osgeo-$APPL"
  213 + fi
  214 + fi
  215 +done
  216 +
  217 +for APP in $RELIEF_APPS ; do
  218 + APPL=`basename $APP .desktop`.desktop
  219 + #echo "[$APP] -> [$APPL]"
  220 + if [ -e "$APPL" ] ; then
  221 + sed -e 's/^Categories=.*/Categories=Geospatial;Relief;/' \
  222 + "$APPL" > "/usr/local/share/applications/osgeo-$APPL"
  223 + fi
  224 +done
  225 +
  226 +
  227 +
  228 +#### move desktop icons to subfolders
  229 +mkdir "Desktop GIS"
  230 +for APP in $DESKTOP_APPS ; do
  231 + mv `basename $APP .desktop`.desktop "Desktop GIS"/
  232 +done
  233 +
  234 +mkdir "Navigation and Maps"
  235 +for APP in $NAV_APPS ; do
  236 + mv `basename $APP .desktop`.desktop "Navigation and Maps"/
  237 +done
  238 +
  239 +mkdir "Web Services"
  240 +for APP in $WEB_SERVICES ; do
  241 + mv `basename $APP .desktop`.desktop "Web Services"/
  242 +done
  243 +
  244 +mkdir "Browser Clients"
  245 +for APP in $BROWSER_CLIENTS ; do
  246 + mv `basename $APP .desktop`.desktop "Browser Clients"/
  247 +done
  248 +
  249 +mkdir "Spatial Tools"
  250 +for APP in $SPATIAL_TOOLS ; do
  251 + mv `basename $APP .desktop`.desktop "Spatial Tools"/
  252 +done
  253 +
  254 +mkdir "Crisis Management"
  255 +for APP in $RELIEF_APPS ; do
  256 + mv `basename $APP .desktop`.desktop "Crisis Management"/
  257 +done
  258 +
  259 +# admin tools already added automatically to the menu ...
  260 +mkdir "Databases"
  261 +for APP in $DB_APPS ; do
  262 + mv `basename $APP .desktop`.desktop "Databases"/
  263 +done
  264 +# ... but need to be manually copied into the desktop folders
  265 +for ITEM in sqlitebrowser pgadmin3 ; do
  266 + cp "/usr/share/applications/$ITEM.desktop" "Databases"/
  267 +done
  268 +
  269 +
  270 +### web-services sub menu infrastructure
  271 +mkdir -p /etc/xdg/menus/applications-merged/
  272 +
  273 +APP_GROUPS="
  274 +52North
  275 +deegree
  276 +GeoNetwork
  277 +GeoServer
  278 +MapProxy
  279 +ncWMS
  280 +Rasdaman
  281 +"
  282 +# Rasdaman is actually in the database menu, but it doesn't seem to harm to process it here..
  283 +
  284 +for APP in $APP_GROUPS ; do
  285 + cat << EOF > "/etc/xdg/menus/applications-merged/$APP.menu"
  286 +<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
  287 +<Menu>
  288 +<Name>Applications</Name>
  289 + <Menu>
  290 + <Name>Geoservers</Name>
  291 + <Menu>
  292 + <Name>$APP</Name>
  293 + <Directory>$APP.directory</Directory>
  294 + <Include>
  295 + <Category>$APP</Category>
  296 + </Include>
  297 + </Menu>
  298 + </Menu>
  299 +</Menu>
  300 +EOF
  301 +
  302 + case "$APP" in
  303 + 52North) APP_ICON=/usr/share/icons/52n.png;;
  304 + Cartaro) APP_ICON=/usr/local/share/icons/logo-cartaro-48.png;;
  305 + deegree) APP_ICON=/usr/share/icons/deegree_desktop_48x48.png;;
  306 + GeoNetwork) APP_ICON=/usr/local/share/icons/geonetwork_icon.png;;
  307 + GeoServer) APP_ICON=/usr/share/icons/geoserver_48x48.logo.png;;
  308 + Geomajas) APP_ICON=/usr/share/icons/geomajas_icon_48x48.png;;
  309 + MapProxy) APP_ICON=gnome-globe;;
  310 + ncWMS) APP_ICON=/usr/local/share/icons/ncWMS_icon.png;;
  311 + Rasdaman) APP_ICON=gnome-globe;;
  312 + *) unset APP_ICON;;
  313 + esac
  314 +
  315 + cat << EOF > "/usr/share/desktop-directories/$APP.directory"
  316 +[Desktop Entry]
  317 +Encoding=UTF-8
  318 +Type=Directory
  319 +Comment=
  320 +Icon=$APP_ICON
  321 +Name=$APP
  322 +EOF
  323 +
  324 +done
  325 +
  326 +
  327 +
  328 +#### web clients sub menu infrastructure
  329 +APP_GROUPS="Cartaro Geomajas GeoNode MapFish"
  330 +
  331 +for APP in $APP_GROUPS ; do
  332 + cat << EOF > "/etc/xdg/menus/applications-merged/$APP.menu"
  333 +<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
  334 +<Menu>
  335 +<Name>Applications</Name>
  336 + <Menu>
  337 + <Name>Geoclients</Name>
  338 + <Menu>
  339 + <Name>$APP</Name>
  340 + <Directory>$APP.directory</Directory>
  341 + <Include>
  342 + <Category>$APP</Category>
  343 + </Include>
  344 + </Menu>
  345 + </Menu>
  346 +</Menu>
  347 +EOF
  348 +
  349 + case "$APP" in
  350 + Cartaro) APP_ICON=/usr/local/share/icons/logo-cartaro-48.png;;
  351 + Geomajas) APP_ICON=/usr/share/icons/geomajas_icon_48x48.png;;
  352 + GeoNode) APP_ICON=/usr/share/icons/geonode.png;;
  353 + MapFish) APP_ICON=/usr/local/lib/mapfish/mapfish.png;;
  354 + *) unset APP_ICON;;
  355 + esac
  356 +
  357 + cat << EOF > "/usr/share/desktop-directories/$APP.directory"
  358 +[Desktop Entry]
  359 +Encoding=UTF-8
  360 +Type=Directory
  361 +Comment=
  362 +Icon=$APP_ICON
  363 +Name=$APP
  364 +EOF
  365 +
  366 +done
  367 +
  368 +
  369 +
  370 +#### OpenStreetMap submenu
  371 +APP=OpenStreetMap
  372 +cat << EOF > "/etc/xdg/menus/applications-merged/$APP.menu"
  373 +<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
  374 +<Menu>
  375 +<Name>Applications</Name>
  376 + <Menu>
  377 + <Name>Navigation and Maps</Name>
  378 + <Menu>
  379 + <Name>$APP</Name>
  380 + <Directory>$APP.directory</Directory>
  381 + <Include>
  382 + <Category>$APP</Category>
  383 + </Include>
  384 + </Menu>
  385 + </Menu>
  386 +</Menu>
  387 +EOF
  388 +
  389 +APP_ICON=josm-32
  390 +
  391 +cat << EOF > "/usr/share/desktop-directories/$APP.directory"
  392 +[Desktop Entry]
  393 +Encoding=UTF-8
  394 +Type=Directory
  395 +Comment=
  396 +Icon=$APP_ICON
  397 +Name=$APP
  398 +EOF
  399 +
  400 +
  401 +
  402 +##### Setup workshop installation icon
  403 +WORKSHOP_INSTALL_FILE="workshop_installation.desktop"
  404 +cat << EOF > "/usr/share/applications/$WORKSHOP_INSTALL_FILE"
  405 +[Desktop Entry]
  406 +Name=Workshop Installation
  407 +Comment=Installation for OSGeo-live based workshops
  408 +Exec=firefox http://trac.osgeo.org/osgeo/wiki/Live_GIS_Workshop_Install
  409 +Icon=synaptic
  410 +Terminal=false
  411 +Type=Application
  412 +Categories=Application;Education;Geography;
  413 +StartupNotify=true
  414 +EOF
  415 +
  416 +\cp -a "/usr/share/applications/$WORKSHOP_INSTALL_FILE" "$USER_HOME/Desktop/"
  417 +chown $USER_NAME.$USER_NAME "$USER_HOME/Desktop/$WORKSHOP_INSTALL_FILE"
  418 +
  419 +
  420 +#### permissions cleanup (if needed)
  421 +chown "$USER_NAME"."$USER_NAME" "$USER_HOME/Desktop/" -R
  422 +chmod a+r "$USER_HOME/Desktop/" -R
  423 +
  424 +
  425 +#### since KDE is removed we copy in some icons for the menus by hand
  426 +cd /
  427 +if [ ! -e /usr/share/icons/hicolor/48x48/apps/knetattach.png ] ; then
  428 + tar xf "$BUILD_DIR"/../desktop-conf/knetattach_icons.tar --no-same-owner
  429 +fi
  430 +if [ ! -e /usr/share/icons/hicolor/48x48/apps/ktip.png ] ; then
  431 + tar xf "$BUILD_DIR"/../desktop-conf/ktip_icons.tar --no-same-owner
  432 +fi
  433 +
  434 +
  435 +
  436 +####
  437 +"$BUILD_DIR"/diskspace_probe.sh "`basename $0`" end
... ...
gisvm/makeIsoI3geoSaude_amd64.sh 0 → 100755
... ... @@ -0,0 +1,46 @@
  1 +# Running:
  2 +# =======
  3 +# sudo ./makeIsoI3geoSaude_amd64.sh
  4 +#http://wiki.osgeo.org/wiki/Live_GIS_Build#Creating_a_fresh_Virtual_Machine_to_use_as_a_build_host_.28Optional.29
  5 +
  6 +#prepara
  7 +deluser --remove-home user
  8 +deluser --remove-home i3geosaude
  9 +
  10 +adduser user --disabled-password --gecos user
  11 +adduser i3geosaude --disabled-password --gecos i3geosaude
  12 +
  13 +cp cron /var/spool/cron/crontabs/i3geosaude
  14 +
  15 +I3="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  16 +
  17 +echo "$I3"
  18 +
  19 +#rm -Rf /usr/local/share/gisvm
  20 +
  21 +rm -Rf /root/livecdtmp
  22 +chmod 777 bootstrap.sh
  23 +./bootstrap.sh
  24 +cd "$I3"
  25 +
  26 +rm /usr/local/share/gisvm/bin/inchroot_release.sh
  27 +cp inchroot_release.sh /usr/local/share/gisvm/bin
  28 +chmod 777 /usr/local/share/gisvm/bin/inchroot_release.sh
  29 +
  30 +rm /usr/local/share/gisvm/desktop-conf/welcome_message.sh
  31 +cp welcome_message.sh /usr/local/share/gisvm/desktop-conf
  32 +chmod 777 /usr/local/share/gisvm/desktop-conf/install_i3geo.sh
  33 +
  34 +rm /usr/local/share/gisvm/bin/install_i3geo.sh
  35 +cp install_i3geo.sh /usr/local/share/gisvm/bin
  36 +chmod 777 /usr/local/share/gisvm/bin/install_i3geo.sh
  37 +
  38 +rm /usr/local/share/gisvm/bin/install_icons_and_menus.sh
  39 +cp install_icons_and_menus.sh /usr/local/share/gisvm/bin
  40 +chmod 777 /usr/local/share/gisvm/bin/install_icons_and_menus.sh
  41 +
  42 +# Build ISO
  43 +chmod 777 build_chroot_release.sh
  44 +./build_chroot_release.sh amd64
  45 +
  46 +
... ...
gisvm/welcome_message.sh 0 → 100755
... ... @@ -0,0 +1,7 @@
  1 +#!/bin/sh
  2 +
  3 +mkdir /tmp/ms_tmp
  4 +chmod -R 777 /tmp/ms_tmp
  5 +rm /var/www/ms_tmp
  6 +ln -s /tmp/ms_tmp /var/www/ms_tmp
  7 +firefox http://localhost
... ...