LANGS=zh_TW zh_CN vi uk tr th sv sr sr_Latn sl sk ru ro pt pt_BR pl nn nl nb lt ko ja it is ie id hu hr he gl fr fo fi fa eu et es eo el de da cs ca bs bg ar 

PREFIX=/usr
DEST=$(DESTDIR)$(PREFIX)

all:	build

build:	translate compress
clean:
	rm -f po/*.mo
	rm -f man/C/*.gz
	rm -f config-example-*.gz
	rm -rf doc-dev/_build/*

install:	install_translations

	# Inject version string into source files
	(cd .. && ./updateversion.sh)

	# Install python
	install -d $(DEST)/share/backintime/common
	install --mode=644 applicationinstance.py $(DEST)/share/backintime/common
	install --mode=644 askpass.py $(DEST)/share/backintime/common
	install --mode=644 backintime.py $(DEST)/share/backintime/common
	install --mode=644 bcolors.py $(DEST)/share/backintime/common
	install --mode=644 bitbase.py $(DEST)/share/backintime/common
	install --mode=644 cli.py $(DEST)/share/backintime/common
	install --mode=644 configfile.py $(DEST)/share/backintime/common
	install --mode=644 config.py $(DEST)/share/backintime/common
	install --mode=644 daemon.py $(DEST)/share/backintime/common
	install --mode=644 diagnostics.py $(DEST)/share/backintime/common
	install --mode=644 encfstools.py $(DEST)/share/backintime/common
	install --mode=644 exceptions.py $(DEST)/share/backintime/common
	install --mode=644 flock.py $(DEST)/share/backintime/common
	install --mode=644 guiapplicationinstance.py $(DEST)/share/backintime/common
	install --mode=644 languages.py $(DEST)/share/backintime/common
	install --mode=644 logger.py $(DEST)/share/backintime/common
	install --mode=644 mount.py $(DEST)/share/backintime/common
	install --mode=644 password_ipc.py $(DEST)/share/backintime/common
	install --mode=644 password.py $(DEST)/share/backintime/common
	install --mode=644 pluginmanager.py $(DEST)/share/backintime/common
	install --mode=644 progress.py $(DEST)/share/backintime/common
	install --mode=644 qt_probing.py $(DEST)/share/backintime/common
	install --mode=644 schedule.py $(DEST)/share/backintime/common
	install --mode=644 singleton.py $(DEST)/share/backintime/common
	install --mode=644 snapshotlog.py $(DEST)/share/backintime/common
	install --mode=644 snapshots.py $(DEST)/share/backintime/common
	install --mode=644 ssh_max_arg.py $(DEST)/share/backintime/common
	install --mode=644 sshtools.py $(DEST)/share/backintime/common
	install --mode=644 tools.py $(DEST)/share/backintime/common
	install --mode=644 uniquenessset.py $(DEST)/share/backintime/common
	install --mode=644 version.py $(DEST)/share/backintime/common

	# Install plugins
	install -d $(DEST)/share/backintime/plugins
	install --mode=644 plugins/usercallbackplugin.py $(DEST)/share/backintime/plugins

	# Install documentation
	install -d $(DEST)/share/doc/backintime-common
	install --mode=644 ../AUTHORS $(DEST)/share/doc/backintime-common
	install --mode=644 ../README.md $(DEST)/share/doc/backintime-common
	install --mode=644 ../FAQ.md $(DEST)/share/doc/backintime-common
	install --mode=644 ../TRANSLATIONS $(DEST)/share/doc/backintime-common
	install --mode=644 ../CHANGES $(DEST)/share/doc/backintime-common
	install --mode=644 ../LICENSE $(DEST)/share/doc/backintime-common
	install -d $(DEST)/share/doc/backintime-common/LICENSES
	install --mode=644 ../LICENSES/CC0-1.0.txt $(DEST)/share/doc/backintime-common/LICENSES
	install --mode=644 ../LICENSES/GPL-2.0-or-later.txt $(DEST)/share/doc/backintime-common/LICENSES
	install --mode=644 ../LICENSES/GPL-3.0-or-later.txt $(DEST)/share/doc/backintime-common/LICENSES
	install --mode=644 ../LICENSES/MIT.txt $(DEST)/share/doc/backintime-common/LICENSES

	# Install config and user-callback examples
	install -d $(DEST)/share/doc/backintime-common/examples
	install --mode=644 config-example-local.gz $(DEST)/share/doc/backintime-common/examples
	install --mode=644 config-example-ssh.gz $(DEST)/share/doc/backintime-common/examples
	install -d $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.apt-backup $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.default $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.diagnostics $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.kill_snapshot $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.multiple-scripts $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.notify $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.sendmail $(DEST)/share/doc/backintime-common/user-callback-examples
	install --mode=644 ../doc/user-callback-examples/user-callback.ssid $(DEST)/share/doc/backintime-common/user-callback-examples

	# Install man
	install -d $(DEST)/share/man/man1
	install --mode=644 man/C/backintime.1.gz $(DEST)/share/man/man1
	install --mode=644 man/C/backintime-askpass.1.gz $(DEST)/share/man/man1
	install --mode=644 man/C/backintime-config.1.gz $(DEST)/share/man/man1

	# Install application
	install -d $(DEST)/bin
	install --mode=755 backintime $(DEST)/bin
	install --mode=755 backintime-askpass $(DEST)/bin

	# Install autostart
	install -d $(DEST)/../etc/xdg/autostart
	install --mode=644 backintime.desktop $(DEST)/../etc/xdg/autostart

	# Install bash-completion
	install -d $(DEST)/share/bash-completion/completions
	install --mode=644 bash-completion/backintime $(DEST)/share/bash-completion/completions
	ln --symbolic --force backintime $(DEST)/share/bash-completion/completions/backintime-qt

compress:
	# Man pages
	for i in $$(ls -1 man/C/); do case $$i in *.gz|*~) continue;; *) gzip -n --best -c man/C/$$i > man/C/$${i}.gz;; esac; done

	# Config-examples
	gzip -n --best -c config-example-local > config-example-local.gz
	gzip -n --best -c config-example-ssh > config-example-ssh.gz

translate:	po/zh_TW.mo po/zh_CN.mo po/vi.mo po/uk.mo po/tr.mo po/th.mo po/sv.mo po/sr.mo po/sr_Latn.mo po/sl.mo po/sk.mo po/ru.mo po/ro.mo po/pt.mo po/pt_BR.mo po/pl.mo po/nn.mo po/nl.mo po/nb.mo po/lt.mo po/ko.mo po/ja.mo po/it.mo po/is.mo po/ie.mo po/id.mo po/hu.mo po/hr.mo po/he.mo po/gl.mo po/fr.mo po/fo.mo po/fi.mo po/fa.mo po/eu.mo po/et.mo po/es.mo po/eo.mo po/el.mo po/de.mo po/da.mo po/cs.mo po/ca.mo po/bs.mo po/bg.mo po/ar.mo 

po/zh_TW.mo: po/zh_TW.po
	msgfmt -o po/zh_TW.mo po/zh_TW.po

po/zh_CN.mo: po/zh_CN.po
	msgfmt -o po/zh_CN.mo po/zh_CN.po

po/vi.mo: po/vi.po
	msgfmt -o po/vi.mo po/vi.po

po/uk.mo: po/uk.po
	msgfmt -o po/uk.mo po/uk.po

po/tr.mo: po/tr.po
	msgfmt -o po/tr.mo po/tr.po

po/th.mo: po/th.po
	msgfmt -o po/th.mo po/th.po

po/sv.mo: po/sv.po
	msgfmt -o po/sv.mo po/sv.po

po/sr.mo: po/sr.po
	msgfmt -o po/sr.mo po/sr.po

po/sr_Latn.mo: po/sr_Latn.po
	msgfmt -o po/sr_Latn.mo po/sr_Latn.po

po/sl.mo: po/sl.po
	msgfmt -o po/sl.mo po/sl.po

po/sk.mo: po/sk.po
	msgfmt -o po/sk.mo po/sk.po

po/ru.mo: po/ru.po
	msgfmt -o po/ru.mo po/ru.po

po/ro.mo: po/ro.po
	msgfmt -o po/ro.mo po/ro.po

po/pt.mo: po/pt.po
	msgfmt -o po/pt.mo po/pt.po

po/pt_BR.mo: po/pt_BR.po
	msgfmt -o po/pt_BR.mo po/pt_BR.po

po/pl.mo: po/pl.po
	msgfmt -o po/pl.mo po/pl.po

po/nn.mo: po/nn.po
	msgfmt -o po/nn.mo po/nn.po

po/nl.mo: po/nl.po
	msgfmt -o po/nl.mo po/nl.po

po/nb.mo: po/nb.po
	msgfmt -o po/nb.mo po/nb.po

po/lt.mo: po/lt.po
	msgfmt -o po/lt.mo po/lt.po

po/ko.mo: po/ko.po
	msgfmt -o po/ko.mo po/ko.po

po/ja.mo: po/ja.po
	msgfmt -o po/ja.mo po/ja.po

po/it.mo: po/it.po
	msgfmt -o po/it.mo po/it.po

po/is.mo: po/is.po
	msgfmt -o po/is.mo po/is.po

po/ie.mo: po/ie.po
	msgfmt -o po/ie.mo po/ie.po

po/id.mo: po/id.po
	msgfmt -o po/id.mo po/id.po

po/hu.mo: po/hu.po
	msgfmt -o po/hu.mo po/hu.po

po/hr.mo: po/hr.po
	msgfmt -o po/hr.mo po/hr.po

po/he.mo: po/he.po
	msgfmt -o po/he.mo po/he.po

po/gl.mo: po/gl.po
	msgfmt -o po/gl.mo po/gl.po

po/fr.mo: po/fr.po
	msgfmt -o po/fr.mo po/fr.po

po/fo.mo: po/fo.po
	msgfmt -o po/fo.mo po/fo.po

po/fi.mo: po/fi.po
	msgfmt -o po/fi.mo po/fi.po

po/fa.mo: po/fa.po
	msgfmt -o po/fa.mo po/fa.po

po/eu.mo: po/eu.po
	msgfmt -o po/eu.mo po/eu.po

po/et.mo: po/et.po
	msgfmt -o po/et.mo po/et.po

po/es.mo: po/es.po
	msgfmt -o po/es.mo po/es.po

po/eo.mo: po/eo.po
	msgfmt -o po/eo.mo po/eo.po

po/el.mo: po/el.po
	msgfmt -o po/el.mo po/el.po

po/de.mo: po/de.po
	msgfmt -o po/de.mo po/de.po

po/da.mo: po/da.po
	msgfmt -o po/da.mo po/da.po

po/cs.mo: po/cs.po
	msgfmt -o po/cs.mo po/cs.po

po/ca.mo: po/ca.po
	msgfmt -o po/ca.mo po/ca.po

po/bs.mo: po/bs.po
	msgfmt -o po/bs.mo po/bs.po

po/bg.mo: po/bg.po
	msgfmt -o po/bg.mo po/bg.po

po/ar.mo: po/ar.po
	msgfmt -o po/ar.mo po/ar.po

install_translations:
	# Install translations
	install -d $(DEST)/share/locale/zh_TW/LC_MESSAGES
	install --mode=644 po/zh_TW.mo $(DEST)/share/locale/zh_TW/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/zh_CN/LC_MESSAGES
	install --mode=644 po/zh_CN.mo $(DEST)/share/locale/zh_CN/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/vi/LC_MESSAGES
	install --mode=644 po/vi.mo $(DEST)/share/locale/vi/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/uk/LC_MESSAGES
	install --mode=644 po/uk.mo $(DEST)/share/locale/uk/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/tr/LC_MESSAGES
	install --mode=644 po/tr.mo $(DEST)/share/locale/tr/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/th/LC_MESSAGES
	install --mode=644 po/th.mo $(DEST)/share/locale/th/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/sv/LC_MESSAGES
	install --mode=644 po/sv.mo $(DEST)/share/locale/sv/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/sr/LC_MESSAGES
	install --mode=644 po/sr.mo $(DEST)/share/locale/sr/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/sr_Latn/LC_MESSAGES
	install --mode=644 po/sr_Latn.mo $(DEST)/share/locale/sr_Latn/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/sl/LC_MESSAGES
	install --mode=644 po/sl.mo $(DEST)/share/locale/sl/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/sk/LC_MESSAGES
	install --mode=644 po/sk.mo $(DEST)/share/locale/sk/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ru/LC_MESSAGES
	install --mode=644 po/ru.mo $(DEST)/share/locale/ru/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ro/LC_MESSAGES
	install --mode=644 po/ro.mo $(DEST)/share/locale/ro/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/pt/LC_MESSAGES
	install --mode=644 po/pt.mo $(DEST)/share/locale/pt/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/pt_BR/LC_MESSAGES
	install --mode=644 po/pt_BR.mo $(DEST)/share/locale/pt_BR/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/pl/LC_MESSAGES
	install --mode=644 po/pl.mo $(DEST)/share/locale/pl/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/nn/LC_MESSAGES
	install --mode=644 po/nn.mo $(DEST)/share/locale/nn/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/nl/LC_MESSAGES
	install --mode=644 po/nl.mo $(DEST)/share/locale/nl/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/nb/LC_MESSAGES
	install --mode=644 po/nb.mo $(DEST)/share/locale/nb/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/lt/LC_MESSAGES
	install --mode=644 po/lt.mo $(DEST)/share/locale/lt/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ko/LC_MESSAGES
	install --mode=644 po/ko.mo $(DEST)/share/locale/ko/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ja/LC_MESSAGES
	install --mode=644 po/ja.mo $(DEST)/share/locale/ja/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/it/LC_MESSAGES
	install --mode=644 po/it.mo $(DEST)/share/locale/it/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/is/LC_MESSAGES
	install --mode=644 po/is.mo $(DEST)/share/locale/is/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ie/LC_MESSAGES
	install --mode=644 po/ie.mo $(DEST)/share/locale/ie/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/id/LC_MESSAGES
	install --mode=644 po/id.mo $(DEST)/share/locale/id/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/hu/LC_MESSAGES
	install --mode=644 po/hu.mo $(DEST)/share/locale/hu/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/hr/LC_MESSAGES
	install --mode=644 po/hr.mo $(DEST)/share/locale/hr/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/he/LC_MESSAGES
	install --mode=644 po/he.mo $(DEST)/share/locale/he/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/gl/LC_MESSAGES
	install --mode=644 po/gl.mo $(DEST)/share/locale/gl/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/fr/LC_MESSAGES
	install --mode=644 po/fr.mo $(DEST)/share/locale/fr/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/fo/LC_MESSAGES
	install --mode=644 po/fo.mo $(DEST)/share/locale/fo/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/fi/LC_MESSAGES
	install --mode=644 po/fi.mo $(DEST)/share/locale/fi/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/fa/LC_MESSAGES
	install --mode=644 po/fa.mo $(DEST)/share/locale/fa/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/eu/LC_MESSAGES
	install --mode=644 po/eu.mo $(DEST)/share/locale/eu/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/et/LC_MESSAGES
	install --mode=644 po/et.mo $(DEST)/share/locale/et/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/es/LC_MESSAGES
	install --mode=644 po/es.mo $(DEST)/share/locale/es/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/eo/LC_MESSAGES
	install --mode=644 po/eo.mo $(DEST)/share/locale/eo/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/el/LC_MESSAGES
	install --mode=644 po/el.mo $(DEST)/share/locale/el/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/de/LC_MESSAGES
	install --mode=644 po/de.mo $(DEST)/share/locale/de/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/da/LC_MESSAGES
	install --mode=644 po/da.mo $(DEST)/share/locale/da/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/cs/LC_MESSAGES
	install --mode=644 po/cs.mo $(DEST)/share/locale/cs/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ca/LC_MESSAGES
	install --mode=644 po/ca.mo $(DEST)/share/locale/ca/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/bs/LC_MESSAGES
	install --mode=644 po/bs.mo $(DEST)/share/locale/bs/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/bg/LC_MESSAGES
	install --mode=644 po/bg.mo $(DEST)/share/locale/bg/LC_MESSAGES/backintime.mo
	install -d $(DEST)/share/locale/ar/LC_MESSAGES
	install --mode=644 po/ar.mo $(DEST)/share/locale/ar/LC_MESSAGES/backintime.mo

uninstall:	uninstall_files uninstall_dirs

uninstall_files:
	# Uninstall files python
	rm -f $(DEST)/share/backintime/common/__pycache__/*.pyc
	rm -f $(DEST)/share/backintime/common/applicationinstance.py
	rm -f $(DEST)/share/backintime/common/askpass.py
	rm -f $(DEST)/share/backintime/common/backintime.py
	rm -f $(DEST)/share/backintime/common/bcolors.py
	rm -f $(DEST)/share/backintime/common/bitbase.py
	rm -f $(DEST)/share/backintime/common/cli.py
	rm -f $(DEST)/share/backintime/common/configfile.py
	rm -f $(DEST)/share/backintime/common/config.py
	rm -f $(DEST)/share/backintime/common/daemon.py
	rm -f $(DEST)/share/backintime/common/diagnostics.py
	rm -f $(DEST)/share/backintime/common/encfstools.py
	rm -f $(DEST)/share/backintime/common/exceptions.py
	rm -f $(DEST)/share/backintime/common/flock.py
	rm -f $(DEST)/share/backintime/common/guiapplicationinstance.py
	rm -f $(DEST)/share/backintime/common/languages.py
	rm -f $(DEST)/share/backintime/common/logger.py
	rm -f $(DEST)/share/backintime/common/mount.py
	rm -f $(DEST)/share/backintime/common/password_ipc.py
	rm -f $(DEST)/share/backintime/common/password.py
	rm -f $(DEST)/share/backintime/common/pluginmanager.py
	rm -f $(DEST)/share/backintime/common/progress.py
	rm -f $(DEST)/share/backintime/common/qt_probing.py
	rm -f $(DEST)/share/backintime/common/schedule.py
	rm -f $(DEST)/share/backintime/common/singleton.py
	rm -f $(DEST)/share/backintime/common/snapshotlog.py
	rm -f $(DEST)/share/backintime/common/snapshots.py
	rm -f $(DEST)/share/backintime/common/ssh_max_arg.py
	rm -f $(DEST)/share/backintime/common/sshtools.py
	rm -f $(DEST)/share/backintime/common/tools.py
	rm -f $(DEST)/share/backintime/common/uniquenessset.py
	rm -f $(DEST)/share/backintime/common/version.py

	# Uninstall files plugins
	rm -f $(DEST)/share/backintime/plugins/__pycache__/*.pyc
	rm -f $(DEST)/share/backintime/plugins/usercallbackplugin.py

	# Uninstall files documentation
	rm -f $(DEST)/share/doc/backintime-common/AUTHORS
	rm -f $(DEST)/share/doc/backintime-common/README.md
	rm -f $(DEST)/share/doc/backintime-common/FAQ.md
	rm -f $(DEST)/share/doc/backintime-common/TRANSLATIONS
	rm -f $(DEST)/share/doc/backintime-common/CHANGES
	rm -f $(DEST)/share/doc/backintime-common/LICENSE
	rm -f $(DEST)/share/doc/backintime-common/LICENSES/CC0-1.0.txt
	rm -f $(DEST)/share/doc/backintime-common/LICENSES/GPL-2.0-or-later.txt
	rm -f $(DEST)/share/doc/backintime-common/LICENSES/GPL-3.0-or-later.txt
	rm -f $(DEST)/share/doc/backintime-common/LICENSES/MIT.txt

	# Uninstall files config and user-callback examples
	rm -f $(DEST)/share/doc/backintime-common/examples/config-example-local.gz
	rm -f $(DEST)/share/doc/backintime-common/examples/config-example-ssh.gz
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.apt-backup
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.default
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.diagnostics
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.kill_snapshot
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.multiple-scripts
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.notify
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.sendmail
	rm -f $(DEST)/share/doc/backintime-common/user-callback-examples/user-callback.ssid

	# Uninstall files man
	rm -f $(DEST)/share/man/man1/backintime.1.gz
	rm -f $(DEST)/share/man/man1/backintime-askpass.1.gz
	rm -f $(DEST)/share/man/man1/backintime-config.1.gz

	# Uninstall files application
	rm -f $(DEST)/bin/backintime
	rm -f $(DEST)/bin/backintime-askpass

	# Uninstall files autostart
	rm -f $(DEST)/../etc/xdg/autostart/backintime.desktop

	# Uninstall files bash-completion
	rm -f $(DEST)/share/bash-completion/completions/backintime
	rm -f $(DEST)/share/bash-completion/completions/backintime-qt

	# Uninstall files translations
	rm -f $(DEST)/share/locale/zh_TW/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/zh_CN/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/vi/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/uk/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/tr/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/th/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/sv/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/sr/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/sr_Latn/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/sl/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/sk/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ru/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ro/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/pt/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/pt_BR/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/pl/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/nn/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/nl/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/nb/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/lt/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ko/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ja/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/it/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/is/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ie/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/id/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/hu/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/hr/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/he/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/gl/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/fr/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/fo/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/fi/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/fa/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/eu/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/et/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/es/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/eo/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/el/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/de/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/da/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/cs/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ca/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/bs/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/bg/LC_MESSAGES/backintime.mo
	rm -f $(DEST)/share/locale/ar/LC_MESSAGES/backintime.mo

uninstall_dirs:
	# Uninstall directory python
	if [ -d $(DEST)/share/backintime/common/__pycache__ ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/backintime/common/__pycache__; fi
	if [ -d $(DEST)/share/backintime/common ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/backintime/common; fi

	# Uninstall directory plugins
	if [ -d $(DEST)/share/backintime/plugins/__pycache__ ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/backintime/plugins/__pycache__; fi
	if [ -d $(DEST)/share/backintime/plugins ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/backintime/plugins; fi
	if [ -d $(DEST)/share/backintime ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/backintime; fi

	# Uninstall directory documentation
	if [ -d $(DEST)/share/doc/backintime-common ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/doc/backintime-common; fi
	if [ -d $(DEST)/share/doc/backintime-common/LICENSES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/doc/backintime-common/LICENSES; fi

	# Uninstall directory config and user-callback examples
	if [ -d $(DEST)/share/doc/backintime-common/examples ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/doc/backintime-common/examples; fi
	if [ -d $(DEST)/share/doc/backintime-common/user-callback-examples ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/doc/backintime-common/user-callback-examples; fi
	if [ -d $(DEST)/share/doc/backintime-common ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/doc/backintime-common; fi
	if [ -d $(DEST)/share/doc ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/doc; fi

	# Uninstall directory man
	if [ -d $(DEST)/share/man/man1 ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/man/man1; fi
	if [ -d $(DEST)/share/man ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/man; fi

	# Uninstall directory application
	if [ -d $(DEST)/bin ]; then rmdir --ignore-fail-on-non-empty $(DEST)/bin; fi

	# Uninstall directory autostart
	if [ -d $(DEST)/../etc/xdg/autostart ]; then rmdir --ignore-fail-on-non-empty $(DEST)/../etc/xdg/autostart; fi
	if [ -d $(DEST)/../etc/xdg ]; then rmdir --ignore-fail-on-non-empty $(DEST)/../etc/xdg; fi
	if [ -d $(DEST)/../etc ]; then rmdir --ignore-fail-on-non-empty $(DEST)/../etc; fi

	# Uninstall directory bash-completion
	if [ -d $(DEST)/share/bash-completion/completions ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/bash-completion/completions; fi
	if [ -d $(DEST)/share/bash-completion ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/bash-completion; fi

	# Uninstall directory translations
	if [ -d $(DEST)/share/locale/zh_TW/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/zh_TW/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/zh_TW ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/zh_TW; fi
	if [ -d $(DEST)/share/locale/zh_CN/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/zh_CN/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/zh_CN ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/zh_CN; fi
	if [ -d $(DEST)/share/locale/vi/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/vi/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/vi ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/vi; fi
	if [ -d $(DEST)/share/locale/uk/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/uk/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/uk ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/uk; fi
	if [ -d $(DEST)/share/locale/tr/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/tr/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/tr ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/tr; fi
	if [ -d $(DEST)/share/locale/th/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/th/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/th ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/th; fi
	if [ -d $(DEST)/share/locale/sv/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sv/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/sv ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sv; fi
	if [ -d $(DEST)/share/locale/sr/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sr/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/sr ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sr; fi
	if [ -d $(DEST)/share/locale/sr_Latn/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sr_Latn/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/sr_Latn ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sr_Latn; fi
	if [ -d $(DEST)/share/locale/sl/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sl/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/sl ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sl; fi
	if [ -d $(DEST)/share/locale/sk/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sk/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/sk ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/sk; fi
	if [ -d $(DEST)/share/locale/ru/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ru/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ru ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ru; fi
	if [ -d $(DEST)/share/locale/ro/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ro/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ro ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ro; fi
	if [ -d $(DEST)/share/locale/pt/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/pt/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/pt ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/pt; fi
	if [ -d $(DEST)/share/locale/pt_BR/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/pt_BR/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/pt_BR ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/pt_BR; fi
	if [ -d $(DEST)/share/locale/pl/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/pl/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/pl ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/pl; fi
	if [ -d $(DEST)/share/locale/nn/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/nn/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/nn ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/nn; fi
	if [ -d $(DEST)/share/locale/nl/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/nl/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/nl ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/nl; fi
	if [ -d $(DEST)/share/locale/nb/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/nb/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/nb ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/nb; fi
	if [ -d $(DEST)/share/locale/lt/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/lt/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/lt ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/lt; fi
	if [ -d $(DEST)/share/locale/ko/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ko/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ko ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ko; fi
	if [ -d $(DEST)/share/locale/ja/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ja/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ja ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ja; fi
	if [ -d $(DEST)/share/locale/it/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/it/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/it ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/it; fi
	if [ -d $(DEST)/share/locale/is/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/is/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/is ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/is; fi
	if [ -d $(DEST)/share/locale/ie/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ie/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ie ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ie; fi
	if [ -d $(DEST)/share/locale/id/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/id/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/id ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/id; fi
	if [ -d $(DEST)/share/locale/hu/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/hu/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/hu ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/hu; fi
	if [ -d $(DEST)/share/locale/hr/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/hr/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/hr ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/hr; fi
	if [ -d $(DEST)/share/locale/he/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/he/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/he ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/he; fi
	if [ -d $(DEST)/share/locale/gl/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/gl/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/gl ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/gl; fi
	if [ -d $(DEST)/share/locale/fr/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fr/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/fr ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fr; fi
	if [ -d $(DEST)/share/locale/fo/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fo/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/fo ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fo; fi
	if [ -d $(DEST)/share/locale/fi/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fi/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/fi ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fi; fi
	if [ -d $(DEST)/share/locale/fa/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fa/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/fa ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/fa; fi
	if [ -d $(DEST)/share/locale/eu/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/eu/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/eu ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/eu; fi
	if [ -d $(DEST)/share/locale/et/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/et/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/et ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/et; fi
	if [ -d $(DEST)/share/locale/es/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/es/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/es ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/es; fi
	if [ -d $(DEST)/share/locale/eo/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/eo/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/eo ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/eo; fi
	if [ -d $(DEST)/share/locale/el/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/el/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/el ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/el; fi
	if [ -d $(DEST)/share/locale/de/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/de/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/de ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/de; fi
	if [ -d $(DEST)/share/locale/da/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/da/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/da ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/da; fi
	if [ -d $(DEST)/share/locale/cs/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/cs/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/cs ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/cs; fi
	if [ -d $(DEST)/share/locale/ca/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ca/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ca ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ca; fi
	if [ -d $(DEST)/share/locale/bs/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/bs/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/bs ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/bs; fi
	if [ -d $(DEST)/share/locale/bg/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/bg/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/bg ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/bg; fi
	if [ -d $(DEST)/share/locale/ar/LC_MESSAGES ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ar/LC_MESSAGES; fi
	if [ -d $(DEST)/share/locale/ar ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale/ar; fi
	if [ -d $(DEST)/share/locale ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share/locale; fi
	if [ -d $(DEST)/share ]; then rmdir --ignore-fail-on-non-empty $(DEST)/share; fi

test:	unittest

test-v:	unittest-v

unittest:
	/usr/bin/pytest 

unittest-v:
	/usr/bin/pytest -v

