5
#rm -rf pkg-root snapcraft.yaml deb
7
#cp snapcraft.yaml.in snapcraft.yaml
8
cat >snapcraft.yaml <<EOF
2
# https://code.launchpad.net/~cmiller/+junk/gcsnap
3
# Canonical, 2016. Questions to chad.miller@canonical.com
8
# Chrome specific values
14
# Not implemented by snap interfaces yet
15
export XDG_DATA_HOME=$SNAP/usr/share
16
export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d
17
export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf
23
cat >snapcraft.yaml <<"EOF"
10
25
version: UPSTREAMVERSION
11
26
summary: The web browser from Google
12
description: Google Chrome is a browser that combines a minimal design with
28
Google Chrome is a browser that combines a minimal design with
13
29
sophisticated technology to make the web faster, safer, and easier
17
command: usr/bin/google-chrome-stable
18
plugs: [ network, x11, home, unity7 ]
33
command: bin/gcenv $SNAP/opt/google/chrome/google-chrome
23
stage-packages: [ libgl1-mesa-glx, libgl1-mesa-dri, libexif12, fontconfig, fonts-dejavu, xfonts-base, xfonts-encodings, xfonts-scalable, xfonts-utils, ttf-bitstream-vera, ttf-ubuntu-font-family, gconf-service, libasound2 , libatk1.0-0 , libc6 , libcairo2 , libcups2 , libdbus-1-3 , libexpat1 , libfontconfig1 , libfreetype6 , libgcc1 , libgconf-2-4 , libgdk-pixbuf2.0-0 , libglib2.0-0 , libgtk2.0-0 , libnspr4 , libnss3 , libpango1.0-0 , libstdc++6 , libx11-6 , libxcomposite1 , libxcursor1 , libxdamage1 , libxext6, libxfixes3, libxi6 , libxrandr2 , libxrender1, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libcurl3, lsb-base , xdg-utils , wget ]
44
stage-packages: [ libgl1-mesa-glx, libgl1-mesa-dri, libexif12, fontconfig, fonts-dejavu, xfonts-base, xfonts-encodings, xfonts-scalable, xfonts-utils, ttf-bitstream-vera, ttf-ubuntu-font-family, DEPENDENCIES ]
25
pkg-root/usr/bin: usr/bin
30
wget -nv -O - https://dl.google.com/linux/chrome/deb/dists/stable/Release |grep ^\ |grep Packages$ |head -1 |
31
while read hash size place; do
32
wget -nv -O - https://dl.google.com/linux/chrome/deb/dists/stable/$place |sed -e '1,/^Package: google-chrome-stable$/d' -e '/^$/,$d' |
33
while read key val; do
34
if test "$key" = Depends:; then
35
sed -i -e "s;DEPENDENCIES;$(echo $val |perl -p -e 's/\(.*?\)//g');" snapcraft.yaml
36
elif test "$key" = Version:; then
37
sed -i -e "s;UPSTREAMVERSION;$val;" snapcraft.yaml
38
elif test "$key" = Filename:; then
39
wget -nv --show-progress -O deb https://dl.google.com/linux/chrome/deb/$val
51
wget -nv -O - https://dl.google.com/linux/chrome/deb/dists/stable/Release |grep ^\ |grep Packages$ |head -1 |while read hash size place; do
52
wget -nv -O - https://dl.google.com/linux/chrome/deb/dists/stable/$place |sed -e '1,/^Package: google-chrome-stable$/d' -e '/^$/,$d' |while read key val; do
53
if test "$key" = Depends:; then
54
sed -i -e "s;DEPENDENCIES;$(echo $val |perl -p -e 's/\(.*?\)//g');" snapcraft.yaml
55
elif test "$key" = Version:; then
56
sed -i -e "s;UPSTREAMVERSION;$val;" snapcraft.yaml
57
elif test "$key" = Filename:; then
58
wget -nv --show-progress -O deb https://dl.google.com/linux/chrome/deb/$val
64
test -f deb || echo "Failed to download chrome package."
69
tar xf data.tar.xz -C pkg-root
72
if which lxc &>/dev/null && false; then
73
snapcraft cleanbuild --debug
75
snapcraft snap --debug
47
cd pkg-root; tar xvf ../data.tar.xz
50
snapcraft clean || true
79
echo "The Snap security policies are not ready yet. Install with '--devmode'."
81
rm -fr pkg-root gcenv snapcraft.yaml