You are not logged in.

#1 2011-05-20 15:18:32

bnordgren
Member
Registered: 2009-11-21
Posts: 6

Package splitting question

This is my first attempt to split a package with makepkg, and my knowledge is limited to what can be exrapolated from the PKGBUILD-split.proto on my system. The topic of this split is the "ruby-enterprise-passenger" package in the AUR (which packages Phusion Passenger). The reason I want to split this package is to build passenger's apache module with makepkg and install it with pacman. Using "gem2arch" means I have to build the apache module on my install system, and I don't want base-devel on my webserver.

I got it to work (meaning build), but there's still some things I don't understand:

  • How would I make the split packages depend on one another? (e.g., ruby-enterprise-passenger-apache2 should depend on ruby-enterprise-passenger)

  • How would I specify individual install scripts?

Thanks for any advice you may have.

My current PKGBUILD:

# Generated by gem2arch
# Maintainer: LeeF

_gemname=passenger
pkgbase=ruby-enterprise-$_gemname
pkgname=($pkgbase $pkgbase-apache2)
pkgver=3.0.7
pkgrel=0
pkgdesc="Easy and robust Ruby web application deployment"
arch=('i686' 'x86_64')
url="http://www.modrails.com/"
license=('GPL2')
depends=('ruby-enterprise' 'ruby-enterprise-rake>=0.8.1' 'ruby-enterprise-fastthread>=1.0.1' 'ruby-enterprise-daemon-controller>=0.2.5' 'ruby-enterprise-file-tail' 'ruby-enterprise-rack')
makedepends=('ruby-enterprise' 'apache' 'openssl' 'curl')
source=(http://gems.rubyforge.org/gems/$_gemname-$pkgver.gem passenger.install)
noextract=($_gemname-$pkgver.gem)
md5sums=('3fb34e737c5fd3902024ddd84a6de2d8'
         'dc10c44e694feaaaf5bb975e6b5ce038')
install='passenger.install'

build() {
    cd $srcdir
    rm -rf tmp
    local _gemdir=`ruby -rubygems -e'puts Gem.default_dir'`
    gem install --ignore-dependencies --no-rdoc --no-ri  -i "tmp$_gemdir" $_gemname-$pkgver.gem
}


package_ruby-enterprise-passenger() {
    cp -ra $srcdir/tmp/opt $pkgdir
}

package_ruby-enterprise-passenger-apache2() {
    # Build mod_passenger
    cd $srcdir/tmp/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/$_gemname-$pkgver
    rake apache2

    # get everything that's a library and stick it in the package.
        gem_dir=opt/ruby-enterprise/lib/ruby/gems/1.8/gems/$_gemname-$pkgver
    find \( -name '*.so' -o \( -name '*.a' -o \( -name '*.la' \) \) \) \
             -exec install -D --mode=755 '{}' $pkgdir/$gem_dir/'{}' \;

    # move the "agents" directory
    agents_dir=$gem_dir/agents
    mv $srcdir/tmp/$agents_dir $pkgdir/$agents_dir

    # link mod_passenger to the apache modules directory
    apache_mod=$pkgdir/usr/lib/httpd/modules
    mkdir -p $apache_mod
    ln -s /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/$_gemname-$pkgver/ext/apache2/mod_passenger.so $apache_mod/mod_passenger.so
}

Offline

#2 2011-05-20 17:41:27

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,849

Re: Package splitting question

Dependencies per package can be used in a split package, check the official mesa package for an example how it works.

install scripts & split packages : sorry , no idea.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2011-05-21 14:01:15

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: Package splitting question

See the package splitting section in 'man PKGBUILD'

man PKGBUILD wrote:

PACKAGE SPLITTING
       makepkg supports building multiple packages from a single PKGBUILD. This is
       achieved by assigning an array of package names to the pkgname directive. Each
       split package uses a corresponding packaging function with name package_foo(),
       where foo is the name of the split package.

       All options and directives for the split packages default to the global values
       given within the PKGBUILD. However, some of these can be overridden within each
       split package’s packaging function. The following variables can be overridden:
       pkgver, pkgrel, pkgdesc, arch, license, groups, depends, optdepends, provides,
       conflicts, replaces, backup, options, install and changelog.

       An optional global directive is available when building a split package:

       pkgbase
           The name used to refer to the group of packages in the output of makepkg and
           in the naming of source-only tarballs. If not specified, the first element
           in the pkgname array is used. The variable is not allowed to begin with a
           hyphen.

Offline

#4 2011-05-25 13:57:21

bnordgren
Member
Registered: 2009-11-21
Posts: 6

Re: Package splitting question

Whoops. RTFM. Sorry about that. Thanks for pointing me in the right direction!

Bryce

Offline

Board footer

Powered by FluxBB