4.2. Getting the Original Sources
Prev | Chapter 4. Slow Porting | Next

## 4.2. Getting the Original Sources

Get the original sources (normally) as a compressed tarball (``foo`.tar.gz` or ``foo`.tar.bz2`) and copy it into `DISTDIR`. Always use mainstream sources when and where you can.

You will need to set the variable `MASTER_SITES` to reflect where the original tarball resides. You will find convenient shorthand definitions for most mainstream sites in `bsd.sites.mk`. Please use these sites—and the associated definitions—if at all possible, to help avoid the problem of having the same information repeated over again many times in the source base. As these sites tend to change over time, this becomes a maintenance nightmare for everyone involved.

If you cannot find a FTP/HTTP site that is well-connected to the net, or can only find sites that have irritatingly non-standard formats, you might want to put a copy on a reliable FTP or HTTP server that you control (e.g., your home page).

If you cannot find somewhere convenient and reliable to put the distfile we can “house” it ourselves on `ftp.FreeBSD.org`; however, this is the least-preferred solution. The distfile must be placed into `~/public_distfiles/` of someone's `freefall` account. Ask the person who commits your port to do this. This person will also set `MASTER_SITES` to `MASTER_SITE_LOCAL` and `MASTER_SITE_SUBDIR` to their `freefall` username.

If your port's distfile changes all the time without any kind of version update by the author, consider putting the distfile on your home page and listing it as the first `MASTER_SITES`. If you can, try to talk the port author out of doing this; it really does help to establish some kind of source code control. Hosting your own version will prevent users from getting checksum mismatch errors, and also reduce the workload of maintainers of our FTP site. Also, if there is only one master site for the port, it is recommended that you house a backup at your site and list it as the second `MASTER_SITES`.

If your port requires some additional `patches' that are available on the Internet, fetch them too and put them in `DISTDIR`. Do not worry if they come from a site other than where you got the main source tarball, we have a way to handle these situations (see the description of PATCHFILES below).

Prev | Up | Next
Chapter 4. Slow Porting | Home | 4.3. Modifying the Port

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.