pidgin/win32/nsis/generate_gtk_zip.sh

Tue, 11 Sep 2012 22:04:23 -0400

author
Daniel Atallah <datallah@pidgin.im>
date
Tue, 11 Sep 2012 22:04:23 -0400
branch
release-2.x.y
changeset 33391
e56515365c37
parent 30312
d2cb1662df79
child 33396
d0ec164c8f20
permissions
-rwxr-xr-x

Add sha1sum checking to the gtk bundle components that are downloaded

29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
1 #!/bin/bash
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
2 # Script to generate zip file for GTK+ runtime to be included in Pidgin installer
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
3
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
4 PIDGIN_BASE=$1
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
5
30305
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
6 if [ ! -e $PIDGIN_BASE/ChangeLog ]; then
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
7 echo $(basename $0) must must have the pidgin base dir specified as a parameter.
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
8 exit 1
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
9 fi
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
10
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
11 STAGE_DIR=$PIDGIN_BASE/pidgin/win32/nsis/gtk_runtime_stage
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
12 #Subdirectory of $STAGE_DIR
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
13 INSTALL_DIR=Gtk
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
14 CONTENTS_FILE=$INSTALL_DIR/CONTENTS
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
15
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
16 #This needs to be changed every time there is any sort of change.
29862
e48ceabf7676 Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <datallah@pidgin.im>
parents: 29817
diff changeset
17 BUNDLE_VERSION=2.16.6.0
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
18
33391
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
19 ATK="http://ftp.acc.umu.se/pub/gnome/binaries/win32/atk/1.26/atk_1.26.0-1_win32.zip ATK 1.26.0-1 97efc4c2640e7bae38f672c5e1ff66542a202756"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
20 CAIRO="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.10-1_win32.zip Cairo 1.8.10-1 a08476cccd807943958610977a138c4d6097c7b8"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
21 EXPAT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.0.1-1_win32.zip Expat 2.0.1-1 f47790b9e324cd8613acc9a17fd56bf2c14745fc"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
22 FONTCONFIG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-2_win32.zip Fontconfig 2.8.0-2 37a3117ea6cc50c8a88fba9b6018f35a04fa71ce"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
23 FREETYPE="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.3.11-2_win32.zip Freetype 2.3.11-2 4d40ac1a44d818ac6720c2e93503346b91e99561"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
24 GETTEXT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip Gettext 0.17-1 ad486eed8a531fba1d3cc7ad2f04e8e03367a962"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
25 GLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.20/glib_2.20.5-1_win32.zip Glib 2.20.5-1 b670b37559ef4d088153f77960c6e24a2747efe7"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
26 GTK="http://ftp.acc.umu.se/pub/gnome/binaries/win32/gtk+/2.16/gtk+_2.16.6-2_win32.zip GTK+ 2.16.6-2 012853e6de814ebda0cc4459f9eed8ae680e6d17"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
27 LIBPNG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.0-1_win32.zip libpng 1.4.0-1 9f08167d43a19e4e2efac458f776f64d61544cb5"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
28 PANGO="http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.26/pango_1.26.2-1_win32.zip Pango 1.26.2-1 f0e70127f7bb7a784a66d406cabf244da8316d31"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
29 ZLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib-1.2.3.zip zlib 1.2.3 0ee1e581e99fb761a5b2d46c534c861ca0f58175"
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
30
29862
e48ceabf7676 Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <datallah@pidgin.im>
parents: 29817
diff changeset
31 ALL="ATK CAIRO EXPAT FONTCONFIG FREETYPE GETTEXT GLIB GTK LIBPNG PANGO ZLIB"
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
32
29806
aface02b85bc mkdir -p is better than checking for directory existence
Daniel Atallah <datallah@pidgin.im>
parents: 29798
diff changeset
33 mkdir -p $STAGE_DIR
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
34 cd $STAGE_DIR
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
35
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
36 rm -rf $INSTALL_DIR
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
37 mkdir $INSTALL_DIR
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
38
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
39 #new CONTENTS file
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
40 echo Bundle Version $BUNDLE_VERSION > $CONTENTS_FILE
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
41
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
42 function download_and_extract {
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
43 URL=${1%%\ *}
33391
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
44 SHA1SUM=${1##*\ }
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
45 NAME=${1%\ *}
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
46 NAME=${NAME#*\ }
30305
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
47 FILE=$(basename $URL)
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
48 if [ ! -e $FILE ]; then
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
49 echo Downloading $NAME
33391
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
50 wget $URL || exit 1
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
51 fi
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
52 CHECK_SHA1SUM=`sha1sum $FILE`
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
53 CHECK_SHA1SUM=${CHECK_SHA1SUM%%\ *}
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
54 if [ "$CHECK_SHA1SUM" != "$SHA1SUM" ]; then
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
55 echo "sha1sum ($CHECK_SHA1SUM) for $FILE doesn't match expected value of $SHA1SUM"
e56515365c37 Add sha1sum checking to the gtk bundle components that are downloaded
Daniel Atallah <datallah@pidgin.im>
parents: 30312
diff changeset
56 exit 1
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
57 fi
30305
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
58 EXTENSION=${FILE##*.}
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
59 #This is an OpenSuSE build service RPM
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
60 if [ $EXTENSION == 'rpm' ]; then
30312
d2cb1662df79 Improve error handling
Daniel Atallah <datallah@pidgin.im>
parents: 30305
diff changeset
61 echo "Generating zip from $FILE"
30305
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
62 FILE=$(../rpm2zip.sh $FILE)
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
63 fi
30312
d2cb1662df79 Improve error handling
Daniel Atallah <datallah@pidgin.im>
parents: 30305
diff changeset
64 unzip -q $FILE -d $INSTALL_DIR || exit 1
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
65 echo "$NAME" >> $CONTENTS_FILE
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
66 }
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
67
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
68 for VAL in $ALL
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
69 do
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
70 VAR=${!VAL}
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
71 download_and_extract "$VAR"
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
72 done
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
73
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
74 #Default GTK+ Theme to MS-Windows
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
75 echo gtk-theme-name = \"MS-Windows\" > $INSTALL_DIR/etc/gtk-2.0/gtkrc
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
76
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
77 #Blow away translations that we don't have in Pidgin
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
78 for LOCALE_DIR in $INSTALL_DIR/share/locale/*
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
79 do
30305
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
80 LOCALE=$(basename $LOCALE_DIR)
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
81 if [ ! -e $PIDGIN_BASE/po/$LOCALE.po ]; then
30305
00c325754ef7 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <datallah@pidgin.im>
parents: 29862
diff changeset
82 echo Removing $LOCALE translation as it is missing from Pidgin
29798
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
83 rm -r $LOCALE_DIR
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
84 fi
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
85 done
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
86
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
87 #Generate zip file to be included in installer
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
88 zip -9 -r ../gtk-runtime-$BUNDLE_VERSION.zip Gtk
7e57f09e0b2e The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
89
30312
d2cb1662df79 Improve error handling
Daniel Atallah <datallah@pidgin.im>
parents: 30305
diff changeset
90 exit 0
d2cb1662df79 Improve error handling
Daniel Atallah <datallah@pidgin.im>
parents: 30305
diff changeset
91

mercurial