~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to admin/build/prep_dist.sh

  • Committer: Package Import Robot
  • Author(s): Jan Niehusmann
  • Date: 2014-07-01 21:49:34 UTC
  • mfrom: (6.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20140701214934-gt4dkgm94byi4vnn
Tags: 0.15-1
* New upstream version
* set debhelper compat level to 9
* set Standards-Version to 3.9.5 (no further changes)
* add lintian override regarding license-problem-non-free-RFC
* use qconf to regenerate configure script
* implement hardening using buildflags instead of hardening-wrapper

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
set -e
 
3
 
 
4
if [ $# != 2 ]; then
 
5
        echo "usage: $0 [prefix] [distdir]"
 
6
        exit 1
 
7
fi
 
8
 
 
9
platform=`uname -s`
 
10
if [ "$platform" == "Darwin" ]; then
 
11
        platform=mac
 
12
elif [ "$platform" == "MINGW32_NT-6.1" ]; then
 
13
        platform=win
 
14
else
 
15
        echo "error: unsupported platform $platform"
 
16
        exit 1
 
17
fi
 
18
 
 
19
. ./package_info
 
20
 
 
21
destdir=
 
22
base_prefix=$1
 
23
dist_base=$2
 
24
 
 
25
build_base=$PWD
 
26
psi_base=$PWD/../..
 
27
deps_base=$PWD/deps
 
28
 
 
29
mkdir -p $dist_base
 
30
 
 
31
# args: path to framework, framework name, framework version
 
32
cleanup_framework() {
 
33
        # remove dev stuff
 
34
        rm -rf $1/Headers
 
35
        rm -f $1/${2}_debug
 
36
        rm -f $1/${2}_debug.prl
 
37
        rm -rf $1/Versions/$3/Headers
 
38
        rm -f $1/Versions/$3/${2}_debug
 
39
        rm -f $1/Versions/$3/${2}_debug.prl
 
40
}
 
41
 
 
42
if [ "$platform" == "mac" ]; then
 
43
        target_base=$destdir$base_prefix
 
44
        target_dist_base=$dist_base
 
45
 
 
46
        mkdir -p $target_dist_base
 
47
 
 
48
        QT_FRAMEWORKS="QtCore QtNetwork QtXml QtGui"
 
49
        QT_PLUGINS="imageformats/libqjpeg.dylib imageformats/libqgif.dylib imageformats/libqmng.dylib"
 
50
        QCA_PLUGINS="crypto/libqca-ossl.dylib crypto/libqca-gnupg.dylib"
 
51
 
 
52
        cp -a $psi_base/psi.app $target_dist_base/Psi.app
 
53
        contentsdir=$target_dist_base/Psi.app/Contents
 
54
 
 
55
        for g in $QT_FRAMEWORKS; do
 
56
                install_name_tool -change $QTDIR/lib/$g.framework/Versions/4/$g @executable_path/../Frameworks/$g.framework/Versions/4/$g $contentsdir/MacOS/psi
 
57
        done
 
58
 
 
59
        install_name_tool -change qca.framework/Versions/2/qca @executable_path/../Frameworks/qca.framework/Versions/2/qca $contentsdir/MacOS/psi
 
60
 
 
61
        mkdir -p $contentsdir/Frameworks
 
62
        for f in $QT_FRAMEWORKS; do
 
63
                cp -a $QTDIR/lib/$f.framework $contentsdir/Frameworks
 
64
                cleanup_framework $contentsdir/Frameworks/$f.framework $f 4
 
65
 
 
66
                install_name_tool -id @executable_path/../Frameworks/$f.framework/Versions/4/$f $contentsdir/Frameworks/$f.framework/$f
 
67
                for g in $QT_FRAMEWORKS; do
 
68
                        install_name_tool -change $QTDIR/lib/$g.framework/Versions/4/$g @executable_path/../Frameworks/$g.framework/Versions/4/$g $contentsdir/Frameworks/$f.framework/$f
 
69
                done
 
70
        done
 
71
 
 
72
        mkdir -p $contentsdir/Plugins
 
73
        mkdir -p $contentsdir/Plugins/imageformats
 
74
        for p in $QT_PLUGINS; do
 
75
                cp -a $QTDIR/plugins/$p $contentsdir/Plugins/$p
 
76
                for g in $QT_FRAMEWORKS; do
 
77
                        install_name_tool -change $QTDIR/lib/$g.framework/Versions/4/$g @executable_path/../Frameworks/$g.framework/Versions/4/$g $contentsdir/Plugins/$p
 
78
                done
 
79
        done
 
80
 
 
81
        cp -a $deps_base/$qca_mac_dir/lib/qca.framework $contentsdir/Frameworks
 
82
        cleanup_framework $contentsdir/Frameworks/qca.framework qca 2
 
83
        install_name_tool -id @executable_path/../Frameworks/qca.framework/Versions/2/qca $contentsdir/Frameworks/qca.framework/qca
 
84
        for g in $QT_FRAMEWORKS; do
 
85
                install_name_tool -change $g.framework/Versions/4/$g @executable_path/../Frameworks/$g.framework/Versions/4/$g $contentsdir/Frameworks/qca.framework/qca
 
86
        done
 
87
 
 
88
        mkdir -p $contentsdir/Plugins/crypto
 
89
        for p in $QCA_PLUGINS; do
 
90
                cp -a $deps_base/$qca_mac_dir/plugins/$p $contentsdir/Plugins/$p
 
91
                for g in $QT_FRAMEWORKS; do
 
92
                        install_name_tool -change $g.framework/Versions/4/$g @executable_path/../Frameworks/$g.framework/Versions/4/$g $contentsdir/Plugins/$p
 
93
                done
 
94
                install_name_tool -change qca.framework/Versions/2/qca @executable_path/../Frameworks/qca.framework/Versions/2/qca $contentsdir/Plugins/$p
 
95
        done
 
96
 
 
97
        cp -a $deps_base/$growl_dir/Framework/Growl.framework $contentsdir/Frameworks
 
98
        cleanup_framework $contentsdir/Frameworks/Growl.framework Growl A
 
99
 
 
100
        GSTBUNDLE_LIB_FILES=
 
101
        for n in `cat $build_base/gstbundle_libs_mac`; do
 
102
                for l in `find $deps_base/$gstbundle_mac_dir/uni/lib -maxdepth 1 -type f -name $n`; do
 
103
                        base_l=`basename $l`
 
104
                        GSTBUNDLE_LIB_FILES="$GSTBUNDLE_LIB_FILES $base_l"
 
105
                done
 
106
        done
 
107
 
 
108
        GSTBUNDLE_LIB_SUBS=
 
109
        for n in `cat $build_base/gstbundle_libs_mac`; do
 
110
                for l in `find $deps_base/$gstbundle_mac_dir/uni/lib -maxdepth 1 -name $n`; do
 
111
                        base_l=`basename $l`
 
112
                        GSTBUNDLE_LIB_SUBS="$GSTBUNDLE_LIB_SUBS $base_l"
 
113
                done
 
114
        done
 
115
 
 
116
        GSTBUNDLE_LIB_GST_FILES=
 
117
        for n in `cat $build_base/gstbundle_gstplugins_mac`; do
 
118
                for l in `find $deps_base/$gstbundle_mac_dir/uni/lib/gstreamer-0.10 -type f -name $n`; do
 
119
                        base_l=`basename $l`
 
120
                        if [ "$base_l" != "libgstosxaudio.so" ]; then
 
121
                                GSTBUNDLE_LIB_GST_FILES="$GSTBUNDLE_LIB_GST_FILES $base_l"
 
122
                        fi
 
123
                done
 
124
        done
 
125
 
 
126
        # subs are files we need to copy, in addition to being what we attempt to substitute via install_name_tool
 
127
        for l in $GSTBUNDLE_LIB_SUBS; do
 
128
                cp -a $deps_base/$gstbundle_mac_dir/uni/lib/$l $contentsdir/Frameworks
 
129
        done
 
130
 
 
131
        # now to substitutions on the regular files only
 
132
        for l in $GSTBUNDLE_LIB_FILES; do
 
133
                for g in $GSTBUNDLE_LIB_SUBS; do
 
134
                        install_name_tool -change $g @executable_path/../Frameworks/$g $contentsdir/Frameworks/$l
 
135
                done
 
136
        done
 
137
 
 
138
        mkdir -p $contentsdir/Frameworks/gstreamer-0.10
 
139
        for p in $GSTBUNDLE_LIB_GST_FILES; do
 
140
                cp $deps_base/$gstbundle_mac_dir/uni/lib/gstreamer-0.10/$p $contentsdir/Frameworks/gstreamer-0.10
 
141
                for g in $GSTBUNDLE_LIB_SUBS; do
 
142
                        install_name_tool -change $g @executable_path/../Frameworks/$g $contentsdir/Frameworks/gstreamer-0.10/$p
 
143
                done
 
144
        done
 
145
 
 
146
        cp $deps_base/$psimedia_mac_dir/plugins/libgstprovider.dylib $contentsdir/Plugins
 
147
        for g in $GSTBUNDLE_LIB_SUBS; do
 
148
                install_name_tool -change $g @executable_path/../Frameworks/$g $contentsdir/Plugins/libgstprovider.dylib
 
149
        done
 
150
        for g in $QT_FRAMEWORKS; do
 
151
                install_name_tool -change $g.framework/Versions/4/$g @executable_path/../Frameworks/$g.framework/Versions/4/$g $contentsdir/Plugins/libgstprovider.dylib
 
152
        done
 
153
else
 
154
        target_base=$destdir$base_prefix
 
155
        target_dist_base=$dist_base
 
156
 
 
157
        mkdir -p $target_dist_base
 
158
        cp -a $target_base/* $target_dist_base
 
159
fi