<commit_before>#!/bin/sh
#############################################################################
#
# Purpose: This script will install QGIS including Python and GRASS support,
#
#############################################################################
# Copyright (c) 2009-2019 The Open Source Geospatial Foundation and others.
# Licensed under the GNU LGPL version >= 2.1.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License,
# or any later version.  This library is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details, either
# in the "LICENSE.LGPL.txt" file distributed with this software or at
# web page "http://www.fsf.org/licenses/lgpl.html".
#############################################################################

./diskspace_probe.sh "`basename $0`" begin
BUILD_DIR=`pwd`
####


if [ -z "$USER_NAME" ] ; then
   USER_NAME="user"
fi
USER_HOME="/home/$USER_NAME"

TMP_DIR=/tmp/build_qgis

if [ ! -d "$TMP_DIR" ] ; then
   mkdir "$TMP_DIR"
fi
cd "$TMP_DIR"

apt-get -q update

#Install packages
## 23feb14 fix for QGis "can't make bookmarks"
apt-get --assume-yes install qgis \
   qgis-common python3-qgis python3-qgis-common \
   gpsbabel qgis-plugin-grass


if [ $? -ne 0 ] ; then
   echo 'ERROR: Package install failed! Aborting.'
   exit 1
fi


# add pykml needed by qgis-plugin 'geopaparazzi'
# wget -c --progress=dot:mega \
#    "http://download.osgeo.org/livedvd/data/ossim/pykml_0.1.1-1_all.deb"
# gdebi --non-interactive --quiet pykml_0.1.1-1_all.deb


#Install optional packages that some plugins use
# apt-get --assume-yes install python-psycopg2 \
#    python-gdal python-matplotlib python-qt4-sql \
#    libqt4-sql-psql python-qwt5-qt4 python-tk \
#    python-sqlalchemy python-owslib python-shapely \
#    python-qt4-phonon libqt4-sql-sqlite

# Removed since R should be installed on its own script: python-rpy2

# Install plugins
# wget -c --progress=dot:mega \
#    "http://download.osgeo.org/livedvd/data/qgis/python-qgis-osgeolive_10.0-1_all.deb"
# dpkg -i python-qgis-osgeolive_10.0-1_all.deb
# rm -rf python-qgis-osgeolive_10.0-1_all.deb

#Install optional packages for workshops
# apt-get --assume-yes install qt4-designer \
#    pyqt4-dev-tools

#Make sure old qt uim isn't installed
# apt-get --assume-yes remove uim-qt uim-qt3

# ###FIXME: Temp patch for #1466
# wget -c --progress=dot:mega \
#    "http://download.osgeo.org/livedvd/data/grass/grass7.tar.gz"
# tar zxvf grass7.tar.gz
# rm grass7.tar.gz
# cp -r grass7/* /usr/share/qgis/python/plugins/processing/algs/grass7/
# rm -rf grass7

#### install desktop icon ####
INSTALLED_VERSION=`dpkg -s qgis | grep '^Version:' | awk '{print $2}' | cut -f1 -d~`
if [ ! -e /usr/share/applications/org.qgis.qgis.desktop ] ; then
   cat << EOF > /usr/share/applications/org.qgis.qgis.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=QGIS
Comment=QGIS $INSTALLED_VERSION
Categories=Application;Education;Geography;
Exec=/usr/bin/qgis %F
Icon=/usr/share/icons/qgis-icon.xpm
Terminal=false
StartupNotify=false
Categories=Education;Geography;Qt;
MimeType=application/x-qgis-project;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-mapinfo-mif;application/x-esri-shape;
EOF
fi

cp /usr/share/applications/org.qgis.qgis.desktop "$USER_HOME/Desktop/qgis.desktop"
cp /usr/share/applications/qbrowser.desktop "$USER_HOME/Desktop/"
chown -R $USER_NAME.$USER_NAME "$USER_HOME/Desktop/qgis.desktop"
chown -R $USER_NAME.$USER_NAME "$USER_HOME/Desktop/qbrowser.desktop"


# add menu item
if [ ! -e /usr/share/menu/qgis ] ; then
   cat << EOF > /usr/share/menu/qgis
?package(qgis):needs="X11"\
  section="Applications/Science/Geoscience"\
  title="QGIS"\
  command="/usr/bin/qgis"\
  icon="/usr/share/icons/qgis-icon.xpm"
EOF
  update-menus
fi


