[pacman-dev] How to run the install scripts

Dan McGee dpmcgee at gmail.com
Tue Jul 10 10:35:56 EDT 2007


On 7/10/07, Siem Korteweg <Siem.Korteweg at qnh.nl> wrote:
> -----Oorspronkelijk bericht-----
> Van: pacman-dev-bounces at archlinux.org namens Xavier
> Verzonden: ma 9-7-2007 22:10
> Aan: Discussion list for pacman development
> Onderwerp: Re: [pacman-dev] How to run the install scripts
>
> On Mon, Jul 09, 2007 at 09:49:56PM +0200, Siem Korteweg wrote:
> > Hi,
> >
> > hope this is the proper mailing-list to post this.
> >
> > I am new to ArchLinux and developing a package. I am having trouble to get
> > the install scripts running, I tested the following (minimal) package:
> >
> > file x.install:
> > echo "$0 with arguments: $*" >>/tmp/log
> > # to be extended for pre- and post-install actions
> > exit 0
> >
> > file src/x
> > #!/bin/sh
> > echo "$0"
> > exit 0
> >
> > file x.build:
> > pkgname=x
> > pkgver=1.1.1
> > pkgrel=1
> > pkgdesc=('get the install scripts running')
> > arch=('i686')
> > install=x.install
> > license=('GPL')
> > build(){
> >    mkdir -p ../pkg/opt/x/bin
> >    cp -x ../pkg/opt/x/bin
> >    chmod 700 ../pkg/opt/x/bin/x
> > }
> >
> > building the package with the command: makepkg -p x.build
> > The build succeeds and the resulting x-1.1.1-1.i686.pkg.tar.gz file
> contains
> > all the right files and the .INSTALL file contains the code of the
> x.install
> > file.
> >
> > Installing the package with: pacman -U x-1.1.1-1.i686.pkg.tar.gz succeeds
> > also. The file /opt/x/bin/x is created. However, the file /tmp/log does not
> > exist, while I expected it to contain several lines for at least
> pre-install
> > and post-install. I did not change any of the pacman configuration files
> (on
> > my base-install).
> >
> > Why does the install script not run?
> >
> > Thanks in advance for any clue.
> >
> > Siem Korteweg
>
> Read The Fine Manual :
> man PKGBUILD
> section INSTALL/UPGRADE/REMOVE SCRIPTING
> it also tells you how to get a template, which could probably be helpful :)
>
>
> I did read the Fine Manual (and the fine wiki). Do you think that I came up
> with this code and build file without reading any doc? :)
>
> The manual page on the system (the manual page on the website is missing some
> lines) tells me:
>
> - create an install script with the name package.install
> - put it in the same directory as the build file
> - add the install directive to the build-file
>
> I did all these things and the package builds correctly without any
> error-messages and the install code is part of the package in the file
> .INSTALL. Upon installing, again no errors, but the install script does not
> run.
>
> Looking again at the fine manual, which tells me to obtain a prototype from
> /var/abs. This directory is empty on my system. So, I tried the program abs
> to obtain the prototype. This program tells me it is missing the CVS
> synchronization utility. So I looked elsewhere for a prototype and found
> this:
>
> http://wiki.archlinux.org/index.php/Arch_Packaging_Standards
>
> The prototype on this page is not different from what I am using. What other
> resources are available for me to consult?

There is no install file prototype there. For that, abs is your best bet.

pacman -S csup
sudo abs (or set up a .abs.conf in your user directory and run it as a user)

At this point you will have both a PKGBUILD.proto and an install.proto.

If you don't want to do the ABS thing (which you are missing the point
of Arch Linux if you don't), then you can find these prototypes here
as well:
http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/?cvsroot=Current#dirlist

-Dan




More information about the pacman-dev mailing list