Here we list the individual Portfile components for an application that conforms to the standard configure, make, and make install steps of most open source application installs.
Modeline
This should be the first line of a Portfile. It sets the correct editing options for vim and emacs. See Port Style for more information. Its use is optional and up to the port maintainer.
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem line
This statement is required for all ports.
PortSystem 1.0
Port name
name rrdtool
Port version
version 1.2.23
Port categories
A port may belong to more than one category, but the first (primary) category should match the directory name in the ports tree where the Portfile is to reside.
categories net
Platform statement
platforms darwin
Port maintainers
A port's maintainers are the people who have agreed to take
responsibility for keeping the port up-to-date. The
maintainers
keyword lists the maintainers' GitHub
usernames or email addresses, preferably in the obfuscated form which
hides them from spambots. For more, see the full explanation of the
maintainers
keyword in the Global
Keywords section of the Portfile
Reference chapter.
maintainers @neverpanic \ jdoe \ example.org:julesverne
Port description
description Round Robin Database
Port long_description
long_description RRDtool is a system to store and display time-series \ data
A port's application homepage
homepage https://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
A port's download URLs
master_sites https://oss.oetiker.ch/rrdtool/pub/ \ ftp://ftp.pucpr.br/rrdtool/
Port checksums
The checksums specified in a Portfile are checked with the fetched tarball for security. For the best security, use rmd160 and sha256 checksum types. Checksums should also include the target file's size.
checksums rmd160 7bbfce4fecc2a8e1ca081169e70c1a298ab1b75a \ sha256 2829fcb7393bac85925090b286b1f9c3cd3fbbf8e7f35796ef4131322509aa53 \ size 1061530
To find the correct checksums for a port's distribution file, follow one of these examples:
%%
openssl dgst -rmd160 rrdtool-1.2.23.tar.gz
%%
openssl dgst -sha256 rrdtool-1.2.23.tar.gz
RIPEMD160( ... rrdtool-1.2.23.tar.gz)= 7bbfce4fecc2a8e1ca081169e70c1a298ab1b75a SHA256( ... rrdtool-1.2.23.tar.gz)= 2829fcb7393bac85925090b286b1f9c3cd3fbbf8e7f35796ef4131322509aa53
or update the version in the Portfile:
%%
sudo port edit rrdtool
and run:
%%
port -v checksum rrdtool
---> Fetching distfiles for rrdtool ---> Verifying checksums for rrdtool ---> Checksumming rrdtool-1.2.23.tar.gz Error: Checksum (rmd160) mismatch for rrdtool-1.2.23.tar.gz Portfile checksum: rrdtool-1.2.23.tar.gz rmd160 ...WRONGCHECKSUM... Distfile checksum: rrdtool-1.2.23.tar.gz rmd160 7bbfce4fecc2a8e1ca081169e70c1a298ab1b75a Error: Checksum (sha256) mismatch for rrdtool-1.2.23.tar.gz Portfile checksum: rrdtool-1.2.23.tar.gz sha256 ...WRONGCHECKSUM... Distfile checksum: rrdtool-1.2.23.tar.gz sha256 2829fcb7393bac85925090b286b1f9c3cd3fbbf8e7f35796ef4131322509aa53 The correct checksum line may be: checksums rmd160 7bbfce4fecc2a8e1ca081169e70c1a298ab1b75a \ sha256 2829fcb7393bac85925090b286b1f9c3cd3fbbf8e7f35796ef4131322509aa5 Error: Failed to checksum rrdtool: Unable to verify file checksums Error: See ...SOMEPATH.../rrdtool/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port rrdtool failed
Port dependencies
A port's dependencies are ports that must be installed before another port is installed.
depends_lib port:perl5.8 \ port:tcl \ port:zlib
Port configure arguments (optional)
configure.args --enable-perl-site-install \ --mandir=${prefix}/share/man