You are not logged in.

#1 2010-02-08 19:00:11

lonesamurai
Member
Registered: 2010-02-08
Posts: 1

Need Help Compiling A Package From Source

***I would like to state first that I am new to Arch Linux; I have used other Linux Distros in the past. I became interested in Arch Linux by reading numerous articles. I have been using it less than a week now and I love it.***

I am trying to learn how to compile packages from sources and I have run into a problem that I have been unable to solve. The package that I used as a test is Alexandria(http://alexandria.rubyforge.org/). I have read numerous articles and posts to accomplish this tasks. This is what I done so far:

1. I downloaded the source(http://rubyforge.org/frs/download.php/68098/alexandria-0.6.6-beta1.tar.gz) to ~/src
2. # pacman -Sy abs base-devel
3. # abs
4. $ mkdir ~/abs
5. $ mkdir ~/abs/alexandria/
6. $ cd ~/abs/alexandria/
7. $ sudo cp /usr/share/pacman/PKGBUILD.proto
8. #gedit PKGBUILD.proto (I will post my edit code)
    #Maintainer: RubyForge <http://rubyforge.org/projects/support/>

srcdir=~/src/builds
pkgname=alexandria
pkgver=0.6.6_beta1
pkgrel=1
pkgdesc="Alexandria is a GNOME application to help you manage your book collection"
arch=('i686' 'x86_64')
url=""
license=('GPL')
groups=()
depends=()
makedepends=()
provides=()
conflicts=()
replaces=()
backup=()
install=
source=(http://rubyforge.org/frs/download.php/68098/$pkgname-$pkgver.tar.gz)
noextract=()
md5sums=('d41d8cd98f00b204e9800998ecf8427e') #generate with 'makepkg -g'

build() {
  cd "$srcdir/$pkgname-$pkgver"

make || return 1
}

9. $makepkg

==> Making package: alexandria 0.6.6_beta1-1 i686 (Mon Feb  8 12:49:49 CST 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Found alexandria-0.6.6_beta1.tar.gz in build dir
==> Validating source files with md5sums...
    alexandria-0.6.6_beta1.tar.gz ... Passed
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Entering fakeroot environment...
==> Starting build()...
~/abs/alexandria/PKGBUILD: line 25: cd: ~/builds/alexandria-0.6.6_beta1: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
==> ERROR: Build Failed.
    Aborting...


All instruction is greatly appreciated! Thanks.

Offline

#2 2010-02-08 19:19:38

evr
Arch Linux f@h Team Member
Registered: 2009-01-23
Posts: 554

Re: Need Help Compiling A Package From Source

First off, welcome to arch!

I'm not sure if you're aware or not, but the Alexandria package is already in the AUR, and if you don't know what the AUR is, i would suggest you read up on it. It is a very valuable resource.

But seeing as you are trying to learn how to setup the PKGBUILD for yourself (which is commendable), I would suggest that you compare your version to the one in the AUR and see how they differ.

More specifically to the point, just quickly looking over your package, I believe your package is failing to build because you are attempting to use the 'make' command, while the program you are building is a ruby program which uses the 'rake' command to build.

Offline

#3 2010-02-08 19:20:01

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: Need Help Compiling A Package From Source

Seems that the ~ isn't expanding.. Try $HOME

Offline

#4 2010-02-08 20:12:58

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Need Help Compiling A Package From Source

pkgname=alexandria
pkgver=0.6.6_beta1
_rpkgver=0.6.6-beta1
pkgrel=1
pkgdesc="Alexandria is a GNOME application to help you manage your book collection"
arch=('i686' 'x86_64')
url="http://rubyforge.org"
license=('GPL')
makedepends=('ruby-gnome2' 'ruby-gtk2' 'ruby-libglade' 'ruby-gconf2' 'ruby-pango')
depends=('ruby')
provides=('alexandria')
source=(http://files.rubyforge.vm.bytemark.co.uk/${pkgname}/${pkgname}-${_rpkgver}.tar.gz)
md5sums=('df5a51687f798328d61eb521187dca9a')

build() {
  cd "$srcdir/$pkgname-$_rpkgver"
  rake install PREFIX=${pkgdir}/usr DESTDIR=${pkgdir} RUBYLIBDIR=${pkgdir}/usr/lib/ruby/site_ruby/1.9.1/
  }

I haven't totally tested this because I don't have gnome installed but this should provide a starting place. I'm not too familiar with the rake command so if you want more information on how to install/use it then download the tarbell from rubyforge (either by this PKGBUILD or manually), extract it and read the INSTALL file. I think the problem before was with your download link and also that it doesn't use "make" or "make install"

edit: Ah, for some reason I never check the AUR, I always try making them myself. So, to the OP; just check the AUR. alexandria is already maintained so you can use their PKGBUILD.

Last edited by milomouse (2010-02-08 22:32:44)

Offline

#5 2010-02-08 20:13:26

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Need Help Compiling A Package From Source

Before writing the build () function in PKGBUILD I would run it directly inside the sources.
makepkg just executes a sequence of commands, and - esp. if you're trying to learn - it's a good idea to execute these commands directly the first time. It gives you a much better idea of what is going on.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

Board footer

Powered by FluxBB