release.linux.sh 3.27 KB
Newer Older
Claudio Valerio's avatar
Claudio Valerio committed
1
#!/bin/bash
Claudio Valerio's avatar
Claudio Valerio committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# --------------------------------------------------------------------
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------

Claudio Valerio's avatar
Claudio Valerio committed
17 18 19

make clean
rm -rf build/linux/release/
20
rm -rf install
Claudio Valerio's avatar
Claudio Valerio committed
21

22
QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
23 24
PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake"
25
LRELEASES="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease"
26 27 28 29 30 31

if [ ! -e "$QMAKE_PATH" ]; then
    echo "qmake command not found at $QMAKE_PATH"
    exit 1
fi

32

33 34 35 36 37 38
if [ ! -e "$PLUGINS_PATH" ]; then
    echo "plugins path not found at $PLUGINS_PATH"
    exit 1
fi

$QMAKE_PATH -spec linux-g++
Claudio Valerio's avatar
Claudio Valerio committed
39

shibakaneki's avatar
shibakaneki committed
40 41
make -j 4 release-install

42 43
$LRELEASES "Sankore_3.1.pro"

Claudio Valerio's avatar
Claudio Valerio committed
44
VERSION=`cat build/linux/release/version`
Kindov's avatar
Kindov committed
45
if [ ! -f build/linux/release/version ]; then
Claudio Valerio's avatar
Claudio Valerio committed
46 47
    echo "version not found"
    exit 1
48 49 50
else
    LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`"
    if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then
51
        echo creating a tag with the version $VERSION
52 53
        git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
        git push origin --tags 
54
    fi
Claudio Valerio's avatar
Claudio Valerio committed
55 56 57 58 59 60 61
fi

cp resources/linux/run.sh build/linux/release/product
chmod +x build/linux/release/product/run.sh

cp -R resources/linux/qtlinux/* build/linux/release/product/

62 63 64 65 66 67 68 69 70 71 72
#copying plugins
cp -R $PLUGINS_PATH build/linux/release/product/
#removing debug version
find build/linux/release/product/ -name *.debug -exec rm {} \;

#copying custom qt library
QT_LIBRARY_DEST_PATH="build/linux/release/product/qtlib"
mkdir $QT_LIBRARY_DEST_PATH
QT_LIBRARY_SOURCE_PATH="$QT_PATH/lib"

copyQtLibrary(){
73
    if [ ! -e "$QT_LIBRARY_SOURCE_PATH/$1.so.4.7.3" ]; then
74
        echo "library not found: $QT_LIBRARY_SOURCE_PATH"
75
        exit 1
76 77
    fi
    cp "$QT_LIBRARY_SOURCE_PATH/$1.so.4" "$QT_LIBRARY_DEST_PATH/"
78
    cp "$QT_LIBRARY_SOURCE_PATH/$1.so.4.7.3" "$QT_LIBRARY_DEST_PATH/"
79 80
}

81 82 83 84

cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4" "$QT_LIBRARY_DEST_PATH/"
cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4.4.0" "$QT_LIBRARY_DEST_PATH/"

85 86 87 88 89 90 91 92 93 94
copyQtLibrary libQtWebKit
copyQtLibrary libQtDBus
copyQtLibrary libQtScript
copyQtLibrary libQtSvg
copyQtLibrary libQtXmlPatterns
copyQtLibrary libQtNetwork
copyQtLibrary libQtXml
copyQtLibrary libQtGui
copyQtLibrary libQtCore

95 96
cp "$QT_LIBRARY_SOURCE_PATH/phonon.so.4" "$QT_LIBRARY_DEST_PATH/"
cp "$QT_LIBRARY_SOURCE_PATH/phonon.so.4.4.0" "$QT_LIBRARY_DEST_PATH/"
Kindov's avatar
Kindov committed
97

Claudio Valerio's avatar
Claudio Valerio committed
98 99 100
rm -rf install/linux
mkdir -p install/linux

Claudio Valerio's avatar
Claudio Valerio committed
101
mv build/linux/release/product build/linux/release/Open-Sankore.$VERSION
Claudio Valerio's avatar
Claudio Valerio committed
102 103 104 105
cd build/linux/release

# "Removing .svn directories ..."
find . -name .svn -exec rm -rf {} \; 2> /dev/null
Claudio Valerio's avatar
Claudio Valerio committed
106 107
tar cvzf ../../../install/linux/Open-Sankore.tar.gz Open-Sankore.$VERSION -C . 
notify-send "Open-Sankore"  "Build Finished"