# Install the Manual and Intro guide locally and link them to the description.html
mkdir /usr/local/share/qgis
# any pdf version of the intro guide?<commit_msg>Cannot find QGIS Browser launcher<commit_after>#!/bin/sh
#############################################################################
#
# Purpose: This script will install QGIS including Python and GRASS support,
#
#############################################################################
# Copyright (c) 2009-2019 The Open Source Geospatial Foundation and others.
# Licensed under the GNU LGPL version >= 2.1.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License,
# or any later version.  This library is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details, either
# in the "LICENSE.LGPL.txt" file distributed with this software or at
# web page "http://www.fsf.org/licenses/lgpl.html".
#############################################################################

./diskspace_probe.sh "`basename $0`" begin
BUILD_DIR=`pwd`
####


if [ -z "$USER_NAME" ] ; then
   USER_NAME="user"
fi
USER_HOME="/home/$USER_NAME"

TMP_DIR=/tmp/build_qgis

if [ ! -d "$TMP_DIR" ] ; then
   mkdir "$TMP_DIR"
fi
cd "$TMP_DIR"

apt-get -q update

#Install packages
## 23feb14 fix for QGis "can't make bookmarks"
apt-get --assume-yes install qgis \
   qgis-common python3-qgis python3-qgis-common \
   gpsbabel qgis-plugin-grass


if [ $? -ne 0 ] ; then
   echo 'ERROR: Package install failed! Aborting.'
   exit 1
fi


# add pykml needed by qgis-plugin 'geopaparazzi'
# wget -c --progress=dot:mega \
#    "http://download.osgeo.org/livedvd/data/ossim/pykml_0.1.1-1_all.deb"
# gdebi --non-interactive --quiet pykml_0.1.1-1_all.deb


#Install optional packages that some plugins use
# apt-get --assume-yes install python-psycopg2 \
#    python-gdal python-matplotlib python-qt4-sql \
#    libqt4-sql-psql python-qwt5-qt4 python-tk \
#    python-sqlalchemy python-owslib python-shapely \
#    python-qt4-phonon libqt4-sql-sqlite

# Removed since R should be installed on its own script: python-rpy2

# Install plugins
# wget -c --progress=dot:mega \
#    "http://download.osgeo.org/livedvd/data/qgis/python-qgis-osgeolive_10.0-1_all.deb"
# dpkg -i python-qgis-osgeolive_10.0-1_all.deb
# rm -rf python-qgis-osgeolive_10.0-1_all.deb

#Install optional packages for workshops
# apt-get --assume-yes install qt4-designer \
#    pyqt4-dev-tools

#Make sure old qt uim isn't installed
# apt-get --assume-yes remove uim-qt uim-qt3

# ###FIXME: Temp patch for #1466
# wget -c --progress=dot:mega \
#    "http://download.osgeo.org/livedvd/data/grass/grass7.tar.gz"
# tar zxvf grass7.tar.gz
# rm grass7.tar.gz
# cp -r grass7/* /usr/share/qgis/python/plugins/processing/algs/grass7/
# rm -rf grass7

#### install desktop icon ####
INSTALLED_VERSION=`dpkg -s qgis | grep '^Version:' | awk '{print $2}' | cut -f1 -d~`
if [ ! -e /usr/share/applications/org.qgis.qgis.desktop ] ; then
   cat << EOF > /usr/share/applications/org.qgis.qgis.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=QGIS
Comment=QGIS $INSTALLED_VERSION
Categories=Application;Education;Geography;
Exec=/usr/bin/qgis %F
Icon=/usr/share/icons/qgis-icon.xpm
Terminal=false
StartupNotify=false
Categories=Education;Geography;Qt;
MimeType=application/x-qgis-project;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-mapinfo-mif;application/x-esri-shape;
EOF
fi

cp /usr/share/applications/org.qgis.qgis.desktop "$USER_HOME/Desktop/qgis.desktop"
# cp /usr/share/applications/qbrowser.desktop "$USER_HOME/Desktop/"
chown -R $USER_NAME.$USER_NAME "$USER_HOME/Desktop/qgis.desktop"
# chown -R $USER_NAME.$USER_NAME "$USER_HOME/Desktop/qbrowser.desktop"


# add menu item
if [ ! -e /usr/share/menu/qgis ] ; then
   cat << EOF > /usr/share/menu/qgis
?package(qgis):needs="X11"\
  section="Applications/Science/Geoscience"\
  title="QGIS"\
  command="/usr/bin/qgis"\
  icon="/usr/share/icons/qgis-icon.xpm"
EOF
  update-menus
fi


# Install the Manual and Intro guide locally and link them to the description.html
mkdir /usr/local/share/qgis
# any pdf version of the intro guide?
{'fraction_non_alphanumeric': 0.17591941906769734, 'fraction_numerical': 0.015928788943546497, 'mean_word_length': 4.248309772587585, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5173741', 'n_tokens_mistral': 3165, 'n_tokens_neox': 2966, 'n_words': 745}