AppImage - update web page
[geeqie.git] / scripts / generate-appimage.sh
1 #! /bin/bash
2 #**********************************************************************
3 # Copyright (C) 2021 - The Geeqie Team
4 #
5 # Author: Colin Clark
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #**********************************************************************
21 #
22 # This script will generate a Geeqie AppImage.
23 #
24 # It must be run from the base Geeqie folder.
25 # The single parameter is the directory where the AppDir
26 # will be created.
27 #
28 #**********************************************************************
29
30
31 if [[ ! -f geeqie.spec.in ]] || [[ ! -d .git ]]
32 then
33         echo "This is not a Geeqie folder"
34         exit 1
35 fi
36
37 target_dir=$(realpath $1)
38
39 if [[ $? -ne 0 ]]
40 then
41         echo "No target dir specified"
42         exit 1
43 fi
44
45 rm -rf "$target_dir"/AppDir
46 mkdir "$target_dir"/AppDir
47
48 sudo rm -rf doc/html
49
50 sudo make maintainer-clean
51 ./autogen.sh --prefix="/usr/"
52 make -j
53 make install DESTDIR="$target_dir"/AppDir
54
55 export VERSION=$(git tag | tail -1)
56
57 cd $target_dir
58
59 linuxdeploy-x86_64.AppImage \
60 --appdir ./AppDir --output appimage \
61 --desktop-file ./AppDir/usr/share/applications/geeqie.desktop \
62 --icon-file ./AppDir/usr/share/pixmaps/geeqie.png \
63 --executable ./AppDir/usr/bin/geeqie
64
65 mv ./Geeqie-$VERSION-x86_64.AppImage $(./Geeqie-$VERSION-x86_64.AppImage -v | sed 's/git//' | sed 's/-.* /-/' | sed 's/ /-v/' | sed 's/-GTK3//').AppImage