745d938afca44ecfd9f3f389dca886a97cd1092a
[geeqie.git] / web / geeqie-install-debian.sh
1 #!/bin/bash
2 version="2018-08-06"
3 description=$'
4 Geeqie is an image viewer.
5 This script will download, compile, and install Geeqie on Debian-based systems.
6 If run from a folder that already contains the Geeqie sources, the source
7 code will be updated from the repository.
8 Dialogs allow the user to install additional features, including
9 additional pixbuf loaders.
10
11 Command line options are:
12 -v --version The version of this file
13 -h --help Output this text
14 -c --commit=ID Checkout and compile commit ID
15 -t --tag=TAG Checkout and compile TAG (e.g. v1.4 or v1.3)
16 -b --back=N Checkout commit -N (e.g. "-b 1" for last-but-one commit)
17 '
18
19 # Essential for compiling
20 essential_array=(
21 "git"
22 "build-essential"
23 "autoconf"
24 "libglib2.0-0"
25 "intltool"
26 )
27
28 # Optional for both GTK2 and GTK3
29 optional_array=(
30 "LCMS (for color management)"
31 "liblcms2-dev"
32 "exiv2 (for exif handling)"
33 "libgexiv2-dev"
34 "lua (for --remote commands)"
35 "liblua5.1-0-dev"
36 "libffmpegthumbnailer (for mpeg thumbnails)"
37 "libffmpegthumbnailer-dev"
38 "libtiff (for tiff support)"
39 "libtiff-dev"
40 "libjpeg (for jpeg support"
41 "libjpeg-dev"
42 "librsvg2 (for viewing .svg images"
43 "librsvg2-common"
44 "libwmf (for viewing .wmf images)"
45 "libwmf0.2-7-gtk"
46 "exiftran (for image rotation)"
47 "exiftran"
48 "imagemagick (for image rotation)"
49 "imagemagick"
50 "ufraw (for RAW file handling)"
51 "ufraw"
52 "markdown (for generating README help file)"
53 "markdown"
54 )
55
56 # Optional for GTK3 only
57 optional_gtk3_array=(
58 "libchamplain gtk (for GPS maps)"
59 "libchamplain-gtk-0.12-dev"
60 "libchamplain (for GPS maps)"
61 "libchamplain-0.12-dev"
62 "libpoppler (for pdf file preview)"
63 "libpoppler-glib-dev"
64 )
65
66 # Optional pixbuf loaders
67 optional_loaders_array=(
68 ".webp WebP images"
69 "webp"
70 ".psd Photoshop images"
71 "psd"
72 ".xcf Gimp files"
73 "xcf"
74 )
75
76 ####################################################################
77 # Get System Info
78 # Derived from: https://github.com/coto/server-easy-install (GPL)
79 ####################################################################
80 lowercase()
81 {
82         echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
83 }
84
85 systemProfile()
86 {
87         OS=`lowercase \`uname\``
88         KERNEL=`uname -r`
89         MACH=`uname -m`
90
91         if [ "${OS}" == "windowsnt" ]
92         then
93                 OS=windows
94         elif [ "${OS}" == "darwin" ]
95         then
96                 OS=mac
97         else
98                 OS=`uname`
99                 if [ "${OS}" = "SunOS" ]
100                 then
101                         OS=Solaris
102                         ARCH=`uname -p`
103                         OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
104                 elif [ "${OS}" = "AIX" ]
105                 then
106                         OSSTR="${OS} `oslevel` (`oslevel -r`)"
107                 elif [ "${OS}" = "Linux" ]
108                 then
109                         if [ -f /etc/redhat-release ]
110                         then
111                                 DistroBasedOn='RedHat'
112                                 DIST=`cat /etc/redhat-release |sed s/\ release.*//`
113                                 PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
114                                 REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
115                         elif [ -f /etc/SuSE-release ]
116                         then
117                                 DistroBasedOn='SuSe'
118                                 PSUEDONAME=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
119                                 REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
120                         elif [ -f /etc/mandrake-release ]
121                         then
122                                 DistroBasedOn='Mandrake'
123                                 PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
124                                 REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
125                         elif [ -f /etc/debian_version ]
126                         then
127                                 DistroBasedOn='Debian'
128                                 if [ -f /etc/lsb-release ]
129                                 then
130                                         DIST=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F=  '{ print $2 }'`
131                                         PSUEDONAME=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F=  '{ print $2 }'`
132                                         REV=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F=  '{ print $2 }'`
133                                 fi
134                         fi
135                         if [ -f /etc/UnitedLinux-release ]
136                         then
137                                 DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
138                         fi
139                         OS=`lowercase $OS`
140                         DistroBasedOn=`lowercase $DistroBasedOn`
141                         readonly OS
142                         readonly DIST
143                         readonly DistroBasedOn
144                         readonly PSUEDONAME
145                         readonly REV
146                         readonly KERNEL
147                         readonly MACH
148                 fi
149         fi
150 }
151
152 install_essential()
153 {
154 arraylength=${#essential_array[@]}
155 for (( i=0; i<${arraylength}; i=i+1 ));
156 do
157         package_query ${essential_array[$i]}
158         if [ $? != 0 ]
159         then
160                 package_install ${essential_array[$i]}
161         fi
162 done
163
164 if [[ $1 == "GTK3" ]]
165 then
166         package_query "libgtk-3-dev"
167         if [ $? != 0 ]
168         then
169                 package_install libgtk-3-dev
170         fi
171 else
172         package_query "libgtk2.0-dev"
173         if [ $? != 0 ]
174         then
175                 package_install libgtk2.0-dev
176         fi
177 fi
178 }
179
180 install_options()
181 {
182 if [ -n "$options" ]
183 then
184         OLDIFS=$IFS
185         IFS='|'
186         set $options
187         while [ $# -gt 0 ];
188         do
189                 package_install $1
190                 shift
191         done
192         IFS=$OLDIFS
193 fi
194 }
195
196 install_webp()
197 {
198 rm -rf webp-pixbuf-loader-master
199 package_install libglib2.0-dev libgdk-pixbuf2.0-dev libwebp-dev python-minimal
200 wget https://github.com/aruiz/webp-pixbuf-loader/archive/master.zip
201 unzip master.zip
202 cd webp-pixbuf-loader-master
203 ./waf configure
204 ./waf build
205 sudo --askpass ./waf install
206 sudo --askpass gdk-pixbuf-query-loaders --update-cache
207 cd -
208 rm -rf webp-pixbuf-loader-master
209 rm master.zip
210 }
211
212 install_psd()
213 {
214 rm -rf gdk-pixbuf-psd
215 git clone https://github.com/and-rom/gdk-pixbuf-psd.git
216 cd gdk-pixbuf-psd
217 ./autogen.sh
218 make
219 sudo --askpass make install
220 sudo --askpass gdk-pixbuf-query-loaders --update-cache
221 cd -
222 rm -rf gdk-pixbuf-psd
223 }
224
225 install_xcf()
226 {
227 rm -rf xcf-pixbuf-loader
228 package_install libbz2-dev
229 git clone https://github.com/StephaneDelcroix/xcf-pixbuf-loader.git
230 cd xcf-pixbuf-loader
231 ./autogen.sh
232 make
233
234 # There must be a better way...
235 loader_locn=$(gdk-pixbuf-query-loaders | grep "LoaderDir" | tr -d '#[:space:]')
236
237 OLDIFS=$IFS
238 IFS='='
239 set $loader_locn
240 OLDIFS=$IFS
241
242 if [ -d $2 ]
243 then
244         sudo --askpass cp .libs/libioxcf.so $2
245         sudo --askpass gdk-pixbuf-query-loaders --update-cache
246 fi
247 cd -
248 rm -rf xcf-pixbuf-loader
249 }
250
251 install_extra_loaders()
252 {
253 if [ -n "$extra_loaders" ]
254 then
255         OLDIFS=$IFS
256         IFS='|'
257         set $extra_loaders
258         while [ $# -gt 0 ];
259         do
260                 case $1 in
261                 "webp" )
262                         install_webp
263                 ;;
264                 "psd" )
265                         install_psd
266                 ;;
267                 "xcf" )
268                         install_xcf
269                 ;;
270                 esac
271
272                 shift
273         done
274         IFS=$OLDIFS
275 fi
276 return
277 }
278
279 uninstall()
280 {
281 current_dir=$(basename $PWD)
282 if [[ $current_dir == "geeqie" ]]
283 then
284         sudo --askpass make uninstall
285         zenity --title="Uninstall Geeqie" --width=370 --text="WARNING.\nThis will delete folder:\n\n$PWD\n\nand all sub-folders!" --question --ok-label="Cancel" --cancel-label="OK" 2>/dev/null
286
287         if [[ $? == 1 ]]
288         then
289                 cd ..
290                 sudo --askpass rm -rf geeqie
291         fi
292 else
293         zenity --title="Uninstall Geeqie" --width=370 --text="This is not a geeqie installation folder!\n\n$PWD" --warning 2>/dev/null
294 fi
295
296 exit_install
297 }
298
299 package_query()
300 {
301 if [[ $DistroBasedOn == "debian" ]]
302 then
303         res=$(dpkg-query --show --showformat='${Status}' $1 2>>$install_log)
304         if [[ "$res" == "install ok installed"* ]]
305         then
306                 status=0
307         else
308                 status=1
309         fi
310 fi
311 return $status
312 }
313
314 package_install()
315 {
316 if [[ $DistroBasedOn == "debian" ]]
317 then
318         sudo --askpass apt-get --assume-yes install $@ >>$install_log 2>&1
319 fi
320 }
321
322 exit_install()
323 {
324 rm $install_pass_script >/dev/null 2>&1
325 #~ rm $install_log >/dev/null 2>&1
326
327 if [[ -p $zen_pipe ]]
328 then
329         echo "100" > $zen_pipe
330         echo "#End" > $zen_pipe
331 fi
332
333 zenity --title="$title" --width=370 --text=$'Geeqie is not installed\nLog file: '$install_log --info 2>/dev/null
334
335 rm $zen_pipe >/dev/null 2>&1
336
337 exit 1
338 }
339
340 # Entry point
341
342 # If uninstall has been run, maybe the current directory no longer exists
343 ls $PWD >/dev/null
344 if [[ $? != 0 ]]
345 then
346         zenity --error --title="Install Geeqie and dependencies" --width=370 --text="Folder $PWD does not exist!" 2>/dev/null
347
348         exit
349 fi
350
351 # Check system type
352 systemProfile
353 if [[ $DistroBasedOn != "debian" ]]
354 then
355         zenity --error --title="Install Geeqie and dependencies" --width=370 --text="Unknown operating system:\n
356 Operating System: $OS
357 Distribution: $DIST
358 Psuedoname: $PSUEDONAME
359 Revision: $REV
360 DistroBasedOn: $DistroBasedOn
361 Kernel: $KERNEL
362 Machine: $MACH" 2>/dev/null
363
364         exit
365 fi
366
367 # Parse the comand line
368 OPTS=$(getopt -o vhc:t:b: --long version,help,commit:,tag:,back: -- "$@")
369 eval set -- "$OPTS"
370
371 while true;
372 do
373         case "$1" in
374         -v | --version )
375                 echo "$version"
376                 exit
377                 ;;
378         -h | --help )
379                 echo "$description"
380                 exit
381                 ;;
382         -c | --commit )
383                 COMMIT="$2"
384                 shift
385                 shift
386                 ;;
387         -t | --tag )
388                 TAG="$2"
389                 shift;
390                 shift
391                 ;;
392         -b | --back )
393                 BACK="$2"
394                 shift;
395                 shift
396                 ;;
397         * ) break
398                 ;;
399         esac
400 done
401
402 # If a Geeqie folder already exists here, warn the user
403 if [ -d "geeqie" ]
404 then
405         zenity --info --title="Install Geeqie and dependencies" --width=370 --text="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will download, compile, and install Geeqie source\ncode and its dependencies.\n\nA sub-folder named \"geeqie\" will be created in the\nfolder this script is run from, and the source code\nwill be downloaded to that sub-folder.\n\nA sub-folder of that name already exists.\nPlease try another folder." 2>/dev/null
406
407         exit
408 fi
409
410 # If it looks like a Geeqie download folder, assume an update
411 if [ -d ".git" ] && [ -d "src" ] && [ -f "geeqie.1" ]
412 then
413         mode="update"
414 else
415         # If it looks like something else is already installed here, warn the user
416         if [ -d ".git" ] || [ -d "src" ]
417         then
418                 zenity --info --title="Install Geeqie and dependencies" --width=370 --text="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will download, compile, and install Geeqie source\ncode and its dependencies.\n\nIt looks like you are running this script from a folder which already has software installed.\n\nPlease try another folder." 2>/dev/null
419
420                 exit
421         else
422                 mode="install"
423         fi
424 fi
425
426 # Use GTK3 as default
427 gk2_installed=FALSE
428 gtk3_installed=TRUE
429
430 if [[ $mode == "install" ]]
431 then
432         message="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will download, compile, and install Geeqie source\ncode and its dependencies.\n\nA sub-folder named \"geeqie\" will be created in the\nfolder this script is run from, and the source code\nwill be downloaded to that sub-folder.\n\nIn this dialog you must select whether to compile\nfor GTK2 or GTK3.\nIf you want to use GPS maps or pdf preview,\nyou must choose GTK3.\nThe GTK2 version has a slightly different\nlook-and-feel compared to the GTK3 version,\nbut otherwise has the same features.\nYou may easily switch between the two after\ninstallation.\n\nIn subsequent dialogs you may choose which\noptional features to install."
433
434         title="Install Geeqie and dependencies"
435         install_option=TRUE
436 else
437         message="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will update the Geeqie source code and its\ndependencies, and will compile and install Geeqie.\n\nYou may also switch the installed version from\nGTK2 to GTK3 and vice versa.\n\nIn this dialog you must select whether to compile\nfor GTK2 or GTK3.\nIf you want to use GPS maps or pdf preview,\nyou must choose GTK3.\nThe GTK2 version has a slightly different\nlook-and-feel compared to the GTK3 version,\nbut otherwise has the same features.\n\nIn subsequent dialogs you may choose which\noptional features to install."
438
439         title="Update Geeqie and re-install"
440         install_option=FALSE
441
442         # When updating, use previous installation as default
443         if [[ -f config.log ]]
444         then
445                 grep gtk-2.0 config.log >/dev/null
446                 if [[ $? != 0 ]]
447                 then
448                         gtk2_installed=FALSE
449                         gtk3_installed=TRUE
450                 else
451                         gtk2_installed=TRUE
452                         gtk3_installed=FALSE
453                 fi
454         fi
455 fi
456
457 # Ask whether to install GTK2 or GTK3 or uninstall
458
459 gtk_version=$(zenity --title="$title" --width=370 --text="$message" --list --radiolist --column "" --column "" "$gtk3_installed" "GTK3 (required for GPS maps and pdf preview)" "$gtk2_installed" "GTK2" FALSE "Uninstall" --cancel-label="Cancel" --ok-label="OK" --hide-header 2>/dev/null)
460
461 if [[ $? == 1 ]]
462 then
463         exit
464 fi
465
466 # Environment variable SUDO_ASKPASS cannot be "zenity --password",
467 # so create a temporary script containing the command
468 install_pass_script=$(mktemp --tmpdir geeqie_install_XXXXXX.sh)
469 echo $'#!/bin/bash
470 zenity --password --title=\"'$title$'\" --width=370 2>/dev/null
471 if [[ $? > 0 ]]
472 then
473         exit 1
474 fi
475 \n' > $install_pass_script
476 chmod +x $install_pass_script
477 export SUDO_ASKPASS=$install_pass_script
478
479 if [[ $gtk_version == "Uninstall" ]]
480 then
481         uninstall
482         exit
483 fi
484
485 # Put the install log in tmp, to avoid writing to PWD during a new install
486 rm install.log 2>/dev/null
487 install_log=$(mktemp --tmpdir geeqie_install_XXXXXX.log)
488
489 sleep 100 | zenity --title="$title" --text="Checking for installed files" --width=370 --progress --pulsate 2>/dev/null &
490 zen_pid=$!
491
492 # Get the standard options that are not yet installed
493 arraylength=${#optional_array[@]}
494 for (( i=0; i<${arraylength}; i=i+2 ));
495 do
496         package_query ${optional_array[$i+1]}
497         if [ $? != 0 ]
498         then
499                 if [ -z "$option_string" ]
500                 then
501                         option_string="$install_option"$'\n'"${optional_array[$i]}"$'\n'"${optional_array[$i+1]}"
502                 else
503                         option_string="$option_string"$'\n'"$install_option"$'\n'"${optional_array[$i]}"$'\n'"${optional_array[$i+1]}"
504                 fi
505         fi
506 done
507
508 # If GTK3 required, get the GTK3 options not yet installed
509 if [[ "$gtk_version" == "GTK3"* ]]
510 then
511         arraylength=${#optional_gtk3_array[@]}
512         for (( i=0; i<${arraylength}; i=i+2 ));
513         do
514                 package_query ${optional_gtk3_array[$i+1]}
515                 if [ $? != 0 ]
516                 then
517                         if [ -z "$option_string" ]
518                         then
519                                 option_string="$install_option"$'\n'"${optional_gtk3_array[$i]}"$'\n'"${optional_gtk3_array[$i+1]}"
520                         else
521                                 option_string="$option_string"$'\n'"$install_option"$'\n'"${optional_gtk3_array[$i]}"$'\n'"${optional_gtk3_array[$i+1]}"
522                         fi
523                 fi
524         done
525 fi
526
527 # Get the optional loaders not yet installed
528 ((i=0))
529 gdk-pixbuf-query-loaders | grep WebP >/dev/null
530 if [[ $? == 1 ]]
531 then
532         if [ -z "$loaders_string" ]
533         then
534                 loaders_string=$'FALSE\n'"${optional_loaders_array[$i]}"$'\n'"${optional_loaders_array[$i+1]}"
535         else
536                 loaders_string="$loaders_string"$'\nFALSE\n'"${optional_loaders_array[$i]}"$'\n'"${optional_loaders_array[$i+1]}"
537
538         fi
539 fi
540
541 ((i=i+2))
542 gdk-pixbuf-query-loaders | grep psd >/dev/null
543 if [[ $? == 1 ]]
544 then
545         if [ -z "$loaders_string" ]
546         then
547                 loaders_string=$'FALSE\n'"${optional_loaders_array[$i]}"$'\n'"${optional_loaders_array[$i+1]}"
548         else
549                 loaders_string="$loaders_string"$'\nFALSE\n'"${optional_loaders_array[$i]}"$'\n'"${optional_loaders_array[$i+1]}"
550         fi
551 fi
552
553 ((i=i+2))
554 gdk-pixbuf-query-loaders | grep xcf >/dev/null
555 if [[ $? == 1 ]]
556 then
557         if [ -z "$loaders_string" ]
558         then
559                 loaders_string=$'FALSE\n'"${optional_loaders_array[$i]}"$'\n'"${optional_loaders_array[$i+1]}"
560         else
561                 loaders_string="$loaders_string"$'\nFALSE\n'"${optional_loaders_array[$i]}"$'\n'"${optional_loaders_array[$i+1]}"
562         fi
563 fi
564
565 kill $zen_pid 2>/dev/null
566
567 # Ask the user which options to install
568 if [ -n "$option_string" ]
569 then
570         options=$(echo "$option_string" | zenity --title="$title" --width=400 --height=500 --list --checklist --text 'Select which library files to install:' --column='Select' --column='Library files' --column='Library' --hide-column=3 --print-column=3 2>/dev/null)
571
572         if [[ $? == 1 ]]
573         then
574                 exit_install
575         fi
576 fi
577
578 # Ask the user which extra loaders to install
579 if [ -n "$loaders_string" ]
580 then
581         extra_loaders=$(echo "$loaders_string" | zenity --title="$title" --width=370 --height=400 --list --checklist --text 'These loaders are not part of the main repository,\nbut are known to work to some extent.' --column='Select' --column='Library files' --column='Library' --hide-column=3 --print-column=3 2>/dev/null)
582
583         if [[ $? == 1 ]]
584         then
585                 exit_install
586         fi
587 fi
588
589 # Start of Zenity progress section
590 zen_pipe=$(mktemp --dry-run --tmpdir geeqie_install_pipe_XXXXXX)
591 mkfifo $zen_pipe
592 (tail  -f $zen_pipe 2>/dev/null) | zenity --progress --title="$title" --width=370 --text="Installing options..." --auto-close --auto-kill --percentage=0 2>/dev/null &
593
594 echo "2" > $zen_pipe
595 echo "#Installing essential libraries..." > $zen_pipe
596
597 install_essential $gtk_version
598
599 echo "4" > $zen_pipe
600 echo "#Installing options..." > $zen_pipe
601
602 install_options
603
604 echo "6" > $zen_pipe
605 echo "#Installing extra loaders..." > $zen_pipe
606
607 install_extra_loaders
608
609 echo "10" > $zen_pipe
610 echo "#Getting new sources from server..." > $zen_pipe
611
612 if [[ $mode == "install" ]]
613 then
614         ret=$(git clone git://www.geeqie.org/geeqie.git >>$install_log 2>&1)
615 else
616         git checkout master >>$install_log 2>&1
617         if [[ $? != 0 ]]
618         then
619                 git_error=$(tail -n5 $install_log 2>&1)
620                 zenity --title="$title" --width=370 --height=400 --error --text=$'Git error:\n\n'"$git_error" 2>/dev/null
621                 exit_install
622         fi
623         ret=$(git pull >>$install_log 2>&1)
624 fi
625
626 if [[ $? != 0 ]]
627 then
628         git_error=$(tail -n5 $install_log 2>&1)
629         zenity --title="$title" --width=370 --height=400 --error --text=$'Git error:\n\n'"$git_error" 2>/dev/null
630         exit_install
631 fi
632
633 echo "20" > $zen_pipe
634 echo "#Cleaning installed version..." > $zen_pipe
635
636 if [[ $mode == "install" ]]
637 then
638         cd geeqie
639 else
640         sudo --askpass make uninstall >>$install_log 2>&1
641         sudo --askpass make maintainer-clean >>$install_log 2>&1
642 fi
643
644 echo "30" > $zen_pipe
645 echo "#Checkout required version..." > $zen_pipe
646
647 if [[ "$BACK" ]]
648 then
649         ret=$(git checkout master~"$BACK" >>$install_log 2>&1)
650         if [[ $? != 0 ]]
651         then
652                 git_error=$(tail -n5 $install_log 2>&1)
653                 zenity --title="$title" --width=370 --height=400 --error --text=$'Git error:\n\n'"$git_error" 2>/dev/null
654                 exit_install
655         fi
656 elif [[ "$COMMIT" ]]
657 then
658         ret=$(git checkout "$COMMIT" >>$install_log 2>&1)
659         if [[ $? != 0 ]]
660         then
661                 git_error=$(tail -n5 $install_log 2>&1)
662                 zenity --title="$title" --width=370 --height=400 --error --text=$'Git error:\n\n'"$git_error" 2>/dev/null
663                 exit_install
664         fi
665 elif [[ "$TAG" ]]
666 then
667         ret=$(git checkout "$TAG" >>$install_log 2>&1)
668         if [[ $? != 0 ]]
669         then
670         echo "error"
671                 git_error=$(tail -n5 $install_log 2>&1)
672                 zenity --title="$title" --width=370 --height=400 --error --text=$'Git error:\n\n'"$git_error" 2>/dev/null
673                 exit_install
674                 exit
675         fi
676 fi
677
678 echo "40" > $zen_pipe
679 echo "#Creating configuration files..." > $zen_pipe
680
681 if [[ $gtk_version == "GTK3"* ]]
682 then
683         ./autogen.sh >>$install_log 2>&1
684 else
685         ./autogen.sh --disable-gtk3 >>$install_log 2>&1
686 fi
687
688 echo "60" > $zen_pipe
689 echo "#Compiling..." > $zen_pipe
690
691 export CFLAGS=$CFLAGS" -Wno-deprecated-declarations"
692 export CXXFLAGS=$CXXFLAGS" -Wno-deprecated-declarations"
693 make -j >>$install_log 2>&1
694
695 echo "90 " > $zen_pipe
696 echo "#Installing Geeqie..." > $zen_pipe
697
698 sudo --askpass make install >>$install_log 2>&1
699
700 rm $install_pass_script
701 mv -f $install_log install.log;
702
703 echo "100 " > $zen_pipe
704 rm $zen_pipe
705
706 (for i in $(seq 0 4 100); do echo "$i"; sleep 0.1; done) | zenity --progress --title="$title" --width=370 --text="Geeqie installation complete...\n" --auto-close 2>/dev/null
707
708 exit