File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / targets.mdwn
Revision 1.8: download - view: text, annotated - select for diffs
Mon Feb 7 04:17:45 2011 UTC (12 years, 7 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by jym

    1: # pkgsrc targets
    2: 
    3: It was proposed that we document _all_ pkgsrc targets,
    4: but this is unreasonable and useless.
    5: Most targets are ancilliary ones;
    6: they exist because that's how [[!template id=man name=make section=1]] works.
    7: Only few of them are useful for regular work.
    8: 
    9: The following targets may be useful to invoke from keyboard:
   10: 
   11: * "depends" to build and install dependencies
   12: * "fetch" to fetch distribution file(s)
   13: * "checksum" to fetch and check distribution file(s)
   14: * "extract" to look at unmodified source
   15: * "patch" to look at initial source
   16: * "configure" to stop after configure stage
   17: * "all" or "build" to stop after build stage
   18: * "stage-install" to install under stage directory
   19: * "test" to run package's self-tests, if any exist and supported
   20: * "package" to create binary package before installing it
   21: * "replace" to change (upgrade, downgrade, or just replace) installed package in-place
   22: * "deinstall" to deinstall previous package
   23: * "package-install" to install package and build binary package
   24: * "install" to install package
   25: * "bin-install" to attempt to skip building from source and use pre-built binary package
   26: 
   27: Cleanup targets (in separate section because of importance):
   28: 
   29: * "clean-depends" to remove work directories for dependencies
   30: * "clean" to remove work directory
   31: * "distclean" to remove distribution file(s)
   32: * "package-clean" to remove binary package
   33: 
   34: The following targets are useful in development and thus may be useful for an advanced user:
   35: 
   36: * "makesum" to fetch and generate checksum for distributed file(s)
   37: * "makepatchsum" to (re)generate checksum for patches
   38: * "makedistinfo" to (re)generate "distinfo" file (creating checksums for distributed file and patches)
   39: * "mps" short for "makepatchsum"
   40: * "mdi" short for "makedistinfo"
   41: * "print-PLIST" to _attempt_ to generate correct packaging list
   42: (NB! It helps, but it _doesn't_ eliminate manual work.)
   43: 
   44: For example, package updating looks like this:
   45: 
   46: [[!template id=programlisting text="""
   47: $ su root -c "make depends clean-depends clean" # to catch new dependencies
   48: $ rm -f distinfo && su root -c "make makesum clean" && make makepatchsum
   49: $ make clean && make stage-install # build
   50: # modify patches
   51: $ make makepatchsum # and build again, or
   52: $ make makepatchsum && make clean && make patch # until all patches apply, if they failed at first
   53: $ make print-PLIST | diff -u PLIST -
   54: # modify PLIST
   55: $ rm $(make show-var VARNAME=WRKDIR)/.PLIST* # this deserves to be another target
   56: $ make stage-install
   57: # modify PLIST again or build again
   58: $ make test # just to check for regressions
   59: $ su root -c "make package deinstall bin-install" # or
   60: $ su root -c "make package replace"
   61: """]]

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