1. Introduction
2. Installing MacPorts
2.1. Install Xcode
2.2. Install MacPorts
2.3. Upgrade MacPorts
2.4. Uninstall MacPorts
2.5. MacPorts and the Shell
3. Using MacPorts
3.1. The port Command
3.2. Port Variants
3.3. Common Tasks
3.4. Port Binaries
4. Portfile Development
4.1. Portfile Introduction
4.2. Creating a Portfile
4.3. Example Portfiles
4.4. Port Variants
4.5. Patch Files
4.6. Local Portfile Repositories
4.7. Portfile Best Practices
4.8. MacPorts' buildbot
5. Portfile Reference
5.1. Global Keywords
5.2. Global Variables
5.3. Port Phases
5.4. Dependencies
5.5. Variants
5.6. Tcl Extensions & Useful Tcl Commands
5.7. StartupItems
5.8. Livecheck / Distcheck
5.9. PortGroups
5.10. PortGroup Introduction
5.11. PortGroup github
5.12. PortGroup gnustep
5.13. PortGroup golang
5.14. PortGroup haskell
5.15. PortGroup java
5.16. PortGroup perl5
5.17. PortGroup python
5.18. PortGroup ruby
5.19. PortGroup xcode
6. MacPorts Internals
6.1. File Hierarchy
6.2. Configuration Files
6.3. Port Images
6.4. APIs and Libs
6.5. The MacPorts Registry
6.6. Tests
7. MacPorts Project
7.1. Using Trac for Tickets
7.2. Using Git and GitHub
7.3. Contributing to MacPorts
7.4. Port Update Policies
7.5. Updating Documentation
7.6. MacPorts Membership
7.7. The PortMgr Team
8. MacPorts Guide Glossary
Glossary

5.8. Livecheck / Distcheck

Options livecheck and distcheck are especially useful for port maintainers, but others may also find this information valuable.

Livecheck checks to see if MacPorts can query the developer’s download site to determine if a newer version of the software has become available since the port was installed.

livecheck.type

Specify what kind of update check to perform.

Open source mirror site options are to use the project’s latest file release from sourceforge or the project’s date_updated XML tag for +freecode+. These options are automatically used if a matching ${master_sites} URL is used.

Generic download site options are to specify a moddate (modification date of a URL resource), a regex (retrieve the version by applying a regex to a URL resource), regexm (retrieve the version by applying a multi-line regex to a URL resource), md5 (compares the md5 sum of a URL resource) or none (no check).

  • Default: sourceforge or googlecode if the ${master_sites} is one of these, else +freecode+.
  • Values: freecodesourceforge+googlecode++moddate++regex++regexm++md5++none+
  • Examples:

    livecheck.type     regex
    livecheck.url       ${homepage}
    livecheck.regex     "Generally Available (\\d+(?:\\.\\d+)*)"
livecheck.name

Name of the project for live checks. Is only used with freecode, sourceforge

  • Default: ${name} or the sourceforge, freecode project name if it can be guessed from +${master_sites}+.
  • Example:

    livecheck.name      hibernate
livecheck.distname

Name of the file release for sourceforge checks. Use the name of the package release. You may use this keyword without livecheck.version if you replace the version part of the name with +(.*)+.

  • Default: sourceforge: ${livecheck.name}
  • Example:

    livecheck.distname  faad2.src
livecheck.version

Version of the project for a check; used for regex-based checks.

  • Default: ${version}
  • Example:

    livecheck.version   ${name}-${version}
livecheck.url

URL to query for a check.

  • Default:

    • ${homepage} or the first hit among the following sites:
    • http://freecode.com/projects-xml/${livecheck.name}/${livecheck.name}.xml
    • https://sourceforge.net/api/file/index/project-name/${livecheck.name}/rss
    • https://code.google.com/p/${livecheck.name}/downloads/list
  • Example:

    livecheck.url       https://ftp.gnu.org/gnu/bison/
livecheck.regex

Regular expression to parse the resource for regex checks. Be sure to use a regular expression grouping around the version component. Also remember that square brackets need to be quoted because Tcl otherwise interprets them as a procedure call.

  • Default: none
  • Example:

    livecheck.regex     4th-(\[a-z0-9.\]+)-unix${extract.suffix}
livecheck.md5

md5 checksum to use for an md5 comparison.

  • Default: none
  • Example:

    livecheck.md5       37e6a5b6516a680c7178b72021d3b706

    Distcheck reports whether or not the distfile(s) specified in a Portfile are still available on the developer’s download site. Examples are given below.

distcheck.check

This option can be used to disable distcheck. It specifies what kind of check should be performed on distfiles: moddate (check if the Portfile is older than the distfile) or none (no check).

  • Default: moddate
  • Example:

    distcheck.check     none