Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 68 lines (55 sloc) 2.197 kB
01b537b now we install in a reasonable way
sdague authored
1 require 'rubygems'
2 require 'rake'
3 require 'rake/testtask'
4 require 'rake/rdoctask'
5 require 'rake/clean'
6 require 'rake/contrib/sshpublisher'
7 require 'ftools'
8
9 PKG_VERSION = "0.1"
10
11 Gem::manage_gems
12 require 'rake/gempackagetask'
13
14 spec = Gem::Specification.new do |s|
15 s.name = "opensim-linux-service"
16 s.version = PKG_VERSION
17 s.homepage = "http://forge.opensimulator.org/gf/projects/linuxserver"
18 s.platform = Gem::Platform::RUBY
19 s.summary = "Linux service scripts for running OpenSim"
20 # s.description = "Implements the iCalendar specification (RFC-2445) in Ruby. This allows for the generation and parsing of .ics files, which are used by a variety of calendaring applications."
21
22 # s.files = FileList["{test,lib,docs,examples}/**/*"].to_a
23 s.files = FileList["{init.d}/*"].to_a
24 s.files += ["config", "Rakefile", "README", "AUTHORS", "LICENSE", "INSTALL"]
25 s.has_rdoc = true
26 s.extra_rdoc_files = ["README", "LICENSE", "AUTHORS", "INSTALL"]
27 s.rdoc_options.concat ['--main', 'README']
28
29 s.author = "Sean Dague"
30 s.email = "sdague@gmail.com"
31 end
32
33
34 Rake::GemPackageTask.new(spec) do |pkg|
35 #pkg.gem_spec = spec
36 #pkg.need_gem = false
37 pkg.need_tar = true
38 end
39
40 desc "Install init scripts"
41 task :install do |args|
42 File.copy("init.d/opensim","/etc/init.d/opensim", true)
43 File.copy("init.d/opensim-grid","/etc/init.d/opensim-grid", true)
44 if not File.exists?("/etc/default/opensim")
45 File.copy("config","/etc/default/opensim",true)
46 end
47
48 # This will only work on ubuntu/debian need rules for others
49 if File.exists?("/usr/sbin/update-rc.d")
50 system("/usr/sbin/update-rc.d opensim defaults ")
51 system("/usr/sbin/update-rc.d opensim-grid defaults ")
52 end
53
54 end
55
56 desc "Remove init scripts"
57 task :uninstall do |args|
58 File.delete("/etc/init.d/opensim")
59 File.delete("/etc/init.d/opensim-grid")
60 File.delete("/etc/default/opensim")
61
62 # This will only work on ubuntu/debian need rules for others
63 if File.exists?("/usr/sbin/update-rc.d")
64 system("/usr/sbin/update-rc.d opensim remove ")
65 system("/usr/sbin/update-rc.d opensim-grid remove ")
66 end
67 end
Something went wrong with that request. Please try again.