You are not logged in.

#1 2004-11-25 08:31:55

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

[solved] How to create a package that doesn't use "make

After recently deleting my /usr folder  by mistake I am back in archlinux again and I thought it was about time that I built some ruby packages... however ruby packages tend to use their own installation script and there is no way of passing the installation directory to the script because it searches for the existing ruby location. When I try to run makepkg the installation script tries to install the package directly to the root of the file system.

What should I do? Would I be cheating if I just saw which files were copied and I did it by hand in the build() section?

Offline

#2 2004-11-25 09:48:12

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: [solved] How to create a package that doesn't use "make

ruby packages?
you mean packages of ruby programs, like ruby gems?
for a sec there I thought you meant ruby "the package"..and I was thinking....what?

heh.. roll

hmm..maybe arch could have a package for the ruby gems installer (supposed to be like cpan, but hopefully better)...

ps..I love ruby!


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2004-11-25 11:15:59

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: [solved] How to create a package that doesn't use "make

Actually rubygems is the package that I am trying to build!

Offline

#4 2004-11-25 14:59:56

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: [solved] How to create a package that doesn't use "make

:shock:


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2004-11-28 17:34:26

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: [solved] How to create a package that doesn't use "make

I assume then that there is no official stance on how to deal with these situations? I will "fudge" a package then and see how it goes...

Offline

#6 2004-11-29 03:10:46

luisfelipe
Member
Registered: 2004-05-06
Posts: 96

Re: [solved] How to create a package that doesn't use "make

I'm also very interested in having the ruby gems package available. Did you have any luck with it ??
Also, have you been able to generate the rdoc documentation for ruby using the standard package that is available in arch ? If so, how did you do it ? Here it just keeps a really looong time
generating it and then there are some weird errors, I'll try it again later to see if I can paste them here.

Offline

#7 2004-11-29 04:38:16

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: [solved] How to create a package that doesn't use "make

Normally you would either a) do everything the install script does inside the build() function or b) patch the install script.

Method a is annoying and error prone.  Method b is the preferred method.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#8 2004-11-29 10:07:10

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: [solved] How to create a package that doesn't use "make

I have *almost* built a package, but there are still some problems when I run makepkg. I have patched the installation script so that it puts the installation files in a place where makepkg can use them, but then at the end of the installation script it tries to install a 'gem' and fails because the rubygem library hasn't been installed yet.

I would like to call a custom ruby script after the package has been installed (perhaps in a post_install method) but where do I place these files that I need? I mean, I cannot put them directly in the pkg directory can I?

Offline

#9 2004-11-29 21:00:58

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [solved] How to create a package that doesn't use "make

kumo wrote:

I would like to call a custom ruby script after the package has been installed (perhaps in a post_install method) but where do I place these files that I need? I mean, I cannot put them directly in the pkg directory can I?

Place your script (and the files it needs) in the same directory than your PKGBUILD file.  In your PKGBUILD, use the install field:

install= ruby.install

where ruby.install is the name of the script.

Offline

#10 2004-11-29 21:57:25

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: [solved] How to create a package that doesn't use "make

Snowman wrote:

Place your script (and the files it needs) in the same directory than your PKGBUILD file.  In your PKGBUILD, use the install field:

install= ruby.install

where ruby.install is the name of the script.

I tried but the script is being ignored...

The PKGBUILD is

pkgname=rubygems
pkgver=0.8.1
pkgrel=1
pkgdesc="A package management framework for the Ruby programming language"
url="http://rubygems.rubyforge.org/wiki/wiki.pl?RubyGems"
depends=('ruby')
makedepends=()
source=(http://rubyforge.org/frs/download.php/1399/rubygems-$pkgver.tgz rubygems.patch)
md5sums=('6276d268b420c0d61796cdbf6d28dae4')
install=install_gem.rb

build() {
  cd $startdir/src/rubygems-$pkgver
  patch -p1 -i ../rubygems.patch
  ruby install.rb
}

The install_gem.rb is

#!/usr/bin/ruby
# Install the 'sources' package bundled with RubyGems.

Dir.chdir("packages/sources")
  load("sources.gemspec")
  spec = Gem.sources_spec
  Gem::manage_gems
  gem_file = Gem::Builder.new(spec).build
  Gem::Installer.new(gem_file).install(true, Gem.dir, false)
Dir.chdir("../..")

What am I doing wrong?

Offline

#11 2004-11-29 22:07:39

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [solved] How to create a package that doesn't use "make

The install field expects a structured script.  See the makepkg man pages for an example. There might be a prototype in /var/abs.   In that script, there is a post_install function where you can call your install_gem.rb script

Offline

#12 2004-11-29 23:35:50

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: [solved] How to create a package that doesn't use "make

if you install abs, there is a install.proto in the /var/abs directory.

# This is a default template for a post-install scriptlet.  You can
# remove any functions you don't need (and this header).
 
# arg 1:  the new package version
pre_install() {
  /bin/true
}
 
# arg 1:  the new package version
post_install() {
  /bin/true
}
 
# arg 1:  the new package version
# arg 2:  the old package version
pre_upgrade() {
  /bin/true
}
 
# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  /bin/true
}
 
# arg 1:  the old package version
pre_remove() {
  /bin/true
}
 
# arg 1:  the old package version
post_remove() {
  /bin/true
}
 
op=$1
shift
$op $*

You can remove the target functions that you will not be using. Something like this should probably work.

# arg 1:  the new package version
post_install() {
  /usr/bin/env ruby -w install_gem.rb 
}
 
op=$1
shift
$op $*

"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#13 2004-12-02 09:51:02

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: [solved] How to create a package that doesn't use "make

(Sorry about this, but it is my first package that I am building!)

I have created the install file and one of the functions is called, but the file doesn't exist. Now I know that I could add the ruby script to the source field of the PKGBUILD file but the problem is that there is more than one file:

# tree
.
|-- PKGBUILD
|-- install_gem.rb
|-- packages
|   `-- sources
|       |-- lib
|       |   `-- sources.rb
|       |-- sources-0.0.1.gem
|       `-- sources.gemspec
|-- rubygems.install
`-- rubygems.patch

The install_gem.rb script should install the ruby gem that is inside the packages tree so is there anyway of forcing this tree to exist inside the package? I tried editing the filelist file but that did nothing.

So should I gzip that folder and also provide it with the package? It seems a bit messy though...

Offline

#14 2004-12-10 11:28:40

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: [solved] How to create a package that doesn't use "make

Okay, I have just chatted to jdrago on IRC and I have decided to copy the necessary files to the tmp directory, so I am closing this topic and opening a new one with the pkgbuild.

Offline

Board footer

Powered by FluxBB