[Pkg-ruby-extras-maintainers] r330 - website/src

Lucas Nussbaum lucas-guest at costa.debian.org
Thu Feb 9 15:34:20 UTC 2006


Author: lucas-guest
Date: 2006-02-09 15:34:19 +0000 (Thu, 09 Feb 2006)
New Revision: 330

Added:
   website/src/50.upstream-devs.en.page
Log:
added a packaging checklist

Added: website/src/50.upstream-devs.en.page
===================================================================
--- website/src/50.upstream-devs.en.page	2006-02-05 20:30:43 UTC (rev 329)
+++ website/src/50.upstream-devs.en.page	2006-02-09 15:34:19 UTC (rev 330)
@@ -0,0 +1,118 @@
+---
+title: Upstream Developers
+inMenu: false
+---
+h1. Upstream developers, be nice to distributions (re)packagers !
+
+Dear developer,
+
+Your library/application is very good, and we would like to integrate it into our favorite distribution, so many more people would benefit easily from it. However, it would be great if you could make our work as easy as possible by following those guidelines.
+
+h2. Don't distribute only as a gem.
+
+"RubyGems":http://docs.rubygems.org/ is nice for people who aren't using another packaging system, but it makes it hard to package your application for our distribution. Please distribute your software as a *.tgz* (or *.tar.gz*) too.
+
+h2. Don't depend on RubyGems
+
+Make sure you are using <code>require</code>, not <code>require_gem</code>, to allow users to use your library without using rubygems.
+
+h2. Use setup.rb
+
+*TODO* explain differences between "setup.rb":http://i.loveruby.net/en/projects/setup/, extconf.rb, install.rb
+
+h2. Don't make your Rakefile depend on RubyGems
+
+If you provide a Rakefile, make sure it is usable without RubyGems installed. The following example is known to work :
+<code><pre>require 'rake/testtask'
+require 'rake/packagetask'
+require 'rake/rdoctask'
+require 'rake'
+require 'find'
+
+# Globals
+
+PKG_NAME = 'yourpackagename'
+PKG_VERSION = '0.1'
+
+PKG_FILES = ['ChangeLog', 'README', 'COPYING', 'LICENSE', 'setup.rb', 'Rakefile']
+Find.find('lib/', 'data/', 'test/', 'tools/') do |f|
+        if FileTest.directory?(f) and f =~ /\.svn/
+                Find.prune
+        else
+                PKG_FILES << f
+        end
+end
+
+# Tasks
+
+task :default => [:package]
+
+Rake::TestTask.new do |t|
+        t.libs << "test"
+        t.test_files = FileList['test/tc_*.rb']
+end
+
+Rake::RDocTask.new do |rd|
+  f = []
+  require 'find'
+  Find.find('lib/') do |file|
+    # Skip hidden files (.svn/ directories and Vim swapfiles)
+    if file.split(/\//).last =~ /^\./
+      Find.prune
+    else
+      f << file if not FileTest.directory?(file)
+    end
+  end
+  rd.rdoc_files.include(f)
+  rd.options << '--all'
+end
+
+
+Rake::PackageTask.new(PKG_NAME, PKG_VERSION) do |p|
+        p.need_tar = true
+        p.package_files = PKG_FILES
+end
+
+# "Gem" part of the Rakefile
+begin
+        require 'rake/gempackagetask'
+
+        spec = Gem::Specification.new do |s|
+                s.platform = Gem::Platform::RUBY
+                s.summary = "Your summary"
+                s.name = PKG_NAME
+                s.version = PKG_VERSION
+                s.requirements << 'none'
+                s.require_path = 'lib'
+                s.autorequire = 'yourpackagename'
+                s.files = PKG_FILES
+                s.description = "Your description"
+        end
+
+        Rake::GemPackageTask.new(spec) do |pkg|
+                pkg.need_zip = true
+                pkg.need_tar = true
+        end
+rescue LoadError
+end</pre></code>
+
+h2. Make your tests and examples usable outside of your directory tree
+
+*Don't* do things like <code>require '../lib/yourpackagename'</code>. Instead, use the following example :
+<code><pre>$:.unshift '../lib'
+
+require 'yourpackagename'</pre></code>
+This way, example and test scripts can be moved to other locations, but will still be able to use the global installation of your library. And since '../lib' is added at the beginning of the search patch, you will be able to use the version of your library you are working on during development.
+
+h2. Use a shebang that works everywhere
+
+The ruby interpreter can be installed in different places. Instead of using <code>#!/usr/bin/ruby</code> or <code>#!/usr/local/bin/ruby</code>, consider using <code>#!/usr/bin/env ruby</code>.
+
+h2. Provide man pages for your binaries
+
+Some distributions (e.g Debian) require all executables to have a man page. It would be great if you could provide it yourself.
+
+h2. References
+
+* "RPA-base: Good Pratices":http://rpa-base.rubyforge.org/wiki/wiki.cgi?GoodPractices
+* "RPA-base: Packaging Nitpick Checklist":http://rpa-base.rubyforge.org/wiki/wiki.cgi?PackagingNitpickChecklist




More information about the pkg-ruby-extras-maintainers mailing list