changeset 28:a666afdaa9c9

Added rakefile and manual
author unexist
date Fri, 22 Jan 2010 15:44:28 +0100
parents b8a8e3c5b6c6
children a7496708b087
files Rakefile dist/man/subtly.1
diffstat 2 files changed, 164 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Rakefile	Fri Jan 22 15:44:28 2010 +0100
@@ -0,0 +1,120 @@
+#
+# @package sur
+#
+# @file Rake build file
+# @copyright (c) 2005-2010 Christoph Kappel <unexist@dorfelite.net>
+# @version $Id$
+#
+# This program can be distributed under the terms of the GNU GPL.
+# See the file COPYING.
+#
+
+require("mkmf")
+require("fileutils")
+
+# 
+# Settings
+#
+# Options {{{
+@options = {
+  "destdir"   => "",
+  "prefix"    => "/usr",
+  "manprefix" => "$(prefix)/share/man",
+  "bindir"    => "$(destdir)/$(prefix)/bin",
+  "extdir"    => "$(destdir)/$(sitelibdir)/subtly",
+  "mandir"    => "$(destdir)/$(manprefix)/man1"
+} # }}}
+
+# Lists {{{
+PG_SUY = "bin/subtly"
+PG_SRC = FileList["subtly/*.rb"]
+# }}}
+
+# 
+# Tasks
+#
+# Task: default {{{
+desc("Just install")
+task(:default => [:install])
+# }}}
+
+# Task: install {{{
+desc("Install sur")
+task(:install) do
+  # Get options
+  @options.each_key do |k|
+    if(!ENV[k].nil?)
+      @options[k] = ENV[k]
+    end
+  end
+
+  # Expand options
+  @options.each do |k, v|
+    @options[k] = Config.expand(v, CONFIG.merge(@options))
+  end
+
+  # Make install dirs
+  FileUtils.mkdir_p( 
+    [
+      @options["bindir"],
+      @options["extdir"],
+      @options["mandir"]
+    ]
+  )
+
+  # Install files
+  message("INSTALL %s\n" % [File.basename(PG_SUY)])
+  FileUtils.install(PG_SUY, @options["bindir"], :mode => 0755, :verbose => false)
+
+  PG_SRC.collect do |f|
+    message("INSTALL %s\n" % [File.basename(f)])
+    FileUtils.install(f, @options["extdir"], :mode => 0644, :verbose => false)
+  end
+
+  # Install manpage
+  FileList["dist/man/*.*"].collect do |f|
+    message("INSTALL %s\n" % [File.basename(f)])
+    FileUtils.install(f, @options["mandir"], :mode => 0644, :verbose => false)
+  end
+
+  # Set revision
+  if(File.exists?(".hg") && (hg = find_executable0("hg")) && (sed = find_executable0("sed")))
+    match = `#{hg} tip`.match(/changeset:\s*(\d+).*/)
+
+    if(!match.nil? && 2 == match.size)
+      revision = match[1]
+    else
+      revision = "999999"
+    end
+
+    # Update version variable
+    file = File.join(@options["extdir"], "runner.rb")
+    if(File.file?(file))
+      `#{sed} -i -e 's#VERSION = "\\([0-9]\\).\\([0-9]\\)"#VERSION = "\\1.\\2.#{revision}"#' #{file}`
+    end
+  end  
+end # }}}
+
+# Task: help {{{
+desc("Show help")
+task(:help) do
+  puts <<EOF
+destdir=PATH     Set intermediate install prefix (current: #{@options["destdir"]})
+prefix=PATH      Set install prefix (current: #{@options["prefix"]})
+bindir=PATH      Set binary directory (current: #{@options["bindir"]})
+mandir=PATH      Set man directory (current: #{@options["mandir"]})
+EOF
+end # }}}
+
+# Task: test {{{
+desc("Run tests")
+task(:test => [:build]) do
+  if(!ENV["sublet"].nil?)
+    require("test/unit/sublet_test")
+    require(ENV["sublet"])
+  else
+    require("test/subtlext_suite")
+  end
+end # }}}
+
+# vim:ts=2:bs=2:sw=2:et:fdm=marker
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dist/man/subtly.1	Fri Jan 22 15:44:28 2010 +0100
@@ -0,0 +1,44 @@
+.\" generated with Ron/v0.3
+.\" http://github.com/rtomayko/ron/
+.
+.TH "SUBTLY" "1" "January 2010" "" ""
+.
+.SH "NAME"
+\fBsubtly\fR \-\- a small ruby webkit browser
+.
+.SH "SYNOPSIS"
+\fBsubtly\fR [URI]
+.
+.SH "DESCIPTION"
+\fBsubtly\fR is a small Ruby based Gtk+ / Webkit browser glued together with ffi,
+mainly created as proof\-of\-concept.
+.
+.SH "COMMANDS"
+.
+.IP "\(bu" 4
+\fBsubtly\fR \fIURI\fR
+.
+.br
+  Launch subtly and load uri
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+.
+.nf
+
+subtly http://www.google.de
+subtly http://subtle.de 
+.
+.fi
+.
+.SH "BUGS"
+Report bugs to unexist@dorfelite.net
+.
+.br
+Homepage: http://subtle.de
+.
+.br
+.
+.SH "COPYRIGHT"
+Copyright (c) Christoph Kappel \fIunexist@dorfelite.net\fR