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

List:       crux
Subject:    Pkgfile.local sucks(?)
From:       Per_Lidén <per () fukt ! bth ! se>
Date:       2002-06-10 21:21:49
[Download RAW message or body]

Hi all,

I'm having second thoughts about the Pkgfile.local-feature added in
pkgutils 4.2, and I'm about to remove it. The reason is that I don't think
the Pkgfile.local-feature doesn't work very well in some (common?)
situations. For example, overriding the source variable in your
Pkgfile.local will cause an md5sum mismatch, and certain changes to the
build function can result in a footprint mismatch. Sure, you can ignore
that to some extent (using pkgmk -im, etc), but that's soft of a temporary
workaround.

I'd like to propose another approach for people that want to tweak ports
wihout loosing their changes with the next execution of "ports -u".

Keep your ports in some directory, say ~/ports/.
Add a Pkgfile which sources the original Pkgfile, and then overrides
whatever variables/functions you want (just like Pkgfile.local).
If you want to use the original .md5sum/.footprint files just make
symlinkt to the original, else create new once which matches your changes.
That's about it.

Example of a tweaked version of base/wget:

$ ls -la ~/ports/wget
-rw-r--r-- 1 root root 199 Jun 10 23:08 .footprint
lrwxrwxrwx 1 root root  28 Jun 10 23:07 .md5sum -> /usr/ports/base/wget/.md5sum
-rw-r--r-- 1 root root  31 Jun  9 23:42 Pkgfile

$ cat ~/ports/wget/Pkgfile

. /usr/ports/base/wget/Pkgfile

build() {
    cd $name-$version
    ./configure --prefix=/usr --sysconfdir=/etc --disable-nls
    make
    make prefix=$PKG/usr install
    ...
    <my changes>
    ...
}

As you can see, I "reuse" the .md5sum file, but use a new .footprint.

This not only makes it possible to build your tweaked version of the
ports without getting md5sum/footprint mismatches, it also solves the
"backup problem" (discussed in a previous thread) since all your
modifications can reside in a separate directory structure.

Another nice side effect is that this approach doesn't require any
modifications of pkgmk at all.

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