forked from OSGeo/OSGeoLive
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install_ipython.sh
executable file
·96 lines (77 loc) · 3.3 KB
/
install_ipython.sh
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
#!/bin/sh
# Copyright (c) 2013 The Open Source Geospatial Foundation.
# 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".
#
# About:
# =====
# This script will install ipython and ipython-notebook in ubuntu
# The future may hold interesting graphical examples using notebook + tools
./diskspace_probe.sh "`basename $0`" begin
####
if [ -z "$USER_NAME" ] ; then
USER_NAME="user"
fi
USER_HOME="/home/$USER_NAME"
USER_DESKTOP="$USER_HOME/Desktop"
BUILD_DIR=`pwd`
## 24jan14 change in iPython+numpy+matplotlib
## 04jul14 jtaylor iPython
apt-get install --assume-yes python-matplotlib \
python-scipy python-pandas \
python-netcdf python-netcdf4 \
python-shapely python-rasterio python-fiona \
python-geopandas python-descartes \
python-enum34 python-geojson
#-- Jupyter ppa
apt-add-repository --yes ppa:gcpp-kalxas/jupyter
apt-get update
# From Jupyter 1.0.0 setup.py dependencies
apt-get install --assume-yes python-notebook python-jupyter-qtconsole python-jupyter-console python-nbconvert python-ipykernel python-ipywidgets
#-- Clean-up
apt-add-repository --yes --remove ppa:gcpp-kalxas/jupyter
cp "$BUILD_DIR"/../app-data/ipython/ipython-notebook*.desktop \
"$USER_DESKTOP"/
chown "$USER_NAME:$USER_NAME" "$USER_DESKTOP"/ipython-notebook*.desktop
cp "$BUILD_DIR"/../app-data/ipython/ipython_*.sh \
/usr/local/bin/
chmod a+x /usr/local/bin/ipython_*.sh
mkdir -p "$USER_HOME/ipython"
git clone https://github.com/OSGeo/IPython_notebooks \
"$USER_HOME/ipython/notebooks"
chown -R "$USER_NAME:$USER_NAME" "$USER_HOME/ipython"
##-- 8.0b1 simple example, launch not resolved
cp "$BUILD_DIR"/../app-data/ipython/cartopy_simple.ipynb \
"$USER_HOME/ipython/notebooks/"
cp -r /home/user/ipython /etc/skel
# gist utility (ruby + jist extension = 15 mb)
#apt-get --assume-yes install ruby ruby-dev
#gem install jist
#
# TODO : add a proper osgeolive profile inclusing js extensions such reveal.js
# and few other notebook extensions
# instructions to do so can be stored on a extra script to run from a live session
if [ ! -d "/etc/skel/.ipython/profile_default" ] ; then
mkdir -p "/etc/skel/.ipython/profile_default"
cp -r "$BUILD_DIR"/../app-data/ipython/static/ \
/etc/skel/.ipython/profile_default/
fi
if [ ! -d "/etc/skel/.ipython/nbextensions" ] ; then
mkdir -p "/etc/skel/.ipython/nbextensions"
cp -r "$BUILD_DIR"/../app-data/ipython/nbextensions/* \
/etc/skel/.ipython/nbextensions/
# these only exist after build is complete, so dangling symlinks during the build
ln -s /var/www/html/openlayers/ /etc/skel/.ipython/nbextensions/
ln -s /var/www/html/reveal.js/ /etc/skel/.ipython/nbextensions/
fi
####
./diskspace_probe.sh "`basename $0`" end