[prev in list] [next in list] [prev in thread] [next in thread] 

List:       crux
Subject:    Re: Keeping changes to Pkgfiles
From:       Per_Lidén <per () fukt ! bth ! se>
Date:       2002-05-15 21:09:18
[Download RAW message or body]

On Wed, 15 May 2002, Markus Ackermann wrote:

> On Thu 09.05.2002, 13:06:41 +0200, Johannes Winkelmann said in public:
> >I'm not sure if there is a easy solution to keep personal changes to
> >official Pkgfiles, but meanwhile, I wrote a patch agains pkgmk. It just
> >looks for a file called Pkgfile.diff in the port's directory, and feeds
> >it to patch(1).
>
> That's monster cool, I've been missing that functionality quite a while. I
> hope Per will add your patch or a similar mechanism to pkgmk.

I like this idea as well. There were some minor issues with the current
patch though. We had short discussion on #crux about the patch, possible
modifications to it and alternative appraoches to the whole thing.

The approach I personally like best (so far) is to simply make it possible
to have two Pkgfiles: the original Pkgfile and another called
Pkgfile.personal or something. pkgmk would source Pkgfile as usual and
then source the Pkgfile.personal as well. The Pkgfile.personal only contains
the variables and/or function you want to override.

Example:

Pkgfile:
----------------------------------------------------------------
name=myprog
version=1.0
release=1
source=(http://www.internet.com/$name-$version.tar.gz)

build() {
    cd $name-$version
    make
    make install
}
----------------------------------------------------------------

Pkgfile.personal:
----------------------------------------------------------------
source=(http://www.faster-server.com/$name-$version.tar.gz)

build() {
    cd $name-$version
    make
    make doc
    make install
    make install-doc
}
----------------------------------------------------------------

The above example replaces the source URL with, let's say, a server closer
to me and also modifies the build() function to install the documents that
comes with the package.

The nice thing is that if ports -u updates the original Pkgfile (e.g. the
version variable changes) I don't need to modify my Pkgfile.personal to
benefit from that change.

Comments?

best regards,
Per

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic