INSTDIR = ${HOME}/.chk_update DESK = $(shell if [ -d "${HOME}/Pulpit" ]; then echo -n "${HOME}/Pulpit"; else echo -n "${HOME}/Desktop"; fi) all: check install-local check: @echo -n "Checking for ruby... " @if [ -f /usr/bin/ruby ]; then echo "yes"; else echo -e "no\nInstall ruby."; exit 1; fi @echo -n "Checking for ruby-progressbar... " @if [ "`ruby -r progressbar -e "puts 'OK'" 2>&1`" = "OK" ]; then echo 'yes'; else echo -e "No.\n Install ruby-progressbar."; exit 1; fi @echo -n "Checking for ruby-bz2... " @if [ "`ruby -r bz2 -e "puts 'OK'" 2>&1`" = "OK" ]; then echo 'yes'; else echo -e "No.\n Install ruby-bz2."; exit 1; fi @echo "Desktop directory: $(DESK)" @echo -e "\nChecking finished.\n" install: check @echo "Global instalation not yet available." @echo "Use make install-local for current user instalation." install-local: check if [ ! -d "$(INSTDIR)" ]; then mkdir "$(INSTDIR)"; fi if [ ! -d "$(INSTDIR)/icons" ]; then mkdir "$(INSTDIR)/icons"; fi cp icons/*.png "$(INSTDIR)/icons/" cp chk_update.rb "$(INSTDIR)/chk_update.rb" cp check_update.desktop ${HOME}/Desktop/ perl -pi -e 's|\$$HOME|${HOME}|g' "$(DESK)/check_update.desktop" cp check_update.autostart.desktop ${HOME}/.kde/Autostart perl -pi -e 's|\$$HOME|${HOME}|g' ${HOME}/.kde/Autostart/check_update.autostart.desktop uninstall-local: rm -rf "$(INSTDIR)" rm -rf $(DESK)/check_update.desktop uninstall: @echo "Not yet implemented." clean: find . -name "*~" -exec rm -rf {} \; rm -rf $(DESK)/check_update.desktop~