Diff for /wikisrc/pkgsrc/how_to_use_pkgsrc.mdwn between versions 1.1 and 1.4

version 1.1, 2011/11/20 20:28:27 version 1.4, 2015/01/30 07:53:02
Line 4 Line 4
   
 #What is pkgsrc  #What is pkgsrc
   
 Pkgsrc [spoken: package source] is the main package management framework for NetBSD. With pkgsrc you can easily add, remove and manage software on your system. Pkgsrc is basically a set of files, grouped by categories which contain information to install the software you have selected. All this files together are mostly referred as the pkgsrc tree. This tree is maintained by the pkgsrc developers, that make changes to it every day. Therefore it is necessary to update the pkgsrc tree regularly.  Pkgsrc [spoken: package source] is the main package management framework for NetBSD. With pkgsrc you can easily add, remove and manage software on your system. Pkgsrc is basically a set of files, grouped by categories which contain information to install the software you have selected. All these files together are mostly referred to as the pkgsrc tree. This tree is maintained by the pkgsrc developers, who make changes to it every day. Therefore it is necessary to update the pkgsrc tree regularly.
   
 #Requirements  #Documentation
   
 The pkgsrc source tree, which contains all the files, will need a minimum of 200 MB disk space.  It is strongly advised to rely on information in [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/)
   This wiki is semi-official and is frequently outdated.
   Sometimes even misleading.
   
 #Preparing pkgsrc  #Preparing pkgsrc
   
 ##Creating the pkgsrc directory  
   
 This is a matter of taste, but most people create the directory in /usr/pkgsrc/  
   
     # mkdir /usr/pkgsrc  
   
 Change owner of pkgsrc to a user, so you can update later it with user rights.  
   
     # chown john pkgsrc  
   
 ##Obtaining the current pkgsrc source tree  ##Obtaining the current pkgsrc source tree
   
 There are many ways to get the pkgsrc tree. For example via ftp, cvs, sup or cvsup. My recommended way is to use csup, a leightweight cvsup protocol client written in C. But, before we can use csup we have to install it first, which in turn needs pkgsrc aswell. Therefore we will use for csup a precompiled binary package, instead of doing the work twice.  See [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/getting.html)
   
     # ftp ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All/csup-20070216.tgz  
   
 and then installing it with  
   
     # pkg_add csup-20070216.tgz  
   
 csup needs one configuration file, the supfile, which contains the information to sync what from which server to where. Please create a file called pkgsrc-supfile in your home directory which contains:  
   
     *default tag=.  
     *default release=cvs  
     *default delete use-rel-suffix  
     *default umask=002  
     *default host=cvsup.se.netbsd.org  
     *default base=/home/john  
     *default prefix=/usr  
   
     netbsd-pkgsrc  
   
 **base** points to your home directory and **prefix** to the directory, where the repo goes.  
   
 To get and to keep your pkgsrc tree in sync, just run:  
   
     $ csup pkgsrc-supfile  
   
 To update regularly, say once a day, use [[cron]].  
   
 ##Creating WRKOBJDIR  ##Creating WRKOBJDIR
   
 To keep the tree clean and your work directories out of it, define WRKOBJDIR in /etc/mk.conf and add:  To keep the tree clean and your work directories out of it,
   create a directory, e.g.
   
     WRKOBJDIR=/usr/work      # mkdir /usr/work
   
 and then create that directory.  and define WRKOBJDIR in /etc/mk.conf:
   
     # mkdir /usr/work      WRKOBJDIR=/usr/work
   
 ##Creating DISTDIR  ##Creating DISTDIR
   
 We also want our distfiles to be stored, outside of the pkgsrc directory. Therefore we add the DISTDIR variable to /etc/mk.conf  We also want our distfiles to be stored, outside of the pkgsrc directory.
   Therefore we add the DISTDIR variable to /etc/mk.conf
   
     DISTDIR=/usr/distfiles      DISTDIR=/usr/distfiles
   
Line 116  You can update a single package using ma Line 84  You can update a single package using ma
   
     # make update      # make update
   
 #Rolling Replace  
   
 pkgtools/pkg_rolling-replace is a very nice programm to update all outdated packages on your system.  
   
 That's it. Have fun.  
   
 Since the framework is complex, there are millions of other options.  
   
 #On-line help  #On-line help
   
 Besides [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/) there is also a built-in on-line help system.  Besides [The pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/) there is also a built-in on-line help system.
Line 137  See also Line 97  See also
   
 * [[How to use pkgsrc mounted over NFS]]  * [[How to use pkgsrc mounted over NFS]]
 * [[How to use pkgsrc on AIX]]  * [[How to use pkgsrc on AIX]]
 * [[How to use pkgsrc on A/UX]]  
 * [[How to use pkgsrc on IRIX]]  * [[How to use pkgsrc on IRIX]]
 * [[How to use pkgsrc on Linux]]  * [[How to use pkgsrc on Linux]]
 * [[How] to use pkgsrc on Mac OS X]  * [[How to use pkgsrc on Mac OS X]
 * [[How to use pkgsrc on OSF1]]  * [[How to use pkgsrc on OSF1]]
 * [[How to use pkgsrc on Solaris]]  * [[How to use pkgsrc on Solaris]]

Removed from v.1.1  
changed lines
  Added in v.1.4


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb