~vcs-imports/soas/trunk

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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
%post --nochroot

# activities.sugarlabs.org (ASLO) installed-packages

# Fructose
ASLO="$ASLO org.laptop.WebActivity"
ASLO="$ASLO org.laptop.TurtleArtActivity"
ASLO="$ASLO org.laptop.sugar.ReadActivity"
ASLO="$ASLO org.laptop.ImageViewerActivity"
ASLO="$ASLO org.laptop.Pippy"
ASLO="$ASLO org.laptop.Terminal"
ASLO="$ASLO org.laptop.sugar.Jukebox"
ASLO="$ASLO org.laptop.Log"
ASLO="$ASLO org.laptop.Chat"
ASLO="$ASLO org.laptop.Calculate"
ASLO="$ASLO org.laptop.AbiWordActivity"

# Honey subset
ASLO="$ASLO org.laptop.community.TypingTurtle"
ASLO="$ASLO org.sugarlabs.IRC"
ASLO="$ASLO com.garycmartin.Moon"
ASLO="$ASLO org.laptop.sugar.ReadEtextsActivity"
ASLO="$ASLO com.ywwg.CartoonBuilderActivity"
ASLO="$ASLO vu.lux.olpc.Speak"
ASLO="$ASLO org.laptop.ViewSlidesActivity"
ASLO="$ASLO org.sugarlabs.InfoSlicer"
ASLO="$ASLO org.worldwideworkshop.olpc.FlipSticks"
ASLO="$ASLO org.worldwideworkshop.olpc.JigsawPuzzle"
ASLO="$ASLO org.worldwideworkshop.olpc.SliderPuzzle"
ASLO="$ASLO org.laptop.community.Colors"
ASLO="$ASLO org.squeak.FreeCell"
ASLO="$ASLO org.laptop.TamTamEdit"
ASLO="$ASLO org.laptop.TamTamJam"
ASLO="$ASLO org.laptop.TamTamMini"
ASLO="$ASLO org.laptop.TamTamSynthLab"
ASLO="$ASLO org.laptop.Memorize"
ASLO="$ASLO org.worldwideworkshop.JokeMachineActivity"
ASLO="$ASLO vu.lux.olpc.Maze"
ASLO="$ASLO org.worldwideworkshop.olpc.storybuilder"
ASLO="$ASLO org.worldwideworkshop.PollBuilder"
ASLO="$ASLO org.gnome.Labyrinth"
ASLO="$ASLO org.laptop.RecordActivity"
ASLO="$ASLO org.laptop.Oficina"
ASLO="$ASLO tv.alterna.Clock"
ASLO="$ASLO org.laptop.physics"
ASLO="$ASLO org.laptop.sugar.GetIABooksActivity"
ASLO="$ASLO org.laptop.Arithmetic"
ASLO="$ASLO org.laptop.community.FoodForce2"
ASLO="$ASLO org.sugarlabs.SlideruleActivity"
ASLO="$ASLO com.socialtext.SocialCalcActivity"

WD=$PWD
BUNDLES_DIR=$INSTALL_ROOT/usr/share/sugar/bundles

mkdir -p $BUNDLES_DIR
cd $BUNDLES_DIR

CACHE_DIR=$WD/../cache/aslo
mkdir -p $CACHE_DIR

ASLO_SP='0.86'
ASLO_URL='http://activities.sugarlabs.org/services/update-aslo.php'
ASLO_LINK='.//{http://www.mozilla.org/2004/em-rdf#}updateLink'

for bundle_id in $ASLO ; do
  curl -4 -s -L "$ASLO_URL?id=$bundle_id&appVersion=$ASLO_SP" > $CACHE_DIR/metadata
  url=$(python -c "from xml.etree.ElementTree import parse; url=parse('$CACHE_DIR/metadata').find('$ASLO_LINK'); print url is not None and url.text or ''")
  if [ -z "$url" ]; then
      echo "Can not find url for $bundle_id" >&2
      continue
  fi
  remote_file=$(basename $(curl -4 -s -L -w %{url_effective} -I $url | tail -1))
  bundle=$CACHE_DIR/$remote_file
  if [ ! -f $bundle ] ; then
     curl -4 -L $url > $bundle
  fi
  cp -p $bundle $BUNDLES_DIR
