Debian Codegraph @

Rakefile

raw
1
2 require "rubygems"
3 require "rake"
4 require "shipit"
5 require "pathname"
6
7 makefilepl = Pathname.new("Makefile.PL")
8
9 NAME = makefilepl.read[/name '([^']+)';/, 1]
10 #VERS =
11 #DESCRIPTION =
12
13
14 task :default => :test
15
16 desc "make test"
17 task :test => ["Makefile"] do
18 sh %{make test}
19 end
20
21 desc "make clean"
22 task :clean => ["Makefile"] do
23 sh %{make clean}
24 rm "MANIFEST"
25 end
26
27 desc "make install"
28 task :install => ["Makefile"] do
29 sh %{sudo make install}
30 end
31
32 desc "release"
33 task :release => :shipit
34
35 task :shipit => [:test, "MANIFEST"]
36 Rake::ShipitTask.new do |s|
37 ENV["LANG"] = "C"
38 s.Step.new {
39 # check
40 system("svn", "up")
41 raise "Any chages remain?\n#{`svn st`}" unless `svn st`.empty?
42 }.and {}
43 s.Step.new {
44 system "shipit", "-n"
45 print "Check dry-run result and press Any Key to continue (or cancel by Ctrl-C)."
46 $stdin.gets
47 }.and {
48 system "shipit"
49 }
50 end
51
52
53
54 file "Makefile" => ["Makefile.PL"] do
55 sh %{perl Makefile.PL}
56 end
57
58 file "Makefile.PL"
59
60 file "MANIFEST" => Dir["**/*"].delete_if {|i| i == "MANIFEST" } do
61 rm "MANIFEST" if File.exist?("MANIFEST")
62 sh %{perl Makefile.PL}
63 sh %{make}
64 sh %{make manifest}
65 end