Subject: Re: pkgsrc option to install all mk-files
To: Jeremy C. Reed <reed@reedmedia.net>
From: Simon Gerraty <sjg@juniper.net>
List: tech-pkg
Date: 05/05/2004 16:49:43
On Wed, 5 May 2004 16:33:00 -0700 (PDT), "Jeremy C. Reed" writes:
>> Because you probably built the pkg on a BSD system.
>
>I built the package on a Linux system and copied it over to another Linux
>system. Everything is from pkgsrc.

Interesting...

>source available via pkgsrc using their own makefiles. My working Linux
>system has:
>
>lrwxrwxrwx  1 root root     6 Oct 13  2003 bsd.dep.mk -> dep.mk
>lrwxrwxrwx  1 root root     6 Oct 13  2003 bsd.doc.mk -> doc.mk
>lrwxrwxrwx  1 root root     7 Oct 13  2003 bsd.init.mk -> init.mk
>lrwxrwxrwx  1 root root     6 Oct 13  2003 bsd.lib.mk -> lib.mk
>lrwxrwxrwx  1 root root     6 Oct 13  2003 bsd.man.mk -> man.mk

Yep that's what I use for linux too.

>I am not sure why this is not suitable for a package. Will you explain?

Because if you install that package on NetBSD it will use the
bsd.prog.mk pointing at prog.mk etc rather than
/usr/share/mk/bsd.prog.mk and that's sub-optimal at best.

>Also, my working Linux system has:
>
>-rw-rw-r--  1 reed root  3477 Sep 30  2003 AIX.sys.mk
>-rw-r--r--  1 reed root  3605 Sep 30  2003 Darwin.sys.mk
>-rw-rw-r--  1 reed root  3990 Sep 30  2003 Generic.sys.mk
>-rw-rw-r--  1 reed root  4557 Sep 30  2003 HP-UX.sys.mk
>-rw-r--r--  1 reed root  3570 Sep 30  2003 IRIX.sys.mk
>-rw-rw-r--  1 reed root  3627 Oct 13  2003 Linux.sys.mk
>-rw-rw-r--  1 reed root  3934 Sep 30  2003 NetBSD.sys.mk
>-rw-rw-r--  1 reed root  3819 Sep 30  2003 OSF1.sys.mk
>-rw-r--r--  1 reed root  3680 Sep 30  2003 OpenBSD.sys.mk
>-rw-rw-r--  1 reed root  3478 Sep 30  2003 SunOS.4.sys.mk
>-rw-rw-r--  1 reed root  3768 Sep 30  2003 SunOS.5.sys.mk
>
>and
>
>lrwxrwxrwx  1 root root    12 Oct 13  2003 sys.mk -> Linux.sys.mk
>
>If some of these things should not be installed in your package, then I
>will make a variable like MK_FILES_INSTALL_ALL and if defined then really
>do install all and symlink for the sys.mk.

I think its ok to install all the *.sys.mk and if in doubt make sys.mk
a symlink to Generic.sys.mk (which would be useless without the others).
But be warned - I haven't used this in anger - its based on an idea I
got while discussing sharing mk-files cross platform.
I'm sure it needs work - patches welcome ;-)

>> Feel free - you'll probably make less of a mess than I would ;-)
>
>Any more suggestions before I bite into this?

Not much, you might want to consider installing everything, and have
Generic.sys.mk run install-mk or something similar if say bsd.prog.mk
is missing?   That way you can defer the issue of bsd.*.mk

--sjg