done

# pull sample content for the journal
PDFS="$PDFS africa.pdf"
PDFS="$PDFS asia.pdf"
PDFS="$PDFS central_america.pdf"
PDFS="$PDFS europe.pdf"
PDFS="$PDFS middle_east.pdf"
PDFS="$PDFS north_america.pdf"
PDFS="$PDFS oceania.pdf"
PDFS="$PDFS south_america.pdf"
PDFS="$PDFS southeast_asia.pdf"

for pdf in $PDFS ; do
  url=http://dev.sugarlabs.org/raw-attachment/ticket/840/$pdf
  remote_file=$(basename $(curl -4 -s -L -w %{url_effective} -I $url | tail -1))
  bundle=$CACHE_DIR/$remote_file
  if [ ! -f $bundle ] ; then
     curl -s -4 -L $url > $bundle
  fi
  cp -p $bundle $BUNDLES_DIR
done

# e-books from epubbooks.com
EPUB="$EPUB 1/dickens-a-christmas-carol-illustrations" # A Christmas Carol
EPUB="$EPUB 7/carroll-alice-in-wonderland-illustrations" # Alice in Wonderland
EPUB="$EPUB 19/baum-dorothy-and-the-wizard-in-oz-illustrations" # Dorothy and the Wizard in Oz
EPUB="$EPUB 24/swift-gullivers-travels-illustrations" # Gulliver's Travels
EPUB="$EPUB 148/burnett-secret-garden-illustrations" # The Secret Garden

for epub in $EPUB ; do
  url=http://www.epubbooks.com/book/$epub.epub
  remote_file=$(basename $(curl -4 -s -L -w %{url_effective} -I $url | tail -1))
  bundle=$CACHE_DIR/$remote_file
  if [ ! -f $bundle ] ; then
     curl -s -4 -L $url > $bundle
  fi
  cp -p $bundle $BUNDLES_DIR
done

# e-books from project gutenberg
EPUB="$EPUB 11589" # Les Voyages Extraordinaires
EPUB="$EPUB 17161" # Max und Moritz

for epub in $EPUB ; do
  url=http://www.gutenberg.org/cache/epub/$epub/pg$epub-images.epub
  remote_file=$(basename $(curl -4 -s -L -w %{url_effective} -I $url | tail -1))
  bundle=$CACHE_DIR/$remote_file
  if [ ! -f $bundle ] ; then
     curl -s -4 -L $url > $bundle
  fi
  cp -p $bundle $BUNDLES_DIR
done

# more CC licensed e-books for us
BOOK="$BOOK http://trailblazing.royalsociety.org/pdf/All.pdf" # Royal Society
BOOK="$BOOK http://www.liberliber.it/biblioteca/c/collodi/pinocchio/epub/collodi_pinocchio.epub" # Pinocchio

for book in $BOOK ; do
  url=$book
  remote_file=$(basename $(curl -4 -s -L -w %{url_effective} -I $url | tail -1))
  bundle=$CACHE_DIR/$remote_file
  if [ ! -f $bundle ] ; then
     curl -s -4 -L $url > $bundle
  fi
  cp -p $bundle $BUNDLES_DIR
done

# get the script to install the activities
cp -p $WD/../install-activity.py .
chmod a+x ./install-activity.py

# get sample content setup script directly from git
cp -p $WD/../copy-to-datastore.py .
chmod a+x ./copy-to-datastore.py

# FIXME: this should be the same uid as CREATE_USERNAME *in the chroot*,
# but is hardcoded here for simplicity
chown -R 500:500 $BUNDLES_DIR
cd $WD

%end