You can build the port step by step.
1. Grab the
Makefile,
pkg-descr, and -if it exists-
pkg-plist.
2. Run
make makesum
to create a distfile. This should download the source files to
/usr/ports/distfiles, as a .tar.gz archive.
3.
make fetch
. This also downloads the source files to
/usr/ports/distfiles.
4.
make extract
extracts the source files from
/usr/ports/distfiles to
./work/.
5.
make patch
applies patches in PATCHDIR, usually located in
./work/files .
6.
make config
handles possible configuration options of a port.
7.
make build
compiles the code, and creates a binary.
8.
make stage
will copy the binary to the STAGEDIR, e.g
./work/stage/usr/local/bin.
8.
make install
finally installs the binary (the files in
pkg-plist).
All those steps are documented in
./work, e.g.
Code:
nioh@nioh:~/usr/ports/www/abc/ % ll work/
total 16
-rw-r--r-- 1 nioh nioh 0 31 Okt. 11:54 .build_done.abc._usr_local
-rw-r--r-- 1 nioh nioh 0 31 Okt. 11:45 .configure_done.abc._usr_local
-rw-r--r-- 1 nioh nioh 0 31 Okt. 11:38 .extract_done.abc._usr_local
-rw-r--r-- 1 nioh nioh 0 31 Okt. 11:51 .license_done.abc._usr_local
-rw-r--r-- 1 nioh nioh 219 31 Okt. 11:51 .license-catalog.mk
-rw-r--r-- 1 nioh nioh 81 31 Okt. 11:51 .license-report
-rw-r--r-- 1 nioh nioh 0 31 Okt. 11:51 .patch_done.abc._usr_local
-rw-r--r-- 1 nioh nioh 151 31 Okt. 12:00 .PLIST.mktmp
-rw-r--r-- 1 nioh nioh 0 31 Okt. 12:00 .stage_done.abc._usr_local
-rw-r--r-- 1 nioh nioh 97 31 Okt. 11:42 BSD2CLAUSE
drwxr-xr-x 4 nioh nioh 512 31 Okt. 11:43 abc-1.39/
E.g. if you wanted to rebuild the port, you could delete .build.done and .stage_done, then just type
make
.
The simplest way to modify the source code is to run
make extract
instead of
make install clean
. Then edit the source files in
./work/abc-1.39. Then continue the build with e.g.
make install clean
or just
make build
.
Creating patch files requires to modify the
Makefile, so it's a bit more complicated.
I hope I explained it correctly.