Subject: Re: base install path of pkgsrc
To: NetBSD User's Discussion List <netbsd-users@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 01/07/2002 15:12:06
[ On Monday, January 7, 2002 at 15:49:01 (+0000), Chris Pinnock wrote: ]
> Subject: Re: base install path of pkgsrc
>
> On Mon, Jan 07, 2002 at 11:48:20PM +0800, Lim Seng Chor wrote:
> > 
> > How to change the install path from "/usr/pkg" to "/usr" if I am going to install the 
> > package from the /usr/pkgsrc.
> 
> I would advise against doing this. You will probably break something in
> the NetBSD base install if you do. 

It works just fine with almost everything I've installed (only a couple
of hundred packages, but what I assume are quite common ones).

Of the few things that conflict with base files, most are things I've
explicitly wanted to overwrite anyway (eg. BIND).  The only thing that
conflicted and which caused some confusion was SSH.  I've been working
on an SSH-2 (now SSH-3 I guess) package that should overlay on top of
all the remnants of the base OpenSSH stuff, but it's not yet ready.

Just set "LOCALBASE=/usr" in /etc/mk.conf and then create the following
symlinks:

        cd /usr && rm -f etc && ln -s ../etc etc
        cd /usr && rm -f info && ln -s share/info info
        cd /usr && rm -f man && ln -s share/man man
        cd /usr && rm -f var && ln -s ../var var
        cd /usr/X11R6 && rm -f etc && ln -s ../../etc etc
        cd /usr/X11R6 && rm -f info && ln -s share/info info
        cd /usr/X11R6 && rm -f man && ln -s share/man man

Note that you do not likely want to set USE_LOCALBASE_FOR_X11, since
that would result in X11 stuff going into /usr/bin.

You will probably also want to get rid of (or fix) the man directories
in mk/NetBSD.pkg.dist, though this may not be 100% necessary.  Diff
attached.

(Caveat:  I've not tested this with a separate / and /usr partition.)

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>

Index: mk/NetBSD.pkg.dist
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mk/NetBSD.pkg.dist,v
retrieving revision 1.19
diff -c -r1.19 NetBSD.pkg.dist
*** mk/NetBSD.pkg.dist	25 Dec 2001 14:42:58 -0000	1.19
--- mk/NetBSD.pkg.dist	5 Jan 2002 04:15:21 -0000
***************
*** 8,123 ****
      ..
      emul
      ..
      etc
!         rc.d
  	..
      ..
      include
      ..
!     info
!     ..
      lib
      ..
      libdata
! 	    tcl
! 	    ..
      ..
      libexec
!         cgi-bin
!         ..
!     ..
!     man
!         cat1           
!         ..
!         cat2            
!         ..
!         cat3            
!         ..
!         cat4            
!         ..
!         cat5            
!         ..
!         cat6            
!         ..
!         cat7            
!         ..
!         cat8            
!         ..
!         cat9            
!         ..
!         catl            
!         ..
!         catn            
!         ..
!         ja_JP.EUC
!             cat1            
!             ..
!             cat2            
!             ..
!             cat3            
!             ..
!             cat4            
!             ..
!             cat5            
!             ..
!             cat6            
!             ..
!             cat7            
!             ..
!             cat8            
!             ..
!             cat9            
!             ..
!             catl            
!             ..
!             catn            
!             ..
!             man1
!             ..
!             man2
!             ..
!             man3
!             ..
!             man4
!             ..
!             man5
!             ..
!             man6
!             ..
!             man7
!             ..
!             man8
!             ..
!             man9
!             ..
!             manl
!             ..
!             mann
!             ..
!         ..
!         man1
!         ..
!         man2
!         ..
!         man3
!         ..
!         man4
!         ..
!         man5
!         ..
!         man6
!         ..
!         man7
!         ..
!         man8
!         ..
!         man9
!         ..
!         manl
!         ..
!         mann
!         ..
      ..
      sbin
      ..
      share
--- 8,36 ----
      ..
      emul
      ..
+     # XXX WARNING: etc will probably be a symlink if PREFIX=/usr
      etc
! 	mtree
! 	..
! 	rc.d
  	..
      ..
      include
      ..
!     # NOTE: mtree won't create symlinks....
!     info		type=link link=share/info
      lib
      ..
      libdata
! 	tcl
! 	..
      ..
      libexec
! 	cgi-bin
! 	..
      ..
+     # NOTE: mtree won't create symlinks....
+     man			type=link link=share/man
      sbin
      ..
      share
***************
*** 133,138 ****
--- 46,53 ----
          ..
  	games
          ..
+ 	info
+ 	..
  	locale
              az
                  LC_MESSAGES
***************
*** 351,356 ****
--- 266,363 ----
                  ..
              ..
          ..
+         man
+             cat1           
+             ..
+             cat2            
+             ..
+             cat3            
+             ..
+             cat4            
+             ..
+             cat5            
+             ..
+             cat6            
+             ..
+             cat7            
+             ..
+             cat8            
+             ..
+             cat9            
+             ..
+             catl            
+             ..
+             catn            
+             ..
+             ja_JP.EUC
+                 cat1            
+                 ..
+                 cat2            
+                 ..
+                 cat3            
+                 ..
+                 cat4            
+                 ..
+                 cat5            
+                 ..
+                 cat6            
+                 ..
+                 cat7            
+                 ..
+                 cat8            
+                 ..
+                 cat9            
+                 ..
+                 catl            
+                 ..
+                 catn            
+                 ..
+                 man1
+                 ..
+                 man2
+                 ..
+                 man3
+                 ..
+                 man4
+                 ..
+                 man5
+                 ..
+                 man6
+                 ..
+                 man7
+                 ..
+                 man8
+                 ..
+                 man9
+                 ..
+                 manl
+                 ..
+                 mann
+                 ..
+             ..
+             man1
+             ..
+             man2
+             ..
+             man3
+             ..
+             man4
+             ..
+             man5
+             ..
+             man6
+             ..
+             man7
+             ..
+             man8
+             ..
+             man9
+             ..
+             manl
+             ..
+             mann
+             ..
+         ..
          misc
          ..
          mk
***************
*** 426,429 ****
--- 433,438 ----
          skel
          ..
      ..
+     # NOTE: mtree won't create symlinks....
+     var			type=link link=/var
  ..