Sha256: 816d0763bc77198adad1babfdda582f6a790c52f03ac35cfa2909cbd26bc46b3

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'fileutils'

unless Process.uid == 0
  puts "Must run as root"
  exit
end

version = File.open('VERSION') { |f| f.read }

Gem.path.each do |path|
  puts "Checking out #{path}"
  path = File.join(path, 'gems', "grumblr-#{version}")
  unless File.directory?(path)
    puts " Gem not found\n\n"
    next
  end
  puts " Gem found!"
  puts " Copying data:"

  target = '/usr/share/pixmaps/grumblr.svg'
  if File.exists?(target)
    puts " - #{target} exists, skipping."
  else
    puts " + #{target} does not exist. copying"
    FileUtils.copy File.join(path, 'data', 'pixmaps', 'grumblr.svg'),
                   target, :verbose => true
  end

  target = '/usr/share/applications/grumblr.desktop'
  if File.exists?(target)
    puts " - #{target} exists, skipping."
  else
    puts " + #{target} does not exist, copying"
    FileUtils.copy File.join(path, 'data', 'grumblr.desktop'),
                   target, :verbose => true
  end

  target = '/usr/local/bin/grumblr'
  if File.exists?(target)
    puts " - #{target} exists, linking."
  else
    puts " + #{target} does not exist, copying"
    File.symlink File.join(path, 'bin', 'grumblr'), target
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grumblr-2.4.1 setup.rb