You are not logged in.

#1 2007-11-14 12:50:44

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

post_install and PKGBUILDS[solved]

OK as a maintainer of a package I have a soft dependency of gpac.

Now its been requested that I use
post_install() {}

My question is how? Would I just add it after my build section

build() {
  cd $startdir/src/$pkgname-$pkgver
  sed -i -e "s|/usr|$startdir/pkg/usr|g" \
        -e 's|usr/local/|usr/|g' install
  ./install
post_install() {
Please install gpac for mp4 or mkv conversion
}

Is this is not correct could some please tell me how to achieve the above so after install it mentions that gpac maybe needed for conversion.

Last edited by FeatherMonkey (2007-11-15 14:21:29)

Offline

#2 2007-11-14 13:05:42

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: post_install and PKGBUILDS[solved]

You need a separate install file. Take a look at a package which has one to guide you. e.g. Totem
http://cvs.archlinux.org/cgi-bin/viewcv … ag=CURRENT

Offline

#3 2007-11-14 14:08:34

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: post_install and PKGBUILDS[solved]

acccccccccccctually, I think they recently merged functionality to allow this stuff in the same file.   I don't know if it's in a pacman release yet though.

for now, a separate file is probably your best bet

Offline

#4 2007-11-14 16:03:59

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: post_install and PKGBUILDS[solved]

Thanks Guys

So my understanding is all I need in my PKGBUILD

install=('my.install')

Then in the my.install

post_install() {
 cat << EOF
 ==> Install mkvmerge for Matroska support
==> Install gpac for mp4 support
EOF
 }

 post_upgrade() {
 post_install $1
 }
 
 op=$1
 shift
 
 $op $*

Is this correct?

Offline

#5 2007-11-14 16:26:30

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: post_install and PKGBUILDS[solved]

FeatherMonkey wrote:

Thanks Guys

So my understanding is all I need in my PKGBUILD
install=('my.install')

It's not an array, so simply:

install=my.install

would work.  Most often we name it $pkgname.install for clarity, but you can name it whatever you want.

Then in the my.install

post_install() {
    cat << EOF
==> Install mkvmerge for Matroska support
==> Install gpac for mp4 support
EOF
}

post_upgrade() {
    post_install $1
}
 
op=$1
shift
$op $*

Is this correct?

on initial scan, that looks pretty good. 

On a related note - pacman will natively support optional dependencies sometime in the next couple of releases, AFAIK, so this kind of post-install work-around won't be needed anymore at that time.  Yay!

Offline

#6 2007-11-14 17:31:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: post_install and PKGBUILDS[solved]

Cerebral wrote:

acccccccccccctually, I think they recently merged functionality to allow this stuff in the same file.   I don't know if it's in a pacman release yet though.

Shhh! I don't know how tested it is 8)

Offline

#7 2007-11-14 17:32:37

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: post_install and PKGBUILDS[solved]

Thanks again Cerebral worked perfectly smile

Offline

#8 2007-11-15 13:56:07

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: post_install and PKGBUILDS[solved]

I got a couple of other things firstly in regards to pkgrel I've always presumed that as the version goes up. I've always assumed that I should only increase if I repackage a said version.

Yet I had a comment to the affect asking if I could increase it by one now I felt this is wrong, so what would be the correct way?

The other thing is there something blatantly wrong with the this PKGBUILD or is just a question of TU hasn't got around to it yet?

pkgname=h264enc
pkgver=7.9.5
pkgrel=5
pkgdesc="Advanced shell script for encoding DVDs or video files to the H.264 format using the encoding utility MEncoder from MPlayer."
arch=(i686)
url="http://sourceforge.net/projects/h264enc/"
license=('GPL')
replaces=('')
depends=('mplayer>=1.0rc2' 'x264' 'lsdvd' 'lame' 'bc')
install=$pkgname.install
source=(http://downloads.sourceforge.net/sourceforge/h264enc/$pkgname-$pkgver.tar.gz)
md5sums=('e5b68fc9f296cf8714859a204f041feb')

build() {
  cd $startdir/src/$pkgname-$pkgver
  sed -i -e "s|/usr|$startdir/pkg/usr|g" \
        -e 's|usr/local/|usr/|g' install
  ./install
}

Offline

#9 2007-11-15 14:05:36

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: post_install and PKGBUILDS[solved]

You are right with the pkgrel - I don't understand the comment in AUR asking for it to be raised with a version increase.  It should go back to 1.

Your PKGBUILD looks fine.  Remove the "replaces" line as it is empty and thus not needed.  TUs are busy so don't get time to mark all packages as safe.  I have never had any of mine marked as safe and one went straight to community so must have been OK...

Offline

#10 2007-11-15 14:20:55

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: post_install and PKGBUILDS[solved]

Thankyou Allan

Nearly did renumber today it but tend to try to keep the downloaders happy wink

I actually disagreed with the post_install bit as when the scripts is run it actually prompts if its missing the libs but I'm very much as requested person. So now they get told before they run it as well as when they run it.

Now to put solved into the title.

Offline

Board footer

Powered by FluxBB