Difference between revisions of "Ruby Gem package guidelines"

From ArchWiki
Jump to: navigation, search
(Undo revision 187856 by Intgr (talk) leading spaces are used to format text in this Wiki)
(added links to related articles with Template:Package Guidelines)
Line 2: Line 2:
 
{{i18n|Ruby Gem Package Guidelines}}
 
{{i18n|Ruby Gem Package Guidelines}}
  
==Package Naming==
+
{{Article summary start}}
For libraries, use "ruby-gemname". For applications, use the program name. In either case, the pkgname should be entirely lowercase
+
{{Article summary text|Writing [[PKGBUILD]]s for sowtware written in [[Ruby]].}}
 +
{{Package Guidelines}}
 +
{{Article summary end}}
  
==Examples==
+
== Package Naming ==
For examples, please see [http://aur.archlinux.org/packages.php?ID=24484 github-gem] [http://aur.archlinux.org/packages.php?ID=24483 ruby-json_pure] [http://aur.archlinux.org/packages.php?ID=17121 ruby-hpricot]
+
For libraries, use {{Ic|ruby-gemname}}. For applications, use the program name. In either case, the name should be entirely lowercase
  
==Example PKGBUILD==
+
== Examples ==
  # Contributor: YourName <YourEmail AT example DOT com>
+
For examples, please see {{AUR|github-gem}} {{AUR|ruby-json_pure}} {{AUR|ruby-hpricot}}.
  pkgname=ruby-GEMNAME # All lowercase
+
  pkgver=GEMVERSION
+
  pkgrel=1
+
  pkgdesc="Ruby gem FooBar which implements BazQuux"
+
  arch=(any)
+
  url=""
+
  license=()
+
  depends=(ruby) # Gem may depend on other gems as well (you can get dependency information from the yaml specification)
+
  makedepends=(rubygems)
+
  source=(http://rubygems.org/downloads/GEMNAME-$pkgver.gem)
+
  noextract=(GEMNAME-$pkgver.gem)
+
  md5sums=()
+
 
+
  build() {
+
    cd $srcdir
+
    # _gemdir is defined inside build() because if ruby[gems] is not installed on the system
+
    #  makepkg will barf when sourcing the PKGBUILD
+
    local _gemdir="$(ruby -rubygems -e'puts Gem.default_dir')"
+
 
+
    gem install --no-user-install --ignore-dependencies --verbose -i "$pkgdir$_gemdir" -n "$pkgdir"/usr/bin GEMNAME-$pkgver.gem
+
  }
+
 
+
  # vim:set ts=2 sw=2 et:
+
  
==Automation==
+
== Notes ==
 +
Add {{Ic|--verbose}} to '''gem''' arguments to recive additional information in case of troubles.
 +
 
 +
{{Warning|Usage of {{Ic|--no-user-install}} '''gem''' argument is mandatory since latest Ruby versions (See {{Bug|28681}} for details).}}
 +
 
 +
== Example PKGBUILD ==
 +
An example PKGBUILD can be found at {{Ic|/usr/share/pacman/PKGBUILD-perl.proto}}, which is in the {{Pkg|abs}} package.
 +
 
 +
== Automation ==
 
Abhishek Dasgupta wrote [http://github.com/abhidg/gem2arch/ gem2arch] to aid in automating the process of creating a ruby gem PKGBUILD. Make sure to manually check the PKGBUILD after generation. There are multiple versions of this tool in AUR ([https://aur.archlinux.org/packages.php?K=gem2arch Search for gem2arch]).
 
Abhishek Dasgupta wrote [http://github.com/abhidg/gem2arch/ gem2arch] to aid in automating the process of creating a ruby gem PKGBUILD. Make sure to manually check the PKGBUILD after generation. There are multiple versions of this tool in AUR ([https://aur.archlinux.org/packages.php?K=gem2arch Search for gem2arch]).
  
The gem installation can also be automated completely with the tool [https://aur.archlinux.org/packages.php?ID=46196 pacgem] which creates a temporary PKGBUILD, calls makepkg and namcap. The resulting package is then installed with sudo pacman.
+
The gem installation can also be automated completely with the tool {{AUR|pacgem}} which creates a temporary PKGBUILD, calls [[makepkg]] and [[namcap]]. The resulting package is then installed with {{Ic|sudo pacman}}.

Revision as of 06:47, 6 March 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Writing PKGBUILDs for sowtware written in Ruby.

Template:Package Guidelines

Package Naming

For libraries, use ruby-gemname. For applications, use the program name. In either case, the name should be entirely lowercase

Examples

For examples, please see github-gemAUR ruby-json_pureAUR ruby-hpricotAUR.

Notes

Add --verbose to gem arguments to recive additional information in case of troubles.

Warning: Usage of --no-user-install gem argument is mandatory since latest Ruby versions (See FS#28681 for details).

Example PKGBUILD

An example PKGBUILD can be found at /usr/share/pacman/PKGBUILD-perl.proto, which is in the abs package.

Automation

Abhishek Dasgupta wrote gem2arch to aid in automating the process of creating a ruby gem PKGBUILD. Make sure to manually check the PKGBUILD after generation. There are multiple versions of this tool in AUR (Search for gem2arch).

The gem installation can also be automated completely with the tool pacgemAUR which creates a temporary PKGBUILD, calls makepkg and namcap. The resulting package is then installed with sudo pacman.