INSTDIR = /var/chk_update DESK = $(shell if [ -d "${HOME}/Pulpit" ]; then echo -n "${HOME}/Pulpit"; else echo -n "${HOME}/Desktop"; fi) all: check 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 -n "Checking for ruby-gettext... " @if [ "`ruby -r gettext -e "puts 'OK'" 2>&1`" = "OK" ]; then echo 'yes'; else echo -e "No.\n Install ruby-gettext."; exit 1; fi @echo "" @echo "Instalation into: $(INSTDIR)" @echo "Create users desktop icon: YES" @echo "Create users autostart entry: YES" @echo -e "\nChecking finished.\n" @echo "If you're updating from version 2.0.* delete your ~/.chk_update directory." @echo -e "\nRun make install as root now.\n" install: check if [ ! -d "$(INSTDIR)" ]; then mkdir "$(INSTDIR)"; fi if [ ! -d "$(INSTDIR)/icons" ]; then mkdir "$(INSTDIR)/icons"; fi if [ ! -d "$(INSTDIR)/langs" ]; then mkdir "$(INSTDIR)/langs"; fi if [ ! -d "$(INSTDIR)/lib" ]; then mkdir "$(INSTDIR)/lib"; fi if [ ! -d "$(INSTDIR)/lib/gui" ]; then mkdir "$(INSTDIR)/lib/gui"; fi if [ ! -d "$(INSTDIR)/archives" ]; then mkdir "$(INSTDIR)/archives"; fi if [ ! -d "$(INSTDIR)/cache" ]; then mkdir "$(INSTDIR)/cache"; fi if [ ! -d "$(INSTDIR)/rb_cache" ]; then mkdir "$(INSTDIR)/rb_cache"; fi if [ ! -d "$(INSTDIR)/lists" ]; then mkdir "$(INSTDIR)/lists"; fi chmod 0777 "$(INSTDIR)/archives" "$(INSTDIR)/cache" "$(INSTDIR)/rb_cache" "$(INSTDIR)/lists" cp icons/*.png "$(INSTDIR)/icons/" cp chk_update.rb "$(INSTDIR)/chk_update.rb" chmod 0755 "$(INSTDIR)/chk_update.rb" cp -R src/lib/*.rb "$(INSTDIR)/lib/" cp -R src/lib/gui/*.rb "$(INSTDIR)/lib/gui/" chmod -R 0755 "$(INSTDIR)/chk_update.rb" chmod a+x "$(INSTDIR)" @ruby -e "require 'fileutils'; include FileUtils; \ Dir.foreach('langs') {|f| \ next if f[0] == 46; \ cp_r \"langs/#{f}\", '$(INSTDIR)/langs', :verbose => true; \ }; \ Dir.foreach('/home/') {|f| \ u = nil; \ u = \"/home/#{f}/Desktop\" if File.exists?(\"/home/#{f}/Desktop\"); \ u = \"/home/#{f}/Pulpit\" if File.exists?(\"/home/#{f}/Pulpit\"); \ next if u.nil?; \ puts \"Installing for user #{f}\"; \ install 'check_update.desktop', u, :mode => 0755, :verbose => true; \ install 'check_update.autostart.desktop', \"/home/#{f}/.kde/Autostart\", :mode => 0755, :verbose => true; \ }" uninstall: rm -rf "$(INSTDIR)" ruby -e "require 'fileutils'; include FileUtils; \ Dir.foreach('/home/') {|f| \ u = nil; \ u = \"/home/#{f}/Desktop\" if File.exists?(\"/home/#{f}/Desktop\"); \ u = \"/home/#{f}/Pulpit\" if File.exists?(\"/home/#{f}/Pulpit\"); \ next if u.nil?; \ puts \"Uninstalling for user #{f}\"; \ rm \"#{u}/check_update.desktop\", :verbose => true; \ rm \"/home/#{f}/.kde/Autostart/check_update.autostart.desktop\", :verbose => true; \ }" clean: find . -name "*~" -exec rm -rf {} \; rm -rf $(DESK)/check_update.desktop~ makepot: rm -rf check_update.pot rgettext chk_update.rb src/lib/*.rb src/lib/gui/*.rb -o check_update.pot updatepo: find langs/ -maxdepth 1 -mindepth 1 -name '*_*' -exec msgmerge \{\}/check_update.po ./check_update.pot -o \{\}/check_update.po \; # LANG=ja_JP msginit -i ../myapp.pot -o myapp.po makemo: find langs/ -maxdepth 1 -mindepth 1 -name '*_*' -exec rmsgfmt \{\}/check_update.po -o ./\{\}/LC_MESSAGES/check_update.mo \;